diff options
Diffstat (limited to 'fs/btrfs/transaction.c')
-rw-r--r-- | fs/btrfs/transaction.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index 3f6811cdf803..3b8ae1a8f02d 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c | |||
@@ -129,6 +129,24 @@ static inline int extwriter_counter_read(struct btrfs_transaction *trans) | |||
129 | } | 129 | } |
130 | 130 | ||
131 | /* | 131 | /* |
132 | * To be called after all the new block groups attached to the transaction | ||
133 | * handle have been created (btrfs_create_pending_block_groups()). | ||
134 | */ | ||
135 | void btrfs_trans_release_chunk_metadata(struct btrfs_trans_handle *trans) | ||
136 | { | ||
137 | struct btrfs_fs_info *fs_info = trans->fs_info; | ||
138 | |||
139 | if (!trans->chunk_bytes_reserved) | ||
140 | return; | ||
141 | |||
142 | WARN_ON_ONCE(!list_empty(&trans->new_bgs)); | ||
143 | |||
144 | btrfs_block_rsv_release(fs_info, &fs_info->chunk_block_rsv, | ||
145 | trans->chunk_bytes_reserved); | ||
146 | trans->chunk_bytes_reserved = 0; | ||
147 | } | ||
148 | |||
149 | /* | ||
132 | * either allocate a new transaction or hop into the existing one | 150 | * either allocate a new transaction or hop into the existing one |
133 | */ | 151 | */ |
134 | static noinline int join_transaction(struct btrfs_fs_info *fs_info, | 152 | static noinline int join_transaction(struct btrfs_fs_info *fs_info, |