mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-04-01 03:44:08 +00:00
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>
This commit is contained in:
parent
6f9994dbab
commit
1af4a0aaa5
2 changed files with 6 additions and 4 deletions
|
@ -991,7 +991,7 @@ static noinline int cow_file_range(struct inode *inode,
|
||||||
ins.offset, /* orig_block_len */
|
ins.offset, /* orig_block_len */
|
||||||
ram_size, /* ram_bytes */
|
ram_size, /* ram_bytes */
|
||||||
BTRFS_COMPRESS_NONE, /* compress_type */
|
BTRFS_COMPRESS_NONE, /* compress_type */
|
||||||
0 /* type */);
|
BTRFS_ORDERED_REGULAR /* type */);
|
||||||
if (IS_ERR(em))
|
if (IS_ERR(em))
|
||||||
goto out_reserve;
|
goto out_reserve;
|
||||||
free_extent_map(em);
|
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 ||
|
ASSERT(type == BTRFS_ORDERED_PREALLOC ||
|
||||||
type == BTRFS_ORDERED_COMPRESSED ||
|
type == BTRFS_ORDERED_COMPRESSED ||
|
||||||
type == BTRFS_ORDERED_NOCOW ||
|
type == BTRFS_ORDERED_NOCOW ||
|
||||||
type == 0);
|
type == BTRFS_ORDERED_REGULAR);
|
||||||
|
|
||||||
em_tree = &BTRFS_I(inode)->extent_tree;
|
em_tree = &BTRFS_I(inode)->extent_tree;
|
||||||
em = alloc_extent_map();
|
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->ram_bytes = ram_bytes;
|
||||||
em->generation = -1;
|
em->generation = -1;
|
||||||
set_bit(EXTENT_FLAG_PINNED, &em->flags);
|
set_bit(EXTENT_FLAG_PINNED, &em->flags);
|
||||||
if (type == BTRFS_ORDERED_PREALLOC)
|
if (type == BTRFS_ORDERED_PREALLOC) {
|
||||||
set_bit(EXTENT_FLAG_FILLING, &em->flags);
|
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);
|
set_bit(EXTENT_FLAG_COMPRESSED, &em->flags);
|
||||||
em->compress_type = compress_type;
|
em->compress_type = compress_type;
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,6 +75,8 @@ struct btrfs_ordered_sum {
|
||||||
* in the logging code. */
|
* in the logging code. */
|
||||||
#define BTRFS_ORDERED_PENDING 11 /* We are waiting for this ordered extent to
|
#define BTRFS_ORDERED_PENDING 11 /* We are waiting for this ordered extent to
|
||||||
* complete in the current transaction. */
|
* complete in the current transaction. */
|
||||||
|
#define BTRFS_ORDERED_REGULAR 12 /* Regular IO for COW */
|
||||||
|
|
||||||
struct btrfs_ordered_extent {
|
struct btrfs_ordered_extent {
|
||||||
/* logical offset in the file */
|
/* logical offset in the file */
|
||||||
u64 file_offset;
|
u64 file_offset;
|
||||||
|
|
Loading…
Add table
Reference in a new issue