aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ctree.h
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2007-04-06 15:37:36 -0400
committerDavid Woodhouse <dwmw2@hera.kernel.org>2007-04-06 15:37:36 -0400
commitd6e4a428eb8f92bbb3537ccabadfb1195efb432b (patch)
treeca408dbd20b38728412b58db5a6ec29aebbc0fe7 /fs/btrfs/ctree.h
parent3eb0314dc1053b1ae617dcc8d6d93f776c5baa31 (diff)
Btrfs: start of support for many FS volumes
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r--fs/btrfs/ctree.h36
1 files changed, 22 insertions, 14 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 6d40758b893f..1ff5b99af682 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -3,6 +3,7 @@
3 3
4#include <linux/fs.h> 4#include <linux/fs.h>
5#include <linux/buffer_head.h> 5#include <linux/buffer_head.h>
6#include <linux/kobject.h>
6#include "bit-radix.h" 7#include "bit-radix.h"
7 8
8struct btrfs_trans_handle; 9struct btrfs_trans_handle;
@@ -183,13 +184,15 @@ struct btrfs_inline_data_item {
183} __attribute__ ((__packed__)); 184} __attribute__ ((__packed__));
184 185
185struct btrfs_dir_item { 186struct btrfs_dir_item {
186 __le64 objectid; 187 struct btrfs_disk_key location;
187 __le16 flags; 188 __le16 flags;
188 __le16 name_len; 189 __le16 name_len;
189 u8 type; 190 u8 type;
190} __attribute__ ((__packed__)); 191} __attribute__ ((__packed__));
191 192
192struct btrfs_root_item { 193struct btrfs_root_item {
194 struct btrfs_inode_item inode;
195 __le64 root_dirid;
193 __le64 blocknr; 196 __le64 blocknr;
194 __le32 flags; 197 __le32 flags;
195 __le64 block_limit; 198 __le64 block_limit;
@@ -249,6 +252,7 @@ struct btrfs_fs_info {
249 struct mutex fs_mutex; 252 struct mutex fs_mutex;
250 struct crypto_hash *hash_tfm; 253 struct crypto_hash *hash_tfm;
251 spinlock_t hash_lock; 254 spinlock_t hash_lock;
255 struct kobject kobj;
252}; 256};
253 257
254/* 258/*
@@ -504,16 +508,6 @@ static inline void btrfs_set_item_size(struct btrfs_item *item, u16 val)
504 item->size = cpu_to_le16(val); 508 item->size = cpu_to_le16(val);
505} 509}
506 510
507static inline u64 btrfs_dir_objectid(struct btrfs_dir_item *d)
508{
509 return le64_to_cpu(d->objectid);
510}
511
512static inline void btrfs_set_dir_objectid(struct btrfs_dir_item *d, u64 val)
513{
514 d->objectid = cpu_to_le64(val);
515}
516
517static inline u16 btrfs_dir_flags(struct btrfs_dir_item *d) 511static inline u16 btrfs_dir_flags(struct btrfs_dir_item *d)
518{ 512{
519 return le16_to_cpu(d->flags); 513 return le16_to_cpu(d->flags);
@@ -724,6 +718,16 @@ static inline void btrfs_set_root_blocknr(struct btrfs_root_item *item, u64 val)
724 item->blocknr = cpu_to_le64(val); 718 item->blocknr = cpu_to_le64(val);
725} 719}
726 720
721static inline u64 btrfs_root_dirid(struct btrfs_root_item *item)
722{
723 return le64_to_cpu(item->root_dirid);
724}
725
726static inline void btrfs_set_root_dirid(struct btrfs_root_item *item, u64 val)
727{
728 item->root_dirid = cpu_to_le64(val);
729}
730
727static inline u32 btrfs_root_refs(struct btrfs_root_item *item) 731static inline u32 btrfs_root_refs(struct btrfs_root_item *item)
728{ 732{
729 return le32_to_cpu(item->refs); 733 return le32_to_cpu(item->refs);
@@ -950,8 +954,8 @@ int btrfs_find_last_root(struct btrfs_root *root, u64 objectid, struct
950 btrfs_root_item *item, struct btrfs_key *key); 954 btrfs_root_item *item, struct btrfs_key *key);
951/* dir-item.c */ 955/* dir-item.c */
952int btrfs_insert_dir_item(struct btrfs_trans_handle *trans, struct btrfs_root 956int btrfs_insert_dir_item(struct btrfs_trans_handle *trans, struct btrfs_root
953 *root, const char *name, int name_len, u64 dir, u64 957 *root, const char *name, int name_len, u64 dir,
954 objectid, u8 type); 958 struct btrfs_key *location, u8 type);
955int btrfs_lookup_dir_item(struct btrfs_trans_handle *trans, struct btrfs_root 959int btrfs_lookup_dir_item(struct btrfs_trans_handle *trans, struct btrfs_root
956 *root, struct btrfs_path *path, u64 dir, 960 *root, struct btrfs_path *path, u64 dir,
957 const char *name, int name_len, int mod); 961 const char *name, int name_len, int mod);
@@ -978,7 +982,8 @@ int btrfs_insert_inode(struct btrfs_trans_handle *trans, struct btrfs_root
978 *root, u64 objectid, struct btrfs_inode_item 982 *root, u64 objectid, struct btrfs_inode_item
979 *inode_item); 983 *inode_item);
980int btrfs_lookup_inode(struct btrfs_trans_handle *trans, struct btrfs_root 984int btrfs_lookup_inode(struct btrfs_trans_handle *trans, struct btrfs_root
981 *root, struct btrfs_path *path, u64 objectid, int mod); 985 *root, struct btrfs_path *path,
986 struct btrfs_key *location, int mod);
982 987
983/* file-item.c */ 988/* file-item.c */
984int btrfs_alloc_file_extent(struct btrfs_trans_handle *trans, 989int btrfs_alloc_file_extent(struct btrfs_trans_handle *trans,
@@ -997,4 +1002,7 @@ int btrfs_csum_file_block(struct btrfs_trans_handle *trans,
997int btrfs_csum_verify_file_block(struct btrfs_root *root, 1002int btrfs_csum_verify_file_block(struct btrfs_root *root,
998 u64 objectid, u64 offset, 1003 u64 objectid, u64 offset,
999 char *data, size_t len); 1004 char *data, size_t len);
1005/* super.c */
1006extern struct subsystem btrfs_subsys;
1007
1000#endif 1008#endif