dev.c 643 B

123456789101112131415161718192021222324252627282930
  1. // SPDX-License-Identifier: GPL-2.0+
  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>
  8. */
  9. #include <common.h>
  10. #include <config.h>
  11. #include <fs_internal.h>
  12. #include <zfs_common.h>
  13. static struct blk_desc *zfs_blk_desc;
  14. static struct disk_partition *part_info;
  15. void zfs_set_blk_dev(struct blk_desc *rbdd, struct disk_partition *info)
  16. {
  17. zfs_blk_desc = rbdd;
  18. part_info = info;
  19. }
  20. /* err */
  21. int zfs_devread(int sector, int byte_offset, int byte_len, char *buf)
  22. {
  23. return fs_devread(zfs_blk_desc, part_info, sector, byte_offset,
  24. byte_len, buf);
  25. }