Motr  M0
file.c File Reference
#include "lib/trace.h"
#include "lib/finject.h"
#include "lib/locality.h"
#include "ioservice/io_service.h"
#include "ioservice/fid_convert.h"
#include "reqh/reqh.h"
#include "reqh/reqh_service.h"
#include "sns/cm/cm.h"
#include "sns/cm/cm_utils.h"
#include "sns/cm/file.h"
#include "pool/pool.h"
Include dependency graph for file.c:

Go to the source code of this file.

Macros

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_SNSCM
 
#define _AST2FCTX(ast, field)   container_of(ast, struct m0_sns_cm_file_ctx, field)
 

Functions

static int _layout_fetch (struct m0_sns_cm_file_ctx *fctx)
 
static int _fid_layout_instance (struct m0_sns_cm_file_ctx *fctx)
 
M0_INTERNAL void m0_sns_cm_fctx_lock (struct m0_sns_cm_file_ctx *fctx)
 
M0_INTERNAL void m0_sns_cm_fctx_unlock (struct m0_sns_cm_file_ctx *fctx)
 
static uint64_t sns_cm_fctx_hash_func (const struct m0_htable *htable, const void *k)
 
static bool sns_cm_fctx_key_eq (const void *key1, const void *key2)
 
 M0_HT_DESCR_DEFINE (m0_scmfctx, "Hash of files used by sns cm", M0_INTERNAL, struct m0_sns_cm_file_ctx, sf_sc_link, sf_magic, M0_SNS_CM_FILE_CTX_MAGIC, M0_SNS_CM_MAGIC, sf_fid, sns_cm_fctx_hash_func, sns_cm_fctx_key_eq)
 
 M0_HT_DEFINE (m0_scmfctx, M0_INTERNAL, struct m0_sns_cm_file_ctx, struct m0_fid)
 
M0_INTERNAL int m0_sns_cm_fctx_state_get (struct m0_sns_cm_file_ctx *fctx)
 
static void _fctx_status_set (struct m0_sns_cm_file_ctx *fctx, int state)
 
static void __fctx_ast_post (struct m0_sns_cm_file_ctx *fctx, struct m0_sm_ast *ast)
 
static void _fctx_fini (struct m0_sm_group *grp, struct m0_sm_ast *ast)
 
static void __sns_cm_fctx_cleanup (struct m0_sns_cm_file_ctx *fctx)
 
M0_INTERNAL void m0_sns_cm_fctx_cleanup (struct m0_sns_cm *scm)
 
static void sns_cm_fctx_release (struct m0_ref *ref)
 
M0_INTERNAL void m0_sns_cm_flock_resource_set (struct m0_sns_cm *scm)
 
static void sns_cm_fctx_rm_init (struct m0_sns_cm_file_ctx *fctx)
 
static void sns_cm_fctx_rm_fini (struct m0_sns_cm_file_ctx *fctx)
 
static bool fctx_fini_clink_cb (struct m0_clink *link)
 
M0_INTERNAL int m0_sns_cm_fctx_init (struct m0_sns_cm *scm, const struct m0_fid *fid, struct m0_sns_cm_file_ctx **sc_fctx)
 
M0_INTERNAL void m0_sns_cm_fctx_fini (struct m0_sns_cm_file_ctx *fctx)
 
static int __sns_cm_file_lock (struct m0_sns_cm_file_ctx *fctx)
 
static int __sns_cm_file_oo_lock (struct m0_sns_cm_file_ctx *fctx)
 
static void __sns_cm_file_unlock (struct m0_sns_cm_file_ctx *fctx)
 
M0_INTERNAL int m0_sns_cm_file_lock_wait (struct m0_sns_cm_file_ctx *fctx, struct m0_fom *fom)
 
M0_INTERNAL int m0_sns_cm_file_lock (struct m0_sns_cm *scm, const struct m0_fid *fid, struct m0_sns_cm_file_ctx **out)
 
M0_INTERNAL struct m0_sns_cm_file_ctxm0_sns_cm_fctx_locate (struct m0_sns_cm *scm, struct m0_fid *fid)
 
M0_INTERNAL struct m0_sns_cm_file_ctxm0_sns_cm_fctx_get (struct m0_sns_cm *scm, const struct m0_cm_ag_id *id)
 
M0_INTERNAL void m0_sns_cm_fctx_put (struct m0_sns_cm *scm, const struct m0_cm_ag_id *id)
 
M0_INTERNAL void m0_sns_cm_file_unlock (struct m0_sns_cm *scm, struct m0_fid *fid)
 
static int _attr_fetch (struct m0_sns_cm_file_ctx *fctx)
 
static uint64_t max_frame (const struct m0_sns_cm_file_ctx *fctx, size_t max_cob_size)
 
static void _max_group_set (struct m0_sns_cm_file_ctx *fctx)
 
static void _attr_ast_cb (struct m0_sm_group *grp, struct m0_sm_ast *ast)
 
static void _attr_cb (void *arg, int rc)
 
static int _ios_failed_cob_attr (struct m0_sns_cm_file_ctx *fctx)
 
static struct m0_poolmachsns_cm_poolmach_get (struct m0_sns_cm_file_ctx *fctx)
 
M0_INTERNAL struct m0_pool_versionm0_sns_cm_pool_version_get (struct m0_sns_cm_file_ctx *fctx)
 
M0_INTERNAL int m0_sns_cm_file_attr_and_layout (struct m0_sns_cm_file_ctx *fctx)
 
M0_INTERNAL void m0_sns_cm_file_attr_and_layout_wait (struct m0_sns_cm_file_ctx *fctx, struct m0_fom *fom)
 
M0_INTERNAL void m0_sns_cm_file_fwd_map (struct m0_sns_cm_file_ctx *fctx, const struct m0_pdclust_src_addr *sa, struct m0_pdclust_tgt_addr *ta)
 
M0_INTERNAL void m0_sns_cm_file_bwd_map (struct m0_sns_cm_file_ctx *fctx, const struct m0_pdclust_tgt_addr *ta, struct m0_pdclust_src_addr *sa)
 
M0_INTERNAL uint64_t m0_sns_cm_file_data_units (struct m0_sns_cm_file_ctx *fctx)
 
M0_INTERNAL bool m0_sns_cm_file_unit_is_EOF (struct m0_pdclust_layout *pl, uint64_t nr_max_data_units, uint64_t group, uint32_t unit)
 

Variables

const struct m0_uint128 m0_rm_sns_cm_group = M0_UINT128(0, 2)
 
const struct m0_rm_resource_type_ops file_lock_type_ops
 
static struct m0_sm_state_descr fctx_sd [M0_SCFS_NR]
 
static const struct m0_sm_conf fctx_sm_conf
 
const struct m0_rm_incoming_ops file_lock_incoming_ops
 

Macro Definition Documentation

◆ M0_TRACE_SUBSYSTEM

#define M0_TRACE_SUBSYSTEM   M0_TRACE_SUBSYS_SNSCM

Definition at line 23 of file file.c.