diff options
author | Chris Mason <chris.mason@oracle.com> | 2007-04-09 10:42:37 -0400 |
---|---|---|
committer | David Woodhouse <dwmw2@hera.kernel.org> | 2007-04-09 10:42:37 -0400 |
commit | 0f7d52f4431c530b4f39c524448c688bb7754de5 (patch) | |
tree | 1ba4f62a2b7230456e1b4850ddad339148f44b3e /fs/btrfs/ctree.h | |
parent | d6e4a428eb8f92bbb3537ccabadfb1195efb432b (diff) |
Btrfs: groundwork for subvolume and snapshot roots
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r-- | fs/btrfs/ctree.h | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 1ff5b99af682..5460030c9e6a 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h | |||
@@ -232,12 +232,12 @@ struct btrfs_inode_map_item { | |||
232 | 232 | ||
233 | struct crypto_hash; | 233 | struct crypto_hash; |
234 | struct btrfs_fs_info { | 234 | struct btrfs_fs_info { |
235 | struct btrfs_root *fs_root; | ||
236 | struct btrfs_root *extent_root; | 235 | struct btrfs_root *extent_root; |
237 | struct btrfs_root *tree_root; | 236 | struct btrfs_root *tree_root; |
238 | struct btrfs_root *inode_root; | 237 | struct btrfs_root *inode_root; |
239 | struct btrfs_key current_insert; | 238 | struct btrfs_key current_insert; |
240 | struct btrfs_key last_insert; | 239 | struct btrfs_key last_insert; |
240 | struct radix_tree_root fs_roots_radix; | ||
241 | struct radix_tree_root pending_del_radix; | 241 | struct radix_tree_root pending_del_radix; |
242 | struct radix_tree_root pinned_radix; | 242 | struct radix_tree_root pinned_radix; |
243 | u64 last_inode_alloc; | 243 | u64 last_inode_alloc; |
@@ -266,6 +266,9 @@ struct btrfs_root { | |||
266 | struct btrfs_root_item root_item; | 266 | struct btrfs_root_item root_item; |
267 | struct btrfs_key root_key; | 267 | struct btrfs_key root_key; |
268 | struct btrfs_fs_info *fs_info; | 268 | struct btrfs_fs_info *fs_info; |
269 | struct inode *inode; | ||
270 | u64 objectid; | ||
271 | u64 last_trans; | ||
269 | u32 blocksize; | 272 | u32 blocksize; |
270 | int ref_cows; | 273 | int ref_cows; |
271 | u32 type; | 274 | u32 type; |
@@ -595,7 +598,7 @@ static inline u32 btrfs_key_overflow(struct btrfs_key *key) | |||
595 | 598 | ||
596 | static inline void btrfs_set_key_overflow(struct btrfs_key *key, u32 over) | 599 | static inline void btrfs_set_key_overflow(struct btrfs_key *key, u32 over) |
597 | { | 600 | { |
598 | BUG_ON(over > BTRFS_KEY_OVERFLOW_MAX); | 601 | BUG_ON(over >= BTRFS_KEY_OVERFLOW_MAX); |
599 | over = over << BTRFS_KEY_OVERFLOW_SHIFT; | 602 | over = over << BTRFS_KEY_OVERFLOW_SHIFT; |
600 | key->flags = (key->flags & ~((u64)BTRFS_KEY_OVERFLOW_MASK)) | over; | 603 | key->flags = (key->flags & ~((u64)BTRFS_KEY_OVERFLOW_MASK)) | over; |
601 | } | 604 | } |
@@ -634,7 +637,7 @@ static inline void btrfs_set_disK_key_overflow(struct btrfs_disk_key *key, | |||
634 | u32 over) | 637 | u32 over) |
635 | { | 638 | { |
636 | u32 flags = btrfs_disk_key_flags(key); | 639 | u32 flags = btrfs_disk_key_flags(key); |
637 | BUG_ON(over > BTRFS_KEY_OVERFLOW_MAX); | 640 | BUG_ON(over >= BTRFS_KEY_OVERFLOW_MAX); |
638 | over = over << BTRFS_KEY_OVERFLOW_SHIFT; | 641 | over = over << BTRFS_KEY_OVERFLOW_SHIFT; |
639 | flags = (flags & ~((u64)BTRFS_KEY_OVERFLOW_MASK)) | over; | 642 | flags = (flags & ~((u64)BTRFS_KEY_OVERFLOW_MASK)) | over; |
640 | btrfs_set_disk_key_flags(key, flags); | 643 | btrfs_set_disk_key_flags(key, flags); |
@@ -748,6 +751,17 @@ static inline void btrfs_set_super_blocknr(struct btrfs_super_block *s, u64 val) | |||
748 | s->blocknr = cpu_to_le64(val); | 751 | s->blocknr = cpu_to_le64(val); |
749 | } | 752 | } |
750 | 753 | ||
754 | static inline u64 btrfs_super_generation(struct btrfs_super_block *s) | ||
755 | { | ||
756 | return le64_to_cpu(s->generation); | ||
757 | } | ||
758 | |||
759 | static inline void btrfs_set_super_generation(struct btrfs_super_block *s, | ||
760 | u64 val) | ||
761 | { | ||
762 | s->generation = cpu_to_le64(val); | ||
763 | } | ||
764 | |||
751 | static inline u64 btrfs_super_root(struct btrfs_super_block *s) | 765 | static inline u64 btrfs_super_root(struct btrfs_super_block *s) |
752 | { | 766 | { |
753 | return le64_to_cpu(s->root); | 767 | return le64_to_cpu(s->root); |