Btrfs: refactor btrfs_evict_inode() reserve refill dance
authorOmar Sandoval <osandov@fb.com>
Fri, 11 May 2018 20:13:36 +0000 (13:13 -0700)
committerDavid Sterba <dsterba@suse.com>
Mon, 28 May 2018 16:23:52 +0000 (18:23 +0200)
commit4b9d7b59bfcb62a7d438876eac5a054db32904dd
treec3e93971288d334bac61eb7954407b75e1a1835a
parentc08db7d8d295a4f3a10faaca376de011afff7950
Btrfs: refactor btrfs_evict_inode() reserve refill dance

The truncate loop in btrfs_evict_inode() does two things at once:

- It refills the temporary block reserve, potentially stealing from the
  global reserve or committing
- It calls btrfs_truncate_inode_items()

The tangle of continues hides the fact that these two steps are actually
separate. Split the first step out into a separate function both for
clarity and so that we can reuse it in a later patch.

Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Omar Sandoval <osandov@fb.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/inode.c