Re: 2.6.17-rc6-mm1

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

 



On Tue, 20 Jun 2006 19:42:29 +0200
Arjan van de Ven <[email protected]> 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 [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