xfs: propagate bmap updates to rmapbt
authorDarrick J. Wong <darrick.wong@oracle.com>
Wed, 3 Aug 2016 02:16:05 +0000 (12:16 +1000)
committerDave Chinner <david@fromorbit.com>
Wed, 3 Aug 2016 02:16:05 +0000 (12:16 +1000)
commit9c19464469556a0cd342fc40a24926ab46d7d243
treec4cd6d84d5e799734cefc169ef627103b485d511
parentf8dbebef98f0b960a0e91d6b8d45c288c377797b
xfs: propagate bmap updates to rmapbt

When we map, unmap, or convert an extent in a file's data or attr
fork, schedule a respective update in the rmapbt.  Previous versions
of this patch required a 1:1 correspondence between bmap and rmap,
but this is no longer true as we now have ability to make interval
queries against the rmapbt.

We use the deferred operations code to handle redo operations
atomically and deadlock free.  This plumbs in all five rmap actions
(map, unmap, convert extent, alloc, free); we'll use the first three
now for file data, and reflink will want the last two.  We also add
an error injection site to test log recovery.

Finally, we need to fix the bmap shift extent code to adjust the
rmaps correctly.

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_bmap.c
fs/xfs/libxfs/xfs_rmap.c
fs/xfs/libxfs/xfs_rmap.h
fs/xfs/xfs_bmap_util.c
fs/xfs/xfs_error.h
fs/xfs/xfs_rmap_item.c
fs/xfs/xfs_trans.h
fs/xfs/xfs_trans_rmap.c