1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-28 11:55:55 +03:00
Commit Graph

1199 Commits

Author SHA1 Message Date
Dave Wysochanski
1b8de4cb25 Add pv_dev_name() to access PV device name.
Patch by Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
2007-10-12 14:29:32 +00:00
Dave Wysochanski
70d9f98ed3 Accessor functions for PV will not modify the given PV.
So we can add 'const' to it.
Patch by Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
2007-10-12 14:08:10 +00:00
Dave Wysochanski
9ea1d647af Non-functional change - refactor lv_create_empty().
Remove struct format_instance param - we can safely obtain
this from vg->fid inside the function.
2007-10-11 19:20:38 +00:00
Dave Wysochanski
8fd14f09e2 Non-functional change - refactor vg_add_snapshot fid parameter. 2007-10-11 18:51:21 +00:00
Alasdair Kergon
6aca8e9297 Handle new sysfs subsystem/block/devices directory structure. 2007-10-10 11:31:21 +00:00
Jim Meyering
4df0c15074 Fix the fsadm build failure without using -llvm.
* lib/misc/util.c (last_path_component): Move definition to ...
* lib/misc/last-path-component.h (last_path_component): ...here.
New file.  Make the function "static inline".
* include/.symlinks: Add last-path-component.h.
* lib/misc/util.h (last_path_component): Remove declaration.
* tools/fsadm/fsadm.c: Include "last-path-component.h".
* tools/lvmcmdline.c: Likewise.

Author: Jim Meyering <meyering@redhat.com>
2007-10-03 16:10:04 +00:00
Dave Wysochanski
bf4f5b21a4 Some const fixups for previous checkins 2007-09-24 21:30:00 +00:00
Jim Meyering
7f8f8bfa09 Correct typo in comments: s/is part of the LVM2/is part of LVM2/.
Signed-off-by: Jim Meyering <jim@meyering.net>


Author: Jim Meyering <jim@meyering.net>
2007-09-21 10:16:45 +00:00
Dave Wysochanski
dfef7f6942 Add %PVS extents option to lvresize, lvextend, and lvcreate. 2007-09-20 21:39:08 +00:00
Alasdair Kergon
9eea0107ba Fix strdup memory leak in str_list_dup(). 2007-09-17 16:02:46 +00:00
Dave Wysochanski
a0fe21ccb6 Undo previous checkin - output format not good, info already available in other form(s) 2007-09-11 13:49:52 +00:00
Dave Wysochanski
45ea446910 Add pvseg_free field to 'pvs' output 2007-09-10 20:05:29 +00:00
Jim Meyering
b45b846449 Include strerror string in dev_open_flags' stat failure message.
* lib/device/dev-io.c (dev_open_flags):
Use log_sys_error after failed stat to report strerror(errno).
Use a slightly different diagnostic to report mismatched device number.
2007-09-07 11:24:19 +00:00
Dave Wysochanski
c6ea067fed move guts of pvresize into library 2007-08-30 20:30:41 +00:00
Jonathan Earl Brassow
a2cb3d17a7 When mirrors are created with the --nosync option, a status flag
(MIRROR_NOTSYNCED) is added to the LVM metadata.  This flag is
not cleared when converting to linear.  Subsequently, if you
up-convert the linear to a mirror, the flag remains - even though
an up-convert will always force a complete resync.
2007-08-29 20:19:11 +00:00
Dave Wysochanski
f603fe64bd Modify lvremove to prompt for removal if LV active on other cluster nodes.
Add '-f' to vgremove to force removal of VG even if LVs exist.
Update vgremove man page for '-f'.
2007-08-28 16:14:49 +00:00
Patrick Caulfield
5982271096 Locking P_global causes a cache refresh. 2007-08-23 15:43:20 +00:00
Alasdair Kergon
e935d21752 Introduce VG_GLOBAL lock type for vgscan/pvscan to trigger clvmd -R. 2007-08-23 15:02:26 +00:00
Alasdair Kergon
21bc366486 Clean up numerous compiler warnings that crept in recently.
Remove several unused parameters from _allocate().
2007-08-22 14:38:18 +00:00
Alasdair Kergon
edb3374d32 Clean up mirrorlog argument processing.
Only permit --force, --verbose and --debug arguments to be repeated.
2007-08-21 19:46:36 +00:00
Dave Wysochanski
16669b5aa0 Move guts of vgremove into lvm library.
Include archiver.h in metadata.c as a result of prior move.
2007-08-21 17:38:20 +00:00
Dave Wysochanski
3d33abbb8c Prepare to move guts of vgremove into lvm library.
Fixup force_t.
2007-08-21 16:40:33 +00:00
Alasdair Kergon
be6845999b Fix inconsistent licence notices: executables are GPLv2; libraries LGPLv2.1. 2007-08-20 20:55:30 +00:00
Dave Wysochanski
cc78b9800d Move lv_remove_single() into library (lv_manip.c, metadata-exported.h).
Move yes_no_prompt() into library (display.c, display.h).
Fixup includes as a result of movement of prior two functions.
Fixup force_t enum to be more descriptive.
2007-08-20 17:04:53 +00:00
Dave Wysochanski
9eb05d9761 Prepare to move guts of lvremove into lvm library 2007-08-20 16:16:54 +00:00
Alasdair Kergon
7a197a6220 Update to use autoconf 2.61, while still supporting 2.57. 2007-08-14 19:11:31 +00:00
Dave Wysochanski
be51e010b4 Remove extra checks for sub LV renaming.
Patch by Jun'ichi Nomura <j-nomura@ce.jp.nec.com>.
2007-08-08 18:00:36 +00:00
Dave Wysochanski
2835f025b6 A few more cleanups for lvrename of mirrors checkin:
* add struct lv_names for old/new names
* replace lv->status & MIRROR checks with lv_is_visible()
2007-08-07 18:55:38 +00:00
Dave Wysochanski
4f4d5fdc67 Some simple fixups for last checkin:
* remove "_" from "return_0"
* improve some naming and terminology
* add 'const'
2007-08-07 16:57:09 +00:00
Jim Meyering
08c9ff434b Add "const" attributes where possible: first cut. 2007-08-07 09:06:05 +00:00
Dave Wysochanski
41a94b5400 Update a few comments 2007-08-06 21:11:27 +00:00
Dave Wysochanski
f58224119c Add support for renaming mirrored LVs.
Patch by Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
2007-08-06 20:35:48 +00:00
Jim Meyering
e5e120a502 For consistency, rename local variable: s/newname/new_name/g. 2007-08-06 14:57:48 +00:00
Jim Meyering
b7449ebc37 Make lv_rename's interface "const correct".
* lib/metadata/lv_manip.c (lv_rename): Make char* param "const".
* lib/metadata/metadata-exported.h: Update prototype, too.
2007-08-06 09:04:21 +00:00
Dave Wysochanski
b7cd307f9b Factor out core of lvrename to lv_rename library function.
Patch by Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
2007-08-03 21:22:10 +00:00
Jonathan Earl Brassow
5efd97f108 lib/activate/activate.c:_lv_activate tries to monitor a device
regardless of whether it was successfully activated.  Now fixed
to only monitor if it was successfully activated.
2007-08-01 20:29:07 +00:00
Jim Meyering
b58a94fed4 Don't leak a file descriptor in fcntl_lock_file(), when fcntl fails. 2007-07-28 15:20:36 +00:00
Jim Meyering
941e4f5567 Remove create_dir function; use now-equivalent dm_create_dir instead.
* lib/misc/lvm-file.c (_create_dir_recursive, create_dir): Remove functions.
* lib/misc/lvm-file.h (create_dir): Remove declaration.
* lib/commands/toolcontext.c (create_toolcontext): s/create_dir/dm_create_dir/
* lib/format_text/archiver.c (archive, backup): Likewise.
* lib/format_text/format-text.c (_add_dir): Likewise.
* lib/locking/file_locking.c (init_file_locking): Likewise.
Patch by Jun'ichi Nomura.
2007-07-28 12:26:21 +00:00
Alasdair Kergon
3579b652e7 Add ps3disk devices. 2007-07-26 13:28:32 +00:00
Jim Meyering
1a5d6bd23d Detect stream write failure reliably; new fn: lvm_fclose; use dm_fclose
* lib/misc/lvm-file.c (lvm_fclose): New function.
* lib/misc/lvm-file.h (lvm_fclose): Declare it.
* lib/config/config.c (write_config_file): Use the new function to detect
and diagnose unlikely write failure.
* lib/filters/filter-persistent.c (persistent_filter_dump): Likewise.
* lib/format_text/archive.c (archive_vg): Likewise.
* lib/format_text/format-text.c (_vg_write_file): Likewise.
* lib/log/log.c (fin_log): Similar, but use dm_fclose directly.
Include "\n" at end of each fprintf format string.
2007-07-24 17:48:08 +00:00
Dave Wysochanski
4f629c3bba Add CORRECT_INCONSISTENT and FAIL_INCONSISTENT flags to vg_lock_and_read 2007-07-23 21:03:42 +00:00
Dave Wysochanski
891c3d298b Add vg_lock_and_read() external library function. 2007-07-23 17:27:55 +00:00
Milan Broz
8a0de6c333 Fix loading of persistent cache if cache_dir is used. (2.02.23)
Move lstat warning in _compare_paths to verbose output only.
2007-07-23 10:45:49 +00:00
Milan Broz
622703467c Fix compilation warning in util.c. 2007-07-23 10:41:19 +00:00
Jim Meyering
6c35e3c84c Eliminate uses of strdup+basename. Use last_path_component instead.
* lib/misc/util.c, lib/misc/util.h (last_path_component): New files.
* lib/Makefile.in (SOURCES): Add misc/util.c.
* lib/misc/lib.h: Include "util.h".
* tools/fsadm/fsadm.c: Include "util.h". (_usage): Use last_path_component,
not basename.
* tools/lvmcmdline.c (_find_command, lvm2_main): Likewise.
* include/.symlinks: Add lib/misc/util.h.
2007-07-20 15:48:39 +00:00
Jim Meyering
bbcd24607c Use gcc's printf attribute wherever possible.
* daemons/clvmd/clvmd.h (debuglog): Add __attribute__((printf)).
* lib/config/config.c (_line_append): Likewise.
* lib/misc/lvm-string.h (emit_to_buffer): Likewise.
2007-07-20 15:38:19 +00:00
Jim Meyering
e732de541e In _line_append, use "sizeof buf - 1" rather than equivalent "4095"
* lib/config/config.c:
2007-07-20 15:26:39 +00:00
Jim Meyering
c93e6b5f79 Introduce is_same_inode macro, now including a comparison of st_dev.
* lib/misc/lvm-file.h (is_same_inode): Define.
* lib/filters/filter-persistent.c (persistent_filter_dump): Use is_same_inode
in place of a direct st_ino-only comparison.
* lib/locking/file_locking.c (_release_lock, _lock_file): Likewise.
2007-07-20 15:22:46 +00:00
Jim Meyering
57015b12e2 Don't leak a file descriptor in _lock_file when flock fails.
* lib/locking/file_locking.c (_lock_file): Close fd upon flock failure.
2007-07-20 12:12:52 +00:00
Patrick Caulfield
35b13fdb5e Add SUN's LDOM virtual block device to filters
Thanks to Fabio Massimo Di Nitto
2007-07-19 07:06:47 +00:00
Alasdair Kergon
03eee0e2ed Split metadata-external.h out from metadata.h for the tools to use. 2007-07-18 15:38:58 +00:00
Dave Wysochanski
33e5601937 Change pv_read_path to pv_by_path 2007-07-12 15:38:53 +00:00
Dave Wysochanski
0c795e2e18 Turn _add_pv_to_vg() into external library function add_pv_to_vg() 2007-07-12 05:04:42 +00:00
Dave Wysochanski
30303765a3 Refactor vg_extend error path. 2007-07-12 04:12:04 +00:00
Dave Wysochanski
c254039677 Add pv_read_path, a proposed external LVM library function to take a device path and return a PV handle 2007-07-11 23:33:12 +00:00
Alasdair Kergon
3c21da1797 Cope with find_seg_by_le() failure in check_lv_segments(). 2007-07-10 18:50:03 +00:00
Alasdair Kergon
eac952f3fe tidy 2007-07-10 18:20:00 +00:00
Alasdair Kergon
19fa139341 Fix pv_mda_count to cope with missing PV.
[vgcreate vg1 pv1 pv2; pvremove -ff pv1; pvs -P -o+pv_mda_count =>segfault]
2007-07-10 18:18:33 +00:00
Alasdair Kergon
d27e123310 Add vg_mda_count and pv_mda_count columns to reports. 2007-07-09 15:40:43 +00:00
Alasdair Kergon
68c87619bd Fix dumpconfig to use log_print instead of stdout directly. 2007-07-08 22:51:20 +00:00
Dave Wysochanski
ea8a12dbc1 Convert _add_pv_to_vg to usable LVM library function. 2007-07-02 21:48:30 +00:00
Dave Wysochanski
13835b5f6c Don't use index and rindex functions marked by SUSv3 as legacy - Jakub Bogusz <qboosh@pld-linux.org> 2007-07-02 11:17:21 +00:00
Petr Rockai
e7ddf4168d Make warnings go to stderr. Change log_warn to that effect, log_print
continues to send messages to stdout.
2007-06-28 17:33:44 +00:00
Dave Wysochanski
d6b1de30fe Convert vg->status checks to use vg_check_status function.\nRename status_flags to status in vg_check_status. 2007-06-19 04:36:12 +00:00
Dave Wysochanski
69483a8aaf Add vg_status function and clean up vg->status in tools directory 2007-06-19 04:23:32 +00:00
Dave Wysochanski
1f54709ee6 Make vg_extend() format_instance * parameter internal to vg_extend() 2007-06-19 00:33:43 +00:00
Dave Wysochanski
ff77bb1ab6 Remove get_ prefix from get_pv_* functions 2007-06-15 22:16:55 +00:00
Alasdair Kergon
817afaad5e pre-release 2007-06-15 20:46:04 +00:00
Petr Rockai
7379c67839 Allow keyboard interrupts in yes_no_prompt(). Add code to toollib.c
loops and to pvcreate.c, lvchange.c and lvresize.c to handle
interrupted prompts.
2007-06-15 10:11:14 +00:00
Dave Wysochanski
3df2c388b1 convert pv->vg_name[0] to \!is_orphan(pv) 2007-06-14 15:48:05 +00:00
Dave Wysochanski
fb6ca78e05 Remove casts in pv_create and find_pv_in_vg_by_uuid 2007-06-13 21:14:07 +00:00
Dave Wysochanski
dd04871295 Convert pv_handle_t to pv_t * and tidy up whitespace 2007-06-13 20:55:56 +00:00
Dave Wysochanski
f1f4c1ea50 Add typedef pv_handle_t 2007-06-13 19:52:48 +00:00
Dave Wysochanski
7da624db7b Fix a couple benign warnings by adding variable initializations. 2007-06-13 15:11:19 +00:00
Dave Wysochanski
b496210d9a Convert find_pv_in_vg_by_uuid and pv_create to use PV handles 2007-06-12 22:41:27 +00:00
Dave Wysochanski
fc2063b660 Change PV_HANDLE_DEREF to pv_field and add paren's 2007-06-12 21:39:49 +00:00
Dave Wysochanski
0e2f6120ee Add get_pv_* functions to return PV fields in prep for external LVM library 2007-06-12 21:20:20 +00:00
Dave Wysochanski
4e5f3e7331 Add wrappers to functions related to pv commands in preparation for exported LVM lib 2007-06-11 18:29:30 +00:00
Bryn M. Reeves
944cac939c Allow vgcfgrestore to list metadata backup files using -f 2007-06-08 22:38:48 +00:00
Dave Wysochanski
c221b0bc21 Add vg_check_status to consolidate vg status flags checks and error messages. 2007-06-06 19:40:28 +00:00
Dave Wysochanski
13209bad59 Fix pvdisplay --maps to not display segment header for orphan PVs. 2007-05-31 20:26:11 +00:00
Dave Wysochanski
3008bc4432 Fix redundant segment display when PV is given to 'pvdisplay --maps' cmdline. 2007-05-31 20:10:25 +00:00
Dave Wysochanski
dda1e6c983 Remove 'Type' from pvdisplay --maps as there is no 'Type' of a physical segment, only logical segments 2007-05-31 15:18:44 +00:00
Dave Wysochanski
5a4ba89aad Small fixes to pvdisplay --maps: 1) rename struct pv_segment vars from 'seg' to 'pvseg', 2) Change heading 2007-05-31 14:19:57 +00:00
Dave Wysochanski
4baa42be1c Add --maps to pvdisplay.
Modified original patch from David Robinson <zxvdr.au@gmail.com>.
2007-05-30 20:43:09 +00:00
Milan Broz
5efa3f1edf Remove symlinks if parent volume is deactivated. 2007-05-15 14:42:01 +00:00
Milan Broz
76b74ab11f Fix a segfault if a device has no target (no table) 2007-05-14 11:27:34 +00:00
Alasdair Kergon
19eb95f72f Fix get_config_uint64() to read a 64-bit value not a 32-bit one. 2007-04-27 20:41:50 +00:00
Alasdair Kergon
7c03887b7a Add -Wformat-security and change one fprintf() to fputs(). 2007-04-27 19:26:57 +00:00
Alasdair Kergon
e6edd1d7af Move regex functions into libdevmapper. 2007-04-27 18:52:05 +00:00
Alasdair Kergon
1bf5aae913 Change some #include lines to search only standard system directories. 2007-04-27 17:46:16 +00:00
Alasdair Kergon
30b95041de add preferred_names to man page. 2007-04-26 17:14:57 +00:00
Alasdair Kergon
4f2f566b06 Add devices/preferred_names config regex list for displayed device names.
Free a temporary dir string in fcntl_lock_file() after use.
Fix a dm_pool_destroy() in matcher_create().
Introduce goto_bad macro.
2007-04-26 16:44:59 +00:00
Dave Wysochanski
867c3249cb Fix warnings on x86_64 involving ptrdiff_t:
config/config.c:493: warning: format '%d' expects type 'int', but argument 5 has type 'long int'

Modified original patch from Jim Meyering <jim@meyering.net>
2007-04-26 16:40:46 +00:00
Dave Wysochanski
28d1c4d7e2 Update pvck to include text metadata area and record detection.
--
2007-04-25 21:10:55 +00:00
Dave Wysochanski
084a8bdcbc Add support functions for analysis of config sections,
and hence, on-disk LVM2 metadata.

--
2007-04-25 20:38:39 +00:00
Dave Wysochanski
d915579c6b Update pvck to read labels on disk, with flexible --labelsector
parameter.

--
2007-04-25 20:03:16 +00:00
Dave Wysochanski
15309c57bd Add count_chars and count_chars_len functions, two
generic string utility functions.

--
2007-04-25 18:24:19 +00:00
Dave Wysochanski
17a6fc0b45 Add 'scan_sector' parameter to label_read and _find_labeller to add
flexibility in searching for disk labels.
2007-04-23 18:21:01 +00:00
Dave Wysochanski
662e0238f0 Add dev_read_circular, read 2 regions on same device. 2007-04-19 02:10:42 +00:00