vfs: switch ->show_devname() to struct dentry *
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
@@ -263,7 +263,7 @@ static match_table_t nfs_local_lock_tokens = {
|
|||||||
static void nfs_umount_begin(struct super_block *);
|
static void nfs_umount_begin(struct super_block *);
|
||||||
static int nfs_statfs(struct dentry *, struct kstatfs *);
|
static int nfs_statfs(struct dentry *, struct kstatfs *);
|
||||||
static int nfs_show_options(struct seq_file *, struct vfsmount *);
|
static int nfs_show_options(struct seq_file *, struct vfsmount *);
|
||||||
static int nfs_show_devname(struct seq_file *, struct vfsmount *);
|
static int nfs_show_devname(struct seq_file *, struct dentry *);
|
||||||
static int nfs_show_path(struct seq_file *, struct vfsmount *);
|
static int nfs_show_path(struct seq_file *, struct vfsmount *);
|
||||||
static int nfs_show_stats(struct seq_file *, struct dentry *);
|
static int nfs_show_stats(struct seq_file *, struct dentry *);
|
||||||
static struct dentry *nfs_fs_mount(struct file_system_type *,
|
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) {}
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static int nfs_show_devname(struct seq_file *m, struct vfsmount *mnt)
|
static int nfs_show_devname(struct seq_file *m, struct dentry *root)
|
||||||
{
|
{
|
||||||
char *page = (char *) __get_free_page(GFP_KERNEL);
|
char *page = (char *) __get_free_page(GFP_KERNEL);
|
||||||
char *devname, *dummy;
|
char *devname, *dummy;
|
||||||
int err = 0;
|
int err = 0;
|
||||||
if (!page)
|
if (!page)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
devname = nfs_path(&dummy, mnt->mnt_root, page, PAGE_SIZE);
|
devname = nfs_path(&dummy, root, page, PAGE_SIZE);
|
||||||
if (IS_ERR(devname))
|
if (IS_ERR(devname))
|
||||||
err = PTR_ERR(devname);
|
err = PTR_ERR(devname);
|
||||||
else
|
else
|
||||||
|
@@ -94,9 +94,10 @@ static int show_vfsmnt(struct seq_file *m, struct vfsmount *mnt)
|
|||||||
struct mount *r = real_mount(mnt);
|
struct mount *r = real_mount(mnt);
|
||||||
int err = 0;
|
int err = 0;
|
||||||
struct path mnt_path = { .dentry = mnt->mnt_root, .mnt = mnt };
|
struct path mnt_path = { .dentry = mnt->mnt_root, .mnt = mnt };
|
||||||
|
struct super_block *sb = mnt_path.dentry->d_sb;
|
||||||
|
|
||||||
if (mnt->mnt_sb->s_op->show_devname) {
|
if (sb->s_op->show_devname) {
|
||||||
err = mnt->mnt_sb->s_op->show_devname(m, mnt);
|
err = sb->s_op->show_devname(m, mnt_path.dentry);
|
||||||
if (err)
|
if (err)
|
||||||
goto out;
|
goto out;
|
||||||
} else {
|
} else {
|
||||||
@@ -105,14 +106,14 @@ static int show_vfsmnt(struct seq_file *m, struct vfsmount *mnt)
|
|||||||
seq_putc(m, ' ');
|
seq_putc(m, ' ');
|
||||||
seq_path(m, &mnt_path, " \t\n\\");
|
seq_path(m, &mnt_path, " \t\n\\");
|
||||||
seq_putc(m, ' ');
|
seq_putc(m, ' ');
|
||||||
show_type(m, mnt->mnt_sb);
|
show_type(m, sb);
|
||||||
seq_puts(m, __mnt_is_readonly(mnt) ? " ro" : " rw");
|
seq_puts(m, __mnt_is_readonly(mnt) ? " ro" : " rw");
|
||||||
err = show_sb_opts(m, mnt->mnt_sb);
|
err = show_sb_opts(m, sb);
|
||||||
if (err)
|
if (err)
|
||||||
goto out;
|
goto out;
|
||||||
show_mnt_opts(m, mnt);
|
show_mnt_opts(m, mnt);
|
||||||
if (mnt->mnt_sb->s_op->show_options)
|
if (sb->s_op->show_options)
|
||||||
err = mnt->mnt_sb->s_op->show_options(m, mnt);
|
err = sb->s_op->show_options(m, mnt);
|
||||||
seq_puts(m, " 0 0\n");
|
seq_puts(m, " 0 0\n");
|
||||||
out:
|
out:
|
||||||
return err;
|
return err;
|
||||||
@@ -163,7 +164,7 @@ static int show_mountinfo(struct seq_file *m, struct vfsmount *mnt)
|
|||||||
show_type(m, sb);
|
show_type(m, sb);
|
||||||
seq_putc(m, ' ');
|
seq_putc(m, ' ');
|
||||||
if (sb->s_op->show_devname)
|
if (sb->s_op->show_devname)
|
||||||
err = sb->s_op->show_devname(m, mnt);
|
err = sb->s_op->show_devname(m, mnt->mnt_root);
|
||||||
else
|
else
|
||||||
mangle(m, r->mnt_devname ? r->mnt_devname : "none");
|
mangle(m, r->mnt_devname ? r->mnt_devname : "none");
|
||||||
if (err)
|
if (err)
|
||||||
@@ -189,7 +190,7 @@ static int show_vfsstat(struct seq_file *m, struct vfsmount *mnt)
|
|||||||
/* device */
|
/* device */
|
||||||
if (sb->s_op->show_devname) {
|
if (sb->s_op->show_devname) {
|
||||||
seq_puts(m, "device ");
|
seq_puts(m, "device ");
|
||||||
err = sb->s_op->show_devname(m, mnt);
|
err = sb->s_op->show_devname(m, mnt_path.dentry);
|
||||||
} else {
|
} else {
|
||||||
if (r->mnt_devname) {
|
if (r->mnt_devname) {
|
||||||
seq_puts(m, "device ");
|
seq_puts(m, "device ");
|
||||||
|
@@ -1673,7 +1673,7 @@ struct super_operations {
|
|||||||
void (*umount_begin) (struct super_block *);
|
void (*umount_begin) (struct super_block *);
|
||||||
|
|
||||||
int (*show_options)(struct seq_file *, struct vfsmount *);
|
int (*show_options)(struct seq_file *, struct vfsmount *);
|
||||||
int (*show_devname)(struct seq_file *, struct vfsmount *);
|
int (*show_devname)(struct seq_file *, struct dentry *);
|
||||||
int (*show_path)(struct seq_file *, struct vfsmount *);
|
int (*show_path)(struct seq_file *, struct vfsmount *);
|
||||||
int (*show_stats)(struct seq_file *, struct dentry *);
|
int (*show_stats)(struct seq_file *, struct dentry *);
|
||||||
#ifdef CONFIG_QUOTA
|
#ifdef CONFIG_QUOTA
|
||||||
|
Reference in New Issue
Block a user