~ubuntu-branches/ubuntu/saucy/lvm2/saucy

« back to all changes in this revision

Viewing changes to libdm/libdevmapper.h

  • Committer: Package Import Robot
  • Author(s): Dmitrijs Ledkovs
  • Date: 2012-08-14 14:35:57 UTC
  • mfrom: (3.1.25 sid)
  • Revision ID: package-import@ubuntu.com-20120814143557-93aill2tp3kf3o30
Tags: 2.02.95-4ubuntu1
* Merge from Debian unstable, remaining changes:
  - debian/patches/avoid-dev-block.patch: Prefer any other device name over
    names in /dev/block/ since lvm.conf won't handle this.
  - debian/rules:
    - copy .po file to .pot file for Rosetta (Ubuntu specific).
  - debian/{dmsetup,lvm2}-udeb.install:
    - install initramfs and udev hooks in udebs (Debian bug 504341).
  - auto-start VGs as their PVs are discovered (Ubuntu specific):
    - add debian/tree/lvm2/lib/udev/rules.d/85-lvm2.rules: use watershed plus
      the sledgehammer of vgscan/vgchange to turn on VGs as they come online.
    - debian/tree/lvm2/usr/share/initramfs-tools/scripts/hooks/lvm2:
      - add 85-lvm2.rules to the list of udev rules to copy.
      - depend on udev.
    - debian/control:
      - add versioned Depend on watershed in lvm2 for udev rules.
      - add Depends on watershed-udeb in lvm2-udeb for udev rules.
      - add versioned Depend/Breaks on udev in dmsetup for udev rules.
      - add Depend on initramfs-tools in dmsetup so system is not potentially
        rendered unbootable by out-of-order dpkg configuration.
    - debian/rules:
      - do not install local-top scripts since Ubuntu mounts root using udev.
      - do not install init scripts for lvm2, since udev starts LVM.
    - debian/lvm2.postinst: handle missing lvm2 init script.
    - debian/tree/dmsetup/lib/udev/rules.d/60-persistent-storage-dm.rules:
      watch dm devices for changes with inotify
  - add mountroot failure hooks to help fix bad boots (Debian bug 468115):
    - debian/tree/lvm2/usr/share/initramfs-tools/scripts/init-premount/lvm2
  - remaining changes to upstream event manager packages (Debian bug 514706):
    - debian/rules:
      - enable dmeventd during configure.
    - debian/dmeventd.{8,manpages}: install dmeventd files.
  - rename debian/clvm.defaults to debian/clvm.default so it is installed
    correctly.
  - debian/control: add dmsetup-udeb to libdevmapper1.02.1-udeb recommends.
  - debian/rules: make sure dmsetup and lvm2 initramfs-tools scripts are
    executable.  When the Ubuntu-specific ones are added with a patch,
    they may lose their executable bit.
  - Add and install clvmd resource agent
  - Add dependency on libudev-dev to libdevmapper-dev so that the .pc file
    works.
  - debian/{clvmd.ra,clvm.init}:
    - create /run/lvm if it doesn't exist.
  - debian/clvm.init:
    - exit 3 if not running on status action.
  - Call dh_installman so that our dmeventd manpage actually gets installed
  - Install the missing fsadm manpage.

 * libdevmapper-dev:
  - move .so symlinks and pkgconfig files to multiarched locations.
  - mark libdevmapper-dev M-A: same

 * libdevmapper-event1.02.1:
  - Add Breaks: dmeventd (<< 2.02.95-4ubuntu1) due to debian symbol rename

 * debian/lvm2.{preinst,postinst,postrm}:
  - Implement removal of obsolete /etc/init.d/lvm2 conffile, which
    should not have been re-introduced in Quantal.

 * Dropped Changes, included in Debian:
  - Mostly included packages for upstream event manager (Debian bug 514706).
  - debian/patches/rules-subdir.patch: removed as reordering will cause
    build failure with dmeventd.
  - debian/patches/libdm-event-static.patch: removed as other static libs
    aren't being built anymore either.
  - Update symbols for libdevmapper-event.
  - Update libdevmapper-event, dmeventd descriptions to match Debian
    boilerplate.

 * Disappeared Changes:
  - Don't install documentation in udebs. No diff found, but no docs are
    installed into udebs either.

 * Resurected Changes:
  - corrected dropping the wrong init script. Now clvm.init is shipped
    and lvm2.init is dropped in favor of udev rules as per original
    intention (LP: #1037033).

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
#include <inttypes.h>
20
20
#include <stdarg.h>
21
21
#include <sys/types.h>
 
22
#include <sys/stat.h>
22
23
 
23
24
#ifdef linux
24
25
#  include <linux/types.h>
163
164
int dm_get_library_version(char *version, size_t size);
164
165
int dm_task_get_driver_version(struct dm_task *dmt, char *version, size_t size);
165
166
int dm_task_get_info(struct dm_task *dmt, struct dm_info *dmi);
166
 
const char *dm_task_get_name(const struct dm_task *dmt);
167
167
const char *dm_task_get_uuid(const struct dm_task *dmt);
168
168
 
169
169
struct dm_deps *dm_task_get_deps(struct dm_task *dmt);
 
170
struct dm_versions *dm_task_get_versions(struct dm_task *dmt);
 
171
 
 
172
/*
 
173
 * These functions return device-mapper names based on the value
 
174
 * of the mangling mode set during preceding dm_task_run call:
 
175
 *   - unmangled name for DM_STRING_MANGLING_{AUTO, HEX},
 
176
 *   - name without any changes for DM_STRING_MANGLING_NONE.
 
177
 *
 
178
 * To get mangled or unmangled form of the name directly, use
 
179
 * dm_task_get_name_mangled or dm_task_get_name_unmangled function.
 
180
 */
 
181
const char *dm_task_get_name(const struct dm_task *dmt);
170
182
struct dm_names *dm_task_get_names(struct dm_task *dmt);
171
 
struct dm_versions *dm_task_get_versions(struct dm_task *dmt);
172
183
 
173
184
int dm_task_set_ro(struct dm_task *dmt);
174
185
int dm_task_set_newname(struct dm_task *dmt, const char *newname);
190
201
int dm_task_query_inactive_table(struct dm_task *dmt);
191
202
int dm_task_suppress_identical_reload(struct dm_task *dmt);
192
203
int dm_task_secure_data(struct dm_task *dmt);
 
204
int dm_task_retry_remove(struct dm_task *dmt);
193
205
 
194
206
/*
195
207
 * Enable checks for common mistakes such as issuing ioctls in an unsafe order.
236
248
                         void *next, uint64_t *start, uint64_t *length,
237
249
                         char **target_type, char **params);
238
250
 
 
251
/* Parse params from STATUS call for thin_pool target */
 
252
struct dm_pool;
 
253
 
 
254
struct dm_status_thin_pool {
 
255
        uint64_t transaction_id;
 
256
        uint64_t used_metadata_blocks;
 
257
        uint64_t total_metadata_blocks;
 
258
        uint64_t used_data_blocks;
 
259
        uint64_t total_data_blocks;
 
260
        uint64_t held_metadata_root;
 
261
};
 
262
 
 
263
int dm_get_status_thin_pool(struct dm_pool *mem, const char *params,
 
264
                            struct dm_status_thin_pool **status);
 
265
 
 
266
/* Parse params from STATUS call for thin target */
 
267
struct dm_status_thin {
 
268
        uint64_t mapped_sectors;
 
269
        uint64_t highest_mapped_sector;
 
270
};
 
271
 
 
272
int dm_get_status_thin(struct dm_pool *mem, const char *params,
 
273
                       struct dm_status_thin **status);
 
274
 
239
275
/*
240
276
 * Call this to actually run the ioctl.
241
277
 */
248
284
void dm_task_update_nodes(void);
249
285
 
250
286
/*
 
287
 * Mangling support
 
288
 *
 
289
 * Character whitelist: 0-9, A-Z, a-z, #+-.:=@_
 
290
 * HEX mangling format: \xNN, NN being the hex value of the character.
 
291
 * (whitelist and format supported by udev)
 
292
*/
 
293
typedef enum {
 
294
        DM_STRING_MANGLING_NONE, /* do not mangle at all */
 
295
        DM_STRING_MANGLING_AUTO, /* mangle only if not already mangled with hex, error when mixed */
 
296
        DM_STRING_MANGLING_HEX   /* always mangle with hex encoding, no matter what the input is */
 
297
} dm_string_mangling_t;
 
298
 
 
299
/*
 
300
 * Set/get mangling mode used for device-mapper names.
 
301
 */
 
302
int dm_set_name_mangling_mode(dm_string_mangling_t name_mangling);
 
303
dm_string_mangling_t dm_get_name_mangling_mode(void);
 
304
 
 
305
/*
 
306
 * Get mangled/unmangled form of the device-mapper name
 
307
 * irrespective of the global setting (set by dm_set_name_mangling_mode).
 
308
 * The name returned needs to be freed after use by calling dm_free!
 
309
 */
 
310
char *dm_task_get_name_mangled(const struct dm_task *dmt);
 
311
char *dm_task_get_name_unmangled(const struct dm_task *dmt);
 
312
 
 
313
/*
251
314
 * Configure the device-mapper directory
252
315
 */
253
316
int dm_set_dev_dir(const char *dir);
254
317
const char *dm_dir(void);
255
318
 
256
319
/*
 
320
 * Configure sysfs directory, /sys by default
 
321
 */
 
322
int dm_set_sysfs_dir(const char *dir);
 
323
const char *dm_sysfs_dir(void);
 
324
 
 
325
/*
 
326
 * Configure default UUID prefix string.
 
327
 * Conventionally this is a short capitalised prefix indicating the subsystem
 
328
 * that is managing the devices, e.g. "LVM-" or "MPATH-".
 
329
 * To support stacks of devices from different subsystems, recursive functions
 
330
 * stop recursing if they reach a device with a different prefix.
 
331
 */
 
332
int dm_set_uuid_prefix(const char *uuid_prefix);
 
333
const char *dm_uuid_prefix(void);
 
334
 
 
335
/*
257
336
 * Determine whether a major number belongs to device-mapper or not.
258
337
 */
259
338
int dm_is_dm_major(uint32_t major);
260
339
 
261
340
/*
 
341
 * Get associated device name for given major and minor number by reading
 
342
 * the sysfs content. If this is a dm device, get associated dm name, the one
 
343
 * that appears in /dev/mapper. DM names could be resolved this way only if
 
344
 * kernel used >= 2.6.29, kernel name is found otherwise (e.g. dm-0).
 
345
 * If prefer_kernel_name is set, the kernel name is always preferred over
 
346
 * device-mapper name for dm devices no matter what the kernel version is.
 
347
 * For non-dm devices, we always get associated kernel name, e.g sda, md0 etc.
 
348
 * Returns 0 on error or if sysfs is not used (or configured incorrectly),
 
349
 * otherwise returns 1 and the supplied buffer holds the device name.
 
350
 */
 
351
int dm_device_get_name(uint32_t major, uint32_t minor,
 
352
                       int prefer_kernel_name,
 
353
                       char *buf, size_t buf_size);
 
354
 
 
355
/*
 
356
 * Determine whether a device has any holders (devices
 
357
 * using this device). If sysfs is not used (or configured
 
358
 * incorrectly), returns 0.
 
359
 */
 
360
int dm_device_has_holders(uint32_t major, uint32_t minor);
 
361
 
 
362
/*
 
363
 * Determine whether a device contains mounted filesystem.
 
364
 * If sysfs is not used (or configured incorrectly), returns 0.
 
365
 */
 
366
int dm_device_has_mounted_fs(uint32_t major, uint32_t minor);
 
367
 
 
368
 
 
369
/*
 
370
 * Initialise library
 
371
 */
 
372
void dm_lib_init(void) __attribute__((constructor));
 
373
 
 
374
/*
262
375
 * Release library resources
263
376
 */
264
377
void dm_lib_release(void);
401
514
void dm_tree_use_no_flush_suspend(struct dm_tree_node *dnode);
402
515
 
403
516
/*
 
517
 * Retry removal of each device if not successful.
 
518
 */
 
519
void dm_tree_retry_remove(struct dm_tree_node *dnode);
 
520
 
 
521
/*
404
522
 * Is the uuid prefix present in the tree?
405
523
 * Only returns 0 if every node was checked successfully.
406
524
 * Returns 1 if the tree walk has to be aborted.
473
591
                                 uint32_t region_size,
474
592
                                 uint32_t stripe_size,
475
593
                                 uint64_t rebuilds,
476
 
                                 uint64_t reserved2);
 
594
                                 uint64_t flags);
477
595
 
478
596
/*
479
597
 * Replicator operation mode
509
627
                                           uint32_t slog_region_size);
510
628
/* End of Replicator API */
511
629
 
 
630
/*
 
631
 * FIXME: Defines bellow are based on kernel's dm-thin.c defines
 
632
 * DATA_DEV_BLOCK_SIZE_MIN_SECTORS (64 * 1024 >> SECTOR_SHIFT)
 
633
 * DATA_DEV_BLOCK_SIZE_MAX_SECTORS (1024 * 1024 * 1024 >> SECTOR_SHIFT)
 
634
 */
 
635
#define DM_THIN_MIN_DATA_BLOCK_SIZE (UINT32_C(128))
 
636
#define DM_THIN_MAX_DATA_BLOCK_SIZE (UINT32_C(2097152))
 
637
 
 
638
int dm_tree_node_add_thin_pool_target(struct dm_tree_node *node,
 
639
                                      uint64_t size,
 
640
                                      uint64_t transaction_id,
 
641
                                      const char *metadata_uuid,
 
642
                                      const char *pool_uuid,
 
643
                                      uint32_t data_block_size,
 
644
                                      uint64_t low_water_mark,
 
645
                                      unsigned skip_block_zeroing);
 
646
 
 
647
/* Supported messages for thin provision target */
 
648
typedef enum {
 
649
        DM_THIN_MESSAGE_CREATE_SNAP,            /* device_id, origin_id */
 
650
        DM_THIN_MESSAGE_CREATE_THIN,            /* device_id */
 
651
        DM_THIN_MESSAGE_DELETE,                 /* device_id */
 
652
        DM_THIN_MESSAGE_SET_TRANSACTION_ID,     /* current_id, new_id */
 
653
} dm_thin_message_t;
 
654
 
 
655
int dm_tree_node_add_thin_pool_message(struct dm_tree_node *node,
 
656
                                       dm_thin_message_t type,
 
657
                                       uint64_t id1, uint64_t id2);
 
658
 
 
659
/*
 
660
 * FIXME: Defines bellow are based on kernel's dm-thin.c defines
 
661
 * MAX_DEV_ID ((1 << 24) - 1)
 
662
 */
 
663
#define DM_THIN_MAX_DEVICE_ID (UINT32_C((1 << 24) - 1))
 
664
int dm_tree_node_add_thin_target(struct dm_tree_node *node,
 
665
                                 uint64_t size,
 
666
                                 const char *pool_uuid,
 
667
                                 uint32_t device_id);
 
668
 
 
669
void dm_tree_node_set_udev_flags(struct dm_tree_node *node, uint16_t udev_flags);
 
670
 
512
671
void dm_tree_node_set_presuspend_node(struct dm_tree_node *node,
513
672
                                      struct dm_tree_node *presuspend_node);
514
673
 
529
688
                                 uint32_t read_ahead,
530
689
                                 uint32_t read_ahead_flags);
531
690
 
 
691
/*
 
692
 * Set node callback hook before de/activation.
 
693
 * Callback is called before 'activation' of node for activation tree,
 
694
 * or 'deactivation' of node for deactivation tree.
 
695
 */
 
696
typedef enum {
 
697
        DM_NODE_CALLBACK_PRELOADED,   /* Node has preload deps */
 
698
        DM_NODE_CALLBACK_DEACTIVATED, /* Node is deactivated */
 
699
} dm_node_callback_t;
 
700
typedef int (*dm_node_callback_fn) (struct dm_tree_node *node,
 
701
                                    dm_node_callback_t type, void *cb_data);
 
702
void dm_tree_node_set_callback(struct dm_tree_node *node,
 
703
                               dm_node_callback_fn cb, void *cb_data);
 
704
 
532
705
void dm_tree_set_cookie(struct dm_tree_node *node, uint32_t cookie);
533
706
uint32_t dm_tree_get_cookie(struct dm_tree_node *node);
534
707
 
816
989
void dm_list_move(struct dm_list *head, struct dm_list *elem);
817
990
 
818
991
/*
819
 
 * Join 'head1' to the of 'head'.
 
992
 * Join 'head1' to the end of 'head'.
820
993
 */
821
994
void dm_list_splice(struct dm_list *head, struct dm_list *head1);
822
995
 
1014
1187
 */
1015
1188
const char *dm_basename(const char *path);
1016
1189
 
 
1190
/*
 
1191
 * Returns number of occurrences of 'c' in 'str' of length 'size'.
 
1192
 */
 
1193
unsigned dm_count_chars(const char *str, size_t len, const int c);
 
1194
 
 
1195
/*
 
1196
 * Length of string after escaping double quotes and backslashes.
 
1197
 */
 
1198
size_t dm_escaped_len(const char *str);
 
1199
 
 
1200
/*
 
1201
 * <vg>-<lv>-<layer> or if !layer just <vg>-<lv>.
 
1202
 */
 
1203
char *dm_build_dm_name(struct dm_pool *mem, const char *vgname,
 
1204
                       const char *lvname, const char *layer);
 
1205
char *dm_build_dm_uuid(struct dm_pool *mem, const char *prefix, const char *lvid, const char *layer);
 
1206
 
 
1207
/*
 
1208
 * Copies a string, quoting double quotes with backslashes.
 
1209
 */
 
1210
char *dm_escape_double_quotes(char *out, const char *src);
 
1211
 
 
1212
/*
 
1213
 * Undo quoting in situ.
 
1214
 */
 
1215
void dm_unescape_double_quotes(char *src);
 
1216
 
 
1217
/*
 
1218
 * Unescape colons and "at" signs in situ and save the substrings
 
1219
 * starting at the position of the first unescaped colon and the
 
1220
 * first unescaped "at" sign. This is normally used to unescape
 
1221
 * device names used as PVs.
 
1222
 */
 
1223
void dm_unescape_colons_and_at_signs(char *src,
 
1224
                                     char **substr_first_unquoted_colon,
 
1225
                                     char **substr_first_unquoted_at_sign);
 
1226
 
 
1227
/*
 
1228
 * Replacement for strncpy() function.
 
1229
 *
 
1230
 * Copies no more than n bytes from string pointed by src to the buffer
 
1231
 * pointed by dest and ensure string is finished with '\0'.
 
1232
 * Returns 0 if the whole string does not fit.
 
1233
 */
 
1234
int dm_strncpy(char *dest, const char *src, size_t n);
 
1235
 
1017
1236
/**************************
1018
1237
 * file/stream manipulation
1019
1238
 **************************/
1024
1243
 */
1025
1244
int dm_create_dir(const char *dir);
1026
1245
 
 
1246
int dm_is_empty_dir(const char *dir);
 
1247
 
1027
1248
/*
1028
1249
 * Close a stream, with nicer error checking than fclose's.
1029
1250
 * Derived from gnulib's close-stream.c.
1181
1402
void dm_report_field_set_value(struct dm_report_field *field, const void *value,
1182
1403
                               const void *sortvalue);
1183
1404
 
 
1405
/*************************
 
1406
 * config file parse/print
 
1407
 *************************/
 
1408
typedef enum {
 
1409
        DM_CFG_INT,
 
1410
        DM_CFG_FLOAT,
 
1411
        DM_CFG_STRING,
 
1412
        DM_CFG_EMPTY_ARRAY
 
1413
} dm_config_value_type_t;
 
1414
 
 
1415
struct dm_config_value {
 
1416
        dm_config_value_type_t type;
 
1417
 
 
1418
        union {
 
1419
                int64_t i;
 
1420
                float f;
 
1421
                double d;               /* Unused. */
 
1422
                const char *str;
 
1423
        } v;
 
1424
 
 
1425
        struct dm_config_value *next;   /* For arrays */
 
1426
};
 
1427
 
 
1428
struct dm_config_node {
 
1429
        const char *key;
 
1430
        struct dm_config_node *parent, *sib, *child;
 
1431
        struct dm_config_value *v;
 
1432
};
 
1433
 
 
1434
struct dm_config_tree {
 
1435
        struct dm_config_node *root;
 
1436
        struct dm_config_tree *cascade;
 
1437
        struct dm_pool *mem;
 
1438
        void *custom;
 
1439
};
 
1440
 
 
1441
struct dm_config_tree *dm_config_create(void);
 
1442
struct dm_config_tree *dm_config_from_string(const char *config_settings);
 
1443
int dm_config_parse(struct dm_config_tree *cft, const char *start, const char *end);
 
1444
 
 
1445
void *dm_config_get_custom(struct dm_config_tree *cft);
 
1446
void dm_config_set_custom(struct dm_config_tree *cft, void *custom);
 
1447
 
 
1448
/*
 
1449
 * When searching, first_cft is checked before second_cft.
 
1450
 */
 
1451
struct dm_config_tree *dm_config_insert_cascaded_tree(struct dm_config_tree *first_cft, struct dm_config_tree *second_cft);
 
1452
 
 
1453
/*
 
1454
 * If there's a cascaded dm_config_tree, remove the top layer
 
1455
 * and return the layer below.  Otherwise return NULL.
 
1456
 */
 
1457
struct dm_config_tree *dm_config_remove_cascaded_tree(struct dm_config_tree *cft);
 
1458
 
 
1459
void dm_config_destroy(struct dm_config_tree *cft);
 
1460
 
 
1461
typedef int (*dm_putline_fn)(const char *line, void *baton);
 
1462
int dm_config_write_node(const struct dm_config_node *cn, dm_putline_fn putline, void *baton);
 
1463
 
 
1464
struct dm_config_node *dm_config_find_node(const struct dm_config_node *cn, const char *path);
 
1465
int dm_config_has_node(const struct dm_config_node *cn, const char *path);
 
1466
const char *dm_config_find_str(const struct dm_config_node *cn, const char *path, const char *fail);
 
1467
const char *dm_config_find_str_allow_empty(const struct dm_config_node *cn, const char *path, const char *fail);
 
1468
int dm_config_find_int(const struct dm_config_node *cn, const char *path, int fail);
 
1469
int64_t dm_config_find_int64(const struct dm_config_node *cn, const char *path, int64_t fail);
 
1470
float dm_config_find_float(const struct dm_config_node *cn, const char *path, float fail);
 
1471
 
 
1472
const struct dm_config_node *dm_config_tree_find_node(const struct dm_config_tree *cft, const char *path);
 
1473
const char *dm_config_tree_find_str(const struct dm_config_tree *cft, const char *path, const char *fail);
 
1474
const char *dm_config_tree_find_str_allow_empty(const struct dm_config_tree *cft, const char *path, const char *fail);
 
1475
int dm_config_tree_find_int(const struct dm_config_tree *cft, const char *path, int fail);
 
1476
int64_t dm_config_tree_find_int64(const struct dm_config_tree *cft, const char *path, int64_t fail);
 
1477
float dm_config_tree_find_float(const struct dm_config_tree *cft, const char *path, float fail);
 
1478
int dm_config_tree_find_bool(const struct dm_config_tree *cft, const char *path, int fail);
 
1479
 
 
1480
/*
 
1481
 * Understands (0, ~0), (y, n), (yes, no), (on,
 
1482
 * off), (true, false).
 
1483
 */
 
1484
int dm_config_find_bool(const struct dm_config_node *cn, const char *path, int fail);
 
1485
 
 
1486
int dm_config_get_uint32(const struct dm_config_node *cn, const char *path, uint32_t *result);
 
1487
int dm_config_get_uint64(const struct dm_config_node *cn, const char *path, uint64_t *result);
 
1488
int dm_config_get_str(const struct dm_config_node *cn, const char *path, const char **result);
 
1489
int dm_config_get_list(const struct dm_config_node *cn, const char *path, const struct dm_config_value **result);
 
1490
int dm_config_get_section(const struct dm_config_node *cn, const char *path, const struct dm_config_node **result);
 
1491
 
 
1492
unsigned dm_config_maybe_section(const char *str, unsigned len);
 
1493
 
 
1494
const char *dm_config_parent_name(const struct dm_config_node *n);
 
1495
 
 
1496
struct dm_config_node *dm_config_clone_node_with_mem(struct dm_pool *mem, const struct dm_config_node *node, int siblings);
 
1497
struct dm_config_node *dm_config_create_node(struct dm_config_tree *cft, const char *key);
 
1498
struct dm_config_value *dm_config_create_value(struct dm_config_tree *cft);
 
1499
struct dm_config_node *dm_config_clone_node(struct dm_config_tree *cft, const struct dm_config_node *cn, int siblings);
 
1500
 
 
1501
struct dm_pool *dm_config_memory(struct dm_config_tree *cft);
 
1502
 
1184
1503
/* Cookie prefixes.
 
1504
 *
1185
1505
 * The cookie value consists of a prefix (16 bits) and a base (16 bits).
1186
1506
 * We can use the prefix to store the flags. These flags are sent to
1187
1507
 * kernel within given dm task. When returned back to userspace in
1189
1509
 * of udev rules we use by decoding the cookie prefix. When doing the
1190
1510
 * notification, we replace the cookie prefix with DM_COOKIE_MAGIC,
1191
1511
 * so we notify the right semaphore.
 
1512
 *
1192
1513
 * It is still possible to use cookies for passing the flags to udev
1193
1514
 * rules even when udev_sync is disabled. The base part of the cookie
1194
1515
 * will be zero (there's no notification semaphore) and prefix will be