summaryrefslogtreecommitdiff
path: root/fs/xfs/xfs_aops.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2018-07-11 22:26:03 -0700
committerDarrick J. Wong <darrick.wong@oracle.com>2018-07-11 22:26:03 -0700
commit6d465e895343225e3ad35fe10d7b3e9f2f18faec (patch)
tree760c1eaa820edc9db09aaedf8ae602b3c2759c46 /fs/xfs/xfs_aops.c
parent3faed667644d787c3cf6f977f80bac7a013eb045 (diff)
xfs: move all writeback buffer_head manipulation into xfs_map_at_offset
This keeps it in a single place so it can be made otional more easily. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'fs/xfs/xfs_aops.c')
-rw-r--r--fs/xfs/xfs_aops.c22
1 files changed, 5 insertions, 17 deletions
diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c
index 6402e4323031..71b4ca60ff40 100644
--- a/fs/xfs/xfs_aops.c
+++ b/fs/xfs/xfs_aops.c
@@ -495,21 +495,6 @@ allocate_blocks:
}
STATIC void
-xfs_start_buffer_writeback(
- struct buffer_head *bh)
-{
- ASSERT(buffer_mapped(bh));
- ASSERT(buffer_locked(bh));
- ASSERT(!buffer_delay(bh));
- ASSERT(!buffer_unwritten(bh));
-
- bh->b_end_io = NULL;
- set_buffer_async_write(bh);
- set_buffer_uptodate(bh);
- clear_buffer_dirty(bh);
-}
-
-STATIC void
xfs_start_page_writeback(
struct page *page,
int clear_dirty)
@@ -728,6 +713,7 @@ xfs_map_at_offset(
ASSERT(imap->br_startblock != HOLESTARTBLOCK);
ASSERT(imap->br_startblock != DELAYSTARTBLOCK);
+ lock_buffer(bh);
xfs_map_buffer(inode, bh, imap, offset);
set_buffer_mapped(bh);
clear_buffer_delay(bh);
@@ -740,6 +726,10 @@ xfs_map_at_offset(
* set the bdev now.
*/
bh->b_bdev = xfs_find_bdev_for_inode(inode);
+ bh->b_end_io = NULL;
+ set_buffer_async_write(bh);
+ set_buffer_uptodate(bh);
+ clear_buffer_dirty(bh);
}
STATIC void
@@ -861,11 +851,9 @@ xfs_writepage_map(
if (wpc->io_type == XFS_IO_HOLE)
continue;
- lock_buffer(bh);
xfs_map_at_offset(inode, bh, &wpc->imap, file_offset);
xfs_add_to_ioend(inode, file_offset, page, wpc, wbc,
&submit_list);
- xfs_start_buffer_writeback(bh);
count++;
}