diff options
author | Yan, Zheng <zheng.yan@oracle.com> | 2010-05-16 10:49:58 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2010-05-25 10:34:52 -0400 |
commit | d68fc57b7e3245cfacf2e3b47acfed1946a11786 (patch) | |
tree | c2572fcd935017440c8370c8a12ceb49a7fc4f1f /fs/btrfs/ctree.h | |
parent | 8929ecfa50f266163832eeacfbc3642ed5eb83b6 (diff) |
Btrfs: Metadata reservation for orphan inodes
reserve metadata space for handling orphan inodes
Signed-off-by: Yan Zheng <zheng.yan@oracle.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/ctree.h')
-rw-r--r-- | fs/btrfs/ctree.h | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h index 504d5daf2f1c..fc324f9fcb42 100644 --- a/fs/btrfs/ctree.h +++ b/fs/btrfs/ctree.h | |||
@@ -1069,7 +1069,6 @@ struct btrfs_root { | |||
1069 | int ref_cows; | 1069 | int ref_cows; |
1070 | int track_dirty; | 1070 | int track_dirty; |
1071 | int in_radix; | 1071 | int in_radix; |
1072 | int clean_orphans; | ||
1073 | 1072 | ||
1074 | u64 defrag_trans_start; | 1073 | u64 defrag_trans_start; |
1075 | struct btrfs_key defrag_progress; | 1074 | struct btrfs_key defrag_progress; |
@@ -1083,8 +1082,11 @@ struct btrfs_root { | |||
1083 | 1082 | ||
1084 | struct list_head root_list; | 1083 | struct list_head root_list; |
1085 | 1084 | ||
1086 | spinlock_t list_lock; | 1085 | spinlock_t orphan_lock; |
1087 | struct list_head orphan_list; | 1086 | struct list_head orphan_list; |
1087 | struct btrfs_block_rsv *orphan_block_rsv; | ||
1088 | int orphan_item_inserted; | ||
1089 | int orphan_cleanup_state; | ||
1088 | 1090 | ||
1089 | spinlock_t inode_lock; | 1091 | spinlock_t inode_lock; |
1090 | /* red-black tree that keeps track of in-memory inodes */ | 1092 | /* red-black tree that keeps track of in-memory inodes */ |
@@ -2080,6 +2082,9 @@ int btrfs_trans_reserve_metadata(struct btrfs_trans_handle *trans, | |||
2080 | int num_items, int *retries); | 2082 | int num_items, int *retries); |
2081 | void btrfs_trans_release_metadata(struct btrfs_trans_handle *trans, | 2083 | void btrfs_trans_release_metadata(struct btrfs_trans_handle *trans, |
2082 | struct btrfs_root *root); | 2084 | struct btrfs_root *root); |
2085 | int btrfs_orphan_reserve_metadata(struct btrfs_trans_handle *trans, | ||
2086 | struct inode *inode); | ||
2087 | void btrfs_orphan_release_metadata(struct inode *inode); | ||
2083 | int btrfs_snap_reserve_metadata(struct btrfs_trans_handle *trans, | 2088 | int btrfs_snap_reserve_metadata(struct btrfs_trans_handle *trans, |
2084 | struct btrfs_pending_snapshot *pending); | 2089 | struct btrfs_pending_snapshot *pending); |
2085 | int btrfs_delalloc_reserve_metadata(struct inode *inode, u64 num_bytes); | 2090 | int btrfs_delalloc_reserve_metadata(struct inode *inode, u64 num_bytes); |
@@ -2404,6 +2409,13 @@ int btrfs_update_inode(struct btrfs_trans_handle *trans, | |||
2404 | int btrfs_orphan_add(struct btrfs_trans_handle *trans, struct inode *inode); | 2409 | int btrfs_orphan_add(struct btrfs_trans_handle *trans, struct inode *inode); |
2405 | int btrfs_orphan_del(struct btrfs_trans_handle *trans, struct inode *inode); | 2410 | int btrfs_orphan_del(struct btrfs_trans_handle *trans, struct inode *inode); |
2406 | void btrfs_orphan_cleanup(struct btrfs_root *root); | 2411 | void btrfs_orphan_cleanup(struct btrfs_root *root); |
2412 | void btrfs_orphan_pre_snapshot(struct btrfs_trans_handle *trans, | ||
2413 | struct btrfs_pending_snapshot *pending, | ||
2414 | u64 *bytes_to_reserve); | ||
2415 | void btrfs_orphan_post_snapshot(struct btrfs_trans_handle *trans, | ||
2416 | struct btrfs_pending_snapshot *pending); | ||
2417 | void btrfs_orphan_commit_root(struct btrfs_trans_handle *trans, | ||
2418 | struct btrfs_root *root); | ||
2407 | int btrfs_cont_expand(struct inode *inode, loff_t size); | 2419 | int btrfs_cont_expand(struct inode *inode, loff_t size); |
2408 | int btrfs_invalidate_inodes(struct btrfs_root *root); | 2420 | int btrfs_invalidate_inodes(struct btrfs_root *root); |
2409 | void btrfs_add_delayed_iput(struct inode *inode); | 2421 | void btrfs_add_delayed_iput(struct inode *inode); |