1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-27 22:50:26 +03:00

vfs: Remove "blocking_lock" from SMB_VFS_BRL_LOCK_WINDOWS

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Volker Lendecke 2019-07-01 14:55:42 +02:00 committed by Jeremy Allison
parent 37c9c4c3ce
commit f83775d855
9 changed files with 24 additions and 38 deletions

View 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;
}

View 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,

View File

@ -266,6 +266,8 @@
/* 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,

View File

@ -351,10 +351,10 @@
#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))

View 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;

View 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,

View 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;
}

View 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;
}

View 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;