+int class_sec_flavor(struct obd_device *obd, struct lustre_cfg *lcfg)
+{
+ struct sec_flavor_config *conf;
+ ENTRY;
+
+ if (strcmp(obd->obd_type->typ_name, LUSTRE_MDC_NAME) &&
+ strcmp(obd->obd_type->typ_name, LUSTRE_OSC_NAME)) {
+ CERROR("Can't set security flavor on obd %s\n",
+ obd->obd_type->typ_name);
+ RETURN(-EINVAL);
+ }
+
+ if (LUSTRE_CFG_BUFLEN(lcfg, 1) != sizeof(*conf)) {
+ CERROR("invalid data\n");
+ RETURN(-EINVAL);
+ }
+
+ conf = &obd->u.cli.cl_sec_conf;
+ memcpy(conf, lustre_cfg_buf(lcfg, 1), sizeof(*conf));
+
+#ifdef __BIG_ENDIAN
+ __swab32s(&conf->sfc_rpc_flavor);
+ __swab32s(&conf->sfc_bulk_csum);
+ __swab32s(&conf->sfc_bulk_priv);
+ __swab32s(&conf->sfc_flags);
+#endif
+
+ RETURN(0);
+}
+