viced-remove-premature-commit-20060303
authorJeffrey Altman <jaltman@secure-endpoints.com>
Fri, 3 Mar 2006 18:26:45 +0000 (18:26 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Fri, 3 Mar 2006 18:26:45 +0000 (18:26 +0000)
remove premature LockUpgrade/LockDowngrade commit

src/viced/afsfileprocs.c

index bcf12bf..213c9ad 100644 (file)
@@ -1698,8 +1698,6 @@ HandleLocking(Vnode * targetptr, afs_int32 rights, ViceLockType LockingType)
     switch (LockingType) {
     case LockRead:
     case LockWrite:
-    case LockUpgrade:
-    case LockDowngrade:
        if (Time > targetptr->disk.lock.lockTime)
            targetptr->disk.lock.lockTime = targetptr->disk.lock.lockCount =
                0;
@@ -1716,18 +1714,6 @@ HandleLocking(Vnode * targetptr, afs_int32 rights, ViceLockType LockingType)
                targetptr->disk.lock.lockTime = Time;
            } else
                return (EAGAIN);
-       } else if (LockingType == LockUpgrade) {
-           if (targetptr->disk.lock.lockCount == 1) {
-               targetptr->disk.lock.lockCount = -1;
-               targetptr->disk.lock.lockTime = Time;
-           } else
-               return (EAGAIN);
-       } else if (LockingType == LockDowngrade) {
-           if (targetptr->disk.lock.lockCount == -1) {
-               targetptr->disk.lock.lockCount = 1;
-               targetptr->disk.lock.lockTime = Time;
-           } else
-               return (EAGAIN);
        }
        break;
     case LockExtend:
@@ -4969,11 +4955,10 @@ SAFSS_SetLock(struct rx_call *acall, struct AFSFid *Fid, ViceLockType type,
     afs_int32 rights, anyrights;       /* rights for this and any user */
     struct client *t_client;   /* tmp ptr to client data */
     struct in_addr logHostAddr;        /* host ip holder for inet_ntoa */
-    static char *locktype[5] = { "LockRead", "LockWrite", "LockExtend", "LockUpgrade", "LockDowngrade" };
+    static char *locktype[4] = { "LockRead", "LockWrite", "LockExtend", "LockRelease" };
     struct rx_connection *tcon = rx_ConnectionOf(acall);
 
-    if (type != LockRead && type != LockWrite && 
-       type != LockUpgrade && type != LockDowngrade) {
+    if (type != LockRead && type != LockWrite) {
        errorCode = EINVAL;
        goto Bad_SetLock;
     }