Skip to content

Commit

Permalink
fs/buffer.c: call __block_write_begin() if we have page
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Namhyung Kim authored and Al Viro committed Oct 26, 2010
1 parent a3314a0 commit 309f77a
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions fs/buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 309f77a

Please sign in to comment.