]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/jfs/super.c
Merge master.kernel.org:/pub/scm/linux/kernel/git/airlied/drm-2.6
[linux-2.6-omap-h63xx.git] / fs / jfs / super.c
index 9ff89720f93bab8bfeaee75ac656e04f6a0de3ee..4226af3ea91bc18dbdf414f63738101babca9cf8 100644 (file)
 #include <linux/parser.h>
 #include <linux/completion.h>
 #include <linux/vfs.h>
+#include <linux/mount.h>
 #include <linux/moduleparam.h>
 #include <linux/posix_acl.h>
 #include <asm/uaccess.h>
+#include <linux/seq_file.h>
 
 #include "jfs_incore.h"
 #include "jfs_filsys.h"
@@ -192,7 +194,8 @@ static void jfs_put_super(struct super_block *sb)
 
 enum {
        Opt_integrity, Opt_nointegrity, Opt_iocharset, Opt_resize,
-       Opt_resize_nosize, Opt_errors, Opt_ignore, Opt_err,
+       Opt_resize_nosize, Opt_errors, Opt_ignore, Opt_err, Opt_quota,
+       Opt_usrquota, Opt_grpquota
 };
 
 static match_table_t tokens = {
@@ -204,8 +207,8 @@ static match_table_t tokens = {
        {Opt_errors, "errors=%s"},
        {Opt_ignore, "noquota"},
        {Opt_ignore, "quota"},
-       {Opt_ignore, "usrquota"},
-       {Opt_ignore, "grpquota"},
+       {Opt_usrquota, "usrquota"},
+       {Opt_grpquota, "grpquota"},
        {Opt_err, NULL}
 };
 
@@ -293,6 +296,24 @@ static int parse_options(char *options, struct super_block *sb, s64 *newLVSize,
                        }
                        break;
                }
+
+#if defined(CONFIG_QUOTA)
+               case Opt_quota:
+               case Opt_usrquota:
+                       *flag |= JFS_USRQUOTA;
+                       break;
+               case Opt_grpquota:
+                       *flag |= JFS_GRPQUOTA;
+                       break;
+#else
+               case Opt_usrquota:
+               case Opt_grpquota:
+               case Opt_quota:
+                       printk(KERN_ERR
+                              "JFS: quota operations not supported\n");
+                       break;
+#endif
+
                default:
                        printk("jfs: Unrecognized mount option \"%s\" "
                                        " or missing value\n", p);
@@ -421,6 +442,7 @@ static int jfs_fill_super(struct super_block *sb, void *data, int silent)
        inode->i_nlink = 1;
        inode->i_size = sb->s_bdev->bd_inode->i_size;
        inode->i_mapping->a_ops = &jfs_metapage_aops;
+       insert_inode_hash(inode);
        mapping_set_gfp_mask(inode->i_mapping, GFP_NOFS);
 
        sbi->direct_inode = inode;
@@ -539,6 +561,26 @@ static int jfs_sync_fs(struct super_block *sb, int wait)
        return 0;
 }
 
+static int jfs_show_options(struct seq_file *seq, struct vfsmount *vfs)
+{
+       struct jfs_sb_info *sbi = JFS_SBI(vfs->mnt_sb);
+
+       if (sbi->flag & JFS_NOINTEGRITY)
+               seq_puts(seq, ",nointegrity");
+       else
+               seq_puts(seq, ",integrity");
+
+#if defined(CONFIG_QUOTA)
+       if (sbi->flag & JFS_USRQUOTA)
+               seq_puts(seq, ",usrquota");
+
+       if (sbi->flag & JFS_GRPQUOTA)
+               seq_puts(seq, ",grpquota");
+#endif
+
+       return 0;
+}
+
 static struct super_operations jfs_super_operations = {
        .alloc_inode    = jfs_alloc_inode,
        .destroy_inode  = jfs_destroy_inode,
@@ -552,6 +594,7 @@ static struct super_operations jfs_super_operations = {
        .unlockfs       = jfs_unlockfs,
        .statfs         = jfs_statfs,
        .remount_fs     = jfs_remount,
+       .show_options   = jfs_show_options
 };
 
 static struct export_operations jfs_export_operations = {