Line 0
Link Here
|
|
|
1 |
--- a/libparted/arch/linux.c |
2 |
+++ b/libparted/arch/linux.c |
3 |
@@ -2304,6 +2304,7 @@ |
4 |
return r < 0 ? NULL : resultp; |
5 |
} |
6 |
|
7 |
+#ifdef ENABLE_DEVICE_MAPPER |
8 |
static char * |
9 |
dm_canonical_path (PedDevice const *dev) |
10 |
{ |
11 |
@@ -2326,12 +2327,22 @@ |
12 |
err: |
13 |
return NULL; |
14 |
} |
15 |
+#endif /* ENABLE_DEVICE_MAPPER */ |
16 |
|
17 |
static char* |
18 |
_device_get_part_path (PedDevice const *dev, int num) |
19 |
{ |
20 |
- char *devpath = (dev->type == PED_DEVICE_DM |
21 |
- ? dm_canonical_path (dev) : dev->path); |
22 |
+ char *devpath = |
23 |
+#ifdef ENABLE_DEVICE_MAPPER |
24 |
+ ( |
25 |
+ dev->type == PED_DEVICE_DM |
26 |
+ ? dm_canonical_path (dev) : |
27 |
+#endif /* ENABLE_DEVICE_MAPPER */ |
28 |
+ dev->path |
29 |
+#ifdef ENABLE_DEVICE_MAPPER |
30 |
+ ) |
31 |
+#endif /* ENABLE_DEVICE_MAPPER */ |
32 |
+ ; |
33 |
size_t path_len = strlen (devpath); |
34 |
char *result; |
35 |
/* Check for devfs-style /disc => /partN transformation |
36 |
@@ -2945,12 +2956,14 @@ |
37 |
unsigned long long *length); |
38 |
|
39 |
|
40 |
+#ifdef ENABLE_DEVICE_MAPPER |
41 |
if (disk->dev->type == PED_DEVICE_DM) { |
42 |
add_partition = _dm_add_partition; |
43 |
remove_partition = _dm_remove_partition; |
44 |
resize_partition = _dm_resize_partition; |
45 |
get_partition_start_and_length = _dm_get_partition_start_and_length; |
46 |
} else { |
47 |
+#endif /* ENABLE_DEVICE_MAPPER */ |
48 |
add_partition = _blkpg_add_partition; |
49 |
remove_partition = _blkpg_remove_partition; |
50 |
#ifdef BLKPG_RESIZE_PARTITION |
51 |
@@ -2959,7 +2972,9 @@ |
52 |
resize_partition = NULL; |
53 |
#endif |
54 |
get_partition_start_and_length = _kernel_get_partition_start_and_length; |
55 |
+#ifdef ENABLE_DEVICE_MAPPER |
56 |
} |
57 |
+#endif /* ENABLE_DEVICE_MAPPER */ |
58 |
|
59 |
/* lpn = largest partition number. |
60 |
* for remove pass, use greater of device or label limit */ |