[SCM] Samba Shared Repository - branch master updated
Jeremy Allison
jra at samba.org
Thu May 23 18:09:02 UTC 2019
The branch, master has been updated
via 1f9b8964ca8 ctdb: Remove unused ctdb_ltdb_fetch_with_header()
via 1a59b0fa638 smbd: Calculate delay_mask only once in delay_for_oplock
via 77e37850fde tdb: Fix typo in README
via 564e0f25664 smbd: Merge "print_lock_struct" into one DBG
from 1a9da378a15 sambaundoguididx: Add flags=ldb.FLG_DONT_CREATE_DB and port to Python3
https://git.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 1f9b8964ca868f70adee0f63e1df67a08d611bf2
Author: Volker Lendecke <vl at samba.org>
Date: Mon May 20 15:12:56 2019 +0200
ctdb: Remove unused ctdb_ltdb_fetch_with_header()
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
Autobuild-User(master): Jeremy Allison <jra at samba.org>
Autobuild-Date(master): Thu May 23 18:08:36 UTC 2019 on sn-devel-184
commit 1a59b0fa638ce33f7a7fda07f26509a3370b76b4
Author: Volker Lendecke <vl at samba.org>
Date: Fri May 17 15:29:59 2019 +0200
smbd: Calculate delay_mask only once in delay_for_oplock
"const" ist just a hint to make sure it's actually not modified inside
the loop
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 77e37850fde550abcf1ce7e4eb8341b5022845f8
Author: Volker Lendecke <vl at samba.org>
Date: Mon May 20 14:55:31 2019 +0200
tdb: Fix typo in README
README is far from a complete, good and accurate document, but what's
in there should at least not have obvious errors.
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
commit 564e0f25664b60f27d57bf1eab05e613db027d71
Author: Volker Lendecke <vl at samba.org>
Date: Mon May 20 13:52:12 2019 +0200
smbd: Merge "print_lock_struct" into one DBG
Also, avoid some casts
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Jeremy Allison <jra at samba.org>
-----------------------------------------------------------------------
Summary of changes:
ctdb/common/common.h | 4 ----
ctdb/common/ctdb_ltdb.c | 35 -----------------------------------
lib/tdb/docs/README | 4 ++--
source3/locking/brlock.c | 24 ++++++++++++------------
source3/smbd/open.c | 9 ++-------
5 files changed, 16 insertions(+), 60 deletions(-)
Changeset truncated at 500 lines:
diff --git a/ctdb/common/common.h b/ctdb/common/common.h
index 02bb746c9b3..6b2c98ef383 100644
--- a/ctdb/common/common.h
+++ b/ctdb/common/common.h
@@ -61,10 +61,6 @@ int ctdb_ltdb_fetch(struct ctdb_db_context *ctdb_db,
TDB_DATA key, struct ctdb_ltdb_header *header,
TALLOC_CTX *mem_ctx, TDB_DATA *data);
-int ctdb_ltdb_fetch_with_header(struct ctdb_db_context *ctdb_db,
- TDB_DATA key, struct ctdb_ltdb_header *header,
- TALLOC_CTX *mem_ctx, TDB_DATA *data);
-
int ctdb_ltdb_store(struct ctdb_db_context *ctdb_db, TDB_DATA key,
struct ctdb_ltdb_header *header, TDB_DATA data);
diff --git a/ctdb/common/ctdb_ltdb.c b/ctdb/common/ctdb_ltdb.c
index f4f216e1ee3..de4f44895e4 100644
--- a/ctdb/common/ctdb_ltdb.c
+++ b/ctdb/common/ctdb_ltdb.c
@@ -221,41 +221,6 @@ int ctdb_ltdb_fetch(struct ctdb_db_context *ctdb_db,
return 0;
}
-/*
- fetch a record from the ltdb, separating out the header information
- and returning the body of the record.
- if the record does not exist, *header will be NULL
- and data = {0, NULL}
-*/
-int ctdb_ltdb_fetch_with_header(struct ctdb_db_context *ctdb_db,
- TDB_DATA key, struct ctdb_ltdb_header *header,
- TALLOC_CTX *mem_ctx, TDB_DATA *data)
-{
- TDB_DATA rec;
-
- rec = tdb_fetch(ctdb_db->ltdb->tdb, key);
- if (rec.dsize < sizeof(*header)) {
- free(rec.dptr);
-
- data->dsize = 0;
- data->dptr = NULL;
- return -1;
- }
-
- *header = *(struct ctdb_ltdb_header *)rec.dptr;
- if (data) {
- data->dsize = rec.dsize - sizeof(struct ctdb_ltdb_header);
- data->dptr = talloc_memdup(mem_ctx,
- sizeof(struct ctdb_ltdb_header)+rec.dptr,
- data->dsize);
- }
-
- free(rec.dptr);
-
- return 0;
-}
-
-
/*
write a record to a normal database
*/
diff --git a/lib/tdb/docs/README b/lib/tdb/docs/README
index be2224f1d84..86d46a38ac2 100644
--- a/lib/tdb/docs/README
+++ b/lib/tdb/docs/README
@@ -206,13 +206,13 @@ int tdb_writeunlock(TDB_CONTEXT *tdb);
unlock the database
----------------------------------------------------------------------
-int tdb_lockchain(TDB_CONTEXT *tdb, TDB_DATA key);
+int tdb_chainlock(TDB_CONTEXT *tdb, TDB_DATA key);
lock one hash chain. This is meant to be used to reduce locking
contention - it cannot guarantee how many records will be locked
----------------------------------------------------------------------
-int tdb_unlockchain(TDB_CONTEXT *tdb, TDB_DATA key);
+int tdb_chainunlock(TDB_CONTEXT *tdb, TDB_DATA key);
unlock one hash chain
diff --git a/source3/locking/brlock.c b/source3/locking/brlock.c
index 0c91d55e813..e587222bc8a 100644
--- a/source3/locking/brlock.c
+++ b/source3/locking/brlock.c
@@ -61,18 +61,18 @@ static void print_lock_struct(unsigned int i, const struct lock_struct *pls)
{
struct server_id_buf tmp;
- DEBUG(10,("[%u]: smblctx = %llu, tid = %u, pid = %s, ",
- i,
- (unsigned long long)pls->context.smblctx,
- (unsigned int)pls->context.tid,
- server_id_str_buf(pls->context.pid, &tmp) ));
-
- DEBUG(10, ("start = %ju, size = %ju, fnum = %ju, %s %s\n",
- (uintmax_t)pls->start,
- (uintmax_t)pls->size,
- (uintmax_t)pls->fnum,
- lock_type_name(pls->lock_type),
- lock_flav_name(pls->lock_flav)));
+ DBG_DEBUG("[%u]: smblctx = %"PRIu64", tid = %"PRIu32", pid = %s, "
+ "start = %"PRIu64", size = %"PRIu64", fnum = %"PRIu64", "
+ "%s %s\n",
+ i,
+ pls->context.smblctx,
+ pls->context.tid,
+ server_id_str_buf(pls->context.pid, &tmp),
+ pls->start,
+ pls->size,
+ pls->fnum,
+ lock_type_name(pls->lock_type),
+ lock_flav_name(pls->lock_flav));
}
unsigned int brl_num_locks(const struct byte_range_lock *brl)
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index 0a4abe0d820..8e9de5e11b4 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -1849,6 +1849,8 @@ static bool delay_for_oplock(files_struct *fsp,
uint32_t i;
bool delay = false;
bool will_overwrite;
+ const uint32_t delay_mask = have_sharing_violation ?
+ SMB2_LEASE_HANDLE : SMB2_LEASE_WRITE;
if ((oplock_request & INTERNAL_OPEN_ONLY) ||
is_stat_open(fsp->access_mask)) {
@@ -1871,7 +1873,6 @@ static bool delay_for_oplock(files_struct *fsp,
bool e_is_lease = (e->op_type == LEASE_OPLOCK);
uint32_t e_lease_type = get_lease_type(d, e);
uint32_t break_to;
- uint32_t delay_mask = 0;
bool lease_is_breaking = false;
if (e_is_lease) {
@@ -1902,12 +1903,6 @@ static bool delay_for_oplock(files_struct *fsp,
SMB_ASSERT(NT_STATUS_IS_OK(status));
}
- if (have_sharing_violation) {
- delay_mask = SMB2_LEASE_HANDLE;
- } else {
- delay_mask = SMB2_LEASE_WRITE;
- }
-
break_to = e_lease_type & ~delay_mask;
if (will_overwrite) {
--
Samba Shared Repository
More information about the samba-cvs
mailing list