summaryrefslogtreecommitdiff
path: root/fs/xfs/libxfs/xfs_types.h
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2017-11-03 10:34:43 -0700
committerDarrick J. Wong <darrick.wong@oracle.com>2017-11-06 11:53:40 -0800
commitb2b1712a640824e7c131bfdd2585d57bf8ccb39a (patch)
treead756c7caa0bb7252aaf444b077c518e0a5d9f0f /fs/xfs/libxfs/xfs_types.h
parent906abed501bf5a2103946deb7a4a40b31c56f027 (diff)
xfs: introduce the xfs_iext_cursor abstraction
Add a new xfs_iext_cursor structure to hide the direct extent map index manipulations. In addition to the existing lookup/get/insert/ remove and update routines new primitives to get the first and last extent cursor, as well as moving up and down by one extent are provided. Also new are convenience to increment/decrement the cursor and retreive the new extent, as well as to peek into the previous/next extent without updating the cursor and last but not least a macro to iterate over all extents in a fork. [darrick: rename for_each_iext to for_each_xfs_iext] Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'fs/xfs/libxfs/xfs_types.h')
-rw-r--r--fs/xfs/libxfs/xfs_types.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/xfs/libxfs/xfs_types.h b/fs/xfs/libxfs/xfs_types.h
index f04dbfb2f50d..5da6382bdaf1 100644
--- a/fs/xfs/libxfs/xfs_types.h
+++ b/fs/xfs/libxfs/xfs_types.h
@@ -142,5 +142,8 @@ typedef uint32_t xfs_dqid_t;
#define XFS_NBWORD (1 << XFS_NBWORDLOG)
#define XFS_WORDMASK ((1 << XFS_WORDLOG) - 1)
+struct xfs_iext_cursor {
+ xfs_extnum_t idx;
+};
#endif /* __XFS_TYPES_H__ */