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