Btrfs: early work to file_write in big extents

Signed-off-by: Chris Mason <chris.mason@oracle.com>
This commit is contained in:
Chris Mason
2007-04-16 09:22:45 -04:00
committed by David Woodhouse
parent b4100d6424
commit 6567e837df
4 changed files with 232 additions and 23 deletions

View File

@ -227,6 +227,7 @@ struct btrfs_file_extent_item {
} __attribute__ ((__packed__));
struct btrfs_csum_item {
__le64 extent_offset;
u8 csum[BTRFS_CSUM_SIZE];
} __attribute__ ((__packed__));
@ -924,6 +925,17 @@ static inline void btrfs_set_file_extent_num_blocks(struct
e->num_blocks = cpu_to_le64(val);
}
static inline u64 btrfs_csum_extent_offset(struct btrfs_csum_item *c)
{
return le64_to_cpu(c->extent_offset);
}
static inline void btrfs_set_csum_extent_offset(struct btrfs_csum_item *c,
u64 val)
{
c->extent_offset = cpu_to_le64(val);
}
static inline u16 btrfs_device_pathlen(struct btrfs_device_item *d)
{
return le16_to_cpu(d->pathlen);
@ -1002,6 +1014,8 @@ int btrfs_free_extent(struct btrfs_trans_handle *trans, struct btrfs_root
int btrfs_finish_extent_commit(struct btrfs_trans_handle *trans, struct
btrfs_root *root);
/* ctree.c */
int btrfs_extend_item(struct btrfs_trans_handle *trans, struct btrfs_root
*root, struct btrfs_path *path, u32 data_size);
int btrfs_search_slot(struct btrfs_trans_handle *trans, struct btrfs_root
*root, struct btrfs_key *key, struct btrfs_path *p, int
ins_len, int cow);
@ -1071,6 +1085,7 @@ int btrfs_lookup_file_extent(struct btrfs_trans_handle *trans,
int btrfs_csum_file_block(struct btrfs_trans_handle *trans,
struct btrfs_root *root,
u64 objectid, u64 offset,
u64 extent_offset,
char *data, size_t len);
int btrfs_csum_verify_file_block(struct btrfs_root *root,
u64 objectid, u64 offset,