mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
s3: Remove smbd_server_conn from files_forall
This commit is contained in:
parent
9fc9ff9bfa
commit
fb8686962a
@ -4756,6 +4756,7 @@ void file_close_pid(struct smbd_server_connection *sconn, uint16 smbpid,
|
||||
void file_init(void);
|
||||
void file_close_user(struct smbd_server_connection *sconn, int vuid);
|
||||
struct files_struct *files_forall(
|
||||
struct smbd_server_connection *sconn,
|
||||
struct files_struct *(*fn)(struct files_struct *fsp,
|
||||
void *private_data),
|
||||
void *private_data);
|
||||
|
@ -442,7 +442,8 @@ static struct files_struct *close_fsp_fd(struct files_struct *fsp,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static NTSTATUS create_aio_child(struct aio_child_list *children,
|
||||
static NTSTATUS create_aio_child(struct smbd_server_connection *sconn,
|
||||
struct aio_child_list *children,
|
||||
size_t map_size,
|
||||
struct aio_child **presult)
|
||||
{
|
||||
@ -480,7 +481,7 @@ static NTSTATUS create_aio_child(struct aio_child_list *children,
|
||||
if (result->pid == 0) {
|
||||
close(fdpair[0]);
|
||||
result->sockfd = fdpair[1];
|
||||
files_forall(close_fsp_fd, NULL);
|
||||
files_forall(sconn, close_fsp_fd, NULL);
|
||||
aio_child_loop(result->sockfd, result->map);
|
||||
}
|
||||
|
||||
@ -538,7 +539,8 @@ static NTSTATUS get_idle_child(struct vfs_handle_struct *handle,
|
||||
if (child == NULL) {
|
||||
DEBUG(10, ("no idle child found, creating new one\n"));
|
||||
|
||||
status = create_aio_child(children, 128*1024, &child);
|
||||
status = create_aio_child(handle->conn->sconn, children,
|
||||
128*1024, &child);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
DEBUG(10, ("create_aio_child failed: %s\n",
|
||||
nt_errstr(status)));
|
||||
|
@ -226,13 +226,14 @@ void file_close_user(struct smbd_server_connection *sconn, int vuid)
|
||||
*/
|
||||
|
||||
struct files_struct *files_forall(
|
||||
struct smbd_server_connection *sconn,
|
||||
struct files_struct *(*fn)(struct files_struct *fsp,
|
||||
void *private_data),
|
||||
void *private_data)
|
||||
{
|
||||
struct files_struct *fsp, *next;
|
||||
|
||||
for (fsp = smbd_server_conn->files; fsp; fsp = next) {
|
||||
for (fsp = sconn->files; fsp; fsp = next) {
|
||||
struct files_struct *ret;
|
||||
next = fsp->next;
|
||||
ret = fn(fsp, private_data);
|
||||
|
@ -78,12 +78,11 @@ static void exit_server_common(enum server_exit_reason how,
|
||||
TALLOC_FREE(sconn->smb1.negprot.auth_context);
|
||||
}
|
||||
|
||||
if (lp_log_writeable_files_on_exit()) {
|
||||
bool found = false;
|
||||
files_forall(log_writeable_file_fn, &found);
|
||||
}
|
||||
|
||||
if (sconn) {
|
||||
if (lp_log_writeable_files_on_exit()) {
|
||||
bool found = false;
|
||||
files_forall(sconn, log_writeable_file_fn, &found);
|
||||
}
|
||||
had_open_conn = conn_close_all(sconn);
|
||||
invalidate_all_vuids(sconn);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user