Motr  M0
Distributed File Lock Internals
Collaboration diagram for Distributed File Lock Internals:

Macros

#define R_F(resource)   container_of(resource, struct m0_file, fi_res)
 

Functions

static bool file_lock_equal (const struct m0_rm_resource *resource0, const struct m0_rm_resource *resource1)
 
static m0_bcount_t file_lock_len (const struct m0_rm_resource *resource)
 
static int file_lock_encode (struct m0_bufvec_cursor *cur, const struct m0_rm_resource *resource)
 
static int file_lock_decode (struct m0_bufvec_cursor *cur, struct m0_rm_resource **resource)
 
static void file_lock_credit_init (struct m0_rm_resource *resource, struct m0_rm_credit *credit)
 
static void file_lock_resource_free (struct m0_rm_resource *resource)
 
static void file_lock_incoming_complete (struct m0_rm_incoming *in, int32_t rc)
 
static void file_lock_incoming_conflict (struct m0_rm_incoming *in)
 
static bool file_lock_cr_intersects (const struct m0_rm_credit *self, const struct m0_rm_credit *c1)
 
static m0_bcount_t file_lock_cr_len (const struct m0_rm_credit *c0)
 
static int file_lock_cr_join (struct m0_rm_credit *self, const struct m0_rm_credit *c1)
 
static int file_lock_cr_disjoin (struct m0_rm_credit *self, const struct m0_rm_credit *c1, struct m0_rm_credit *intersection)
 
static int file_lock_cr_copy (struct m0_rm_credit *dest, const struct m0_rm_credit *self)
 
static int file_lock_cr_diff (struct m0_rm_credit *self, const struct m0_rm_credit *c1)
 
static bool file_lock_cr_conflicts (const struct m0_rm_credit *self, const struct m0_rm_credit *c1)
 
static bool file_lock_cr_is_subset (const struct m0_rm_credit *self, const struct m0_rm_credit *c1)
 
static int file_lock_cr_encode (struct m0_rm_credit *self, struct m0_bufvec_cursor *cur)
 
static int file_lock_cr_decode (struct m0_rm_credit *self, struct m0_bufvec_cursor *cur)
 
static void file_lock_cr_free (struct m0_rm_credit *self)
 
static void file_lock_cr_initial_capital (struct m0_rm_credit *self)
 
static int file_lock_encdec (struct m0_file *file, struct m0_bufvec_cursor *cur, enum m0_xcode_what what)
 
static bool file_lock_credit_invariant (const struct m0_rm_credit *file_cr)
 
static int file_lock_cr_encdec (struct m0_rm_credit *self, struct m0_bufvec_cursor *cur, enum m0_xcode_what what)
 

Variables

const struct m0_rm_resource_type_ops file_lock_type_ops
 
const struct m0_rm_resource_ops file_lock_ops
 
const struct m0_rm_credit_ops file_lock_credit_ops
 
const struct m0_rm_incoming_ops file_lock_incoming_ops
 

Detailed Description

This section contains the functions that are internal to the distributed file lock. They implement various resource manager ops.

See also
Overview and Logical Specification

Macro Definition Documentation

◆ R_F

#define R_F (   resource)    container_of(resource, struct m0_file, fi_res)

Definition at line 220 of file file.c.

Function Documentation

◆ file_lock_cr_conflicts()

static bool file_lock_cr_conflicts ( const struct m0_rm_credit self,
const struct m0_rm_credit c1 
)
static

Definition at line 418 of file file.c.

Here is the call graph for this function:

◆ file_lock_cr_copy()

static int file_lock_cr_copy ( struct m0_rm_credit dest,
const struct m0_rm_credit self 
)
static

Definition at line 393 of file file.c.

Here is the call graph for this function:

◆ file_lock_cr_decode()

static int file_lock_cr_decode ( struct m0_rm_credit self,
struct m0_bufvec_cursor cur 
)
static

Definition at line 455 of file file.c.

Here is the call graph for this function:

◆ file_lock_cr_diff()

static int file_lock_cr_diff ( struct m0_rm_credit self,
const struct m0_rm_credit c1 
)
static

Definition at line 406 of file file.c.

Here is the call graph for this function:

◆ file_lock_cr_disjoin()

static int file_lock_cr_disjoin ( struct m0_rm_credit self,
const struct m0_rm_credit c1,
struct m0_rm_credit intersection 
)
static

Definition at line 386 of file file.c.

Here is the call graph for this function:

◆ file_lock_cr_encdec()

static int file_lock_cr_encdec ( struct m0_rm_credit self,
struct m0_bufvec_cursor cur,
enum m0_xcode_what  what 
)
static

Definition at line 436 of file file.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ file_lock_cr_encode()

static int file_lock_cr_encode ( struct m0_rm_credit self,
struct m0_bufvec_cursor cur 
)
static

Definition at line 448 of file file.c.

Here is the call graph for this function:

◆ file_lock_cr_free()

static void file_lock_cr_free ( struct m0_rm_credit self)
static

Definition at line 461 of file file.c.

◆ file_lock_cr_initial_capital()

static void file_lock_cr_initial_capital ( struct m0_rm_credit self)
static

Definition at line 466 of file file.c.

◆ file_lock_cr_intersects()

static bool file_lock_cr_intersects ( const struct m0_rm_credit self,
const struct m0_rm_credit c1 
)
static

Definition at line 357 of file file.c.

Here is the call graph for this function:

◆ file_lock_cr_is_subset()

static bool file_lock_cr_is_subset ( const struct m0_rm_credit self,
const struct m0_rm_credit c1 
)
static

Definition at line 428 of file file.c.

Here is the call graph for this function:

◆ file_lock_cr_join()

static int file_lock_cr_join ( struct m0_rm_credit self,
const struct m0_rm_credit c1 
)
static

Definition at line 380 of file file.c.

◆ file_lock_cr_len()

static m0_bcount_t file_lock_cr_len ( const struct m0_rm_credit c0)
static

Definition at line 366 of file file.c.

Here is the call graph for this function:

◆ file_lock_credit_init()

static void file_lock_credit_init ( struct m0_rm_resource resource,
struct m0_rm_credit credit 
)
static

Initialises credit (lock state) and ops vector for the file_lock

Definition at line 321 of file file.c.

◆ file_lock_credit_invariant()

static bool file_lock_credit_invariant ( const struct m0_rm_credit file_cr)
static

Definition at line 352 of file file.c.

Here is the caller graph for this function:

◆ file_lock_decode()

static int file_lock_decode ( struct m0_bufvec_cursor cur,
struct m0_rm_resource **  resource 
)
static

Decode file_lock - from the wire

Definition at line 295 of file file.c.

Here is the call graph for this function:

◆ file_lock_encdec()

static int file_lock_encdec ( struct m0_file file,
struct m0_bufvec_cursor cur,
enum m0_xcode_what  what 
)
static
  • Todo:
    ->rto_decode() decode for file resource should create an entire ambient object: an inode on client and a cob on server.

Definition at line 258 of file file.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ file_lock_encode()

static int file_lock_encode ( struct m0_bufvec_cursor cur,
const struct m0_rm_resource resource 
)
static

Encode file_lock - ready to send over the wire

Definition at line 280 of file file.c.

Here is the call graph for this function:

◆ file_lock_equal()

static bool file_lock_equal ( const struct m0_rm_resource resource0,
const struct m0_rm_resource resource1 
)
static

Compare Ids of two file locks

Definition at line 223 of file file.c.

Here is the call graph for this function:

◆ file_lock_incoming_complete()

static void file_lock_incoming_complete ( struct m0_rm_incoming in,
int32_t  rc 
)
static

Lock request completion callback

Definition at line 339 of file file.c.

◆ file_lock_incoming_conflict()

static void file_lock_incoming_conflict ( struct m0_rm_incoming in)
static

Lock request conflict callback

Definition at line 346 of file file.c.

◆ file_lock_len()

static m0_bcount_t file_lock_len ( const struct m0_rm_resource resource)
static

Definition at line 237 of file file.c.

Here is the call graph for this function:

◆ file_lock_resource_free()

static void file_lock_resource_free ( struct m0_rm_resource resource)
static

Definition at line 329 of file file.c.

Here is the call graph for this function:

Variable Documentation

◆ file_lock_credit_ops

const struct m0_rm_credit_ops file_lock_credit_ops
Initial value:
= {
.cro_intersects = file_lock_cr_intersects,
.cro_join = file_lock_cr_join,
.cro_copy = file_lock_cr_copy,
.cro_diff = file_lock_cr_diff,
.cro_free = file_lock_cr_free,
.cro_encode = file_lock_cr_encode,
.cro_decode = file_lock_cr_decode,
.cro_len = file_lock_cr_len,
.cro_is_subset = file_lock_cr_is_subset,
.cro_disjoin = file_lock_cr_disjoin,
.cro_conflicts = file_lock_cr_conflicts,
.cro_initial_capital = file_lock_cr_initial_capital,
}
static void file_lock_cr_free(struct m0_rm_credit *self)
Definition: file.c:461
static int file_lock_cr_copy(struct m0_rm_credit *dest, const struct m0_rm_credit *self)
Definition: file.c:393
static int file_lock_cr_join(struct m0_rm_credit *self, const struct m0_rm_credit *c1)
Definition: file.c:380
static m0_bcount_t file_lock_cr_len(const struct m0_rm_credit *c0)
Definition: file.c:366
static bool file_lock_cr_intersects(const struct m0_rm_credit *self, const struct m0_rm_credit *c1)
Definition: file.c:357
static int file_lock_cr_decode(struct m0_rm_credit *self, struct m0_bufvec_cursor *cur)
Definition: file.c:455
static int file_lock_cr_diff(struct m0_rm_credit *self, const struct m0_rm_credit *c1)
Definition: file.c:406
static int file_lock_cr_disjoin(struct m0_rm_credit *self, const struct m0_rm_credit *c1, struct m0_rm_credit *intersection)
Definition: file.c:386
static bool file_lock_cr_conflicts(const struct m0_rm_credit *self, const struct m0_rm_credit *c1)
Definition: file.c:418
static void file_lock_cr_initial_capital(struct m0_rm_credit *self)
Definition: file.c:466
static bool file_lock_cr_is_subset(const struct m0_rm_credit *self, const struct m0_rm_credit *c1)
Definition: file.c:428
static int file_lock_cr_encode(struct m0_rm_credit *self, struct m0_bufvec_cursor *cur)
Definition: file.c:448

Definition at line 200 of file file.c.

◆ file_lock_incoming_ops

const struct m0_rm_incoming_ops file_lock_incoming_ops
Initial value:
= {
.rio_complete = file_lock_incoming_complete,
}
static void file_lock_incoming_complete(struct m0_rm_incoming *in, int32_t rc)
Definition: file.c:339
static void file_lock_incoming_conflict(struct m0_rm_incoming *in)
Definition: file.c:346

Definition at line 215 of file file.c.

◆ file_lock_ops

const struct m0_rm_resource_ops file_lock_ops
Initial value:
= {
.rop_credit_init = file_lock_credit_init,
.rop_resource_free = file_lock_resource_free,
}
static void file_lock_credit_init(struct m0_rm_resource *resource, struct m0_rm_credit *credit)
Definition: file.c:321
static void file_lock_resource_free(struct m0_rm_resource *resource)
Definition: file.c:329

Definition at line 195 of file file.c.

◆ file_lock_type_ops

const struct m0_rm_resource_type_ops file_lock_type_ops
Initial value:
= {
.rto_eq = file_lock_equal,
.rto_len = file_lock_len,
.rto_decode = file_lock_decode,
.rto_encode = file_lock_encode,
}
static int file_lock_encode(struct m0_bufvec_cursor *cur, const struct m0_rm_resource *resource)
Definition: file.c:280
static int file_lock_decode(struct m0_bufvec_cursor *cur, struct m0_rm_resource **resource)
Definition: file.c:295
static m0_bcount_t file_lock_len(const struct m0_rm_resource *resource)
Definition: file.c:237
static bool file_lock_equal(const struct m0_rm_resource *resource0, const struct m0_rm_resource *resource1)
Definition: file.c:223

Definition at line 188 of file file.c.