summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/include/proto.h1
-rw-r--r--source3/modules/vfs_aio_fork.c8
-rw-r--r--source3/smbd/files.c3
-rw-r--r--source3/smbd/server_exit.c9
4 files changed, 12 insertions, 9 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 2319020ad2..af25db66a1 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -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);
diff --git a/source3/modules/vfs_aio_fork.c b/source3/modules/vfs_aio_fork.c
index 02b1394216..90d06b10c1 100644
--- a/source3/modules/vfs_aio_fork.c
+++ b/source3/modules/vfs_aio_fork.c
@@ -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)));
diff --git a/source3/smbd/files.c b/source3/smbd/files.c
index a50bd950a5..5293529411 100644
--- a/source3/smbd/files.c
+++ b/source3/smbd/files.c
@@ -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);
diff --git a/source3/smbd/server_exit.c b/source3/smbd/server_exit.c
index 1a330994b8..9f2d6b3e9a 100644
--- a/source3/smbd/server_exit.c
+++ b/source3/smbd/server_exit.c
@@ -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);
}