5994e8b643
The ext4, reiserfs and zfs filesystems all have their own implementation of the same function, *_devread. Generalize this function into fs_devread and put the code into fs/fs_internal.c. Signed-off-by: Marek Behun <marek.behun@nic.cz> [trini: Move fs/fs_internal.o hunk to the end of fs/Makefile as all cases need it] Signed-off-by: Tom Rini <trini@konsulko.com>
32 lines
636 B
C
32 lines
636 B
C
/*
|
|
*
|
|
* based on code of fs/reiserfs/dev.c by
|
|
*
|
|
* (C) Copyright 2003 - 2004
|
|
* Sysgo AG, <www.elinos.com>, Pavel Bartusek <pba@sysgo.com>
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0+
|
|
*/
|
|
|
|
|
|
#include <common.h>
|
|
#include <config.h>
|
|
#include <fs_internal.h>
|
|
#include <zfs_common.h>
|
|
|
|
static struct blk_desc *zfs_blk_desc;
|
|
static disk_partition_t *part_info;
|
|
|
|
void zfs_set_blk_dev(struct blk_desc *rbdd, disk_partition_t *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);
|
|
}
|