btrfs-progs: start framework for transaction abort
authorDavid Sterba <dsterba@suse.com>
Mon, 28 Aug 2017 15:44:41 +0000 (17:44 +0200)
committerDavid Sterba <dsterba@suse.com>
Fri, 8 Sep 2017 14:15:05 +0000 (16:15 +0200)
Signed-off-by: David Sterba <dsterba@suse.com>
ctree.h
transaction.c
transaction.h

diff --git a/ctree.h b/ctree.h
index 4ad34f6..2818441 100644 (file)
--- a/ctree.h
+++ b/ctree.h
@@ -1139,6 +1139,8 @@ struct btrfs_fs_info {
        unsigned int avoid_sys_chunk_alloc:1;
        unsigned int finalize_on_close:1;
 
+       int transaction_aborted;
+
        int (*free_extent_hook)(struct btrfs_trans_handle *trans,
                                struct btrfs_root *root,
                                u64 bytenr, u64 num_bytes, u64 parent,
index 6677a22..feca06b 100644 (file)
@@ -173,3 +173,7 @@ commit_tree:
        return 0;
 }
 
+void btrfs_abort_transaction(struct btrfs_trans_handle *trans, int error)
+{
+       trans->fs_info->transaction_aborted = error;
+}
index ccbecce..470ee3d 100644 (file)
@@ -40,5 +40,6 @@ int commit_tree_roots(struct btrfs_trans_handle *trans,
                             struct btrfs_fs_info *fs_info);
 int btrfs_commit_transaction(struct btrfs_trans_handle *trans,
                             struct btrfs_root *root);
+void btrfs_abort_transaction(struct btrfs_trans_handle *trans, int error);
 
 #endif