Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6d465e89 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Darrick J. Wong
Browse files

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: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarBrian Foster <bfoster@redhat.com>
Reviewed-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
parent 3faed667
Loading
Loading
Loading
Loading
+5 −17
Original line number Diff line number Diff line
@@ -494,21 +494,6 @@ xfs_map_blocks(
	return 0;
}

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,
@@ -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++;
	}