mirror of
https://github.com/samba-team/samba.git
synced 2025-02-23 09:57:40 +03:00
smbd: move files_struct.closing to a bitfield
Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
parent
e940a41c2b
commit
16a485d1be
@ -373,6 +373,7 @@ typedef struct files_struct {
|
||||
bool is_sparse : 1;
|
||||
bool backup_intent : 1;
|
||||
bool use_ofd_locks : 1;
|
||||
bool closing : 1;
|
||||
} fsp_flags;
|
||||
|
||||
struct tevent_timer *update_write_time_event;
|
||||
@ -430,7 +431,6 @@ typedef struct files_struct {
|
||||
*/
|
||||
unsigned num_aio_requests;
|
||||
struct tevent_req **aio_requests;
|
||||
bool closing;
|
||||
|
||||
/*
|
||||
* Requests waiting for smb1 byte range locks. They are
|
||||
|
@ -270,12 +270,12 @@ NTSTATUS vfs_offload_token_check_handles(uint32_t fsctl,
|
||||
return NT_STATUS_ACCESS_DENIED;
|
||||
}
|
||||
|
||||
if (src_fsp->closing) {
|
||||
if (src_fsp->fsp_flags.closing) {
|
||||
DBG_INFO("copy chunk src handle with closing in progress.\n");
|
||||
return NT_STATUS_ACCESS_DENIED;
|
||||
}
|
||||
|
||||
if (dst_fsp->closing) {
|
||||
if (dst_fsp->fsp_flags.closing) {
|
||||
DBG_INFO("copy chunk dst handle with closing in progress.\n");
|
||||
return NT_STATUS_ACCESS_DENIED;
|
||||
}
|
||||
|
@ -174,7 +174,7 @@ static struct tevent_req *conn_force_tdis_send(connection_struct *conn)
|
||||
* done on it. Not strictly needed, but
|
||||
* doesn't hurt to flag it as closing.
|
||||
*/
|
||||
fsp->closing = true;
|
||||
fsp->fsp_flags.closing = true;
|
||||
|
||||
if (fsp->num_aio_requests > 0) {
|
||||
/*
|
||||
|
@ -663,7 +663,7 @@ files_struct *file_fsp(struct smb_request *req, uint16_t fid)
|
||||
}
|
||||
|
||||
if (req->chain_fsp != NULL) {
|
||||
if (req->chain_fsp->closing) {
|
||||
if (req->chain_fsp->fsp_flags.closing) {
|
||||
return NULL;
|
||||
}
|
||||
return req->chain_fsp;
|
||||
@ -686,7 +686,7 @@ files_struct *file_fsp(struct smb_request *req, uint16_t fid)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (fsp->closing) {
|
||||
if (fsp->fsp_flags.closing) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -733,7 +733,7 @@ struct files_struct *file_fsp_get(struct smbd_smb2_request *smb2req,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (fsp->closing) {
|
||||
if (fsp->fsp_flags.closing) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -747,7 +747,7 @@ struct files_struct *file_fsp_smb2(struct smbd_smb2_request *smb2req,
|
||||
struct files_struct *fsp;
|
||||
|
||||
if (smb2req->compat_chain_fsp != NULL) {
|
||||
if (smb2req->compat_chain_fsp->closing) {
|
||||
if (smb2req->compat_chain_fsp->fsp_flags.closing) {
|
||||
return NULL;
|
||||
}
|
||||
return smb2req->compat_chain_fsp;
|
||||
|
@ -2712,7 +2712,7 @@ static struct tevent_req *reply_ulogoffX_send(struct smb_request *smb1req,
|
||||
* This will prevent any more IO being
|
||||
* done on it.
|
||||
*/
|
||||
fsp->closing = true;
|
||||
fsp->fsp_flags.closing = true;
|
||||
|
||||
if (fsp->num_aio_requests > 0) {
|
||||
/*
|
||||
@ -5847,7 +5847,7 @@ static struct tevent_req *reply_exit_send(struct smb_request *smb1req)
|
||||
* This will prevent any more IO being
|
||||
* done on it.
|
||||
*/
|
||||
fsp->closing = true;
|
||||
fsp->fsp_flags.closing = true;
|
||||
|
||||
if (fsp->num_aio_requests > 0) {
|
||||
/*
|
||||
@ -5974,7 +5974,7 @@ static void reply_exit_done(struct tevent_req *req)
|
||||
if (fsp->vuid != smb1req->vuid) {
|
||||
continue;
|
||||
}
|
||||
if (!fsp->closing) {
|
||||
if (!fsp->fsp_flags.closing) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -6119,7 +6119,7 @@ static struct tevent_req *reply_close_send(struct smb_request *smb1req,
|
||||
* This will prevent any more IO being
|
||||
* done on it.
|
||||
*/
|
||||
fsp->closing = true;
|
||||
fsp->fsp_flags.closing = true;
|
||||
|
||||
/*
|
||||
* Now wait until all aio requests on this fsp are
|
||||
@ -6564,7 +6564,7 @@ static struct tevent_req *reply_tdis_send(struct smb_request *smb1req)
|
||||
* done on it. Not strictly needed, but
|
||||
* doesn't hurt to flag it as closing.
|
||||
*/
|
||||
fsp->closing = true;
|
||||
fsp->fsp_flags.closing = true;
|
||||
|
||||
if (fsp->num_aio_requests > 0) {
|
||||
/*
|
||||
|
@ -327,7 +327,7 @@ static struct tevent_req *smbd_smb2_close_send(TALLOC_CTX *mem_ctx,
|
||||
state->in_fsp = in_fsp;
|
||||
state->in_flags = in_flags;
|
||||
|
||||
in_fsp->closing = true;
|
||||
in_fsp->fsp_flags.closing = true;
|
||||
|
||||
i = 0;
|
||||
while (i < in_fsp->num_aio_requests) {
|
||||
|
@ -629,7 +629,7 @@ static bool smbd_smb2_lock_cancel(struct tevent_req *req)
|
||||
* the status is NT_STATUS_RANGE_NOT_LOCKED instead of
|
||||
* NT_STATUS_CANCELLED.
|
||||
*/
|
||||
if (state->fsp->closing ||
|
||||
if (state->fsp->fsp_flags.closing ||
|
||||
!NT_STATUS_IS_OK(smb2req->session->status) ||
|
||||
!NT_STATUS_IS_OK(smb2req->tcon->status)) {
|
||||
tevent_req_nterror(req, NT_STATUS_RANGE_NOT_LOCKED);
|
||||
|
Loading…
x
Reference in New Issue
Block a user