summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2017-08-28 17:44:41 +0200
committerDavid Sterba <dsterba@suse.com>2017-09-08 16:15:05 +0200
commit355a052647e3a3bab49dfea3f0281f0d5efae4ae (patch)
tree9c3c6eea39ab1b790a0163cbee4333f6f069fe9a
parent0ee0b57f0b7ebfa72a2525afeecc353fd74aca03 (diff)
btrfs-progs: start framework for transaction abort
Signed-off-by: David Sterba <dsterba@suse.com>
-rw-r--r--ctree.h2
-rw-r--r--transaction.c4
-rw-r--r--transaction.h1
3 files changed, 7 insertions, 0 deletions
diff --git a/ctree.h b/ctree.h
index 4ad34f60..2818441f 100644
--- 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,
diff --git a/transaction.c b/transaction.c
index 6677a220..feca06b4 100644
--- a/transaction.c
+++ b/transaction.c
@@ -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;
+}
diff --git a/transaction.h b/transaction.h
index ccbecce9..470ee3de 100644
--- a/transaction.h
+++ b/transaction.h
@@ -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