]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - fs/reiserfs/xattr.c
[PATCH] reiserfs: remove kmalloc wrapper
[karo-tx-linux.git] / fs / reiserfs / xattr.c
index f1895f0a278eb3277c353444f8dd7903e3d8d8d8..4f0db4e54517f05987a021348d07b9d80f06c88b 100644 (file)
@@ -30,6 +30,7 @@
  */
 
 #include <linux/reiserfs_fs.h>
+#include <linux/capability.h>
 #include <linux/dcache.h>
 #include <linux/namei.h>
 #include <linux/errno.h>
@@ -367,15 +368,13 @@ static int __xattr_readdir(struct file *filp, void *dirent, filldir_t filldir)
                if (d_reclen <= 32) {
                        local_buf = small_buf;
                } else {
-                       local_buf =
-                           reiserfs_kmalloc(d_reclen, GFP_NOFS, inode->i_sb);
+                       local_buf = kmalloc(d_reclen, GFP_NOFS);
                        if (!local_buf) {
                                pathrelse(&path_to_entry);
                                return -ENOMEM;
                        }
                        if (item_moved(&tmp_ih, &path_to_entry)) {
-                               reiserfs_kfree(local_buf, d_reclen,
-                                              inode->i_sb);
+                               kfree(local_buf);
 
                                /* sigh, must retry.  Do this same offset again */
                                next_pos = d_off;
@@ -398,13 +397,12 @@ static int __xattr_readdir(struct file *filp, void *dirent, filldir_t filldir)
                if (filldir(dirent, local_buf, d_reclen, d_off, d_ino,
                            DT_UNKNOWN) < 0) {
                        if (local_buf != small_buf) {
-                               reiserfs_kfree(local_buf, d_reclen,
-                                              inode->i_sb);
+                               kfree(local_buf);
                        }
                        goto end;
                }
                if (local_buf != small_buf) {
-                       reiserfs_kfree(local_buf, d_reclen, inode->i_sb);
+                       kfree(local_buf);
                }
        }                       /* while */
 
@@ -497,12 +495,6 @@ reiserfs_xattr_set(struct inode *inode, const char *name, const void *buffer,
        struct iattr newattrs;
        __u32 xahash = 0;
 
-       if (IS_RDONLY(inode))
-               return -EROFS;
-
-       if (IS_IMMUTABLE(inode) || IS_APPEND(inode))
-               return -EPERM;
-
        if (get_inode_sd_version(inode) == STAT_DATA_V1)
                return -EOPNOTSUPP;
 
@@ -758,9 +750,6 @@ int reiserfs_xattr_del(struct inode *inode, const char *name)
        struct dentry *dir;
        int err;
 
-       if (IS_RDONLY(inode))
-               return -EROFS;
-
        dir = open_xa_dir(inode, FL_READONLY);
        if (IS_ERR(dir)) {
                err = PTR_ERR(dir);
@@ -984,12 +973,6 @@ reiserfs_setxattr(struct dentry *dentry, const char *name, const void *value,
            get_inode_sd_version(dentry->d_inode) == STAT_DATA_V1)
                return -EOPNOTSUPP;
 
-       if (IS_RDONLY(dentry->d_inode))
-               return -EROFS;
-
-       if (IS_IMMUTABLE(dentry->d_inode) || IS_APPEND(dentry->d_inode))
-               return -EROFS;
-
        reiserfs_write_lock_xattr_i(dentry->d_inode);
        lock = !has_xattr_dir(dentry->d_inode);
        if (lock)
@@ -1019,12 +1002,6 @@ int reiserfs_removexattr(struct dentry *dentry, const char *name)
            get_inode_sd_version(dentry->d_inode) == STAT_DATA_V1)
                return -EOPNOTSUPP;
 
-       if (IS_RDONLY(dentry->d_inode))
-               return -EROFS;
-
-       if (IS_IMMUTABLE(dentry->d_inode) || IS_APPEND(dentry->d_inode))
-               return -EPERM;
-
        reiserfs_write_lock_xattr_i(dentry->d_inode);
        reiserfs_read_lock_xattrs(dentry->d_sb);