diff options
Diffstat (limited to 'fs/kernfs/mount.c')
-rw-r--r-- | fs/kernfs/mount.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/kernfs/mount.c b/fs/kernfs/mount.c index 405279b5517b..6a5f04ac8704 100644 --- a/fs/kernfs/mount.c +++ b/fs/kernfs/mount.c | |||
@@ -131,6 +131,7 @@ const void *kernfs_super_ns(struct super_block *sb) | |||
131 | * @fs_type: file_system_type of the fs being mounted | 131 | * @fs_type: file_system_type of the fs being mounted |
132 | * @flags: mount flags specified for the mount | 132 | * @flags: mount flags specified for the mount |
133 | * @root: kernfs_root of the hierarchy being mounted | 133 | * @root: kernfs_root of the hierarchy being mounted |
134 | * @new_sb_created: tell the caller if we allocated a new superblock | ||
134 | * @ns: optional namespace tag of the mount | 135 | * @ns: optional namespace tag of the mount |
135 | * | 136 | * |
136 | * This is to be called from each kernfs user's file_system_type->mount() | 137 | * This is to be called from each kernfs user's file_system_type->mount() |
@@ -141,7 +142,8 @@ const void *kernfs_super_ns(struct super_block *sb) | |||
141 | * The return value can be passed to the vfs layer verbatim. | 142 | * The return value can be passed to the vfs layer verbatim. |
142 | */ | 143 | */ |
143 | struct dentry *kernfs_mount_ns(struct file_system_type *fs_type, int flags, | 144 | struct dentry *kernfs_mount_ns(struct file_system_type *fs_type, int flags, |
144 | struct kernfs_root *root, const void *ns) | 145 | struct kernfs_root *root, bool *new_sb_created, |
146 | const void *ns) | ||
145 | { | 147 | { |
146 | struct super_block *sb; | 148 | struct super_block *sb; |
147 | struct kernfs_super_info *info; | 149 | struct kernfs_super_info *info; |
@@ -159,6 +161,10 @@ struct dentry *kernfs_mount_ns(struct file_system_type *fs_type, int flags, | |||
159 | kfree(info); | 161 | kfree(info); |
160 | if (IS_ERR(sb)) | 162 | if (IS_ERR(sb)) |
161 | return ERR_CAST(sb); | 163 | return ERR_CAST(sb); |
164 | |||
165 | if (new_sb_created) | ||
166 | *new_sb_created = !sb->s_root; | ||
167 | |||
162 | if (!sb->s_root) { | 168 | if (!sb->s_root) { |
163 | error = kernfs_fill_super(sb); | 169 | error = kernfs_fill_super(sb); |
164 | if (error) { | 170 | if (error) { |