]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/reiserfs/super.c
[PATCH] fix mem_write() return value
[linux-2.6-omap-h63xx.git] / fs / reiserfs / super.c
index cae2abbc0c713933a4283f9e66f215ebd3ec57db..80fc3b32802f827d6fe1bf8e9e919321d3f9e6d0 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)
 {
@@ -511,8 +510,10 @@ static void init_once(void *foo, kmem_cache_t * cachep, unsigned long flags)
            SLAB_CTOR_CONSTRUCTOR) {
                INIT_LIST_HEAD(&ei->i_prealloc_list);
                inode_init_once(&ei->vfs_inode);
+#ifdef CONFIG_REISERFS_FS_POSIX_ACL
                ei->i_acl_access = NULL;
                ei->i_acl_default = NULL;
+#endif
        }
 }
 
@@ -531,9 +532,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 */
@@ -563,6 +562,7 @@ static void reiserfs_dirty_inode(struct inode *inode)
        reiserfs_write_unlock(inode->i_sb);
 }
 
+#ifdef CONFIG_REISERFS_FS_POSIX_ACL
 static void reiserfs_clear_inode(struct inode *inode)
 {
        struct posix_acl *acl;
@@ -577,6 +577,9 @@ static void reiserfs_clear_inode(struct inode *inode)
                posix_acl_release(acl);
        REISERFS_I(inode)->i_acl_default = NULL;
 }
+#else
+#define reiserfs_clear_inode NULL
+#endif
 
 #ifdef CONFIG_QUOTA
 static ssize_t reiserfs_quota_write(struct super_block *, int, const char *,
@@ -726,12 +729,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
@@ -960,19 +957,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') {
@@ -1938,15 +1924,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;
@@ -2204,7 +2190,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;
@@ -2249,11 +2235,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)