22 #define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_SPIEL 82 .sd_name =
"Conf_flip_Prepare",
87 .sd_name =
"Conf_Flip_Apply",
141 return M0_RC(-ENOMEM);
173 fd = open(
filename, O_TRUNC | O_CREAT | O_WRONLY, 0700);
249 char *conf_filename =
NULL;
251 char *confd_buffer =
NULL;
291 }
else if (new_cache !=
NULL)
294 if (confd_buffer !=
NULL)
378 #undef M0_TRACE_SUBSYSTEM
#define M0_CONFD_FID(old_version, new_version, tx_id)
static size_t conf_flip_fom_home_locality(const struct m0_fom *fom)
void m0_fom_phase_moveif(struct m0_fom *fom, int32_t rc, int phase0, int phase1)
static int conf_flip_prepare(struct m0_fom *)
struct m0_fop_type m0_fop_conf_flip_rep_fopt
#define M0_LOG(level,...)
M0_INTERNAL int m0_file_read(const char *path, char **out)
void(* m0_rconfc_cb_t)(struct m0_rconfc *rconfc)
int(* fto_create)(struct m0_fop *fop, struct m0_fom **out, struct m0_reqh *reqh)
M0_INTERNAL void m0_rconfc_stop_sync(struct m0_rconfc *rconfc)
M0_INTERNAL void m0_free_aligned(void *data, size_t size, unsigned shift)
struct m0_rpc_machine * rc_rmach
#define container_of(ptr, type, member)
struct m0_fop_getxattr_rep * rep
static int conf_after_flip_apply(struct m0_reqh *reqh, const char *filename)
struct m0_fom_type ft_fom_type
struct m0_mutex d_cache_lock
M0_INTERNAL uint32_t m0_stob_block_shift(struct m0_stob *stob)
M0_TL_DECLARE(m0_conf_cache, M0_INTERNAL, struct m0_conf_obj)
M0_INTERNAL int m0_confd_service_to_filename(struct m0_reqh_service *service, char **dbpath)
void m0_fom_init(struct m0_fom *fom, const struct m0_fom_type *fom_type, const struct m0_fom_ops *ops, struct m0_fop *fop, struct m0_fop *reply, struct m0_reqh *reqh)
struct m0_fop_type * f_type
static int conf_flip_fom_tick(struct m0_fom *fom)
static int conf_flip_apply(struct m0_fom *)
static int conf_flip_confd_config_save(char *filename, char *buffer)
return M0_ERR(-EOPNOTSUPP)
void m0_confd_stob_fini(struct m0_stob *stob)
M0_INTERNAL int m0_conf_stob_location_generate(struct m0_fom *fom, char **location)
int m0_fom_tick_generic(struct m0_fom *fom)
void m0_fom_fini(struct m0_fom *fom)
static struct m0_stob * stob
const struct m0_fom_ops conf_flip_fom_ops
const struct m0_bob_type m0_confd_bob
#define bob_of(ptr, type, field, bt)
M0_INTERNAL int m0_confd_cache_create(struct m0_conf_cache **out, struct m0_mutex *cache_lock, const char *confstr)
int m0_confd_stob_init(struct m0_stob **stob, const char *location, struct m0_fid *confd_fid)
M0_INTERNAL bool m0_rconfc_is_preloaded(struct m0_rconfc *rconfc)
struct m0_sm_group * sm_grp
static int m0_rconfc_start_sync(struct m0_rconfc *rconfc)
M0_INTERNAL void m0_confd_cache_destroy(struct m0_conf_cache *cache)
uint32_t cff_prev_version
struct m0_sm_conf conf_flip_conf
M0_INTERNAL void m0_rconfc_fini(struct m0_rconfc *rconfc)
struct m0_fop * m0_fop_reply_alloc(struct m0_fop *req, struct m0_fop_type *rept)
struct m0_conf_cache * d_cache
uint32_t cff_next_version
m0_rconfc_cb_t rc_expired_cb
static struct m0_fid profile
#define M0_FI_ENABLED(tag)
#define M0_ALLOC_PTR(ptr)
const struct m0_fom_type_ops conf_flip_fom_type_ops
M0_INTERNAL int m0_fom_rc(const struct m0_fom *fom)
static struct m0_fop * fop
struct m0t1fs_filedata * fd
static struct m0_rconfc * rconfc(struct m0_client *m0c)
void(* fo_fini)(struct m0_fom *fom)
struct m0_rconfc rh_rconfc
int m0_confd_stob_read(struct m0_stob *stob, char **str)
M0_INTERNAL int m0_rconfc_init(struct m0_rconfc *rconfc, const struct m0_fid *profile, struct m0_sm_group *sm_group, struct m0_rpc_machine *rmach, m0_rconfc_cb_t expired_cb, m0_rconfc_cb_t ready_cb)
M0_INTERNAL struct m0_fop_conf_flip * m0_conf_fop_to_flip_fop(const struct m0_fop *fop)
void m0_fom_phase_set(struct m0_fom *fom, int phase)
static bool conf_flip_fom_invariant(const struct m0_conf_flip_fom *fom)
M0_INTERNAL bool m0_is_conf_flip_fop(const struct m0_fop *fop)
M0_INTERNAL int m0_conf_flip_fom_create(struct m0_fop *fop, struct m0_fom **out, struct m0_reqh *reqh)
struct m0_sm_state_descr conf_flip_phases[]
M0_INTERNAL struct m0_reqh * m0_fom2reqh(const struct m0_fom *fom)
M0_INTERNAL struct m0_fop_conf_flip_rep * m0_conf_fop_to_flip_fop_rep(const struct m0_fop *fop)
static void conf_flip_fom_fini(struct m0_fom *fom)
m0_rconfc_cb_t rc_ready_cb