mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 20:51:03 +02:00
gfs2: merge gfs2_writepage_common into gfs2_writepage
There is no need to keep these two functions separate. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
This commit is contained in:
committed by
Andreas Gruenbacher
parent
eadd753580
commit
59c01c5046
@@ -82,15 +82,11 @@ static int gfs2_get_block_noalloc(struct inode *inode, sector_t lblock,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gfs2_writepage_common - Common bits of writepage
|
* gfs2_writepage - Write page for writeback mappings
|
||||||
* @page: The page to be written
|
* @page: The page
|
||||||
* @wbc: The writeback control
|
* @wbc: The writeback control
|
||||||
*
|
|
||||||
* Returns: 1 if writepage is ok, otherwise an error code or zero if no error.
|
|
||||||
*/
|
*/
|
||||||
|
static int gfs2_writepage(struct page *page, struct writeback_control *wbc)
|
||||||
static int gfs2_writepage_common(struct page *page,
|
|
||||||
struct writeback_control *wbc)
|
|
||||||
{
|
{
|
||||||
struct inode *inode = page->mapping->host;
|
struct inode *inode = page->mapping->host;
|
||||||
struct gfs2_inode *ip = GFS2_I(inode);
|
struct gfs2_inode *ip = GFS2_I(inode);
|
||||||
@@ -109,7 +105,9 @@ static int gfs2_writepage_common(struct page *page,
|
|||||||
page->mapping->a_ops->invalidatepage(page, 0, PAGE_SIZE);
|
page->mapping->a_ops->invalidatepage(page, 0, PAGE_SIZE);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
return 1;
|
|
||||||
|
return nobh_writepage(page, gfs2_get_block_noalloc, wbc);
|
||||||
|
|
||||||
redirty:
|
redirty:
|
||||||
redirty_page_for_writepage(wbc, page);
|
redirty_page_for_writepage(wbc, page);
|
||||||
out:
|
out:
|
||||||
@@ -117,24 +115,6 @@ out:
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* gfs2_writepage - Write page for writeback mappings
|
|
||||||
* @page: The page
|
|
||||||
* @wbc: The writeback control
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
static int gfs2_writepage(struct page *page, struct writeback_control *wbc)
|
|
||||||
{
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
ret = gfs2_writepage_common(page, wbc);
|
|
||||||
if (ret <= 0)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
return nobh_writepage(page, gfs2_get_block_noalloc, wbc);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* This is the same as calling block_write_full_page, but it also
|
/* This is the same as calling block_write_full_page, but it also
|
||||||
* writes pages outside of i_size
|
* writes pages outside of i_size
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user