lck->num_recs -= 1;
if (i < lck->num_recs) {
uint8_t *recptr = lck->recsbuf + i*G_LOCK_REC_LENGTH;
- struct g_lock_rec rec;
- struct server_id_buf tmp;
-
- g_lock_rec_get(&rec, recptr);
- DBG_ERR("%s: i[%zu] pid[%s] type[%u]\n",
- __location__, i,
- server_id_str_buf(rec.pid, &tmp),
- (unsigned)rec.lock_type);
-
memcpy(recptr, lck->recsbuf + lck->num_recs*G_LOCK_REC_LENGTH,
G_LOCK_REC_LENGTH);
}
{
uint8_t sizebuf[4];
uint8_t addbuf[G_LOCK_REC_LENGTH];
- size_t i;
+
struct TDB_DATA dbufs[] = {
{ .dptr = sizebuf, .dsize = sizeof(sizebuf) },
{ .dptr = lck->recsbuf,
{ .dptr = lck->data, .dsize = lck->datalen }
};
- for (i=0; i < lck->num_recs; i++) {
- uint8_t *recptr = lck->recsbuf + i*G_LOCK_REC_LENGTH;
- struct g_lock_rec _rec;
- struct server_id_buf tmp;
-
- g_lock_rec_get(&_rec, recptr);
- DBG_ERR("%s: i[%zu] pid[%s] type[%u]\n",
- __location__, i,
- server_id_str_buf(_rec.pid, &tmp),
- (unsigned)_rec.lock_type);
- }
-
if (add != NULL) {
- struct server_id_buf tmp;
g_lock_rec_put(addbuf, *add);
- DBG_ERR("%s: ia[%zu] pid[%s] type[%u]\n",
- __location__, lck->num_recs,
- server_id_str_buf(add->pid, &tmp),
- (unsigned)add->lock_type);
-
dbufs[2] = (TDB_DATA) {
.dptr = addbuf, .dsize = G_LOCK_REC_LENGTH
};
lck->num_recs += 1;
}
- DBG_ERR("%s: num_recs[%zu]\n",
- __location__, lck->num_recs);
SIVAL(sizebuf, 0, lck->num_recs);
return dbwrap_record_storev(rec, dbufs, ARRAY_SIZE(dbufs), 0);
NTSTATUS status;
bool modified = false;
bool ok;
- struct server_id_buf tmp;
-
- DBG_ERR("%s: self[%s] type[%u]\n",
- __location__,
- server_id_str_buf(self, &tmp),
- (unsigned)type);
data = dbwrap_record_get_value(rec);
status = store_status;
}
}
-
- DBG_ERR("%s: self[%s] type[%u] => modified[%u] %s\n",
- __location__,
- server_id_str_buf(self, &tmp),
- (unsigned)type, modified,
- nt_errstr(status));
-
return status;
}