Re: [PATCH] AFS: Implement file locking [try #2]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



One more vague question I had while skimming the previous version--

On Tue, May 29, 2007 at 03:54:27PM +0100, David Howells wrote:
> +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);
> +			}
> +		}
> +	}
> +}

--without having tried to understand how they're actually used, these
data structures (like the pending_locks and granted_locks lists) seem to
duplicate stuff that's already kept in fs/locks.c.  Is there a reason
they're required?

--b.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux