1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
Commit Graph

19384 Commits

Author SHA1 Message Date
Zdenek Kabelac
85e0636623 cleanup: some more MAJOR MINOR unsigned
Finish remaing missing cases where MAJOR/MINOR was casted to (int)
while we can now use it directly as 'unsigned'.
2024-06-03 15:30:05 +02:00
Zdenek Kabelac
91502446ac lvremove: reuse existing dm_build_dm_uuid
Use existing dm_build_dm_uuid() to generate LV's DM UUID.
2024-06-03 15:30:05 +02:00
David Teigland
a8b8e1f074 vgimportdevices: skip global lockd locking
Fix commit b65a2c3f3a "vgimportdevices: skip lvmlockd locking"
which intended to disable lvmlockd locking, but the lockd_gl_disable
flag was mistakenly set after lock_global() so it wasn't effective.
This caused vgimportdevices to fail unless locking was started.
2024-05-30 14:53:46 -05:00
David Teigland
ace25d5eeb README: remove old branch names 2024-05-29 09:30:41 -05:00
Zdenek Kabelac
9ee6a9b982 make: generate 2024-05-28 14:55:53 +02:00
Zdenek Kabelac
c14e0282ec tests: accept new vdoformat output
There is slight change in the printed size number.
2024-05-28 14:55:53 +02:00
Zdenek Kabelac
2c8ff67470 args: generate configurable path 2024-05-28 14:55:53 +02:00
Zdenek Kabelac
f10de12ade tests: quoted DM_DEV_DIR 2024-05-27 21:34:25 +02:00
Zdenek Kabelac
7e59c3aa58 tests: use single aux lvmconf
Reduce log size as lvmconf can process multiple settings at once.
2024-05-27 21:34:25 +02:00
Zdenek Kabelac
9207bae33b device_id: use faster dm_strncpy 2024-05-27 21:34:25 +02:00
Zdenek Kabelac
fbdd26a4a3 device_mapper: solve no devices path
Malloc needs to use sane value when names would be NULL.
Also for devices without 'uuid' return empty string instead of NULL.
2024-05-27 21:33:59 +02:00
Zdenek Kabelac
533a87d0ea lvremove: initilize struct list 2024-05-27 18:23:26 +02:00
Zdenek Kabelac
80fa3511be lvremove: check for handle
Get lvremove_params from non NULL handle.
Introduced in commit 47f8bda05.
TODO: any more thing needed ?
2024-05-27 17:03:37 +02:00
Zdenek Kabelac
c496cfa99a WHATS_NEW: update 2024-05-27 16:35:23 +02:00
Zdenek Kabelac
d825e8887c make: generate 2024-05-27 16:35:23 +02:00
Zdenek Kabelac
9dfe5ce2bc cov: replace enum report_type_t with unsigned
Another enum used as bitfield mask.
2024-05-27 16:35:23 +02:00
Zdenek Kabelac
90c6c421cd cov: convert some more enternal field masks
Some more 'internal' masks misusing enums for bitfields.
2024-05-27 16:35:23 +02:00
Zdenek Kabelac
3b649c3076 cov: cleanup mask from enum to unsigned
Enums are single 'values' so not a proper type for bitfields.
(Probably better to use such values as defines).

Although here 'daemon_talk()' is part of library API, it's hidden
non-public API call - and moreover 'enum' and 'unsigned' are
using the same size, so linker shouldn't have any issue with
this symbol usage.

For this reason there are no 'versioning' tricks applied.
2024-05-27 16:35:23 +02:00
Zdenek Kabelac
403ecb46fa cov: annotate known use of validated lv name 2024-05-27 16:35:23 +02:00
Zdenek Kabelac
1b90865843 cleanup: remove blank spaces 2024-05-27 16:35:23 +02:00
Zdenek Kabelac
88e0060aa8 cleanup: refactor common code
Refactor shared code from _get_rootvg_dev() between vgchange
and vgimportdevices to get_rootvg_dev_uuid() in toollib.c
2024-05-27 16:35:00 +02:00
Zdenek Kabelac
2e6e752c3a tests: add some lvm shell testing
Check lvm shell for autocomplete functionality and error reporting.
2024-05-27 15:35:58 +02:00
Zdenek Kabelac
cd56b04ef6 cleanup: print MAJOR and MINOR as unsigned
Print directly as %u instead of %d with (int) casting.
2024-05-27 15:35:58 +02:00
Zdenek Kabelac
cdcd482fa4 libdm: use 'unsigned' for major minor
Although linux uses 'dev_t' as 'unsigned long int' on 64bit,
it's easier to print with just '%u' instead of '%lu'.
2024-05-27 15:35:58 +02:00
Zdenek Kabelac
e1fd179dc5 cleanup: replace strlen with sizeof
Use the string size from compile time.
2024-05-27 15:35:58 +02:00
Zdenek Kabelac
eaa4882924 cleanup: use const for sizeof values 2024-05-27 15:35:58 +02:00
Zdenek Kabelac
ddf3b6e5e3 cleanup: simplier loop condition
Check char for != 0.
2024-05-27 15:35:58 +02:00
Zdenek Kabelac
9ab2607c7f cleanup: use correct log_sys_debug 2024-05-27 15:35:58 +02:00
Zdenek Kabelac
40cf4ce1e1 cleanup: struct reorder
Better alignments.
2024-05-27 15:35:58 +02:00
Zdenek Kabelac
45c06025da cleanup: some typos
Collection of some typos or invalid uppercase or doublespace cases.
2024-05-27 15:35:57 +02:00
Zdenek Kabelac
bbe1b93ed9 hash: increase some default hash table size
Size of these hashes was quite small, so raise the size of
hashed entries to reduce amount of hash collistion.
Select some unique/unused number for hash_create below 8192.
2024-05-27 15:35:57 +02:00
Zdenek Kabelac
93115ef91d libdm: drop allocation
Use structure allocated on local stack.
2024-05-27 15:35:57 +02:00
Zdenek Kabelac
fdfe80f024 mirror: drop unneeded call
Major,minor,patchlevel are already set from previous call.
2024-05-27 15:35:57 +02:00
Zdenek Kabelac
01e014a246 device: use device_get_uuid
Replace call to get_dm_uuid_from_sysfs() with use of
device_get_uuid() which gets the same information,
but instead of several syscalls it need either 1 or even 0
when the information is cached with newer kernels.
2024-05-27 15:35:57 +02:00
Zdenek Kabelac
b63e54d0ed dev_manager: remove disable_dm_dev flag
Lvm currenly drops cache before first table manipulation
there is no need for this flag ATM.
2024-05-27 15:35:57 +02:00
Zdenek Kabelac
e211768d1c dev_manager: drop cache for dm tree manipulation
We've got cached DM list before grabbing lock, so there
is some chance, that DM table has changed and we would
need to refresh this info.

TODO: benchmark, whether it would even make sense to refresh cache
and keep it content instead of using individual ioctl() for tree build.
2024-05-27 15:35:57 +02:00
Zdenek Kabelac
d192477ae6 label: cache dm dev list earlier
Cache (when possibly with newer kernel) earlier within label
scanning loop, so the cache information can be also used by
hints file.
2024-05-27 15:35:57 +02:00
Zdenek Kabelac
dac2bfe6a4 device_manager: add device_get_uuid
Function that is working with DM target is located within
lib/activate directory.

This function is able to use cached  dm_device_list when possible
to quickly resolve checks for device's UUID.

Function can fully replace get_dm_uuid_from_sysfs() and instead
of syscalls for open/read/close get the UUID with single ioctl.

When there is cached dm devs list, we can get many UUID from
a single syscall.
2024-05-27 15:35:56 +02:00
Zdenek Kabelac
5da282fa23 device: propagate struct cmd_context
For better use of cached data located within cmd_context,
pass this structure from the top level function.
Also add missing '_' for static _dev_cache_index_devs.
No other change here.
2024-05-27 15:35:17 +02:00
Zdenek Kabelac
1712845ab5 device_mapper: use const for this API
Allow using constified version of devs_list.
Internal loop does not need to modify anythin in this stucture.
2024-05-27 15:35:17 +02:00
Zdenek Kabelac
36691b9844 device_mapper: add dm_device_list_find_by_dev
Introduce function to find device's name and uuid for
a given major:minor.

This information is cached with dm_device_list which reads all the
info from single ioctl(DM_DEVICE_LIST).
Lvm keeps major:minor name & uuid for active devices in the system.
2024-05-27 15:34:16 +02:00
Zdenek Kabelac
5c24d6d4db dev-type: use if..else if...
Compare strings till the first match.
2024-05-27 15:16:26 +02:00
Zdenek Kabelac
aad1add77f command: reorder vals order
Keep most frequently used val names in front.
2024-05-27 15:16:26 +02:00
Zdenek Kabelac
314c759a09 command: store val_name with its size
Compile length of val_name during compilation.
2024-05-27 15:16:26 +02:00
Zdenek Kabelac
a198224666 dev-cache: skip scanning known blockless dirs
Skip scan and stat() for dirs and nodes within known /dev/ paths,
where no block devices are located.

Also strlen(_cache.dev_dir) just once.

TODO: add more dirs to _no_scan (configurable via lvm.conf ?)
2024-05-27 15:16:26 +02:00
Zdenek Kabelac
d8e639ecba dev-cache: collapsing slashes counts string size
_collapse_slashes() already goes through the whole string,
so just return now already known string length.
2024-05-27 15:16:26 +02:00
Zdenek Kabelac
caa0e08738 cleanup: use single array for idtype string
Share string array for de/coding idtype.
2024-05-27 15:16:26 +02:00
Zdenek Kabelac
2e0ac97903 error: try with modprobe
If the error target would be built as module,
ask modprobe to load it if the target is not present.
2024-05-27 15:16:26 +02:00
Zdenek Kabelac
9a371639fc cleanup: relocate section
Move _features[] structure from .data.rel.ro to .rodata.
2024-05-27 15:16:26 +02:00
Zdenek Kabelac
83c0b19f61 cleanup: use ALTERNATIVE_EXTENTS
Instead of comparing string of command names,
introduce ALTERNATIVE_EXTENTS command flags.
2024-05-27 15:16:25 +02:00