Josef Bacik
2007-Sep-10 06:41 UTC
[Btrfs-devel] [PATCH 2/2] fix btrfs-progs to have data_len instead of flags
Hello, In adding EA support I dropped the flags section of dir_item and replaced it with data_len. This patch updates btrfs-progs with the change. Thank you, Josef diff -r f4810b8d5822 ctree.h --- a/ctree.h Wed Aug 29 15:56:44 2007 -0400 +++ b/ctree.h Tue Sep 04 16:06:10 2007 -0400 @@ -211,7 +211,7 @@ struct btrfs_inline_data_item { struct btrfs_dir_item { struct btrfs_disk_key location; - __le16 flags; + __le16 data_len; __le16 name_len; u8 type; } __attribute__ ((__packed__)); @@ -568,16 +568,6 @@ static inline void btrfs_set_item_size(s static inline void btrfs_set_item_size(struct btrfs_item *item, u16 val) { item->size = cpu_to_le16(val); -} - -static inline u16 btrfs_dir_flags(struct btrfs_dir_item *d) -{ - return le16_to_cpu(d->flags); -} - -static inline void btrfs_set_dir_flags(struct btrfs_dir_item *d, u16 val) -{ - d->flags = cpu_to_le16(val); } static inline u8 btrfs_dir_type(struct btrfs_dir_item *d) diff -r f4810b8d5822 dir-item.c --- a/dir-item.c Wed Aug 29 15:56:44 2007 -0400 +++ b/dir-item.c Wed Sep 05 11:39:25 2007 -0400 @@ -83,7 +83,6 @@ int btrfs_insert_dir_item(struct btrfs_t } btrfs_cpu_key_to_disk(&dir_item->location, location); btrfs_set_dir_type(dir_item, type); - btrfs_set_dir_flags(dir_item, 0); btrfs_set_dir_name_len(dir_item, name_len); name_ptr = (char *)(dir_item + 1); memcpy(name_ptr, name, name_len); @@ -102,7 +101,6 @@ int btrfs_insert_dir_item(struct btrfs_t } btrfs_cpu_key_to_disk(&dir_item->location, location); btrfs_set_dir_type(dir_item, type); - btrfs_set_dir_flags(dir_item, 0); btrfs_set_dir_name_len(dir_item, name_len); name_ptr = (char *)(dir_item + 1); memcpy(name_ptr, name, name_len); diff -r f4810b8d5822 print-tree.c --- a/print-tree.c Wed Aug 29 15:56:44 2007 -0400 +++ b/print-tree.c Wed Sep 05 11:38:59 2007 -0400 @@ -31,9 +31,8 @@ static int print_dir_item(struct btrfs_i u32 len; total = btrfs_item_size(item); while(cur < total) { - printf("\t\tdir index %llu flags %u type %u\n", + printf("\t\tdir index %llu type %u\n", (unsigned long long)btrfs_disk_key_objectid(&di->location), - btrfs_dir_flags(di), btrfs_dir_type(di)); printf("\t\tname %.*s\n", btrfs_dir_name_len(di),(char *)(di + 1));