#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"
range, so we should try the lock again. Note that on timeout we
do retry the lock, giving it a last chance.
*/
-static void pvfs_pending_lock_continue(void *private, enum pvfs_wait_notice reason)
+static void pvfs_pending_lock_continue(void *private_data, enum pvfs_wait_notice reason)
{
- struct pvfs_pending_lock *pending = private;
+ struct pvfs_pending_lock *pending = talloc_get_type(private_data,
+ struct pvfs_pending_lock);
struct pvfs_state *pvfs = pending->pvfs;
struct pvfs_file *f = pending->f;
struct ntvfs_request *req = pending->req;
/* we don't retry on a cancel */
if (reason == PVFS_WAIT_CANCEL) {
- status = NT_STATUS_FILE_LOCK_CONFLICT;
+ if (pvfs->ntvfs->ctx->protocol != PROTOCOL_SMB2) {
+ status = NT_STATUS_FILE_LOCK_CONFLICT;
+ } else {
+ status = NT_STATUS_CANCELLED;
+ }
} else {
/*
* here it's important to pass the pending pointer
NTSTATUS pvfs_lock(struct ntvfs_module_context *ntvfs,
struct ntvfs_request *req, union smb_lock *lck)
{
- struct pvfs_state *pvfs = ntvfs->private_data;
+ struct pvfs_state *pvfs = talloc_get_type(ntvfs->private_data,
+ struct pvfs_state);
struct pvfs_file *f;
struct smb_lock_entry *locks;
int i;