xfs: add shared rmap map/unmap/convert log item types
authorDarrick J. Wong <darrick.wong@oracle.com>
Mon, 3 Oct 2016 16:11:47 +0000 (09:11 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Wed, 5 Oct 2016 23:26:29 +0000 (16:26 -0700)
Wire up some rmap log redo item type codes to map, unmap, or convert
shared data block extents.  The actual log item recovery comes in a
later patch.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
fs/xfs/libxfs/xfs_log_format.h
fs/xfs/xfs_rmap_item.c
fs/xfs/xfs_trans_rmap.c

index 364ce6fcc2134eb4eaa66d4ae924ba0067a438be..083cdd6d6c28cecdf9af7d45df56cdc6d9a13665 100644 (file)
@@ -635,8 +635,11 @@ struct xfs_map_extent {
 
 /* rmap me_flags: upper bits are flags, lower byte is type code */
 #define XFS_RMAP_EXTENT_MAP            1
+#define XFS_RMAP_EXTENT_MAP_SHARED     2
 #define XFS_RMAP_EXTENT_UNMAP          3
+#define XFS_RMAP_EXTENT_UNMAP_SHARED   4
 #define XFS_RMAP_EXTENT_CONVERT                5
+#define XFS_RMAP_EXTENT_CONVERT_SHARED 6
 #define XFS_RMAP_EXTENT_ALLOC          7
 #define XFS_RMAP_EXTENT_FREE           8
 #define XFS_RMAP_EXTENT_TYPE_MASK      0xFF
index 0432a459871c6e086db5928bddfc4460d14562e6..19d817e3e1d936b99c42108766853aa20860dac0 100644 (file)
@@ -441,8 +441,11 @@ xfs_rui_recover(
                                   XFS_FSB_TO_DADDR(mp, rmap->me_startblock));
                switch (rmap->me_flags & XFS_RMAP_EXTENT_TYPE_MASK) {
                case XFS_RMAP_EXTENT_MAP:
+               case XFS_RMAP_EXTENT_MAP_SHARED:
                case XFS_RMAP_EXTENT_UNMAP:
+               case XFS_RMAP_EXTENT_UNMAP_SHARED:
                case XFS_RMAP_EXTENT_CONVERT:
+               case XFS_RMAP_EXTENT_CONVERT_SHARED:
                case XFS_RMAP_EXTENT_ALLOC:
                case XFS_RMAP_EXTENT_FREE:
                        op_ok = true;
index 5a50ef881568024fb4f7e543ac7e1b1272df0a50..9ead064b5e90ae34507c450cfa24988c8bc669c1 100644 (file)
@@ -48,12 +48,21 @@ xfs_trans_set_rmap_flags(
        case XFS_RMAP_MAP:
                rmap->me_flags |= XFS_RMAP_EXTENT_MAP;
                break;
+       case XFS_RMAP_MAP_SHARED:
+               rmap->me_flags |= XFS_RMAP_EXTENT_MAP_SHARED;
+               break;
        case XFS_RMAP_UNMAP:
                rmap->me_flags |= XFS_RMAP_EXTENT_UNMAP;
                break;
+       case XFS_RMAP_UNMAP_SHARED:
+               rmap->me_flags |= XFS_RMAP_EXTENT_UNMAP_SHARED;
+               break;
        case XFS_RMAP_CONVERT:
                rmap->me_flags |= XFS_RMAP_EXTENT_CONVERT;
                break;
+       case XFS_RMAP_CONVERT_SHARED:
+               rmap->me_flags |= XFS_RMAP_EXTENT_CONVERT_SHARED;
+               break;
        case XFS_RMAP_ALLOC:
                rmap->me_flags |= XFS_RMAP_EXTENT_ALLOC;
                break;