Re: [PATCH 4/9] vfs: introduce clone_private_mount()

From: Miklos Szeredi
Date: Thu Mar 14 2013 - 09:28:52 EST


On Wed, Mar 13, 2013 at 11:48 PM, Andrew Morton
<akpm@xxxxxxxxxxxxxxxxxxxx> wrote:
> On Wed, 13 Mar 2013 15:16:28 +0100 Miklos Szeredi <miklos@xxxxxxxxxx> wrote:
>
>> From: Miklos Szeredi <mszeredi@xxxxxxx>
>>
>> Overlayfs needs a private clone of the mount, so create a function for
>> this and export to modules.
>>
>> ...
>>
>> +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);
>
> So this one gets the _GPL?
>
> This is a new, exported-to-modules kernel interface function. And it
> is undocumented?

Following documentation added:

/**
* clone_private_mount - create a private clone of a path
*
* This creates a new vfsmount, which will be the clone of @path. The new will
* not be attached anywhere in the namespace and will be private (i.e. changes
* to the originating mount won't be propagated into this).
*
* Release with mntput().
*/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/