aboutsummaryrefslogtreecommitdiffstats
path: root/disk-io.c
diff options
context:
space:
mode:
authorQu Wenruo <quwenruo@cn.fujitsu.com>2015-05-11 16:08:46 +0800
committerDavid Sterba <dsterba@suse.cz>2015-05-14 15:41:07 +0200
commit92b020ee0487b34282169a55a91261cee3daa1fe (patch)
treee1c66ec13071f673c0bde839d686167d06c24d98 /disk-io.c
parent2259f03439bd697b64efdb09dfc75638f24c4b48 (diff)
downloadbtrfs-progs-92b020ee0487b34282169a55a91261cee3daa1fe.tar.gz
btrfs-progs-92b020ee0487b34282169a55a91261cee3daa1fe.tar.xz
btrfs-progs-92b020ee0487b34282169a55a91261cee3daa1fe.zip
btrfs-progs: Export write_tree_block
Export write_tree_block() function and allow it write extent without transaction. This provides the basis for later uuid change function. Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz>
Diffstat (limited to 'disk-io.c')
-rw-r--r--disk-io.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/disk-io.c b/disk-io.c
index 3daed3b..2a7feb0 100644
--- a/disk-io.c
+++ b/disk-io.c
@@ -372,7 +372,7 @@ int write_and_map_eb(struct btrfs_trans_handle *trans,
return 0;
}
-static int write_tree_block(struct btrfs_trans_handle *trans,
+int write_tree_block(struct btrfs_trans_handle *trans,
struct btrfs_root *root,
struct extent_buffer *eb)
{
@@ -381,7 +381,7 @@ static int write_tree_block(struct btrfs_trans_handle *trans,
BUG();
}
- if (!btrfs_buffer_uptodate(eb, trans->transid))
+ if (trans && !btrfs_buffer_uptodate(eb, trans->transid))
BUG();
btrfs_set_header_flag(eb, BTRFS_HEADER_FLAG_WRITTEN);