From 37b3f3b9df367b00d9f9c1fa383af7bf30923bda Mon Sep 17 00:00:00 2001 From: Michael Grigoriev Date: Sun, 9 Nov 2003 15:33:24 +0000 Subject: Removed an unused variable and added a bit of error checking in read combining code. --- kernel/file.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/kernel/file.c b/kernel/file.c index fe83c19..3e9b80b 100644 --- a/kernel/file.c +++ b/kernel/file.c @@ -148,7 +148,7 @@ static int fuse_cache_block(struct address_space *mapping, size_t end_index = ((bl_index + 1) << FUSE_BLOCK_PAGE_SHIFT) - 1; size_t file_end_index = inode->i_size >> PAGE_CACHE_SHIFT; - int i, error = 0; + int i; if (end_index > file_end_index) end_index = file_end_index; @@ -160,6 +160,9 @@ static int fuse_cache_block(struct address_space *mapping, page = find_or_create_page(mapping, index, GFP_NOFS); + if (!page) + return -1; + if (!Page_Uptodate(page)) { buffer = kmap(page); memcpy(buffer, bl_buf + i * PAGE_CACHE_SIZE, @@ -172,7 +175,7 @@ static int fuse_cache_block(struct address_space *mapping, page_cache_release(page); } - return error; + return 0; } static int fuse_file_read_block(struct inode *inode, char *bl_buf, -- cgit v1.2.3