#include <lustre_mds.h>
#include <lprocfs_status.h>
#include "mdt_internal.h"
+#include <obd_cksum.h>
/**
* The rename stats output would be YAML formats, like
}
LUSTRE_RW_ATTR(checksum_t10pi_enforce);
+/*
+ * mdt_checksum_type(server) proc handling
+ */
+DECLARE_CKSUM_NAME;
+
+static int mdt_checksum_type_seq_show(struct seq_file *m, void *data)
+{
+ struct obd_device *obd = m->private;
+ struct lu_target *lut;
+ enum cksum_types pref;
+ int i;
+
+ if (!obd)
+ return 0;
+
+ lut = obd->u.obt.obt_lut;
+
+ /* select fastest checksum type on the server */
+ pref = obd_cksum_type_select(obd->obd_name,
+ lut->lut_cksum_types_supported, 0);
+
+ for (i = 0; i < ARRAY_SIZE(cksum_name); i++) {
+ if ((BIT(i) & lut->lut_cksum_types_supported) == 0)
+ continue;
+
+ if (pref == BIT(i))
+ seq_printf(m, "[%s] ", cksum_name[i]);
+ else
+ seq_printf(m, "%s ", cksum_name[i]);
+ }
+ seq_puts(m, "\n");
+
+ return 0;
+}
+
+LPROC_SEQ_FOPS_RO(mdt_checksum_type);
+
LPROC_SEQ_FOPS_RO_TYPE(mdt, hash);
LPROC_SEQ_FOPS_WR_ONLY(mdt, mds_evict_client);
LPROC_SEQ_FOPS_RW_TYPE(mdt, checksum_dump);
.fops = &mdt_root_squash_fops },
{ .name = "nosquash_nids",
.fops = &mdt_nosquash_nids_fops },
+ { .name = "checksum_type",
+ .fops = &mdt_checksum_type_fops },
{ NULL }
};
#include <linux/seq_file.h>
#include <lustre_lfsck.h>
#include <uapi/linux/lustre/lustre_access_log.h>
+#include <obd_cksum.h>
#include "ofd_internal.h"
}
LPROC_SEQ_FOPS(ofd_brw_size);
+/*
+ * ofd_checksum_type(server) proc handling
+ */
+DECLARE_CKSUM_NAME;
+
+static int ofd_checksum_type_seq_show(struct seq_file *m, void *data)
+{
+ struct obd_device *obd = m->private;
+ struct lu_target *lut;
+ enum cksum_types pref;
+ int i;
+
+ if (!obd)
+ return 0;
+
+ lut = obd->u.obt.obt_lut;
+
+ /* select fastest checksum type on the server */
+ pref = obd_cksum_type_select(obd->obd_name,
+ lut->lut_cksum_types_supported, 0);
+
+ for (i = 0; i < ARRAY_SIZE(cksum_name); i++) {
+ if ((BIT(i) & lut->lut_cksum_types_supported) == 0)
+ continue;
+
+ if (pref == BIT(i))
+ seq_printf(m, "[%s] ", cksum_name[i]);
+ else
+ seq_printf(m, "%s ", cksum_name[i]);
+ }
+ seq_puts(m, "\n");
+
+ return 0;
+}
+
+LPROC_SEQ_FOPS_RO(ofd_checksum_type);
+
+
#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 16, 53, 0)
static bool sync_on_lock_cancel_warned;
static ssize_t sync_on_lock_cancel_show(struct kobject *kobj,
.fops = &ofd_lfsck_verify_pfid_fops },
{ .name = "site_stats",
.fops = &ofd_site_stats_fops },
+ { .name = "checksum_type",
+ .fops = &ofd_checksum_type_fops },
{ NULL }
};
}
run_test 77n "Verify read from a hole inside contiguous blocks with T10PI"
+test_77o() {
+ (( $CLIENT_VERSION >= $(version_code 2.14.54) )) ||
+ skip "Need at least version 2.14.54"
+ local ofd=obdfilter
+ local mdt=mdt
+
+ # print OST checksum_type
+ echo "$ofd.$FSNAME-*.checksum_type:"
+ do_nodes $(comma_list $(osts_nodes)) \
+ $LCTL get_param -n $ofd.$FSNAME-*.checksum_type
+
+ # print MDT checksum_type
+ echo "$mdt.$FSNAME-*.checksum_type:"
+ do_nodes $(comma_list $(mdts_nodes)) \
+ $LCTL get_param -n $mdt.$FSNAME-*.checksum_type
+
+ local o_count=$(do_nodes $(comma_list $(osts_nodes)) \
+ $LCTL get_param -n $ofd.$FSNAME-*.checksum_type | wc -l)
+
+ (( $o_count == $OSTCOUNT )) ||
+ error "found $o_count checksums, not \$MDSCOUNT=$OSTCOUNT"
+
+ local m_count=$(do_nodes $(comma_list $(mdts_nodes)) \
+ $LCTL get_param -n $mdt.$FSNAME-*.checksum_type | wc -l)
+
+ (( $m_count == $MDSCOUNT )) ||
+ error "found $m_count checksums, not \$MDSCOUNT=$MDSCOUNT"
+}
+run_test 77o "Verify checksum_type for server (mdt and ofd(obdfilter))"
+
cleanup_test_78() {
trap 0
rm -f $DIR/$tfile