summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung@gmail.com>2010-10-25 08:01:12 +0200
committerAl Viro <viro@zeniv.linux.org.uk>2010-10-26 03:18:23 +0200
commit309f77ad9bea057d55b04580b5a711e9e3727e83 (patch)
tree7edf988602761b4ac46f9edc9a6d89c7abffd3cf /fs
parentlockdep: fixup checking of dir inode annotation (diff)
downloadlinux-309f77ad9bea057d55b04580b5a711e9e3727e83.tar.xz
linux-309f77ad9bea057d55b04580b5a711e9e3727e83.zip
fs/buffer.c: call __block_write_begin() if we have page
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> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r--fs/buffer.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/fs/buffer.c b/fs/buffer.c
index 74566c6f67b1..d895d9fd5b71 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -2458,11 +2458,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))