Commit 1a1a99df authored by Nathan Scott's avatar Nathan Scott Committed by Nathan Scott

[XFS] Fix accidental reverting of sync write preallocations.

SGI Modid: xfs-linux:xfs-kern:176195a
Signed-off-by: default avatarNathan Scott <nathans@sgi.com>
parent 7db48a7c
......@@ -993,17 +993,6 @@ linvfs_get_block(
create, 0, BMAPI_WRITE);
}
STATIC int
linvfs_get_block_sync(
struct inode *inode,
sector_t iblock,
struct buffer_head *bh_result,
int create)
{
return linvfs_get_block_core(inode, iblock, 0, bh_result,
create, 0, BMAPI_SYNC|BMAPI_WRITE);
}
STATIC int
linvfs_get_blocks_direct(
struct inode *inode,
......@@ -1258,13 +1247,7 @@ linvfs_prepare_write(
unsigned int from,
unsigned int to)
{
if (file && (file->f_flags & O_SYNC)) {
return block_prepare_write(page, from, to,
linvfs_get_block_sync);
} else {
return block_prepare_write(page, from, to,
linvfs_get_block);
}
return block_prepare_write(page, from, to, linvfs_get_block);
}
struct address_space_operations linvfs_aops = {
......
......@@ -585,8 +585,10 @@ xfs_iomap_write_delay(
* out to the file system's write iosize. We clean up any extra
* space left over when the file is closed in xfs_inactive().
*
* We don't bother with this for sync writes, because we need
* to minimize the amount we write for good performance.
* For sync writes, we are flushing delayed allocate space to
* try to make additional space available for allocation near
* the filesystem full boundary - preallocation hurts in that
* situation, of course.
*/
if (!(ioflag & BMAPI_SYNC) && ((offset + count) > ip->i_d.di_size)) {
xfs_off_t aligned_offset;
......
......@@ -58,7 +58,7 @@ typedef enum {
BMAPI_IGNSTATE = (1 << 4), /* ignore unwritten state on read */
BMAPI_DIRECT = (1 << 5), /* direct instead of buffered write */
BMAPI_MMAP = (1 << 6), /* allocate for mmap write */
BMAPI_SYNC = (1 << 7), /* sync write */
BMAPI_SYNC = (1 << 7), /* sync write to flush delalloc space */
BMAPI_TRYLOCK = (1 << 8), /* non-blocking request */
BMAPI_DEVICE = (1 << 9), /* we only want to know the device */
} bmapi_flags_t;
......
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