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.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 983e3cc9ae9f..96cec6352f12 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -52,6 +52,7 @@ struct btrfs_key {
52struct btrfs_header { 52struct btrfs_header {
53 u8 fsid[16]; /* FS specific uuid */ 53 u8 fsid[16]; /* FS specific uuid */
54 __le64 blocknr; /* which block this node is supposed to live in */ 54 __le64 blocknr; /* which block this node is supposed to live in */
55 __le64 generation;
55 __le64 parentid; /* objectid of the tree root */ 56 __le64 parentid; /* objectid of the tree root */
56 __le32 csum; 57 __le32 csum;
57 __le32 ham; 58 __le32 ham;
@@ -600,6 +601,17 @@ static inline void btrfs_set_header_blocknr(struct btrfs_header *h, u64 blocknr)
600 h->blocknr = cpu_to_le64(blocknr); 601 h->blocknr = cpu_to_le64(blocknr);
601} 602}
602 603
604static inline u64 btrfs_header_generation(struct btrfs_header *h)
605{
606 return le64_to_cpu(h->generation);
607}
608
609static inline void btrfs_set_header_generation(struct btrfs_header *h,
610 u64 val)
611{
612 h->generation = cpu_to_le64(val);
613}
614
603static inline u64 btrfs_header_parentid(struct btrfs_header *h) 615static inline u64 btrfs_header_parentid(struct btrfs_header *h)
604{ 616{
605 return le64_to_cpu(h->parentid); 617 return le64_to_cpu(h->parentid);
@@ -839,7 +851,7 @@ int btrfs_lookup_dir_item(struct btrfs_trans_handle *trans, struct btrfs_root
839 *root, struct btrfs_path *path, u64 dir, 851 *root, struct btrfs_path *path, u64 dir,
840 const char *name, int name_len, int mod); 852 const char *name, int name_len, int mod);
841int btrfs_match_dir_item_name(struct btrfs_root *root, struct btrfs_path *path, 853int btrfs_match_dir_item_name(struct btrfs_root *root, struct btrfs_path *path,
842 char *name, int name_len); 854 const char *name, int name_len);
843int btrfs_find_free_objectid(struct btrfs_trans_handle *trans, 855int btrfs_find_free_objectid(struct btrfs_trans_handle *trans,
844 struct btrfs_root *fs_root, 856 struct btrfs_root *fs_root,
845 u64 dirid, u64 *objectid); 857 u64 dirid, u64 *objectid);