summaryrefslogtreecommitdiffstats
path: root/fs/efivarfs/super.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-07-19 13:42:02 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2019-07-19 13:42:02 -0400
commit933a90bf4f3505f8ec83bda21a3c7d70d7c2b426 (patch)
treeca81c209000a15670e3582760ad9bae1a9cde215 /fs/efivarfs/super.c
parent5f4fc6d440d77a2cf74fe4ea56955674ac7e35e7 (diff)
parent037f11b4752f717201143a1dc5d6acf3cb71ddfa (diff)
Merge branch 'work.mount0' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull vfs mount updates from Al Viro: "The first part of mount updates. Convert filesystems to use the new mount API" * 'work.mount0' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (63 commits) mnt_init(): call shmem_init() unconditionally constify ksys_mount() string arguments don't bother with registering rootfs init_rootfs(): don't bother with init_ramfs_fs() vfs: Convert smackfs to use the new mount API vfs: Convert selinuxfs to use the new mount API vfs: Convert securityfs to use the new mount API vfs: Convert apparmorfs to use the new mount API vfs: Convert openpromfs to use the new mount API vfs: Convert xenfs to use the new mount API vfs: Convert gadgetfs to use the new mount API vfs: Convert oprofilefs to use the new mount API vfs: Convert ibmasmfs to use the new mount API vfs: Convert qib_fs/ipathfs to use the new mount API vfs: Convert efivarfs to use the new mount API vfs: Convert configfs to use the new mount API vfs: Convert binfmt_misc to use the new mount API convenience helper: get_tree_single() convenience helper get_tree_nodev() vfs: Kill sget_userns() ...
Diffstat (limited to 'fs/efivarfs/super.c')
-rw-r--r--fs/efivarfs/super.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/fs/efivarfs/super.c b/fs/efivarfs/super.c
index 5bc3c4a4c563..fa4f6447ddad 100644
--- a/fs/efivarfs/super.c
+++ b/fs/efivarfs/super.c
@@ -7,6 +7,7 @@
7#include <linux/ctype.h> 7#include <linux/ctype.h>
8#include <linux/efi.h> 8#include <linux/efi.h>
9#include <linux/fs.h> 9#include <linux/fs.h>
10#include <linux/fs_context.h>
10#include <linux/module.h> 11#include <linux/module.h>
11#include <linux/pagemap.h> 12#include <linux/pagemap.h>
12#include <linux/ucs2_string.h> 13#include <linux/ucs2_string.h>
@@ -28,8 +29,6 @@ static const struct super_operations efivarfs_ops = {
28 .evict_inode = efivarfs_evict_inode, 29 .evict_inode = efivarfs_evict_inode,
29}; 30};
30 31
31static struct super_block *efivarfs_sb;
32
33/* 32/*
34 * Compare two efivarfs file names. 33 * Compare two efivarfs file names.
35 * 34 *
@@ -188,14 +187,12 @@ static int efivarfs_destroy(struct efivar_entry *entry, void *data)
188 return 0; 187 return 0;
189} 188}
190 189
191static int efivarfs_fill_super(struct super_block *sb, void *data, int silent) 190static int efivarfs_fill_super(struct super_block *sb, struct fs_context *fc)
192{ 191{
193 struct inode *inode = NULL; 192 struct inode *inode = NULL;
194 struct dentry *root; 193 struct dentry *root;
195 int err; 194 int err;
196 195
197 efivarfs_sb = sb;
198
199 sb->s_maxbytes = MAX_LFS_FILESIZE; 196 sb->s_maxbytes = MAX_LFS_FILESIZE;
200 sb->s_blocksize = PAGE_SIZE; 197 sb->s_blocksize = PAGE_SIZE;
201 sb->s_blocksize_bits = PAGE_SHIFT; 198 sb->s_blocksize_bits = PAGE_SHIFT;
@@ -223,16 +220,24 @@ static int efivarfs_fill_super(struct super_block *sb, void *data, int silent)
223 return err; 220 return err;
224} 221}
225 222
226static struct dentry *efivarfs_mount(struct file_system_type *fs_type, 223static int efivarfs_get_tree(struct fs_context *fc)
227 int flags, const char *dev_name, void *data) 224{
225 return get_tree_single(fc, efivarfs_fill_super);
226}
227
228static const struct fs_context_operations efivarfs_context_ops = {
229 .get_tree = efivarfs_get_tree,
230};
231
232static int efivarfs_init_fs_context(struct fs_context *fc)
228{ 233{
229 return mount_single(fs_type, flags, data, efivarfs_fill_super); 234 fc->ops = &efivarfs_context_ops;
235 return 0;
230} 236}
231 237
232static void efivarfs_kill_sb(struct super_block *sb) 238static void efivarfs_kill_sb(struct super_block *sb)
233{ 239{
234 kill_litter_super(sb); 240 kill_litter_super(sb);
235 efivarfs_sb = NULL;
236 241
237 /* Remove all entries and destroy */ 242 /* Remove all entries and destroy */
238 __efivar_entry_iter(efivarfs_destroy, &efivarfs_list, NULL, NULL); 243 __efivar_entry_iter(efivarfs_destroy, &efivarfs_list, NULL, NULL);
@@ -241,7 +246,7 @@ static void efivarfs_kill_sb(struct super_block *sb)
241static struct file_system_type efivarfs_type = { 246static struct file_system_type efivarfs_type = {
242 .owner = THIS_MODULE, 247 .owner = THIS_MODULE,
243 .name = "efivarfs", 248 .name = "efivarfs",
244 .mount = efivarfs_mount, 249 .init_fs_context = efivarfs_init_fs_context,
245 .kill_sb = efivarfs_kill_sb, 250 .kill_sb = efivarfs_kill_sb,
246}; 251};
247 252