s4:smbd: s/private/private_data
authorStefan Metzmacher <metze@samba.org>
Mon, 2 Feb 2009 07:41:28 +0000 (08:41 +0100)
committerStefan Metzmacher <metze@samba.org>
Mon, 2 Feb 2009 12:08:36 +0000 (13:08 +0100)
metze

source4/smbd/process_prefork.c
source4/smbd/process_single.c
source4/smbd/process_standard.c
source4/smbd/process_thread.c
source4/smbd/server.c
source4/smbd/service_named_pipe.c
source4/smbd/service_stream.c
source4/smbd/service_task.c

index ad8172d3a7d7898f8aaa24891d7c616e9b9078de..979a65482ececb4a2722c851769fb37e21926a4e 100644 (file)
@@ -74,7 +74,7 @@ static void prefork_accept_connection(struct tevent_context *ev,
                                       void (*new_conn)(struct tevent_context *,
                                                        struct loadparm_context *, struct socket_context *, 
                                                        struct server_id , void *), 
-                                      void *private)
+                                      void *private_data)
 {
        NTSTATUS status;
        struct socket_context *connected_socket;
@@ -86,9 +86,9 @@ static void prefork_accept_connection(struct tevent_context *ev,
                return;
        }
 
-       talloc_steal(private, connected_socket);
+       talloc_steal(private_data, connected_socket);
 
-       new_conn(ev, lp_ctx, connected_socket, cluster_id(pid, socket_get_fd(connected_socket)), private);
+       new_conn(ev, lp_ctx, connected_socket, cluster_id(pid, socket_get_fd(connected_socket)), private_data);
 }
 
 /*
@@ -98,7 +98,7 @@ static void prefork_new_task(struct tevent_context *ev,
                             struct loadparm_context *lp_ctx,
                             const char *service_name,
                             void (*new_task_fn)(struct tevent_context *, struct loadparm_context *lp_ctx, struct server_id , void *), 
-                            void *private)
+                            void *private_data)
 {
        pid_t pid;
        int i, num_children;
@@ -120,7 +120,7 @@ static void prefork_new_task(struct tevent_context *ev,
        /* the service has given us a private pointer that
           encapsulates the context it needs for this new connection -
           everything else will be freed */
-       talloc_steal(ev2, private);
+       talloc_steal(ev2, private_data);
 
        /* this will free all the listening sockets and all state that
           is not associated with this new connection */
@@ -131,7 +131,7 @@ static void prefork_new_task(struct tevent_context *ev,
        prefork_reload_after_fork();
 
        /* setup this new connection: process will bind to it's sockets etc */
-       new_task_fn(ev2, lp_ctx, cluster_id(pid, 0), private);
+       new_task_fn(ev2, lp_ctx, cluster_id(pid, 0), private_data);
 
        num_children = lp_parm_int(lp_ctx, NULL, "prefork children", service_name, 0);
        if (num_children == 0) {
index bb82c384d6666466eec03a3b07462cccc4965f7c..738ace95c7d29f163e34d53e2359157a94a0badf 100644 (file)
@@ -43,7 +43,7 @@ static void single_accept_connection(struct tevent_context *ev,
                                                      struct loadparm_context *,
                                                      struct socket_context *, 
                                                      struct server_id , void *), 
-                                    void *private)
+                                    void *private_data)
 {
        NTSTATUS status;
        struct socket_context *connected_socket;
@@ -67,12 +67,12 @@ static void single_accept_connection(struct tevent_context *ev,
                return;
        }
 
-       talloc_steal(private, connected_socket);
+       talloc_steal(private_data, connected_socket);
 
        /* The cluster_id(0, fd) cannot collide with the incrementing
         * task below, as the first component is 0, not 1 */
        new_conn(ev, lp_ctx, connected_socket, 
-                cluster_id(0, socket_get_fd(connected_socket)), private);
+                cluster_id(0, socket_get_fd(connected_socket)), private_data);
 }
 
 /*
@@ -82,7 +82,7 @@ static void single_new_task(struct tevent_context *ev,
                            struct loadparm_context *lp_ctx, 
                            const char *service_name,
                            void (*new_task)(struct tevent_context *, struct loadparm_context *, struct server_id, void *), 
-                           void *private)
+                           void *private_data)
 {
        static uint32_t taskid = 0;
        
@@ -90,7 +90,7 @@ static void single_new_task(struct tevent_context *ev,
         * in the accept connection above, and unlikly to collide with
         * PIDs from process modal standard (don't run samba as
         * init) */
-       new_task(ev, lp_ctx, cluster_id(1, taskid++), private);
+       new_task(ev, lp_ctx, cluster_id(1, taskid++), private_data);
 }
 
 
index b20adbfd1605e3ae2e50e2aee788d480ac774cac..137e0a7ce02c07e5a95ebd11fdb773e42331f55f 100644 (file)
@@ -61,7 +61,7 @@ static void standard_accept_connection(struct tevent_context *ev,
                                       void (*new_conn)(struct tevent_context *,
                                                        struct loadparm_context *, struct socket_context *, 
                                                        struct server_id , void *), 
-                                      void *private)
+                                      void *private_data)
 {
        NTSTATUS status;
        struct socket_context *sock2;
@@ -97,8 +97,8 @@ static void standard_accept_connection(struct tevent_context *ev,
        /* the service has given us a private pointer that
           encapsulates the context it needs for this new connection -
           everything else will be freed */
-       talloc_steal(ev2, private);
-       talloc_steal(private, sock2);
+       talloc_steal(ev2, private_data);
+       talloc_steal(private_data, sock2);
 
        /* this will free all the listening sockets and all state that
           is not associated with this new connection */
@@ -128,7 +128,7 @@ static void standard_accept_connection(struct tevent_context *ev,
        talloc_free(s);
 
        /* setup this new connection.  Cluster ID is PID based for this process modal */
-       new_conn(ev2, lp_ctx, sock2, cluster_id(pid, 0), private);
+       new_conn(ev2, lp_ctx, sock2, cluster_id(pid, 0), private_data);
 
        /* we can't return to the top level here, as that event context is gone,
           so we now process events in the new event context until there are no
@@ -146,7 +146,7 @@ static void standard_new_task(struct tevent_context *ev,
                              struct loadparm_context *lp_ctx,
                              const char *service_name,
                              void (*new_task)(struct tevent_context *, struct loadparm_context *lp_ctx, struct server_id , void *), 
-                             void *private)
+                             void *private_data)
 {
        pid_t pid;
        struct tevent_context *ev2;
@@ -166,7 +166,7 @@ static void standard_new_task(struct tevent_context *ev,
        /* the service has given us a private pointer that
           encapsulates the context it needs for this new connection -
           everything else will be freed */
-       talloc_steal(ev2, private);
+       talloc_steal(ev2, private_data);
 
        /* this will free all the listening sockets and all state that
           is not associated with this new connection */
@@ -183,7 +183,7 @@ static void standard_new_task(struct tevent_context *ev,
        setproctitle("task %s server_id[%d]", service_name, pid);
 
        /* setup this new task.  Cluster ID is PID based for this process modal */
-       new_task(ev2, lp_ctx, cluster_id(pid, 0), private);
+       new_task(ev2, lp_ctx, cluster_id(pid, 0), private_data);
 
        /* we can't return to the top level here, as that event context is gone,
           so we now process events in the new event context until there are no
index 3c3b6b287fb3ad4a0e47a7e2e0043a18c2b1f148..5be6374c1416315af12264fa3d0160fed97428d3 100644 (file)
@@ -41,14 +41,14 @@ struct new_conn_state {
        struct socket_context *sock;
        struct loadparm_context *lp_ctx;
        void (*new_conn)(struct tevent_context *, struct loadparm_context *lp_ctx, struct socket_context *, uint32_t , void *);
-       void *private;
+       void *private_data;
 };
 
 static void *thread_connection_fn(void *thread_parm)
 {
        struct new_conn_state *new_conn = talloc_get_type(thread_parm, struct new_conn_state);
 
-       new_conn->new_conn(new_conn->ev, new_conn->lp_ctx, new_conn->sock, pthread_self(), new_conn->private);
+       new_conn->new_conn(new_conn->ev, new_conn->lp_ctx, new_conn->sock, pthread_self(), new_conn->private_data);
 
        /* run this connection from here */
        event_loop_wait(new_conn->ev);
@@ -68,7 +68,7 @@ static void thread_accept_connection(struct tevent_context *ev,
                                                      struct loadparm_context *,
                                                      struct socket_context *, 
                                                      uint32_t , void *), 
-                                    void *private)
+                                    void *private_data)
 {              
        NTSTATUS status;
        int rc;
@@ -87,7 +87,7 @@ static void thread_accept_connection(struct tevent_context *ev,
        }
 
        state->new_conn = new_conn;
-       state->private  = private;
+       state->private_data  = private_data;
        state->lp_ctx   = lp_ctx;
        state->ev       = ev2;
 
@@ -125,7 +125,7 @@ struct new_task_state {
        struct loadparm_context *lp_ctx;
        void (*new_task)(struct tevent_context *, struct loadparm_context *, 
                         uint32_t , void *);
-       void *private;
+       void *private_data;
 };
 
 static void *thread_task_fn(void *thread_parm)
@@ -133,7 +133,7 @@ static void *thread_task_fn(void *thread_parm)
        struct new_task_state *new_task = talloc_get_type(thread_parm, struct new_task_state);
 
        new_task->new_task(new_task->ev, new_task->lp_ctx, pthread_self(), 
-                          new_task->private);
+                          new_task->private_data);
 
        /* run this connection from here */
        event_loop_wait(new_task->ev);
@@ -152,7 +152,7 @@ static void thread_new_task(struct tevent_context *ev,
                            void (*new_task)(struct tevent_context *, 
                                             struct loadparm_context *,
                                             uint32_t , void *), 
-                           void *private)
+                           void *private_data)
 {              
        int rc;
        pthread_t thread_id;
@@ -171,7 +171,7 @@ static void thread_new_task(struct tevent_context *ev,
 
        state->new_task = new_task;
        state->lp_ctx   = lp_ctx;
-       state->private  = private;
+       state->private_data  = private_data;
        state->ev       = ev2;
 
        pthread_attr_init(&thread_attr);
index df970661f17c9b161da632862d409515fcdb3b66..247a10f60f6734690b1aff238804eaff669a2e21 100644 (file)
@@ -149,9 +149,9 @@ static void setup_signals(void)
   handle io on stdin
 */
 static void server_stdin_handler(struct tevent_context *event_ctx, struct tevent_fd *fde, 
-                                uint16_t flags, void *private)
+                                uint16_t flags, void *private_data)
 {
-       const char *binary_name = (const char *)private;
+       const char *binary_name = (const char *)private_data;
        uint8_t c;
        if (read(0, &c, 1) == 0) {
                DEBUG(0,("%s: EOF on stdin - terminating\n", binary_name));
@@ -169,9 +169,9 @@ static void server_stdin_handler(struct tevent_context *event_ctx, struct tevent
 */
 _NORETURN_ static void max_runtime_handler(struct tevent_context *ev, 
                                           struct tevent_timer *te, 
-                                          struct timeval t, void *private)
+                                          struct timeval t, void *private_data)
 {
-       const char *binary_name = (const char *)private;
+       const char *binary_name = (const char *)private_data;
        DEBUG(0,("%s: maximum runtime exceeded - terminating\n", binary_name));
        exit(0);
 }
index e3c0908a150d7a0332dc7f3b80f858810172eafb..ffa4072392085e7d2c502c9936913c9d6a36bbc7 100644 (file)
@@ -238,7 +238,7 @@ static void named_pipe_recv_error(void *private_data, NTSTATUS status)
        stream_terminate_connection(pipe_conn->connection, nt_errstr(status));
 }
 
-static NTSTATUS named_pipe_full_request(void *private, DATA_BLOB blob, size_t *size)
+static NTSTATUS named_pipe_full_request(void *private_data, DATA_BLOB blob, size_t *size)
 {
        if (blob.length < 8) {
                return STATUS_MORE_ENTRIES;
index 6dff01f4f357163323e51e15328eadc4ddc074d2..fe07dc5a38ffc0c24fbce8ed07e47cb4ec59a547 100644 (file)
@@ -47,7 +47,7 @@ struct stream_socket {
        struct tevent_context *event_ctx;
        const struct model_ops *model_ops;
        struct socket_context *sock;
-       void *private;
+       void *private_data;
 };
 
 
@@ -101,16 +101,16 @@ static void stream_io_handler(struct stream_connection *conn, uint16_t flags)
 }
 
 static void stream_io_handler_fde(struct tevent_context *ev, struct tevent_fd *fde, 
-                                 uint16_t flags, void *private)
+                                 uint16_t flags, void *private_data)
 {
-       struct stream_connection *conn = talloc_get_type(private
+       struct stream_connection *conn = talloc_get_type(private_data,
                                                         struct stream_connection);
        stream_io_handler(conn, flags);
 }
 
-void stream_io_handler_callback(void *private, uint16_t flags) 
+void stream_io_handler_callback(void *private_data, uint16_t flags)
 {
-       struct stream_connection *conn = talloc_get_type(private
+       struct stream_connection *conn = talloc_get_type(private_data,
                                                         struct stream_connection);
        stream_io_handler(conn, flags);
 }
@@ -163,9 +163,9 @@ NTSTATUS stream_new_connection_merge(struct tevent_context *ev,
 static void stream_new_connection(struct tevent_context *ev,
                                  struct loadparm_context *lp_ctx,
                                  struct socket_context *sock, 
-                                 struct server_id server_id, void *private)
+                                 struct server_id server_id, void *private_data)
 {
-       struct stream_socket *stream_socket = talloc_get_type(private, struct stream_socket);
+       struct stream_socket *stream_socket = talloc_get_type(private_data, struct stream_socket);
        struct stream_connection *srv_conn;
        struct socket_address *c, *s;
 
@@ -177,7 +177,7 @@ static void stream_new_connection(struct tevent_context *ev,
 
        talloc_steal(srv_conn, sock);
 
-       srv_conn->private       = stream_socket->private;
+       srv_conn->private       = stream_socket->private_data;
        srv_conn->model_ops     = stream_socket->model_ops;
        srv_conn->socket        = sock;
        srv_conn->server_id     = server_id;
@@ -235,9 +235,9 @@ static void stream_new_connection(struct tevent_context *ev,
   called when someone opens a connection to one of our listening ports
 */
 static void stream_accept_handler(struct tevent_context *ev, struct tevent_fd *fde, 
-                                 uint16_t flags, void *private)
+                                 uint16_t flags, void *private_data)
 {
-       struct stream_socket *stream_socket = talloc_get_type(private, struct stream_socket);
+       struct stream_socket *stream_socket = talloc_get_type(private_data, struct stream_socket);
 
        /* ask the process model to create us a process for this new
           connection.  When done, it calls stream_new_connection()
@@ -263,7 +263,7 @@ NTSTATUS stream_setup_socket(struct tevent_context *event_context,
                             const char *sock_addr,
                             uint16_t *port,
                             const char *socket_options,
-                            void *private)
+                            void *private_data)
 {
        NTSTATUS status;
        struct stream_socket *stream_socket;
@@ -352,7 +352,7 @@ NTSTATUS stream_setup_socket(struct tevent_context *event_context,
        tevent_fd_set_close_fn(fde, socket_tevent_fd_close_fn);
        socket_set_flags(stream_socket->sock, SOCKET_FLAG_NOCLOSE);
 
-       stream_socket->private          = talloc_reference(stream_socket, private);
+       stream_socket->private_data     = talloc_reference(stream_socket, private_data);
        stream_socket->ops              = stream_ops;
        stream_socket->event_ctx        = event_context;
        stream_socket->model_ops        = model_ops;
index d3951a4a9ab8ecaedc8ea0972480d085a2c815be..c4fd3d4e982c51145d79d770c2087112fef5184c 100644 (file)
@@ -53,9 +53,9 @@ struct task_state {
 */
 static void task_server_callback(struct tevent_context *event_ctx, 
                                 struct loadparm_context *lp_ctx,
-                                struct server_id server_id, void *private)
+                                struct server_id server_id, void *private_data)
 {
-       struct task_state *state = talloc_get_type(private, struct task_state);
+       struct task_state *state = talloc_get_type(private_data, struct task_state);
        struct task_server *task;
 
        task = talloc(event_ctx, struct task_server);