patch-libparted_arch_linux_c 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. --- parted-3.2.orig/libparted/arch/linux.c 2014-06-15 14:15:54.000000000 -0500
  2. +++ parted-3.2/libparted/arch/linux.c 2015-01-03 14:10:43.244848741 -0600
  3. @@ -2304,6 +2304,7 @@ zasprintf (const char *format, ...)
  4. return r < 0 ? NULL : resultp;
  5. }
  6. +#ifdef ENABLE_DEVICE_MAPPER
  7. static char *
  8. dm_canonical_path (PedDevice const *dev)
  9. {
  10. @@ -2326,12 +2327,17 @@ dm_canonical_path (PedDevice const *dev)
  11. err:
  12. return NULL;
  13. }
  14. +#endif
  15. static char*
  16. _device_get_part_path (PedDevice const *dev, int num)
  17. {
  18. +#ifdef ENABLE_DEVICE_MAPPER
  19. char *devpath = (dev->type == PED_DEVICE_DM
  20. ? dm_canonical_path (dev) : dev->path);
  21. +#else
  22. + char *devpath = dev->path;
  23. +#endif
  24. size_t path_len = strlen (devpath);
  25. char *result;
  26. /* Check for devfs-style /disc => /partN transformation
  27. @@ -2946,10 +2952,12 @@ _disk_sync_part_table (PedDisk* disk)
  28. if (disk->dev->type == PED_DEVICE_DM) {
  29. +#ifdef ENABLE_DEVICE_MAPPER
  30. add_partition = _dm_add_partition;
  31. remove_partition = _dm_remove_partition;
  32. resize_partition = _dm_resize_partition;
  33. get_partition_start_and_length = _dm_get_partition_start_and_length;
  34. +#endif
  35. } else {
  36. add_partition = _blkpg_add_partition;
  37. remove_partition = _blkpg_remove_partition;