summaryrefslogtreecommitdiffstats
path: root/libdm/libdevmapper.h
Commit message (Collapse)AuthorAgeFilesLines
...
* Move the core of the lib/config/config.c functionality into libdevmapper,Petr Rockai2011-08-301-0/+143
| | | | | | | leaving behind the LVM-specific parts of the code (convenience wrappers that handle `struct device` and `struct cmd_context`, basically). A number of functions have been renamed (in addition to getting a dm_ prefix) -- namely, all of the config interface now has a dm_config_ prefix.
* restrict dm_tree_node_add_null_areaAlasdair Kergon2011-08-191-0/+4
|
* Add support for m-way to n-way up-convert in RAID1 (no linear to n-way yet)Jonathan Earl Brassow2011-08-181-1/+1
| | | | | | | | | | | This patch adds the ability to upconvert a raid1 array - say from 2-way to 3-way. It does not yet support upconverting linear to n-way. The 'raid' device-mapper target allows for individual components (images) of an array to be specified for rebuild. This mechanism is used when adding new images to the array so that the new images can be resync'ed while the rest of the images in the array can remain 'in-sync'. (There is no mirror-on-mirror layering required.)
* Add the ability to split an image from the mirror and track changes.Jonathan Earl Brassow2011-08-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ~> lvconvert --splitmirrors 1 --trackchanges vg/lv The '--trackchanges' option allows a user the ability to use an image of a RAID1 array for the purposes of temporary read-only access. The image can be merged back into the array at a later time and only the blocks that have changed in the array since the split will be resync'ed. This operation can be thought of as a partial split. The image is never completely extracted from the array, in that the array reserves the position the device occupied and tracks the differences between the array and the split image via a bitmap. The image itself is rendered read-only and the name (<LV>_rimage_*) cannot be changed. The user can complete the split (permanently splitting the image from the array) by re-issuing the 'lvconvert' command without the '--trackchanges' argument and specifying the '--name' argument. ~> lvconvert --splitmirrors 1 --name my_split vg/lv Merging the tracked image back into the array is done with the '--merge' option (included in a follow-on patch). ~> lvconvert --merge vg/lv_rimage_<n> The internal mechanics of this are relatively simple. The 'raid' device- mapper target allows for the specification of an empty slot in an array via '- -'. This is what will be used if a partial activation of an array is ever required. (It would also be possible to use 'error' targets in place of the '- -'.) If a RAID image is found to be both read-only and visible, then it is considered separate from the array and '- -' is used to hold it's position in the array. So, all that needs to be done to temporarily split an image from the array /and/ cause the kernel target's bitmap to track (aka "mark") changes made is to make the specified image visible and read-only. To merge the device back into the array, the image needs to be returned to the read/write state of the top-level LV and made invisible.
* Add memory pool locking functionsZdenek Kabelac2011-08-111-0/+16
| | | | | | | | | | | | | | | | | | | Adding debuging functionality to lock and unlock memory pool. 2 ways to debug code: crc - is default checksum/hash of the locked pool. It gets slower when the pool is larger - so the check is only made when VG is finaly released and it has been used more then once.Thus the result is rather informative. mprotect - quite fast all the time - but requires more memory and currently it is using posix_memalign() - this could be later modified to use dm_malloc() and align internally. Tool segfaults when locked memory is modified and core could be examined for faulty code section (backtrace). Only fast memory pools could use mprotect for now - so such debug builds cannot be combined with DEBUG_POOL.
* Add basic RAID segment type(s) support.Jonathan Earl Brassow2011-08-021-0/+8
| | | | | | | | | | | | | Implementation described in doc/lvm2-raid.txt. Basic support includes: - ability to create RAID 1/4/5/6 arrays - ability to delete RAID arrays - ability to display RAID arrays Notable missing features (not included in this patch): - ability to clean-up/repair failures - ability to convert RAID segment types - ability to monitor RAID segment types
* Add framework for validation of ioctls. Doesn't do any checks yet.Alasdair Kergon2011-07-011-0/+6
| | | | | | dmsetup --checks libdevmapper: dm_task_enable_checks() lvm.conf: activation/checks=1
* Maintain a count of the number of suspended devices in libdevmapperAlasdair Kergon2011-06-131-0/+5
| | | | | | | | | and use this for the LVM critical section logic. Also report an error if code tries to load a table while any device is known to be in the suspended state. (If the variety of problems these changes are showing up can't be fixed before the next release, the error messages can be reduced to debug level.)
* Use void pointer instead of char for binary keyZdenek Kabelac2011-03-101-4/+4
| | | | | | | | dm_hash binary functions takes void* key - so there is no need to cast pointers to char* (also the hash key does not have trailing '\0'). This is slight API change, but presents no change for the API user side it just allows to write code easier as the casting could be removed.
* API change - support more const argZdenek Kabelac2011-02-181-1/+1
| | | | | | | | | As dm_report_field_string() doesn't modify content of data pointer, it can be marked as const. It's slight API change - but doesn't require any change on the user side and supports wider range of arguments without const casting. (i.e. we may use as paramater const lv struct this way: &lv->name)
* Add --addnodeonresume, --addnodeoncreateZdenek Kabelac2011-02-041-0/+5
| | | | | | | | | | | | | | | | Add new function dm_task_set_add_node() to select between 2 types of node creation in device directory. DM_ADD_NODE_ON_RESUME is now default and ensures node is created on resume. Old original behavior is accessible with DM_ADD_NODE_ON_CREATE. In this case node would be created during dmsetup create --notable. For the user 2 new options for dmsetup create are added: [{--addnodeonresume | --addnodeoncreate }] Properly working node creation on resume is needed for proper operation stacking and ability to correctly check in which state the device should after whole udev transation.
* Suport DM_SECURE_DATA_FLAG.Milan Broz2011-02-041-0/+1
| | | | | It will be user for cryptsetup to ensure buffers are properly wiped when sending sensitive data (key).
* Define DM_COOKIE_AUTO_CREATEZdenek Kabelac2011-01-101-0/+5
| | | | TODO: Use it also for already written code.
* Export DM_CONTROL_NODE_UMASK and use it while creating /dev/mapper/control.Peter Rajnoha2011-01-041-0/+1
|
* Use const char* for offset calculationZdenek Kabelac2010-12-201-1/+1
| | | | | | As 'const' types are also passed to macro dm_list_struct_base - keep offset calculation with const char pointers. Fixes several gcc constness warnings.
* Use const char* const * for dm_regex_create()Zdenek Kabelac2010-12-201-1/+1
| | | | | | | Change API interface to accept even completely const array patterns. This should present no change for libdm users and allows to pass pattern arrays without cast to const char **.
* Add new dm_prepare_selinux_context fn to libdevmapper and use it throughout.Peter Rajnoha2010-12-131-0/+11
| | | | | | | | | | | Detect existence of new SELinux selabel interface during configure. Use new dm_prepare_selinux_context instead of dm_set_selinux_context. We should set the SELinux context before the actual file system object creation. The new dm_prepare_selinux_context function sets this using the selabel_lookup fn in conjuction with the setfscreatecon fn. If selinux/label.h interface (that should be a part of the selinux library) is not found during configure, we fallback to the original matchpathcon function instead.
* Use const pointer for return value of dm_basenameZdenek Kabelac2010-10-251-1/+1
| | | | Fix return pointer to const as it is created from passed input const pointer.
* Add --setuuid to dmsetup rename.Alasdair Kergon2010-10-151-0/+1
| | | | Add dm_task_set_newuuid to set uuid of mapped device post-creation. (pjones)
* Add dm_zalloc and use it and dm_pool_zalloc throughout.Alasdair Kergon2010-09-301-0/+4
|
* Add macro definitions to report infrastructure for character array length.Dave Wysochanski2010-08-201-2/+7
| | | | | | | | | | Rather than hard code the size of the field, use a #define, so we can re-use. The #define will be needed in a future patch when we extend the reporting infrastructure to have 'get' and 'set' functions for each field, allowing lvm2app functions which query any report field. In order to provide a generic lookup based on the field id, we will define a type containing this field id, and thus, we will need to re-use the length of this string as it's defined inside libdevmapper.h.
* It's not enough to check for the kernel module in the case of clusterJonathan Earl Brassow2010-07-211-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | mirrors, we must also check that the log daemon (cmirrord) is running. The log module can be auto-loaded, but the daemon cannot be "auto-started". Failing to check for the daemon produces cryptic messages that customers have a hard time deciphering. (The system messages do report that the log daemon is not running, but people don't seem to find this message easily.) Here are examples of what is printed when the module is available, but the log daemon has not been started. [root@bp-01 LVM2]# lvcreate -m1 -l1 -n lv vg Shared cluster mirrors are not available. [root@bp-01 LVM2]# lvcreate -m1 -l1 -n lv vg -v Setting logging type to disk Finding volume group "vg" Archiving volume group "vg" metadata (seqno 3). Creating logical volume lv Executing: /sbin/modprobe dm-log-userspace Cluster mirror log daemon is not running Shared cluster mirrors are not available. Creating volume group backup "/etc/lvm/backup/vg" (seqno 4).
* [REGEX] calculate dfa states on demandJoe Thornber2010-07-211-0/+2
|
* [REGEX] add a fingerprinting facility to allow test code to compare dfasJoe Thornber2010-07-201-0/+8
|
* Add dm_create_lockfile to libdm to handle pidfiles for all daemons.Fabio M. Di Nitto2010-07-131-0/+8
| | | | | | Switch dmeventd to use dm_create_lockfile and drop duplicate code. Allow clvmd pidfile to be configurable. Switch cmirrord and clvmd to use dm_create_lockfile.
* Use __attribute__ consistently throughout.Alasdair Kergon2010-07-091-1/+1
|
* Add parentheses to some libdevmapper.h macro arguments.Alasdair Kergon2010-07-051-8/+8
|
* Add printf format attributes to yes_no_prompt & dm_{sn,as}printf and fix a calleAlasdair Kergon2010-07-021-2/+5
|
* In some C++ standards, typeof is not reserved.Alasdair Kergon2010-06-231-7/+11
|
* Remove C++ private keyword from headers.Milan Broz2010-06-161-3/+10
| | | | Add extern C definition for libdevmapper, lvm2app and lvm2cmd.
* Replicator: support deactivate of replicator-dev nodesZdenek Kabelac2010-05-211-0/+3
| | | | | | | | | Introducing dm_tree_node_set_presuspend_node() for presuspending child node (i.e. replicator control target) before deactivation of parent node (i.e. replicator-dev target). This patch presents no functional change to current dtree - only replicator target currently sets presuspend node for dev nodes.
* Replicator: libdm supportZdenek Kabelac2010-05-211-0/+35
| | | | | | | | Introducing new API calls: dm_tree_node_add_replicator_target() dm_tree_node_add_replicator_dev_target(). Define new typedef dm_replicator_mode_t.
* Add dm_list_splice() to join two lists.Zdenek Kabelac2010-05-061-0/+5
|
* Add support for new IMPORT{db} udev rule.Peter Rajnoha2010-04-281-0/+10
| | | | | | | | | | This rule appeared in udev v152 and it helps us to support spurious events where we didn't have any flags set (events originated in udevadm trigger or the watch rule). These flags are important to direct the rule application. Now, with the help of this rule, we can regenerate old udev db content. To implement this correctly, we need to flag all proper DM udev events with DM_UDEV_PRIMARY_SOURCE_FLAG. That happens automatically for all ioctls generating events originated in libdevmapper.
* Add dm_bitset_equal to libdevmapper.Alasdair Kergon2010-04-201-0/+2
|
* missed files from last commitAlasdair Kergon2010-04-201-0/+1
|
* Several changes in dmsetup and libdevmapper:Peter Rajnoha2010-02-151-0/+8
| | | | | | | | | | | | | - add DM_UDEV_DISABLE_LIBRARY_FALLBACK udev flag to rely on udev only - export dm_udev_create_cookie function to create new cookies on demand - add --udevcookie, udevcreatecookie and udevreleasecookie for dmsetup (to support "udev transactions" where one cookie value can be used for several dmsetup calls) - don't use DM_UDEV_DISABLE_CHECKING env. var. anymore and set the state automatically (based on udev and libdevmapper dev path comparison)
* Cleanup gcc warning: cast discards qualifiers from pointer target typeZdenek Kabelac2010-01-141-8/+8
| | | | | API of the library should remain the same as the 'const' is not mangled into the function name in C.
* Cleanup gcc warning: cast from function call of type 'struct dm_list *'Zdenek Kabelac2010-01-141-1/+1
| | | | | | | to non-matching type 'long unsigned int' Casting pointer to long and back to pointer could be easily handled with just pointer arithmetic.
* Add support for "snapshot-merge" target.Mike Snitzer2010-01-131-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduces new libdevmapper function dm_tree_node_add_snapshot_merge_target Verifies that the kernel (dm-snapshot) provides the 'snapshot-merge' target. Activate origin LV as snapshot-merge target. Using snapshot-origin target would be pointless because the origin contains volatile data while a merge is in progress. Because snapshot-merge target is activated in place of the snapshot-origin target it must be resumed after all other snapshots (just like snapshot-origin does) --- otherwise small window for data corruption would exist. Ideally the merging snapshot would not be activated at all but if it is to be activated (because snapshot was already active) it _must_ be done after the snapshot-merge. This insures that DM's snapshot-merge target will perform exception handover in the proper order (new->resume before old->resume). DM's snapshot-merge does support handover if the reverse sequence is used (old->resume before new->resume) but DM will fail to resume the old snapshot; leaving it suspended. To insure the proper activation sequence dm_tree_activate_children() was updated to accommodate an additional 'activation_priority' level. All regular snapshots are 0, snapshot-merge is 1, and merging snapshot is 2.
* Add support to disable udev checking: DM_UDEV_DISABLE_CHECKING=1 env. variable.Peter Rajnoha2010-01-111-0/+2
| | | | | | | | | | | Sometimes it is really needed to switch off udev checking and the warnings we show when we detect that udev has not done its job right - the messages like "Udev should have done this and that. Falling back to direct node creation/removal. " etc. This would be especially handy while setting DM_DEV_DIR env var that could be set to a different location than standard /dev (udev can't create nodes/symlinks out of that one directory that is configured into udevd). The exact same situation happens while we're running our tests.
* Add activation/udev_rules config option in lvm.conf.Peter Rajnoha2010-01-071-0/+2
| | | | Add dm_tree_add_dev_with_udev_flags to provide wider support for udev flags.
* Support udev flags even when udev_sync is disabled or not compiled in.Peter Rajnoha2009-11-131-1/+5
| | | | | | | | | | | This provides better support for environments where udev rules are installed but udev_sync is not compiled in (however, using udev_sync is highly recommended). It also provides consistent and expected functionality even when '--noudevsync' option is used. There is still requirement for kernel >= 2.6.31 for the flags to work though (it uses DM cookies to pass the flags into the kernel and set them in udev event environment that we can read in udev rules).
* Remove 'last_rule' from udev rules.Peter Rajnoha2009-11-131-3/+3
| | | | | | | | 'last_rule' option has been removed from udev (version >= 147). From now on, we require foreign rules to check and honor ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG} instead. Foreign rules should be skipped totally when this flag is set.
* Add support for querying a device's inactive table.Alasdair Kergon2009-11-061-0/+1
| | | | | Currently this data is invisible to userspace. Requires dm >= 4.16 (likely to be in linux 2.6.33).
* Several changes to udev support code:Peter Rajnoha2009-10-261-3/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | - we have these levels when the udev rules are processed: 10-dm.rules --> [11-dm-<subsystem>.rules] --> [12-dm-permissions.rules] --> 13-dm-disk.rules --> [...all the other foreign rules...] --> 95-dm-notify.rules - each level can be disabled now by DM_UDEV_DISABLE_{DM, SUBSYSTEM, DISK, OTHER}_RULES_FLAG - add DM_UDEV_DISABLE_DM_RULES_FLAG to disable 10-dm.rules - add DM_UDEV_DISABLE_OTHER_RULES_FLAG to disable all the other (non-dm) rules. We cutoff these rules by using the 'last_rule', so this one should really be used with great care and in well-founded situations. We use this for lvm's hidden and layer devices now. - add a parameter for add_dev_node, rm_dev_node and rename_dev_node so it's possible to switch on/off udev checks - use DM_UDEV_DISABLE_DM_RULES_FLAG and DM_UDEV_DISABLE_SUBSYSTEM_RULES_FLAG if there's no cookie set and we have resume, remove and rename ioctl. This could happen when someone uses the libdevmapper that is compiled with udev_sync but the software does not make use of it. This way we can switch off the rules and fallback to libdevmapper node creation so there's no udev/libdevmapper race.
* Use udev flags support in LVM and provide ↵Peter Rajnoha2009-10-221-0/+9
| | | | dm_tree_add_new_dev_with_udev_flags wrapper for dm_tree_add_new_dev.
* Add udev flags support in libdevmapper and provide 'dmsetup udevflags' ↵Peter Rajnoha2009-10-221-1/+32
| | | | command to decode them.
* Use the same default umask for /dev dirs (DM_DEV_DIR_UMASK).Peter Rajnoha2009-09-251-0/+2
|
* Add 'udevcomplete_all' command for dmsetup. Export DM_COOKIE_MAGIC in ↵Peter Rajnoha2009-08-061-0/+2
| | | | libdevmapper.h.