goto out;
}
- if (strcmp(kobj_id, PC_KOBJ_ID))
+ if (strcmp(kobj->name, PC_KOBJ_ID))
new_op->upcall.req.param.type = ORANGEFS_PARAM_REQUEST_GET;
- if (!strcmp(kobj_id, ORANGEFS_KOBJ_ID)) {
- orangefs_attr = (struct orangefs_attribute *)attr;
-
+ if (!strcmp(kobj->name, ORANGEFS_KOBJ_ID)) {
+ /* Drop unsupported requests first. */
+ if (!(orangefs_features & ORANGEFS_FEATURE_READAHEAD) &&
- (!strcmp(orangefs_attr->attr.name, "readahead_count") ||
- !strcmp(orangefs_attr->attr.name, "readahead_size") ||
- !strcmp(orangefs_attr->attr.name,
- "readahead_count_size"))) {
++ (!strcmp(attr->attr.name, "readahead_count") ||
++ !strcmp(attr->attr.name, "readahead_size") ||
++ !strcmp(attr->attr.name, "readahead_count_size"))) {
+ rc = -EINVAL;
+ goto out;
+ }
+
- if (!strcmp(orangefs_attr->attr.name, "perf_history_size"))
+ if (!strcmp(attr->attr.name, "perf_history_size"))
new_op->upcall.req.param.op =
ORANGEFS_PARAM_REQUEST_OP_PERF_HISTORY_SIZE;
- else if (!strcmp(orangefs_attr->attr.name,
+ else if (!strcmp(attr->attr.name,
"perf_time_interval_secs"))
new_op->upcall.req.param.op =
ORANGEFS_PARAM_REQUEST_OP_PERF_TIME_INTERVAL_SECS;
new_op->upcall.req.param.type = ORANGEFS_PARAM_REQUEST_SET;
- if (!strcmp(kobj_id, ORANGEFS_KOBJ_ID)) {
- orangefs_attr = (struct orangefs_attribute *)attr;
+ if (!strcmp(kobj->name, ORANGEFS_KOBJ_ID)) {
+ /* Drop unsupported requests first. */
+ if (!(orangefs_features & ORANGEFS_FEATURE_READAHEAD) &&
- (!strcmp(orangefs_attr->attr.name, "readahead_count") ||
- !strcmp(orangefs_attr->attr.name, "readahead_size") ||
- !strcmp(orangefs_attr->attr.name,
- "readahead_count_size"))) {
++ (!strcmp(attr->attr.name, "readahead_count") ||
++ !strcmp(attr->attr.name, "readahead_size") ||
++ !strcmp(attr->attr.name, "readahead_count_size"))) {
+ rc = -EINVAL;
+ goto out;
+ }
+
- if (!strcmp(orangefs_attr->attr.name, "perf_history_size")) {
+ if (!strcmp(attr->attr.name, "perf_history_size")) {
if (val > 0) {
new_op->upcall.req.param.op =
ORANGEFS_PARAM_REQUEST_OP_PERF_HISTORY_SIZE;