summaryrefslogtreecommitdiff
path: root/transaction.h
diff options
context:
space:
mode:
authorYan <yanzheng@21cn.com>2007-12-05 10:41:38 -0500
committerDavid Woodhouse <dwmw2@hera.kernel.org>2007-12-05 10:41:38 -0500
commit07a4f1b81df6cd9b9e09773f680fc098faed310c (patch)
tree3543dcbdbe4fd1c153f468d2976bcebc34b72ae7 /transaction.h
parent1c2b38fe25fe6496d51d41aee7a5a1eb2e2694d8 (diff)
Update btrfs-progs to better match the kernel
Diffstat (limited to 'transaction.h')
-rw-r--r--transaction.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/transaction.h b/transaction.h
index bffd5b2b..ac026aad 100644
--- a/transaction.h
+++ b/transaction.h
@@ -28,8 +28,11 @@ struct btrfs_trans_handle {
static inline struct btrfs_trans_handle *
btrfs_start_transaction(struct btrfs_root *root, int num_blocks)
{
+ struct btrfs_fs_info *fs_info = root->fs_info;
struct btrfs_trans_handle *h = malloc(sizeof(*h));
- h->transid = root->root_key.offset;
+ fs_info->running_transaction = h;
+ fs_info->generation++;
+ h->transid = fs_info->generation;
h->blocks_reserved = num_blocks;
h->blocks_used = 0;
return h;