aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ctree.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r--fs/btrfs/ctree.h8
1 files changed, 3 insertions, 5 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 1a98952e0faf..a4ad39b58a4b 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -59,7 +59,7 @@ struct btrfs_header {
59 __le32 ham; 59 __le32 ham;
60 __le16 nritems; 60 __le16 nritems;
61 __le16 flags; 61 __le16 flags;
62 /* generation flags to be added */ 62 u8 level;
63} __attribute__ ((__packed__)); 63} __attribute__ ((__packed__));
64 64
65#define BTRFS_MAX_LEVEL 8 65#define BTRFS_MAX_LEVEL 8
@@ -648,15 +648,13 @@ static inline void btrfs_set_header_flags(struct btrfs_header *h, u16 val)
648 648
649static inline int btrfs_header_level(struct btrfs_header *h) 649static inline int btrfs_header_level(struct btrfs_header *h)
650{ 650{
651 return btrfs_header_flags(h) & (BTRFS_MAX_LEVEL - 1); 651 return h->level;
652} 652}
653 653
654static inline void btrfs_set_header_level(struct btrfs_header *h, int level) 654static inline void btrfs_set_header_level(struct btrfs_header *h, int level)
655{ 655{
656 u16 flags;
657 BUG_ON(level > BTRFS_MAX_LEVEL); 656 BUG_ON(level > BTRFS_MAX_LEVEL);
658 flags = btrfs_header_flags(h) & ~(BTRFS_MAX_LEVEL - 1); 657 h->level = level;
659 btrfs_set_header_flags(h, flags | level);
660} 658}
661 659
662static inline int btrfs_is_leaf(struct btrfs_node *n) 660static inline int btrfs_is_leaf(struct btrfs_node *n)