summaryrefslogtreecommitdiff
path: root/source3/locking
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2019-09-03 16:26:09 +0200
committerJeremy Allison <jra@samba.org>2019-09-10 23:14:31 +0000
commitde8b93b47992dc37821aa2bd83b34ba374ff0139 (patch)
tree5978c816161e2970559cde1284890d830aca6e7d /source3/locking
parent49d18bbf29dd00414fcd52ddeed72809ba4e9002 (diff)
downloadsamba-de8b93b47992dc37821aa2bd83b34ba374ff0139.tar.gz
smbd: Use file_id_str_buf() in brl_cleanup_disconnected()
Also avoid some casts and use DBG_ instead of DEBUG() Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3/locking')
-rw-r--r--source3/locking/brlock.c47
1 files changed, 24 insertions, 23 deletions
diff --git a/source3/locking/brlock.c b/source3/locking/brlock.c
index 11585574546..f3fb75ef136 100644
--- a/source3/locking/brlock.c
+++ b/source3/locking/brlock.c
@@ -1962,14 +1962,15 @@ bool brl_cleanup_disconnected(struct file_id fid, uint64_t open_persistent_id)
struct db_record *rec;
struct lock_struct *lock;
unsigned n, num;
+ struct file_id_buf buf;
NTSTATUS status;
key = make_tdb_data((void*)&fid, sizeof(fid));
rec = dbwrap_fetch_locked(brlock_db, frame, key);
if (rec == NULL) {
- DEBUG(5, ("brl_cleanup_disconnected: failed to fetch record "
- "for file %s\n", file_id_string(frame, &fid)));
+ DBG_INFO("failed to fetch record for file %s\n",
+ file_id_str_buf(fid, &buf));
goto done;
}
@@ -1977,8 +1978,8 @@ bool brl_cleanup_disconnected(struct file_id fid, uint64_t open_persistent_id)
lock = (struct lock_struct*)val.dptr;
num = val.dsize / sizeof(struct lock_struct);
if (lock == NULL) {
- DEBUG(10, ("brl_cleanup_disconnected: no byte range locks for "
- "file %s\n", file_id_string(frame, &fid)));
+ DBG_DEBUG("no byte range locks for file %s\n",
+ file_id_str_buf(fid, &buf));
ret = true;
goto done;
}
@@ -1988,38 +1989,38 @@ bool brl_cleanup_disconnected(struct file_id fid, uint64_t open_persistent_id)
if (!server_id_is_disconnected(&ctx->pid)) {
struct server_id_buf tmp;
- DEBUG(5, ("brl_cleanup_disconnected: byte range lock "
- "%s used by server %s, do not cleanup\n",
- file_id_string(frame, &fid),
- server_id_str_buf(ctx->pid, &tmp)));
+ DBG_INFO("byte range lock "
+ "%s used by server %s, do not cleanup\n",
+ file_id_str_buf(fid, &buf),
+ server_id_str_buf(ctx->pid, &tmp));
goto done;
}
if (ctx->smblctx != open_persistent_id) {
- DEBUG(5, ("brl_cleanup_disconnected: byte range lock "
- "%s expected smblctx %llu but found %llu"
- ", do not cleanup\n",
- file_id_string(frame, &fid),
- (unsigned long long)open_persistent_id,
- (unsigned long long)ctx->smblctx));
+ DBG_INFO("byte range lock %s expected smblctx %"PRIu64" "
+ "but found %"PRIu64", do not cleanup\n",
+ file_id_str_buf(fid, &buf),
+ open_persistent_id,
+ ctx->smblctx);
goto done;
}
}
status = dbwrap_record_delete(rec);
if (!NT_STATUS_IS_OK(status)) {
- DEBUG(5, ("brl_cleanup_disconnected: failed to delete record "
- "for file %s from %s, open %llu: %s\n",
- file_id_string(frame, &fid), dbwrap_name(brlock_db),
- (unsigned long long)open_persistent_id,
- nt_errstr(status)));
+ DBG_INFO("failed to delete record "
+ "for file %s from %s, open %"PRIu64": %s\n",
+ file_id_str_buf(fid, &buf),
+ dbwrap_name(brlock_db),
+ open_persistent_id,
+ nt_errstr(status));
goto done;
}
- DEBUG(10, ("brl_cleanup_disconnected: "
- "file %s cleaned up %u entries from open %llu\n",
- file_id_string(frame, &fid), num,
- (unsigned long long)open_persistent_id));
+ DBG_DEBUG("file %s cleaned up %u entries from open %"PRIu64"\n",
+ file_id_str_buf(fid, &buf),
+ num,
+ open_persistent_id);
ret = true;
done: