btrfs: open code set_extent_dirty
The helper is used a few times, that it's setting the DIRTY extent bit is still clear. Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Qu Wenruo <wqu@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
eea8686e68
commit
fe1a598c42
@ -3521,9 +3521,10 @@ int btrfs_update_block_group(struct btrfs_trans_handle *trans,
|
|||||||
spin_unlock(&cache->lock);
|
spin_unlock(&cache->lock);
|
||||||
spin_unlock(&space_info->lock);
|
spin_unlock(&space_info->lock);
|
||||||
|
|
||||||
set_extent_dirty(&trans->transaction->pinned_extents,
|
set_extent_bit(&trans->transaction->pinned_extents,
|
||||||
bytenr, bytenr + num_bytes - 1,
|
bytenr, bytenr + num_bytes - 1,
|
||||||
GFP_NOFS | __GFP_NOFAIL);
|
EXTENT_DIRTY, NULL,
|
||||||
|
GFP_NOFS | __GFP_NOFAIL);
|
||||||
}
|
}
|
||||||
|
|
||||||
spin_lock(&trans->transaction->dirty_bgs_lock);
|
spin_lock(&trans->transaction->dirty_bgs_lock);
|
||||||
|
@ -175,12 +175,6 @@ static inline int clear_extent_uptodate(struct extent_io_tree *tree, u64 start,
|
|||||||
cached_state, GFP_NOFS, NULL);
|
cached_state, GFP_NOFS, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int set_extent_dirty(struct extent_io_tree *tree, u64 start,
|
|
||||||
u64 end, gfp_t mask)
|
|
||||||
{
|
|
||||||
return set_extent_bit(tree, start, end, EXTENT_DIRTY, NULL, mask);
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline int clear_extent_dirty(struct extent_io_tree *tree, u64 start,
|
static inline int clear_extent_dirty(struct extent_io_tree *tree, u64 start,
|
||||||
u64 end, struct extent_state **cached)
|
u64 end, struct extent_state **cached)
|
||||||
{
|
{
|
||||||
|
@ -2507,8 +2507,9 @@ static int pin_down_extent(struct btrfs_trans_handle *trans,
|
|||||||
spin_unlock(&cache->lock);
|
spin_unlock(&cache->lock);
|
||||||
spin_unlock(&cache->space_info->lock);
|
spin_unlock(&cache->space_info->lock);
|
||||||
|
|
||||||
set_extent_dirty(&trans->transaction->pinned_extents, bytenr,
|
set_extent_bit(&trans->transaction->pinned_extents, bytenr,
|
||||||
bytenr + num_bytes - 1, GFP_NOFS | __GFP_NOFAIL);
|
bytenr + num_bytes - 1, EXTENT_DIRTY, NULL,
|
||||||
|
GFP_NOFS | __GFP_NOFAIL);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4829,16 +4830,18 @@ btrfs_init_new_buffer(struct btrfs_trans_handle *trans, struct btrfs_root *root,
|
|||||||
* EXTENT bit to differentiate dirty pages.
|
* EXTENT bit to differentiate dirty pages.
|
||||||
*/
|
*/
|
||||||
if (buf->log_index == 0)
|
if (buf->log_index == 0)
|
||||||
set_extent_dirty(&root->dirty_log_pages, buf->start,
|
set_extent_bit(&root->dirty_log_pages, buf->start,
|
||||||
buf->start + buf->len - 1, GFP_NOFS);
|
buf->start + buf->len - 1,
|
||||||
|
EXTENT_DIRTY, NULL, GFP_NOFS);
|
||||||
else
|
else
|
||||||
set_extent_bit(&root->dirty_log_pages, buf->start,
|
set_extent_bit(&root->dirty_log_pages, buf->start,
|
||||||
buf->start + buf->len - 1,
|
buf->start + buf->len - 1,
|
||||||
EXTENT_NEW, NULL, GFP_NOFS);
|
EXTENT_NEW, NULL, GFP_NOFS);
|
||||||
} else {
|
} else {
|
||||||
buf->log_index = -1;
|
buf->log_index = -1;
|
||||||
set_extent_dirty(&trans->transaction->dirty_pages, buf->start,
|
set_extent_bit(&trans->transaction->dirty_pages, buf->start,
|
||||||
buf->start + buf->len - 1, GFP_NOFS);
|
buf->start + buf->len - 1, EXTENT_DIRTY, NULL,
|
||||||
|
GFP_NOFS);
|
||||||
}
|
}
|
||||||
/* this returns a buffer locked for blocking */
|
/* this returns a buffer locked for blocking */
|
||||||
return buf;
|
return buf;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user