aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLiu Bo <bo.li.liu@oracle.com>2017-02-13 18:35:09 -0500
committerDavid Sterba <dsterba@suse.com>2017-02-17 06:03:48 -0500
commit1af4a0aaa5d4bfcd17020f0620017a3057a9fb8d (patch)
treecc2ae71ae332926dd0083896993496ba82683894
parent6f9994dbabe5756df1922d84a568cbff74ae1323 (diff)
Btrfs: specify a new ordered extent type for create_io_em
As 0 refers to an existing type BTRFS_ORDERED_IO_DONE, this specifies a new type 'REGULAR' for regular IO. Signed-off-by: Liu Bo <bo.li.liu@oracle.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
-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,
991 ins.offset, /* orig_block_len */ 991 ins.offset, /* orig_block_len */
992 ram_size, /* ram_bytes */ 992 ram_size, /* ram_bytes */
993 BTRFS_COMPRESS_NONE, /* compress_type */ 993 BTRFS_COMPRESS_NONE, /* compress_type */
994 0 /* type */); 994 BTRFS_ORDERED_REGULAR /* type */);
995 if (IS_ERR(em)) 995 if (IS_ERR(em))
996 goto out_reserve; 996 goto out_reserve;
997 free_extent_map(em); 997 free_extent_map(em);
@@ -7506,7 +7506,7 @@ static struct extent_map *create_io_em(struct inode *inode, u64 start, u64 len,
7506 ASSERT(type == BTRFS_ORDERED_PREALLOC || 7506 ASSERT(type == BTRFS_ORDERED_PREALLOC ||
7507 type == BTRFS_ORDERED_COMPRESSED || 7507 type == BTRFS_ORDERED_COMPRESSED ||
7508 type == BTRFS_ORDERED_NOCOW || 7508 type == BTRFS_ORDERED_NOCOW ||
7509 type == 0); 7509 type == BTRFS_ORDERED_REGULAR);
7510 7510
7511 em_tree = &BTRFS_I(inode)->extent_tree; 7511 em_tree = &BTRFS_I(inode)->extent_tree;
7512 em = alloc_extent_map(); 7512 em = alloc_extent_map();
@@ -7523,9 +7523,9 @@ static struct extent_map *create_io_em(struct inode *inode, u64 start, u64 len,
7523 em->ram_bytes = ram_bytes; 7523 em->ram_bytes = ram_bytes;
7524 em->generation = -1; 7524 em->generation = -1;
7525 set_bit(EXTENT_FLAG_PINNED, &em->flags); 7525 set_bit(EXTENT_FLAG_PINNED, &em->flags);
7526 if (type == BTRFS_ORDERED_PREALLOC) 7526 if (type == BTRFS_ORDERED_PREALLOC) {
7527 set_bit(EXTENT_FLAG_FILLING, &em->flags); 7527 set_bit(EXTENT_FLAG_FILLING, &em->flags);
7528 else if (type == BTRFS_ORDERED_COMPRESSED) { 7528 } else if (type == BTRFS_ORDERED_COMPRESSED) {
7529 set_bit(EXTENT_FLAG_COMPRESSED, &em->flags); 7529 set_bit(EXTENT_FLAG_COMPRESSED, &em->flags);
7530 em->compress_type = compress_type; 7530 em->compress_type = compress_type;
7531 } 7531 }
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 {
75 * in the logging code. */ 75 * in the logging code. */
76#define BTRFS_ORDERED_PENDING 11 /* We are waiting for this ordered extent to 76#define BTRFS_ORDERED_PENDING 11 /* We are waiting for this ordered extent to
77 * complete in the current transaction. */ 77 * complete in the current transaction. */
78#define BTRFS_ORDERED_REGULAR 12 /* Regular IO for COW */
79
78struct btrfs_ordered_extent { 80struct btrfs_ordered_extent {
79 /* logical offset in the file */ 81 /* logical offset in the file */
80 u64 file_offset; 82 u64 file_offset;