wok-next view parted/stuff/patches/parted-3.2-devmapper-1.patch @ rev 20239
linux-cloop: tiny patch (again)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Mon Nov 06 18:03:36 2017 +0100 (2017-11-06) |
parents | |
children |
line source
1 Submitted By: Ken Moffat <ken at linuxfromscratch dot org>
2 Date: 2014-08-16
3 Initial Package Version: 3.2
4 Upstream Status: Unknown
5 Origin: Funtoo Linux
6 URL: http://data.gpo.zugaina.org/funtoo/sys-block/parted/files/parted-3.2-devmapper.patch
7 Description: Parted-3.2 fails to build with --disable-device-mapper
10 --- a/libparted/arch/linux.c
11 +++ b/libparted/arch/linux.c
12 @@ -2304,6 +2304,7 @@
13 return r < 0 ? NULL : resultp;
14 }
16 +#ifdef ENABLE_DEVICE_MAPPER
17 static char *
18 dm_canonical_path (PedDevice const *dev)
19 {
20 @@ -2326,12 +2327,22 @@
21 err:
22 return NULL;
23 }
24 +#endif /* ENABLE_DEVICE_MAPPER */
26 static char*
27 _device_get_part_path (PedDevice const *dev, int num)
28 {
29 - char *devpath = (dev->type == PED_DEVICE_DM
30 - ? dm_canonical_path (dev) : dev->path);
31 + char *devpath =
32 +#ifdef ENABLE_DEVICE_MAPPER
33 + (
34 + dev->type == PED_DEVICE_DM
35 + ? dm_canonical_path (dev) :
36 +#endif /* ENABLE_DEVICE_MAPPER */
37 + dev->path
38 +#ifdef ENABLE_DEVICE_MAPPER
39 + )
40 +#endif /* ENABLE_DEVICE_MAPPER */
41 + ;
42 size_t path_len = strlen (devpath);
43 char *result;
44 /* Check for devfs-style /disc => /partN transformation
45 @@ -2945,12 +2956,14 @@
46 unsigned long long *length);
49 +#ifdef ENABLE_DEVICE_MAPPER
50 if (disk->dev->type == PED_DEVICE_DM) {
51 add_partition = _dm_add_partition;
52 remove_partition = _dm_remove_partition;
53 resize_partition = _dm_resize_partition;
54 get_partition_start_and_length = _dm_get_partition_start_and_length;
55 } else {
56 +#endif /* ENABLE_DEVICE_MAPPER */
57 add_partition = _blkpg_add_partition;
58 remove_partition = _blkpg_remove_partition;
59 #ifdef BLKPG_RESIZE_PARTITION
60 @@ -2959,7 +2972,9 @@
61 resize_partition = NULL;
62 #endif
63 get_partition_start_and_length = _kernel_get_partition_start_and_length;
64 +#ifdef ENABLE_DEVICE_MAPPER
65 }
66 +#endif /* ENABLE_DEVICE_MAPPER */
68 /* lpn = largest partition number.
69 * for remove pass, use greater of device or label limit */