Skip to content

Commit

Permalink
Btrfs: Remove unused xattr code
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Mason <chris.mason@oracle.com>
  • Loading branch information
Josef Bacik authored and Chris Mason committed Sep 25, 2008
1 parent aec7477 commit 6099afe
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 53 deletions.
3 changes: 1 addition & 2 deletions fs/btrfs/ctree.h
Original file line number Diff line number Diff line change
Expand Up @@ -1689,8 +1689,7 @@ void btrfs_sysfs_del_super(struct btrfs_fs_info *root);

/* xattr.c */
ssize_t btrfs_listxattr(struct dentry *dentry, char *buffer, size_t size);
int btrfs_delete_xattrs(struct btrfs_trans_handle *trans,
struct btrfs_root *root, struct inode *inode);

/* super.c */
u64 btrfs_parse_size(char *str);
int btrfs_parse_options(struct btrfs_root *root, char *options);
Expand Down
51 changes: 0 additions & 51 deletions fs/btrfs/xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -378,57 +378,6 @@ ssize_t btrfs_listxattr(struct dentry *dentry, char *buffer, size_t size)
return ret;
}

/*
* delete all the xattrs associated with the inode.
*/
int btrfs_delete_xattrs(struct btrfs_trans_handle *trans,
struct btrfs_root *root, struct inode *inode)
{
struct btrfs_path *path;
struct btrfs_key key, found_key;
struct btrfs_item *item;
struct extent_buffer *leaf;
int ret;

path = btrfs_alloc_path();
if (!path)
return -ENOMEM;
path->reada = -1;
key.objectid = inode->i_ino;
btrfs_set_key_type(&key, BTRFS_XATTR_ITEM_KEY);
key.offset = (u64)-1;

while(1) {
/* look for our next xattr */
ret = btrfs_search_slot(trans, root, &key, path, -1, 1);
if (ret < 0)
goto out;
BUG_ON(ret == 0);

if (path->slots[0] == 0)
break;

path->slots[0]--;
leaf = path->nodes[0];
item = btrfs_item_nr(leaf, path->slots[0]);
btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0]);

if (found_key.objectid != key.objectid)
break;
if (btrfs_key_type(&found_key) != BTRFS_XATTR_ITEM_KEY)
break;

ret = btrfs_del_item(trans, root, path);
BUG_ON(ret);
btrfs_release_path(root, path);
}
ret = 0;
out:
btrfs_free_path(path);

return ret;
}

/*
* Handler functions
*/
Expand Down

0 comments on commit 6099afe

Please sign in to comment.