From 95a4903b20b892c461198dd1dff77ccca159d2ca Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Tue, 18 Dec 2001 05:04:09 +0000 Subject: Removed unused function, delete_fn() (This used to be commit f26e8205cff63967b9c1659b8e6ad71cbe36dace) --- source3/locking/locking.c | 57 ----------------------------------------------- 1 file changed, 57 deletions(-) (limited to 'source3/locking') diff --git a/source3/locking/locking.c b/source3/locking/locking.c index 8a8a33b808..cb523532d8 100644 --- a/source3/locking/locking.c +++ b/source3/locking/locking.c @@ -210,63 +210,6 @@ void locking_close_file(files_struct *fsp) } } -/**************************************************************************** - Delete a record if it is for a dead process, if check_self is true, then - delete any records belonging to this pid also (there shouldn't be any). - This function is only called on locking startup and shutdown. -****************************************************************************/ - -static int delete_fn(TDB_CONTEXT *ttdb, TDB_DATA kbuf, TDB_DATA dbuf, void *state) -{ - struct locking_data *data; - share_mode_entry *shares; - int i, del_count=0; - pid_t mypid = sys_getpid(); - BOOL check_self = *(BOOL *)state; - int ret = 0; - - tdb_chainlock(tdb, kbuf); - - data = (struct locking_data *)dbuf.dptr; - shares = (share_mode_entry *)(dbuf.dptr + sizeof(*data)); - - for (i=0;iu.num_share_mode_entries;) { - - if (check_self && (shares[i].pid == mypid)) { - DEBUG(0,("locking : delete_fn. LOGIC ERROR ! Shutting down and a record for my pid (%u) exists !\n", - (unsigned int)shares[i].pid )); - } else if (!process_exists(shares[i].pid)) { - DEBUG(0,("locking : delete_fn. LOGIC ERROR ! Entry for pid %u and it no longer exists !\n", - (unsigned int)shares[i].pid )); - } else { - /* Process exists, leave this record alone. */ - i++; - continue; - } - - data->u.num_share_mode_entries--; - memmove(&shares[i], &shares[i+1], - dbuf.dsize - (sizeof(*data) + (i+1)*sizeof(*shares))); - del_count++; - - } - - /* the record has shrunk a bit */ - dbuf.dsize -= del_count * sizeof(*shares); - - /* store it back in the database */ - if (data->u.num_share_mode_entries == 0) { - if (tdb_delete(ttdb, kbuf) == -1) - ret = -1; - } else { - if (tdb_store(ttdb, kbuf, dbuf, TDB_REPLACE) == -1) - ret = -1; - } - - tdb_chainunlock(tdb, kbuf); - return ret; -} - /**************************************************************************** Initialise the locking functions. ****************************************************************************/ -- cgit