aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ctree.h
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2007-04-10 12:13:09 -0400
committerDavid Woodhouse <dwmw2@hera.kernel.org>2007-04-10 12:13:09 -0400
commit1b05da2ee6217e7d55460d04335813fec25be4ca (patch)
tree250a3e789777c7a6d17dccf0bf5a57b00ef1bdac /fs/btrfs/ctree.h
parentc5739bba5260a59cebd20a51a55080592c8d3b07 (diff)
Btrfs: drop the inode map tree
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r--fs/btrfs/ctree.h39
1 files changed, 5 insertions, 34 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 2cbcaaeac9e5..5103709bb2b9 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -14,9 +14,8 @@ extern struct kmem_cache *btrfs_path_cachep;
14 14
15#define BTRFS_ROOT_TREE_OBJECTID 1ULL 15#define BTRFS_ROOT_TREE_OBJECTID 1ULL
16#define BTRFS_EXTENT_TREE_OBJECTID 2ULL 16#define BTRFS_EXTENT_TREE_OBJECTID 2ULL
17#define BTRFS_INODE_MAP_OBJECTID 3ULL 17#define BTRFS_FS_TREE_OBJECTID 3ULL
18#define BTRFS_FS_TREE_OBJECTID 4ULL 18#define BTRFS_FIRST_FREE_OBJECTID 4ULL
19#define BTRFS_FIRST_FREE_OBJECTID 5ULL
20 19
21/* 20/*
22 * we can actually store much bigger names, but lets not confuse the rest 21 * we can actually store much bigger names, but lets not confuse the rest
@@ -62,7 +61,6 @@ struct btrfs_header {
62 __le64 blocknr; /* which block this node is supposed to live in */ 61 __le64 blocknr; /* which block this node is supposed to live in */
63 __le64 generation; 62 __le64 generation;
64 __le64 parentid; /* objectid of the tree root */ 63 __le64 parentid; /* objectid of the tree root */
65 __le32 ham;
66 __le16 nritems; 64 __le16 nritems;
67 __le16 flags; 65 __le16 flags;
68 u8 level; 66 u8 level;
@@ -226,23 +224,16 @@ struct btrfs_csum_item {
226 u8 csum[BTRFS_CSUM_SIZE]; 224 u8 csum[BTRFS_CSUM_SIZE];
227} __attribute__ ((__packed__)); 225} __attribute__ ((__packed__));
228 226
229struct btrfs_inode_map_item {
230 u32 refs;
231} __attribute__ ((__packed__));
232
233struct crypto_hash; 227struct crypto_hash;
234struct btrfs_fs_info { 228struct btrfs_fs_info {
235 struct btrfs_root *extent_root; 229 struct btrfs_root *extent_root;
236 struct btrfs_root *tree_root; 230 struct btrfs_root *tree_root;
237 struct btrfs_root *inode_root;
238 struct btrfs_key current_insert; 231 struct btrfs_key current_insert;
239 struct btrfs_key last_insert; 232 struct btrfs_key last_insert;
240 struct radix_tree_root fs_roots_radix; 233 struct radix_tree_root fs_roots_radix;
241 struct radix_tree_root pending_del_radix; 234 struct radix_tree_root pending_del_radix;
242 struct radix_tree_root pinned_radix; 235 struct radix_tree_root pinned_radix;
243 u64 last_inode_alloc;
244 u64 generation; 236 u64 generation;
245 u64 highest_inode;
246 struct btrfs_transaction *running_transaction; 237 struct btrfs_transaction *running_transaction;
247 struct btrfs_super_block *disk_super; 238 struct btrfs_super_block *disk_super;
248 struct buffer_head *sb_buffer; 239 struct buffer_head *sb_buffer;
@@ -272,6 +263,8 @@ struct btrfs_root {
272 u32 blocksize; 263 u32 blocksize;
273 int ref_cows; 264 int ref_cows;
274 u32 type; 265 u32 type;
266 u64 highest_inode;
267 u64 last_inode_alloc;
275}; 268};
276 269
277/* the lower bits in the key flags defines the item type */ 270/* the lower bits in the key flags defines the item type */
@@ -321,15 +314,10 @@ struct btrfs_root {
321#define BTRFS_EXTENT_ITEM_KEY 8 314#define BTRFS_EXTENT_ITEM_KEY 8
322 315
323/* 316/*
324 * the inode map records which inode numbers are in use and where
325 * they actually live on disk
326 */
327#define BTRFS_INODE_MAP_ITEM_KEY 9
328/*
329 * string items are for debugging. They just store a short string of 317 * string items are for debugging. They just store a short string of
330 * data in the FS 318 * data in the FS
331 */ 319 */
332#define BTRFS_STRING_ITEM_KEY 10 320#define BTRFS_STRING_ITEM_KEY 9
333 321
334static inline u64 btrfs_inode_generation(struct btrfs_inode_item *i) 322static inline u64 btrfs_inode_generation(struct btrfs_inode_item *i)
335{ 323{
@@ -883,17 +871,6 @@ static inline void btrfs_set_file_extent_num_blocks(struct
883 e->num_blocks = cpu_to_le64(val); 871 e->num_blocks = cpu_to_le64(val);
884} 872}
885 873
886static inline u32 btrfs_inode_map_refs(struct btrfs_inode_map_item *m)
887{
888 return le32_to_cpu(m->refs);
889}
890
891static inline void btrfs_set_inode_map_refs(struct btrfs_inode_map_item *m,
892 u32 val)
893{
894 m->refs = cpu_to_le32(val);
895}
896
897static inline struct btrfs_root *btrfs_sb(struct super_block *sb) 874static inline struct btrfs_root *btrfs_sb(struct super_block *sb)
898{ 875{
899 return sb->s_fs_info; 876 return sb->s_fs_info;
@@ -996,12 +973,6 @@ int btrfs_match_dir_item_name(struct btrfs_root *root, struct btrfs_path *path,
996int btrfs_find_free_objectid(struct btrfs_trans_handle *trans, 973int btrfs_find_free_objectid(struct btrfs_trans_handle *trans,
997 struct btrfs_root *fs_root, 974 struct btrfs_root *fs_root,
998 u64 dirid, u64 *objectid); 975 u64 dirid, u64 *objectid);
999int btrfs_insert_inode_map(struct btrfs_trans_handle *trans,
1000 struct btrfs_root *root,
1001 u64 objectid, struct btrfs_key *location);
1002int btrfs_lookup_inode_map(struct btrfs_trans_handle *trans,
1003 struct btrfs_root *root, struct btrfs_path *path,
1004 u64 objectid, int mod);
1005int btrfs_find_highest_inode(struct btrfs_root *fs_root, u64 *objectid); 976int btrfs_find_highest_inode(struct btrfs_root *fs_root, u64 *objectid);
1006 977
1007/* inode-item.c */ 978/* inode-item.c */