GFS2: Merge ordered and writeback writepage

The writepages function was recently merged between writeback
and ordered mode. This completes the change by doing the same
with writepage. The remaining differences in writepage were
left over from some earlier time and not actually doing anything
useful.

Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
This commit is contained in:
Steven Whitehouse 2013-08-27 21:22:07 +01:00
parent 7286b31eab
commit 9d35814355

View File

@ -122,14 +122,13 @@ static int gfs2_writepage_common(struct page *page,
} }
/** /**
* gfs2_writeback_writepage - Write page for writeback mappings * gfs2_writepage - Write page for writeback mappings
* @page: The page * @page: The page
* @wbc: The writeback control * @wbc: The writeback control
* *
*/ */
static int gfs2_writeback_writepage(struct page *page, static int gfs2_writepage(struct page *page, struct writeback_control *wbc)
struct writeback_control *wbc)
{ {
int ret; int ret;
@ -140,32 +139,6 @@ static int gfs2_writeback_writepage(struct page *page,
return nobh_writepage(page, gfs2_get_block_noalloc, wbc); return nobh_writepage(page, gfs2_get_block_noalloc, wbc);
} }
/**
* gfs2_ordered_writepage - Write page for ordered data files
* @page: The page to write
* @wbc: The writeback control
*
*/
static int gfs2_ordered_writepage(struct page *page,
struct writeback_control *wbc)
{
struct inode *inode = page->mapping->host;
struct gfs2_inode *ip = GFS2_I(inode);
int ret;
ret = gfs2_writepage_common(page, wbc);
if (ret <= 0)
return ret;
if (!page_has_buffers(page)) {
create_empty_buffers(page, inode->i_sb->s_blocksize,
(1 << BH_Dirty)|(1 << BH_Uptodate));
}
gfs2_page_add_databufs(ip, page, 0, inode->i_sb->s_blocksize-1);
return block_write_full_page(page, gfs2_get_block_noalloc, wbc);
}
/** /**
* __gfs2_jdata_writepage - The core of jdata writepage * __gfs2_jdata_writepage - The core of jdata writepage
* @page: The page to write * @page: The page to write
@ -1107,7 +1080,7 @@ int gfs2_releasepage(struct page *page, gfp_t gfp_mask)
} }
static const struct address_space_operations gfs2_writeback_aops = { static const struct address_space_operations gfs2_writeback_aops = {
.writepage = gfs2_writeback_writepage, .writepage = gfs2_writepage,
.writepages = gfs2_writepages, .writepages = gfs2_writepages,
.readpage = gfs2_readpage, .readpage = gfs2_readpage,
.readpages = gfs2_readpages, .readpages = gfs2_readpages,
@ -1123,7 +1096,7 @@ static const struct address_space_operations gfs2_writeback_aops = {
}; };
static const struct address_space_operations gfs2_ordered_aops = { static const struct address_space_operations gfs2_ordered_aops = {
.writepage = gfs2_ordered_writepage, .writepage = gfs2_writepage,
.writepages = gfs2_writepages, .writepages = gfs2_writepages,
.readpage = gfs2_readpage, .readpage = gfs2_readpage,
.readpages = gfs2_readpages, .readpages = gfs2_readpages,