2012-07-19 20:48:25 +00:00
|
|
|
/*
|
|
|
|
*
|
|
|
|
* based on code of fs/reiserfs/dev.c by
|
|
|
|
*
|
|
|
|
* (C) Copyright 2003 - 2004
|
|
|
|
* Sysgo AG, <www.elinos.com>, Pavel Bartusek <pba@sysgo.com>
|
|
|
|
*
|
2013-07-08 07:37:19 +00:00
|
|
|
* SPDX-License-Identifier: GPL-2.0+
|
2012-07-19 20:48:25 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#include <common.h>
|
|
|
|
#include <config.h>
|
2017-09-03 15:00:24 +00:00
|
|
|
#include <fs_internal.h>
|
2012-07-19 20:48:25 +00:00
|
|
|
#include <zfs_common.h>
|
|
|
|
|
2016-02-29 22:25:34 +00:00
|
|
|
static struct blk_desc *zfs_blk_desc;
|
2012-08-23 11:31:49 +00:00
|
|
|
static disk_partition_t *part_info;
|
2012-07-19 20:48:25 +00:00
|
|
|
|
2016-02-29 22:25:34 +00:00
|
|
|
void zfs_set_blk_dev(struct blk_desc *rbdd, disk_partition_t *info)
|
2012-07-19 20:48:25 +00:00
|
|
|
{
|
2016-02-29 22:25:34 +00:00
|
|
|
zfs_blk_desc = rbdd;
|
2012-08-23 11:31:49 +00:00
|
|
|
part_info = info;
|
2012-07-19 20:48:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* err */
|
|
|
|
int zfs_devread(int sector, int byte_offset, int byte_len, char *buf)
|
|
|
|
{
|
2017-09-03 15:00:24 +00:00
|
|
|
return fs_devread(zfs_blk_desc, part_info, sector, byte_offset,
|
|
|
|
byte_len, buf);
|
2012-07-19 20:48:25 +00:00
|
|
|
}
|