Commit 63fbb4c1 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Darrick J. Wong

xfs: remove the ISUNWRITTEN macro

Opencoding the trivial checks makes it much easier to read (and grep..).
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
parent 9c4f29d3
...@@ -30,7 +30,6 @@ struct xfs_trans; ...@@ -30,7 +30,6 @@ struct xfs_trans;
#define XFS_EXTFMT_INODE(x) \ #define XFS_EXTFMT_INODE(x) \
(xfs_sb_version_hasextflgbit(&((x)->i_mount->m_sb)) ? \ (xfs_sb_version_hasextflgbit(&((x)->i_mount->m_sb)) ? \
XFS_EXTFMT_HASSTATE : XFS_EXTFMT_NOSTATE) XFS_EXTFMT_HASSTATE : XFS_EXTFMT_NOSTATE)
#define ISUNWRITTEN(x) ((x)->br_state == XFS_EXT_UNWRITTEN)
/* /*
* Btree block header size depends on a superblock flag. * Btree block header size depends on a superblock flag.
......
...@@ -1261,8 +1261,8 @@ xfs_get_blocks( ...@@ -1261,8 +1261,8 @@ xfs_get_blocks(
if (nimaps) { if (nimaps) {
trace_xfs_get_blocks_found(ip, offset, size, trace_xfs_get_blocks_found(ip, offset, size,
ISUNWRITTEN(&imap) ? XFS_IO_UNWRITTEN imap.br_state == XFS_EXT_UNWRITTEN ?
: XFS_IO_OVERWRITE, &imap); XFS_IO_UNWRITTEN : XFS_IO_OVERWRITE, &imap);
xfs_iunlock(ip, lockmode); xfs_iunlock(ip, lockmode);
} else { } else {
trace_xfs_get_blocks_notfound(ip, offset, size); trace_xfs_get_blocks_notfound(ip, offset, size);
......
...@@ -240,7 +240,7 @@ xfs_iomap_write_direct( ...@@ -240,7 +240,7 @@ xfs_iomap_write_direct(
*/ */
if (IS_DAX(VFS_I(ip))) { if (IS_DAX(VFS_I(ip))) {
bmapi_flags = XFS_BMAPI_CONVERT | XFS_BMAPI_ZERO; bmapi_flags = XFS_BMAPI_CONVERT | XFS_BMAPI_ZERO;
if (ISUNWRITTEN(imap)) { if (imap->br_state == XFS_EXT_UNWRITTEN) {
tflags |= XFS_TRANS_RESERVE; tflags |= XFS_TRANS_RESERVE;
resblks = XFS_DIOSTRAT_SPACE_RES(mp, 0) << 1; resblks = XFS_DIOSTRAT_SPACE_RES(mp, 0) << 1;
} }
...@@ -945,7 +945,7 @@ static inline bool imap_needs_alloc(struct inode *inode, ...@@ -945,7 +945,7 @@ static inline bool imap_needs_alloc(struct inode *inode,
return !nimaps || return !nimaps ||
imap->br_startblock == HOLESTARTBLOCK || imap->br_startblock == HOLESTARTBLOCK ||
imap->br_startblock == DELAYSTARTBLOCK || imap->br_startblock == DELAYSTARTBLOCK ||
(IS_DAX(inode) && ISUNWRITTEN(imap)); (IS_DAX(inode) && imap->br_state == XFS_EXT_UNWRITTEN);
} }
static inline bool need_excl_ilock(struct xfs_inode *ip, unsigned flags) static inline bool need_excl_ilock(struct xfs_inode *ip, unsigned flags)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment