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);
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)
{
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);
}
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)));
*/
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);
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);
}