summaryrefslogtreecommitdiff
path: root/fs/xfs/libxfs/xfs_inode_fork.h
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2021-04-13 11:15:12 -0700
committerDarrick J. Wong <djwong@kernel.org>2021-04-15 09:35:51 -0700
commitb2197a36c0ef5b35a0ed83de744610a462da1ad3 (patch)
tree21611dca81125014a3e3904f8c4e8b7e7f2937fb /fs/xfs/libxfs/xfs_inode_fork.h
parent0779f4a68d4df539a7ea624f7e1560f48aa46ad9 (diff)
xfs: remove XFS_IFEXTENTS
The in-memory XFS_IFEXTENTS is now only used to check if an inode with extents still needs the extents to be read into memory before doing operations that need the extent map. Add a new xfs_need_iread_extents helper that returns true for btree format forks that do not have any entries in the in-memory extent btree, and use that instead of checking the XFS_IFEXTENTS flag. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Diffstat (limited to 'fs/xfs/libxfs/xfs_inode_fork.h')
-rw-r--r--fs/xfs/libxfs/xfs_inode_fork.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/xfs/libxfs/xfs_inode_fork.h b/fs/xfs/libxfs/xfs_inode_fork.h
index ac8b2182ce8c..a6f7897b6887 100644
--- a/fs/xfs/libxfs/xfs_inode_fork.h
+++ b/fs/xfs/libxfs/xfs_inode_fork.h
@@ -22,17 +22,11 @@ struct xfs_ifork {
char *if_data; /* inline file data */
} if_u1;
short if_broot_bytes; /* bytes allocated for root */
- unsigned char if_flags; /* per-fork flags */
int8_t if_format; /* format of this fork */
xfs_extnum_t if_nextents; /* # of extents in this fork */
};
/*
- * Per-fork incore inode flags.
- */
-#define XFS_IFEXTENTS 0x02 /* All extent pointers are read in */
-
-/*
* Worst-case increase in the fork extent count when we're adding a single
* extent to a fork and there's no possibility of splitting an existing mapping.
*/
@@ -236,4 +230,10 @@ int xfs_ifork_verify_local_attr(struct xfs_inode *ip);
int xfs_iext_count_may_overflow(struct xfs_inode *ip, int whichfork,
int nr_to_add);
+/* returns true if the fork has extents but they are not read in yet. */
+static inline bool xfs_need_iread_extents(struct xfs_ifork *ifp)
+{
+ return ifp->if_format == XFS_DINODE_FMT_BTREE && ifp->if_height == 0;
+}
+
#endif /* __XFS_INODE_FORK_H__ */