Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
wdenk | 4d01d9e | 2004-03-25 14:59:05 +0000 | [diff] [blame] | 2 | /* |
| 3 | * (C) Copyright 2003 - 2004 |
| 4 | * Sysgo AG, <www.elinos.com>, Pavel Bartusek <pba@sysgo.com> |
wdenk | 4d01d9e | 2004-03-25 14:59:05 +0000 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | |
| 8 | #include <common.h> |
wdenk | 4d01d9e | 2004-03-25 14:59:05 +0000 | [diff] [blame] | 9 | #include <config.h> |
| 10 | #include <reiserfs.h> |
Marek Behún | 45ebb95 | 2017-09-03 17:00:24 +0200 | [diff] [blame] | 11 | #include <fs_internal.h> |
wdenk | 4d01d9e | 2004-03-25 14:59:05 +0000 | [diff] [blame] | 12 | #include "reiserfs_private.h" |
| 13 | |
Simon Glass | e339475 | 2016-02-29 15:25:34 -0700 | [diff] [blame] | 14 | static struct blk_desc *reiserfs_blk_desc; |
Rob Herring | 8d6ba05 | 2012-08-23 11:31:50 +0000 | [diff] [blame] | 15 | static disk_partition_t *part_info; |
wdenk | 4d01d9e | 2004-03-25 14:59:05 +0000 | [diff] [blame] | 16 | |
| 17 | |
Simon Glass | e339475 | 2016-02-29 15:25:34 -0700 | [diff] [blame] | 18 | void reiserfs_set_blk_dev(struct blk_desc *rbdd, disk_partition_t *info) |
wdenk | 4d01d9e | 2004-03-25 14:59:05 +0000 | [diff] [blame] | 19 | { |
Simon Glass | e339475 | 2016-02-29 15:25:34 -0700 | [diff] [blame] | 20 | reiserfs_blk_desc = rbdd; |
Rob Herring | 8d6ba05 | 2012-08-23 11:31:50 +0000 | [diff] [blame] | 21 | part_info = info; |
wdenk | 4d01d9e | 2004-03-25 14:59:05 +0000 | [diff] [blame] | 22 | } |
| 23 | |
Marek Behún | 45ebb95 | 2017-09-03 17:00:24 +0200 | [diff] [blame] | 24 | int reiserfs_devread(int sector, int byte_offset, int byte_len, char *buf) |
wdenk | 4d01d9e | 2004-03-25 14:59:05 +0000 | [diff] [blame] | 25 | { |
Marek Behún | 45ebb95 | 2017-09-03 17:00:24 +0200 | [diff] [blame] | 26 | return fs_devread(reiserfs_blk_desc, part_info, sector, byte_offset, |
| 27 | byte_len, buf); |
wdenk | 4d01d9e | 2004-03-25 14:59:05 +0000 | [diff] [blame] | 28 | } |