lkml.org 
[lkml]   [2006]   [Jun]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: 2.6.17-rc6-mm1
On Tue, 20 Jun 2006 19:42:29 +0200
Arjan van de Ven <arjan@infradead.org> wrote:

> /*
> + * Lock a file handle/inode to be used as parent dir for another
> + * NOTE: both fh_lock and fh_unlock are done "by hand" in
> + * vfs.c:nfsd_rename as it needs to grab 2 i_mutex's at once
> + * so, any changes here should be reflected there.
> + */
> +static inline void
> +fh_lock_parent(struct svc_fh *fhp)
> +{
> + struct dentry *dentry = fhp->fh_dentry;
> + struct inode *inode;
> +
> + dfprintk(FILEOP, "nfsd: fh_lock(%s) locked = %d\n",
> + SVCFH_fmt(fhp), fhp->fh_locked);
> +
> + if (!fhp->fh_dentry) {
> + printk(KERN_ERR "fh_lock: fh not verified!\n");
> + return;
> + }
> + if (fhp->fh_locked) {
> + printk(KERN_WARNING "fh_lock: %s/%s already locked!\n",
> + dentry->d_parent->d_name.name, dentry->d_name.name);
> + return;
> + }
> +
> + inode = dentry->d_inode;
> + mutex_lock_nested(&inode->i_mutex, I_MUTEX_PARENT);
> + fill_pre_wcc(fhp);
> + fhp->fh_locked = 1;
> +}

yikes, five callsites, and fill_pre_wcc() is inlined too.

This is all farily intrusive.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-06-20 22:28    [W:0.064 / U:4.264 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site