Motr  M0
m0_rm_resource_ops Struct Reference

#include <rm.h>

Collaboration diagram for m0_rm_resource_ops:
Collaboration graph

Data Fields

int(* rop_credit_decode )(struct m0_rm_resource *resource, struct m0_rm_credit *credit, struct m0_bufvec_cursor *cur)
 
void(* rop_policy )(struct m0_rm_resource *resource, struct m0_rm_incoming *in)
 
void(* rop_credit_init )(struct m0_rm_resource *resource, struct m0_rm_credit *credit)
 
void(* rop_resource_free )(struct m0_rm_resource *resource)
 

Detailed Description

Definition at line 334 of file rm.h.

Field Documentation

◆ rop_credit_decode

int(* rop_credit_decode) (struct m0_rm_resource *resource, struct m0_rm_credit *credit, struct m0_bufvec_cursor *cur)

Called when a new credit is allocated for the resource. The resource specific code should parse the credit description stored in the buffer and fill m0_rm_credit::cr_datum appropriately.

Definition at line 340 of file rm.h.

◆ rop_credit_init

void(* rop_credit_init) (struct m0_rm_resource *resource, struct m0_rm_credit *credit)

Called to initialise a usage credit for this resource. Sets up m0_rm_credit::cr_ops.

Definition at line 365 of file rm.h.

◆ rop_policy

void(* rop_policy) (struct m0_rm_resource *resource, struct m0_rm_incoming *in)

Decides which credit should be granted, sublet, or revoked.

"Policy" defines which credit to actually grant. E.g., a client doing a write to the first 4KB page in a file asks for [0, 4KB) extent lock. If nobody else accesses the file, RM would grant [0, ~0ULL) lock instead to avoid repeated lock requests in case of sequential IO. If there are other conflicting locks, already granted on the file, the policy might expand requested credit to the largest credit that doesn't overlap with conflicting credits. And so on, there are multiple options. So this is literally a "credit policy" as used by banks. The name stems all the way back to VAX VMS lock manager.

See also
m0_rm_incoming_policy — a list of a few predefined policies.

Definition at line 359 of file rm.h.

◆ rop_resource_free

void(* rop_resource_free) (struct m0_rm_resource *resource)

Definition at line 368 of file rm.h.


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