patch-2.4.13 linux/fs/lockd/svcproc.c

Next file: linux/fs/locks.c
Previous file: linux/fs/lockd/svclock.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.12/linux/fs/lockd/svcproc.c linux/fs/lockd/svcproc.c
@@ -29,17 +29,20 @@
 static u32
 cast_to_nlm(u32 status, u32 vers)
 {
-
+	/* Note: status is assumed to be in network byte order !!! */
 	if (vers != 4){
-		switch(ntohl(status)){
-		case NLM_LCK_GRANTED:
-		case NLM_LCK_DENIED:
-		case NLM_LCK_DENIED_NOLOCKS:
-		case NLM_LCK_BLOCKED:
-		case NLM_LCK_DENIED_GRACE_PERIOD:
+		switch (status) {
+		case nlm_granted:
+		case nlm_lck_denied:
+		case nlm_lck_denied_nolocks:
+		case nlm_lck_blocked:
+		case nlm_lck_denied_grace_period:
+			break;
+		case nlm4_deadlock:
+			status = nlm_lck_denied;
 			break;
 		default:
-			status = NLM_LCK_DENIED_NOLOCKS;
+			status = nlm_lck_denied_nolocks;
 		}
 	}
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)