aboutsummaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@suse.cz>2011-06-01 10:57:14 +0200
committerJohn Rigby <john.rigby@linaro.org>2011-11-16 14:24:54 -0700
commit44c4e6a30f2dfe33d41453b307fe7171469f75b5 (patch)
tree2fa2014b682b1ee6b4b441fbc7ec2b7048503678 /fs
parent5559d9300ebe4ceed60d08ed36e54cc407bb430f (diff)
downloadlinux-linaro-precise-44c4e6a30f2dfe33d41453b307fe7171469f75b5.tar.gz
UBUNTU: ubuntu: overlayfs -- vfs: introduce clone_private_mount()
Overlayfs needs a private clone of the mount, so create a function for this and export to modules. Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> Signed-off-by: Andy Whitcroft <apw@canonical.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/namespace.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/fs/namespace.c b/fs/namespace.c
index 344999bccca..7cff66db2bb 100644
--- a/fs/namespace.c
+++ b/fs/namespace.c
@@ -1495,6 +1495,23 @@ void drop_collected_mounts(struct vfsmount *mnt)
release_mounts(&umount_list);
}
+struct vfsmount *clone_private_mount(struct path *path)
+{
+ struct vfsmount *mnt;
+
+ if (IS_MNT_UNBINDABLE(path->mnt))
+ return ERR_PTR(-EINVAL);
+
+ down_read(&namespace_sem);
+ mnt = clone_mnt(path->mnt, path->dentry, CL_PRIVATE);
+ up_read(&namespace_sem);
+ if (!mnt)
+ return ERR_PTR(-ENOMEM);
+
+ return mnt;
+}
+EXPORT_SYMBOL_GPL(clone_private_mount);
+
int iterate_mounts(int (*f)(struct vfsmount *, void *), void *arg,
struct vfsmount *root)
{