Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
LU-3496 lprocfs: implement log2 using bitops
[fs/lustre-release.git]
/
lustre
/
lfsck
/
lfsck_lib.c
diff --git
a/lustre/lfsck/lfsck_lib.c
b/lustre/lfsck/lfsck_lib.c
index
fc612fc
..
0da2614
100644
(file)
--- a/
lustre/lfsck/lfsck_lib.c
+++ b/
lustre/lfsck/lfsck_lib.c
@@
-100,7
+100,7
@@
static inline void lfsck_component_put(const struct lu_env *env,
{
if (atomic_dec_and_test(&com->lc_ref)) {
if (com->lc_obj != NULL)
- lu_object_put(env, &com->lc_obj->do_lu);
+ lu_object_put
_nocache
(env, &com->lc_obj->do_lu);
if (com->lc_file_ram != NULL)
OBD_FREE(com->lc_file_ram, com->lc_file_size);
if (com->lc_file_disk != NULL)
@@
-167,7
+167,7
@@
static void lfsck_instance_cleanup(const struct lu_env *env,
LASSERT(thread_is_init(thread) || thread_is_stopped(thread));
if (lfsck->li_obj_oit != NULL) {
- lu_object_put(env, &lfsck->li_obj_oit->do_lu);
+ lu_object_put
_nocache
(env, &lfsck->li_obj_oit->do_lu);
lfsck->li_obj_oit = NULL;
}
@@
-197,7
+197,7
@@
static void lfsck_instance_cleanup(const struct lu_env *env,
}
if (lfsck->li_bookmark_obj != NULL) {
- lu_object_put(env, &lfsck->li_bookmark_obj->do_lu);
+ lu_object_put
_nocache
(env, &lfsck->li_bookmark_obj->do_lu);
lfsck->li_bookmark_obj = NULL;
}
@@
-206,11
+206,6
@@
static void lfsck_instance_cleanup(const struct lu_env *env,
lfsck->li_los = NULL;
}
- if (lfsck->li_local_root != NULL) {
- lu_object_put(env, &lfsck->li_local_root->do_lu);
- lfsck->li_local_root = NULL;
- }
-
OBD_FREE_PTR(lfsck);
}
@@
-372,12
+367,12
@@
static void __lfsck_set_speed(struct lfsck_instance *lfsck, __u32 limit)
{
lfsck->li_bookmark_ram.lb_speed_limit = limit;
if (limit != LFSCK_SPEED_NO_LIMIT) {
- if (limit >
CFS_
HZ) {
- lfsck->li_sleep_rate = limit /
CFS_
HZ;
+ if (limit > HZ) {
+ lfsck->li_sleep_rate = limit / HZ;
lfsck->li_sleep_jif = 1;
} else {
lfsck->li_sleep_rate = 1;
- lfsck->li_sleep_jif =
CFS_
HZ / limit;
+ lfsck->li_sleep_jif = HZ / limit;
}
} else {
lfsck->li_sleep_jif = 0;
@@
-481,8
+476,7
@@
static int lfsck_needs_scan_dir(const struct lu_env *env,
if (rc != 0)
return rc;
- if (unlikely(lu_fid_eq(fid,
- lfsck_dto2fid(lfsck->li_local_root))))
+ if (unlikely(lu_fid_eq(fid, &lfsck->li_local_root_fid)))
return 0;
obj = lfsck_object_find(env, lfsck, fid);
@@
-928,6
+922,10
@@
int lfsck_start(const struct lu_env *env, struct dt_device *key,
}
if (start->ls_valid & LSV_DRYRUN) {
+ valid |= DOIV_DRYRUN;
+ if (start->ls_flags & LPF_DRYRUN)
+ flags |= DOIF_DRYRUN;
+
if ((start->ls_flags & LPF_DRYRUN) &&
!(bk->lb_param & LPF_DRYRUN)) {
bk->lb_param |= LPF_DRYRUN;
@@
-1000,8
+998,11
@@
int lfsck_start(const struct lu_env *env, struct dt_device *key,
trigger:
lfsck->li_args_dir = LUDA_64BITHASH | LUDA_VERIFY;
- if (bk->lb_param & LPF_DRYRUN)
+ if (bk->lb_param & LPF_DRYRUN)
{
lfsck->li_args_dir |= LUDA_VERIFY_DRYRUN;
+ valid |= DOIV_DRYRUN;
+ flags |= DOIF_DRYRUN;
+ }
if (bk->lb_param & LPF_FAILOUT) {
valid |= DOIV_ERROR_HANDLE;
@@
-1013,8
+1014,7
@@
trigger:
lfsck->li_args_oit = (flags << DT_OTABLE_IT_FLAGS_SHIFT) | valid;
thread_set_flags(thread, 0);
- if (lfsck->li_master)
- rc = PTR_ERR(kthread_run(lfsck_master_engine, lfsck, "lfsck"));
+ rc = PTR_ERR(kthread_run(lfsck_master_engine, lfsck, "lfsck"));
if (IS_ERR_VALUE(rc)) {
CERROR("%s: cannot start LFSCK thread, rc = %ld\n",
lfsck_lfsck2name(lfsck), rc);
@@
-1062,7
+1062,7
@@
int lfsck_stop(const struct lu_env *env, struct dt_device *key, bool pause)
thread_set_flags(thread, SVC_STOPPING);
spin_unlock(&lfsck->li_lock);
-
cfs_waitq_broadcast
(&thread->t_ctl_waitq);
+
wake_up_all
(&thread->t_ctl_waitq);
l_wait_event(thread->t_ctl_waitq,
thread_is_stopped(thread),
&lwi);
@@
-1077,7
+1077,7
@@
int lfsck_register(const struct lu_env *env, struct dt_device *key,
struct dt_device *next, bool master)
{
struct lfsck_instance *lfsck;
- struct dt_object *root;
+ struct dt_object *root
= NULL
;
struct dt_object *obj;
struct lu_fid *fid = &lfsck_env_info(env)->lti_fid;
int rc;
@@
-1099,7
+1099,7
@@
int lfsck_register(const struct lu_env *env, struct dt_device *key,
CFS_INIT_LIST_HEAD(&lfsck->li_list_double_scan);
CFS_INIT_LIST_HEAD(&lfsck->li_list_idle);
atomic_set(&lfsck->li_ref, 1);
-
cfs_waitq_init
(&lfsck->li_thread.t_ctl_waitq);
+
init_waitqueue_head
(&lfsck->li_thread.t_ctl_waitq);
lfsck->li_next = next;
lfsck->li_bottom = key;
@@
-1118,7
+1118,7
@@
int lfsck_register(const struct lu_env *env, struct dt_device *key,
if (IS_ERR(root))
GOTO(out, rc = PTR_ERR(root));
- lfsck->li_local_root
= root
;
+ lfsck->li_local_root
_fid = *fid
;
dt_try_as_dir(env, root);
if (master) {
lfsck->li_master = 1;
@@
-1162,6
+1162,8
@@
int lfsck_register(const struct lu_env *env, struct dt_device *key,
add:
rc = lfsck_instance_add(lfsck);
out:
+ if (root != NULL && !IS_ERR(root))
+ lu_object_put(env, &root->do_lu);
if (rc != 0)
lfsck_instance_cleanup(env, lfsck);
return rc;