Fix include paths to new location of libutil.
[sfrench/samba-autobuild/.git] / source4 / ntvfs / posix / pvfs_lock.c
index baa92880f13d570e8c6cb6b33082a67e05a070fc..173b2fe187fdee8108b629ea57da02733afbff2f 100644 (file)
@@ -22,7 +22,7 @@
 #include "includes.h"
 #include "vfs_posix.h"
 #include "system/time.h"
-#include "lib/util/dlinklist.h"
+#include "../lib/util/dlinklist.h"
 #include "messaging/messaging.h"
 
 
@@ -31,7 +31,7 @@
 */
 NTSTATUS pvfs_check_lock(struct pvfs_state *pvfs,
                         struct pvfs_file *f,
-                        uint16_t smbpid,
+                        uint32_t smbpid,
                         uint64_t offset, uint64_t count,
                         enum brl_type rw)
 {
@@ -68,13 +68,8 @@ static void pvfs_lock_async_failed(struct pvfs_state *pvfs,
                                   int i,
                                   NTSTATUS status)
 {
-       /* in SMB2 mode we also try to unlock failing lock */ 
-       if (req->ctx->protocol != PROTOCOL_SMB2) {
-               i--;
-       }
-
        /* undo the locks we just did */
-       for (;i>=0;i--) {
+       for (i--;i>=0;i--) {
                brl_unlock(pvfs->brl_context,
                           f->brl_handle,
                           locks[i].pid,
@@ -390,12 +385,9 @@ NTSTATUS pvfs_lock(struct ntvfs_module_context *ntvfs,
                                DLIST_ADD(f->pending_list, pending);
                                return NT_STATUS_OK;
                        }
-                       /* in SMB2 mode we also try to unlock failing lock */ 
-                       if (req->ctx->protocol != PROTOCOL_SMB2) {
-                               i--;
-                       }
+
                        /* undo the locks we just did */
-                       for (;i>=0;i--) {
+                       for (i--;i>=0;i--) {
                                brl_unlock(pvfs->brl_context,
                                           f->brl_handle,
                                           locks[i].pid,