Btrfs: tweak the delayed inode reservations again

Josef sent along an incremental to the inode reservation
code to make sure we try and fall back to directly updating
the inode item if things go horribly wrong.

This reworks that patch slightly, adding a fallback function
that will always try to update the inode item directly without
going through the delayed_inode code.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
This commit is contained in:
Chris Mason
2011-11-10 20:39:08 -05:00
parent 7fd2ae21a4
commit 2115133f8b
2 changed files with 47 additions and 26 deletions

View File

@ -692,11 +692,6 @@ static int btrfs_delayed_inode_reserve_metadata(
migrate:
ret = btrfs_block_rsv_migrate(src_rsv, dst_rsv, num_bytes);
if (unlikely(ret)) {
/* This shouldn't happen */
BUG_ON(release);
return ret;
}
out:
/*
@ -712,9 +707,11 @@ out:
* reservation here. I think it may be time for a documentation page on
* how block rsvs. work.
*/
if (!ret)
node->bytes_reserved = num_bytes;
if (release)
btrfs_block_rsv_release(root, src_rsv, num_bytes);
node->bytes_reserved = num_bytes;
return ret;
}