return false;
}
-static bool skel_strict_lock(struct vfs_handle_struct *handle,
- struct files_struct *fsp,
- struct lock_struct *plock)
+static bool skel_strict_lock_check(struct vfs_handle_struct *handle,
+ struct files_struct *fsp,
+ struct lock_struct *plock)
{
errno = ENOSYS;
return false;
.brl_lock_windows_fn = skel_brl_lock_windows,
.brl_unlock_windows_fn = skel_brl_unlock_windows,
.brl_cancel_windows_fn = skel_brl_cancel_windows,
- .strict_lock_fn = skel_strict_lock,
+ .strict_lock_check_fn = skel_strict_lock_check,
.translate_name_fn = skel_translate_name,
.fsctl_fn = skel_fsctl,
.readdir_attr_fn = skel_readdir_attr,
return SMB_VFS_NEXT_BRL_CANCEL_WINDOWS(handle, br_lck, plock);
}
-static bool skel_strict_lock(struct vfs_handle_struct *handle,
- struct files_struct *fsp,
- struct lock_struct *plock)
+static bool skel_strict_lock_check(struct vfs_handle_struct *handle,
+ struct files_struct *fsp,
+ struct lock_struct *plock)
{
- return SMB_VFS_NEXT_STRICT_LOCK(handle, fsp, plock);
+ return SMB_VFS_NEXT_STRICT_LOCK_CHECK(handle, fsp, plock);
}
static NTSTATUS skel_translate_name(struct vfs_handle_struct *handle,
.brl_lock_windows_fn = skel_brl_lock_windows,
.brl_unlock_windows_fn = skel_brl_unlock_windows,
.brl_cancel_windows_fn = skel_brl_cancel_windows,
- .strict_lock_fn = skel_strict_lock,
+ .strict_lock_check_fn = skel_strict_lock_check,
.translate_name_fn = skel_translate_name,
.fsctl_fn = skel_fsctl,
.readdir_attr_fn = skel_readdir_attr,
/* Version 37 - Rename SMB_VFS_COPY_CHUNK_SEND/RECV to
SMB_VFS_OFFLOAD_READ_SEND/RECV */
/* Version 37 - Remove SMB_VFS_STRICT_UNLOCK */
+/* Version 37 - Rename SMB_VFS_STRICT_LOCK to
+ SMB_VFS_STRICT_LOCK_CHECK */
#define SMB_VFS_INTERFACE_VERSION 37
struct byte_range_lock *br_lck,
struct lock_struct *plock);
- bool (*strict_lock_fn)(struct vfs_handle_struct *handle,
- struct files_struct *fsp,
- struct lock_struct *plock);
+ bool (*strict_lock_check_fn)(struct vfs_handle_struct *handle,
+ struct files_struct *fsp,
+ struct lock_struct *plock);
NTSTATUS (*translate_name_fn)(struct vfs_handle_struct *handle,
const char *name,
bool smb_vfs_call_brl_cancel_windows(struct vfs_handle_struct *handle,
struct byte_range_lock *br_lck,
struct lock_struct *plock);
-bool smb_vfs_call_strict_lock(struct vfs_handle_struct *handle,
- struct files_struct *fsp,
- struct lock_struct *plock);
+bool smb_vfs_call_strict_lock_check(struct vfs_handle_struct *handle,
+ struct files_struct *fsp,
+ struct lock_struct *plock);
NTSTATUS smb_vfs_call_translate_name(struct vfs_handle_struct *handle,
const char *name,
enum vfs_translate_direction direction,
#define SMB_VFS_NEXT_BRL_CANCEL_WINDOWS(handle, br_lck, plock) \
smb_vfs_call_brl_cancel_windows((handle)->next, (br_lck), (plock))
-#define SMB_VFS_STRICT_LOCK(conn, fsp, plock) \
- smb_vfs_call_strict_lock((conn)->vfs_handles, (fsp), (plock))
-#define SMB_VFS_NEXT_STRICT_LOCK(handle, fsp, plock) \
- smb_vfs_call_strict_lock((handle)->next, (fsp), (plock))
+#define SMB_VFS_STRICT_LOCK_CHECK(conn, fsp, plock) \
+ smb_vfs_call_strict_lock_check((conn)->vfs_handles, (fsp), (plock))
+#define SMB_VFS_NEXT_STRICT_LOCK_CHECK(handle, fsp, plock) \
+ smb_vfs_call_strict_lock_check((handle)->next, (fsp), (plock))
#define SMB_VFS_TRANSLATE_NAME(conn, name, direction, mem_ctx, mapped_name) \
smb_vfs_call_translate_name((conn)->vfs_handles, (name), (direction), (mem_ctx), (mapped_name))
plock->lock_flav = lp_posix_cifsu_locktype(fsp);
}
-bool strict_lock_default(files_struct *fsp, struct lock_struct *plock)
+bool strict_lock_check_default(files_struct *fsp, struct lock_struct *plock)
{
struct byte_range_lock *br_lck;
int strict_locking = lp_strict_locking(fsp->conn->params);
br_off size,
enum brl_type lock_type,
struct lock_struct *plock);
-bool strict_lock_default(files_struct *fsp,
- struct lock_struct *plock);
+bool strict_lock_check_default(files_struct *fsp,
+ struct lock_struct *plock);
NTSTATUS query_lock(files_struct *fsp,
uint64_t *psmblctx,
uint64_t *pcount,
WRITE_LOCK,
&dest_lck);
- if (!SMB_VFS_STRICT_LOCK(src_fsp->conn, src_fsp, &src_lck)) {
+ if (!SMB_VFS_STRICT_LOCK_CHECK(src_fsp->conn, src_fsp, &src_lck)) {
tevent_req_nterror(req, NT_STATUS_FILE_LOCK_CONFLICT);
return tevent_req_post(req, ev);
}
- if (!SMB_VFS_STRICT_LOCK(dest_fsp->conn, dest_fsp, &dest_lck)) {
+ if (!SMB_VFS_STRICT_LOCK_CHECK(dest_fsp->conn, dest_fsp, &dest_lck)) {
tevent_req_nterror(req, NT_STATUS_FILE_LOCK_CONFLICT);
return tevent_req_post(req, ev);
}
return ok;
}
-static bool catia_strict_lock(struct vfs_handle_struct *handle,
- struct files_struct *fsp,
- struct lock_struct *plock)
+static bool catia_strict_lock_check(struct vfs_handle_struct *handle,
+ struct files_struct *fsp,
+ struct lock_struct *plock)
{
struct catia_cache *cc = NULL;
int ret;
return -1;
}
- ok = SMB_VFS_NEXT_STRICT_LOCK(handle, fsp, plock);
+ ok = SMB_VFS_NEXT_STRICT_LOCK_CHECK(handle, fsp, plock);
CATIA_FETCH_FSP_POST_NEXT(&cc, fsp);
.realpath_fn = catia_realpath,
.chflags_fn = catia_chflags,
.streaminfo_fn = catia_streaminfo,
- .strict_lock_fn = catia_strict_lock,
+ .strict_lock_check_fn = catia_strict_lock_check,
.translate_name_fn = catia_translate_name,
.fsctl_fn = catia_fsctl,
.get_dos_attributes_fn = catia_get_dos_attributes,
READ_LOCK,
&read_lck);
- ok = SMB_VFS_STRICT_LOCK(state->src_fsp->conn,
+ ok = SMB_VFS_STRICT_LOCK_CHECK(state->src_fsp->conn,
state->src_fsp,
&read_lck);
if (!ok) {
WRITE_LOCK,
&write_lck);
- ok = SMB_VFS_STRICT_LOCK(state->dst_fsp->conn,
+ ok = SMB_VFS_STRICT_LOCK_CHECK(state->dst_fsp->conn,
state->dst_fsp,
&write_lck);
if (!ok) {
return brl_lock_cancel_default(br_lck, plock);
}
-static bool vfswrap_strict_lock(struct vfs_handle_struct *handle,
- files_struct *fsp,
- struct lock_struct *plock)
+static bool vfswrap_strict_lock_check(struct vfs_handle_struct *handle,
+ files_struct *fsp,
+ struct lock_struct *plock)
{
SMB_ASSERT(plock->lock_type == READ_LOCK ||
plock->lock_type == WRITE_LOCK);
- return strict_lock_default(fsp, plock);
+ return strict_lock_check_default(fsp, plock);
}
/* NT ACL operations. */
.brl_lock_windows_fn = vfswrap_brl_lock_windows,
.brl_unlock_windows_fn = vfswrap_brl_unlock_windows,
.brl_cancel_windows_fn = vfswrap_brl_cancel_windows,
- .strict_lock_fn = vfswrap_strict_lock,
+ .strict_lock_check_fn = vfswrap_strict_lock_check,
.translate_name_fn = vfswrap_translate_name,
.fsctl_fn = vfswrap_fsctl,
.set_dos_attributes_fn = vfswrap_set_dos_attributes,
SMB_VFS_OP_BRL_LOCK_WINDOWS,
SMB_VFS_OP_BRL_UNLOCK_WINDOWS,
SMB_VFS_OP_BRL_CANCEL_WINDOWS,
- SMB_VFS_OP_STRICT_LOCK,
+ SMB_VFS_OP_STRICT_LOCK_CHECK,
SMB_VFS_OP_TRANSLATE_NAME,
SMB_VFS_OP_FSCTL,
SMB_VFS_OP_OFFLOAD_READ_SEND,
{ SMB_VFS_OP_BRL_LOCK_WINDOWS, "brl_lock_windows" },
{ SMB_VFS_OP_BRL_UNLOCK_WINDOWS, "brl_unlock_windows" },
{ SMB_VFS_OP_BRL_CANCEL_WINDOWS, "brl_cancel_windows" },
- { SMB_VFS_OP_STRICT_LOCK, "strict_lock" },
+ { SMB_VFS_OP_STRICT_LOCK_CHECK, "strict_lock_check" },
{ SMB_VFS_OP_TRANSLATE_NAME, "translate_name" },
{ SMB_VFS_OP_FSCTL, "fsctl" },
{ SMB_VFS_OP_OFFLOAD_READ_SEND, "offload_read_send" },
return result;
}
-static bool smb_full_audit_strict_lock(struct vfs_handle_struct *handle,
- struct files_struct *fsp,
- struct lock_struct *plock)
+static bool smb_full_audit_strict_lock_check(struct vfs_handle_struct *handle,
+ struct files_struct *fsp,
+ struct lock_struct *plock)
{
bool result;
- result = SMB_VFS_NEXT_STRICT_LOCK(handle, fsp, plock);
+ result = SMB_VFS_NEXT_STRICT_LOCK_CHECK(handle, fsp, plock);
- do_log(SMB_VFS_OP_STRICT_LOCK, result, handle,
+ do_log(SMB_VFS_OP_STRICT_LOCK_CHECK, result, handle,
"%s:%llu-%llu:%d", fsp_str_do_log(fsp), plock->start,
plock->size, plock->lock_type);
.brl_lock_windows_fn = smb_full_audit_brl_lock_windows,
.brl_unlock_windows_fn = smb_full_audit_brl_unlock_windows,
.brl_cancel_windows_fn = smb_full_audit_brl_cancel_windows,
- .strict_lock_fn = smb_full_audit_strict_lock,
+ .strict_lock_check_fn = smb_full_audit_strict_lock_check,
.translate_name_fn = smb_full_audit_translate_name,
.fsctl_fn = smb_full_audit_fsctl,
.get_dos_attributes_fn = smb_full_audit_get_dos_attributes,
.brl_lock_windows_fn = NULL,
.brl_unlock_windows_fn = NULL,
.brl_cancel_windows_fn = NULL,
- .strict_lock_fn = NULL,
+ .strict_lock_check_fn = NULL,
.translate_name_fn = NULL,
.fsctl_fn = NULL,
return result;
}
-static bool smb_time_audit_strict_lock(struct vfs_handle_struct *handle,
- struct files_struct *fsp,
- struct lock_struct *plock)
+static bool smb_time_audit_strict_lock_check(struct vfs_handle_struct *handle,
+ struct files_struct *fsp,
+ struct lock_struct *plock)
{
bool result;
struct timespec ts1,ts2;
double timediff;
clock_gettime_mono(&ts1);
- result = SMB_VFS_NEXT_STRICT_LOCK(handle, fsp, plock);
+ result = SMB_VFS_NEXT_STRICT_LOCK_CHECK(handle, fsp, plock);
clock_gettime_mono(&ts2);
timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
if (timediff > audit_timeout) {
- smb_time_audit_log_fsp("strict_lock", timediff, fsp);
+ smb_time_audit_log_fsp("strict_lock_check", timediff, fsp);
}
return result;
.brl_lock_windows_fn = smb_time_audit_brl_lock_windows,
.brl_unlock_windows_fn = smb_time_audit_brl_unlock_windows,
.brl_cancel_windows_fn = smb_time_audit_brl_cancel_windows,
- .strict_lock_fn = smb_time_audit_strict_lock,
+ .strict_lock_check_fn = smb_time_audit_strict_lock_check,
.translate_name_fn = smb_time_audit_translate_name,
.fsctl_fn = smb_time_audit_fsctl,
.get_dos_attributes_fn = smb_time_get_dos_attributes,
&aio_ex->lock);
/* Take the lock until the AIO completes. */
- if (!SMB_VFS_STRICT_LOCK(conn, fsp, &aio_ex->lock)) {
+ if (!SMB_VFS_STRICT_LOCK_CHECK(conn, fsp, &aio_ex->lock)) {
TALLOC_FREE(aio_ex);
return NT_STATUS_FILE_LOCK_CONFLICT;
}
&aio_ex->lock);
/* Take the lock until the AIO completes. */
- if (!SMB_VFS_STRICT_LOCK(conn, fsp, &aio_ex->lock)) {
+ if (!SMB_VFS_STRICT_LOCK_CHECK(conn, fsp, &aio_ex->lock)) {
TALLOC_FREE(aio_ex);
return NT_STATUS_FILE_LOCK_CONFLICT;
}
&aio_ex->lock);
/* Take the lock until the AIO completes. */
- if (!SMB_VFS_STRICT_LOCK(conn, fsp, &aio_ex->lock)) {
+ if (!SMB_VFS_STRICT_LOCK_CHECK(conn, fsp, &aio_ex->lock)) {
TALLOC_FREE(aio_ex);
return NT_STATUS_FILE_LOCK_CONFLICT;
}
&aio_ex->lock);
/* Take the lock until the AIO completes. */
- if (!SMB_VFS_STRICT_LOCK(conn, fsp, &aio_ex->lock)) {
+ if (!SMB_VFS_STRICT_LOCK_CHECK(conn, fsp, &aio_ex->lock)) {
TALLOC_FREE(aio_ex);
return NT_STATUS_FILE_LOCK_CONFLICT;
}
(uint64_t)startpos, (uint64_t)maxcount, READ_LOCK,
&lock);
- if (!SMB_VFS_STRICT_LOCK(conn, fsp, &lock)) {
+ if (!SMB_VFS_STRICT_LOCK_CHECK(conn, fsp, &lock)) {
reply_readbraw_error(xconn);
END_PROFILE(SMBreadbraw);
return;
(uint64_t)startpos, (uint64_t)numtoread, READ_LOCK,
&lock);
- if (!SMB_VFS_STRICT_LOCK(conn, fsp, &lock)) {
+ if (!SMB_VFS_STRICT_LOCK_CHECK(conn, fsp, &lock)) {
reply_nterror(req, NT_STATUS_FILE_LOCK_CONFLICT);
END_PROFILE(SMBread);
return;
(uint64_t)startpos, (uint64_t)smb_maxcnt, READ_LOCK,
&lock);
- if (!SMB_VFS_STRICT_LOCK(conn, fsp, &lock)) {
+ if (!SMB_VFS_STRICT_LOCK_CHECK(conn, fsp, &lock)) {
reply_nterror(req, NT_STATUS_FILE_LOCK_CONFLICT);
return;
}
(uint64_t)startpos, (uint64_t)tcount, WRITE_LOCK,
&lock);
- if (!SMB_VFS_STRICT_LOCK(conn, fsp, &lock)) {
+ if (!SMB_VFS_STRICT_LOCK_CHECK(conn, fsp, &lock)) {
reply_nterror(req, NT_STATUS_FILE_LOCK_CONFLICT);
error_to_writebrawerr(req);
END_PROFILE(SMBwritebraw);
(uint64_t)startpos, (uint64_t)numtowrite, WRITE_LOCK,
&lock);
- if (!SMB_VFS_STRICT_LOCK(conn, fsp, &lock)) {
+ if (!SMB_VFS_STRICT_LOCK_CHECK(conn, fsp, &lock)) {
reply_nterror(req, NT_STATUS_FILE_LOCK_CONFLICT);
END_PROFILE(SMBwriteunlock);
return;
(uint64_t)startpos, (uint64_t)numtowrite, WRITE_LOCK,
&lock);
- if (!SMB_VFS_STRICT_LOCK(conn, fsp, &lock)) {
+ if (!SMB_VFS_STRICT_LOCK_CHECK(conn, fsp, &lock)) {
reply_nterror(req, NT_STATUS_FILE_LOCK_CONFLICT);
END_PROFILE(SMBwrite);
return;
(uint64_t)startpos, (uint64_t)numtowrite, WRITE_LOCK,
&lock);
- if (!SMB_VFS_STRICT_LOCK(conn, fsp, &lock)) {
+ if (!SMB_VFS_STRICT_LOCK_CHECK(conn, fsp, &lock)) {
reply_nterror(req, NT_STATUS_FILE_LOCK_CONFLICT);
goto out;
}
(uint64_t)startpos, (uint64_t)numtowrite, WRITE_LOCK,
&lock);
- if (!SMB_VFS_STRICT_LOCK(conn, fsp, &lock)) {
+ if (!SMB_VFS_STRICT_LOCK_CHECK(conn, fsp, &lock)) {
reply_nterror(req, NT_STATUS_FILE_LOCK_CONFLICT);
END_PROFILE(SMBwriteclose);
return;
WRITE_LOCK,
&lck);
- if (!SMB_VFS_STRICT_LOCK(fsp->conn, fsp, &lck)) {
+ if (!SMB_VFS_STRICT_LOCK_CHECK(fsp->conn, fsp, &lck)) {
DEBUG(2, ("failed to lock range for zero-data\n"));
return NT_STATUS_FILE_LOCK_CONFLICT;
}
READ_LOCK,
&lock);
- if (!SMB_VFS_STRICT_LOCK(conn, fsp, &lock)) {
+ if (!SMB_VFS_STRICT_LOCK_CHECK(conn, fsp, &lock)) {
tevent_req_nterror(req, NT_STATUS_FILE_LOCK_CONFLICT);
return tevent_req_post(req, ev);
}
WRITE_LOCK,
&lock);
- if (!SMB_VFS_STRICT_LOCK(conn, fsp, &lock)) {
+ if (!SMB_VFS_STRICT_LOCK_CHECK(conn, fsp, &lock)) {
tevent_req_nterror(req, NT_STATUS_FILE_LOCK_CONFLICT);
return tevent_req_post(req, ev);
}
return handle->fns->connectpath_fn(handle, smb_fname);
}
-bool smb_vfs_call_strict_lock(struct vfs_handle_struct *handle,
- struct files_struct *fsp,
- struct lock_struct *plock)
+bool smb_vfs_call_strict_lock_check(struct vfs_handle_struct *handle,
+ struct files_struct *fsp,
+ struct lock_struct *plock)
{
- VFS_FIND(strict_lock);
- return handle->fns->strict_lock_fn(handle, fsp, plock);
+ VFS_FIND(strict_lock_check);
+ return handle->fns->strict_lock_check_fn(handle, fsp, plock);
}
NTSTATUS smb_vfs_call_translate_name(struct vfs_handle_struct *handle,