1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-03-10 16:58:47 +03:00

Rename LCK_NONE to LCK_UNLOCK

This commit is contained in:
Alasdair Kergon 2002-04-04 11:18:45 +00:00
parent 607bcd61d0
commit 8856889d10
3 changed files with 8 additions and 8 deletions

View File

@ -125,7 +125,7 @@ static int _lock_file(const char *file, int flags)
case LCK_WRITE:
operation = LOCK_EX;
break;
case LCK_NONE:
case LCK_UNLOCK:
return _release_lock(file);
default:
log_error("Unrecognised lock type: %d", flags & LCK_TYPE_MASK);
@ -198,7 +198,7 @@ int lock_resource(struct cmd_context *cmd, const char *resource, int flags)
break;
case LCK_LV:
switch (flags & LCK_TYPE_MASK) {
case LCK_NONE:
case LCK_UNLOCK:
if (!lv_resume_if_active(cmd, resource))
return 0;
break;

View File

@ -59,7 +59,7 @@ static void _unblock_signals(void)
static inline void _update_lock_count(int flags)
{
if ((flags & LCK_TYPE_MASK) == LCK_NONE)
if ((flags & LCK_TYPE_MASK) == LCK_UNLOCK)
_lock_count--;
else
_lock_count++;
@ -159,9 +159,9 @@ int lock_vol(struct cmd_context *cmd, const char *vol, int flags)
return 0;
/* Perform immediate unlock unless LCK_HOLD set */
if (!(flags & LCK_HOLD) && ((flags & LCK_TYPE_MASK) != LCK_NONE)) {
if (!(flags & LCK_HOLD) && ((flags & LCK_TYPE_MASK) != LCK_UNLOCK)) {
if (!_lock_vol(cmd, resource,
(flags & ~LCK_TYPE_MASK) | LCK_NONE))
(flags & ~LCK_TYPE_MASK) | LCK_UNLOCK))
return 0;
}

View File

@ -28,7 +28,7 @@ int lock_vol(struct cmd_context *cmd, const char *vol, int flags);
* Lock type
*/
#define LCK_TYPE_MASK 0x000000FF
#define LCK_NONE 0x00000000
#define LCK_UNLOCK 0x00000000
#define LCK_READ 0x00000001
#define LCK_WRITE 0x00000002
#define LCK_EXCL 0x00000003
@ -51,12 +51,12 @@ int lock_vol(struct cmd_context *cmd, const char *vol, int flags);
*/
#define LCK_VG_READ (LCK_VG | LCK_READ | LCK_HOLD)
#define LCK_VG_WRITE (LCK_VG | LCK_WRITE | LCK_HOLD)
#define LCK_VG_UNLOCK (LCK_VG | LCK_NONE)
#define LCK_VG_UNLOCK (LCK_VG | LCK_UNLOCK)
#define LCK_LV_DEACTIVATE (LCK_LV | LCK_EXCL)
#define LCK_LV_SUSPEND (LCK_LV | LCK_WRITE)
#define LCK_LV_ACTIVATE (LCK_LV | LCK_READ)
#define LCK_LV_UNLOCK (LCK_LV | LCK_NONE)
#define LCK_LV_UNLOCK (LCK_LV | LCK_UNLOCK)
#define unlock_lv(cmd, vol) lock_vol(cmd, vol, LCK_LV_UNLOCK)
#define unlock_vg(cmd, vol) lock_vol(cmd, vol, LCK_VG_UNLOCK)