mirror of
				https://github.com/torvalds/linux.git
				synced 2025-10-31 16:48:26 +02:00 
			
		
		
		
	 5641371fd0
			
		
	
	
		5641371fd0
		
	
	
	
	
		
			
			Remove accesses to page->index and page->mapping. Also use folio APIs where available. This code still assumes order 0 folios. [dan.carpenter@linaro.org: fix a NULL vs IS_ERR() bug] Link: https://lkml.kernel.org/r/7b7f44d6-9153-4d7c-b65b-2d78febe6c7a@stanley.mountain Link: https://lkml.kernel.org/r/20241220224634.723899-4-willy@infradead.org Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Cc: Phillip Lougher <phillip@squashfs.org.uk> Cc: Dan Carpenter <dan.carpenter@linaro.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
		
			
				
	
	
		
			36 lines
		
	
	
	
		
			891 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			36 lines
		
	
	
	
		
			891 B
		
	
	
	
		
			C
		
	
	
	
	
	
| // SPDX-License-Identifier: GPL-2.0-only
 | |
| /*
 | |
|  * Copyright (c) 2013
 | |
|  * Phillip Lougher <phillip@squashfs.org.uk>
 | |
|  */
 | |
| 
 | |
| #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 folio *folio, u64 block, int bsize, int expected)
 | |
| {
 | |
| 	struct inode *i = folio->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(folio, buffer, expected, 0);
 | |
| 
 | |
| 	squashfs_cache_put(buffer);
 | |
| 	return res;
 | |
| }
 |