diff options
author | Yan, Zheng <zheng.yan@oracle.com> | 2010-05-16 10:48:46 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2010-05-25 10:34:50 -0400 |
commit | a22285a6a32390195235171b89d157ed1a1fe932 (patch) | |
tree | 3fabc88a029e1af4f2fdcc708e7b62ef3cf3703a /fs/btrfs/transaction.h | |
parent | f0486c68e4bd9a06a5904d3eeb3a0d73a83befb8 (diff) |
Btrfs: Integrate metadata reservation with start_transaction
Besides simplify the code, this change makes sure all metadata
reservation for normal metadata operations are released after
committing transaction.
Changes since V1:
Add code that check if unlink and rmdir will free space.
Add ENOSPC handling for clone ioctl.
Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/transaction.h')
-rw-r--r-- | fs/btrfs/transaction.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/fs/btrfs/transaction.h b/fs/btrfs/transaction.h index 56e728d70e39..14b3841b75d5 100644 --- a/fs/btrfs/transaction.h +++ b/fs/btrfs/transaction.h | |||
@@ -57,8 +57,11 @@ struct btrfs_trans_handle { | |||
57 | struct btrfs_pending_snapshot { | 57 | struct btrfs_pending_snapshot { |
58 | struct dentry *dentry; | 58 | struct dentry *dentry; |
59 | struct btrfs_root *root; | 59 | struct btrfs_root *root; |
60 | char *name; | 60 | struct btrfs_root *snap; |
61 | struct btrfs_key root_key; | 61 | /* block reservation for the operation */ |
62 | struct btrfs_block_rsv block_rsv; | ||
63 | /* extra metadata reseration for relocation */ | ||
64 | int error; | ||
62 | struct list_head list; | 65 | struct list_head list; |
63 | }; | 66 | }; |
64 | 67 | ||
@@ -85,11 +88,11 @@ static inline void btrfs_set_inode_last_trans(struct btrfs_trans_handle *trans, | |||
85 | int btrfs_end_transaction(struct btrfs_trans_handle *trans, | 88 | int btrfs_end_transaction(struct btrfs_trans_handle *trans, |
86 | struct btrfs_root *root); | 89 | struct btrfs_root *root); |
87 | struct btrfs_trans_handle *btrfs_start_transaction(struct btrfs_root *root, | 90 | struct btrfs_trans_handle *btrfs_start_transaction(struct btrfs_root *root, |
88 | int num_blocks); | 91 | int num_items); |
89 | struct btrfs_trans_handle *btrfs_join_transaction(struct btrfs_root *root, | 92 | struct btrfs_trans_handle *btrfs_join_transaction(struct btrfs_root *root, |
90 | int num_blocks); | 93 | int num_blocks); |
91 | struct btrfs_trans_handle *btrfs_start_ioctl_transaction(struct btrfs_root *r, | 94 | struct btrfs_trans_handle *btrfs_start_ioctl_transaction(struct btrfs_root *r, |
92 | int num_blocks); | 95 | int num_blocks); |
93 | int btrfs_write_and_wait_transaction(struct btrfs_trans_handle *trans, | 96 | int btrfs_write_and_wait_transaction(struct btrfs_trans_handle *trans, |
94 | struct btrfs_root *root); | 97 | struct btrfs_root *root); |
95 | int btrfs_commit_tree_roots(struct btrfs_trans_handle *trans, | 98 | int btrfs_commit_tree_roots(struct btrfs_trans_handle *trans, |