[XFS] Don't wait for pending I/Os when purging blocks beyond eof.

On last close of a file we purge blocks beyond eof. The same code is used
when we truncate the file size down. In this case we need to wait for any
pending I/Os for dirty pages beyond the new eof. For the last close case
we are not changing the file size and therefore do not need to wait for
any I/Os to complete. This fixes a performance bottleneck where writes
into the page cache and cache flushes can become mutually exclusive.

SGI-PV: 964002
SGI-Modid: xfs-linux-melb:xfs-kern:30220a

Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
Signed-off-by: Peter Leckie <pleckie@sgi.com>

authored by Lachlan McIlroy and committed by Lachlan McIlroy c734c79b c63a1190

+4 -2
+4 -2
fs/xfs/xfs_inode.c
··· 1459 1459 mp = ip->i_mount; 1460 1460 vp = XFS_ITOV(ip); 1461 1461 1462 - vn_iowait(ip); /* wait for the completion of any pending DIOs */ 1463 - 1462 + /* wait for the completion of any pending DIOs */ 1463 + if (new_size < ip->i_size) 1464 + vn_iowait(ip); 1465 + 1464 1466 /* 1465 1467 * Call toss_pages or flushinval_pages to get rid of pages 1466 1468 * overlapping the region being removed. We have to use