Removed an unused variable and added a bit of error checking in read combining
authorMichael Grigoriev <mag@luminal.org>
Sun, 9 Nov 2003 15:33:24 +0000 (15:33 +0000)
committerMichael Grigoriev <mag@luminal.org>
Sun, 9 Nov 2003 15:33:24 +0000 (15:33 +0000)
code.

kernel/file.c

index fe83c19de815f44e595c99a668e7679de767bafb..3e9b80b1070de6606dbff71ab6ff6d5804ebd514 100644 (file)
@@ -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,