diff options
Diffstat (limited to 'fs/btrfs/transaction.c')
-rw-r--r-- | fs/btrfs/transaction.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index de48e4ec808c..cdbb5022da52 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c | |||
@@ -857,6 +857,16 @@ static void update_super_roots(struct btrfs_root *root) | |||
857 | super->root_level = root_item->level; | 857 | super->root_level = root_item->level; |
858 | } | 858 | } |
859 | 859 | ||
860 | int btrfs_transaction_in_commit(struct btrfs_fs_info *info) | ||
861 | { | ||
862 | int ret = 0; | ||
863 | spin_lock(&info->new_trans_lock); | ||
864 | if (info->running_transaction) | ||
865 | ret = info->running_transaction->in_commit; | ||
866 | spin_unlock(&info->new_trans_lock); | ||
867 | return ret; | ||
868 | } | ||
869 | |||
860 | int btrfs_commit_transaction(struct btrfs_trans_handle *trans, | 870 | int btrfs_commit_transaction(struct btrfs_trans_handle *trans, |
861 | struct btrfs_root *root) | 871 | struct btrfs_root *root) |
862 | { | 872 | { |