]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - fs/afs/super.c
Merge branch 'work.mount' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
[karo-tx-linux.git] / fs / afs / super.c
index 67680c2d96cf0ebdbad87a1c8b87e50339b8a171..689173c0a682fd2861a6836bc097e49e15696abc 100644 (file)
@@ -37,6 +37,8 @@ static void afs_kill_super(struct super_block *sb);
 static struct inode *afs_alloc_inode(struct super_block *sb);
 static void afs_destroy_inode(struct inode *inode);
 static int afs_statfs(struct dentry *dentry, struct kstatfs *buf);
+static int afs_show_devname(struct seq_file *m, struct dentry *root);
+static int afs_show_options(struct seq_file *m, struct dentry *root);
 
 struct file_system_type afs_fs_type = {
        .owner          = THIS_MODULE,
@@ -53,7 +55,8 @@ static const struct super_operations afs_super_ops = {
        .drop_inode     = afs_drop_inode,
        .destroy_inode  = afs_destroy_inode,
        .evict_inode    = afs_evict_inode,
-       .show_options   = generic_show_options,
+       .show_devname   = afs_show_devname,
+       .show_options   = afs_show_options,
 };
 
 static struct kmem_cache *afs_inode_cachep;
@@ -135,6 +138,45 @@ void __exit afs_fs_exit(void)
        _leave("");
 }
 
+/*
+ * Display the mount device name in /proc/mounts.
+ */
+static int afs_show_devname(struct seq_file *m, struct dentry *root)
+{
+       struct afs_super_info *as = root->d_sb->s_fs_info;
+       struct afs_volume *volume = as->volume;
+       struct afs_cell *cell = volume->cell;
+       const char *suf = "";
+       char pref = '%';
+
+       switch (volume->type) {
+       case AFSVL_RWVOL:
+               break;
+       case AFSVL_ROVOL:
+               pref = '#';
+               if (volume->type_force)
+                       suf = ".readonly";
+               break;
+       case AFSVL_BACKVOL:
+               pref = '#';
+               suf = ".backup";
+               break;
+       }
+
+       seq_printf(m, "%c%s:%s%s", pref, cell->name, volume->vlocation->vldb.name, suf);
+       return 0;
+}
+
+/*
+ * Display the mount options in /proc/mounts.
+ */
+static int afs_show_options(struct seq_file *m, struct dentry *root)
+{
+       if (test_bit(AFS_VNODE_AUTOCELL, &AFS_FS_I(d_inode(root))->flags))
+               seq_puts(m, "autocell");
+       return 0;
+}
+
 /*
  * parse the mount options
  * - this function has been shamelessly adapted from the ext3 fs which
@@ -427,7 +469,6 @@ static struct dentry *afs_mount(struct file_system_type *fs_type,
                        deactivate_locked_super(sb);
                        goto error;
                }
-               save_mount_options(sb, new_opts);
                sb->s_flags |= MS_ACTIVE;
        } else {
                _debug("reuse");