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 #include <config.h>
11 #include <fs_internal.h>
12 #include <zfs_common.h>
13
14 static struct blk_desc *zfs_blk_desc;
15 static struct disk_partition *part_info;
16
zfs_set_blk_dev(struct blk_desc * rbdd,struct disk_partition * info)17 void zfs_set_blk_dev(struct blk_desc *rbdd, struct disk_partition *info)
18 {
19 zfs_blk_desc = rbdd;
20 part_info = info;
21 }
22
23 /* err */
zfs_devread(int sector,int byte_offset,int byte_len,char * buf)24 int zfs_devread(int sector, int byte_offset, int byte_len, char *buf)
25 {
26 return fs_devread(zfs_blk_desc, part_info, sector, byte_offset,
27 byte_len, buf) ? 0 : 1;
28 }
29