Ignore:
Timestamp:
Nov 14, 2012, 12:59:34 PM (13 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: update vendor to 3.6.0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vendor/current/source3/smbd/globals.c

    r414 r740  
    1919
    2020#include "includes.h"
     21#include "smbd/smbd.h"
    2122#include "smbd/globals.h"
     23#include "memcache.h"
     24#include "messages.h"
     25#include <tdb.h>
    2226
    2327#if defined(WITH_AIO)
     
    2731int outstanding_aio_calls = 0;
    2832#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;
    4133
    4234#ifdef USE_DMAPI
     
    5042unsigned int allocated_write_caches = 0;
    5143
    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 = 0
    62         }
    63 };
    64 unsigned long file_gen_counter = 0;
    65 int first_file = 0;
    66 
    6744const struct mangle_fns *mangle_fns = NULL;
    6845
     
    7047TDB_CONTEXT *tdb_mangled_cache = NULL;
    7148
    72 /* these tables are used to provide fast tests for characters */
    73 unsigned char char_flags[256];
    7449/*
    7550  this determines how many characters are used from the original filename
     
    7853*/
    7954unsigned mangle_prefix = 0;
    80 unsigned char base_reverse[256];
    81 
    82 char *last_from = NULL;
    83 char *last_to = NULL;
    8455
    8556struct msg_state *smbd_msg_state = NULL;
     
    8758bool logged_ioctl_message = false;
    8859
    89 int trans_num = 0;
    90 pid_t mypid = 0;
    9160time_t last_smb_conf_reload_time = 0;
    9261time_t last_printer_reload_time = 0;
     
    11180uint16_t last_flags = 0;
    11281
    113 struct db_context *session_db_ctx_ptr = NULL;
    114 
    11582uint32_t global_client_caps = 0;
    11683
     
    12895int32_t exclusive_oplocks_open = 0;
    12996int32_t level_II_oplocks_open = 0;
    130 bool global_client_failed_oplock_break = false;
    13197struct kernel_oplocks *koplocks = NULL;
    13298
    13399int am_parent = 1;
    134 int server_fd = -1;
    135 struct event_context *smbd_event_ctx = NULL;
    136 struct messaging_context *smbd_msg_ctx = NULL;
    137100struct memcache *smbd_memcache_ctx = NULL;
    138101bool exit_firsttime = true;
     
    142105struct smbd_server_connection *smbd_server_conn = NULL;
    143106
     107struct 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
     120struct 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
     130struct 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
    144149void smbd_init_globals(void)
    145150{
    146         ZERO_STRUCT(char_flags);
    147         ZERO_STRUCT(base_reverse);
    148 
    149151        ZERO_STRUCT(conn_ctx_stack);
    150152
     
    155157                exit_server("failed to create smbd_server_connection");
    156158        }
     159
     160        smbd_server_conn->smb1.echo_handler.trusted_fd = -1;
     161        smbd_server_conn->smb1.echo_handler.socket_lock_fd = -1;
    157162}
Note: See TracChangeset for help on using the changeset viewer.