Btrfs: early work to file_write in big extents
Signed-off-by: Chris Mason <chris.mason@oracle.com>
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index ef3583c..796f19d 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -227,6 +227,7 @@
} __attribute__ ((__packed__));
struct btrfs_csum_item {
+ __le64 extent_offset;
u8 csum[BTRFS_CSUM_SIZE];
} __attribute__ ((__packed__));
@@ -924,6 +925,17 @@
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_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_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,