mirror of
				https://github.com/smaeul/u-boot.git
				synced 2025-11-03 21:48:15 +00:00 
			
		
		
		
	As evidenced by how other filesystems handle it, a return value of 0 from fs_devread() means failure; nonzero means success. The opposite assumption was being made in zfs.c for the use of zfs_devread() so fix the confusion by making zfs_devread() return 0 on success. It probably doesn't make sense to change the handling of zfs_devread() in zfs.c instead, because as it is it matches the semantics of the other functions there. Signed-off-by: Phaedrus Leeds <mwleeds@mailtundra.com>
		
			
				
	
	
		
			31 lines
		
	
	
		
			651 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			31 lines
		
	
	
		
			651 B
		
	
	
	
		
			C
		
	
	
	
	
	
// SPDX-License-Identifier: GPL-2.0+
 | 
						|
/*
 | 
						|
 *
 | 
						|
 *	based on code of fs/reiserfs/dev.c by
 | 
						|
 *
 | 
						|
 *	(C) Copyright 2003 - 2004
 | 
						|
 *	Sysgo AG, <www.elinos.com>, Pavel Bartusek <pba@sysgo.com>
 | 
						|
 */
 | 
						|
 | 
						|
 | 
						|
#include <common.h>
 | 
						|
#include <config.h>
 | 
						|
#include <fs_internal.h>
 | 
						|
#include <zfs_common.h>
 | 
						|
 | 
						|
static struct blk_desc *zfs_blk_desc;
 | 
						|
static struct disk_partition *part_info;
 | 
						|
 | 
						|
void zfs_set_blk_dev(struct blk_desc *rbdd, struct disk_partition *info)
 | 
						|
{
 | 
						|
	zfs_blk_desc = rbdd;
 | 
						|
	part_info = info;
 | 
						|
}
 | 
						|
 | 
						|
/* err */
 | 
						|
int zfs_devread(int sector, int byte_offset, int byte_len, char *buf)
 | 
						|
{
 | 
						|
	return fs_devread(zfs_blk_desc, part_info, sector, byte_offset,
 | 
						|
			  byte_len, buf) ? 0 : 1;
 | 
						|
}
 |