summaryrefslogtreecommitdiff
path: root/fs/xfs/xfs_aops.c
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2016-02-15 17:20:50 +1100
committerDave Chinner <david@fromorbit.com>2016-02-15 17:20:50 +1100
commit988ef927926aa3481cbf144f235c0cefd7deb9e4 (patch)
tree4b008acb2648a7f200ac3fe47bd133d0b8d55d23 /fs/xfs/xfs_aops.c
parent36f90b0a2ddd60823fe193a85e60ff1906c2a9b3 (diff)
downloadlwn-988ef927926aa3481cbf144f235c0cefd7deb9e4.tar.gz
lwn-988ef927926aa3481cbf144f235c0cefd7deb9e4.zip
xfs: remove nonblocking mode from xfs_vm_writepage
Remove the nonblocking optimisation done for mapping lookups during writeback. It's not clear that leaving a hole in the writeback range just because we couldn't get a lock is really a win, as it makes us do another small random IO later on rather than a large sequential IO now. As this gets in the way of sane error handling later on, just remove for the moment and we can re-introduce an equivalent optimisation in future if we see problems due to extent map lock contention. Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dave Chinner <david@fromorbit.com>
Diffstat (limited to 'fs/xfs/xfs_aops.c')
-rw-r--r--fs/xfs/xfs_aops.c20
1 files changed, 3 insertions, 17 deletions
diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c
index 379c089fb051..807744b19233 100644
--- a/fs/xfs/xfs_aops.c
+++ b/fs/xfs/xfs_aops.c
@@ -283,8 +283,7 @@ xfs_map_blocks(
struct inode *inode,
loff_t offset,
struct xfs_bmbt_irec *imap,
- int type,
- int nonblocking)
+ int type)
{
struct xfs_inode *ip = XFS_I(inode);
struct xfs_mount *mp = ip->i_mount;
@@ -300,12 +299,7 @@ xfs_map_blocks(
if (type == XFS_IO_UNWRITTEN)
bmapi_flags |= XFS_BMAPI_IGSTATE;
- if (!xfs_ilock_nowait(ip, XFS_ILOCK_SHARED)) {
- if (nonblocking)
- return -EAGAIN;
- xfs_ilock(ip, XFS_ILOCK_SHARED);
- }
-
+ xfs_ilock(ip, XFS_ILOCK_SHARED);
ASSERT(ip->i_d.di_format != XFS_DINODE_FMT_BTREE ||
(ip->i_df.if_flags & XFS_IFEXTENTS));
ASSERT(offset <= mp->m_super->s_maxbytes);
@@ -955,7 +949,6 @@ xfs_vm_writepage(
ssize_t len;
int err, imap_valid = 0, uptodate = 1;
int count = 0;
- int nonblocking = 0;
trace_xfs_writepage(inode, page, 0, 0);
@@ -1055,9 +1048,6 @@ xfs_vm_writepage(
offset = page_offset(page);
type = XFS_IO_OVERWRITE;
- if (wbc->sync_mode == WB_SYNC_NONE)
- nonblocking = 1;
-
do {
int new_ioend = 0;
@@ -1117,8 +1107,7 @@ xfs_vm_writepage(
* time.
*/
new_ioend = 1;
- err = xfs_map_blocks(inode, offset, &imap, type,
- nonblocking);
+ err = xfs_map_blocks(inode, offset, &imap, type);
if (err)
goto error;
imap_valid = xfs_imap_valid(inode, &imap, offset);
@@ -1188,9 +1177,6 @@ error:
if (iohead)
xfs_cancel_ioend(iohead);
- if (err == -EAGAIN)
- goto redirty;
-
xfs_aops_discard_page(page);
ClearPageUptodate(page);
unlock_page(page);