[PATCH] Remove some unused code
Jeremy Allison
jra at samba.org
Fri Oct 26 19:42:03 UTC 2018
On Thu, Oct 25, 2018 at 03:39:42PM +0200, Volker Lendecke via samba-technical wrote:
> Hi!
>
> Review appreciated!
LGTM. RB+ and pushed.
Jeremy.
> --
> SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
> phone: +49-551-370000-0, fax: +49-551-370000-9
> AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
> http://www.sernet.de, mailto:kontakt at sernet.de
> From 62fc104e03b3ba7143d3db3ff31565d7321c72c6 Mon Sep 17 00:00:00 2001
> From: Volker Lendecke <vl at samba.org>
> Date: Tue, 25 Sep 2018 08:59:20 -0700
> Subject: [PATCH] lib: Remove unused tdb_trans_* functions
>
> The transactions have all moved to dbwrap
>
> Signed-off-by: Volker Lendecke <vl at samba.org>
> ---
> source3/include/util_tdb.h | 6 -----
> source3/lib/util_tdb.c | 66 ----------------------------------------------
> 2 files changed, 72 deletions(-)
>
> diff --git a/source3/include/util_tdb.h b/source3/include/util_tdb.h
> index 8dc104834e8..d4efb0c31aa 100644
> --- a/source3/include/util_tdb.h
> +++ b/source3/include/util_tdb.h
> @@ -26,12 +26,6 @@
> #include "../libcli/util/ntstatus.h" /* for map_nt_error_from_tdb() */
> #include "../../lib/util/util_tdb.h"
>
> -int tdb_trans_store_bystring(TDB_CONTEXT *tdb, const char *keystr,
> - TDB_DATA data, int flags);
> -int tdb_trans_store(struct tdb_context *tdb, TDB_DATA key, TDB_DATA dbuf,
> - int flag);
> -int tdb_trans_delete(struct tdb_context *tdb, TDB_DATA key);
> -
> /*
> * The tdb_unpack() and tdb_pack[_append]() helpers are deprecated. Consider
> * using idl/ndr for marshalling of complex data types instead.
> diff --git a/source3/lib/util_tdb.c b/source3/lib/util_tdb.c
> index 9730a030c10..cbcca4df09f 100644
> --- a/source3/lib/util_tdb.c
> +++ b/source3/lib/util_tdb.c
> @@ -29,17 +29,6 @@
> #undef calloc
> #undef strdup
>
> -/* these are little tdb utility functions that are meant to make
> - dealing with a tdb database a little less cumbersome in Samba */
> -
> -int tdb_trans_store_bystring(TDB_CONTEXT *tdb, const char *keystr,
> - TDB_DATA data, int flags)
> -{
> - TDB_DATA key = string_term_tdb_data(keystr);
> -
> - return tdb_trans_store(tdb, key, data, flags);
> -}
> -
> /****************************************************************************
> Useful pair of routines for packing/unpacking data consisting of
> integers and strings.
> @@ -319,61 +308,6 @@ TDB_CONTEXT *tdb_open_log(const char *name, int hash_size, int tdb_flags,
> return tdb;
> }
>
> -/****************************************************************************
> - tdb_store, wrapped in a transaction. This way we make sure that a process
> - that dies within writing does not leave a corrupt tdb behind.
> -****************************************************************************/
> -
> -int tdb_trans_store(struct tdb_context *tdb, TDB_DATA key, TDB_DATA dbuf,
> - int flag)
> -{
> - int res;
> -
> - if ((res = tdb_transaction_start(tdb)) != 0) {
> - DEBUG(5, ("tdb_transaction_start failed\n"));
> - return res;
> - }
> -
> - if ((res = tdb_store(tdb, key, dbuf, flag)) != 0) {
> - DEBUG(10, ("tdb_store failed\n"));
> - tdb_transaction_cancel(tdb);
> - return res;
> - }
> -
> - if ((res = tdb_transaction_commit(tdb)) != 0) {
> - DEBUG(5, ("tdb_transaction_commit failed\n"));
> - }
> -
> - return res;
> -}
> -
> -/****************************************************************************
> - tdb_delete, wrapped in a transaction. This way we make sure that a process
> - that dies within deleting does not leave a corrupt tdb behind.
> -****************************************************************************/
> -
> -int tdb_trans_delete(struct tdb_context *tdb, TDB_DATA key)
> -{
> - int res;
> -
> - if ((res = tdb_transaction_start(tdb)) != 0) {
> - DEBUG(5, ("tdb_transaction_start failed\n"));
> - return res;
> - }
> -
> - if ((res = tdb_delete(tdb, key)) != 0) {
> - DEBUG(10, ("tdb_delete failed\n"));
> - tdb_transaction_cancel(tdb);
> - return res;
> - }
> -
> - if ((res = tdb_transaction_commit(tdb)) != 0) {
> - DEBUG(5, ("tdb_transaction_commit failed\n"));
> - }
> -
> - return res;
> -}
> -
> int tdb_data_cmp(TDB_DATA t1, TDB_DATA t2)
> {
> int ret;
> --
> 2.11.0
>
More information about the samba-technical
mailing list