summaryrefslogtreecommitdiffstats
path: root/libdm
Commit message (Collapse)AuthorAgeFilesLines
* config: require dm_config_create_value for dm_config_node's valuePeter Rajnoha2012-08-271-7/+2
| | | | | | | | | | | | | | | | | If we were defining a section (which is a node without a value) and the value was created automatically on dm_config_create_node call, we were wasting resources as the next step after creating the config node itself was assigning NULL for the node's value. The dm_config_node_create + dm_config_create_value sequence should be used instead for settings and dm_config_node_create alone for sections. The majority of the code already used the correct sequence. Though with dm_config_node_create fn creating the value as well, the pool memory was being trashed this way. This patch removes the node value initialization on dm_config_create_node fn call and keeps it for the direct dm_config_create_value fn call.
* RAID: Add support for RAID10Jonathan Brassow2012-08-241-0/+4
| | | | | | This patch adds support for RAID10. It is not the default at this stage. The user needs to specify '--type raid10' if they would like RAID10 instead of stacked mirror over stripe.
* cleanup: add __attribute__ ((nonnull(1)))Zdenek Kabelac2012-08-231-0/+1
|
* check: add internal errors for unexpected pathsZdenek Kabelac2012-08-231-0/+5
| | | | | | | | | | | | | | | | | | | | Adding couple INTERNAL_ERROR reports for unwanted parameters: Ensure the 'top' metadata node cannot be NULL for lvmetad. Make obvious vginfo2 cannot be NULL. Report internal error if handler and vg is undefined. Check for handle in poll_vg(). Ensure seg is not NULL in dev_manager_transient(). Report missing read_ahead for _lv_read_ahead_single(). Check for report handler in dm_report_object(). Check missing VG in _vgreduce_single().
* cleanup: keep MKNOD type cast cleanZdenek Kabelac2012-08-233-6/+6
| | | | Setup major already a dev_t type before it gets shifted.
* cleanup: drop unneeded included header filesZdenek Kabelac2012-08-231-1/+0
| | | | | This headers were not resolving anything used for compiled .c files. Remove unused util.c file.
* thin: use discards as plural rather than singularAlasdair G Kergon2012-08-071-2/+2
| | | | Global change from --discard to --discards, as that feels more natural.
* whitespaceAlasdair G Kergon2012-08-071-1/+0
|
* comments: misc updatesAlasdair G Kergon2012-08-072-7/+7
| | | | Miscellaneous clarifications to comments.
* Remove redundant (potentially harmful) semicolonMarian Csontos2012-08-021-1/+1
|
* libdm-string: Add dm_vasprintf.Petr Rockai2012-07-312-2/+13
|
* dmsetup: allow --noflush with status/wait for thinAlasdair G Kergon2012-07-271-5/+7
| | | | | Allow --noflush with dmsetup status and wait (for thin target 1.3.0 / ioctl 4.23.0).
* config: fix one-node dumpconfig, add dm_config_write_one_nodePeter Rajnoha2012-07-202-2/+16
| | | | | | | | | | | | | | | | | | A regression introduced in 2.02.89 (11e520256b3005ed813ce83f8770aaab74edef3f) caused the lvm dumpconfig <node> to print out the node as well as its subsequent siblings. The information about "only_one" mode got lost. Before this patch (just an example node): # lvm dumpconfig global/use_lvmetad use_lvmetad=1 thin_check_executable="/usr/sbin/thin_check" thin_check_options="-q" (...all nodes to the end of the section) With this patch applied: # lvm dumpconfig global/use_lvmetad use_lvmetad=1
* libdm: support reserve and release metadata snap msgZdenek Kabelac2012-07-182-0/+8
| | | | Add support for new message types for thinp target 1.1
* libdm: add support for external origin and discardZdenek Kabelac2012-07-182-21/+133
|
* cleanup: use dev_t typeZdenek Kabelac2012-06-221-2/+2
|
* cleanup: replace memset with struct initilizationZdenek Kabelac2012-06-221-3/+1
| | | | | Simplifies the code, properly detects too long socket paths, drops unused parameter.
* headers: add some __attribute__ instrumentationZdenek Kabelac2012-06-201-13/+26
| | | | | Use some malloc and strdup instrumentation and warning attributes and standard systems headers.
* Remove unsupported udev_get_dev_path libudev call used for checking udev dir.Peter Rajnoha2012-05-291-0/+3
| | | | | | | | | | | | With latest changes in the udev, some deprecated functions were removed from libudev amongst which there was the "udev_get_dev_path" function we used to compare a device directory used in udev and directore set in libdevmapper. The "/dev" is hardcoded in udev now (udev version >= 183). Amongst other changes and from packager's point of view, it's also important to note that the libudev development library ("libudev-devel") could now be a part of the systemd development library ("systemd-devel") because of the udev + systemd merge.
* Set delay_resume_if_new on deptree snapshot origin.Alasdair Kergon2012-05-151-2/+10
| | | | (Must avoid activating snapshot origin more than once concurrently.)
* add major:minor to table size changed debug messageAlasdair Kergon2012-05-151-2/+3
|
* indicate when deptree detects but ignores size change in debug msgAlasdair Kergon2012-05-151-3/+5
|
* Log value chosen in _find_config_bool like other variable types do.Alasdair Kergon2012-05-081-11/+18
|
* Adjust wordingAlasdair Kergon2012-03-061-1/+1
|
* Use already acquired variable...Peter Rajnoha2012-03-051-2/+1
|
* Check for multiple mangled names in auto mangling mode.Peter Rajnoha2012-03-053-0/+22
| | | | | 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.
* Fix dm_task_get_name_unmangled to not unmangle already unmangled name.Peter Rajnoha2012-03-051-2/+7
| | | | | In 'auto' and 'hex' mode, these names are already unmangled on ioctl return. There's no point on trying to do that once again (actually it's a bug!).
* Check whether device names are properly mangled on ioctl return.Peter Rajnoha2012-03-052-10/+28
| | | | | | | Be more strict when unmangling names on ioctl return - require the name to be properly mangled in 'auto' and 'hex' mode. There really should not be any blacklisted character since the names should be renamed already (by means of renaming it directly or running 'dmsetup mangle' for automatic rename).
* Clean up internal mangling interface.Peter Rajnoha2012-03-052-17/+17
|
* Return success for deactivation of thin poolZdenek Kabelac2012-03-041-1/+4
| | | | | | | if the thin_check fail on thin pool - still return successful deactivation, since lvremove would currently fail. TODO: find some way to not run check with lvremove.
* Remove part of FIXMEZdenek Kabelac2012-03-041-9/+5
| | | | (and reindent a code below)
* Support 16GB for thin pool metadataZdenek Kabelac2012-03-021-1/+21
| | | | | | | | | Add some hack math to allow 16GB devices to be passed as thinpool metadata. Since kernel has put in limit to not allow which are just bigger then some predefined constant in kernel but not matching 16GB so any device bigger is rejected. FIXME: Current code still might need more tweaks to be more generic.
* Purge remaining trim bits from codeZdenek Kabelac2012-03-021-4/+0
|
* Added dm_tree_node_set_callback() for preload and deactivation hooksZdenek Kabelac2012-03-022-1/+40
| | | | | Run users hook after preload for the node is finished, or after the node has been deactivated.
* Remove support for TRIM messageZdenek Kabelac2012-03-022-12/+0
| | | | | | It's been unsupporte for now - and it's not going to be implemented for thin pool kernel driver - so dropping appearence of TRIM from libdm and lvm.
* Use 64 bit integers whenever extracting numbers from daemon replies.Petr Rockai2012-03-012-0/+6
|
* Missed ;Zdenek Kabelac2012-03-011-1/+1
|
* Add cast for ptrdiff_t - cleanup gcc warningZdenek Kabelac2012-03-011-1/+1
|
* Check for version string bufferZdenek Kabelac2012-03-011-3/+11
| | | | | | Since lvm seems to call driver_version(NULL, 0) this would lead to crash. Though the combination of the code is probably very hard to hit. If the user doesn't supply version buffer, just skip printing to buffer.
* Fix empty string warning logic in _find_config_str. (1.02.68)Alasdair Kergon2012-02-281-8/+10
| | | | | | | | pvcreate gives WARNING: Ignoring unsupported value for metadata/pvmetadataignore. It was warning if there is no config file entry instead of only if the node exists but is empty.
* Using enum types for enumsZdenek Kabelac2012-02-281-1/+1
| | | | alloc_policy_t, dm_string_mangling_t, percent_range_t, sign_t
* Fix dm_task_set_name to properly resolve path to dm name.Peter Rajnoha2012-02-281-1/+1
| | | | Wrong variable was checked in _dm_task_set_name_from_path.
* Introduce dm_strncpyZdenek Kabelac2012-02-232-0/+19
| | | | | | | Should be faster then strncpy - since we could avoid clearing 4KB pages with each strncpy(...,PATH_MAX). Also it's easy to check whether string fit - and eventually avoid to continue working we incomplete string.
* Missed dm_free in last commitZdenek Kabelac2012-02-231-0/+1
|
* Limit number of mem allocs and copiesZdenek Kabelac2012-02-231-14/+18
| | | | | | | | If we have good enough glibc to return number of needed chars, do not loop try to reach good size, but use this size directly for allocation, saving also last strdup. Since now we start with 16 bytes - skip buffer realloc for shorter string.
* Add DM_DEFAULT_NAME_MANGLING_MODE env. variable to override configured value.Peter Rajnoha2012-02-153-1/+27
| | | | | 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.
* Replace any '\' char with '\\' in table specification on input.Peter Rajnoha2012-02-151-3/+22
| | | | | | | | | | | | | | | Device-mapper in kernel uses '\' as escape character so it's better to double it to avoid any confusion when using existing device names with '\' in the table specification. For example: dmsetup create x --table "0 8 linear /dev/mapper/a\x20b 0" should pass just fine now without a need to explicitly escape the '\' char like this: dmsetup create x --table "0 8 linear /dev/mapper/a\\x20b 0"
* Unamngle dm device name list automatically on ioctl return.Peter Rajnoha2012-02-152-2/+46
| | | | | | | | | | | | | | | | | | | | | | | | | If dm_task_get_name or dm_task_get_names gets called, these will return unmangled form of the names so the name mangling stays totally transparent to any libdevmapper user (unless DM_STRING_MANGLING_NONE is used in which case the name is not touched and it is is returned as it is in kernel). For example: dmsetup create "a b" - will create a\x20b device in kernel and so udev will create /dev/mapper/a\x20b dm_task_get_name/names will still return "a b" In AUTO mode, the libdevmapper user can still query the device by using the mangled ("a\x20b") or unmangled form of the name when calling dm_task_set_name. If mangled name is provided, it's detected and the name is kept as it is. If unmangled name is provided, it will be mangled. IOW in AUTO mode it's totally transparent and it should not require any changes in the code using libdevmapper. However, any libdevmapper user must be aware of the fact that the mangled form of the name appears in /dev/mapper (udev just can't deal with those blacklisted characters).
* Add dm_task_get_name_mangled/unmangled to libdevmapper.Peter Rajnoha2012-02-153-0/+100
| | | | | | | | | 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-152-20/+21
| | | | | | | | | 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)!