From d60fac2a5a789680b6dd9f05ab15a3033ec2887c Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Wed, 5 Dec 2007 20:53:22 +0100 Subject: Tiny simplifications locking.c:open_read_only was unused don't export the silly boolean flag locking_init(bool read_only) (This used to be commit 2f3c865707010bc7c463a02782dbee3dc2479da1) --- source3/locking/brlock.c | 7 ++----- source3/locking/locking.c | 24 ++++++++++++++---------- source3/locking/posix.c | 2 +- 3 files changed, 17 insertions(+), 16 deletions(-) (limited to 'source3/locking') diff --git a/source3/locking/brlock.c b/source3/locking/brlock.c index f821761cd7..eb42d081fe 100644 --- a/source3/locking/brlock.c +++ b/source3/locking/brlock.c @@ -258,7 +258,7 @@ static NTSTATUS brl_lock_failed(files_struct *fsp, const struct lock_struct *loc Open up the brlock.tdb database. ****************************************************************************/ -void brl_init(int read_only) +void brl_init(bool read_only) { if (brlock_db) { return; @@ -279,11 +279,8 @@ void brl_init(int read_only) Close down the brlock.tdb database. ****************************************************************************/ -void brl_shutdown(int read_only) +void brl_shutdown(void) { - if (!brlock_db) { - return; - } TALLOC_FREE(brlock_db); } diff --git a/source3/locking/locking.c b/source3/locking/locking.c index 296323f7da..dab21e53b3 100644 --- a/source3/locking/locking.c +++ b/source3/locking/locking.c @@ -385,9 +385,7 @@ void locking_close_file(struct messaging_context *msg_ctx, Initialise the locking functions. ****************************************************************************/ -static int open_read_only; - -bool locking_init(int read_only) +static bool locking_init_internal(bool read_only) { brl_init(read_only); @@ -408,22 +406,28 @@ bool locking_init(int read_only) if (!posix_locking_init(read_only)) return False; - open_read_only = read_only; - return True; } +bool locking_init(void) +{ + return locking_init_internal(false); +} + +bool locking_init_readonly(void) +{ + return locking_init_internal(true); +} + /******************************************************************* Deinitialize the share_mode management. ******************************************************************/ bool locking_end(void) { - brl_shutdown(open_read_only); - if (lock_db) { - TALLOC_FREE(lock_db); - } - return True; + brl_shutdown(); + TALLOC_FREE(lock_db); + return true; } /******************************************************************* diff --git a/source3/locking/posix.c b/source3/locking/posix.c index 7669b140f6..4b0b91bd19 100644 --- a/source3/locking/posix.c +++ b/source3/locking/posix.c @@ -347,7 +347,7 @@ static TDB_DATA fd_array_key_fsp(files_struct *fsp) Create the in-memory POSIX lock databases. ********************************************************************/ -bool posix_locking_init(int read_only) +bool posix_locking_init(bool read_only) { if (posix_pending_close_tdb) { return True; -- cgit