LLOG_LCM_FL_EXIT = 1 << 1
};
-/**
+/**
* Allocate new llcd from cache, init it and return to caller.
* Bumps number of objects allocated.
*/
struct llog_canceld_ctxt *llcd;
int llcd_size;
- /*
+ /*
* Payload of lustre_msg V2 is bigger.
*/
- llcd_size = CFS_PAGE_SIZE -
+ llcd_size = CFS_PAGE_SIZE -
lustre_msg_size(LUSTRE_MSG_MAGIC_V2, 1, NULL);
llcd_size += offsetof(struct llog_canceld_ctxt, llcd_cookies);
OBD_SLAB_ALLOC(llcd, llcd_cache, CFS_ALLOC_STD, llcd_size);
/**
* Copy passed @cookies to @llcd.
*/
-static void llcd_copy(struct llog_canceld_ctxt *llcd,
+static void llcd_copy(struct llog_canceld_ctxt *llcd,
struct llog_cookie *cookies)
{
- memcpy((char *)llcd->llcd_cookies + llcd->llcd_cookiebytes,
+ memcpy((char *)llcd->llcd_cookies + llcd->llcd_cookiebytes,
cookies, sizeof(*cookies));
llcd->llcd_cookiebytes += sizeof(*cookies);
}
static int llcd_fit(struct llog_canceld_ctxt *llcd,
struct llog_cookie *cookies)
{
- return (llcd->llcd_size -
+ return (llcd->llcd_size -
llcd->llcd_cookiebytes) >= sizeof(*cookies);
}
-static void llcd_print(struct llog_canceld_ctxt *llcd,
- const char *func, int line)
+static void llcd_print(struct llog_canceld_ctxt *llcd,
+ const char *func, int line)
{
CDEBUG(D_RPCTRACE, "Llcd (%p) at %s:%d:\n", llcd, func, line);
CDEBUG(D_RPCTRACE, " size: %d\n", llcd->llcd_size);
* sending result. Error is passed in @rc. Note, that this will be called
* in cleanup time when all inflight rpcs aborted.
*/
-static int
+static int
llcd_interpret(const struct lu_env *env,
struct ptlrpc_request *req, void *noused, int rc)
{
llcd_free(llcd);
return 0;
}
-
+
/**
* Send @llcd to remote node. Free llcd uppon completion or error. Sending
- * is performed in async style so this function will return asap without
+ * is performed in async style so this function will return asap without
* blocking.
*/
static int llcd_send(struct llog_canceld_ctxt *llcd)
ctxt = llcd->llcd_ctxt;
if (!ctxt) {
- CERROR("Invalid llcd with NULL ctxt found (%p)\n",
+ CERROR("Invalid llcd with NULL ctxt found (%p)\n",
llcd);
llcd_print(llcd, __FUNCTION__, __LINE__);
LBUG();
GOTO(exit, rc = 0);
lcm = llcd->llcd_lcm;
-
- /*
+
+ /*
* Check if we're in exit stage. Do not send llcd in
- * this case.
+ * this case.
*/
if (test_bit(LLOG_LCM_FL_EXIT, &lcm->lcm_flags))
GOTO(exit, rc = -ENODEV);
CDEBUG(D_RPCTRACE, "Sending llcd %p\n", llcd);
import = llcd->llcd_ctxt->loc_imp;
- if (!import || (import == LP_POISON) ||
+ if (!import || (import == LP_POISON) ||
(import->imp_client == LP_POISON)) {
- CERROR("Invalid import %p for llcd %p\n",
+ CERROR("Invalid import %p for llcd %p\n",
import, llcd);
GOTO(exit, rc = -ENODEV);
}
OBD_FAIL_TIMEOUT(OBD_FAIL_PTLRPC_DELAY_RECOV, 10);
/*
- * No need to get import here as it is already done in
+ * No need to get import here as it is already done in
* llog_receptor_accept().
*/
req = ptlrpc_request_alloc(import, &RQF_LOG_CANCEL);
if (req == NULL) {
- CERROR("Can't allocate request for sending llcd %p\n",
+ CERROR("Can't allocate request for sending llcd %p\n",
llcd);
GOTO(exit, rc = -ENOMEM);
}
}
atomic_dec(&lcm->lcm_count);
ctxt->loc_llcd = NULL;
-
- CDEBUG(D_RPCTRACE, "Detach llcd %p from ctxt %p (%d)\n",
+
+ CDEBUG(D_RPCTRACE, "Detach llcd %p from ctxt %p (%d)\n",
llcd, ctxt, atomic_read(&lcm->lcm_count));
llog_ctxt_put(ctxt);
int rc;
/*
- * Make sure that this llcd will not be sent again as we detach
+ * Make sure that this llcd will not be sent again as we detach
* it from ctxt.
*/
llcd = llcd_detach(ctxt);
llcd_print(llcd, __FUNCTION__, __LINE__);
LBUG();
}
-
+
rc = llcd_send(llcd);
if (rc)
CERROR("Couldn't send llcd %p (%d)\n", llcd, rc);
rc = ptlrpcd_start(lcm->lcm_name, &lcm->lcm_pc);
if (rc) {
- CERROR("Error %d while starting recovery thread %s\n",
+ CERROR("Error %d while starting recovery thread %s\n",
rc, lcm->lcm_name);
RETURN(rc);
}
ENTRY;
/**
- * Let all know that we're stopping. This will also make
+ * Let all know that we're stopping. This will also make
* llcd_send() refuse any new llcds.
*/
set_bit(LLOG_LCM_FL_EXIT, &lcm->lcm_flags);
/*
* Try to create threads with unique names.
*/
- snprintf(lcm->lcm_name, sizeof(lcm->lcm_name),
+ snprintf(lcm->lcm_name, sizeof(lcm->lcm_name),
"ll_log_commit_%s", name);
strncpy(lcm->lcm_name, name, sizeof(lcm->lcm_name));
}
EXPORT_SYMBOL(llog_recov_thread_fini);
-static int llog_recov_thread_replay(struct llog_ctxt *ctxt,
+static int llog_recov_thread_replay(struct llog_ctxt *ctxt,
void *cb, void *arg)
{
struct obd_device *obd = ctxt->loc_obd;
OBD_FREE_PTR(lpca);
RETURN(-ENODEV);
}
- rc = cfs_kernel_thread(llog_cat_process_thread, lpca,
+ rc = cfs_kernel_thread(llog_cat_process_thread, lpca,
CLONE_VM | CLONE_FILES);
if (rc < 0) {
CERROR("Error starting llog_cat_process_thread(): %d\n", rc);
int rc;
ENTRY;
- /*
+ /*
* Send back cached llcd from llog before recovery if we have any.
* This is void is nothing cached is found there.
*/
llog_sync(ctxt, NULL);
- /*
- * Start recovery in separate thread.
+ /*
+ * Start recovery in separate thread.
*/
mutex_down(&ctxt->loc_sem);
ctxt->loc_gen = *gen;
}
EXPORT_SYMBOL(llog_obd_repl_connect);
-/**
+/**
* Deleted objects have a commit callback that cancels the MDS
* log record for the deletion. The commit callback calls this
* function.
mutex_down(&ctxt->loc_sem);
lcm = ctxt->loc_lcm;
-
+
/*
* Let's check if we have all structures alive. We also check for
* possible shutdown. Do nothing if we're stopping.
}
if (test_bit(LLOG_LCM_FL_EXIT, &lcm->lcm_flags)) {
- CDEBUG(D_RPCTRACE, "Commit thread is stopping for ctxt %p\n",
+ CDEBUG(D_RPCTRACE, "Commit thread is stopping for ctxt %p\n",
ctxt);
GOTO(out, rc = -ENODEV);
}
if (count > 0 && cookies != NULL) {
/*
- * Get new llcd from ctxt if required.
+ * Get new llcd from ctxt if required.
*/
if (!llcd) {
llcd = llcd_get(ctxt);
}
/*
- * Llcd does not have enough room for @cookies. Let's push
- * it out and allocate new one.
+ * Llcd does not have enough room for @cookies. Let's push
+ * it out and allocate new one.
*/
if (!llcd_fit(llcd, cookies)) {
rc = llcd_push(ctxt);
{
int llcd_size;
- llcd_size = CFS_PAGE_SIZE -
+ llcd_size = CFS_PAGE_SIZE -
lustre_msg_size(LUSTRE_MSG_MAGIC_V2, 1, NULL);
llcd_size += offsetof(struct llog_canceld_ctxt, llcd_cookies);
llcd_cache = cfs_mem_cache_create("llcd_cache", llcd_size, 0, 0);
void llog_recov_fini(void)
{
/*
- * Kill llcd cache when thread is stopped and we're sure no
+ * Kill llcd cache when thread is stopped and we're sure no
* llcd in use left.
*/
if (llcd_cache) {
* In 2.6.22 cfs_mem_cache_destroy() will not return error
* for busy resources. Let's check it another way.
*/
- LASSERTF(atomic_read(&llcd_count) == 0,
+ LASSERTF(atomic_read(&llcd_count) == 0,
"Can't destroy llcd cache! Number of "
"busy llcds: %d\n", atomic_read(&llcd_count));
cfs_mem_cache_destroy(llcd_cache);