diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2011-12-08 21:32:45 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-01-06 23:16:54 -0500 |
commit | d861c630e99febe5ce6055290085556c5b714b06 (patch) | |
tree | 972fb0e89694197dbdbeca13920de08394abfe39 | |
parent | 64132379d509184425672e0dce1ac0a031e3f2a5 (diff) |
vfs: switch ->show_devname() to struct dentry *
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r-- | fs/nfs/super.c | 6 | ||||
-rw-r--r-- | fs/proc_namespace.c | 17 | ||||
-rw-r--r-- | include/linux/fs.h | 2 |
3 files changed, 13 insertions, 12 deletions
diff --git a/fs/nfs/super.c b/fs/nfs/super.c index dd74d3bc2eaa..6e6faa17bd38 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c | |||
@@ -263,7 +263,7 @@ static match_table_t nfs_local_lock_tokens = { | |||
263 | static void nfs_umount_begin(struct super_block *); | 263 | static void nfs_umount_begin(struct super_block *); |
264 | static int nfs_statfs(struct dentry *, struct kstatfs *); | 264 | static int nfs_statfs(struct dentry *, struct kstatfs *); |
265 | static int nfs_show_options(struct seq_file *, struct vfsmount *); | 265 | static int nfs_show_options(struct seq_file *, struct vfsmount *); |
266 | static int nfs_show_devname(struct seq_file *, struct vfsmount *); | 266 | static int nfs_show_devname(struct seq_file *, struct dentry *); |
267 | static int nfs_show_path(struct seq_file *, struct vfsmount *); | 267 | static int nfs_show_path(struct seq_file *, struct vfsmount *); |
268 | static int nfs_show_stats(struct seq_file *, struct dentry *); | 268 | static int nfs_show_stats(struct seq_file *, struct dentry *); |
269 | static struct dentry *nfs_fs_mount(struct file_system_type *, | 269 | static struct dentry *nfs_fs_mount(struct file_system_type *, |
@@ -760,14 +760,14 @@ static void show_pnfs(struct seq_file *m, struct nfs_server *server) {} | |||
760 | #endif | 760 | #endif |
761 | #endif | 761 | #endif |
762 | 762 | ||
763 | static int nfs_show_devname(struct seq_file *m, struct vfsmount *mnt) | 763 | static int nfs_show_devname(struct seq_file *m, struct dentry *root) |
764 | { | 764 | { |
765 | char *page = (char *) __get_free_page(GFP_KERNEL); | 765 | char *page = (char *) __get_free_page(GFP_KERNEL); |
766 | char *devname, *dummy; | 766 | char *devname, *dummy; |
767 | int err = 0; | 767 | int err = 0; |
768 | if (!page) | 768 | if (!page) |
769 | return -ENOMEM; | 769 | return -ENOMEM; |
770 | devname = nfs_path(&dummy, mnt->mnt_root, page, PAGE_SIZE); | 770 | devname = nfs_path(&dummy, root, page, PAGE_SIZE); |
771 | if (IS_ERR(devname)) | 771 | if (IS_ERR(devname)) |
772 | err = PTR_ERR(devname); | 772 | err = PTR_ERR(devname); |
773 | else | 773 | else |
diff --git a/fs/proc_namespace.c b/fs/proc_namespace.c index 61a09a6364ba..6d4583ddbeda 100644 --- a/fs/proc_namespace.c +++ b/fs/proc_namespace.c | |||
@@ -94,9 +94,10 @@ static int show_vfsmnt(struct seq_file *m, struct vfsmount *mnt) | |||
94 | struct mount *r = real_mount(mnt); | 94 | struct mount *r = real_mount(mnt); |
95 | int err = 0; | 95 | int err = 0; |
96 | struct path mnt_path = { .dentry = mnt->mnt_root, .mnt = mnt }; | 96 | struct path mnt_path = { .dentry = mnt->mnt_root, .mnt = mnt }; |
97 | struct super_block *sb = mnt_path.dentry->d_sb; | ||
97 | 98 | ||
98 | if (mnt->mnt_sb->s_op->show_devname) { | 99 | if (sb->s_op->show_devname) { |
99 | err = mnt->mnt_sb->s_op->show_devname(m, mnt); | 100 | err = sb->s_op->show_devname(m, mnt_path.dentry); |
100 | if (err) | 101 | if (err) |
101 | goto out; | 102 | goto out; |
102 | } else { | 103 | } else { |
@@ -105,14 +106,14 @@ static int show_vfsmnt(struct seq_file *m, struct vfsmount *mnt) | |||
105 | seq_putc(m, ' '); | 106 | seq_putc(m, ' '); |
106 | seq_path(m, &mnt_path, " \t\n\\"); | 107 | seq_path(m, &mnt_path, " \t\n\\"); |
107 | seq_putc(m, ' '); | 108 | seq_putc(m, ' '); |
108 | show_type(m, mnt->mnt_sb); | 109 | show_type(m, sb); |
109 | seq_puts(m, __mnt_is_readonly(mnt) ? " ro" : " rw"); | 110 | seq_puts(m, __mnt_is_readonly(mnt) ? " ro" : " rw"); |
110 | err = show_sb_opts(m, mnt->mnt_sb); | 111 | err = show_sb_opts(m, sb); |
111 | if (err) | 112 | if (err) |
112 | goto out; | 113 | goto out; |
113 | show_mnt_opts(m, mnt); | 114 | show_mnt_opts(m, mnt); |
114 | if (mnt->mnt_sb->s_op->show_options) | 115 | if (sb->s_op->show_options) |
115 | err = mnt->mnt_sb->s_op->show_options(m, mnt); | 116 | err = sb->s_op->show_options(m, mnt); |
116 | seq_puts(m, " 0 0\n"); | 117 | seq_puts(m, " 0 0\n"); |
117 | out: | 118 | out: |
118 | return err; | 119 | return err; |
@@ -163,7 +164,7 @@ static int show_mountinfo(struct seq_file *m, struct vfsmount *mnt) | |||
163 | show_type(m, sb); | 164 | show_type(m, sb); |
164 | seq_putc(m, ' '); | 165 | seq_putc(m, ' '); |
165 | if (sb->s_op->show_devname) | 166 | if (sb->s_op->show_devname) |
166 | err = sb->s_op->show_devname(m, mnt); | 167 | err = sb->s_op->show_devname(m, mnt->mnt_root); |
167 | else | 168 | else |
168 | mangle(m, r->mnt_devname ? r->mnt_devname : "none"); | 169 | mangle(m, r->mnt_devname ? r->mnt_devname : "none"); |
169 | if (err) | 170 | if (err) |
@@ -189,7 +190,7 @@ static int show_vfsstat(struct seq_file *m, struct vfsmount *mnt) | |||
189 | /* device */ | 190 | /* device */ |
190 | if (sb->s_op->show_devname) { | 191 | if (sb->s_op->show_devname) { |
191 | seq_puts(m, "device "); | 192 | seq_puts(m, "device "); |
192 | err = sb->s_op->show_devname(m, mnt); | 193 | err = sb->s_op->show_devname(m, mnt_path.dentry); |
193 | } else { | 194 | } else { |
194 | if (r->mnt_devname) { | 195 | if (r->mnt_devname) { |
195 | seq_puts(m, "device "); | 196 | seq_puts(m, "device "); |
diff --git a/include/linux/fs.h b/include/linux/fs.h index b2e4b6f639e4..a8dff43d1b9d 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -1673,7 +1673,7 @@ struct super_operations { | |||
1673 | void (*umount_begin) (struct super_block *); | 1673 | void (*umount_begin) (struct super_block *); |
1674 | 1674 | ||
1675 | int (*show_options)(struct seq_file *, struct vfsmount *); | 1675 | int (*show_options)(struct seq_file *, struct vfsmount *); |
1676 | int (*show_devname)(struct seq_file *, struct vfsmount *); | 1676 | int (*show_devname)(struct seq_file *, struct dentry *); |
1677 | int (*show_path)(struct seq_file *, struct vfsmount *); | 1677 | int (*show_path)(struct seq_file *, struct vfsmount *); |
1678 | int (*show_stats)(struct seq_file *, struct dentry *); | 1678 | int (*show_stats)(struct seq_file *, struct dentry *); |
1679 | #ifdef CONFIG_QUOTA | 1679 | #ifdef CONFIG_QUOTA |