xfs: add rmap btree operations
authorDarrick J. Wong <darrick.wong@oracle.com>
Wed, 3 Aug 2016 01:39:05 +0000 (11:39 +1000)
committerDave Chinner <david@fromorbit.com>
Wed, 3 Aug 2016 01:39:05 +0000 (11:39 +1000)
commit4b8ed67794fe57b23801c65f4ea5b0f0b1f0dbab
tree1114e25bd4a5faca22f87a478bd11e3d10edc683
parent525488520ac69a3612dbceefa573b255a83005e9
xfs: add rmap btree operations

Originally-From: Dave Chinner <dchinner@redhat.com>

Implement the generic btree operations needed to manipulate rmap
btree blocks. This is very similar to the per-ag freespace btree
implementation, and uses the AGFL for allocation and freeing of
blocks.

Adapt the rmap btree to store owner offsets within each rmap record,
and to handle the primary key being redefined as the tuple
[agblk, owner, offset].  The expansion of the primary key is crucial
to allowing multiple owners per extent.

[darrick: adapt the btree ops to deal with offsets]
[darrick: remove init_rec_from_key]
[darrick: move unwritten bit to rm_offset]

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
fs/xfs/libxfs/xfs_btree.h
fs/xfs/libxfs/xfs_rmap.c
fs/xfs/libxfs/xfs_rmap.h
fs/xfs/libxfs/xfs_rmap_btree.c
fs/xfs/xfs_trace.h