summaryrefslogtreecommitdiffstats
path: root/lib/metadata/metadata.h
Commit message (Collapse)AuthorAgeFilesLines
* Pass 'single_device' parameter down to suppress 'Can't find uuid' messagesAlasdair Kergon2012-02-291-1/+2
| | | | | | when reading VG text metadate and called from pvscan --lvmetad. (Longer-term, that check needs moving outside of that code.)
* The lvmetad client-side integration. Only active when use_lvmetad = 1 is set inPetr Rockai2012-02-231-0/+4
| | | | lvm.conf *and* lvmetad is running.
* Thin add pool_below_thresholdZdenek Kabelac2012-02-081-0/+1
| | | | Test both data and metadata percent usage.
* Thin fix transaction_id incrementation and code refactoringZdenek Kabelac2012-01-251-4/+6
| | | | | | | | | | Add pool_has_message and use it in attach_pool_message. Also update header to make more obvious which segment type is expected as parameter. Rename 'read_only' to 'no_update' (no auto update transaction_id) to better fit how it's used. Fix problem when there was only one stacked message replaced with delete message that caused unwanted transaction_id increase.
* Thin supports snapshotsZdenek Kabelac2011-11-071-1/+2
| | | | | | | Full support for thin snapshots. Create and remove is supported. TODO: lvconvert support is not yes available.
* Make detach_pool_message visible for toolsZdenek Kabelac2011-10-301-1/+0
| | | | Move there also vg_write and vg_commit.
* Thin support for stripeZdenek Kabelac2011-10-281-1/+1
| | | | | | Support stripe options to create thin data pool LV. TODO: combine chunk size and stripe size.
* Recoded way to insert thin pool into vgZdenek Kabelac2011-10-221-0/+3
| | | | | | | | | | | | Code in _lv_insert_empty_sublvs was not able to provide proper initialization order for thin pool LV. New function extend_pool() first adds metadata segment to pool LV which is still visible. Such LV is activate and cleared. Then new meta LV is created and metadata segments are moved there. Now the preallocated pool data segment is attached to the pool LV and layer _tpool is created. Finaly segment is marked as thin_pool.
* Make move_lv_segment non-staticZdenek Kabelac2011-10-221-0/+3
| | | | | | | | This function could be useful for other _manip source files. Use dm_list manipulation function for provided functionality, which make the code more readable and avoid touching list internal details here.
* Simple validation of messages in mdaZdenek Kabelac2011-10-191-1/+1
| | | | | | Check we do not combine multiple messages for same LV target and switch to use 'delete_id' to make it clear for what this device_id is being used.
* Message support for thin provisiongZdenek Kabelac2011-10-171-0/+4
| | | | | | | | | | | | | | | | | | lvm part of messaging. Each message is now stored it's own thin pool section: message1 { create = lv } Messages are queued to thin pool dm target when this target is going to be resumed or used through some dependency. Currently 'delete' message are purely queued and processed with next thin pool resume operation (i.e. create_thin). WARNING - thin provisioning support is developmental code.
* Add simple function for lookup of some free device_idZdenek Kabelac2011-10-031-0/+3
| | | | Initial simple implementation for finding some free device_id.
* Append z to lv_attr if new blocks will be zeroed.Alasdair Kergon2011-09-091-1/+1
|
* lvcreate/remove thin_pool and thin volumes (--driverloaded n only)Alasdair Kergon2011-09-081-0/+4
|
* pool attach fns & more field renamingAlasdair Kergon2011-09-061-3/+5
|
* add thin_manip.c like the other manip filesAlasdair Kergon2011-09-061-0/+7
| | | | | move basic lv_is_* to macros data_lv -> pool_lv - we decided to call it 'pool' everywhere now
* Start using 64-bit status flags - most of the code already handles them.Alasdair Kergon2011-09-061-42/+11
| | | | | | tdata -> tpool remove commented out definitions from metadata.h formatting clean-ups
* Use size_t return typeZdenek Kabelac2011-09-011-1/+1
| | | | Since these function returns buffer size - use size_t type for them.
* Move the core of the lib/config/config.c functionality into libdevmapper,Petr Rockai2011-08-301-2/+3
| | | | | | | 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.
* Remove INCONSISTENT_VG flagZdenek Kabelac2011-08-101-1/+0
| | | | | | | | | | | | | | | As this flag could not have been set by the current code - removing it. Note: because of the wrong code logic this call: lvmcache_update_vg(correct_vg, correct_vg->status & PRECOMMITTED & (inconsistent ? INCONSISTENT_VG : 0)); had always passed '0' - now after flag removal it's passing PRECOMMITTED flag in - this present functinal change in this patch. To match the original functionality - 0 had to be always passed. More testing is needed here.
* Add basic RAID segment type(s) support.Jonathan Earl Brassow2011-08-021-0/+1
| | | | | | | | | | | | | 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
* When suspending, automatically preload newly-visible existing LVsAlasdair Kergon2011-06-301-0/+5
| | | | Let's find out if this makes things better or worse overall...
* Remove unused internal flag ACTIVATE_EXCL from the codeZdenek Kabelac2011-06-171-1/+0
|
* Fix RHBZ 651590 (failure to lock LV results in failure to repair mirror afterPetr Rockai2011-06-151-1/+5
| | | | | | | | | | | | | | | | | | transient error), stemming from the following sequence of events: 1) devices fail IO, triggering repair 2) dmeventd starts fixing up the mirror 3) during the downconversion, a new metadata version is written --> the devices come back online here 4) the mirror device suspend/resume is called to update DM tables 5) during the suspend/resume cycle, *pre*-commit metadata is read; however, since the failed devices are now back online, we get back inconsistent set of precommit metadata and the whole operation fails The patch relaxes the check that fails in step 5 above, namely by ignoring inconsistencies coming from PVs that are marked MISSING.
* Defer writing PV labels to vg_write.Alasdair Kergon2011-06-011-1/+2
| | | | Store label_sector only in struct physical_volume.
* Make vg_mark_partial_lvs also clear existing PARTIAL_LV flags, so it can bePetr Rockai2011-05-071-1/+0
| | | | issued repeatedly on the same VG, keeping the PARTIAL_LV flags up to date.
* Use only vg_set_fid and new pv_set_fid fn to assign the format instance.Peter Rajnoha2011-03-111-0/+8
| | | | | | This is essential for proper format instance ref_count support. We must use these functions to set the fid everywhere from now on, even the NULL value!
* Use new alloc_fid fn for common format instance initialisation.Peter Rajnoha2011-03-111-12/+15
|
* Allow non-orphan PVs with two metadata areas to be resized.Peter Rajnoha2011-02-281-0/+1
| | | | | | | | | We allow writing non-orphan PVs only for resize now. The "orphan PV" assert in pv_write fn uses the "allow_non_orphan" parameter to control this assert. However, we should find a more elaborate solution so we can remove this restriction altogether (pv_write together with vg_write is not atomic, we need to find a safe mechanism so there's an easy revert possible in case of an error).
* Change pvresize code to work with new metadata handling interface and allowPeter Rajnoha2011-02-211-0/+8
| | | | resizing a PV with two metadata areas.
* Change pv_write code to work with the changes in metadata handling interfacePeter Rajnoha2011-02-211-2/+1
| | | | and changes in format_instance.
* Change the code throughout to use new pv_initialise and modified pv_setup fn.Peter Rajnoha2011-02-211-6/+2
| | | | | Change pv_create code to work with these changes together with using new pv_add_metadata_area fn to add metadata areas for a PV being created.
* Separate new pv_initialise function out of the original pv_setup code.Peter Rajnoha2011-02-211-0/+12
| | | | | pv_initiliase initialises a new PV pv_setup sets up an existing PV with a VG
* Add new pv_remove_metadata_area interface function.Peter Rajnoha2011-02-211-0/+7
|
* Add new pv_add_metadata_area interface function.Peter Rajnoha2011-02-211-0/+11
|
* Remove useless mdas parameter for pv_read (from now on, we store mdas in aPeter Rajnoha2011-02-211-2/+1
| | | | format instance)
* Add vg_set_fid function to change VG format instance.Peter Rajnoha2011-02-211-0/+1
| | | | | | This function also sets a reference to a new VG format instance for all PVs that are part of the VG so the PV-VG interconnection is consistent after the change.
* Change create_instance to create PV-based as well as VG-based format instances.Peter Rajnoha2011-02-211-6/+10
| | | | | | | | Add supporting functions to work with the format instance and metadata area structures stored within the format instance. Add support for simple indexing of metadata areas using PV id and mda order (for on-disk PV only for now, we can extend the indexing even for other mdas if needed - we only need to define a proper key for the index).
* Change and generalise struct format_instance for PV and VG use.Peter Rajnoha2011-02-211-0/+12
|
* Replace PV_MIN_SIZE with function pv_min_size()Zdenek Kabelac2011-02-181-1/+0
| | | | | | | | | | | | | | | | | Add configurable option to define minimal size of of block device usable as a PV. pv_min_size() is added to lvm-globals and it's being initialized through _process_config. Macro PV_MIN_SIZE is unused and removed. New define DEFAULT_PV_MIN_SIZE_KB is added to lvm-global and unlike PV_MIN_SIZE it uses KB units. Should help users with various slow devices attached to the system, which cannot be easily filtered out (like FDD on /dev/sdX): https://bugzilla.redhat.com/show_bug.cgi?id=644578
* Change import_vg_from_buffer to use config_treeZdenek Kabelac2011-01-101-0/+3
| | | | | | Change function import_vg_from_buffer() to import_vg_from_config_tree(). Instead of creating config tree inside the function allow config tree to be passed as parameter - usable later for caching.
* Remove const usage from destroy callbacksZdenek Kabelac2010-12-201-1/+1
| | | | | | As const segment_type or const format_type are never released use their non-const version and remove const downcast from dm_free calls. This change fixes many gcc warnings we were getting from them.
* Some const cleanupsZdenek Kabelac2010-12-201-1/+1
| | | | Minor const warning fixes and internal API updates.
* Fix scanning of VGs without in-PV mdas.Alasdair Kergon2010-12-101-1/+1
| | | | | | | | | | | | | | Set cmd->independent_metadata_areas if metadata/dirs or disk_areas in use. - Identify and record this state. Don't skip full scan when independent mdas are present even if memlock is set. - Clusters and OOM aren't supported, so no problem doing the proper scans. Avoid revalidating the label cache immediately after scanning. - A simple optimisation. Support scanning for a single VG in independent mdas. - Not used by the fix but I left it in anyway as later patches might use it.
* pre-releaseAlasdair Kergon2010-10-251-1/+0
|
* Rename 'flags' to 'status' for struct metadata_area.Dave Wysochanski2010-10-051-1/+1
| | | | | | | | | | | | | | In other LVM memory structures such as volume_group, the field used to store flags is called "status", and on-disk fields are called 'flags', so rename the one inside metadata_area to be consistent. Not only is it more consistent with existing code but is cleaner to say "the status of this mda is ignored". Background for this patch - prajnoha pinged me on IRC this morning about a fix he was working on related to metadataignore when metadata/dirs was set. I was reviewing my patches from this year and realized the 'flags' field was probably not the best choice when I originally did the metadataignore patches.
* Fix copyright dates on new files lib/metadata/{lv|vg|pv}.[ch].Dave Wysochanski2010-09-301-1/+1
|
* Add tags_format_and_copy() common function and call from _tags_disp.Dave Wysochanski2010-09-301-0/+1
| | | | | | Add a common function to allocate memory and format a string of tags. Call tags_format_and_copy() from _tags_disp().
* Add {pv|vg|lv}_attr_dup() functions and refactor 'disp' functions.Dave Wysochanski2010-09-301-0/+1
| | | | | | | | Move the creating of the 'attr' strings into a common function so they can be called from the 'disp' functions as well as the new 'get' property functions. Add "_dup" suffix to indicate memory is allocated. Refactor pvstatus_disp to take pv argument and call pv_attr_dup().
* Refactor metadata.[ch] into vg.[ch] for vg functions.Dave Wysochanski2010-09-301-7/+0
| | | | | | The metadata.[ch] files are very large. This patch makes a first attempt at separating out vg functions and data, particularly related to the reporting fields calculations.