gfs2: stop using mpage_writepage
PATCH 1/1 gfs2: stop using mpage_writepage
GFS2 always creates buffer_heads during ->write_begin or ->page_mkwrite, which means mpage_writepage always falls back to block_write_full_page.
So stop calling mpage_writepage and always call block_write_full_page directly.
fs/gfs2/aops.c +1 -4
@@ -136,10 +136,7 @@ static int gfs2_writeback_writepage(struif (ret <=0 )return ret; - ret =mpage_writepage (page, gfs2_get_block_noalloc, wbc); -if (ret == -EAGAIN ) - ret =block_write_full_page (page, gfs2_get_block_noalloc, wbc); -return ret; +return block_write_full_page (page, gfs2_get_block_noalloc, wbc); }/**
PATCH 1/1 gfs2: stop using mpage_writepage
Hi,
Quoted 6 lines · Christoph Hellwig
GFS2 always creates
buffer_headsduring ->write_begin or ->page_mkwrite, which meansmpage_writepagealways falls back toblock_write_full_page.So stop calling
mpage_writepageand always callblock_write_full_pagedirectly.
->write_begin does, but I did hope to change that eventually. On the other hand that isn't true of ->page_mkwrite unless an unstuffing operation occurs,
Steve.
Quoted 18 lines
Signed-off-by Christoph Hellwig <[email protected]>Index:
linux-2.6/fs/gfs2/aops.c
===================================================================fs/gfs2/aops.c +1
-4@@ -136,10 +136,7 @@ static int gfs2_writeback_writepage(struif (ret <=0 )return ret; - ret =mpage_writepage (page, gfs2_get_block_noalloc, wbc); -if (ret == -EAGAIN ) - ret =block_write_full_page (page, gfs2_get_block_noalloc, wbc); -return ret; +return block_write_full_page (page, gfs2_get_block_noalloc, wbc); }/**
PATCH 1/1 gfs2: stop using mpage_writepage
In reply to Christoph HellwigUse nobh_writepage rather than calling mpage_writepage directly.
fs/gfs2/aops.c +0 -0
@@ -136,10 +136,7 @@ static int gfs2_writeback_writepage(struct page
*page,
if (ret <= 0)
return ret;
- ret = mpage_writepage(page, gfs2_get_block_noalloc, wbc);
- if (ret == -EAGAIN)
- ret = block_write_full_page(page, gfs2_get_block_noalloc, wbc);
- return ret;
+ return nobh_writepage(page, gfs2_get_block_noalloc, wbc);
}
/**