diff options
author | Josef Bacik <jbacik@redhat.com> | 2007-11-16 11:45:54 -0500 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2008-09-25 11:03:57 -0400 |
commit | 5103e947b9b7ac18ddb21a04ee3486e94c6504d7 (patch) | |
tree | 5d7c0c9ce1d57b988165f87c7bae304cb339589c /fs/btrfs/inode.c | |
parent | 0591fb56fb732c7bf500d1446d0bf927046d7002 (diff) |
xattr support for btrfs
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r-- | fs/btrfs/inode.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index d6d32465bc9a..37f8e0321af8 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <linux/compat.h> | 32 | #include <linux/compat.h> |
33 | #include <linux/bit_spinlock.h> | 33 | #include <linux/bit_spinlock.h> |
34 | #include <linux/version.h> | 34 | #include <linux/version.h> |
35 | #include <linux/xattr.h> | ||
35 | #include "ctree.h" | 36 | #include "ctree.h" |
36 | #include "disk-io.h" | 37 | #include "disk-io.h" |
37 | #include "transaction.h" | 38 | #include "transaction.h" |
@@ -841,6 +842,9 @@ void btrfs_delete_inode(struct inode *inode) | |||
841 | ret = btrfs_truncate_in_trans(trans, root, inode); | 842 | ret = btrfs_truncate_in_trans(trans, root, inode); |
842 | if (ret) | 843 | if (ret) |
843 | goto no_delete_lock; | 844 | goto no_delete_lock; |
845 | ret = btrfs_delete_xattrs(trans, root, inode); | ||
846 | if (ret) | ||
847 | goto no_delete_lock; | ||
844 | ret = btrfs_free_inode(trans, root, inode); | 848 | ret = btrfs_free_inode(trans, root, inode); |
845 | if (ret) | 849 | if (ret) |
846 | goto no_delete_lock; | 850 | goto no_delete_lock; |
@@ -1110,7 +1114,8 @@ static int btrfs_readdir(struct file *filp, void *dirent, filldir_t filldir) | |||
1110 | 1114 | ||
1111 | if (over) | 1115 | if (over) |
1112 | goto nopos; | 1116 | goto nopos; |
1113 | di_len = btrfs_dir_name_len(leaf, di) + sizeof(*di); | 1117 | di_len = btrfs_dir_name_len(leaf, di) + |
1118 | btrfs_dir_data_len(leaf, di) +sizeof(*di); | ||
1114 | di_cur += di_len; | 1119 | di_cur += di_len; |
1115 | di = (struct btrfs_dir_item *)((char *)di + di_len); | 1120 | di = (struct btrfs_dir_item *)((char *)di + di_len); |
1116 | } | 1121 | } |
@@ -2519,6 +2524,10 @@ static struct inode_operations btrfs_dir_inode_operations = { | |||
2519 | .symlink = btrfs_symlink, | 2524 | .symlink = btrfs_symlink, |
2520 | .setattr = btrfs_setattr, | 2525 | .setattr = btrfs_setattr, |
2521 | .mknod = btrfs_mknod, | 2526 | .mknod = btrfs_mknod, |
2527 | .setxattr = generic_setxattr, | ||
2528 | .getxattr = generic_getxattr, | ||
2529 | .listxattr = btrfs_listxattr, | ||
2530 | .removexattr = generic_removexattr, | ||
2522 | }; | 2531 | }; |
2523 | 2532 | ||
2524 | static struct inode_operations btrfs_dir_ro_inode_operations = { | 2533 | static struct inode_operations btrfs_dir_ro_inode_operations = { |
@@ -2567,6 +2576,10 @@ static struct inode_operations btrfs_file_inode_operations = { | |||
2567 | .truncate = btrfs_truncate, | 2576 | .truncate = btrfs_truncate, |
2568 | .getattr = btrfs_getattr, | 2577 | .getattr = btrfs_getattr, |
2569 | .setattr = btrfs_setattr, | 2578 | .setattr = btrfs_setattr, |
2579 | .setxattr = generic_setxattr, | ||
2580 | .getxattr = generic_getxattr, | ||
2581 | .listxattr = btrfs_listxattr, | ||
2582 | .removexattr = generic_removexattr, | ||
2570 | }; | 2583 | }; |
2571 | 2584 | ||
2572 | static struct inode_operations btrfs_special_inode_operations = { | 2585 | static struct inode_operations btrfs_special_inode_operations = { |