if (rc)
return rc;
- if (val < 0 || val > INT_MAX)
- return -ERANGE;
- if (val > OST_MAX_PRECREATE)
+ if (val && (val < OST_MIN_PRECREATE ||
+ val > OST_MAX_PRECREATE))
return -ERANGE;
if (osp->opd_pre_create_count > val)
osp->opd_pre_create_count = val;
+ /* Can be 0 after setting max_create_count to 0 */
+ if (osp->opd_pre_create_count == 0 && val != 0)
+ osp->opd_pre_create_count = OST_MIN_PRECREATE;
+
osp->opd_pre_max_create_count = val;
return count;
}
LUSTRE_RO_ATTR(ping);
+ssize_t osp_conn_uuid_show(struct kobject *kobj, struct attribute *attr,
+ char *buf)
+{
+ struct dt_device *dt = container_of(kobj, struct dt_device,
+ dd_kobj);
+ struct lu_device *lu = dt2lu_dev(dt);
+ struct obd_device *obd = lu->ld_obd;
+ struct ptlrpc_connection *conn;
+ ssize_t count;
+
+ LPROCFS_CLIMP_CHECK(obd);
+ conn = obd->u.cli.cl_import->imp_connection;
+ if (conn && obd->u.cli.cl_import)
+ count = sprintf(buf, "%s\n", conn->c_remote_uuid.uuid);
+ else
+ count = sprintf(buf, "%s\n", "<none>");
+
+ LPROCFS_CLIMP_EXIT(obd);
+ return count;
+}
+
+LUSTRE_ATTR(ost_conn_uuid, 0444, osp_conn_uuid_show, NULL);
+LUSTRE_ATTR(mdt_conn_uuid, 0444, osp_conn_uuid_show, NULL);
+
LDEBUGFS_SEQ_FOPS_RO_TYPE(osp, connect_flags);
LDEBUGFS_SEQ_FOPS_RO_TYPE(osp, server_uuid);
-LDEBUGFS_SEQ_FOPS_RO_TYPE(osp, conn_uuid);
-
LDEBUGFS_SEQ_FOPS_RO_TYPE(osp, timeouts);
LPROC_SEQ_FOPS_RW_TYPE(osp, import);
__s64 val;
int rc;
- if (osp == NULL)
+ if (osp == NULL || osp->opd_pre == NULL)
return -EINVAL;
rc = lprocfs_str_with_units_to_s64(buffer, count, &val, 'M');
__s64 val;
int rc;
- if (osp == NULL)
+ if (osp == NULL || osp->opd_pre == NULL)
return -EINVAL;
rc = lprocfs_str_with_units_to_s64(buffer, count, &val, 'M');
.fops = &osp_connect_flags_fops },
{ .name = "ost_server_uuid",
.fops = &osp_server_uuid_fops },
- { .name = "ost_conn_uuid",
- .fops = &osp_conn_uuid_fops },
{ .name = "timeouts",
.fops = &osp_timeouts_fops },
{ .name = "import",
.fops = &osp_connect_flags_fops },
{ .name = "mdt_server_uuid",
.fops = &osp_server_uuid_fops },
- { .name = "mdt_conn_uuid",
- .fops = &osp_conn_uuid_fops },
{ .name = "timeouts",
.fops = &osp_timeouts_fops },
{ .name = "import",
&lustre_attr_max_rpcs_in_flight.attr,
&lustre_attr_max_rpcs_in_progress.attr,
&lustre_attr_maxage.attr,
+ &lustre_attr_ost_conn_uuid.attr,
&lustre_attr_ping.attr,
&lustre_attr_prealloc_status.attr,
&lustre_attr_prealloc_next_id.attr,
&lustre_attr_max_rpcs_in_flight.attr,
&lustre_attr_max_rpcs_in_progress.attr,
&lustre_attr_maxage.attr,
+ &lustre_attr_mdt_conn_uuid.attr,
&lustre_attr_ping.attr,
&lustre_attr_prealloc_status.attr,
NULL,