dev.c 636 B

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