/* grant one or more locks (readlocks are allowed to jump the queue if the first lock in the queue is itself a readlock) */
static void afs_grant_locks(struct afs_vnode *vnode, struct file_lock *fl)
/* grant one or more locks (readlocks are allowed to jump the queue if the first lock in the queue is itself a readlock) */
static void afs_grant_locks(struct afs_vnode *vnode, struct file_lock *fl)
{
	struct file_lock *p, *_p;
	list_move_tail(&fl->fl_u.afs.link, &vnode->granted_locks);
	if (fl->fl_type == F_RDLCK) {
		list_for_each_entry_safe(p, _p, &vnode->pending_locks,
					 fl_u.afs.link) {
			if (p->fl_type == F_RDLCK) {
				p->fl_u.afs.state = AFS_LOCK_GRANTED;
				list_move_tail(&p->fl_u.afs.link,
					       &vnode->granted_locks);
				wake_up(&p->fl_wait);
			}
		}
	}
}