Merge master.kernel.org:/pub/scm/linux/kernel/git/lethal/sh-2.6
[pandora-kernel.git] / fs / reiserfs / super.c
index d63da75..b40d4d6 100644 (file)
@@ -11,7 +11,6 @@
  * NO WARRANTY
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/vmalloc.h>
 #include <linux/time.h>
@@ -60,7 +59,7 @@ static int is_any_reiserfs_magic_string(struct reiserfs_super_block *rs)
 }
 
 static int reiserfs_remount(struct super_block *s, int *flags, char *data);
-static int reiserfs_statfs(struct super_block *s, struct kstatfs *buf);
+static int reiserfs_statfs(struct dentry *dentry, struct kstatfs *buf);
 
 static int reiserfs_sync_fs(struct super_block *s, int wait)
 {
@@ -521,7 +520,8 @@ static int init_inodecache(void)
        reiserfs_inode_cachep = kmem_cache_create("reiser_inode_cache",
                                                  sizeof(struct
                                                         reiserfs_inode_info),
-                                                 0, SLAB_RECLAIM_ACCOUNT,
+                                                 0, (SLAB_RECLAIM_ACCOUNT|
+                                                       SLAB_MEM_SPREAD),
                                                  init_once, NULL);
        if (reiserfs_inode_cachep == NULL)
                return -ENOMEM;
@@ -530,9 +530,7 @@ static int init_inodecache(void)
 
 static void destroy_inodecache(void)
 {
-       if (kmem_cache_destroy(reiserfs_inode_cachep))
-               reiserfs_warning(NULL,
-                                "reiserfs_inode_cache: not all structures were freed");
+       kmem_cache_destroy(reiserfs_inode_cachep);
 }
 
 /* we don't mark inodes dirty, we just log them */
@@ -684,14 +682,14 @@ static const arg_desc_t logging_mode[] = {
         (1 << REISERFS_DATA_ORDERED | 1 << REISERFS_DATA_WRITEBACK)},
        {"writeback", 1 << REISERFS_DATA_WRITEBACK,
         (1 << REISERFS_DATA_ORDERED | 1 << REISERFS_DATA_LOG)},
-       {NULL, 0}
+       {.value = NULL}
 };
 
 /* possible values for -o barrier= */
 static const arg_desc_t barrier_mode[] = {
        {"none", 1 << REISERFS_BARRIER_NONE, 1 << REISERFS_BARRIER_FLUSH},
        {"flush", 1 << REISERFS_BARRIER_FLUSH, 1 << REISERFS_BARRIER_NONE},
-       {NULL, 0}
+       {.value = NULL}
 };
 
 /* possible values for "-o block-allocator=" and bits which are to be set in
@@ -725,12 +723,6 @@ static const arg_desc_t error_actions[] = {
        {NULL, 0, 0},
 };
 
-int reiserfs_default_io_size = 128 * 1024;     /* Default recommended I/O size is 128k.
-                                                  There might be broken applications that are
-                                                  confused by this. Use nolargeio mount option
-                                                  to get usual i/o size = PAGE_SIZE.
-                                                */
-
 /* proceed only one option from a list *cur - string containing of mount options
    opts - array of options which are accepted
    opt_arg - if option is found and requires an argument and if it is specifed
@@ -889,7 +881,7 @@ static int reiserfs_parse_options(struct super_block *s, char *options,     /* strin
                {"acl",.setmask = 1 << REISERFS_UNSUPPORTED_OPT},
                {"noacl",.clrmask = 1 << REISERFS_UNSUPPORTED_OPT},
 #endif
-               {"nolog",},     /* This is unsupported */
+               {.option_name = "nolog"},
                {"replayonly",.setmask = 1 << REPLAYONLY},
                {"block-allocator",.arg_required = 'a',.values = balloc},
                {"data",.arg_required = 'd',.values = logging_mode},
@@ -907,7 +899,7 @@ static int reiserfs_parse_options(struct super_block *s, char *options,     /* strin
                {"grpjquota",.arg_required =
                 'g' | (1 << REISERFS_OPT_ALLOWEMPTY),.values = NULL},
                {"jqfmt",.arg_required = 'f',.values = NULL},
-               {NULL,}
+               {.option_name = NULL}
        };
 
        *blocks = 0;
@@ -959,19 +951,8 @@ static int reiserfs_parse_options(struct super_block *s, char *options,    /* strin
                }
 
                if (c == 'w') {
-                       char *p = NULL;
-                       int val = simple_strtoul(arg, &p, 0);
-
-                       if (*p != '\0') {
-                               reiserfs_warning(s,
-                                                "reiserfs_parse_options: non-numeric value %s for nolargeio option",
-                                                arg);
-                               return 0;
-                       }
-                       if (val)
-                               reiserfs_default_io_size = PAGE_SIZE;
-                       else
-                               reiserfs_default_io_size = 128 * 1024;
+                       reiserfs_warning(s, "reiserfs: nolargeio option is no longer supported");
+                       return 0;
                }
 
                if (c == 'j') {
@@ -1937,15 +1918,15 @@ static int reiserfs_fill_super(struct super_block *s, void *data, int silent)
        return errval;
 }
 
-static int reiserfs_statfs(struct super_block *s, struct kstatfs *buf)
+static int reiserfs_statfs(struct dentry *dentry, struct kstatfs *buf)
 {
-       struct reiserfs_super_block *rs = SB_DISK_SUPER_BLOCK(s);
+       struct reiserfs_super_block *rs = SB_DISK_SUPER_BLOCK(dentry->d_sb);
 
        buf->f_namelen = (REISERFS_MAX_NAME(s->s_blocksize));
        buf->f_bfree = sb_free_blocks(rs);
        buf->f_bavail = buf->f_bfree;
        buf->f_blocks = sb_block_count(rs) - sb_bmap_nr(rs) - 1;
-       buf->f_bsize = s->s_blocksize;
+       buf->f_bsize = dentry->d_sb->s_blocksize;
        /* changed to accommodate gcc folks. */
        buf->f_type = REISERFS_SUPER_MAGIC;
        return 0;
@@ -2203,7 +2184,7 @@ static ssize_t reiserfs_quota_write(struct super_block *sb, int type,
        size_t towrite = len;
        struct buffer_head tmp_bh, *bh;
 
-       mutex_lock(&inode->i_mutex);
+       mutex_lock_nested(&inode->i_mutex, I_MUTEX_QUOTA);
        while (towrite > 0) {
                tocopy = sb->s_blocksize - offset < towrite ?
                    sb->s_blocksize - offset : towrite;
@@ -2248,11 +2229,12 @@ static ssize_t reiserfs_quota_write(struct super_block *sb, int type,
 
 #endif
 
-static struct super_block *get_super_block(struct file_system_type *fs_type,
-                                          int flags, const char *dev_name,
-                                          void *data)
+static int get_super_block(struct file_system_type *fs_type,
+                          int flags, const char *dev_name,
+                          void *data, struct vfsmount *mnt)
 {
-       return get_sb_bdev(fs_type, flags, dev_name, data, reiserfs_fill_super);
+       return get_sb_bdev(fs_type, flags, dev_name, data, reiserfs_fill_super,
+                          mnt);
 }
 
 static int __init init_reiserfs_fs(void)