diff options
author | Chris Mason <chris.mason@oracle.com> | 2007-04-19 15:36:27 -0400 |
---|---|---|
committer | David Woodhouse <dwmw2@hera.kernel.org> | 2007-04-19 15:36:27 -0400 |
commit | 7e38180e207c8707691c12395e990a5d583c5e71 (patch) | |
tree | 50fc0973873f7bc9455a1faf536a5a5b4681fe56 /fs/btrfs/ctree.h | |
parent | 236454dfffb64a95ee01c50a215153f5de61c475 (diff) |
Btrfs: directory inode index is back
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r-- | fs/btrfs/ctree.h | 58 |
1 files changed, 17 insertions, 41 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index f1800008be34..d628a3b9441c 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h | |||
@@ -185,11 +185,6 @@ struct btrfs_inode_item { | |||
185 | struct btrfs_inode_timespec otime; | 185 | struct btrfs_inode_timespec otime; |
186 | } __attribute__ ((__packed__)); | 186 | } __attribute__ ((__packed__)); |
187 | 187 | ||
188 | /* inline data is just a blob of bytes */ | ||
189 | struct btrfs_inline_data_item { | ||
190 | u8 data; | ||
191 | } __attribute__ ((__packed__)); | ||
192 | |||
193 | struct btrfs_dir_item { | 188 | struct btrfs_dir_item { |
194 | struct btrfs_disk_key location; | 189 | struct btrfs_disk_key location; |
195 | __le16 flags; | 190 | __le16 flags; |
@@ -293,9 +288,6 @@ struct btrfs_root { | |||
293 | #define BTRFS_KEY_TYPE_MASK (((u32)BTRFS_KEY_TYPE_MAX - 1) << \ | 288 | #define BTRFS_KEY_TYPE_MASK (((u32)BTRFS_KEY_TYPE_MAX - 1) << \ |
294 | BTRFS_KEY_TYPE_SHIFT) | 289 | BTRFS_KEY_TYPE_SHIFT) |
295 | 290 | ||
296 | #define BTRFS_KEY_OVERFLOW_MAX 128 | ||
297 | #define BTRFS_KEY_OVERFLOW_MASK ((u32)BTRFS_KEY_OVERFLOW_MAX - 1) | ||
298 | |||
299 | /* | 291 | /* |
300 | * inode items have the data typically returned from stat and store other | 292 | * inode items have the data typically returned from stat and store other |
301 | * info about object characteristics. There is one for every file and dir in | 293 | * info about object characteristics. There is one for every file and dir in |
@@ -621,31 +613,6 @@ static inline void btrfs_set_key_type(struct btrfs_key *key, u32 val) | |||
621 | key->flags = (key->flags & ~(BTRFS_KEY_TYPE_MASK)) | val; | 613 | key->flags = (key->flags & ~(BTRFS_KEY_TYPE_MASK)) | val; |
622 | } | 614 | } |
623 | 615 | ||
624 | static inline u32 btrfs_key_overflow(struct btrfs_key *key) | ||
625 | { | ||
626 | return key->flags & BTRFS_KEY_OVERFLOW_MASK; | ||
627 | } | ||
628 | |||
629 | static inline void btrfs_set_key_overflow(struct btrfs_key *key, u32 over) | ||
630 | { | ||
631 | BUG_ON(over >= BTRFS_KEY_OVERFLOW_MAX); | ||
632 | key->flags = (key->flags & ~BTRFS_KEY_OVERFLOW_MASK) | over; | ||
633 | } | ||
634 | |||
635 | static inline u32 btrfs_disk_key_overflow(struct btrfs_disk_key *key) | ||
636 | { | ||
637 | return le32_to_cpu(key->flags) & BTRFS_KEY_OVERFLOW_MASK; | ||
638 | } | ||
639 | |||
640 | static inline void btrfs_set_disk_key_overflow(struct btrfs_disk_key *key, | ||
641 | u32 over) | ||
642 | { | ||
643 | u32 flags = btrfs_disk_key_flags(key); | ||
644 | BUG_ON(over >= BTRFS_KEY_OVERFLOW_MAX); | ||
645 | flags = (flags & ~BTRFS_KEY_OVERFLOW_MASK) | over; | ||
646 | btrfs_set_disk_key_flags(key, flags); | ||
647 | } | ||
648 | |||
649 | static inline u64 btrfs_header_blocknr(struct btrfs_header *h) | 616 | static inline u64 btrfs_header_blocknr(struct btrfs_header *h) |
650 | { | 617 | { |
651 | return le64_to_cpu(h->blocknr); | 618 | return le64_to_cpu(h->blocknr); |
@@ -1079,15 +1046,24 @@ int btrfs_find_last_root(struct btrfs_root *root, u64 objectid, struct | |||
1079 | int btrfs_insert_dir_item(struct btrfs_trans_handle *trans, struct btrfs_root | 1046 | int btrfs_insert_dir_item(struct btrfs_trans_handle *trans, struct btrfs_root |
1080 | *root, const char *name, int name_len, u64 dir, | 1047 | *root, const char *name, int name_len, u64 dir, |
1081 | struct btrfs_key *location, u8 type); | 1048 | struct btrfs_key *location, u8 type); |
1082 | int btrfs_lookup_dir_item(struct btrfs_trans_handle *trans, struct btrfs_root | 1049 | struct btrfs_dir_item *btrfs_lookup_dir_item(struct btrfs_trans_handle *trans, |
1083 | *root, struct btrfs_path *path, u64 dir, | 1050 | struct btrfs_root *root, |
1084 | const char *name, int name_len, int mod); | 1051 | struct btrfs_path *path, u64 dir, |
1085 | int btrfs_lookup_dir_index_item(struct btrfs_trans_handle *trans, | 1052 | const char *name, int name_len, |
1086 | struct btrfs_root *root, | 1053 | int mod); |
1087 | struct btrfs_path *path, u64 dir, | 1054 | struct btrfs_dir_item * |
1088 | u64 objectid, int mod); | 1055 | btrfs_lookup_dir_index_item(struct btrfs_trans_handle *trans, |
1089 | int btrfs_match_dir_item_name(struct btrfs_root *root, struct btrfs_path *path, | 1056 | struct btrfs_root *root, |
1057 | struct btrfs_path *path, u64 dir, | ||
1058 | u64 objectid, const char *name, int name_len, | ||
1059 | int mod); | ||
1060 | struct btrfs_dir_item *btrfs_match_dir_item_name(struct btrfs_root *root, | ||
1061 | struct btrfs_path *path, | ||
1090 | const char *name, int name_len); | 1062 | const char *name, int name_len); |
1063 | int btrfs_delete_one_dir_name(struct btrfs_trans_handle *trans, | ||
1064 | struct btrfs_root *root, | ||
1065 | struct btrfs_path *path, | ||
1066 | struct btrfs_dir_item *di); | ||
1091 | /* inode-map.c */ | 1067 | /* inode-map.c */ |
1092 | int btrfs_find_free_objectid(struct btrfs_trans_handle *trans, | 1068 | int btrfs_find_free_objectid(struct btrfs_trans_handle *trans, |
1093 | struct btrfs_root *fs_root, | 1069 | struct btrfs_root *fs_root, |