3 * Phillip Lougher <phillip@squashfs.org.uk>
5 * This work is licensed under the terms of the GNU GPL, version 2. See
6 * the COPYING file in the top-level directory.
10 #include <linux/vfs.h>
11 #include <linux/kernel.h>
12 #include <linux/slab.h>
13 #include <linux/string.h>
14 #include <linux/pagemap.h>
15 #include <linux/mutex.h>
17 #include "squashfs_fs.h"
18 #include "squashfs_fs_sb.h"
19 #include "squashfs_fs_i.h"
22 /* Read separately compressed datablock and memcopy into page cache */
23 int squashfs_readpage_block(struct page
*page
, u64 block
, int bsize
, int expected
)
25 struct inode
*i
= page
->mapping
->host
;
26 struct squashfs_cache_entry
*buffer
= squashfs_get_datablock(i
->i_sb
,
28 int res
= buffer
->error
;
31 ERROR("Unable to read page, block %llx, size %x\n", block
,
34 squashfs_copy_cache(page
, buffer
, expected
, 0);
36 squashfs_cache_put(buffer
);