ocfs2: Don't merge in 1st refcount ops of reflink.
authorTao Ma <tao.ma@oracle.com>
Tue, 18 Aug 2009 03:44:03 +0000 (11:44 +0800)
committerJoel Becker <joel.becker@oracle.com>
Wed, 23 Sep 2009 03:09:46 +0000 (20:09 -0700)
commit7540c1a77b26bc2f9d86a0bfbe6597b05ec5f93d
tree4b0414f74d265cfe496d5e5f39c6c6d240f6e713
parentce9c5a54c0f06b0efb4db8720a0616cc6aa0e5b2
ocfs2: Don't merge in 1st refcount ops of reflink.

Actually the whole reflink will touch refcount tree 2 times:
1. It will add the clusters in the extent record to the tree if it
   isn't refcounted before.
2. It will add 1 refcount to these clusters when it add these
   extent records to the tree.

So actually we shouldn't do merge in the 1st operation since the 2nd
one will soon be called and we may have to split it again. Do a merge
first and split soon is a waste of time. So we only merge in the 2nd
round. This is done by adding a new internal __ocfs2_increase_refcount
and call it with "not-merge" for 1st refcount operation in reflink.

This also has a side-effect that we don't need to worry too much about
the metadata allocation in the 2nd round since it will only merge and
no split will happen for those records.

Signed-off-by: Tao Ma <tao.ma@oracle.com>
fs/ocfs2/refcounttree.c