Re: 2.6.17-rc6-mm1

Arjan van de Ven
2006-06-20T20:39:09Z

On Tue, 2006-06-20 at 13:24 -0700, Andrew Morton wrote:
> 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.

if this patch works for Dave I'll make one that just inlines this (and
the other one) as well; as you said.. 5+ call sites...
(and in fact there used to be an out-of-line function for this at some
point so.. it's not unheard of)