summaryrefslogtreecommitdiff
path: root/libdm/libdm-common.h
Commit message (Collapse)AuthorAgeFilesLines
* build: Don't generate symlinks in include/ dirJoe Thornber2018-05-141-1/+1
| | | | | | | As we start refactoring the code to break dependencies (see doc/refactoring.txt), I want us to use full paths in the includes (eg, #include "base/data-struct/list.h"). This makes it more obvious when we're breaking abstraction boundaries, eg, including a file in metadata/ from base/
* cleanup: call uname onceZdenek Kabelac2018-04-201-0/+2
| | | | Call uname() once and keep result for mirror use-case.
* lvconvert: limit libdm to maximum of 64 RAID devicesHeinz Mauelshagen2017-02-271-2/+0
| | | | | | | | | | | | | | | | | Commit 64a2fad5d6c6 raised the maximum number of RAID devices to 64. Commit e2354ea344c2 introduced RAID_BITMAP_SIZE as 4 to have 256 bits (4 * 64 bit array members), thus changing the libdm API unnecessarilly for the time being. To not change the API, reduce RAID_BITMAP_SIZE to 1. Remove an unneeded definition of it from libdm-common.h. If we ever decide to raise past 64, we'll version the API. Related: rhbz834579 Related: rhbz1191935 Related: rhbz1191978
* lvconvert: add infrastructure for RaidLV reshaping supportHeinz Mauelshagen2017-02-241-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to support striped raid5/6/10 LV reshaping (change of LV type, stripesize or number of legs), this patch introduces infrastructure prerequisites to be used by raid_manip.c extensions in followup patches. This base is needed for allocation of out-of-place reshape space required by the MD raid personalities to avoid writing over data in-place when reading off the current RAID layout or number of legs and writing out the new layout or to a different number of legs (i.e. restripe) Changes: - add members reshape_len to 'struct lv_segment' to store out-of-place reshape length per component rimage - add member data_copies to struct lv_segment to support more than 2 raid10 data copies - make alloc_lv_segment() aware of both reshape_len and data_copies - adjust all alloc_lv_segment() callers to the new API - add functions to retrieve the current data offset (needed for out-of-place reshaping space allocation) and the devices count from the kernel - make libdm deptree code aware of reshape_len - add LV flags for disk add/remove reshaping - support import/export of the new 'struct lv_segment' members - enhance lv_extend/_lv_reduce to cope with reshape_len - add seg_is_*/segtype_is_* macros related to reshaping - add target version check for reshaping - grow rebuilds/writemostly bitmaps to 246 bit to support kernel maximal - enhance libdm deptree code to support data_offset (out-of-place reshaping) and delta_disk (legs add/remove reshaping) target arguments Related: rhbz834579 Related: rhbz1191935 Related: rhbz1191978
* doc: change fsf addressZdenek Kabelac2016-01-211-1/+1
| | | | | Hmm rpmlint suggest fsf is using a different address these days, so lets keep it up-to-date
* libdm: Move status fns from deptree to targets.Alasdair G Kergon2015-09-281-0/+2
| | | | libdm-deptree is only for functions working with dm tree nodes.
* libdm: introduce and use DEV_UUID macroPeter Rajnoha2012-10-101-0/+1
| | | | | To automatically prefer mangled UUID over unmangled UUID. The same logic that is already used for dm name mangling...
* libdm: refactor internal mangling functionsPeter Rajnoha2012-10-101-5/+6
| | | | | | | (un)mangle_name -> (un)mangle_string check_multiple_mangled_name_allowed -> check_multiple_mangled_string_allowed Just for clarity as the same functions will be reused to (un)mangle dm UUIDs.
* Check for multiple mangled names in auto mangling mode.Peter Rajnoha2012-03-051-0/+2
| | | | | Auto mode can't deal with multiple mangled names. We can do that while working in hex mode, but in auto mode, this would lead to device name ambiguity.
* Add DM_DEFAULT_NAME_MANGLING_MODE env. variable to override configured value.Peter Rajnoha2012-02-151-0/+2
| | | | | Just in case of emergency when name mangling code causes any problems so we can override the default value and switch off the mangling globally.
* Add dm_task_get_name_mangled/unmangled to libdevmapper.Peter Rajnoha2012-02-151-0/+3
| | | | | | | | | dm_task_get_name_mangled will always return mangled form of the name while the dm_task_get_name_unmangled will always return unmangled form of the name irrespective of the global setting (dm_set/get_name_mangling_mode). This is handy in situations where we need to detect whether the name is already mangled or not. Also display functions make use of it.
* Add DEV_NAME macro.Peter Rajnoha2012-02-151-0/+2
| | | | | | | | | Use the DEV_NAME macro to use the mangled form of the name if present, use normal name otherwise (we store both forms - mangled and unmangled in struct dm_task). Mangled form should be always preferred over unmangled with the exception of the situations where we divide one task into several others (like "create and load") - we need to avoid mangling the name twice (because of multiple dm_task_set_name calls)!
* Mangle device name on dm_task_set_name/newname call if necessary.Peter Rajnoha2012-02-151-0/+3
| | | | | | | | | | If dm_task_set_name/newname is called, the name provided will be automatically translated to correct encoded form with the hex enconding so any character not on udev whitelist will be mangled with \xNN format where NN is hex value of the character used. By default, the name mangling mode used is the one set during configure with the '--with-default-name-mangling' option.
* Use sysfs to set/get of read-aheadZdenek Kabelac2012-01-091-4/+5
| | | | | | | | If we know major:minor number of device (which is known after resume) we will try to use sysfs to set/get read ahead parameters of device. This avoid potential problem of blocking commands like 'dmsetup info' awaiting for device being usable for open/close - i.e. overfilled thin pool may block such command.
* Move udev_only logic inside stacked node op code.Alasdair Kergon2011-06-271-3/+3
| | | | | | (We still need to treat add+readhead+del as a no-op.) Rename udev_fallback to verify_udev_operations. Rename --udevfallback to --verifyudev
* Maintain a count of the number of suspended devices in libdevmapperAlasdair Kergon2011-06-131-0/+3
| | | | | | | | | 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.)
* Add new dm_prepare_selinux_context fn to libdevmapper and use it throughout.Peter Rajnoha2010-12-131-0/+1
| | | | | | | | | | | 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.
* Several changes to udev support code:Peter Rajnoha2009-10-261-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | - 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.
* read_ahead node opsAlasdair Kergon2007-11-301-0/+3
|
* Fix inconsistent licence notices: executables are GPLv2; libraries LGPLv2.1.Alasdair Kergon2007-08-211-1/+1
|
* Add DM_LIB_VERSION definition to configure.h.Alasdair Kergon2007-01-191-0/+31
|
* Add function that returns the library version.Alasdair Kergon2002-01-171-16/+0
|
* Various fixes & restructure to extract common code.Alasdair Kergon2001-12-051-0/+16