diff options
author | Chris Mason <chris.mason@oracle.com> | 2007-03-16 12:46:49 (GMT) |
---|---|---|
committer | David Woodhouse <dwmw2@hera.kernel.org> | 2007-03-16 12:46:49 (GMT) |
commit | a8a2ee0c600a213d13170c2f4d7bd0b304bbec19 (patch) | |
tree | 91c98147b03657985b386a1bad74a9d0095d2606 /fs/btrfs/ctree.h | |
parent | 1e1d27017c5986c1ea81181506042cf9cba3f6ea (diff) | |
download | linux-fsl-qoriq-a8a2ee0c600a213d13170c2f4d7bd0b304bbec19.tar.xz |
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.h | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index dbf3917..7c66b64 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h @@ -26,14 +26,14 @@ */ struct btrfs_disk_key { __le64 objectid; - __le64 offset; __le32 flags; + __le64 offset; } __attribute__ ((__packed__)); struct btrfs_key { u64 objectid; - u64 offset; u32 flags; + u64 offset; } __attribute__ ((__packed__)); /* @@ -166,6 +166,7 @@ struct btrfs_inline_data_item { struct btrfs_dir_item { __le64 objectid; __le16 flags; + __le16 name_len; u8 type; } __attribute__ ((__packed__)); @@ -431,9 +432,14 @@ static inline void btrfs_set_dir_type(struct btrfs_dir_item *d, u8 val) d->type = val; } -static inline u32 btrfs_dir_name_len(struct btrfs_item *i) +static inline u16 btrfs_dir_name_len(struct btrfs_dir_item *d) +{ + return le16_to_cpu(d->name_len); +} + +static inline void btrfs_set_dir_name_len(struct btrfs_dir_item *d, u16 val) { - return btrfs_item_size(i) - sizeof(struct btrfs_dir_item); + d->name_len = cpu_to_le16(val); } static inline void btrfs_disk_key_to_cpu(struct btrfs_key *cpu, |