Tiny refactoring
authorVolker Lendecke <vl@sernet.de>
Sat, 1 Dec 2007 13:52:25 +0000 (14:52 +0100)
committerVolker Lendecke <vl@sernet.de>
Wed, 5 Dec 2007 12:45:11 +0000 (13:45 +0100)
Reformatting, consolidate oplock calculation to the same place in both routines
(This used to be commit a855808f4851a800055bfee5df39ca72057e55f9)

source3/smbd/nttrans.c

index 68eb9f0985676333bf6b5b6b88b439a699d8cdff..aaf4a408e6b9aa61d50ca40e329bb8f612e076d5 100644 (file)
@@ -704,6 +704,12 @@ void reply_ntcreate_and_X(connection_struct *conn,
                }
        }
 
+       oplock_request = (flags & REQUEST_OPLOCK) ? EXCLUSIVE_OPLOCK : 0;
+       if (oplock_request) {
+               oplock_request |= (flags & REQUEST_BATCH_OPLOCK)
+                       ? BATCH_OPLOCK : 0;
+       }
+
        /*
         * Now contruct the smb_open_mode value from the filename,
         * desired access and the share access.
@@ -724,11 +730,6 @@ void reply_ntcreate_and_X(connection_struct *conn,
                return;
        }
 
-       oplock_request = (flags & REQUEST_OPLOCK) ? EXCLUSIVE_OPLOCK : 0;
-       if (oplock_request) {
-               oplock_request |= (flags & REQUEST_BATCH_OPLOCK) ? BATCH_OPLOCK : 0;
-       }
-
        /*
         * Ordinary file or directory.
         */
@@ -1458,7 +1459,8 @@ static void call_nt_transact_create(connection_struct *conn,
 
        oplock_request = (flags & REQUEST_OPLOCK) ? EXCLUSIVE_OPLOCK : 0;
        if (oplock_request) {
-               oplock_request |= (flags & REQUEST_BATCH_OPLOCK) ? BATCH_OPLOCK : 0;
+               oplock_request |= (flags & REQUEST_BATCH_OPLOCK)
+                       ? BATCH_OPLOCK : 0;
        }
 
        /*