blob: 3cdb9e03edc633f8faaea0a579cecdb90ebe84a9 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Jorgen Lundman4d3c95f2012-07-19 20:48:25 +00002/*
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>
Jorgen Lundman4d3c95f2012-07-19 20:48:25 +00008 */
9
10
11#include <common.h>
12#include <config.h>
Marek BehĂșn5994e8b2017-09-03 17:00:24 +020013#include <fs_internal.h>
Jorgen Lundman4d3c95f2012-07-19 20:48:25 +000014#include <zfs_common.h>
15
Simon Glass4101f682016-02-29 15:25:34 -070016static struct blk_desc *zfs_blk_desc;
Rob Herring41204572012-08-23 11:31:49 +000017static disk_partition_t *part_info;
Jorgen Lundman4d3c95f2012-07-19 20:48:25 +000018
Simon Glass4101f682016-02-29 15:25:34 -070019void zfs_set_blk_dev(struct blk_desc *rbdd, disk_partition_t *info)
Jorgen Lundman4d3c95f2012-07-19 20:48:25 +000020{
Simon Glass4101f682016-02-29 15:25:34 -070021 zfs_blk_desc = rbdd;
Rob Herring41204572012-08-23 11:31:49 +000022 part_info = info;
Jorgen Lundman4d3c95f2012-07-19 20:48:25 +000023}
24
25/* err */
26int zfs_devread(int sector, int byte_offset, int byte_len, char *buf)
27{
Marek BehĂșn5994e8b2017-09-03 17:00:24 +020028 return fs_devread(zfs_blk_desc, part_info, sector, byte_offset,
29 byte_len, buf);
Jorgen Lundman4d3c95f2012-07-19 20:48:25 +000030}