aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorplougher <plougher>2009-01-31 07:32:25 +0000
committerMohamad Ayyash <mkayyash@google.com>2015-02-23 12:34:12 -0800
commitdc0c9e8537384bfa3310bd27700ebff9903a9a2d (patch)
tree0a79e85fbad1546a32998c4c5c964a2151ca05bb
parent0564f6ab9ccd23d5356a2b845e0267b35a975670 (diff)
downloadsquashfs-tools-dc0c9e8537384bfa3310bd27700ebff9903a9a2d.tar.gz
Code tidy
Signed-off-by: Phillip Lougher <phillip@lougher.demon.co.uk>
-rw-r--r--kernel/fs/squashfs/file.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/kernel/fs/squashfs/file.c b/kernel/fs/squashfs/file.c
index 355211f..9fb181c 100644
--- a/kernel/fs/squashfs/file.c
+++ b/kernel/fs/squashfs/file.c
@@ -376,17 +376,15 @@ static int squashfs_readpage(struct file *file, struct page *page)
{
struct inode *inode = page->mapping->host;
struct squashfs_sb_info *msblk = inode->i_sb->s_fs_info;
- u64 block = 0;
- unsigned int i;
- int bytes, index = page->index >> (msblk->block_log - PAGE_CACHE_SHIFT);
+ int bytes, i, offset = 0, sparse = 0;
struct squashfs_cache_entry *buffer = NULL;
void *pageaddr;
int mask = (1 << (msblk->block_log - PAGE_CACHE_SHIFT)) - 1;
+ int index = page->index >> (msblk->block_log - PAGE_CACHE_SHIFT);
int start_index = page->index & ~mask;
int end_index = start_index | mask;
int file_end = i_size_read(inode) >> msblk->block_log;
- int offset = 0, sparse = 0;
TRACE("Entered squashfs_readpage, page index %lx, start block %llx\n",
page->index, squashfs_i(inode)->start);
@@ -401,6 +399,7 @@ static int squashfs_readpage(struct file *file, struct page *page)
* Reading a datablock from disk. Need to read block list
* to get location and block size.
*/
+ u64 block = 0;
int bsize = read_blocklist(inode, index, &block);
if (bsize < 0)
goto error_out;