@@ -661,8 +661,7 @@ xfs_file_buffered_aio_write(
xfs_flush_inodes(ip->i_mount);
xfs_iunlock(ip, iolock);
- eofb.eof_flags = XFS_EOF_FLAGS_SYNC;
- xfs_icache_free_eofblocks(ip->i_mount, &eofb);
+ xfs_icache_free_eofblocks(ip->i_mount, &eofb, SYNC_WAIT);
xfs_icache_free_cowblocks(ip->i_mount, &eofb, SYNC_WAIT);
goto write_retry;
}
@@ -912,7 +912,7 @@ xfs_eofblocks_worker(
if (!sb_start_write_trylock(mp->m_super))
return;
- xfs_icache_free_eofblocks(mp, NULL);
+ xfs_icache_free_eofblocks(mp, NULL, SYNC_TRYLOCK);
sb_end_write(mp->m_super);
xfs_queue_eofblocks(mp);
@@ -1507,12 +1507,9 @@ xfs_inode_free_eofblocks(
int
xfs_icache_free_eofblocks(
struct xfs_mount *mp,
- struct xfs_eofblocks *eofb)
+ struct xfs_eofblocks *eofb,
+ int flags)
{
- int flags = SYNC_TRYLOCK;
-
- if (eofb && (eofb->eof_flags & XFS_EOF_FLAGS_SYNC))
- flags = SYNC_WAIT;
return xfs_inode_ag_iterator_tag(mp, xfs_inode_free_eofblocks, flags,
eofb, XFS_ICI_EOFBLOCKS_TAG);
}
@@ -1556,7 +1553,7 @@ xfs_inode_free_quota_blocks(
}
if (scan) {
- xfs_icache_free_eofblocks(ip->i_mount, &eofb);
+ xfs_icache_free_eofblocks(ip->i_mount, &eofb, SYNC_WAIT);
xfs_icache_free_cowblocks(ip->i_mount, &eofb, SYNC_WAIT);
}
@@ -59,7 +59,8 @@ void xfs_inode_set_reclaim_tag(struct xfs_inode *ip);
void xfs_inode_set_eofblocks_tag(struct xfs_inode *ip);
void xfs_inode_clear_eofblocks_tag(struct xfs_inode *ip);
-int xfs_icache_free_eofblocks(struct xfs_mount *, struct xfs_eofblocks *);
+int xfs_icache_free_eofblocks(struct xfs_mount *mp, struct xfs_eofblocks *eofb,
+ int flags);
int xfs_inode_free_quota_blocks(struct xfs_inode *ip);
void xfs_eofblocks_worker(struct work_struct *);
void xfs_queue_eofblocks(struct xfs_mount *);
@@ -2330,7 +2330,9 @@ xfs_file_ioctl(
return error;
sb_start_write(mp->m_super);
- error = xfs_icache_free_eofblocks(mp, &keofb);
+ error = xfs_icache_free_eofblocks(mp, &keofb,
+ (keofb.eof_flags & XFS_EOF_FLAGS_SYNC) ?
+ SYNC_WAIT : SYNC_TRYLOCK);
sb_end_write(mp->m_super);
return error;
}
Pass the SYNC_* flags directly instead of hiding the information in the eofblocks structure. Signed-off-by: Christoph Hellwig <hch@lst.de> --- fs/xfs/xfs_file.c | 3 +-- fs/xfs/xfs_icache.c | 11 ++++------- fs/xfs/xfs_icache.h | 3 ++- fs/xfs/xfs_ioctl.c | 4 +++- 4 files changed, 10 insertions(+), 11 deletions(-)