summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/inode.c
diff options
context:
space:
mode:
authorJosef Bacik <jbacik@redhat.com>2007-11-16 11:45:54 -0500
committerChris Mason <chris.mason@oracle.com>2008-09-25 11:03:57 -0400
commit5103e947b9b7ac18ddb21a04ee3486e94c6504d7 (patch)
tree5d7c0c9ce1d57b988165f87c7bae304cb339589c /fs/btrfs/inode.c
parent0591fb56fb732c7bf500d1446d0bf927046d7002 (diff)
downloadop-kernel-dev-5103e947b9b7ac18ddb21a04ee3486e94c6504d7.zip
op-kernel-dev-5103e947b9b7ac18ddb21a04ee3486e94c6504d7.tar.gz
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.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index d6d3246..37f8e03 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -32,6 +32,7 @@
#include <linux/compat.h>
#include <linux/bit_spinlock.h>
#include <linux/version.h>
+#include <linux/xattr.h>
#include "ctree.h"
#include "disk-io.h"
#include "transaction.h"
@@ -841,6 +842,9 @@ void btrfs_delete_inode(struct inode *inode)
ret = btrfs_truncate_in_trans(trans, root, inode);
if (ret)
goto no_delete_lock;
+ ret = btrfs_delete_xattrs(trans, root, inode);
+ if (ret)
+ goto no_delete_lock;
ret = btrfs_free_inode(trans, root, inode);
if (ret)
goto no_delete_lock;
@@ -1110,7 +1114,8 @@ static int btrfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
if (over)
goto nopos;
- di_len = btrfs_dir_name_len(leaf, di) + sizeof(*di);
+ di_len = btrfs_dir_name_len(leaf, di) +
+ btrfs_dir_data_len(leaf, di) +sizeof(*di);
di_cur += di_len;
di = (struct btrfs_dir_item *)((char *)di + di_len);
}
@@ -2519,6 +2524,10 @@ static struct inode_operations btrfs_dir_inode_operations = {
.symlink = btrfs_symlink,
.setattr = btrfs_setattr,
.mknod = btrfs_mknod,
+ .setxattr = generic_setxattr,
+ .getxattr = generic_getxattr,
+ .listxattr = btrfs_listxattr,
+ .removexattr = generic_removexattr,
};
static struct inode_operations btrfs_dir_ro_inode_operations = {
@@ -2567,6 +2576,10 @@ static struct inode_operations btrfs_file_inode_operations = {
.truncate = btrfs_truncate,
.getattr = btrfs_getattr,
.setattr = btrfs_setattr,
+ .setxattr = generic_setxattr,
+ .getxattr = generic_getxattr,
+ .listxattr = btrfs_listxattr,
+ .removexattr = generic_removexattr,
};
static struct inode_operations btrfs_special_inode_operations = {
OpenPOWER on IntegriCloud