blob: 7dda42b48baf555adab71a8fbd4751f77766a8cf [file] [log] [blame]
Jorgen Lundman9b4a1f92012-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 Denkd79de1d2013-07-08 09:37:19 +02008 * SPDX-License-Identifier: GPL-2.0+
Jorgen Lundman9b4a1f92012-07-19 20:48:25 +00009 */
10
11
12#include <common.h>
13#include <config.h>
Marek BehĂșn45ebb952017-09-03 17:00:24 +020014#include <fs_internal.h>
Jorgen Lundman9b4a1f92012-07-19 20:48:25 +000015#include <zfs_common.h>
16
Simon Glasse3394752016-02-29 15:25:34 -070017static struct blk_desc *zfs_blk_desc;
Rob Herring153817e2012-08-23 11:31:49 +000018static disk_partition_t *part_info;
Jorgen Lundman9b4a1f92012-07-19 20:48:25 +000019
Simon Glasse3394752016-02-29 15:25:34 -070020void zfs_set_blk_dev(struct blk_desc *rbdd, disk_partition_t *info)
Jorgen Lundman9b4a1f92012-07-19 20:48:25 +000021{
Simon Glasse3394752016-02-29 15:25:34 -070022 zfs_blk_desc = rbdd;
Rob Herring153817e2012-08-23 11:31:49 +000023 part_info = info;
Jorgen Lundman9b4a1f92012-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Ășn45ebb952017-09-03 17:00:24 +020029 return fs_devread(zfs_blk_desc, part_info, sector, byte_offset,
30 byte_len, buf);
Jorgen Lundman9b4a1f92012-07-19 20:48:25 +000031}