VServer 1.9.2 (patch-2.6.8.1-vs1.9.2.diff)
[linux-2.6.git] / fs / reiserfs / super.c
index 50e5aaf..71eaa06 100644 (file)
@@ -492,7 +492,6 @@ static void reiserfs_clear_inode (struct inode *inode)
     REISERFS_I(inode)->i_acl_default = NULL;
 }
 
-
 struct super_operations reiserfs_sops = 
 {
   .alloc_inode = reiserfs_alloc_inode,
@@ -651,7 +650,7 @@ static int reiserfs_getopt ( struct super_block * s, char ** cur, opt_desc_t * o
        reiserfs_warning (s, "head of option \"%s\" is only correct", opt->option_name);
        return -1;
     }
-       
+
     /* move to the argument, or to next option if argument is not required */
     p ++;
     
@@ -696,29 +695,30 @@ static int reiserfs_parse_options (struct super_block * s, char * options, /* st
     char * arg = NULL;
     char * pos;
     opt_desc_t opts[] = {
-       {"tails", 't', tails, 0, 0}, /* Compatibility stuff, so that -o notail for old setups still work */
-       {"notail", 0, 0, 0,  (1<<REISERFS_LARGETAIL)|(1<<REISERFS_SMALLTAIL)},
-       {"conv", 0, 0, 1<<REISERFS_CONVERT, 0},
-       {"attrs", 0, 0, 1<<REISERFS_ATTRS, 0},
-       {"noattrs", 0, 0, 0, 1<<REISERFS_ATTRS},
-       {"user_xattr", 0, 0, 1<<REISERFS_XATTRS_USER, 0},
-       {"nouser_xattr", 0, 0, 0, 1<<REISERFS_XATTRS_USER},
+       /* Compatibility stuff, so that -o notail for old setups still work */
+       {"tails",       .arg_required = 't', .values = tails},
+       {"notail",      .clrmask = (1<<REISERFS_LARGETAIL)|(1<<REISERFS_SMALLTAIL)},
+       {"conv",        .setmask = 1<<REISERFS_CONVERT},
+       {"attrs",       .setmask = 1<<REISERFS_ATTRS},
+       {"noattrs",     .clrmask = 1<<REISERFS_ATTRS},
+       {"user_xattr",  .setmask = 1<<REISERFS_XATTRS_USER},
+       {"nouser_xattr",.clrmask = 1<<REISERFS_XATTRS_USER},
+       {"tagxid",      .setmask = 1<<REISERFS_TAGXID},
 #ifdef CONFIG_REISERFS_FS_POSIX_ACL
-       {"acl", 0, 0, 1<<REISERFS_POSIXACL, 0},
-       {"noacl", 0, 0, 0, 1<<REISERFS_POSIXACL},
+       {"acl",         .setmask = 1<<REISERFS_POSIXACL},
+       {"noacl",       .clrmask = 1<<REISERFS_POSIXACL},
 #endif
-       {"nolog", 0, 0, 0, 0}, /* This is unsupported */
-       {"replayonly", 0, 0, 1<<REPLAYONLY, 0},
-       {"block-allocator", 'a', balloc, 0, 0},
-       {"data", 'd', logging_mode, 0, 0},
-       {"resize", 'r', 0, 0, 0},
-       {"jdev", 'j', 0, 0, 0},
-       {"nolargeio", 'w', 0, 0, 0},
-       {"commit", 'c', 0, 0, 0},
-       {"usrquota", 0, 0, 0, 0},
-       {"grpquota", 0, 0, 0, 0},
-       {"tagxid", 0, 0, 1<<REISERFS_TAGXID, 0},
-       {NULL, 0, 0, 0, 0}
+       {"nolog",},      /* This is unsupported */
+       {"replayonly",  .setmask = 1<<REPLAYONLY},
+       {"block-allocator", .arg_required = 'a', .values = balloc},
+       {"data",        .arg_required = 'd', .values = logging_mode},
+       {"resize",      .arg_required = 'r', .values = NULL},
+       {"jdev",        .arg_required = 'j', .values = NULL},
+       {"nolargeio",   .arg_required = 'w', .values = NULL},
+       {"commit",      .arg_required = 'c', .values = NULL},
+       {"usrquota",},
+       {"grpquota",},
+       {NULL,}
     };
        
     *blocks = 0;
@@ -736,7 +736,7 @@ static int reiserfs_parse_options (struct super_block * s, char * options, /* st
        if (c == 'r') {
            char * p;
            
-           p = 0;
+           p = NULL;
            /* "resize=NNN" */
            *blocks = simple_strtoul (arg, &p, 0);
            if (*p != '\0') {
@@ -747,7 +747,7 @@ static int reiserfs_parse_options (struct super_block * s, char * options, /* st
        }
 
        if ( c == 'c' ) {
-               char *p = 0;
+               char *p = NULL;
                unsigned long val = simple_strtoul (arg, &p, 0);
                /* commit=NNN (time in seconds) */
                if ( *p != '\0' || val >= (unsigned int)-1) {
@@ -757,7 +757,7 @@ static int reiserfs_parse_options (struct super_block * s, char * options, /* st
        }
 
        if ( c == 'w' ) {
-               char *p=0;
+               char *p=NULL;
                int val = simple_strtoul (arg, &p, 0);
 
                if ( *p != '\0') {
@@ -1346,15 +1346,17 @@ static int reiserfs_fill_super (struct super_block * s, void * data, int silent)
     memset (sbi, 0, sizeof (struct reiserfs_sb_info));
     /* Set default values for options: non-aggressive tails */
     REISERFS_SB(s)->s_mount_opt = ( 1 << REISERFS_SMALLTAIL );
-    /* default block allocator option: skip_busy */
-    REISERFS_SB(s)->s_alloc_options.bits = ( 1 << 5);
-    /* If file grew past 4 blocks, start preallocation blocks for it. */
-    REISERFS_SB(s)->s_alloc_options.preallocmin = 4;
+    /* no preallocation minimum, be smart in
+       reiserfs_file_write instead */
+    REISERFS_SB(s)->s_alloc_options.preallocmin = 0;
     /* Preallocate by 16 blocks (17-1) at once */
     REISERFS_SB(s)->s_alloc_options.preallocsize = 17;
     /* Initialize the rwsem for xattr dir */
     init_rwsem(&REISERFS_SB(s)->xattr_dir_sem);
 
+    /* setup default block allocator options */
+    reiserfs_init_alloc_options(s);
+
     jdev_name = NULL;
     if (reiserfs_parse_options (s, (char *) data, &(sbi->s_mount_opt), &blocks, &jdev_name, &commit_max_age) == 0) {
        goto error;