1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-23 09:57:40 +03:00

smbd: move files_struct.use_ofd_locks to a bitfield

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Ralph Boehme 2020-04-03 08:02:23 +02:00 committed by Jeremy Allison
parent 34b4effc04
commit e940a41c2b
4 changed files with 6 additions and 6 deletions

View File

@ -372,6 +372,7 @@ typedef struct files_struct {
bool delete_on_close : 1;
bool is_sparse : 1;
bool backup_intent : 1;
bool use_ofd_locks : 1;
} fsp_flags;
struct tevent_timer *update_write_time_event;
@ -393,7 +394,6 @@ typedef struct files_struct {
int current_lock_count; /* Count the number of outstanding locks and pending locks. */
uint64_t posix_flags;
bool use_ofd_locks; /* Are we using open file description locks ? */
struct smb_filename *fsp_name;
uint32_t name_hash; /* Jenkins hash of full pathname. */
uint64_t mid; /* Mid of the operation that created us. */

View File

@ -585,7 +585,7 @@ int fd_close_posix(const struct files_struct *fsp)
if (!lp_locking(fsp->conn->params) ||
!lp_posix_locking(fsp->conn->params) ||
fsp->use_ofd_locks)
fsp->fsp_flags.use_ofd_locks)
{
/*
* No locking or POSIX to worry about or we are using POSIX

View File

@ -2730,7 +2730,7 @@ static bool vfswrap_lock(vfs_handle_struct *handle, files_struct *fsp, int op, o
START_PROFILE(syscall_fcntl_lock);
if (fsp->use_ofd_locks) {
if (fsp->fsp_flags.use_ofd_locks) {
op = map_process_lock_to_ofd_lock(op);
}
@ -2800,7 +2800,7 @@ static bool vfswrap_getlock(vfs_handle_struct *handle, files_struct *fsp, off_t
START_PROFILE(syscall_fcntl_getlock);
if (fsp->use_ofd_locks) {
if (fsp->fsp_flags.use_ofd_locks) {
op = map_process_lock_to_ofd_lock(op);
}

View File

@ -52,12 +52,12 @@ NTSTATUS fsp_new(struct connection_struct *conn, TALLOC_CTX *mem_ctx,
}
#if defined(HAVE_OFD_LOCKS)
fsp->use_ofd_locks = true;
fsp->fsp_flags.use_ofd_locks = true;
if (lp_parm_bool(SNUM(conn),
"smbd",
"force process locks",
false)) {
fsp->use_ofd_locks = false;
fsp->fsp_flags.use_ofd_locks = false;
}
#endif
fsp->fh->ref_count = 1;