#include <lustre_log.h>
#include "mdt_internal.h"
-void dump_llog_agent_req_rec(char *prefix, struct llog_agent_req_rec *larr)
+void dump_llog_agent_req_rec(const char *prefix,
+ const struct llog_agent_req_rec *larr)
{
char buf[12];
int sz;
ENTRY;
lctxt = llog_get_context(obd, LLOG_AGENT_ORIG_CTXT);
- if ((lctxt == NULL) || (lctxt->loc_handle == NULL))
+ if (lctxt == NULL || lctxt->loc_handle == NULL)
RETURN(-ENOENT);
- down(&cdt->cdt_llog_lock);
+ mutex_lock(&cdt->cdt_llog_lock);
rc = llog_cat_process(env, lctxt->loc_handle, cb, data, 0, 0);
if (rc < 0)
rc = 0;
llog_ctxt_put(lctxt);
- up(&cdt->cdt_llog_lock);
+ mutex_unlock(&cdt->cdt_llog_lock);
RETURN(rc);
}
memcpy(&larr->arr_hai, hai, hai->hai_len);
lctxt = llog_get_context(obd, LLOG_AGENT_ORIG_CTXT);
- if ((lctxt == NULL) || (lctxt->loc_handle == NULL))
+ if (lctxt == NULL || lctxt->loc_handle == NULL)
GOTO(free, rc = -ENOENT);
- down(&cdt->cdt_llog_lock);
+ mutex_lock(&cdt->cdt_llog_lock);
/* in case of cancel request, the cookie is already set to the
* value of the request cookie to be cancelled
if (rc > 0)
rc = 0;
- up(&cdt->cdt_llog_lock);
+ mutex_unlock(&cdt->cdt_llog_lock);
llog_ctxt_put(lctxt);
EXIT;
* the 1st has to be set to ARS_CANCELED and the 2nd to ARS_SUCCEED
*/
if (agent_req_in_final_state(larr->arr_status) ||
- ((larr->arr_hai.hai_action == HSMA_CANCEL) &&
- (ducb->status == ARS_CANCELED)))
+ (larr->arr_hai.hai_action == HSMA_CANCEL &&
+ ducb->status == ARS_CANCELED))
RETURN(0);
rc = 0;
aai->aai_magic);
aai->aai_ctxt = llog_get_context(aai->aai_obd, LLOG_AGENT_ORIG_CTXT);
- if ((aai->aai_ctxt == NULL) || (aai->aai_ctxt->loc_handle == NULL)) {
+ if (aai->aai_ctxt == NULL || aai->aai_ctxt->loc_handle == NULL) {
CERROR("llog_get_context() failed\n");
RETURN(ERR_PTR(-ENOENT));
}
struct mdt_device *mdt;
ENTRY;
- if (LPROCFS_ENTRY_AND_CHECK(PDE(inode)))
+ if (LPROCFS_ENTRY_CHECK(PDE(inode)))
RETURN(-ENOENT);
rc = seq_open(file, &mdt_agent_actions_proc_ops);
- if (rc) {
- LPROCFS_EXIT();
+ if (rc)
RETURN(rc);
- }
OBD_ALLOC_PTR(aai);
if (aai == NULL)