aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/inode-map.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/inode-map.c')
-rw-r--r--fs/btrfs/inode-map.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/fs/btrfs/inode-map.c b/fs/btrfs/inode-map.c
index 2c66ddbbe670..ab485e57b6fe 100644
--- a/fs/btrfs/inode-map.c
+++ b/fs/btrfs/inode-map.c
@@ -78,10 +78,8 @@ again:
78 btrfs_transaction_in_commit(fs_info)) { 78 btrfs_transaction_in_commit(fs_info)) {
79 leaf = path->nodes[0]; 79 leaf = path->nodes[0];
80 80
81 if (btrfs_header_nritems(leaf) == 0) { 81 if (WARN_ON(btrfs_header_nritems(leaf) == 0))
82 WARN_ON(1);
83 break; 82 break;
84 }
85 83
86 /* 84 /*
87 * Save the key so we can advances forward 85 * Save the key so we can advances forward
@@ -237,7 +235,7 @@ again:
237 start_caching(root); 235 start_caching(root);
238 236
239 if (objectid <= root->cache_progress || 237 if (objectid <= root->cache_progress ||
240 objectid > root->highest_objectid) 238 objectid >= root->highest_objectid)
241 __btrfs_add_free_space(ctl, objectid, 1); 239 __btrfs_add_free_space(ctl, objectid, 1);
242 else 240 else
243 __btrfs_add_free_space(pinned, objectid, 1); 241 __btrfs_add_free_space(pinned, objectid, 1);
@@ -412,8 +410,7 @@ int btrfs_save_ino_cache(struct btrfs_root *root,
412 return 0; 410 return 0;
413 411
414 /* Don't save inode cache if we are deleting this root */ 412 /* Don't save inode cache if we are deleting this root */
415 if (btrfs_root_refs(&root->root_item) == 0 && 413 if (btrfs_root_refs(&root->root_item) == 0)
416 root != root->fs_info->tree_root)
417 return 0; 414 return 0;
418 415
419 if (!btrfs_test_opt(root, INODE_MAP_CACHE)) 416 if (!btrfs_test_opt(root, INODE_MAP_CACHE))
@@ -467,7 +464,7 @@ again:
467 } 464 }
468 465
469 if (i_size_read(inode) > 0) { 466 if (i_size_read(inode) > 0) {
470 ret = btrfs_truncate_free_space_cache(root, trans, path, inode); 467 ret = btrfs_truncate_free_space_cache(root, trans, inode);
471 if (ret) { 468 if (ret) {
472 if (ret != -ENOSPC) 469 if (ret != -ENOSPC)
473 btrfs_abort_transaction(trans, root, ret); 470 btrfs_abort_transaction(trans, root, ret);
@@ -504,7 +501,7 @@ again:
504 } 501 }
505 btrfs_free_reserved_data_space(inode, prealloc); 502 btrfs_free_reserved_data_space(inode, prealloc);
506 503
507 ret = btrfs_write_out_ino_cache(root, trans, path); 504 ret = btrfs_write_out_ino_cache(root, trans, path, inode);
508out_put: 505out_put:
509 iput(inode); 506 iput(inode);
510out_release: 507out_release: