mirror of
https://github.com/hardkernel/linux.git
synced 2026-03-25 03:50:24 +09:00
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>
This commit is contained in:
committed by
Tim Gardner
parent
564a3c863e
commit
246239e5ec
@@ -1421,6 +1421,24 @@ void drop_collected_mounts(struct vfsmount *mnt)
|
||||
release_mounts(&umount_list);
|
||||
}
|
||||
|
||||
struct vfsmount *clone_private_mount(struct path *path)
|
||||
{
|
||||
struct mount *old_mnt = real_mount(path->mnt);
|
||||
struct mount *new_mnt;
|
||||
|
||||
if (IS_MNT_UNBINDABLE(old_mnt))
|
||||
return ERR_PTR(-EINVAL);
|
||||
|
||||
down_read(&namespace_sem);
|
||||
new_mnt = clone_mnt(old_mnt, path->dentry, CL_PRIVATE);
|
||||
up_read(&namespace_sem);
|
||||
if (!new_mnt)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
return &new_mnt->mnt;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(clone_private_mount);
|
||||
|
||||
int iterate_mounts(int (*f)(struct vfsmount *, void *), void *arg,
|
||||
struct vfsmount *root)
|
||||
{
|
||||
|
||||
@@ -68,6 +68,9 @@ extern void mnt_pin(struct vfsmount *mnt);
|
||||
extern void mnt_unpin(struct vfsmount *mnt);
|
||||
extern int __mnt_is_readonly(struct vfsmount *mnt);
|
||||
|
||||
struct path;
|
||||
extern struct vfsmount *clone_private_mount(struct path *path);
|
||||
|
||||
struct file_system_type;
|
||||
extern struct vfsmount *vfs_kern_mount(struct file_system_type *type,
|
||||
int flags, const char *name,
|
||||
|
||||
Reference in New Issue
Block a user