Originally, the "lfsck_namespace" file stored both the namespace
LFSCK statistics information and the FIDs to be double scanned.
But to improve the namespace LFSCK performance (since Lustre-2.7),
we used multiple trace files with the name "lfsck_namespace_xx".
At that time, the original "lfsck_namespace" file only need to
record the namespace LFSCK statistics information. So we made it
as regular file, NOT index file. Such changes will cause trouble
when downgrade to Lustre-2.6 or older, becuase the old namespace
LFSCK needs an index trace file instead of regular file. To avoid
the compatibility issues, we will keep the "lfsck_namespace" file
as index file on b2_7 and newer release.
Signed-off-by: Fan Yong <fan.yong@intel.com>
Change-Id: I76d8b1416c4c507793aa9bbab2d52cc7d8daa440
Reviewed-on: http://review.whamcloud.com/13945
Tested-by: Jenkins
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lfsck_namespace_load_one_trace_file(const struct lu_env *env,
struct lfsck_component *com,
struct dt_object *parent,
lfsck_namespace_load_one_trace_file(const struct lu_env *env,
struct lfsck_component *com,
struct dt_object *parent,
- const char *name,
- const struct dt_index_features *ft,
- bool reset)
+ const char *name, bool reset)
{
struct lfsck_instance *lfsck = com->lc_lfsck;
struct dt_object *obj;
{
struct lfsck_instance *lfsck = com->lc_lfsck;
struct dt_object *obj;
- if (ft != NULL)
- obj = local_index_find_or_create(env, lfsck->li_los, parent,
- name, S_IFREG | S_IRUGO | S_IWUSR, ft);
- else
- obj = local_file_find_or_create(env, lfsck->li_los, parent,
- name, S_IFREG | S_IRUGO | S_IWUSR);
+ obj = local_index_find_or_create(env, lfsck->li_los, parent, name,
+ S_IFREG | S_IRUGO | S_IWUSR,
+ &dt_lfsck_features);
}
obj = lfsck_namespace_load_one_trace_file(env, com,
}
obj = lfsck_namespace_load_one_trace_file(env, com,
- com->lc_lfsck->li_lfsck_dir,
- name, &dt_lfsck_features, reset);
+ com->lc_lfsck->li_lfsck_dir, name, reset);
if (IS_ERR(obj))
return PTR_ERR(obj);
if (IS_ERR(obj))
return PTR_ERR(obj);
lfsck_object_put(env, com->lc_obj);
com->lc_obj = NULL;
dto = lfsck_namespace_load_one_trace_file(env, com, root,
lfsck_object_put(env, com->lc_obj);
com->lc_obj = NULL;
dto = lfsck_namespace_load_one_trace_file(env, com, root,
- LFSCK_NAMESPACE, NULL, true);
+ LFSCK_NAMESPACE, true);
if (IS_ERR(dto))
GOTO(out, rc = PTR_ERR(dto));
if (IS_ERR(dto))
GOTO(out, rc = PTR_ERR(dto));
if (unlikely(!dt_try_as_dir(env, root)))
GOTO(out, rc = -ENOTDIR);
if (unlikely(!dt_try_as_dir(env, root)))
GOTO(out, rc = -ENOTDIR);
- obj = local_file_find_or_create(env, lfsck->li_los, root,
- LFSCK_NAMESPACE,
- S_IFREG | S_IRUGO | S_IWUSR);
+ obj = local_index_find_or_create(env, lfsck->li_los, root,
+ LFSCK_NAMESPACE,
+ S_IFREG | S_IRUGO | S_IWUSR,
+ &dt_lfsck_features);
if (IS_ERR(obj))
GOTO(out, rc = PTR_ERR(obj));
if (IS_ERR(obj))
GOTO(out, rc = PTR_ERR(obj));