diff options
author | Darrick J. Wong <darrick.wong@oracle.com> | 2016-10-03 18:11:27 +0200 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2016-10-04 20:05:44 +0200 |
commit | f65306ea5246ef3ff68a6abf85f5a73a04903366 (patch) | |
tree | 2c2f8ae61ce162c8c79cd5b8ea86266331ec83a6 /fs/xfs/libxfs/xfs_bmap.h | |
parent | xfs: log bmap intent items (diff) | |
download | linux-f65306ea5246ef3ff68a6abf85f5a73a04903366.tar.xz linux-f65306ea5246ef3ff68a6abf85f5a73a04903366.zip |
xfs: map an inode's offset to an exact physical block
Teach the bmap routine to know how to map a range of file blocks to a
specific range of physical blocks, instead of simply allocating fresh
blocks. This enables reflink to map a file to blocks that are already
in use.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/xfs/libxfs/xfs_bmap.h')
-rw-r--r-- | fs/xfs/libxfs/xfs_bmap.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/fs/xfs/libxfs/xfs_bmap.h b/fs/xfs/libxfs/xfs_bmap.h index 7219207d58eb..8e69b5329629 100644 --- a/fs/xfs/libxfs/xfs_bmap.h +++ b/fs/xfs/libxfs/xfs_bmap.h @@ -97,6 +97,13 @@ struct xfs_extent_free_item */ #define XFS_BMAPI_ZERO 0x080 +/* + * Map the inode offset to the block given in ap->firstblock. Primarily + * used for reflink. The range must be in a hole, and this flag cannot be + * turned on with PREALLOC or CONVERT, and cannot be used on the attr fork. + */ +#define XFS_BMAPI_REMAP 0x100 + #define XFS_BMAPI_FLAGS \ { XFS_BMAPI_ENTIRE, "ENTIRE" }, \ { XFS_BMAPI_METADATA, "METADATA" }, \ @@ -105,7 +112,8 @@ struct xfs_extent_free_item { XFS_BMAPI_IGSTATE, "IGSTATE" }, \ { XFS_BMAPI_CONTIG, "CONTIG" }, \ { XFS_BMAPI_CONVERT, "CONVERT" }, \ - { XFS_BMAPI_ZERO, "ZERO" } + { XFS_BMAPI_ZERO, "ZERO" }, \ + { XFS_BMAPI_REMAP, "REMAP" } static inline int xfs_bmapi_aflag(int w) |