1// SPDX-License-Identifier: GPL-2.0+
2/*
3 *
4 *	based on code of fs/reiserfs/dev.c by
5 *
6 *	(C) Copyright 2003 - 2004
7 *	Sysgo AG, <www.elinos.com>, Pavel Bartusek <pba@sysgo.com>
8 */
9
10
11#include <common.h>
12#include <config.h>
13#include <fs_internal.h>
14#include <zfs_common.h>
15
16static struct blk_desc *zfs_blk_desc;
17static struct disk_partition *part_info;
18
19void zfs_set_blk_dev(struct blk_desc *rbdd, struct disk_partition *info)
20{
21	zfs_blk_desc = rbdd;
22	part_info = info;
23}
24
25/* err */
26int zfs_devread(int sector, int byte_offset, int byte_len, char *buf)
27{
28	return fs_devread(zfs_blk_desc, part_info, sector, byte_offset,
29			  byte_len, buf) ? 0 : 1;
30}
31