1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

smbd: Factor out fsp_unbind_smb() from file_free()

For example, remove our entry from smbXsrv_open_global.tdb

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Volker Lendecke 2022-02-09 17:23:03 +01:00 committed by Jeremy Allison
parent 5f1ceead70
commit e751c6237b
2 changed files with 13 additions and 4 deletions

View File

@ -1224,11 +1224,11 @@ static void fsp_free(files_struct *fsp)
TALLOC_FREE(fsp);
}
void file_free(struct smb_request *req, files_struct *fsp)
/*
* Rundown of all smb-related sub-structures of an fsp
*/
void fsp_unbind_smb(struct smb_request *req, files_struct *fsp)
{
struct smbd_server_connection *sconn = fsp->conn->sconn;
uint64_t fnum = fsp->fnum;
if (fsp == fsp->conn->cwd_fsp) {
return;
}
@ -1269,6 +1269,14 @@ void file_free(struct smb_request *req, files_struct *fsp)
* pointers in the SMB2 request queue.
*/
remove_smb2_chained_fsp(fsp);
}
void file_free(struct smb_request *req, files_struct *fsp)
{
struct smbd_server_connection *sconn = fsp->conn->sconn;
uint64_t fnum = fsp->fnum;
fsp_unbind_smb(req, fsp);
/* Drop all remaining extensions. */
vfs_remove_all_fsp_extensions(fsp);

View File

@ -412,6 +412,7 @@ struct files_struct *file_find_one_fsp_from_lease_key(
struct smbd_server_connection *sconn,
const struct smb2_lease_key *lease_key);
bool file_find_subpath(files_struct *dir_fsp);
void fsp_unbind_smb(struct smb_request *req, files_struct *fsp);
void file_free(struct smb_request *req, files_struct *fsp);
files_struct *file_fsp(struct smb_request *req, uint16_t fid);
struct files_struct *file_fsp_get(struct smbd_smb2_request *smb2req,