blob: 7dda42b48baf555adab71a8fbd4751f77766a8cf [file] [log] [blame]
Jorgen Lundman4d3c95f2012-07-19 20:48:25 +00001/*
2 *
3 * based on code of fs/reiserfs/dev.c by
4 *
5 * (C) Copyright 2003 - 2004
6 * Sysgo AG, <www.elinos.com>, Pavel Bartusek <pba@sysgo.com>
7 *
Wolfgang Denk1a459662013-07-08 09:37:19 +02008 * SPDX-License-Identifier: GPL-2.0+
Jorgen Lundman4d3c95f2012-07-19 20:48:25 +00009 */
10
11
12#include <common.h>
13#include <config.h>
Marek BehĂșn5994e8b2017-09-03 17:00:24 +020014#include <fs_internal.h>
Jorgen Lundman4d3c95f2012-07-19 20:48:25 +000015#include <zfs_common.h>
16
Simon Glass4101f682016-02-29 15:25:34 -070017static struct blk_desc *zfs_blk_desc;
Rob Herring41204572012-08-23 11:31:49 +000018static disk_partition_t *part_info;
Jorgen Lundman4d3c95f2012-07-19 20:48:25 +000019
Simon Glass4101f682016-02-29 15:25:34 -070020void zfs_set_blk_dev(struct blk_desc *rbdd, disk_partition_t *info)
Jorgen Lundman4d3c95f2012-07-19 20:48:25 +000021{
Simon Glass4101f682016-02-29 15:25:34 -070022 zfs_blk_desc = rbdd;
Rob Herring41204572012-08-23 11:31:49 +000023 part_info = info;
Jorgen Lundman4d3c95f2012-07-19 20:48:25 +000024}
25
26/* err */
27int zfs_devread(int sector, int byte_offset, int byte_len, char *buf)
28{
Marek BehĂșn5994e8b2017-09-03 17:00:24 +020029 return fs_devread(zfs_blk_desc, part_info, sector, byte_offset,
30 byte_len, buf);
Jorgen Lundman4d3c95f2012-07-19 20:48:25 +000031}