For vfs_get_keyed_super users.
Unified · Split
| @@ -1386,8 +1386,7 @@ static int nfsd_fill_super(struct super_block *sb, struct fs_context *fc) · 1385 unmodified lines | ||
| 1386 | 1386 | |
| 1387 | 1387 | static int nfsd_fs_get_tree(struct fs_context *fc) |
| 1388 | 1388 | { |
| 1389 | − fc->s_fs_info = get_net(fc->net_ns); | |
| 1390 | − return vfs_get_super(fc, vfs_get_keyed_super, nfsd_fill_super); | |
| 1389 | + return get_tree_keyed(fc, nfsd_fill_super, get_net(fc->net_ns)); | |
| 1391 | 1390 | } |
| 1392 | 1391 | |
| 1393 | 1392 | static void nfsd_fs_free_fc(struct fs_context *fc) |
| @@ -157,8 +157,7 @@ static int proc_get_tree(struct fs_context *fc) · 156 unmodified lines | ||
| 157 | 157 | { |
| 158 | 158 | struct proc_fs_context *ctx = fc->fs_private; |
| 159 | 159 | |
| 160 | − fc->s_fs_info = ctx->pid_ns; | |
| 161 | − return vfs_get_super(fc, vfs_get_keyed_super, proc_fill_super); | |
| 160 | + return get_tree_keyed(fc, proc_fill_super, ctx->pid_ns); | |
| 162 | 161 | } |
| 163 | 162 | |
| 164 | 163 | static void proc_fs_context_free(struct fs_context *fc) |
| @@ -1211,6 +1211,16 @@ int get_tree_single(struct fs_context *fc, · 1210 unmodified lines | ||
| 1211 | 1211 | } |
| 1212 | 1212 | EXPORT_SYMBOL(get_tree_single); |
| 1213 | 1213 | |
| 1214 | +int get_tree_keyed(struct fs_context *fc, | |
| 1215 | + int (*fill_super)(struct super_block *sb, | |
| 1216 | + struct fs_context *fc), | |
| 1217 | + void *key) | |
| 1218 | +{ | |
| 1219 | + fc->s_fs_info = key; | |
| 1220 | + return vfs_get_super(fc, vfs_get_keyed_super, fill_super); | |
| 1221 | +} | |
| 1222 | +EXPORT_SYMBOL(get_tree_keyed); | |
| 1223 | + | |
| 1214 | 1224 | #ifdef CONFIG_BLOCK |
| 1215 | 1225 | static int set_bdev_super(struct super_block *s, void *data) |
| 1216 | 1226 | { |
| @@ -136,7 +136,7 @@ extern int vfs_get_tree(struct fs_context *fc); · 135 unmodified lines | ||
| 136 | 136 | extern void put_fs_context(struct fs_context *fc); |
| 137 | 137 | |
| 138 | 138 | /* |
| 139 | − * sget() wrapper to be called from the ->get_tree() op. | |
| 139 | + * sget() wrappers to be called from the ->get_tree() op. | |
| 140 | 140 | */ |
| 141 | 141 | enum vfs_get_super_keying { |
| 142 | 142 | vfs_get_single_super, /* Only one such superblock may exist */ |
| @@ -147,12 +147,17 @@ extern int vfs_get_super(struct fs_context *fc, · 4 unmodified lines | ||
| 147 | 147 | enum vfs_get_super_keying keying, |
| 148 | 148 | int (*fill_super)(struct super_block *sb, |
| 149 | 149 | struct fs_context *fc)); |
| 150 | + | |
| 150 | 151 | extern int get_tree_nodev(struct fs_context *fc, |
| 151 | 152 | int (*fill_super)(struct super_block *sb, |
| 152 | 153 | struct fs_context *fc)); |
| 153 | 154 | extern int get_tree_single(struct fs_context *fc, |
| 154 | 155 | int (*fill_super)(struct super_block *sb, |
| 155 | 156 | struct fs_context *fc)); |
| 157 | +extern int get_tree_keyed(struct fs_context *fc, | |
| 158 | + int (*fill_super)(struct super_block *sb, | |
| 159 | + struct fs_context *fc), | |
| 160 | + void *key); | |
| 156 | 161 | |
| 157 | 162 | extern const struct file_operations fscontext_fops; |
| 158 | 163 | |
| @@ -364,8 +364,7 @@ static int mqueue_get_tree(struct fs_context *fc) · 363 unmodified lines | ||
| 364 | 364 | { |
| 365 | 365 | struct mqueue_fs_context *ctx = fc->fs_private; |
| 366 | 366 | |
| 367 | − fc->s_fs_info = ctx->ipc_ns; | |
| 368 | − return vfs_get_super(fc, vfs_get_keyed_super, mqueue_fill_super); | |
| 367 | + return get_tree_keyed(fc, mqueue_fill_super, ctx->ipc_ns); | |
| 369 | 368 | } |
| 370 | 369 | |
| 371 | 370 | static void mqueue_fs_context_free(struct fs_context *fc) |
| @@ -1416,8 +1416,7 @@ EXPORT_SYMBOL_GPL(gssd_running); · 1415 unmodified lines | ||
| 1416 | 1416 | |
| 1417 | 1417 | static int rpc_fs_get_tree(struct fs_context *fc) |
| 1418 | 1418 | { |
| 1419 | − fc->s_fs_info = get_net(fc->net_ns); | |
| 1420 | − return vfs_get_super(fc, vfs_get_keyed_super, rpc_fill_super); | |
| 1419 | + return get_tree_keyed(fc, rpc_fill_super, get_net(fc->net_ns)); | |
| 1421 | 1420 | } |
| 1422 | 1421 | |
| 1423 | 1422 | static void rpc_fs_free_fc(struct fs_context *fc) |