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 | |
Jorgen Lundman | 9b4a1f9 | 2012-07-19 20:48:25 +0000 | [diff] [blame] | 10 | #include <config.h> |
Marek BehĂșn | 45ebb95 | 2017-09-03 17:00:24 +0200 | [diff] [blame] | 11 | #include <fs_internal.h> |
Jorgen Lundman | 9b4a1f9 | 2012-07-19 20:48:25 +0000 | [diff] [blame] | 12 | #include <zfs_common.h> |
| 13 | |
Simon Glass | e339475 | 2016-02-29 15:25:34 -0700 | [diff] [blame] | 14 | static struct blk_desc *zfs_blk_desc; |
Simon Glass | c1c4a8f | 2020-05-10 11:39:57 -0600 | [diff] [blame] | 15 | static struct disk_partition *part_info; |
Jorgen Lundman | 9b4a1f9 | 2012-07-19 20:48:25 +0000 | [diff] [blame] | 16 | |
Simon Glass | c1c4a8f | 2020-05-10 11:39:57 -0600 | [diff] [blame] | 17 | void zfs_set_blk_dev(struct blk_desc *rbdd, struct disk_partition *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 | zfs_blk_desc = rbdd; |
Rob Herring | 153817e | 2012-08-23 11:31:49 +0000 | [diff] [blame] | 20 | part_info = info; |
Jorgen Lundman | 9b4a1f9 | 2012-07-19 20:48:25 +0000 | [diff] [blame] | 21 | } |
| 22 | |
| 23 | /* err */ |
| 24 | int zfs_devread(int sector, int byte_offset, int byte_len, char *buf) |
| 25 | { |
Marek BehĂșn | 45ebb95 | 2017-09-03 17:00:24 +0200 | [diff] [blame] | 26 | return fs_devread(zfs_blk_desc, part_info, sector, byte_offset, |
mwleeds@mailtundra.com | 185b1aa | 2024-04-06 18:47:28 -0700 | [diff] [blame] | 27 | byte_len, buf) ? 0 : 1; |
Jorgen Lundman | 9b4a1f9 | 2012-07-19 20:48:25 +0000 | [diff] [blame] | 28 | } |