diff options
author | Chris Mason <chris.mason@oracle.com> | 2011-11-11 01:39:08 (GMT) |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2011-11-11 01:39:08 (GMT) |
commit | 2115133f8b9a8dbdb217d14080814df07ce90479 (patch) | |
tree | 3b2f3d6839cdb1f6495ae10dd548f7fbfee70266 /fs/btrfs/delayed-inode.c | |
parent | 7fd2ae21a42d178982679b86086661292b4afe4a (diff) | |
download | linux-fsl-qoriq-2115133f8b9a8dbdb217d14080814df07ce90479.tar.xz |
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>
Diffstat (limited to 'fs/btrfs/delayed-inode.c')
-rw-r--r-- | fs/btrfs/delayed-inode.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/fs/btrfs/delayed-inode.c b/fs/btrfs/delayed-inode.c index 313ee14..6a1a680 100644 --- a/fs/btrfs/delayed-inode.c +++ b/fs/btrfs/delayed-inode.c @@ -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; } |