Go to the source code of this file.
◆ M0_TRACE_SUBSYSTEM
#define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_CLIENT |
◆ m0_ufid_fini()
Finalises Unique File/object ID (UFID) generator.
- Parameters
-
gr | The UFID generator to be finalised. |
Definition at line 283 of file ufid.c.
◆ m0_ufid_init()
Initialises Unique File/object ID (UFID) generator.
- Parameters
-
m0c | The Client instance contains required process FID. |
gr | The UFID generator to be initialised. |
- Returns
- Returns 0 on success. Negative errno in case of error.
Definition at line 248 of file ufid.c.
◆ m0_ufid_new()
Primary interface to obtain one or more unique file/object IDs of 128 bits.
m0_ufid_new() obtains new FID range which is unique across nodes/processes.
Input Params:
- Parameters
-
gr | Pointer to an UFID generator. |
nr_ids | Number of IDs that should be allocated. nr_ids value cannot be greater than (2^20-1). |
nr_skip_ids | Number of FIDs to skip. It invalidates nr_skip_ids ID range and cannot be greater than (2^20-1). |
id128[Output] | Starting ID of generated range. |
- Returns
- Returns 0 on success. Negative errno in case of error.
Error Values: -EINVAL In case of errors in parameters. -ETIME In case clock errors are detected. -EPERM In case module is not initialized before invoking this interface.
Definition at line 298 of file ufid.c.
◆ m0_ufid_next()
◆ ufid_generation_id_refresh()
Refreshes generation ID of UFID structure
- Parameters
-
gr | - Pointer to the UFID generator. |
- Returns
- - Returns 0 on success. Negative errno in case of error.
Definition at line 60 of file ufid.c.
◆ ufid_invariant()
static bool ufid_invariant |
( |
struct m0_ufid * |
ufid | ) |
|
|
static |
◆ ufid_proc_id_refresh()
Refreshes process id of an ufid generator
- Parameters
-
gr | - Pointer to the UFID generator. |
- Returns
- - Returns 0 on success. Negative errno in case of error.
Definition at line 124 of file ufid.c.
◆ ufid_salt_refresh()
Fills random number as salt.
- Parameters
-
gr | - Pointer to the UFID generator. |
Definition at line 45 of file ufid.c.
◆ ufid_seq_id_refresh()
Reserves a range of seq IDs by incrementing current sequence id stored in UFID generator. If the number of available sequence ids under current generation id cann't satisfy the number of sequence ids wanted, a new generation id will be created.
- Parameters
-
gr | - Pointer to the UFID generator. |
nr_seqs | - Number of sequences to reserve/skip |
- Returns
- - Returns 0 on success. Negative errno in case of error.
Definition at line 178 of file ufid.c.
◆ ufid_to_id128()