aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ctree.h
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2007-12-12 14:38:19 -0500
committerChris Mason <chris.mason@oracle.com>2008-09-25 11:03:58 -0400
commit3954401fa6013bb2f2c8758b903e9bffcf25b64b (patch)
treecc9e732db0466d35c7b7b42caef6e6bc994f940c /fs/btrfs/ctree.h
parentd8d5f3e16d1ae4fe9b93312e083f2c04a95520f0 (diff)
Btrfs: Add back pointers from the inode to the directory that references it
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r--fs/btrfs/ctree.h21
1 files changed, 19 insertions, 2 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index cb1b156d954e..035fa1550343 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -53,7 +53,7 @@ extern struct kmem_cache *btrfs_path_cachep;
53#define BTRFS_CSUM_SIZE 32 53#define BTRFS_CSUM_SIZE 32
54/* four bytes for CRC32 */ 54/* four bytes for CRC32 */
55#define BTRFS_CRC32_SIZE 4 55#define BTRFS_CRC32_SIZE 4
56#define BTRFS_EMPTY_DIR_SIZE 6 56#define BTRFS_EMPTY_DIR_SIZE 0
57 57
58#define BTRFS_FT_UNKNOWN 0 58#define BTRFS_FT_UNKNOWN 0
59#define BTRFS_FT_REG_FILE 1 59#define BTRFS_FT_REG_FILE 1
@@ -206,6 +206,11 @@ struct btrfs_extent_ref {
206 __le64 offset; 206 __le64 offset;
207} __attribute__ ((__packed__)); 207} __attribute__ ((__packed__));
208 208
209struct btrfs_inode_ref {
210 __le16 name_len;
211 /* name goes here */
212} __attribute__ ((__packed__));
213
209struct btrfs_inode_timespec { 214struct btrfs_inode_timespec {
210 __le64 sec; 215 __le64 sec;
211 __le32 nsec; 216 __le32 nsec;
@@ -379,7 +384,8 @@ struct btrfs_root {
379 * the FS 384 * the FS
380 */ 385 */
381#define BTRFS_INODE_ITEM_KEY 1 386#define BTRFS_INODE_ITEM_KEY 1
382#define BTRFS_XATTR_ITEM_KEY 2 387#define BTRFS_INODE_REF_KEY 2
388#define BTRFS_XATTR_ITEM_KEY 8
383/* reserve 2-15 close to the inode for later flexibility */ 389/* reserve 2-15 close to the inode for later flexibility */
384 390
385/* 391/*
@@ -486,6 +492,9 @@ BTRFS_SETGET_STACK_FUNCS(block_group_used, struct btrfs_block_group_item,
486BTRFS_SETGET_FUNCS(disk_block_group_used, struct btrfs_block_group_item, 492BTRFS_SETGET_FUNCS(disk_block_group_used, struct btrfs_block_group_item,
487 used, 64); 493 used, 64);
488 494
495/* struct btrfs_inode_ref */
496BTRFS_SETGET_FUNCS(inode_ref_name_len, struct btrfs_inode_ref, name_len, 16);
497
489/* struct btrfs_inode_item */ 498/* struct btrfs_inode_item */
490BTRFS_SETGET_FUNCS(inode_generation, struct btrfs_inode_item, generation, 64); 499BTRFS_SETGET_FUNCS(inode_generation, struct btrfs_inode_item, generation, 64);
491BTRFS_SETGET_FUNCS(inode_size, struct btrfs_inode_item, size, 64); 500BTRFS_SETGET_FUNCS(inode_size, struct btrfs_inode_item, size, 64);
@@ -1043,6 +1052,14 @@ int btrfs_find_free_objectid(struct btrfs_trans_handle *trans,
1043int btrfs_find_highest_inode(struct btrfs_root *fs_root, u64 *objectid); 1052int btrfs_find_highest_inode(struct btrfs_root *fs_root, u64 *objectid);
1044 1053
1045/* inode-item.c */ 1054/* inode-item.c */
1055int btrfs_insert_inode_ref(struct btrfs_trans_handle *trans,
1056 struct btrfs_root *root,
1057 const char *name, int name_len,
1058 u64 inode_objectid, u64 ref_objectid);
1059int btrfs_del_inode_ref(struct btrfs_trans_handle *trans,
1060 struct btrfs_root *root,
1061 const char *name, int name_len,
1062 u64 inode_objectid, u64 ref_objectid);
1046int btrfs_insert_empty_inode(struct btrfs_trans_handle *trans, 1063int btrfs_insert_empty_inode(struct btrfs_trans_handle *trans,
1047 struct btrfs_root *root, 1064 struct btrfs_root *root,
1048 struct btrfs_path *path, u64 objectid); 1065 struct btrfs_path *path, u64 objectid);