blob: 251e7d1f74fc54c68596e65f553a97dfff7dbd09 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Jorgen Lundman9b4a1f92012-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 Lundman9b4a1f92012-07-19 20:48:25 +00008 */
9
10
11#include <common.h>
12#include <config.h>
Marek BehĂșn45ebb952017-09-03 17:00:24 +020013#include <fs_internal.h>
Jorgen Lundman9b4a1f92012-07-19 20:48:25 +000014#include <zfs_common.h>
15
Simon Glasse3394752016-02-29 15:25:34 -070016static struct blk_desc *zfs_blk_desc;
Simon Glassc1c4a8f2020-05-10 11:39:57 -060017static struct disk_partition *part_info;
Jorgen Lundman9b4a1f92012-07-19 20:48:25 +000018
Simon Glassc1c4a8f2020-05-10 11:39:57 -060019void zfs_set_blk_dev(struct blk_desc *rbdd, struct disk_partition *info)
Jorgen Lundman9b4a1f92012-07-19 20:48:25 +000020{
Simon Glasse3394752016-02-29 15:25:34 -070021 zfs_blk_desc = rbdd;
Rob Herring153817e2012-08-23 11:31:49 +000022 part_info = info;
Jorgen Lundman9b4a1f92012-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Ășn45ebb952017-09-03 17:00:24 +020028 return fs_devread(zfs_blk_desc, part_info, sector, byte_offset,
29 byte_len, buf);
Jorgen Lundman9b4a1f92012-07-19 20:48:25 +000030}