summaryrefslogtreecommitdiffstats
path: root/fs/befs
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-07-15 15:00:42 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2017-07-15 15:00:42 -0400
commit78dcf73421a879d22319d3889119945b85954a68 (patch)
tree26e76f3e9fdc6b40133f2158de23cfe74af9feac /fs/befs
parent93ff81859733d9697a5a0cc4707e52fb17056abb (diff)
parentfdb254db21bb4aed44a0bc7fe993e58d3848c926 (diff)
Merge branch 'work.mount' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull ->s_options removal from Al Viro: "Preparations for fsmount/fsopen stuff (coming next cycle). Everything gets moved to explicit ->show_options(), killing ->s_options off + some cosmetic bits around fs/namespace.c and friends. Basically, the stuff needed to work with fsmount series with minimum of conflicts with other work. It's not strictly required for this merge window, but it would reduce the PITA during the coming cycle, so it would be nice to have those bits and pieces out of the way" * 'work.mount' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: isofs: Fix isofs_show_options() VFS: Kill off s_options and helpers orangefs: Implement show_options 9p: Implement show_options isofs: Implement show_options afs: Implement show_options affs: Implement show_options befs: Implement show_options spufs: Implement show_options bpf: Implement show_options ramfs: Implement show_options pstore: Implement show_options omfs: Implement show_options hugetlbfs: Implement show_options VFS: Don't use save/replace_mount_options if not using generic_show_options VFS: Provide empty name qstr VFS: Make get_filesystem() return the affected filesystem VFS: Clean up whitespace in fs/namespace.c and fs/super.c Provide a function to create a NUL-terminated string from unterminated data
Diffstat (limited to 'fs/befs')
-rw-r--r--fs/befs/linuxvfs.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/fs/befs/linuxvfs.c b/fs/befs/linuxvfs.c
index 63e7c4760bfb..4a4a5a366158 100644
--- a/fs/befs/linuxvfs.c
+++ b/fs/befs/linuxvfs.c
@@ -20,6 +20,7 @@
20#include <linux/sched.h> 20#include <linux/sched.h>
21#include <linux/cred.h> 21#include <linux/cred.h>
22#include <linux/exportfs.h> 22#include <linux/exportfs.h>
23#include <linux/seq_file.h>
23 24
24#include "befs.h" 25#include "befs.h"
25#include "btree.h" 26#include "btree.h"
@@ -53,6 +54,7 @@ static int befs_nls2utf(struct super_block *sb, const char *in, int in_len,
53static void befs_put_super(struct super_block *); 54static void befs_put_super(struct super_block *);
54static int befs_remount(struct super_block *, int *, char *); 55static int befs_remount(struct super_block *, int *, char *);
55static int befs_statfs(struct dentry *, struct kstatfs *); 56static int befs_statfs(struct dentry *, struct kstatfs *);
57static int befs_show_options(struct seq_file *, struct dentry *);
56static int parse_options(char *, struct befs_mount_options *); 58static int parse_options(char *, struct befs_mount_options *);
57static struct dentry *befs_fh_to_dentry(struct super_block *sb, 59static struct dentry *befs_fh_to_dentry(struct super_block *sb,
58 struct fid *fid, int fh_len, int fh_type); 60 struct fid *fid, int fh_len, int fh_type);
@@ -66,7 +68,7 @@ static const struct super_operations befs_sops = {
66 .put_super = befs_put_super, /* uninit super */ 68 .put_super = befs_put_super, /* uninit super */
67 .statfs = befs_statfs, /* statfs */ 69 .statfs = befs_statfs, /* statfs */
68 .remount_fs = befs_remount, 70 .remount_fs = befs_remount,
69 .show_options = generic_show_options, 71 .show_options = befs_show_options,
70}; 72};
71 73
72/* slab cache for befs_inode_info objects */ 74/* slab cache for befs_inode_info objects */
@@ -771,6 +773,24 @@ parse_options(char *options, struct befs_mount_options *opts)
771 return 1; 773 return 1;
772} 774}
773 775
776static int befs_show_options(struct seq_file *m, struct dentry *root)
777{
778 struct befs_sb_info *befs_sb = BEFS_SB(root->d_sb);
779 struct befs_mount_options *opts = &befs_sb->mount_opts;
780
781 if (!uid_eq(opts->uid, GLOBAL_ROOT_UID))
782 seq_printf(m, ",uid=%u",
783 from_kuid_munged(&init_user_ns, opts->uid));
784 if (!gid_eq(opts->gid, GLOBAL_ROOT_GID))
785 seq_printf(m, ",gid=%u",
786 from_kgid_munged(&init_user_ns, opts->gid));
787 if (opts->iocharset)
788 seq_printf(m, ",charset=%s", opts->iocharset);
789 if (opts->debug)
790 seq_puts(m, ",debug");
791 return 0;
792}
793
774/* This function has the responsibiltiy of getting the 794/* This function has the responsibiltiy of getting the
775 * filesystem ready for unmounting. 795 * filesystem ready for unmounting.
776 * Basically, we free everything that we allocated in 796 * Basically, we free everything that we allocated in
@@ -804,8 +824,6 @@ befs_fill_super(struct super_block *sb, void *data, int silent)
804 const off_t x86_sb_off = 512; 824 const off_t x86_sb_off = 512;
805 int blocksize; 825 int blocksize;
806 826
807 save_mount_options(sb, data);
808
809 sb->s_fs_info = kzalloc(sizeof(*befs_sb), GFP_KERNEL); 827 sb->s_fs_info = kzalloc(sizeof(*befs_sb), GFP_KERNEL);
810 if (sb->s_fs_info == NULL) 828 if (sb->s_fs_info == NULL)
811 goto unacquire_none; 829 goto unacquire_none;