Skip to contentSkip to conversation

gfs2: stop using mpage_writepage

PATCH New Christoph Hellwig 2 participants 3 messages Jun 7, 2010 GFS2 file system

lore
Share & tools
lore
#0 lore raw

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
Index: linux-2.6/fs/gfs2/aops.c
===================================================================
@@ -136,10 +136,7 @@ static int gfs2_writeback_writepage(stru
 	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 block_write_full_page(page, gfs2_get_block_noalloc, wbc);
 }
 
 /**
#1 lore raw

PATCH 1/1 gfs2: stop using mpage_writepage

Hi,

Quoted 6 lines · Christoph Hellwig

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.

->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

Index: linux-2.6/fs/gfs2/aops.c
===================================================================

fs/gfs2/aops.c +1 -4
@@ -136,10 +136,7 @@ static int gfs2_writeback_writepage(stru
 	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 block_write_full_page(page, gfs2_get_block_noalloc, wbc);
 }
 
 /**
#2 lore raw

PATCH 1/1 gfs2: stop using mpage_writepage

In reply to Christoph Hellwig

Use nobh_writepage rather than calling mpage_writepage directly.

fs/gfs2/aops.c +0 -0
index 9f8b525..9485a88 100644
@@ -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);
}

/**