Motr  M0
m0_rm_credit Struct Reference

#include <rm.h>

Collaboration diagram for m0_rm_credit:
Collaboration graph

Data Fields

struct m0_rm_ownercr_owner
 
const struct m0_rm_credit_opscr_ops
 
struct m0_uint128 cr_group_id
 
m0_time_t cr_get_time
 
uint64_t cr_datum
 
struct m0_tlink cr_linkage
 
struct m0_tl cr_pins
 
uint64_t cr_magix
 

Detailed Description

A resource owner uses the resource via a usage credit (also called resource credit or simply credit as context permits). E.g., a client might have a credit of read-only, write-only, or read-write access to a certain extent in a file. An owner is granted a credit to use a resource.

The meaning of a resource credit is determined by the resource type. m0_rm_credit is allocated and managed by the generic code, but it has a scratchpad field (m0_rm_credit::cr_datum), where type specific code stores some additional information.

A credit can be something simple as a single bit (conveying, for example, an exclusive ownership of some datum) or a collection of extents tagged with access masks.

A credit is said to be "pinned" or "held" when it is necessary for some ongoing operation. A pinned credit has M0_RPF_PROTECT pins (m0_rm_pin) on its m0_rm_credit::cr_pins list. Otherwise a credit is simply "cached".

Credits are typically linked into one of m0_rm_owner lists. Pinned credits can only happen on m0_rm_owner::ro_owned[OWOS_HELD] list. They cannot be moved out of this list until unpinned.

Definition at line 500 of file rm.h.

Field Documentation

◆ cr_datum

uint64_t cr_datum

Resource type private field. By convention, 0 means "empty" credit.

Definition at line 514 of file rm.h.

◆ cr_get_time

m0_time_t cr_get_time

Time when request for this credit acquisition was raised.

Definition at line 510 of file rm.h.

◆ cr_group_id

struct m0_uint128 cr_group_id

Group id of the credit.

Definition at line 506 of file rm.h.

◆ cr_linkage

struct m0_tlink cr_linkage

Linkage of a credit (and the corresponding loan, if applicable) to a list hanging off m0_rm_owner.

Definition at line 519 of file rm.h.

◆ cr_magix

uint64_t cr_magix

Definition at line 525 of file rm.h.

◆ cr_ops

const struct m0_rm_credit_ops* cr_ops

Definition at line 502 of file rm.h.

◆ cr_owner

struct m0_rm_owner* cr_owner

Definition at line 501 of file rm.h.

◆ cr_pins

struct m0_tl cr_pins

A list of pins, linked through m0_rm_pin::rp_credit, stuck into this credit.

Definition at line 524 of file rm.h.


The documentation for this struct was generated from the following file: