diff options
author | Jeremy Allison <jra@samba.org> | 2001-09-06 23:07:20 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2001-09-06 23:07:20 +0000 |
commit | 1f1fcb7d61094b2c489f74a2444e3cb2168898fe (patch) | |
tree | 29ba0c1a8de169c822327d41c8180b92a619df3a | |
parent | 562f054b52c6725f30964ca89ff6a2fba9550cf1 (diff) | |
download | samba-1f1fcb7d61094b2c489f74a2444e3cb2168898fe.tar.gz samba-1f1fcb7d61094b2c489f74a2444e3cb2168898fe.tar.xz samba-1f1fcb7d61094b2c489f74a2444e3cb2168898fe.zip |
Ok - so Andrew was right :-) and we don't need USE_TDB_MMAP_FLAG if we
put the check in the right place.... :-).
Jeremy.
-rw-r--r-- | source/include/smb_macros.h | 1 | ||||
-rw-r--r-- | source/lib/messages.c | 2 | ||||
-rw-r--r-- | source/libsmb/unexpected.c | 4 | ||||
-rw-r--r-- | source/locking/brlock.c | 2 | ||||
-rw-r--r-- | source/locking/locking.c | 2 | ||||
-rw-r--r-- | source/passdb/pdb_tdb.c | 14 | ||||
-rw-r--r-- | source/passdb/secrets.c | 2 | ||||
-rw-r--r-- | source/printing/nt_printing.c | 6 | ||||
-rw-r--r-- | source/printing/printing.c | 2 | ||||
-rw-r--r-- | source/rpc_server/srv_srvsvc_nt.c | 2 | ||||
-rw-r--r-- | source/smbd/connection.c | 2 | ||||
-rw-r--r-- | source/smbd/session.c | 2 | ||||
-rw-r--r-- | source/utils/smbcontrol.c | 2 | ||||
-rw-r--r-- | source/utils/status.c | 2 | ||||
-rw-r--r-- | source/web/statuspage.c | 2 |
15 files changed, 23 insertions, 24 deletions
diff --git a/source/include/smb_macros.h b/source/include/smb_macros.h index 630f1dc2aa3..51f3c3c6e47 100644 --- a/source/include/smb_macros.h +++ b/source/include/smb_macros.h @@ -248,5 +248,4 @@ copy an IP address from one buffer to another #define vfs_chdir(conn,fname) ((conn)->vfs_ops.chdir((conn),dos_to_unix((fname),False))) -#define USE_TDB_MMAP_FLAG (!lp_use_mmap() ? TDB_NOMMAP : TDB_DEFAULT) #endif /* _SMB_MACROS_H */ diff --git a/source/lib/messages.c b/source/lib/messages.c index be2cc6e95cf..ac8ce7399bc 100644 --- a/source/lib/messages.c +++ b/source/lib/messages.c @@ -90,7 +90,7 @@ BOOL message_init(void) if (tdb) return True; tdb = tdb_open_log(lock_path("messages.tdb"), - 0, TDB_CLEAR_IF_FIRST|USE_TDB_MMAP_FLAG, + 0, TDB_CLEAR_IF_FIRST|TDB_DEFAULT, O_RDWR|O_CREAT,0600); if (!tdb) { diff --git a/source/libsmb/unexpected.c b/source/libsmb/unexpected.c index 8dfd0fa6e8a..8f115623a1c 100644 --- a/source/libsmb/unexpected.c +++ b/source/libsmb/unexpected.c @@ -50,7 +50,7 @@ void unexpected_packet(struct packet_struct *p) if (!tdbd) { tdbd = tdb_open_log(lock_path("unexpected.tdb"), 1, - TDB_CLEAR_IF_FIRST|USE_TDB_MMAP_FLAG, + TDB_CLEAR_IF_FIRST|TDB_DEFAULT, O_RDWR | O_CREAT, 0644); if (!tdbd) { DEBUG(0,("Failed to open unexpected.tdb\n")); @@ -151,7 +151,7 @@ struct packet_struct *receive_unexpected(enum packet_type packet_type, int id, { TDB_CONTEXT *tdb2; - tdb2 = tdb_open_log(lock_path("unexpected.tdb"), 0, USE_TDB_MMAP_FLAG, O_RDONLY, 0); + tdb2 = tdb_open_log(lock_path("unexpected.tdb"), 0, TDB_DEFAULT, O_RDONLY, 0); if (!tdb2) return NULL; matched_packet = NULL; diff --git a/source/locking/brlock.c b/source/locking/brlock.c index dc2f39e7d9b..7f91f664102 100644 --- a/source/locking/brlock.c +++ b/source/locking/brlock.c @@ -201,7 +201,7 @@ void brl_init(int read_only) if (tdb) return; - tdb = tdb_open_log(lock_path("brlock.tdb"), 0, USE_TDB_MMAP_FLAG|(read_only?0x0:TDB_CLEAR_IF_FIRST), + tdb = tdb_open_log(lock_path("brlock.tdb"), 0, TDB_DEFAULT|(read_only?0x0:TDB_CLEAR_IF_FIRST), read_only?O_RDONLY:(O_RDWR|O_CREAT), 0644); if (!tdb) { DEBUG(0,("Failed to open byte range locking database\n")); diff --git a/source/locking/locking.c b/source/locking/locking.c index 5d0a19c1a67..4dd1a198822 100644 --- a/source/locking/locking.c +++ b/source/locking/locking.c @@ -296,7 +296,7 @@ BOOL locking_init(int read_only) return True; tdb = tdb_open_log(lock_path("locking.tdb"), - 0, USE_TDB_MMAP_FLAG|(read_only?0x0:TDB_CLEAR_IF_FIRST), + 0, TDB_DEFAULT|(read_only?0x0:TDB_CLEAR_IF_FIRST), read_only?O_RDONLY:O_RDWR|O_CREAT, 0644); diff --git a/source/passdb/pdb_tdb.c b/source/passdb/pdb_tdb.c index fc19f279181..89d5139facf 100644 --- a/source/passdb/pdb_tdb.c +++ b/source/passdb/pdb_tdb.c @@ -344,10 +344,10 @@ BOOL pdb_setsampwent(BOOL update) pstrcat (tdbfile, PASSDB_FILE_NAME); /* Open tdb passwd */ - if (!(global_tdb_ent.passwd_tdb = tdb_open_log(tdbfile, 0, USE_TDB_MMAP_FLAG, update ? O_RDWR : O_RDONLY, 0600))) + if (!(global_tdb_ent.passwd_tdb = tdb_open_log(tdbfile, 0, TDB_DEFAULT, update ? O_RDWR : O_RDONLY, 0600))) { DEBUG(0, ("Unable to open TDB passwd, trying create new!\n")); - if (!(global_tdb_ent.passwd_tdb = tdb_open_log(tdbfile, 0, USE_TDB_MMAP_FLAG, O_RDWR | O_CREAT | O_EXCL, 0600))) + if (!(global_tdb_ent.passwd_tdb = tdb_open_log(tdbfile, 0, TDB_DEFAULT, O_RDWR | O_CREAT | O_EXCL, 0600))) { DEBUG(0, ("Unable to create TDB passwd (passdb.tdb) !!!")); return False; @@ -476,7 +476,7 @@ BOOL pdb_getsampwnam (SAM_ACCOUNT *user, char *sname) key.dsize = strlen (keystr) + 1; /* open the accounts TDB */ - if (!(pwd_tdb = tdb_open_log(tdbfile, 0, USE_TDB_MMAP_FLAG, O_RDONLY, 0600))) + if (!(pwd_tdb = tdb_open_log(tdbfile, 0, TDB_DEFAULT, O_RDONLY, 0600))) { DEBUG(0, ("pdb_getsampwnam: Unable to open TDB passwd!\n")); return False; @@ -577,7 +577,7 @@ BOOL pdb_getsampwrid (SAM_ACCOUNT *user, uint32 rid) key.dsize = strlen (keystr) + 1; /* open the accounts TDB */ - if (!(pwd_tdb = tdb_open_log(tdbfile, 0, USE_TDB_MMAP_FLAG, O_RDONLY, 0600))) + if (!(pwd_tdb = tdb_open_log(tdbfile, 0, TDB_DEFAULT, O_RDONLY, 0600))) { DEBUG(0, ("pdb_getsampwrid: Unable to open TDB rid database!\n")); return False; @@ -622,7 +622,7 @@ BOOL pdb_delete_sam_account(char *sname) pstrcat (tdbfile, PASSDB_FILE_NAME); /* open the TDB */ - if (!(pwd_tdb = tdb_open_log(tdbfile, 0, USE_TDB_MMAP_FLAG, O_RDWR, 0600))) + if (!(pwd_tdb = tdb_open_log(tdbfile, 0, TDB_DEFAULT, O_RDWR, 0600))) { DEBUG(0, ("Unable to open TDB passwd!")); return False; @@ -744,13 +744,13 @@ static BOOL tdb_update_sam(SAM_ACCOUNT* newpwd, BOOL override, int flag) } /* open the account TDB passwd*/ - if (!(pwd_tdb = tdb_open_log(tdbfile, 0, USE_TDB_MMAP_FLAG, O_RDWR, 0600))) + if (!(pwd_tdb = tdb_open_log(tdbfile, 0, TDB_DEFAULT, O_RDWR, 0600))) { DEBUG(0, ("tdb_update_sam: Unable to open TDB passwd!\n")); if (flag == TDB_INSERT) { DEBUG(0, ("Unable to open TDB passwd, trying create new!\n")); - if (!(pwd_tdb = tdb_open_log(tdbfile, 0, USE_TDB_MMAP_FLAG, O_RDWR | O_CREAT | O_EXCL, 0600))) + if (!(pwd_tdb = tdb_open_log(tdbfile, 0, TDB_DEFAULT, O_RDWR | O_CREAT | O_EXCL, 0600))) { DEBUG(0, ("Unable to create TDB passwd (passdb.tdb) !!!\n")); return False; diff --git a/source/passdb/secrets.c b/source/passdb/secrets.c index 4a3a92695ee..9c141ec90a4 100644 --- a/source/passdb/secrets.c +++ b/source/passdb/secrets.c @@ -41,7 +41,7 @@ BOOL secrets_init(void) *p = 0; pstrcat(fname,"/secrets.tdb"); - tdb = tdb_open_log(fname, 0, USE_TDB_MMAP_FLAG, O_RDWR|O_CREAT, 0600); + tdb = tdb_open_log(fname, 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600); if (!tdb) { DEBUG(0,("Failed to open %s\n", fname)); diff --git a/source/printing/nt_printing.c b/source/printing/nt_printing.c index 4de519372f6..879f8229768 100644 --- a/source/printing/nt_printing.c +++ b/source/printing/nt_printing.c @@ -239,21 +239,21 @@ BOOL nt_printing_init(void) if (tdb_drivers && tdb_printers && tdb_forms && local_pid == sys_getpid()) return True; - tdb_drivers = tdb_open_log(lock_path("ntdrivers.tdb"), 0, USE_TDB_MMAP_FLAG, O_RDWR|O_CREAT, 0600); + tdb_drivers = tdb_open_log(lock_path("ntdrivers.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600); if (!tdb_drivers) { DEBUG(0,("nt_printing_init: Failed to open nt drivers database %s (%s)\n", lock_path("ntdrivers.tdb"), strerror(errno) )); return False; } - tdb_printers = tdb_open_log(lock_path("ntprinters.tdb"), 0, USE_TDB_MMAP_FLAG, O_RDWR|O_CREAT, 0600); + tdb_printers = tdb_open_log(lock_path("ntprinters.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600); if (!tdb_printers) { DEBUG(0,("nt_printing_init: Failed to open nt printers database %s (%s)\n", lock_path("ntprinters.tdb"), strerror(errno) )); return False; } - tdb_forms = tdb_open_log(lock_path("ntforms.tdb"), 0, USE_TDB_MMAP_FLAG, O_RDWR|O_CREAT, 0600); + tdb_forms = tdb_open_log(lock_path("ntforms.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600); if (!tdb_forms) { DEBUG(0,("nt_printing_init: Failed to open nt forms database %s (%s)\n", lock_path("ntforms.tdb"), strerror(errno) )); diff --git a/source/printing/printing.c b/source/printing/printing.c index d06b192052d..19d6aa2f70c 100644 --- a/source/printing/printing.c +++ b/source/printing/printing.c @@ -55,7 +55,7 @@ BOOL print_backend_init(void) char *sversion = "INFO/version"; if (tdb && local_pid == sys_getpid()) return True; - tdb = tdb_open_log(lock_path("printing.tdb"), 0, USE_TDB_MMAP_FLAG, O_RDWR|O_CREAT, 0600); + tdb = tdb_open_log(lock_path("printing.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600); if (!tdb) { DEBUG(0,("print_backend_init: Failed to open printing backend database. Error = [%s]\n", tdb_errorstr(tdb))); diff --git a/source/rpc_server/srv_srvsvc_nt.c b/source/rpc_server/srv_srvsvc_nt.c index c0ae67004e9..ef58bbeb6e8 100644 --- a/source/rpc_server/srv_srvsvc_nt.c +++ b/source/rpc_server/srv_srvsvc_nt.c @@ -125,7 +125,7 @@ BOOL share_info_db_init(void) char *vstring = "INFO/version"; if (share_tdb && local_pid == sys_getpid()) return True; - share_tdb = tdb_open_log(lock_path("share_info.tdb"), 0, USE_TDB_MMAP_FLAG, O_RDWR|O_CREAT, 0600); + share_tdb = tdb_open_log(lock_path("share_info.tdb"), 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600); if (!share_tdb) { DEBUG(0,("Failed to open share info database %s (%s)\n", lock_path("share_info.tdb"), strerror(errno) )); diff --git a/source/smbd/connection.c b/source/smbd/connection.c index f59cb1898a4..08dca443895 100644 --- a/source/smbd/connection.c +++ b/source/smbd/connection.c @@ -120,7 +120,7 @@ BOOL claim_connection(connection_struct *conn,char *name,int max_connections,BOO BOOL ret = True; if (!tdb) { - tdb = tdb_open_log(lock_path("connections.tdb"), 0, TDB_CLEAR_IF_FIRST|USE_TDB_MMAP_FLAG, + tdb = tdb_open_log(lock_path("connections.tdb"), 0, TDB_CLEAR_IF_FIRST|TDB_DEFAULT, O_RDWR | O_CREAT, 0644); } if (!tdb) diff --git a/source/smbd/session.c b/source/smbd/session.c index 7616689fe0c..bf21677f566 100644 --- a/source/smbd/session.c +++ b/source/smbd/session.c @@ -62,7 +62,7 @@ BOOL session_claim(uint16 vuid) } if (!tdb) { - tdb = tdb_open_log(lock_path("sessionid.tdb"), 0, TDB_CLEAR_IF_FIRST|USE_TDB_MMAP_FLAG, + tdb = tdb_open_log(lock_path("sessionid.tdb"), 0, TDB_CLEAR_IF_FIRST|TDB_DEFAULT, O_RDWR | O_CREAT, 0644); if (!tdb) { DEBUG(1,("session_claim: failed to open sessionid tdb\n")); diff --git a/source/utils/smbcontrol.c b/source/utils/smbcontrol.c index 4652260d61e..bd5a085d084 100644 --- a/source/utils/smbcontrol.c +++ b/source/utils/smbcontrol.c @@ -129,7 +129,7 @@ static BOOL send_message(char *dest, int msg_type, void *buf, int len, BOOL dupl pid_t pid = 0; TDB_CONTEXT *the_tdb; - the_tdb = tdb_open_log(lock_path("connections.tdb"), 0, USE_TDB_MMAP_FLAG, O_RDWR, 0); + the_tdb = tdb_open_log(lock_path("connections.tdb"), 0, TDB_DEFAULT, O_RDWR, 0); if (!the_tdb) { fprintf(stderr,"Failed to open connections database in send_message.\n"); return False; diff --git a/source/utils/status.c b/source/utils/status.c index 7942f69a28d..28726d40f0f 100644 --- a/source/utils/status.c +++ b/source/utils/status.c @@ -635,7 +635,7 @@ static int traverse_fn1(TDB_CONTEXT *tdb, TDB_DATA kbuf, TDB_DATA dbuf, void *st return profile_dump(); } - tdb = tdb_open_log(lock_path("connections.tdb"), 0, USE_TDB_MMAP_FLAG, O_RDONLY, 0); + tdb = tdb_open_log(lock_path("connections.tdb"), 0, TDB_DEFAULT, O_RDONLY, 0); if (!tdb) { printf("connections.tdb not initialised\n"); if (!lp_status(-1)) diff --git a/source/web/statuspage.c b/source/web/statuspage.c index a49b78c649e..a8666f54762 100644 --- a/source/web/statuspage.c +++ b/source/web/statuspage.c @@ -187,7 +187,7 @@ void status_page(void) refresh_interval = atoi(v); } - tdb = tdb_open_log(lock_path("connections.tdb"), 0, USE_TDB_MMAP_FLAG, O_RDONLY, 0); + tdb = tdb_open_log(lock_path("connections.tdb"), 0, TDB_DEFAULT, O_RDONLY, 0); if (tdb) tdb_traverse(tdb, traverse_fn1, NULL); printf("<H2>Server Status</H2>\n"); |