diff options
author | Chris Mason <chris.mason@oracle.com> | 2011-11-10 20:39:08 -0500 |
---|---|---|
committer | Chris Mason <chris.mason@oracle.com> | 2011-11-10 20:39:08 -0500 |
commit | 2115133f8b9a8dbdb217d14080814df07ce90479 (patch) | |
tree | 3b2f3d6839cdb1f6495ae10dd548f7fbfee70266 /fs/btrfs/delayed-inode.c | |
parent | 7fd2ae21a42d178982679b86086661292b4afe4a (diff) |
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 313ee14cf3b7..6a1a6800776c 100644 --- a/fs/btrfs/delayed-inode.c +++ b/fs/btrfs/delayed-inode.c | |||
@@ -692,11 +692,6 @@ static int btrfs_delayed_inode_reserve_metadata( | |||
692 | 692 | ||
693 | migrate: | 693 | migrate: |
694 | ret = btrfs_block_rsv_migrate(src_rsv, dst_rsv, num_bytes); | 694 | ret = btrfs_block_rsv_migrate(src_rsv, dst_rsv, num_bytes); |
695 | if (unlikely(ret)) { | ||
696 | /* This shouldn't happen */ | ||
697 | BUG_ON(release); | ||
698 | return ret; | ||
699 | } | ||
700 | 695 | ||
701 | out: | 696 | out: |
702 | /* | 697 | /* |
@@ -712,9 +707,11 @@ out: | |||
712 | * reservation here. I think it may be time for a documentation page on | 707 | * reservation here. I think it may be time for a documentation page on |
713 | * how block rsvs. work. | 708 | * how block rsvs. work. |
714 | */ | 709 | */ |
710 | if (!ret) | ||
711 | node->bytes_reserved = num_bytes; | ||
712 | |||
715 | if (release) | 713 | if (release) |
716 | btrfs_block_rsv_release(root, src_rsv, num_bytes); | 714 | btrfs_block_rsv_release(root, src_rsv, num_bytes); |
717 | node->bytes_reserved = num_bytes; | ||
718 | 715 | ||
719 | return ret; | 716 | return ret; |
720 | } | 717 | } |