summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fs/btrfs/inode.c8
-rw-r--r--fs/btrfs/ordered-data.h2
2 files changed, 6 insertions, 4 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index b37b062789a7..151d192b88be 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -991,7 +991,7 @@ static noinline int cow_file_range(struct inode *inode,
ins.offset, /* orig_block_len */
ram_size, /* ram_bytes */
BTRFS_COMPRESS_NONE, /* compress_type */
- 0 /* type */);
+ BTRFS_ORDERED_REGULAR /* type */);
if (IS_ERR(em))
goto out_reserve;
free_extent_map(em);
@@ -7506,7 +7506,7 @@ static struct extent_map *create_io_em(struct inode *inode, u64 start, u64 len,
ASSERT(type == BTRFS_ORDERED_PREALLOC ||
type == BTRFS_ORDERED_COMPRESSED ||
type == BTRFS_ORDERED_NOCOW ||
- type == 0);
+ type == BTRFS_ORDERED_REGULAR);
em_tree = &BTRFS_I(inode)->extent_tree;
em = alloc_extent_map();
@@ -7523,9 +7523,9 @@ static struct extent_map *create_io_em(struct inode *inode, u64 start, u64 len,
em->ram_bytes = ram_bytes;
em->generation = -1;
set_bit(EXTENT_FLAG_PINNED, &em->flags);
- if (type == BTRFS_ORDERED_PREALLOC)
+ if (type == BTRFS_ORDERED_PREALLOC) {
set_bit(EXTENT_FLAG_FILLING, &em->flags);
- else if (type == BTRFS_ORDERED_COMPRESSED) {
+ } else if (type == BTRFS_ORDERED_COMPRESSED) {
set_bit(EXTENT_FLAG_COMPRESSED, &em->flags);
em->compress_type = compress_type;
}
diff --git a/fs/btrfs/ordered-data.h b/fs/btrfs/ordered-data.h
index b02b71d41d83..a8cb8efe6fae 100644
--- a/fs/btrfs/ordered-data.h
+++ b/fs/btrfs/ordered-data.h
@@ -75,6 +75,8 @@ struct btrfs_ordered_sum {
* in the logging code. */
#define BTRFS_ORDERED_PENDING 11 /* We are waiting for this ordered extent to
* complete in the current transaction. */
+#define BTRFS_ORDERED_REGULAR 12 /* Regular IO for COW */
+
struct btrfs_ordered_extent {
/* logical offset in the file */
u64 file_offset;