aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ctree.c
diff options
context:
space:
mode:
authorChris Mason <chris.mason@oracle.com>2008-06-25 16:01:30 -0400
committerChris Mason <chris.mason@oracle.com>2008-09-25 11:04:03 -0400
commit594a24eb0e7fa8413f8b443863be4b7c72bfde9f (patch)
tree616ddbee05148d18096fc56daf0a9af598078fc6 /fs/btrfs/ctree.c
parent051e1b9f748ae673b7325d3fc049bb838606cffa (diff)
Fix btrfs_del_ordered_inode to allow forcing the drop during unlinks
This allows us to delete an unlinked inode with dirty pages from the list instead of forcing commit to write these out before deleting the inode. Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/ctree.c')
-rw-r--r--fs/btrfs/ctree.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
index 1b756fae2799..9601241e552b 100644
--- a/fs/btrfs/ctree.c
+++ b/fs/btrfs/ctree.c
@@ -1245,7 +1245,10 @@ int btrfs_search_slot(struct btrfs_trans_handle *trans, struct btrfs_root
1245 int level; 1245 int level;
1246 int should_reada = p->reada; 1246 int should_reada = p->reada;
1247 int lowest_unlock = 1; 1247 int lowest_unlock = 1;
1248 int blocksize;
1248 u8 lowest_level = 0; 1249 u8 lowest_level = 0;
1250 u64 blocknr;
1251 u64 gen;
1249 1252
1250 lowest_level = p->lowest_level; 1253 lowest_level = p->lowest_level;
1251 WARN_ON(lowest_level && ins_len); 1254 WARN_ON(lowest_level && ins_len);
@@ -1320,11 +1323,12 @@ again:
1320 reada_for_search(root, p, level, slot, 1323 reada_for_search(root, p, level, slot,
1321 key->objectid); 1324 key->objectid);
1322 1325
1323 tmp = btrfs_find_tree_block(root, 1326 blocknr = btrfs_node_blockptr(b, slot);
1324 btrfs_node_blockptr(b, slot), 1327 gen = btrfs_node_ptr_generation(b, slot);
1325 btrfs_level_size(root, level - 1)); 1328 blocksize = btrfs_level_size(root, level - 1);
1326 if (tmp && btrfs_buffer_uptodate(tmp, 1329
1327 btrfs_node_ptr_generation(b, slot))) { 1330 tmp = btrfs_find_tree_block(root, blocknr, blocksize);
1331 if (tmp && btrfs_buffer_uptodate(tmp, gen)) {
1328 b = tmp; 1332 b = tmp;
1329 } else { 1333 } else {
1330 /* 1334 /*
@@ -1336,6 +1340,10 @@ again:
1336 btrfs_release_path(NULL, p); 1340 btrfs_release_path(NULL, p);
1337 if (tmp) 1341 if (tmp)
1338 free_extent_buffer(tmp); 1342 free_extent_buffer(tmp);
1343 tmp = read_tree_block(root, blocknr,
1344 blocksize, gen);
1345 if (tmp)
1346 free_extent_buffer(tmp);
1339 goto again; 1347 goto again;
1340 } else { 1348 } else {
1341 b = read_node_slot(root, b, slot); 1349 b = read_node_slot(root, b, slot);