vfs: Remove "blocking_lock" from SMB_VFS_BRL_LOCK_WINDOWS
authorVolker Lendecke <vl@samba.org>
Mon, 1 Jul 2019 12:55:42 +0000 (14:55 +0200)
committerJeremy Allison <jra@samba.org>
Tue, 2 Jul 2019 17:01:27 +0000 (17:01 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
examples/VFS/skel_opaque.c
examples/VFS/skel_transparent.c
source3/include/vfs.h
source3/include/vfs_macros.h
source3/locking/brlock.c
source3/modules/vfs_default.c
source3/modules/vfs_full_audit.c
source3/modules/vfs_not_implemented.c
source3/modules/vfs_time_audit.c

index 4e4475a11e887354194cc134bfe1097e22029ea1..1d4f28d1d286b6a24fe13b0f7488b3ffd0c999a6 100644 (file)
@@ -647,8 +647,7 @@ static const char *skel_connectpath(struct vfs_handle_struct *handle,
 
 static NTSTATUS skel_brl_lock_windows(struct vfs_handle_struct *handle,
                                      struct byte_range_lock *br_lck,
-                                     struct lock_struct *plock,
-                                     bool blocking_lock)
+                                     struct lock_struct *plock)
 {
        return NT_STATUS_NOT_IMPLEMENTED;
 }
index ac2665ef07ba82733be82715f171e135c11eebdd..fd5d2296559607e670f577d8d2bf236330dfcd5a 100644 (file)
@@ -818,11 +818,9 @@ static const char *skel_connectpath(struct vfs_handle_struct *handle,
 
 static NTSTATUS skel_brl_lock_windows(struct vfs_handle_struct *handle,
                                      struct byte_range_lock *br_lck,
-                                     struct lock_struct *plock,
-                                     bool blocking_lock)
+                                     struct lock_struct *plock)
 {
-       return SMB_VFS_NEXT_BRL_LOCK_WINDOWS(handle,
-                                            br_lck, plock, blocking_lock);
+       return SMB_VFS_NEXT_BRL_LOCK_WINDOWS(handle, br_lck, plock);
 }
 
 static bool skel_brl_unlock_windows(struct vfs_handle_struct *handle,
index 56f4b9dd1f85fc0a86221f3d05915f54b077fbfc..f4ae10429b8fa728f861c86806a07bb9a28cca65 100644 (file)
 /* Version 41 - add st_ex_itime to struct stat_ex */
 /* Version 41 - add st_ex_file_id to struct stat_ex */
 /* Version 41 - add SMB_VFS_FS_FILE_ID */
+/* Version 41 - Remove "blocking_lock" parameter from
+                SMB_VFS_BRL_LOCK_WINDOWS */
 
 #define SMB_VFS_INTERFACE_VERSION 41
 
@@ -870,8 +872,7 @@ struct vfs_fn_pointers {
 
        NTSTATUS (*brl_lock_windows_fn)(struct vfs_handle_struct *handle,
                                        struct byte_range_lock *br_lck,
-                                       struct lock_struct *plock,
-                                       bool blocking_lock);
+                                       struct lock_struct *plock);
 
        bool (*brl_unlock_windows_fn)(struct vfs_handle_struct *handle,
                                      struct messaging_context *msg_ctx,
@@ -1345,8 +1346,7 @@ const char *smb_vfs_call_connectpath(struct vfs_handle_struct *handle,
                                     const struct smb_filename *smb_fname);
 NTSTATUS smb_vfs_call_brl_lock_windows(struct vfs_handle_struct *handle,
                                       struct byte_range_lock *br_lck,
-                                      struct lock_struct *plock,
-                                      bool blocking_lock);
+                                      struct lock_struct *plock);
 bool smb_vfs_call_brl_unlock_windows(struct vfs_handle_struct *handle,
                                     struct messaging_context *msg_ctx,
                                     struct byte_range_lock *br_lck,
@@ -1808,8 +1808,7 @@ const char *vfs_not_implemented_connectpath(struct vfs_handle_struct *handle,
                                            const struct smb_filename *smb_fname);
 NTSTATUS vfs_not_implemented_brl_lock_windows(struct vfs_handle_struct *handle,
                                              struct byte_range_lock *br_lck,
-                                             struct lock_struct *plock,
-                                             bool blocking_lock);
+                                             struct lock_struct *plock);
 bool vfs_not_implemented_brl_unlock_windows(struct vfs_handle_struct *handle,
                                            struct messaging_context *msg_ctx,
                                            struct byte_range_lock *br_lck,
index c4fa0fe022e8bd1044411998d6622e4295a2e18c..2c1a9d1cd168e57b3888279ea30ff62247db4b04 100644 (file)
 #define SMB_VFS_NEXT_CONNECTPATH(conn, smb_fname) \
        smb_vfs_call_connectpath((conn)->next, (smb_fname))
 
-#define SMB_VFS_BRL_LOCK_WINDOWS(conn, br_lck, plock, blocking_lock) \
-       smb_vfs_call_brl_lock_windows((conn)->vfs_handles, (br_lck), (plock), (blocking_lock))
-#define SMB_VFS_NEXT_BRL_LOCK_WINDOWS(handle, br_lck, plock, blocking_lock) \
-       smb_vfs_call_brl_lock_windows((handle)->next, (br_lck), (plock), (blocking_lock))
+#define SMB_VFS_BRL_LOCK_WINDOWS(conn, br_lck, plock) \
+       smb_vfs_call_brl_lock_windows((conn)->vfs_handles, (br_lck), (plock))
+#define SMB_VFS_NEXT_BRL_LOCK_WINDOWS(handle, br_lck, plock) \
+       smb_vfs_call_brl_lock_windows((handle)->next, (br_lck), (plock))
 
 #define SMB_VFS_BRL_UNLOCK_WINDOWS(conn, msg_ctx, br_lck, plock) \
        smb_vfs_call_brl_unlock_windows((conn)->vfs_handles, (msg_ctx), (br_lck), (plock))
index 7d67f271ab234451b64497274ce887d48303fbd7..f3ef909563972a8f18076e11eafa02e02a92db6d 100644 (file)
@@ -892,12 +892,10 @@ static NTSTATUS brl_lock_posix(struct messaging_context *msg_ctx,
 
 NTSTATUS smb_vfs_call_brl_lock_windows(struct vfs_handle_struct *handle,
                                       struct byte_range_lock *br_lck,
-                                      struct lock_struct *plock,
-                                      bool blocking_lock)
+                                      struct lock_struct *plock)
 {
        VFS_FIND(brl_lock_windows);
-       return handle->fns->brl_lock_windows_fn(handle, br_lck, plock,
-                                               blocking_lock);
+       return handle->fns->brl_lock_windows_fn(handle, br_lck, plock);
 }
 
 /****************************************************************************
@@ -939,7 +937,7 @@ NTSTATUS brl_lock(struct messaging_context *msg_ctx,
 
        if (lock_flav == WINDOWS_LOCK) {
                ret = SMB_VFS_BRL_LOCK_WINDOWS(
-                       br_lck->fsp->conn, br_lck, &lock, false);
+                       br_lck->fsp->conn, br_lck, &lock);
        } else {
                ret = brl_lock_posix(msg_ctx, br_lck, &lock);
        }
@@ -948,7 +946,6 @@ NTSTATUS brl_lock(struct messaging_context *msg_ctx,
        /* sort the lock list */
        TYPESAFE_QSORT(br_lck->lock_data, (size_t)br_lck->num_locks, lock_compare);
 #endif
-
        /* If we're returning an error, return who blocked us. */
        if (!NT_STATUS_IS_OK(ret) && psmblctx) {
                *blocker_pid = lock.context.pid;
index 68d9200ce889b33aa63389b6d83297f084629a94..13bfe45527099c6613658cc87baa4563cd4a3545 100644 (file)
@@ -2835,13 +2835,12 @@ static const char *vfswrap_connectpath(struct vfs_handle_struct *handle,
 
 static NTSTATUS vfswrap_brl_lock_windows(struct vfs_handle_struct *handle,
                                         struct byte_range_lock *br_lck,
-                                        struct lock_struct *plock,
-                                        bool blocking_lock)
+                                        struct lock_struct *plock)
 {
        SMB_ASSERT(plock->lock_flav == WINDOWS_LOCK);
 
        /* Note: blr is not used in the default implementation. */
-       return brl_lock_windows_default(br_lck, plock, blocking_lock);
+       return brl_lock_windows_default(br_lck, plock, false);
 }
 
 static bool vfswrap_brl_unlock_windows(struct vfs_handle_struct *handle,
index b20bca0a528b74a514693ebd628bf01b8e54f98a..60802b8eb1158a27b6b0040e5b29df0c27274e47 100644 (file)
@@ -1886,21 +1886,18 @@ static const char *smb_full_audit_connectpath(vfs_handle_struct *handle,
 
 static NTSTATUS smb_full_audit_brl_lock_windows(struct vfs_handle_struct *handle,
                                                struct byte_range_lock *br_lck,
-                                               struct lock_struct *plock,
-                                               bool blocking_lock)
+                                               struct lock_struct *plock)
 {
        NTSTATUS result;
 
-       result = SMB_VFS_NEXT_BRL_LOCK_WINDOWS(handle, br_lck, plock,
-                                              blocking_lock);
+       result = SMB_VFS_NEXT_BRL_LOCK_WINDOWS(handle, br_lck, plock);
 
        do_log(SMB_VFS_OP_BRL_LOCK_WINDOWS, NT_STATUS_IS_OK(result), handle,
-           "%s:%llu-%llu. type=%d. blocking=%d",
+           "%s:%llu-%llu. type=%d.",
               fsp_str_do_log(brl_fsp(br_lck)),
               (unsigned long long)plock->start,
               (unsigned long long)plock->size,
-              plock->lock_type,
-              blocking_lock);
+              plock->lock_type);
 
        return result;
 }
index aa7068ed0732f379460a1860448dc9143ec73257..93a49722cfe3dfa62afe0cb065553778e23ab1f9 100644 (file)
@@ -650,8 +650,7 @@ const char *vfs_not_implemented_connectpath(struct vfs_handle_struct *handle,
 
 NTSTATUS vfs_not_implemented_brl_lock_windows(struct vfs_handle_struct *handle,
                                              struct byte_range_lock *br_lck,
-                                             struct lock_struct *plock,
-                                             bool blocking_lock)
+                                             struct lock_struct *plock)
 {
        return NT_STATUS_NOT_IMPLEMENTED;
 }
index 8e1c794c037b5d6a8de8681052afd629d8628892..563490bf94c025502baacd82c3b1de76869e813b 100644 (file)
@@ -1608,16 +1608,14 @@ static const char *smb_time_audit_connectpath(vfs_handle_struct *handle,
 
 static NTSTATUS smb_time_audit_brl_lock_windows(struct vfs_handle_struct *handle,
                                                struct byte_range_lock *br_lck,
-                                               struct lock_struct *plock,
-                                               bool blocking_lock)
+                                               struct lock_struct *plock)
 {
        NTSTATUS result;
        struct timespec ts1,ts2;
        double timediff;
 
        clock_gettime_mono(&ts1);
-       result = SMB_VFS_NEXT_BRL_LOCK_WINDOWS(handle, br_lck, plock,
-                                              blocking_lock);
+       result = SMB_VFS_NEXT_BRL_LOCK_WINDOWS(handle, br_lck, plock);
        clock_gettime_mono(&ts2);
        timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;