summaryrefslogtreecommitdiffstats
path: root/source/locking
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2001-12-18 05:04:09 +0000
committerTim Potter <tpot@samba.org>2001-12-18 05:04:09 +0000
commitf26e8205cff63967b9c1659b8e6ad71cbe36dace (patch)
tree1c75054c74c8617b1e7b3f1dc94ec6a25274840a /source/locking
parent5e0f0716ca9826de110fd9eeaf231970e7c19b42 (diff)
downloadsamba-f26e8205cff63967b9c1659b8e6ad71cbe36dace.tar.gz
samba-f26e8205cff63967b9c1659b8e6ad71cbe36dace.tar.xz
samba-f26e8205cff63967b9c1659b8e6ad71cbe36dace.zip
Removed unused function, delete_fn()
Diffstat (limited to 'source/locking')
-rw-r--r--source/locking/locking.c57
1 files changed, 0 insertions, 57 deletions
diff --git a/source/locking/locking.c b/source/locking/locking.c
index 8a8a33b808d..cb523532d8f 100644
--- a/source/locking/locking.c
+++ b/source/locking/locking.c
@@ -211,63 +211,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;i<data->u.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.
****************************************************************************/