Re: [autofs] [PATCH 04/38] autofs4: Save autofs trigger's vfsmount in super block info

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

 



Ian Kent:
> +static vfsmount *autofs4_find_vfsmount(struct path *parent, struct dentry *root)
> +{
> +	struct vfsmount *mnt = NULL;
> +	struct dentry *child;
> +
> +	spin_lock(&dcache_lock);
> +	list_for_each_entry(child, &dentry->d_subdirs, d_u.d_child) {

dentry->d_subdirs?
parent->dentry->...?

Or how about iterate_mounts() instead of loop over dentries?
For example (just a example),

struct args {
	/* input */
	struct dentry *root;

	/* output */
	struct vfsmount *mnt;
};

static int compare_mnt(struct vfsmount *mnt, void *arg)
{
	struct args *a = arg;

	if (mnt->mnt_root != a->root)
		return 0;
	a->mnt = mntget(mnt);
	return 1;
}

struct vfsmount *autofs4_find_vfsmount(struct dentry *root)
{
	int err;
	struct args args = {
		.root = root
	};

	err = iterate_mounts(compare_mnt, &args, current->nsproxy->mnt_ns);
}


J. R. Okajima
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux