aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ctree.h
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2007-03-16 08:46:49 -0400
committerDavid Woodhouse <dwmw2@hera.kernel.org>2007-03-16 08:46:49 -0400
commita8a2ee0c600a213d13170c2f4d7bd0b304bbec19 (patch)
tree91c98147b03657985b386a1bad74a9d0095d2606 /fs/btrfs/ctree.h
parent1e1d27017c5986c1ea81181506042cf9cba3f6ea (diff)
Btrfs: add a name_len to dir items, reorder key
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r--fs/btrfs/ctree.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index dbf3917833fe..7c66b647ea24 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -26,14 +26,14 @@
26 */ 26 */
27struct btrfs_disk_key { 27struct btrfs_disk_key {
28 __le64 objectid; 28 __le64 objectid;
29 __le64 offset;
30 __le32 flags; 29 __le32 flags;
30 __le64 offset;
31} __attribute__ ((__packed__)); 31} __attribute__ ((__packed__));
32 32
33struct btrfs_key { 33struct btrfs_key {
34 u64 objectid; 34 u64 objectid;
35 u64 offset;
36 u32 flags; 35 u32 flags;
36 u64 offset;
37} __attribute__ ((__packed__)); 37} __attribute__ ((__packed__));
38 38
39/* 39/*
@@ -166,6 +166,7 @@ struct btrfs_inline_data_item {
166struct btrfs_dir_item { 166struct btrfs_dir_item {
167 __le64 objectid; 167 __le64 objectid;
168 __le16 flags; 168 __le16 flags;
169 __le16 name_len;
169 u8 type; 170 u8 type;
170} __attribute__ ((__packed__)); 171} __attribute__ ((__packed__));
171 172
@@ -431,9 +432,14 @@ static inline void btrfs_set_dir_type(struct btrfs_dir_item *d, u8 val)
431 d->type = val; 432 d->type = val;
432} 433}
433 434
434static inline u32 btrfs_dir_name_len(struct btrfs_item *i) 435static inline u16 btrfs_dir_name_len(struct btrfs_dir_item *d)
436{
437 return le16_to_cpu(d->name_len);
438}
439
440static inline void btrfs_set_dir_name_len(struct btrfs_dir_item *d, u16 val)
435{ 441{
436 return btrfs_item_size(i) - sizeof(struct btrfs_dir_item); 442 d->name_len = cpu_to_le16(val);
437} 443}
438 444
439static inline void btrfs_disk_key_to_cpu(struct btrfs_key *cpu, 445static inline void btrfs_disk_key_to_cpu(struct btrfs_key *cpu,