o->od_is_ost = 1;
o->od_full_scrub_ratio = OFSR_DEFAULT;
- o->od_full_scrub_speed = FULL_SCRUB_SPEED_DEFULT;
+ o->od_full_scrub_threshold_rate = FULL_SCRUB_THRESHOLD_RATE_DEFAULT;
rc = osd_mount(env, o, cfg);
if (rc != 0)
GOTO(out_capa, rc);
* OI scrub to scan the whole the device. */
__u64 od_full_scrub_ratio;
/* If the speed of found bad OI mappings (per minute)
- * exceeds the osd_device::od_full_scrub_speed, then
- * trigger OI scrub to scan the whole the device. */
- __u64 od_full_scrub_speed;
+ * exceeds the osd_device::od_full_scrub_threshold_rate,
+ * then trigger OI scrub to scan the whole device. */
+ __u64 od_full_scrub_threshold_rate;
};
enum osd_full_scrub_ratio {
OFSR_DEFAULT = 10000,
};
-#define FULL_SCRUB_SPEED_DEFULT 60
+#define FULL_SCRUB_THRESHOLD_RATE_DEFAULT 60
/* There are at most 10 uid/gids are affected in a transaction, and
* that's rename case:
}
LPROC_SEQ_FOPS(ldiskfs_osd_full_scrub_ratio);
-static int ldiskfs_osd_full_scrub_speed_seq_show(struct seq_file *m, void *data)
+static int ldiskfs_osd_full_scrub_threshold_rate_seq_show(struct seq_file *m,
+ void *data)
{
struct osd_device *dev = osd_dt_dev((struct dt_device *)m->private);
return -EINPROGRESS;
return seq_printf(m, LPU64" (bad OI mappings/minute)\n",
- dev->od_full_scrub_speed);
+ dev->od_full_scrub_threshold_rate);
}
static ssize_t
-ldiskfs_osd_full_scrub_speed_seq_write(struct file *file, const char *buffer,
- size_t count, loff_t *off)
+ldiskfs_osd_full_scrub_threshold_rate_seq_write(struct file *file,
+ const char *buffer,
+ size_t count, loff_t *off)
{
struct seq_file *m = file->private_data;
struct dt_device *dt = m->private;
if (val < 0)
return -EINVAL;
- dev->od_full_scrub_speed = val;
+ dev->od_full_scrub_threshold_rate = val;
return count;
}
-LPROC_SEQ_FOPS(ldiskfs_osd_full_scrub_speed);
+LPROC_SEQ_FOPS(ldiskfs_osd_full_scrub_threshold_rate);
static int
ldiskfs_osd_track_declares_assert_seq_show(struct seq_file *m, void *data)
.fops = &ldiskfs_osd_auto_scrub_fops },
{ .name = "full_scrub_ratio",
.fops = &ldiskfs_osd_full_scrub_ratio_fops },
- { .name = "full_scrub_speed",
- .fops = &ldiskfs_osd_full_scrub_speed_fops },
+ { .name = "full_scrub_threshold_rate",
+ .fops = &ldiskfs_osd_full_scrub_threshold_rate_fops },
{ .name = "oi_scrub",
.fops = &ldiskfs_osd_oi_scrub_fops },
{ .name = "read_cache_enable",
}
scrub->os_bad_oimap_time = now;
- if (++scrub->os_bad_oimap_count > dev->od_full_scrub_speed)
+ if (++scrub->os_bad_oimap_count >
+ dev->od_full_scrub_threshold_rate)
scrub->os_full_scrub = 1;
}
}
scrub_enable_auto() {
- local n
-
- for n in $(seq $MDSCOUNT); do
- do_facet mds$n $LCTL set_param -n \
- osd-ldiskfs.$(facet_svc mds$n).auto_scrub 1
- done
+ do_nodes $(comma_list $(mdts_nodes)) $LCTL set_param -n \
+ osd-ldiskfs.*.auto_scrub=1
}
full_scrub_ratio() {
return
local ratio=$1
- local n
- for n in $(seq $MDSCOUNT); do
- do_facet mds$n $LCTL set_param -n \
- osd-ldiskfs.$(facet_svc mds$n).full_scrub_ratio $ratio
- done
+ do_nodes $(comma_list $(mdts_nodes)) $LCTL set_param -n \
+ osd-ldiskfs.*.full_scrub_ratio=$ratio
}
-full_scrub_speed() {
- local speed=$1
- local n
+full_scrub_threshold_rate() {
+ [[ $(lustre_version_code $SINGLEMDS) -le $(version_code 2.6.50) ]] &&
+ return
- for n in $(seq $MDSCOUNT); do
- do_facet mds$n $LCTL set_param -n \
- osd-ldiskfs.$(facet_svc mds$n).full_scrub_speed $speed
- done
+ local rate=$1
+
+ do_nodes $(comma_list $(mdts_nodes)) $LCTL set_param -n \
+ osd-ldiskfs.*.full_scrub_threshold_rate=$rate
}
test_0() {
mount_client $MOUNT || error "(5) Fail to start client!"
scrub_enable_auto
full_scrub_ratio 10
- full_scrub_speed 10000
+ full_scrub_threshold_rate 10000
scrub_check_data 6
sleep 3
mount_client $MOUNT || error "(5) Fail to start client!"
scrub_enable_auto
full_scrub_ratio 2
- full_scrub_speed 20
+ full_scrub_threshold_rate 20
scrub_check_data 6
sleep 3