Jorgen Lundman | 4d3c95f | 2012-07-19 20:48:25 +0000 | [diff] [blame] | 1 | /* |
| 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 Denk | 1a45966 | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 8 | * SPDX-License-Identifier: GPL-2.0+ |
Jorgen Lundman | 4d3c95f | 2012-07-19 20:48:25 +0000 | [diff] [blame] | 9 | */ |
| 10 | |
| 11 | |
| 12 | #include <common.h> |
| 13 | #include <config.h> |
Marek BehĂșn | 5994e8b | 2017-09-03 17:00:24 +0200 | [diff] [blame] | 14 | #include <fs_internal.h> |
Jorgen Lundman | 4d3c95f | 2012-07-19 20:48:25 +0000 | [diff] [blame] | 15 | #include <zfs_common.h> |
| 16 | |
Simon Glass | 4101f68 | 2016-02-29 15:25:34 -0700 | [diff] [blame] | 17 | static struct blk_desc *zfs_blk_desc; |
Rob Herring | 4120457 | 2012-08-23 11:31:49 +0000 | [diff] [blame] | 18 | static disk_partition_t *part_info; |
Jorgen Lundman | 4d3c95f | 2012-07-19 20:48:25 +0000 | [diff] [blame] | 19 | |
Simon Glass | 4101f68 | 2016-02-29 15:25:34 -0700 | [diff] [blame] | 20 | void zfs_set_blk_dev(struct blk_desc *rbdd, disk_partition_t *info) |
Jorgen Lundman | 4d3c95f | 2012-07-19 20:48:25 +0000 | [diff] [blame] | 21 | { |
Simon Glass | 4101f68 | 2016-02-29 15:25:34 -0700 | [diff] [blame] | 22 | zfs_blk_desc = rbdd; |
Rob Herring | 4120457 | 2012-08-23 11:31:49 +0000 | [diff] [blame] | 23 | part_info = info; |
Jorgen Lundman | 4d3c95f | 2012-07-19 20:48:25 +0000 | [diff] [blame] | 24 | } |
| 25 | |
| 26 | /* err */ |
| 27 | int zfs_devread(int sector, int byte_offset, int byte_len, char *buf) |
| 28 | { |
Marek BehĂșn | 5994e8b | 2017-09-03 17:00:24 +0200 | [diff] [blame] | 29 | return fs_devread(zfs_blk_desc, part_info, sector, byte_offset, |
| 30 | byte_len, buf); |
Jorgen Lundman | 4d3c95f | 2012-07-19 20:48:25 +0000 | [diff] [blame] | 31 | } |