LVM2 ./WHATS_NEW lib/activate/activate.c lib/a ...
CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: zkabelac at sourceware.org 2012-01-25 08:48:43
Modified files:
. : WHATS_NEW
lib/activate : activate.c activate.h dev_manager.c
dev_manager.h
Log message:
Thin add lv_thin_pool_transaction_id
Easy function to get transaction_id status value.
Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.2236&r2=1.2237
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.c.diff?cvsroot=lvm2&r1=1.233&r2=1.234
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/activate.h.diff?cvsroot=lvm2&r1=1.94&r2=1.95
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.c.diff?cvsroot=lvm2&r1=1.264&r2=1.265
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/activate/dev_manager.h.diff?cvsroot=lvm2&r1=1.44&r2=1.45
WHATS_NEW +1 -0
@@ -1,5 +1,6 @@ Version 2.02.89 - ================================== + Add lv_thin_pool_transaction_id to read the transaction_id value. Use suspend|resume_origin_only when up-converting RAID, as mirrors do. Fix the way RAID meta LVs are added to the dependency tree. Change exclusive LV activation logic to try local node before remote nodes.
lib/activate/activate.c +29 -0
@@ -762,6 +762,35 @@return r; } +/* +* Returns 1 if transaction_id set, else 0 on failure. +*/ +int lv_thin_pool_transaction_id (const struct logical_volume *lv, +uint64_t *transaction_id) +{ +int r; +struct dev_manager *dm; +struct dm_status_thin_pool *status; + +if (!activation ()) +return 0 ; + +log_debug ("Checking thin percent for LV %s/%s" , + lv->vg->name, lv->name); + +if (!(dm =dev_manager_create (lv->vg->cmd, lv->vg->name,1 ))) + return_0; + +if (!(r =dev_manager_thin_pool_status (dm, lv, &status))) + stack; +else + *transaction_id = status->transaction_id; + +dev_manager_destroy (dm); + +return r; +} +static int _lv_active (struct cmd_context *cmd,struct logical_volume *lv) {struct lvinfo info;
lib/activate/activate.h +2 -0
@@ -105,6 +105,8 @@ percent_t *percent);int lv_thin_percent (const struct logical_volume *lv,int mapped,percent_t *percent); +int lv_thin_pool_transaction_id (const struct logical_volume *lv, +uint64_t *transaction_id);/* * Return number of LVs in the VG that are active.
lib/activate/dev_manager.c +42 -0
48 lines not on this page · raw message
lib/activate/dev_manager.h +3 -0
@@ -54,6 +54,9 @@int dev_manager_mirror_percent (struct dev_manager *dm,const struct logical_volume *lv,int wait,percent_t *percent,uint32_t *event_nr); +int dev_manager_thin_pool_status (struct dev_manager *dm, +const struct logical_volume *lv, +struct dm_status_thin_pool **status);int dev_manager_thin_pool_percent (struct dev_manager *dm,const struct logical_volume *lv,int metadata,percent_t *percent);