diff options
| author | Alistair Strachan <astrachan@google.com> | 2018-12-19 15:37:41 -0800 |
|---|---|---|
| committer | Alistair Strachan <astrachan@google.com> | 2018-12-19 16:08:02 -0800 |
| commit | 34a4d7ffc21bafe8af1e39eae951e3255f2b1c37 (patch) | |
| tree | 6cc1b2e7eab500391657ff7bd1617539c8934ace /fs/squashfs/file_cache.c | |
| parent | 66a37fc02dffc240c28dc56f1f502f521944f3c6 (diff) | |
ANDROID: Revert fs/squashfs back to linux-4.4.y
Bug: 29521202
Test: local build test only
Change-Id: I117e6e733f0ece85fd4d90604efc4d59fa545464
Signed-off-by: Alistair Strachan <astrachan@google.com>
Diffstat (limited to 'fs/squashfs/file_cache.c')
| -rw-r--r-- | fs/squashfs/file_cache.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/fs/squashfs/file_cache.c b/fs/squashfs/file_cache.c new file mode 100644 index 000000000000..f2310d2a2019 --- /dev/null +++ b/fs/squashfs/file_cache.c @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2013 + * Phillip Lougher <phillip@squashfs.org.uk> + * + * This work is licensed under the terms of the GNU GPL, version 2. See + * the COPYING file in the top-level directory. + */ + +#include <linux/fs.h> +#include <linux/vfs.h> +#include <linux/kernel.h> +#include <linux/slab.h> +#include <linux/string.h> +#include <linux/pagemap.h> +#include <linux/mutex.h> + +#include "squashfs_fs.h" +#include "squashfs_fs_sb.h" +#include "squashfs_fs_i.h" +#include "squashfs.h" + +/* Read separately compressed datablock and memcopy into page cache */ +int squashfs_readpage_block(struct page *page, u64 block, int bsize) +{ + struct inode *i = page->mapping->host; + struct squashfs_cache_entry *buffer = squashfs_get_datablock(i->i_sb, + block, bsize); + int res = buffer->error; + + if (res) + ERROR("Unable to read page, block %llx, size %x\n", block, + bsize); + else + squashfs_copy_cache(page, buffer, buffer->length, 0); + + squashfs_cache_put(buffer); + return res; +} |
