Skip to content

Commit a66ca41

Browse files
dhowellsAl Viro
authored andcommitted
spufs: Implement show_options
Implement the show_options superblock op for spufs as part of a bid to get rid of s_options and generic_show_options() to make it easier to implement a context-based mount where the mount options can be passed individually over a file descriptor. Signed-off-by: David Howells <[email protected]> cc: Jeremy Kerr <[email protected]> cc: [email protected] Signed-off-by: Al Viro <[email protected]>
1 parent 4cc7c18 commit a66ca41

File tree

1 file changed

+19
-3
lines changed
  • arch/powerpc/platforms/cell/spufs

1 file changed

+19
-3
lines changed

arch/powerpc/platforms/cell/spufs/inode.c

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,24 @@ static const match_table_t spufs_tokens = {
605605
{ Opt_err, NULL },
606606
};
607607

608+
static int spufs_show_options(struct seq_file *m, struct dentry *root)
609+
{
610+
struct spufs_sb_info *sbi = spufs_get_sb_info(root->d_sb);
611+
struct inode *inode = root->d_inode;
612+
613+
if (!uid_eq(inode->i_uid, GLOBAL_ROOT_UID))
614+
seq_printf(m, ",uid=%u",
615+
from_kuid_munged(&init_user_ns, inode->i_uid));
616+
if (!gid_eq(inode->i_gid, GLOBAL_ROOT_GID))
617+
seq_printf(m, ",gid=%u",
618+
from_kgid_munged(&init_user_ns, inode->i_gid));
619+
if ((inode->i_mode & S_IALLUGO) != 0775)
620+
seq_printf(m, ",mode=%o", inode->i_mode);
621+
if (sbi->debug)
622+
seq_puts(m, ",debug");
623+
return 0;
624+
}
625+
608626
static int
609627
spufs_parse_options(struct super_block *sb, char *options, struct inode *root)
610628
{
@@ -724,11 +742,9 @@ spufs_fill_super(struct super_block *sb, void *data, int silent)
724742
.destroy_inode = spufs_destroy_inode,
725743
.statfs = simple_statfs,
726744
.evict_inode = spufs_evict_inode,
727-
.show_options = generic_show_options,
745+
.show_options = spufs_show_options,
728746
};
729747

730-
save_mount_options(sb, data);
731-
732748
info = kzalloc(sizeof(*info), GFP_KERNEL);
733749
if (!info)
734750
return -ENOMEM;

0 commit comments

Comments
 (0)