Btrfs: mark delayed refs as for cow
authorArne Jansen <sensille@gmx.net>
Mon, 12 Sep 2011 13:26:38 +0000 (15:26 +0200)
committerJan Schmidt <list.btrfs@jan-o-sch.net>
Thu, 22 Dec 2011 15:22:27 +0000 (16:22 +0100)
commit66d7e7f09f77456fe68683247d77721032a00ee5
treebbf7df3933ed47aa202d60d835864543d25df82d
parentc7d22a3c3cdb73d8a0151e2ccc8cf4a48c48310b
Btrfs: mark delayed refs as for cow

Add a for_cow parameter to add_delayed_*_ref and pass the appropriate value
from every call site. The for_cow parameter will later on be used to
determine if a ref will change anything with respect to qgroups.

Delayed refs coming from relocation are always counted as for_cow, as they
don't change subvol quota.

Also pass in the fs_info for later use.

btrfs_find_all_roots() will use this as an optimization, as changes that are
for_cow will not change anything with respect to which root points to a
certain leaf. Thus, we don't need to add the current sequence number to
those delayed refs.

Signed-off-by: Arne Jansen <sensille@gmx.net>
Signed-off-by: Jan Schmidt <list.btrfs@jan-o-sch.net>
12 files changed:
fs/btrfs/ctree.c
fs/btrfs/ctree.h
fs/btrfs/delayed-ref.c
fs/btrfs/delayed-ref.h
fs/btrfs/disk-io.c
fs/btrfs/extent-tree.c
fs/btrfs/file.c
fs/btrfs/inode.c
fs/btrfs/ioctl.c
fs/btrfs/relocation.c
fs/btrfs/transaction.c
fs/btrfs/tree-log.c