History

vfs: Kill mount_ns()

Kill mount_ns() as it has been replaced by vfs_get_super() in the new mount API.

David Howells committed 7 years ago

Commit bb7b6b21 parent 96a374a2 files · +0 −41Browse files

Unified · Split

2 files
  1. fs/super.c +0 −38
  2. include/linux/fs.h +0 −3
fs/super.c+0−38
@@ -1143,44 +1143,6 @@ void kill_litter_super(struct super_block *sb) · 1142 unmodified lines
1143}1143}
1144EXPORT_SYMBOL(kill_litter_super);1144EXPORT_SYMBOL(kill_litter_super);
1145 1145
1146static int ns_test_super(struct super_block *sb, void *data)
1147{
1148 return sb->s_fs_info == data;
1149}
1150
1151static int ns_set_super(struct super_block *sb, void *data)
1152{
1153 sb->s_fs_info = data;
1154 return set_anon_super(sb, NULL);
1155}
1156
1157struct dentry *mount_ns(struct file_system_type *fs_type,
1158 int flags, void *data, void *ns, struct user_namespace *user_ns,
1159 int (*fill_super)(struct super_block *, void *, int))
1160{
1161 struct super_block *sb;
1162
1163 sb = sget_userns(fs_type, ns_test_super, ns_set_super, flags,
1164 user_ns, ns);
1165 if (IS_ERR(sb))
1166 return ERR_CAST(sb);
1167
1168 if (!sb->s_root) {
1169 int err;
1170 err = fill_super(sb, data, flags & SB_SILENT ? 1 : 0);
1171 if (err) {
1172 deactivate_locked_super(sb);
1173 return ERR_PTR(err);
1174 }
1175
1176 sb->s_flags |= SB_ACTIVE;
1177 }
1178
1179 return dget(sb->s_root);
1180}
1181
1182EXPORT_SYMBOL(mount_ns);
1183
1184int set_anon_super_fc(struct super_block *sb, struct fs_context *fc)1146int set_anon_super_fc(struct super_block *sb, struct fs_context *fc)
1185{1147{
1186 return set_anon_super(sb, NULL);1148 return set_anon_super(sb, NULL);
include/linux/fs.h+0−3
@@ -2206,9 +2206,6 @@ struct file_system_type { · 2205 unmodified lines
2206 2206
2207#define MODULE_ALIAS_FS(NAME) MODULE_ALIAS("fs-" NAME)2207#define MODULE_ALIAS_FS(NAME) MODULE_ALIAS("fs-" NAME)
2208 2208
2209extern struct dentry *mount_ns(struct file_system_type *fs_type,
2210 int flags, void *data, void *ns, struct user_namespace *user_ns,
2211 int (*fill_super)(struct super_block *, void *, int));
2212#ifdef CONFIG_BLOCK2209#ifdef CONFIG_BLOCK
2213extern struct dentry *mount_bdev(struct file_system_type *fs_type,2210extern struct dentry *mount_bdev(struct file_system_type *fs_type,
2214 int flags, const char *dev_name, void *data,2211 int flags, const char *dev_name, void *data,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t