public inbox for lvm2-cvs@sourceware.org help / color / mirror / Atom feed
From: agk@sourceware.org To: lvm-devel@redhat.com, lvm2-cvs@sourceware.org Subject: LVM2 ./WHATS_NEW daemons/clvmd/lvm-functions.c ... Date: Fri, 24 Jul 2009 18:15:00 -0000 [thread overview] Message-ID: <20090724181508.2348.qmail@sourceware.org> (raw) CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: agk@sourceware.org 2009-07-24 18:15:07 Modified files: . : WHATS_NEW daemons/clvmd : lvm-functions.c lib/locking : locking.c locking.h Log message: All LV locks are non-blocking so remove LCK_NONBLOCK from separate macros. Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/WHATS_NEW.diff?cvsroot=lvm2&r1=1.1200&r2=1.1201 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/daemons/clvmd/lvm-functions.c.diff?cvsroot=lvm2&r1=1.66&r2=1.67 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/locking/locking.c.diff?cvsroot=lvm2&r1=1.62&r2=1.63 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/locking/locking.h.diff?cvsroot=lvm2&r1=1.48&r2=1.49 --- LVM2/WHATS_NEW 2009/07/24 15:01:43 1.1200 +++ LVM2/WHATS_NEW 2009/07/24 18:15:06 1.1201 @@ -1,5 +1,6 @@ Version 2.02.50 - ================================ + All LV locks are non-blocking so remove LCK_NONBLOCK from separate macros. Fix race condition with vgcreate and vgextend on same device (2.02.49). Remove redundant validate_name call from vgreduce. Add lvm_{pv|vg|lv}_get_{name|uuid} liblvm functions. --- LVM2/daemons/clvmd/lvm-functions.c 2009/07/16 00:36:59 1.66 +++ LVM2/daemons/clvmd/lvm-functions.c 2009/07/24 18:15:07 1.67 @@ -65,8 +65,6 @@ int lock_mode; }; -#define LCK_MASK (LCK_TYPE_MASK | LCK_SCOPE_MASK) - static const char *decode_locking_cmd(unsigned char cmdl) { static char buf[128]; @@ -482,28 +480,28 @@ cmd->partial_activation = (lock_flags & LCK_PARTIAL_MODE) ? 1 : 0; switch (command) { - case LCK_LV_EXCLUSIVE: + case LCK_LV_EXCLUSIVE & LCK_MASK: status = do_activate_lv(resource, lock_flags, LKM_EXMODE); break; - case LCK_LV_SUSPEND: + case LCK_LV_SUSPEND & LCK_MASK: status = do_suspend_lv(resource); if (!status) suspended++; break; case LCK_UNLOCK: - case LCK_LV_RESUME: /* if active */ + case LCK_LV_RESUME & LCK_MASK: /* if active */ status = do_resume_lv(resource); if (!status) suspended--; break; - case LCK_LV_ACTIVATE: + case LCK_LV_ACTIVATE & LCK_MASK: status = do_activate_lv(resource, lock_flags, LKM_CRMODE); break; - case LCK_LV_DEACTIVATE: + case LCK_LV_DEACTIVATE & LCK_MASK: status = do_deactivate_lv(resource, lock_flags); break; --- LVM2/lib/locking/locking.c 2009/07/15 05:49:47 1.62 +++ LVM2/lib/locking/locking.c 2009/07/24 18:15:07 1.63 @@ -386,9 +386,10 @@ /* If LVM1 driver knows about the VG, it can't be accessed. */ if (!check_lvm1_vg_inactive(cmd, vol)) return 0; + break; case LCK_LV: - /* Suspend LV if it's active. */ - strncpy(resource, vol, sizeof(resource)); + /* All LV locks are non-blocking. */ + flags |= LCK_NONBLOCK; break; default: log_error("Unrecognised lock scope: %d", @@ -396,6 +397,8 @@ return 0; } + strncpy(resource, vol, sizeof(resource)); + if (!_lock_vol(cmd, resource, flags)) return 0; --- LVM2/lib/locking/locking.h 2009/06/12 08:30:19 1.48 +++ LVM2/lib/locking/locking.h 2009/07/24 18:15:07 1.49 @@ -106,17 +106,19 @@ #define LCK_VG_DROP_CACHE (LCK_VG | LCK_WRITE | LCK_CACHE) #define LCK_VG_BACKUP (LCK_VG | LCK_CACHE) -#define LCK_LV_EXCLUSIVE (LCK_LV | LCK_EXCL | LCK_NONBLOCK) -#define LCK_LV_SUSPEND (LCK_LV | LCK_WRITE | LCK_NONBLOCK) -#define LCK_LV_RESUME (LCK_LV | LCK_UNLOCK | LCK_NONBLOCK) -#define LCK_LV_ACTIVATE (LCK_LV | LCK_READ | LCK_NONBLOCK) -#define LCK_LV_DEACTIVATE (LCK_LV | LCK_NULL | LCK_NONBLOCK) +#define LCK_LV_EXCLUSIVE (LCK_LV | LCK_EXCL) +#define LCK_LV_SUSPEND (LCK_LV | LCK_WRITE) +#define LCK_LV_RESUME (LCK_LV | LCK_UNLOCK) +#define LCK_LV_ACTIVATE (LCK_LV | LCK_READ) +#define LCK_LV_DEACTIVATE (LCK_LV | LCK_NULL) + +#define LCK_MASK (LCK_TYPE_MASK | LCK_SCOPE_MASK) #define LCK_LV_CLUSTERED(lv) \ (vg_is_clustered((lv)->vg) ? LCK_CLUSTER_VG : 0) #define lock_lv_vol(cmd, lv, flags) \ - lock_vol(cmd, (lv)->lvid.s, flags | LCK_LV_CLUSTERED(lv)) + lock_vol(cmd, (lv)->lvid.s, flags | LCK_LV_CLUSTERED(lv) | LCK_NONBLOCK) #define unlock_vg(cmd, vol) lock_vol(cmd, vol, LCK_VG_UNLOCK) #define unlock_and_release_vg(cmd, vg, vol) \
next reply other threads:[~2009-07-24 18:15 UTC|newest] Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top 2009-07-24 18:15 agk [this message] -- strict thread matches above, loose matches on Subject: below -- 2012-01-20 0:27 jbrassow 2011-12-08 21:24 agk 2011-09-27 22:43 agk 2011-08-10 20:25 zkabelac 2011-02-18 14:16 zkabelac 2011-02-18 0:36 jbrassow 2011-02-04 20:30 jbrassow 2011-02-03 16:03 zkabelac 2011-02-03 1:58 zkabelac 2010-12-08 20:51 agk 2010-11-23 1:56 agk 2010-03-26 15:40 snitzer 2010-03-23 22:30 snitzer 2010-01-19 13:25 mbroz 2010-01-05 16:09 mbroz 2010-01-05 16:06 mbroz 2010-01-05 16:03 mbroz 2009-11-23 10:44 mbroz 2009-07-16 0:37 agk 2009-07-15 23:57 agk 2009-07-13 19:49 agk 2009-06-12 8:30 mbroz 2009-02-22 21:14 agk 2009-01-26 19:01 agk 2008-09-19 6:42 agk 2007-08-07 9:06 meyering 2007-01-25 14:37 agk 2007-01-23 15:58 agk 2007-01-19 22:21 agk 2006-05-11 19:05 agk 2006-03-09 22:34 agk 2005-08-14 23:18 agk
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20090724181508.2348.qmail@sourceware.org \ --to=agk@sourceware.org \ --cc=lvm-devel@redhat.com \ --cc=lvm2-cvs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).