iops->put(env, di);
}
-static int lfsck_parent_fid(const struct lu_env *env, struct dt_object *obj,
- struct lu_fid *fid)
-{
- if (unlikely(!S_ISDIR(lfsck_object_type(obj)) ||
- !dt_try_as_dir(env, obj)))
- return -ENOTDIR;
-
- return dt_lookup(env, obj, (struct dt_rec *)fid,
- (const struct dt_key *)"..");
-}
-
/**
* Check whether needs to scan the directory or not.
*
if (rc < 0 && rc != -ENODATA)
GOTO(out, rc);
- rc = lfsck_parent_fid(env, obj, fid);
+ rc = dt_lookup_dir(env, obj, dotdot, fid);
if (depth > 0)
lfsck_object_put(env, obj);
else
stripes = lmv->lmv_stripe_count;
- OBD_ALLOC_LARGE(lslr, sizeof(*lslr) * stripes);
+ OBD_ALLOC_PTR_ARRAY_LARGE(lslr, stripes);
if (lslr == NULL) {
OBD_FREE_PTR(llmv);
lfsck->li_pos_checkpoint.lp_oit_cookie,
lfsck->li_pos_checkpoint.lp_dir_cookie,
PFID(&lfsck->li_pos_checkpoint.lp_dir_parent),
- current_pid());
+ current->pid);
spin_lock(&lfsck->li_lock);
if (unlikely(!thread_is_starting(thread))) {
lfsck->li_pos_checkpoint.lp_oit_cookie,
lfsck->li_pos_checkpoint.lp_dir_cookie,
PFID(&lfsck->li_pos_checkpoint.lp_dir_parent),
- current_pid(), rc);
+ current->pid, rc);
if (!OBD_FAIL_CHECK(OBD_FAIL_LFSCK_CRASH))
rc = lfsck_post(env, lfsck, rc);
struct lfsck_assistant_data *lad = com->lc_data;
struct ptlrpc_thread *mthread = &lfsck->li_thread;
struct ptlrpc_thread *athread = &lad->lad_thread;
- struct lfsck_assistant_operations *lao = lad->lad_ops;
+ const struct lfsck_assistant_operations *lao = lad->lad_ops;
struct lfsck_assistant_req *lar;
- struct l_wait_info lwi = { 0 };
int rc = 0;
int rc1 = 0;
int rc2;
GOTO(cleanup, rc);
}
- l_wait_event(athread->t_ctl_waitq,
- !lfsck_assistant_req_empty(lad) ||
- test_bit(LAD_EXIT, &lad->lad_flags) ||
- test_bit(LAD_TO_POST, &lad->lad_flags) ||
- test_bit(LAD_TO_DOUBLE_SCAN, &lad->lad_flags),
- &lwi);
+ wait_event_idle(athread->t_ctl_waitq,
+ !lfsck_assistant_req_empty(lad) ||
+ test_bit(LAD_EXIT, &lad->lad_flags) ||
+ test_bit(LAD_TO_POST, &lad->lad_flags) ||
+ test_bit(LAD_TO_DOUBLE_SCAN, &lad->lad_flags));
if (unlikely(test_bit(LAD_EXIT, &lad->lad_flags)))
GOTO(cleanup, rc = lad->lad_post_result);