]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: slightly simplify global block reserve calculations
authorAnand Jain <anand.jain@oracle.com>
Tue, 4 Feb 2020 11:05:58 +0000 (19:05 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 23 Mar 2020 16:01:46 +0000 (17:01 +0100)
commit135d5910a5fc082a957789753282d93081e134b7
treea90c3ae17d57b27a5b48ba3e85ce8552a86d63a3
parentbfaede6299ec483f4be469a0d6a5f898fdf1a76f
btrfs: slightly simplify global block reserve calculations

In btrfs_update_global_block_rsv the lines:

  num_bytes = block_rsv->size - block_rsv->reserved;
  block_rsv->reserved += num_bytes;

imply:

  block_rsv->reserved = block_rsv->size;

Assign block_rsv->size to block_rsv->reserved directly and reorder lines
so they match the other branch.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/block-rsv.c