/* how many write cache buffers have been allocated */
unsigned int allocated_write_caches = 0;
-int real_max_open_files = 0;
-struct bitmap *file_bmap = NULL;
-files_struct *Files = NULL;
-int files_used = 0;
-struct fsp_singleton_cache fsp_fi_cache = {
- .fsp = NULL,
- .id = {
- .devid = 0,
- .inode = 0,
- .extid = 0
- }
-};
-unsigned long file_gen_counter = 0;
-int first_file = 0;
-
const struct mangle_fns *mangle_fns = NULL;
unsigned char *chartest = NULL;
struct smbd_server_connection *smbd_server_conn = NULL;
+struct smbd_server_connection *msg_ctx_to_sconn(struct messaging_context *msg_ctx)
+{
+ struct server_id my_id, msg_id;
+
+ my_id = messaging_server_id(smbd_server_conn->msg_ctx);
+ msg_id = messaging_server_id(msg_ctx);
+
+ if (!procid_equal(&my_id, &msg_id)) {
+ return NULL;
+ }
+ return smbd_server_conn;
+}
+
struct messaging_context *smbd_messaging_context(void)
{
- return server_messaging_context();
+ struct messaging_context *msg_ctx = server_messaging_context();
+ if (likely(msg_ctx != NULL)) {
+ return msg_ctx;
+ }
+ smb_panic("Could not init smbd's messaging context.\n");
}
struct memcache *smbd_memcache(void)