Re: 2.6.17-rc6-mm1

Andrew Morton
2006-06-20T20:25:07Z

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.