mirror of
https://github.com/samba-team/samba.git
synced 2025-01-27 14:04:05 +03:00
g_lock: parse->get
Make it more in line with server_id_get/put Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
parent
4d1f9ff1b8
commit
fadc877c59
@ -113,8 +113,8 @@ static bool g_lock_conflicts(enum g_lock_type l1, enum g_lock_type l2)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool g_lock_parse(TALLOC_CTX *mem_ctx, TDB_DATA data,
|
static bool g_lock_get(TALLOC_CTX *mem_ctx, TDB_DATA data,
|
||||||
unsigned *pnum_locks, struct g_lock_rec **plocks)
|
unsigned *pnum_locks, struct g_lock_rec **plocks)
|
||||||
{
|
{
|
||||||
size_t i, num_locks;
|
size_t i, num_locks;
|
||||||
struct g_lock_rec *locks;
|
struct g_lock_rec *locks;
|
||||||
@ -207,7 +207,7 @@ static NTSTATUS g_lock_trylock(struct db_record *rec, struct server_id self,
|
|||||||
|
|
||||||
data = dbwrap_record_get_value(rec);
|
data = dbwrap_record_get_value(rec);
|
||||||
|
|
||||||
if (!g_lock_parse(talloc_tos(), data, &num_locks, &locks)) {
|
if (!g_lock_get(talloc_tos(), data, &num_locks, &locks)) {
|
||||||
return NT_STATUS_INTERNAL_DB_CORRUPTION;
|
return NT_STATUS_INTERNAL_DB_CORRUPTION;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -446,8 +446,8 @@ NTSTATUS g_lock_unlock(struct g_lock_ctx *ctx, const char *name)
|
|||||||
|
|
||||||
value = dbwrap_record_get_value(rec);
|
value = dbwrap_record_get_value(rec);
|
||||||
|
|
||||||
if (!g_lock_parse(talloc_tos(), value, &num_locks, &locks)) {
|
if (!g_lock_get(talloc_tos(), value, &num_locks, &locks)) {
|
||||||
DEBUG(10, ("g_lock_parse for %s failed\n", name));
|
DEBUG(10, ("g_lock_get for %s failed\n", name));
|
||||||
status = NT_STATUS_FILE_INVALID;
|
status = NT_STATUS_FILE_INVALID;
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
@ -539,12 +539,12 @@ NTSTATUS g_lock_dump(struct g_lock_ctx *ctx, const char *name,
|
|||||||
return NT_STATUS_OK;
|
return NT_STATUS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = g_lock_parse(talloc_tos(), data, &num_locks, &locks);
|
ret = g_lock_get(talloc_tos(), data, &num_locks, &locks);
|
||||||
|
|
||||||
TALLOC_FREE(data.dptr);
|
TALLOC_FREE(data.dptr);
|
||||||
|
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
DEBUG(10, ("g_lock_parse for %s failed\n", name));
|
DEBUG(10, ("g_lock_get for %s failed\n", name));
|
||||||
return NT_STATUS_INTERNAL_ERROR;
|
return NT_STATUS_INTERNAL_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user