s3:smbd: move global notify_changes_by_mid to smbd_server_connection
authorStefan Metzmacher <metze@samba.org>
Tue, 30 Jun 2009 08:17:38 +0000 (10:17 +0200)
committerStefan Metzmacher <metze@samba.org>
Thu, 2 Jul 2009 07:10:58 +0000 (09:10 +0200)
metze

source3/smbd/globals.c
source3/smbd/globals.h
source3/smbd/notify.c

index 2e1b5c8593c11946203dbed91119b32f30cc8c98..15550ed455e43679c26c3ec9659b7e914e900b64 100644 (file)
@@ -134,8 +134,6 @@ int32_t level_II_oplocks_open = 0;
 bool global_client_failed_oplock_break = false;
 struct kernel_oplocks *koplocks = NULL;
 
-struct notify_mid_map *notify_changes_by_mid = NULL;
-
 int am_parent = 1;
 int server_fd = -1;
 struct event_context *smbd_event_ctx = NULL;
index 5e9da66540b0e4ced80a014ec68eb6335d58b5a7..e1a95ced605d0d4ff471e35744bf77f5d83f5f5a 100644 (file)
@@ -144,8 +144,6 @@ extern int32_t level_II_oplocks_open;
 extern bool global_client_failed_oplock_break;
 extern struct kernel_oplocks *koplocks;
 
-extern struct notify_mid_map *notify_changes_by_mid;
-
 extern int am_parent;
 extern int server_fd;
 extern struct event_context *smbd_event_ctx;
@@ -376,6 +374,8 @@ struct smbd_server_connection {
                struct smb_signing_state *signing_state;
                /* List to store partial SPNEGO auth fragments. */
                struct pending_auth_data *pd_list;
+
+               struct notify_mid_map *notify_mid_maps;
        } smb1;
        struct {
                struct tevent_context *event_ctx;
index a242fc3ac03d3517cc28c6108347769d86740285..94544271fe62c32360c0887c36e9ee866a63d17e 100644 (file)
@@ -238,6 +238,7 @@ NTSTATUS change_notify_add_request(struct smb_request *req,
 {
        struct notify_change_request *request = NULL;
        struct notify_mid_map *map = NULL;
+       struct smbd_server_connection *sconn = smbd_server_conn;
 
        DEBUG(10, ("change_notify_add_request: Adding request for %s: "
                   "max_param = %d\n", fsp->fsp_name, (int)max_param));
@@ -261,7 +262,7 @@ NTSTATUS change_notify_add_request(struct smb_request *req,
                      struct notify_change_request *);
 
        map->mid = request->req->mid;
-       DLIST_ADD(notify_changes_by_mid, map);
+       DLIST_ADD(sconn->smb1.notify_mid_maps, map);
 
        return NT_STATUS_OK;
 }
@@ -270,6 +271,7 @@ static void change_notify_remove_request(struct notify_change_request *remove_re
 {
        files_struct *fsp;
        struct notify_change_request *req;
+       struct smbd_server_connection *sconn = smbd_server_conn;
 
        /*
         * Paranoia checks, the fsp referenced must must have the request in
@@ -290,7 +292,7 @@ static void change_notify_remove_request(struct notify_change_request *remove_re
        }
 
        DLIST_REMOVE(fsp->notify->requests, req);
-       DLIST_REMOVE(notify_changes_by_mid, req->mid_map);
+       DLIST_REMOVE(sconn->smb1.notify_mid_maps, req->mid_map);
        TALLOC_FREE(req);
 }
 
@@ -301,8 +303,9 @@ static void change_notify_remove_request(struct notify_change_request *remove_re
 void remove_pending_change_notify_requests_by_mid(uint16 mid)
 {
        struct notify_mid_map *map;
+       struct smbd_server_connection *sconn = smbd_server_conn;
 
-       for (map = notify_changes_by_mid; map; map = map->next) {
+       for (map = sconn->smb1.notify_mid_maps; map; map = map->next) {
                if (map->mid == mid) {
                        break;
                }