Merge tag 'iommu-updates-v4.7' of git://git.kernel.org/pub/scm/linux/kernel/git/joro...
[deliverable/linux.git] / fs / btrfs / xattr.c
index 145d2b89e62dce075903cb73234fd726e8fcec2f..3bfb252206c7c678f5da79333543fa3ce0af8659 100644 (file)
@@ -237,6 +237,9 @@ int __btrfs_setxattr(struct btrfs_trans_handle *trans,
        struct btrfs_root *root = BTRFS_I(inode)->root;
        int ret;
 
+       if (btrfs_root_readonly(root))
+               return -EROFS;
+
        if (trans)
                return do_setxattr(trans, inode, name, value, size, flags);
 
@@ -369,11 +372,9 @@ err:
 }
 
 static int btrfs_xattr_handler_get(const struct xattr_handler *handler,
-                                  struct dentry *dentry, const char *name,
-                                  void *buffer, size_t size)
+                                  struct dentry *unused, struct inode *inode,
+                                  const char *name, void *buffer, size_t size)
 {
-       struct inode *inode = d_inode(dentry);
-
        name = xattr_full_name(handler, name);
        return __btrfs_getxattr(inode, name, buffer, size);
 }
@@ -434,25 +435,6 @@ const struct xattr_handler *btrfs_xattr_handlers[] = {
        NULL,
 };
 
-int btrfs_setxattr(struct dentry *dentry, const char *name, const void *value,
-                  size_t size, int flags)
-{
-       struct btrfs_root *root = BTRFS_I(d_inode(dentry))->root;
-
-       if (btrfs_root_readonly(root))
-               return -EROFS;
-       return generic_setxattr(dentry, name, value, size, flags);
-}
-
-int btrfs_removexattr(struct dentry *dentry, const char *name)
-{
-       struct btrfs_root *root = BTRFS_I(d_inode(dentry))->root;
-
-       if (btrfs_root_readonly(root))
-               return -EROFS;
-       return generic_removexattr(dentry, name);
-}
-
 static int btrfs_initxattrs(struct inode *inode,
                            const struct xattr *xattr_array, void *fs_info)
 {
This page took 0.024962 seconds and 5 git commands to generate.