/* Get the on-disk location and compressed size of the datablock specified by index. Fill_meta_index() does most of the work.  */
static int read_blocklist(struct inode *inode, int index, u64 *block)
/* Get the on-disk location and compressed size of the datablock specified by index. Fill_meta_index() does most of the work.  */
static int read_blocklist(struct inode *inode, int index, u64 *block)
{
	u64 start;
	long long blks;
	int offset;
	__le32 size;
	int res = fill_meta_index(inode, index, &start, &offset, block);
	TRACE("read_blocklist: res %d, index %d, start 0x%llx, offset"
		       " 0x%x, block 0x%llx\n", res, index, start, offset,
			*block);
	if (res < 0)
		return res;
	if (res < index) {
		blks = read_indexes(inode->i_sb, index - res, &start, &offset);
		if (blks < 0)
			return (int) blks;
		*block += blks;
	}
	res = squashfs_read_metadata(inode->i_sb, &size, &start, &offset,
			sizeof(size));
	if (res < 0)
		return res;
	return le32_to_cpu(size);
}