]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
remove dns_db_{un,}locknode
authorEvan Hunt <each@isc.org>
Thu, 14 Aug 2025 23:28:11 +0000 (16:28 -0700)
committerEvan Hunt <each@isc.org>
Mon, 15 Sep 2025 16:11:50 +0000 (16:11 +0000)
remove the dns_db_locknode() and _unlocknode() calls, so that callers no
longer have the ability to directly manipulate the internal locking of
cache and zone databases.

lib/dns/db.c
lib/dns/include/dns/db.h
lib/dns/qpcache.c
lib/dns/qpzone.c

index 08805b053599dd6f002af3984ec10729683ff035..92003520240945d791c0884f2e55c6ea37707e4d 100644 (file)
@@ -1043,22 +1043,6 @@ dns_db_addglue(dns_db_t *db, dns_dbversion_t *version, dns_rdataset_t *rdataset,
        return ISC_R_NOTIMPLEMENTED;
 }
 
-void
-dns_db_locknode(dns_dbnode_t *node, isc_rwlocktype_t type) {
-       REQUIRE(node != NULL && node->methods != NULL);
-       if (node->methods->locknode != NULL) {
-               (node->methods->locknode)(node, type);
-       }
-}
-
-void
-dns_db_unlocknode(dns_dbnode_t *node, isc_rwlocktype_t type) {
-       REQUIRE(node != NULL && node->methods != NULL);
-       if (node->methods->unlocknode != NULL) {
-               (node->methods->unlocknode)(node, type);
-       }
-}
-
 void
 dns_db_expiredata(dns_dbnode_t *node, void *data) {
        REQUIRE(node != NULL && node->methods != NULL);
index 23f14030a7ef5af75142976dc885400559d70d7f..7ebeeb2253d6260810e031a467fe382919e20f33 100644 (file)
@@ -80,9 +80,6 @@ typedef struct dns_dbnode_methods {
                           dns_dbnode_t **targetp DNS__DB_FLARG);
        void (*detachnode)(dns_dbnode_t **targetp DNS__DB_FLARG);
 
-       void (*locknode)(dns_dbnode_t *node, isc_rwlocktype_t t);
-       void (*unlocknode)(dns_dbnode_t *node, isc_rwlocktype_t t);
-
        void (*deletedata)(dns_dbnode_t *node, void *data);
        void (*expiredata)(dns_dbnode_t *node, void *data);
 } dns_dbnode_methods_t;
@@ -1718,15 +1715,6 @@ dns_db_setgluecachestats(dns_db_t *db, isc_stats_t *stats);
  *     dns_rdatasetstats_create(); otherwise NULL.
  */
 
-void
-dns_db_locknode(dns_dbnode_t *node, isc_rwlocktype_t type);
-void
-dns_db_unlocknode(dns_dbnode_t *node, isc_rwlocktype_t type);
-/*%<
- * Lock/unlock a single node within a database so that data stored
- * there can be manipulated directly.
- */
-
 isc_result_t
 dns_db_addglue(dns_db_t *db, dns_dbversion_t *version, dns_rdataset_t *rdataset,
               dns_message_t *msg);
index b6224c77ac36e66610e14c1c55cdbd03d341efc8..0d0e9b1bd2b9d08d76317d5b49d0ef2406c8bcdd 100644 (file)
@@ -305,10 +305,6 @@ qpcnode_attachnode(dns_dbnode_t *source, dns_dbnode_t **targetp DNS__DB_FLARG);
 static void
 qpcnode_detachnode(dns_dbnode_t **nodep DNS__DB_FLARG);
 static void
-qpcnode_locknode(dns_dbnode_t *node, isc_rwlocktype_t type);
-static void
-qpcnode_unlocknode(dns_dbnode_t *node, isc_rwlocktype_t type);
-static void
 qpcnode_deletedata(dns_dbnode_t *node, void *data);
 static void
 qpcnode_expiredata(dns_dbnode_t *node, void *data);
@@ -316,8 +312,6 @@ qpcnode_expiredata(dns_dbnode_t *node, void *data);
 static dns_dbnode_methods_t qpcnode_methods = (dns_dbnode_methods_t){
        .attachnode = qpcnode_attachnode,
        .detachnode = qpcnode_detachnode,
-       .locknode = qpcnode_locknode,
-       .unlocknode = qpcnode_unlocknode,
        .deletedata = qpcnode_deletedata,
        .expiredata = qpcnode_expiredata,
 };
@@ -3264,22 +3258,6 @@ nodecount(dns_db_t *db, dns_dbtree_t tree) {
        return mu.leaves;
 }
 
-static void
-qpcnode_locknode(dns_dbnode_t *node, isc_rwlocktype_t type) {
-       qpcnode_t *qpnode = (qpcnode_t *)node;
-       qpcache_t *qpdb = qpnode->qpdb;
-
-       RWLOCK(&qpdb->buckets[qpnode->locknum].lock, type);
-}
-
-static void
-qpcnode_unlocknode(dns_dbnode_t *node, isc_rwlocktype_t type) {
-       qpcnode_t *qpnode = (qpcnode_t *)node;
-       qpcache_t *qpdb = qpnode->qpdb;
-
-       RWUNLOCK(&qpdb->buckets[qpnode->locknum].lock, type);
-}
-
 isc_result_t
 dns__qpcache_create(isc_mem_t *mctx, const dns_name_t *origin,
                    dns_dbtype_t type, dns_rdataclass_t rdclass,
index 460f83085156b1061120abd3152123ed8766cf2e..e081f15c261a94cd46af84331ab540c7e3325b93 100644 (file)
@@ -3886,20 +3886,6 @@ getoriginnode(dns_db_t *db, dns_dbnode_t **nodep DNS__DB_FLARG) {
        return ISC_R_SUCCESS;
 }
 
-static void
-locknode(dns_dbnode_t *dbnode, isc_rwlocktype_t type) {
-       qpznode_t *node = (qpznode_t *)dbnode;
-
-       RWLOCK(qpzone_get_lock(node), type);
-}
-
-static void
-unlocknode(dns_dbnode_t *dbnode, isc_rwlocktype_t type) {
-       qpznode_t *node = (qpznode_t *)dbnode;
-
-       RWUNLOCK(qpzone_get_lock(node), type);
-}
-
 static void
 deletedata(dns_dbnode_t *node ISC_ATTR_UNUSED, void *data) {
        dns_slabheader_t *header = data;
@@ -5292,8 +5278,6 @@ static dns_dbmethods_t qpdb_zonemethods = {
 static dns_dbnode_methods_t qpznode_methods = (dns_dbnode_methods_t){
        .attachnode = qpzone_attachnode,
        .detachnode = qpzone_detachnode,
-       .locknode = locknode,
-       .unlocknode = unlocknode,
        .deletedata = deletedata,
 };