#include <linux/kthread.h>
#include <linux/sched.h>
-#include <libcfs/list.h>
+#include <linux/list.h>
#include <lu_object.h>
#include <dt_object.h>
#include <md_object.h>
if (index >= ltds->ltd_tgts_bitmap->size) {
__u32 newsize = max((__u32)ltds->ltd_tgts_bitmap->size,
(__u32)BITS_PER_LONG);
- cfs_bitmap_t *old_bitmap = ltds->ltd_tgts_bitmap;
- cfs_bitmap_t *new_bitmap;
+ struct cfs_bitmap *old_bitmap = ltds->ltd_tgts_bitmap;
+ struct cfs_bitmap *new_bitmap;
while (newsize < index + 1)
newsize <<= 1;
struct lu_seq_range *range = &lfsck_env_info(env)->lti_range;
int rc;
+ if (unlikely(fid_seq(fid) == FID_SEQ_LOCAL_FILE)) {
+ /* "ROOT" is always on the MDT0. */
+ if (lu_fid_eq(fid, &lfsck->li_global_root_fid))
+ return 0;
+
+ return lfsck_dev_idx(lfsck);
+ }
+
fld_range_set_mdt(range);
rc = fld_server_lookup(env, ss->ss_server_fld, fid_seq(fid), range);
if (rc == 0)
*cfid = bk->lb_lpf_fid;
}
- child = lfsck_object_find_bottom(env, lfsck, cfid);
+ child = lfsck_object_find_bottom_new(env, lfsck, cfid);
if (IS_ERR(child))
GOTO(unlock, rc = PTR_ERR(child));
return 0;
}
-int lfsck_bits_dump(struct seq_file *m, int bits, const char *names[],
- const char *prefix)
+void lfsck_bits_dump(struct seq_file *m, int bits, const char *names[],
+ const char *prefix)
{
int flag;
int i;
bool newline = (bits != 0 ? false : true);
- int rc;
- rc = seq_printf(m, "%s:%c", prefix, bits != 0 ? ' ' : '\n');
- if (rc < 0)
- return rc;
+ seq_printf(m, "%s:%c", prefix, bits != 0 ? ' ' : '\n');
for (i = 0, flag = 1; bits != 0; i++, flag = 1 << i) {
if (flag & bits) {
if (bits == 0)
newline = true;
- rc = seq_printf(m, "%s%c", names[i],
- newline ? '\n' : ',');
- if (rc < 0)
- return rc;
+ seq_printf(m, "%s%c", names[i],
+ newline ? '\n' : ',');
}
}
}
if (!newline)
- rc = seq_printf(m, "\n");
-
- return rc;
+ seq_putc(m, '\n');
}
-int lfsck_time_dump(struct seq_file *m, __u64 time, const char *name)
+void lfsck_time_dump(struct seq_file *m, __u64 time, const char *name)
{
- int rc;
-
if (time == 0) {
- rc = seq_printf(m, "%s_time: N/A\n", name);
- if (rc == 0)
- rc = seq_printf(m, "time_since_%s: N/A\n", name);
-
- return rc;
+ seq_printf(m, "%s_time: N/A\n", name);
+ seq_printf(m, "time_since_%s: N/A\n", name);
+ } else {
+ seq_printf(m, "%s_time: %llu\n", name, time);
+ seq_printf(m, "time_since_%s: %llu seconds\n",
+ name, cfs_time_current_sec() - time);
}
-
- rc = seq_printf(m, "%s_time: "LPU64"\n", name, time);
- if (rc == 0)
- rc = seq_printf(m, "time_since_%s: "LPU64" seconds\n",
- name, cfs_time_current_sec() - time);
-
- return rc;
}
-int lfsck_pos_dump(struct seq_file *m, struct lfsck_position *pos,
- const char *prefix)
+void lfsck_pos_dump(struct seq_file *m, struct lfsck_position *pos,
+ const char *prefix)
{
if (fid_is_zero(&pos->lp_dir_parent)) {
- if (pos->lp_oit_cookie == 0)
- return seq_printf(m, "%s: N/A, N/A, N/A\n", prefix);
-
- return seq_printf(m, "%s: "LPU64", N/A, N/A\n",
- prefix, pos->lp_oit_cookie);
+ if (pos->lp_oit_cookie == 0) {
+ seq_printf(m, "%s: N/A, N/A, N/A\n", prefix);
+ return;
+ }
+ seq_printf(m, "%s: %llu, N/A, N/A\n",
+ prefix, pos->lp_oit_cookie);
+ } else {
+ seq_printf(m, "%s: %llu, "DFID", %#llx\n",
+ prefix, pos->lp_oit_cookie,
+ PFID(&pos->lp_dir_parent), pos->lp_dir_cookie);
}
-
- return seq_printf(m, "%s: "LPU64", "DFID", "LPX64"\n",
- prefix, pos->lp_oit_cookie,
- PFID(&pos->lp_dir_parent), pos->lp_dir_cookie);
}
void lfsck_pos_fill(const struct lu_env *env, struct lfsck_instance *lfsck,
}
EXPORT_SYMBOL(lfsck_get_speed);
-int lfsck_set_speed(struct dt_device *key, int val)
+int lfsck_set_speed(struct dt_device *key, __u32 val)
{
struct lu_env env;
struct lfsck_instance *lfsck;
if (likely(lfsck != NULL)) {
com = lfsck_component_find(lfsck, type);
if (likely(com != NULL)) {
- rc = com->lc_ops->lfsck_dump(&env, com, m);
+ com->lc_ops->lfsck_dump(&env, com, m);
lfsck_component_put(&env, com);
} else {
rc = -ENOTSUPP;