Changeset 740 for vendor/current/source3/smbd/globals.c
- Timestamp:
- Nov 14, 2012, 12:59:34 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/source3/smbd/globals.c
r414 r740 19 19 20 20 #include "includes.h" 21 #include "smbd/smbd.h" 21 22 #include "smbd/globals.h" 23 #include "memcache.h" 24 #include "messages.h" 25 #include <tdb.h> 22 26 23 27 #if defined(WITH_AIO) … … 27 31 int outstanding_aio_calls = 0; 28 32 #endif 29 30 /* dlink list we store pending lock records on. */31 struct blocking_lock_record *blocking_lock_queue = NULL;32 33 /* dlink list we move cancelled lock records onto. */34 struct blocking_lock_record *blocking_lock_cancelled_queue = NULL;35 36 /* The event that makes us process our blocking lock queue */37 struct timed_event *brl_timeout = NULL;38 39 bool blocking_lock_unlock_state = false;40 bool blocking_lock_cancel_state = false;41 33 42 34 #ifdef USE_DMAPI … … 50 42 unsigned int allocated_write_caches = 0; 51 43 52 int real_max_open_files = 0;53 struct bitmap *file_bmap = NULL;54 files_struct *Files = NULL;55 int files_used = 0;56 struct fsp_singleton_cache fsp_fi_cache = {57 .fsp = NULL,58 .id = {59 .devid = 0,60 .inode = 0,61 .extid = 062 }63 };64 unsigned long file_gen_counter = 0;65 int first_file = 0;66 67 44 const struct mangle_fns *mangle_fns = NULL; 68 45 … … 70 47 TDB_CONTEXT *tdb_mangled_cache = NULL; 71 48 72 /* these tables are used to provide fast tests for characters */73 unsigned char char_flags[256];74 49 /* 75 50 this determines how many characters are used from the original filename … … 78 53 */ 79 54 unsigned mangle_prefix = 0; 80 unsigned char base_reverse[256];81 82 char *last_from = NULL;83 char *last_to = NULL;84 55 85 56 struct msg_state *smbd_msg_state = NULL; … … 87 58 bool logged_ioctl_message = false; 88 59 89 int trans_num = 0;90 pid_t mypid = 0;91 60 time_t last_smb_conf_reload_time = 0; 92 61 time_t last_printer_reload_time = 0; … … 111 80 uint16_t last_flags = 0; 112 81 113 struct db_context *session_db_ctx_ptr = NULL;114 115 82 uint32_t global_client_caps = 0; 116 83 … … 128 95 int32_t exclusive_oplocks_open = 0; 129 96 int32_t level_II_oplocks_open = 0; 130 bool global_client_failed_oplock_break = false;131 97 struct kernel_oplocks *koplocks = NULL; 132 98 133 99 int am_parent = 1; 134 int server_fd = -1;135 struct event_context *smbd_event_ctx = NULL;136 struct messaging_context *smbd_msg_ctx = NULL;137 100 struct memcache *smbd_memcache_ctx = NULL; 138 101 bool exit_firsttime = true; … … 142 105 struct smbd_server_connection *smbd_server_conn = NULL; 143 106 107 struct smbd_server_connection *msg_ctx_to_sconn(struct messaging_context *msg_ctx) 108 { 109 struct server_id my_id, msg_id; 110 111 my_id = messaging_server_id(smbd_server_conn->msg_ctx); 112 msg_id = messaging_server_id(msg_ctx); 113 114 if (!procid_equal(&my_id, &msg_id)) { 115 return NULL; 116 } 117 return smbd_server_conn; 118 } 119 120 struct messaging_context *smbd_messaging_context(void) 121 { 122 struct messaging_context *msg_ctx = server_messaging_context(); 123 if (likely(msg_ctx != NULL)) { 124 return msg_ctx; 125 } 126 smb_panic("Could not init smbd's messaging context.\n"); 127 return NULL; 128 } 129 130 struct memcache *smbd_memcache(void) 131 { 132 if (!smbd_memcache_ctx) { 133 /* 134 * Note we MUST use the NULL context here, not the 135 * autofree context, to avoid side effects in forked 136 * children exiting. 137 */ 138 smbd_memcache_ctx = memcache_init(NULL, 139 lp_max_stat_cache_size()*1024); 140 } 141 if (!smbd_memcache_ctx) { 142 smb_panic("Could not init smbd memcache"); 143 } 144 145 return smbd_memcache_ctx; 146 } 147 148 144 149 void smbd_init_globals(void) 145 150 { 146 ZERO_STRUCT(char_flags);147 ZERO_STRUCT(base_reverse);148 149 151 ZERO_STRUCT(conn_ctx_stack); 150 152 … … 155 157 exit_server("failed to create smbd_server_connection"); 156 158 } 159 160 smbd_server_conn->smb1.echo_handler.trusted_fd = -1; 161 smbd_server_conn->smb1.echo_handler.socket_lock_fd = -1; 157 162 }
Note:
See TracChangeset
for help on using the changeset viewer.