diff options
-rw-r--r-- | fs/btrfs/TODO | 3 | ||||
-rw-r--r-- | fs/btrfs/extent-tree.c | 17 |
2 files changed, 18 insertions, 2 deletions
diff --git a/fs/btrfs/TODO b/fs/btrfs/TODO index 5ff2cef9f028..6a8c8cd03ca4 100644 --- a/fs/btrfs/TODO +++ b/fs/btrfs/TODO | |||
@@ -6,8 +6,7 @@ | |||
6 | * Check compat and incompat flags on the inode | 6 | * Check compat and incompat flags on the inode |
7 | * Get rid of struct ctree_path, limiting tree levels held at one time | 7 | * Get rid of struct ctree_path, limiting tree levels held at one time |
8 | * Add generation number to key pointer in nodes | 8 | * Add generation number to key pointer in nodes |
9 | * Add parent pointer back to extent map. | 9 | * Add generation number to inode |
10 | * Implement real list of pending transactions | ||
11 | * Release | 10 | * Release |
12 | * Do real tree locking | 11 | * Do real tree locking |
13 | * Add extent mirroring (backup copies of blocks) | 12 | * Add extent mirroring (backup copies of blocks) |
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index aca5802a8a1e..afc5267515e2 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c | |||
@@ -291,10 +291,18 @@ static int update_block_group(struct btrfs_trans_handle *trans, | |||
291 | return 0; | 291 | return 0; |
292 | } | 292 | } |
293 | 293 | ||
294 | static int try_remove_page(struct address_space *mapping, unsigned long index) | ||
295 | { | ||
296 | int ret; | ||
297 | ret = invalidate_mapping_pages(mapping, index, index); | ||
298 | return ret; | ||
299 | } | ||
300 | |||
294 | int btrfs_finish_extent_commit(struct btrfs_trans_handle *trans, struct | 301 | int btrfs_finish_extent_commit(struct btrfs_trans_handle *trans, struct |
295 | btrfs_root *root) | 302 | btrfs_root *root) |
296 | { | 303 | { |
297 | unsigned long gang[8]; | 304 | unsigned long gang[8]; |
305 | struct inode *btree_inode = root->fs_info->btree_inode; | ||
298 | u64 first = 0; | 306 | u64 first = 0; |
299 | int ret; | 307 | int ret; |
300 | int i; | 308 | int i; |
@@ -309,6 +317,9 @@ int btrfs_finish_extent_commit(struct btrfs_trans_handle *trans, struct | |||
309 | first = gang[0]; | 317 | first = gang[0]; |
310 | for (i = 0; i < ret; i++) { | 318 | for (i = 0; i < ret; i++) { |
311 | clear_radix_bit(pinned_radix, gang[i]); | 319 | clear_radix_bit(pinned_radix, gang[i]); |
320 | try_remove_page(btree_inode->i_mapping, | ||
321 | gang[i] << (PAGE_CACHE_SHIFT - | ||
322 | btree_inode->i_blkbits)); | ||
312 | } | 323 | } |
313 | } | 324 | } |
314 | if (root->fs_info->block_group_cache) { | 325 | if (root->fs_info->block_group_cache) { |
@@ -600,6 +611,12 @@ check_pending: | |||
600 | */ | 611 | */ |
601 | btrfs_release_path(root, path); | 612 | btrfs_release_path(root, path); |
602 | BUG_ON(ins->objectid < search_start); | 613 | BUG_ON(ins->objectid < search_start); |
614 | if (ins->objectid >= btrfs_super_total_blocks(info->disk_super)) { | ||
615 | if (search_start == 0) | ||
616 | return -ENOSPC; | ||
617 | search_start = 0; | ||
618 | goto check_failed; | ||
619 | } | ||
603 | for (test_block = ins->objectid; | 620 | for (test_block = ins->objectid; |
604 | test_block < ins->objectid + num_blocks; test_block++) { | 621 | test_block < ins->objectid + num_blocks; test_block++) { |
605 | if (test_radix_bit(&info->pinned_radix, test_block)) { | 622 | if (test_radix_bit(&info->pinned_radix, test_block)) { |