void jnl_wait(gd_region *reg) { jnl_private_control *jpc; sgmnt_addrs *csa; uint4 status; if ((NULL != reg) && (TRUE == reg->open)) { csa = &FILE_INFO(reg)->s_addrs; jpc = csa->jnl; if ((TRUE == JNL_ENABLED(csa->hdr)) && (NULL != jpc)) { /* wait on jnl writes for region */ status = jnl_write_attempt(jpc, jpc->new_freeaddr); if (SS_NORMAL == status && !JNL_FILE_SWITCHED(jpc)) jnl_fsync(reg, jpc->new_freeaddr); } } return; }
void jnl_flush(gd_region *reg) { sgmnt_addrs *csa; jnl_private_control *jpc; jnl_buffer_ptr_t jb; if (!reg || !reg->open) return; csa = &FILE_INFO(reg)->s_addrs; assert(csa->now_crit); jpc = csa->jnl; if (!JNL_ENABLED(csa->hdr) || (NULL == jpc) || (NOJNL == jpc->channel)) return; jb = jpc->jnl_buff; jb->blocked = process_id; if (jb->freeaddr != jb->dskaddr && SS_NORMAL != jnl_write_attempt(jpc, jb->freeaddr)) return; assert(jb->dskaddr == jb->freeaddr); jb->blocked = 0; return; }