aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ctree.h
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/ctree.h
parent0591fb56fb732c7bf500d1446d0bf927046d7002 (diff)
xattr support for btrfs
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r--fs/btrfs/ctree.h22
1 files changed, 18 insertions, 4 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 030d21d7f98c..27cadae1af63 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -63,7 +63,8 @@ extern struct kmem_cache *btrfs_path_cachep;
63#define BTRFS_FT_FIFO 5 63#define BTRFS_FT_FIFO 5
64#define BTRFS_FT_SOCK 6 64#define BTRFS_FT_SOCK 6
65#define BTRFS_FT_SYMLINK 7 65#define BTRFS_FT_SYMLINK 7
66#define BTRFS_FT_MAX 8 66#define BTRFS_FT_XATTR 8
67#define BTRFS_FT_MAX 9
67 68
68/* 69/*
69 * the key defines the order in the tree, and so it also defines (optimal) 70 * the key defines the order in the tree, and so it also defines (optimal)
@@ -226,7 +227,7 @@ struct btrfs_inode_item {
226 227
227struct btrfs_dir_item { 228struct btrfs_dir_item {
228 struct btrfs_disk_key location; 229 struct btrfs_disk_key location;
229 __le16 flags; 230 __le16 data_len;
230 __le16 name_len; 231 __le16 name_len;
231 u8 type; 232 u8 type;
232} __attribute__ ((__packed__)); 233} __attribute__ ((__packed__));
@@ -367,7 +368,7 @@ struct btrfs_root {
367 * the FS 368 * the FS
368 */ 369 */
369#define BTRFS_INODE_ITEM_KEY 1 370#define BTRFS_INODE_ITEM_KEY 1
370 371#define BTRFS_XATTR_ITEM_KEY 2
371/* reserve 2-15 close to the inode for later flexibility */ 372/* reserve 2-15 close to the inode for later flexibility */
372 373
373/* 374/*
@@ -621,7 +622,7 @@ static inline void btrfs_set_item_key(struct extent_buffer *eb,
621} 622}
622 623
623/* struct btrfs_dir_item */ 624/* struct btrfs_dir_item */
624BTRFS_SETGET_FUNCS(dir_flags, struct btrfs_dir_item, flags, 16); 625BTRFS_SETGET_FUNCS(dir_data_len, struct btrfs_dir_item, data_len, 16);
625BTRFS_SETGET_FUNCS(dir_type, struct btrfs_dir_item, type, 8); 626BTRFS_SETGET_FUNCS(dir_type, struct btrfs_dir_item, type, 8);
626BTRFS_SETGET_FUNCS(dir_name_len, struct btrfs_dir_item, name_len, 16); 627BTRFS_SETGET_FUNCS(dir_name_len, struct btrfs_dir_item, name_len, 16);
627 628
@@ -962,6 +963,15 @@ int btrfs_delete_one_dir_name(struct btrfs_trans_handle *trans,
962 struct btrfs_root *root, 963 struct btrfs_root *root,
963 struct btrfs_path *path, 964 struct btrfs_path *path,
964 struct btrfs_dir_item *di); 965 struct btrfs_dir_item *di);
966int btrfs_insert_xattr_item(struct btrfs_trans_handle *trans,
967 struct btrfs_root *root, const char *name,
968 u16 name_len, const void *data, u16 data_len,
969 u64 dir);
970struct btrfs_dir_item *btrfs_lookup_xattr(struct btrfs_trans_handle *trans,
971 struct btrfs_root *root,
972 struct btrfs_path *path, u64 dir,
973 const char *name, u16 name_len,
974 int mod);
965/* inode-map.c */ 975/* inode-map.c */
966int btrfs_find_free_objectid(struct btrfs_trans_handle *trans, 976int btrfs_find_free_objectid(struct btrfs_trans_handle *trans,
967 struct btrfs_root *fs_root, 977 struct btrfs_root *fs_root,
@@ -1039,4 +1049,8 @@ int btrfs_sysfs_add_root(struct btrfs_root *root);
1039void btrfs_sysfs_del_root(struct btrfs_root *root); 1049void btrfs_sysfs_del_root(struct btrfs_root *root);
1040void btrfs_sysfs_del_super(struct btrfs_fs_info *root); 1050void btrfs_sysfs_del_super(struct btrfs_fs_info *root);
1041 1051
1052/* xattr.c */
1053ssize_t btrfs_listxattr(struct dentry *dentry, char *buffer, size_t size);
1054int btrfs_delete_xattrs(struct btrfs_trans_handle *trans,
1055 struct btrfs_root *root, struct inode *inode);
1042#endif 1056#endif