Go to the source code of this file.
|
M0_INTERNAL struct m0_client * | m0__oo_instance (struct m0_op_obj *oo) |
|
M0_INTERNAL struct m0_obj * | m0__obj_entity (struct m0_entity *entity) |
|
static bool | m0_op_common_invariant (struct m0_op_common *oc) |
|
M0_INTERNAL bool | m0_op_obj_ast_rc_invariant (struct m0_ast_rc *ar) |
|
M0_INTERNAL bool | m0_op_obj_invariant (struct m0_op_obj *oo) |
|
static bool | obj_op_obj_invariant (struct m0_op_obj *oo) |
|
static bool | obj_layout_id_invariant (uint64_t layout_id) |
|
M0_INTERNAL uint64_t | m0__obj_lid (struct m0_obj *obj) |
|
M0_INTERNAL enum m0_client_layout_type | m0__obj_layout_type (struct m0_obj *obj) |
|
M0_INTERNAL void | m0__obj_attr_set (struct m0_obj *obj, struct m0_fid pver, uint64_t layout_id) |
|
M0_INTERNAL struct m0_fid | m0__obj_pver (struct m0_obj *obj) |
|
M0_INTERNAL bool | m0__obj_pool_version_is_valid (const struct m0_obj *obj) |
|
static void | obj_namei_cb_cancel (struct m0_op_common *oc) |
|
static void | obj_namei_cb_launch (struct m0_op_common *oc) |
|
static void | obj_namei_cb_free (struct m0_op_common *oc) |
|
static void | obj_namei_cb_fini (struct m0_op_common *oc) |
|
M0_INTERNAL int | m0__obj_pool_version_get (struct m0_obj *obj, struct m0_pool_version **pv) |
|
M0_INTERNAL uint64_t | m0__obj_layout_id_get (struct m0_op_obj *oo) |
|
M0_INTERNAL int | m0__obj_layout_instance_build (struct m0_client *cinst, const uint64_t layout_id, const struct m0_fid *fid, struct m0_layout_instance **linst) |
|
static int | obj_namei_op_init (struct m0_entity *entity, struct m0_op *op) |
|
static void | obj_optimal_lid_set (struct m0_obj *obj, struct m0_layout_domain *ldom) |
|
static int | obj_op_obj_init (struct m0_op_obj *oo) |
|
static int | obj_op_prepare (struct m0_entity *entity, struct m0_op **op, enum m0_entity_opcode opcode) |
|
static int | entity_namei_op (struct m0_entity *entity, struct m0_op **op, enum m0_entity_opcode opcode) |
|
int | m0_entity_create (struct m0_fid *pool, struct m0_entity *entity, struct m0_op **op) |
|
int | m0_entity_delete (struct m0_entity *entity, struct m0_op **op) |
|
uint64_t | m0_obj_unit_size_to_layout_id (int unit_size) |
|
int | m0_obj_layout_id_to_unit_size (uint64_t layout_id) |
|
uint64_t | m0_client_layout_id (const struct m0_client *instance) |
|
enum m0_client_layout_type | m0_obj_layout_type (struct m0_obj *obj) |
|
int | m0_entity_open (struct m0_entity *entity, struct m0_op **op) |
|
◆ M0_TRACE_SUBSYSTEM
#define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_CLIENT |
Definition at line 37 of file obj.c.
◆ entity_namei_op()
Sets a entity operation to modify the object namespace. This type of operation on entities allow creating and deleting entities.
- Parameters
-
entity | entity to be modified. |
op | pointer to the operation being set. The caller might pre-allocate this operation.Otherwise, the function will allocate the required memory. |
opcode | M0_EO_CREATE or M0_EO_DELETE. |
- Returns
- 0 if the function succeeds or an error code otherwise.
Definition at line 743 of file obj.c.
◆ m0__obj_attr_set()
M0_INTERNAL void m0__obj_attr_set |
( |
struct m0_obj * |
obj, |
|
|
struct m0_fid |
pver, |
|
|
uint64_t |
layout_id |
|
) |
| |
◆ m0__obj_entity()
TODO: doxygen
Definition at line 51 of file obj.c.
◆ m0__obj_layout_id_get()
M0_INTERNAL uint64_t m0__obj_layout_id_get |
( |
struct m0_op_obj * |
oo | ) |
|
Gets the default layout identifier from confd.
- Parameters
-
instance | The client instance containing information of confd. |
- Returns
- Default layout id.
Definition at line 384 of file obj.c.
◆ m0__obj_layout_instance_build()
Builds a layout instance using the supplied layout.
- Parameters
-
| cinst | client instance. |
| layout_id | ID of the layout. |
| fid | (global) fid of the object this instance is associated to. |
[out] | linst | new layout instance. |
- Returns
- 0 if the operation succeeds or an error code (<0) otherwise.
Definition at line 403 of file obj.c.
◆ m0__obj_layout_type()
◆ m0__obj_lid()
M0_INTERNAL uint64_t m0__obj_lid |
( |
struct m0_obj * |
obj | ) |
|
◆ m0__obj_pool_version_get()
Gets current valid pool version from client instance.
- Parameters
-
instance | The client instance containing information of pool and pool versions. |
pv | The returned pool version. |
Validate the cached pool version.
Definition at line 346 of file obj.c.
◆ m0__obj_pool_version_is_valid()
M0_INTERNAL bool m0__obj_pool_version_is_valid |
( |
const struct m0_obj * |
obj | ) |
|
◆ m0__obj_pver()
M0_INTERNAL struct m0_fid m0__obj_pver |
( |
struct m0_obj * |
obj | ) |
|
◆ m0__oo_instance()
Returns the client instance associated to an object operation.
- Parameters
-
oo | object operation pointing to the instance. |
- Returns
- a pointer to the client instance associated to the entity.
Definition at line 43 of file obj.c.
◆ m0_op_common_invariant()
static bool m0_op_common_invariant |
( |
struct m0_op_common * |
oc | ) |
|
|
static |
Checks the common part of an operation is not malformed or corrupted.
- Parameters
-
oc | operation common to be checked. |
- Returns
- true if the operation is not malformed or false if some error was detected.
Definition at line 67 of file obj.c.
◆ m0_op_obj_ast_rc_invariant()
M0_INTERNAL bool m0_op_obj_ast_rc_invariant |
( |
struct m0_ast_rc * |
ar | ) |
|
Checks the data struct holding the AST information is not malformed or corrupted.
- Parameters
-
ar | The pointer to AST information. |
- Returns
- true if the operation is not malformed or false if some error was detected.
Definition at line 73 of file obj.c.
◆ m0_op_obj_invariant()
M0_INTERNAL bool m0_op_obj_invariant |
( |
struct m0_op_obj * |
oo | ) |
|
Checks an object operation is not malformed or corrupted.
- Parameters
-
oo | object operation to be checked. |
- Returns
- true if the operation is not malformed or false if some error was detected.
Definition at line 79 of file obj.c.
◆ obj_layout_id_invariant()
static bool obj_layout_id_invariant |
( |
uint64_t |
layout_id | ) |
|
|
static |
◆ obj_namei_cb_cancel()
Cancels all the fops that are sent during launch operation
- Parameters
-
oc | operation being launched. Note the operation is of type m0_op_common although it has to be allocated as a m0_op_obj. |
Definition at line 187 of file obj.c.
◆ obj_namei_cb_fini()
'op fini entry' on the vtable for entities. This client callback gets invoked when a create/delete operation on an object gets finalised.
- Parameters
-
oc | operation being finalised. Note the operation is of type m0_op_common although it has to be allocated as a m0_op_obj. |
Definition at line 311 of file obj.c.
◆ obj_namei_cb_free()
'free entry' on the vtable for obj namespace manipulation. This callback gets invoked when freeing an operation.
- Parameters
-
oc | operation being freed. Note the operation is of type m0_op_common although it has to be allocated as a m0_op_obj. |
Definition at line 285 of file obj.c.
◆ obj_namei_cb_launch()
'launch entry' on the vtable for obj namespace manipulation. This client callback gets invoked when launching a create/delete object operation.
- Parameters
-
oc | operation being launched. Note the operation is of type m0_op_common although it has to be allocated as a m0_op_obj. |
Definition at line 219 of file obj.c.
◆ obj_namei_op_init()
static int obj_namei_op_init |
( |
struct m0_entity * |
entity, |
|
|
struct m0_op * |
op |
|
) |
| |
|
static |
Initialises a m0_obj namespace operation. The operation is intended to manage in the backend the object the provided entity is associated to.
- Parameters
-
entity | in-memory representation of the object's entity. |
op | operation being set. The operation must have been allocated as a m0_op_obj. |
- Returns
- 0 if the function completes successfully or an error code otherwise.
Definition at line 462 of file obj.c.
◆ obj_op_obj_init()
static int obj_op_obj_init |
( |
struct m0_op_obj * |
oo | ) |
|
|
static |
Initialises a m0_op_obj (i.e. an operation on an object).
- Parameters
-
oo | object operation to be initialised. |
- Returns
- 0 if success or an error code otherwise.
Get the object's pool version and optimal layout id.
TODO: hash the fid to chose a locality
Definition at line 592 of file obj.c.
◆ obj_op_obj_invariant()
static bool obj_op_obj_invariant |
( |
struct m0_op_obj * |
oo | ) |
|
|
static |
Checks an object operation is not malformed or corrupted.
- Parameters
-
oo | object operation to be checked. |
- Returns
- true if the operation is not malformed or false if some error was detected.
Definition at line 95 of file obj.c.
◆ obj_op_prepare()
Prepares a client operation to be executed on an object. Does all the generic stuff common to every operation on objects. Also allocates the operation if it has not been pre-allocated.
- Parameters
-
| entity | Entity of the obj the operation is targeted to. |
[out] | op | Operation to be prepared. The operation might have been pre-allocated. Otherwise the function allocates extra memory. |
| opcode | Specific operation code. |
- Returns
- 0 if the operation completes successfully or an error code otherwise.
Definition at line 665 of file obj.c.
◆ obj_optimal_lid_set()
Finds optimal layout id according to the object's size and sets it in m0_obj::ob_attr::oa_layout_id if it is not already set.
Definition at line 568 of file obj.c.