lkml.org 
[lkml]   [2010]   [Oct]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH RESEND] fs/buffer.c: call __block_write_begin() if we have page
Date
If we have the appropriate page already, call __block_write_begin()
directly instead of releasing and regrabbing it inside of
block_write_begin().

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
---
Shared error path.

fs/buffer.c | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/fs/buffer.c b/fs/buffer.c
index 7f0b9b0..a132c2b 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -2466,11 +2466,10 @@ int nobh_write_begin(struct address_space *mapping,
*fsdata = NULL;

if (page_has_buffers(page)) {
- unlock_page(page);
- page_cache_release(page);
- *pagep = NULL;
- return block_write_begin(mapping, pos, len, flags, pagep,
- get_block);
+ ret = __block_write_begin(page, pos, len, get_block);
+ if (unlikely(ret))
+ goto out_release;
+ return ret;
}

if (PageMappedToDisk(page))
--
1.7.0.4


\
 
 \ /
  Last update: 2010-10-25 08:03    [W:0.044 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site