diff options
-rw-r--r-- | fs/efivarfs/super.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/fs/efivarfs/super.c b/fs/efivarfs/super.c index 5b68e4294faa..124f1aa9ab03 100644 --- a/fs/efivarfs/super.c +++ b/fs/efivarfs/super.c | |||
@@ -10,6 +10,7 @@ | |||
10 | #include <linux/ctype.h> | 10 | #include <linux/ctype.h> |
11 | #include <linux/efi.h> | 11 | #include <linux/efi.h> |
12 | #include <linux/fs.h> | 12 | #include <linux/fs.h> |
13 | #include <linux/fs_context.h> | ||
13 | #include <linux/module.h> | 14 | #include <linux/module.h> |
14 | #include <linux/pagemap.h> | 15 | #include <linux/pagemap.h> |
15 | #include <linux/ucs2_string.h> | 16 | #include <linux/ucs2_string.h> |
@@ -31,8 +32,6 @@ static const struct super_operations efivarfs_ops = { | |||
31 | .evict_inode = efivarfs_evict_inode, | 32 | .evict_inode = efivarfs_evict_inode, |
32 | }; | 33 | }; |
33 | 34 | ||
34 | static struct super_block *efivarfs_sb; | ||
35 | |||
36 | /* | 35 | /* |
37 | * Compare two efivarfs file names. | 36 | * Compare two efivarfs file names. |
38 | * | 37 | * |
@@ -191,14 +190,12 @@ static int efivarfs_destroy(struct efivar_entry *entry, void *data) | |||
191 | return 0; | 190 | return 0; |
192 | } | 191 | } |
193 | 192 | ||
194 | static int efivarfs_fill_super(struct super_block *sb, void *data, int silent) | 193 | static int efivarfs_fill_super(struct super_block *sb, struct fs_context *fc) |
195 | { | 194 | { |
196 | struct inode *inode = NULL; | 195 | struct inode *inode = NULL; |
197 | struct dentry *root; | 196 | struct dentry *root; |
198 | int err; | 197 | int err; |
199 | 198 | ||
200 | efivarfs_sb = sb; | ||
201 | |||
202 | sb->s_maxbytes = MAX_LFS_FILESIZE; | 199 | sb->s_maxbytes = MAX_LFS_FILESIZE; |
203 | sb->s_blocksize = PAGE_SIZE; | 200 | sb->s_blocksize = PAGE_SIZE; |
204 | sb->s_blocksize_bits = PAGE_SHIFT; | 201 | sb->s_blocksize_bits = PAGE_SHIFT; |
@@ -226,16 +223,24 @@ static int efivarfs_fill_super(struct super_block *sb, void *data, int silent) | |||
226 | return err; | 223 | return err; |
227 | } | 224 | } |
228 | 225 | ||
229 | static struct dentry *efivarfs_mount(struct file_system_type *fs_type, | 226 | static int efivarfs_get_tree(struct fs_context *fc) |
230 | int flags, const char *dev_name, void *data) | 227 | { |
228 | return get_tree_single(fc, efivarfs_fill_super); | ||
229 | } | ||
230 | |||
231 | static const struct fs_context_operations efivarfs_context_ops = { | ||
232 | .get_tree = efivarfs_get_tree, | ||
233 | }; | ||
234 | |||
235 | static int efivarfs_init_fs_context(struct fs_context *fc) | ||
231 | { | 236 | { |
232 | return mount_single(fs_type, flags, data, efivarfs_fill_super); | 237 | fc->ops = &efivarfs_context_ops; |
238 | return 0; | ||
233 | } | 239 | } |
234 | 240 | ||
235 | static void efivarfs_kill_sb(struct super_block *sb) | 241 | static void efivarfs_kill_sb(struct super_block *sb) |
236 | { | 242 | { |
237 | kill_litter_super(sb); | 243 | kill_litter_super(sb); |
238 | efivarfs_sb = NULL; | ||
239 | 244 | ||
240 | /* Remove all entries and destroy */ | 245 | /* Remove all entries and destroy */ |
241 | __efivar_entry_iter(efivarfs_destroy, &efivarfs_list, NULL, NULL); | 246 | __efivar_entry_iter(efivarfs_destroy, &efivarfs_list, NULL, NULL); |
@@ -244,7 +249,7 @@ static void efivarfs_kill_sb(struct super_block *sb) | |||
244 | static struct file_system_type efivarfs_type = { | 249 | static struct file_system_type efivarfs_type = { |
245 | .owner = THIS_MODULE, | 250 | .owner = THIS_MODULE, |
246 | .name = "efivarfs", | 251 | .name = "efivarfs", |
247 | .mount = efivarfs_mount, | 252 | .init_fs_context = efivarfs_init_fs_context, |
248 | .kill_sb = efivarfs_kill_sb, | 253 | .kill_sb = efivarfs_kill_sb, |
249 | }; | 254 | }; |
250 | 255 | ||