File: devmapper.h

package info (click to toggle)
multipath-tools 0.14.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,088 kB
  • sloc: ansic: 64,885; perl: 1,622; makefile: 742; sh: 732; pascal: 155
file content (39 lines) | stat: -rw-r--r-- 1,524 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#ifndef KPARTX_DEVMAPPER_H_INCLUDED
#define KPARTX_DEVMAPPER_H_INCLUDED

#ifdef DM_SUBSYSTEM_UDEV_FLAG0
#define MPATH_UDEV_RELOAD_FLAG DM_SUBSYSTEM_UDEV_FLAG0
#else
#define MPATH_UDEV_RELOAD_FLAG 0
#endif

extern int udev_sync;

int dm_prereq (char *, uint32_t, uint32_t, uint32_t);
int dm_simplecmd (int, const char *, int, uint16_t);
int dm_addmap (int, const char *, const char *, const char *, uint64_t,
	       int, const char *, int, mode_t, uid_t, gid_t);
char * dm_mapname(int major, int minor);
dev_t dm_get_first_dep(char *devname);
char * dm_mapuuid(const char *mapname);
int dm_devn (const char * mapname, unsigned int *major, unsigned int *minor);
int dm_remove_partmaps (char * mapname, char *uuid, dev_t devt, int verbose);
int dm_find_part(const char *parent, const char *delim, int part,
		 const char *parent_uuid,
		 char *name, size_t namesiz, char **part_uuid, int verbose);

/*
 * UUID format for partitions created on non-DM devices
 * ${UUID_PREFIX}devnode_${MAJOR}:${MINOR}_${NONDM_UUID_SUFFIX}"
 * where ${UUID_PREFIX} is "part${PARTNO}-" (see devmapper.c).
 *
 * The suffix should be sufficiently unique to avoid incidental conflicts;
 * the value below is a base64-encoded random number.
 * The UUID format shouldn't be changed between kpartx releases.
 */
#define NONDM_UUID_PREFIX "devnode"
#define NONDM_UUID_SUFFIX "Wh5pYvM"
char *nondm_create_uuid(dev_t devt);
int nondm_parse_uuid(const char *uuid,
		     unsigned int *major, unsigned int *minor);
#endif /* KPARTX_DEVMAPPER_H_INCLUDED */