diff options
-rw-r--r-- | fs/orangefs/orangefs-sysfs.c | 472 |
1 files changed, 81 insertions, 391 deletions
diff --git a/fs/orangefs/orangefs-sysfs.c b/fs/orangefs/orangefs-sysfs.c index 6137434ff08c..6cbc2468f5ba 100644 --- a/fs/orangefs/orangefs-sysfs.c +++ b/fs/orangefs/orangefs-sysfs.c | |||
@@ -148,60 +148,6 @@ struct orangefs_attribute { | |||
148 | size_t count); | 148 | size_t count); |
149 | }; | 149 | }; |
150 | 150 | ||
151 | struct acache_orangefs_attribute { | ||
152 | struct attribute attr; | ||
153 | ssize_t (*show)(struct acache_orangefs_attribute *attr, | ||
154 | char *buf); | ||
155 | ssize_t (*store)(struct acache_orangefs_attribute *attr, | ||
156 | const char *buf, | ||
157 | size_t count); | ||
158 | }; | ||
159 | |||
160 | struct capcache_orangefs_attribute { | ||
161 | struct attribute attr; | ||
162 | ssize_t (*show)(struct capcache_orangefs_attribute *attr, | ||
163 | char *buf); | ||
164 | ssize_t (*store)(struct capcache_orangefs_attribute *attr, | ||
165 | const char *buf, | ||
166 | size_t count); | ||
167 | }; | ||
168 | |||
169 | struct ccache_orangefs_attribute { | ||
170 | struct attribute attr; | ||
171 | ssize_t (*show)(struct ccache_orangefs_attribute *attr, | ||
172 | char *buf); | ||
173 | ssize_t (*store)(struct ccache_orangefs_attribute *attr, | ||
174 | const char *buf, | ||
175 | size_t count); | ||
176 | }; | ||
177 | |||
178 | struct ncache_orangefs_attribute { | ||
179 | struct attribute attr; | ||
180 | ssize_t (*show)(struct ncache_orangefs_attribute *attr, | ||
181 | char *buf); | ||
182 | ssize_t (*store)(struct ncache_orangefs_attribute *attr, | ||
183 | const char *buf, | ||
184 | size_t count); | ||
185 | }; | ||
186 | |||
187 | struct pc_orangefs_attribute { | ||
188 | struct attribute attr; | ||
189 | ssize_t (*show)(struct pc_orangefs_attribute *attr, | ||
190 | char *buf); | ||
191 | ssize_t (*store)(struct pc_orangefs_attribute *attr, | ||
192 | const char *buf, | ||
193 | size_t count); | ||
194 | }; | ||
195 | |||
196 | struct stats_orangefs_attribute { | ||
197 | struct attribute attr; | ||
198 | ssize_t (*show)(struct stats_orangefs_attribute *attr, | ||
199 | char *buf); | ||
200 | ssize_t (*store)(struct stats_orangefs_attribute *attr, | ||
201 | const char *buf, | ||
202 | size_t count); | ||
203 | }; | ||
204 | |||
205 | static ssize_t orangefs_attr_show(struct kobject *kobj, | 151 | static ssize_t orangefs_attr_show(struct kobject *kobj, |
206 | struct attribute *attr, | 152 | struct attribute *attr, |
207 | char *buf) | 153 | char *buf) |
@@ -251,265 +197,42 @@ static const struct sysfs_ops orangefs_sysfs_ops = { | |||
251 | .store = orangefs_attr_store, | 197 | .store = orangefs_attr_store, |
252 | }; | 198 | }; |
253 | 199 | ||
254 | static ssize_t acache_orangefs_attr_show(struct kobject *kobj, | ||
255 | struct attribute *attr, | ||
256 | char *buf) | ||
257 | { | ||
258 | struct acache_orangefs_attribute *attribute; | ||
259 | int rc; | ||
260 | |||
261 | attribute = container_of(attr, struct acache_orangefs_attribute, attr); | ||
262 | |||
263 | if (!attribute->show) { | ||
264 | rc = -EIO; | ||
265 | goto out; | ||
266 | } | ||
267 | |||
268 | rc = attribute->show(attribute, buf); | ||
269 | |||
270 | out: | ||
271 | return rc; | ||
272 | } | ||
273 | |||
274 | static ssize_t acache_orangefs_attr_store(struct kobject *kobj, | ||
275 | struct attribute *attr, | ||
276 | const char *buf, | ||
277 | size_t len) | ||
278 | { | ||
279 | struct acache_orangefs_attribute *attribute; | ||
280 | int rc; | ||
281 | |||
282 | gossip_debug(GOSSIP_SYSFS_DEBUG, | ||
283 | "acache_orangefs_attr_store: start\n"); | ||
284 | |||
285 | attribute = container_of(attr, struct acache_orangefs_attribute, attr); | ||
286 | |||
287 | if (!attribute->store) { | ||
288 | rc = -EIO; | ||
289 | goto out; | ||
290 | } | ||
291 | |||
292 | rc = attribute->store(attribute, buf, len); | ||
293 | |||
294 | out: | ||
295 | return rc; | ||
296 | } | ||
297 | |||
298 | static const struct sysfs_ops acache_orangefs_sysfs_ops = { | 200 | static const struct sysfs_ops acache_orangefs_sysfs_ops = { |
299 | .show = acache_orangefs_attr_show, | 201 | .show = orangefs_attr_show, |
300 | .store = acache_orangefs_attr_store, | 202 | .store = orangefs_attr_store, |
301 | }; | 203 | }; |
302 | 204 | ||
303 | static ssize_t capcache_orangefs_attr_show(struct kobject *kobj, | ||
304 | struct attribute *attr, | ||
305 | char *buf) | ||
306 | { | ||
307 | struct capcache_orangefs_attribute *attribute; | ||
308 | int rc; | ||
309 | |||
310 | attribute = | ||
311 | container_of(attr, struct capcache_orangefs_attribute, attr); | ||
312 | |||
313 | if (!attribute->show) { | ||
314 | rc = -EIO; | ||
315 | goto out; | ||
316 | } | ||
317 | |||
318 | rc = attribute->show(attribute, buf); | ||
319 | |||
320 | out: | ||
321 | return rc; | ||
322 | } | ||
323 | |||
324 | static ssize_t capcache_orangefs_attr_store(struct kobject *kobj, | ||
325 | struct attribute *attr, | ||
326 | const char *buf, | ||
327 | size_t len) | ||
328 | { | ||
329 | struct capcache_orangefs_attribute *attribute; | ||
330 | int rc; | ||
331 | |||
332 | gossip_debug(GOSSIP_SYSFS_DEBUG, | ||
333 | "capcache_orangefs_attr_store: start\n"); | ||
334 | |||
335 | attribute = | ||
336 | container_of(attr, struct capcache_orangefs_attribute, attr); | ||
337 | |||
338 | if (!attribute->store) { | ||
339 | rc = -EIO; | ||
340 | goto out; | ||
341 | } | ||
342 | |||
343 | rc = attribute->store(attribute, buf, len); | ||
344 | |||
345 | out: | ||
346 | return rc; | ||
347 | } | ||
348 | |||
349 | static const struct sysfs_ops capcache_orangefs_sysfs_ops = { | 205 | static const struct sysfs_ops capcache_orangefs_sysfs_ops = { |
350 | .show = capcache_orangefs_attr_show, | 206 | .show = orangefs_attr_show, |
351 | .store = capcache_orangefs_attr_store, | 207 | .store = orangefs_attr_store, |
352 | }; | 208 | }; |
353 | 209 | ||
354 | static ssize_t ccache_orangefs_attr_show(struct kobject *kobj, | ||
355 | struct attribute *attr, | ||
356 | char *buf) | ||
357 | { | ||
358 | struct ccache_orangefs_attribute *attribute; | ||
359 | int rc; | ||
360 | |||
361 | attribute = | ||
362 | container_of(attr, struct ccache_orangefs_attribute, attr); | ||
363 | |||
364 | if (!attribute->show) { | ||
365 | rc = -EIO; | ||
366 | goto out; | ||
367 | } | ||
368 | |||
369 | rc = attribute->show(attribute, buf); | ||
370 | |||
371 | out: | ||
372 | return rc; | ||
373 | } | ||
374 | |||
375 | static ssize_t ccache_orangefs_attr_store(struct kobject *kobj, | ||
376 | struct attribute *attr, | ||
377 | const char *buf, | ||
378 | size_t len) | ||
379 | { | ||
380 | struct ccache_orangefs_attribute *attribute; | ||
381 | int rc; | ||
382 | |||
383 | gossip_debug(GOSSIP_SYSFS_DEBUG, | ||
384 | "ccache_orangefs_attr_store: start\n"); | ||
385 | |||
386 | attribute = | ||
387 | container_of(attr, struct ccache_orangefs_attribute, attr); | ||
388 | |||
389 | if (!attribute->store) { | ||
390 | rc = -EIO; | ||
391 | goto out; | ||
392 | } | ||
393 | |||
394 | rc = attribute->store(attribute, buf, len); | ||
395 | |||
396 | out: | ||
397 | return rc; | ||
398 | } | ||
399 | |||
400 | static const struct sysfs_ops ccache_orangefs_sysfs_ops = { | 210 | static const struct sysfs_ops ccache_orangefs_sysfs_ops = { |
401 | .show = ccache_orangefs_attr_show, | 211 | .show = orangefs_attr_show, |
402 | .store = ccache_orangefs_attr_store, | 212 | .store = orangefs_attr_store, |
403 | }; | 213 | }; |
404 | 214 | ||
405 | static ssize_t ncache_orangefs_attr_show(struct kobject *kobj, | ||
406 | struct attribute *attr, | ||
407 | char *buf) | ||
408 | { | ||
409 | struct ncache_orangefs_attribute *attribute; | ||
410 | int rc; | ||
411 | |||
412 | attribute = container_of(attr, struct ncache_orangefs_attribute, attr); | ||
413 | |||
414 | if (!attribute->show) { | ||
415 | rc = -EIO; | ||
416 | goto out; | ||
417 | } | ||
418 | |||
419 | rc = attribute->show(attribute, buf); | ||
420 | |||
421 | out: | ||
422 | return rc; | ||
423 | } | ||
424 | |||
425 | static ssize_t ncache_orangefs_attr_store(struct kobject *kobj, | ||
426 | struct attribute *attr, | ||
427 | const char *buf, | ||
428 | size_t len) | ||
429 | { | ||
430 | struct ncache_orangefs_attribute *attribute; | ||
431 | int rc; | ||
432 | |||
433 | gossip_debug(GOSSIP_SYSFS_DEBUG, | ||
434 | "ncache_orangefs_attr_store: start\n"); | ||
435 | |||
436 | attribute = container_of(attr, struct ncache_orangefs_attribute, attr); | ||
437 | |||
438 | if (!attribute->store) { | ||
439 | rc = -EIO; | ||
440 | goto out; | ||
441 | } | ||
442 | |||
443 | rc = attribute->store(attribute, buf, len); | ||
444 | |||
445 | out: | ||
446 | return rc; | ||
447 | } | ||
448 | |||
449 | static const struct sysfs_ops ncache_orangefs_sysfs_ops = { | 215 | static const struct sysfs_ops ncache_orangefs_sysfs_ops = { |
450 | .show = ncache_orangefs_attr_show, | 216 | .show = orangefs_attr_show, |
451 | .store = ncache_orangefs_attr_store, | 217 | .store = orangefs_attr_store, |
452 | }; | 218 | }; |
453 | 219 | ||
454 | static ssize_t pc_orangefs_attr_show(struct kobject *kobj, | ||
455 | struct attribute *attr, | ||
456 | char *buf) | ||
457 | { | ||
458 | struct pc_orangefs_attribute *attribute; | ||
459 | int rc; | ||
460 | |||
461 | attribute = container_of(attr, struct pc_orangefs_attribute, attr); | ||
462 | |||
463 | if (!attribute->show) { | ||
464 | rc = -EIO; | ||
465 | goto out; | ||
466 | } | ||
467 | |||
468 | rc = attribute->show(attribute, buf); | ||
469 | |||
470 | out: | ||
471 | return rc; | ||
472 | } | ||
473 | |||
474 | static const struct sysfs_ops pc_orangefs_sysfs_ops = { | 220 | static const struct sysfs_ops pc_orangefs_sysfs_ops = { |
475 | .show = pc_orangefs_attr_show, | 221 | .show = orangefs_attr_show, |
476 | }; | 222 | }; |
477 | 223 | ||
478 | static ssize_t stats_orangefs_attr_show(struct kobject *kobj, | ||
479 | struct attribute *attr, | ||
480 | char *buf) | ||
481 | { | ||
482 | struct stats_orangefs_attribute *attribute; | ||
483 | int rc; | ||
484 | |||
485 | attribute = container_of(attr, struct stats_orangefs_attribute, attr); | ||
486 | |||
487 | if (!attribute->show) { | ||
488 | rc = -EIO; | ||
489 | goto out; | ||
490 | } | ||
491 | |||
492 | rc = attribute->show(attribute, buf); | ||
493 | |||
494 | out: | ||
495 | return rc; | ||
496 | } | ||
497 | |||
498 | static const struct sysfs_ops stats_orangefs_sysfs_ops = { | 224 | static const struct sysfs_ops stats_orangefs_sysfs_ops = { |
499 | .show = stats_orangefs_attr_show, | 225 | .show = orangefs_attr_show, |
500 | }; | 226 | }; |
501 | 227 | ||
502 | static ssize_t sysfs_int_show(char *kobj_id, char *buf, void *attr) | 228 | static ssize_t sysfs_int_show(char *kobj_id, char *buf, void *attr) |
503 | { | 229 | { |
504 | int rc = -EIO; | 230 | int rc = -EIO; |
505 | struct orangefs_attribute *orangefs_attr; | 231 | struct orangefs_attribute *orangefs_attr = attr; |
506 | struct stats_orangefs_attribute *stats_orangefs_attr; | ||
507 | 232 | ||
508 | gossip_debug(GOSSIP_SYSFS_DEBUG, "sysfs_int_show: id:%s:\n", kobj_id); | 233 | gossip_debug(GOSSIP_SYSFS_DEBUG, "sysfs_int_show: id:%s:\n", kobj_id); |
509 | 234 | ||
510 | if (!strcmp(kobj_id, ORANGEFS_KOBJ_ID)) { | 235 | if (!strcmp(kobj_id, ORANGEFS_KOBJ_ID)) { |
511 | orangefs_attr = (struct orangefs_attribute *)attr; | ||
512 | |||
513 | if (!strcmp(orangefs_attr->attr.name, "op_timeout_secs")) { | 236 | if (!strcmp(orangefs_attr->attr.name, "op_timeout_secs")) { |
514 | rc = scnprintf(buf, | 237 | rc = scnprintf(buf, |
515 | PAGE_SIZE, | 238 | PAGE_SIZE, |
@@ -542,15 +265,13 @@ static ssize_t sysfs_int_show(char *kobj_id, char *buf, void *attr) | |||
542 | } | 265 | } |
543 | 266 | ||
544 | } else if (!strcmp(kobj_id, STATS_KOBJ_ID)) { | 267 | } else if (!strcmp(kobj_id, STATS_KOBJ_ID)) { |
545 | stats_orangefs_attr = (struct stats_orangefs_attribute *)attr; | 268 | if (!strcmp(orangefs_attr->attr.name, "reads")) { |
546 | |||
547 | if (!strcmp(stats_orangefs_attr->attr.name, "reads")) { | ||
548 | rc = scnprintf(buf, | 269 | rc = scnprintf(buf, |
549 | PAGE_SIZE, | 270 | PAGE_SIZE, |
550 | "%lu\n", | 271 | "%lu\n", |
551 | g_orangefs_stats.reads); | 272 | g_orangefs_stats.reads); |
552 | goto out; | 273 | goto out; |
553 | } else if (!strcmp(stats_orangefs_attr->attr.name, "writes")) { | 274 | } else if (!strcmp(orangefs_attr->attr.name, "writes")) { |
554 | rc = scnprintf(buf, | 275 | rc = scnprintf(buf, |
555 | PAGE_SIZE, | 276 | PAGE_SIZE, |
556 | "%lu\n", | 277 | "%lu\n", |
@@ -580,7 +301,7 @@ static ssize_t int_orangefs_show(struct orangefs_attribute *attr, | |||
580 | return rc; | 301 | return rc; |
581 | } | 302 | } |
582 | 303 | ||
583 | static ssize_t int_stats_show(struct stats_orangefs_attribute *attr, | 304 | static ssize_t int_stats_show(struct orangefs_attribute *attr, |
584 | char *buf) | 305 | char *buf) |
585 | { | 306 | { |
586 | int rc; | 307 | int rc; |
@@ -637,12 +358,7 @@ static int sysfs_service_op_show(char *kobj_id, char *buf, void *attr) | |||
637 | struct orangefs_kernel_op_s *new_op = NULL; | 358 | struct orangefs_kernel_op_s *new_op = NULL; |
638 | int rc = 0; | 359 | int rc = 0; |
639 | char *ser_op_type = NULL; | 360 | char *ser_op_type = NULL; |
640 | struct orangefs_attribute *orangefs_attr; | 361 | struct orangefs_attribute *orangefs_attr = attr; |
641 | struct acache_orangefs_attribute *acache_attr; | ||
642 | struct capcache_orangefs_attribute *capcache_attr; | ||
643 | struct ccache_orangefs_attribute *ccache_attr; | ||
644 | struct ncache_orangefs_attribute *ncache_attr; | ||
645 | struct pc_orangefs_attribute *pc_attr; | ||
646 | __u32 op_alloc_type; | 362 | __u32 op_alloc_type; |
647 | 363 | ||
648 | gossip_debug(GOSSIP_SYSFS_DEBUG, | 364 | gossip_debug(GOSSIP_SYSFS_DEBUG, |
@@ -671,8 +387,6 @@ static int sysfs_service_op_show(char *kobj_id, char *buf, void *attr) | |||
671 | new_op->upcall.req.param.type = ORANGEFS_PARAM_REQUEST_GET; | 387 | new_op->upcall.req.param.type = ORANGEFS_PARAM_REQUEST_GET; |
672 | 388 | ||
673 | if (!strcmp(kobj_id, ORANGEFS_KOBJ_ID)) { | 389 | if (!strcmp(kobj_id, ORANGEFS_KOBJ_ID)) { |
674 | orangefs_attr = (struct orangefs_attribute *)attr; | ||
675 | |||
676 | if (!strcmp(orangefs_attr->attr.name, "perf_history_size")) | 390 | if (!strcmp(orangefs_attr->attr.name, "perf_history_size")) |
677 | new_op->upcall.req.param.op = | 391 | new_op->upcall.req.param.op = |
678 | ORANGEFS_PARAM_REQUEST_OP_PERF_HISTORY_SIZE; | 392 | ORANGEFS_PARAM_REQUEST_OP_PERF_HISTORY_SIZE; |
@@ -700,93 +414,83 @@ static int sysfs_service_op_show(char *kobj_id, char *buf, void *attr) | |||
700 | new_op->upcall.req.param.op = | 414 | new_op->upcall.req.param.op = |
701 | ORANGEFS_PARAM_REQUEST_OP_READAHEAD_COUNT_SIZE; | 415 | ORANGEFS_PARAM_REQUEST_OP_READAHEAD_COUNT_SIZE; |
702 | } else if (!strcmp(kobj_id, ACACHE_KOBJ_ID)) { | 416 | } else if (!strcmp(kobj_id, ACACHE_KOBJ_ID)) { |
703 | acache_attr = (struct acache_orangefs_attribute *)attr; | 417 | if (!strcmp(orangefs_attr->attr.name, "timeout_msecs")) |
704 | |||
705 | if (!strcmp(acache_attr->attr.name, "timeout_msecs")) | ||
706 | new_op->upcall.req.param.op = | 418 | new_op->upcall.req.param.op = |
707 | ORANGEFS_PARAM_REQUEST_OP_ACACHE_TIMEOUT_MSECS; | 419 | ORANGEFS_PARAM_REQUEST_OP_ACACHE_TIMEOUT_MSECS; |
708 | 420 | ||
709 | if (!strcmp(acache_attr->attr.name, "hard_limit")) | 421 | if (!strcmp(orangefs_attr->attr.name, "hard_limit")) |
710 | new_op->upcall.req.param.op = | 422 | new_op->upcall.req.param.op = |
711 | ORANGEFS_PARAM_REQUEST_OP_ACACHE_HARD_LIMIT; | 423 | ORANGEFS_PARAM_REQUEST_OP_ACACHE_HARD_LIMIT; |
712 | 424 | ||
713 | if (!strcmp(acache_attr->attr.name, "soft_limit")) | 425 | if (!strcmp(orangefs_attr->attr.name, "soft_limit")) |
714 | new_op->upcall.req.param.op = | 426 | new_op->upcall.req.param.op = |
715 | ORANGEFS_PARAM_REQUEST_OP_ACACHE_SOFT_LIMIT; | 427 | ORANGEFS_PARAM_REQUEST_OP_ACACHE_SOFT_LIMIT; |
716 | 428 | ||
717 | if (!strcmp(acache_attr->attr.name, "reclaim_percentage")) | 429 | if (!strcmp(orangefs_attr->attr.name, "reclaim_percentage")) |
718 | new_op->upcall.req.param.op = | 430 | new_op->upcall.req.param.op = |
719 | ORANGEFS_PARAM_REQUEST_OP_ACACHE_RECLAIM_PERCENTAGE; | 431 | ORANGEFS_PARAM_REQUEST_OP_ACACHE_RECLAIM_PERCENTAGE; |
720 | 432 | ||
721 | } else if (!strcmp(kobj_id, CAPCACHE_KOBJ_ID)) { | 433 | } else if (!strcmp(kobj_id, CAPCACHE_KOBJ_ID)) { |
722 | capcache_attr = (struct capcache_orangefs_attribute *)attr; | 434 | if (!strcmp(orangefs_attr->attr.name, "timeout_secs")) |
723 | |||
724 | if (!strcmp(capcache_attr->attr.name, "timeout_secs")) | ||
725 | new_op->upcall.req.param.op = | 435 | new_op->upcall.req.param.op = |
726 | ORANGEFS_PARAM_REQUEST_OP_CAPCACHE_TIMEOUT_SECS; | 436 | ORANGEFS_PARAM_REQUEST_OP_CAPCACHE_TIMEOUT_SECS; |
727 | 437 | ||
728 | if (!strcmp(capcache_attr->attr.name, "hard_limit")) | 438 | if (!strcmp(orangefs_attr->attr.name, "hard_limit")) |
729 | new_op->upcall.req.param.op = | 439 | new_op->upcall.req.param.op = |
730 | ORANGEFS_PARAM_REQUEST_OP_CAPCACHE_HARD_LIMIT; | 440 | ORANGEFS_PARAM_REQUEST_OP_CAPCACHE_HARD_LIMIT; |
731 | 441 | ||
732 | if (!strcmp(capcache_attr->attr.name, "soft_limit")) | 442 | if (!strcmp(orangefs_attr->attr.name, "soft_limit")) |
733 | new_op->upcall.req.param.op = | 443 | new_op->upcall.req.param.op = |
734 | ORANGEFS_PARAM_REQUEST_OP_CAPCACHE_SOFT_LIMIT; | 444 | ORANGEFS_PARAM_REQUEST_OP_CAPCACHE_SOFT_LIMIT; |
735 | 445 | ||
736 | if (!strcmp(capcache_attr->attr.name, "reclaim_percentage")) | 446 | if (!strcmp(orangefs_attr->attr.name, "reclaim_percentage")) |
737 | new_op->upcall.req.param.op = | 447 | new_op->upcall.req.param.op = |
738 | ORANGEFS_PARAM_REQUEST_OP_CAPCACHE_RECLAIM_PERCENTAGE; | 448 | ORANGEFS_PARAM_REQUEST_OP_CAPCACHE_RECLAIM_PERCENTAGE; |
739 | 449 | ||
740 | } else if (!strcmp(kobj_id, CCACHE_KOBJ_ID)) { | 450 | } else if (!strcmp(kobj_id, CCACHE_KOBJ_ID)) { |
741 | ccache_attr = (struct ccache_orangefs_attribute *)attr; | 451 | if (!strcmp(orangefs_attr->attr.name, "timeout_secs")) |
742 | |||
743 | if (!strcmp(ccache_attr->attr.name, "timeout_secs")) | ||
744 | new_op->upcall.req.param.op = | 452 | new_op->upcall.req.param.op = |
745 | ORANGEFS_PARAM_REQUEST_OP_CCACHE_TIMEOUT_SECS; | 453 | ORANGEFS_PARAM_REQUEST_OP_CCACHE_TIMEOUT_SECS; |
746 | 454 | ||
747 | if (!strcmp(ccache_attr->attr.name, "hard_limit")) | 455 | if (!strcmp(orangefs_attr->attr.name, "hard_limit")) |
748 | new_op->upcall.req.param.op = | 456 | new_op->upcall.req.param.op = |
749 | ORANGEFS_PARAM_REQUEST_OP_CCACHE_HARD_LIMIT; | 457 | ORANGEFS_PARAM_REQUEST_OP_CCACHE_HARD_LIMIT; |
750 | 458 | ||
751 | if (!strcmp(ccache_attr->attr.name, "soft_limit")) | 459 | if (!strcmp(orangefs_attr->attr.name, "soft_limit")) |
752 | new_op->upcall.req.param.op = | 460 | new_op->upcall.req.param.op = |
753 | ORANGEFS_PARAM_REQUEST_OP_CCACHE_SOFT_LIMIT; | 461 | ORANGEFS_PARAM_REQUEST_OP_CCACHE_SOFT_LIMIT; |
754 | 462 | ||
755 | if (!strcmp(ccache_attr->attr.name, "reclaim_percentage")) | 463 | if (!strcmp(orangefs_attr->attr.name, "reclaim_percentage")) |
756 | new_op->upcall.req.param.op = | 464 | new_op->upcall.req.param.op = |
757 | ORANGEFS_PARAM_REQUEST_OP_CCACHE_RECLAIM_PERCENTAGE; | 465 | ORANGEFS_PARAM_REQUEST_OP_CCACHE_RECLAIM_PERCENTAGE; |
758 | 466 | ||
759 | } else if (!strcmp(kobj_id, NCACHE_KOBJ_ID)) { | 467 | } else if (!strcmp(kobj_id, NCACHE_KOBJ_ID)) { |
760 | ncache_attr = (struct ncache_orangefs_attribute *)attr; | 468 | if (!strcmp(orangefs_attr->attr.name, "timeout_msecs")) |
761 | |||
762 | if (!strcmp(ncache_attr->attr.name, "timeout_msecs")) | ||
763 | new_op->upcall.req.param.op = | 469 | new_op->upcall.req.param.op = |
764 | ORANGEFS_PARAM_REQUEST_OP_NCACHE_TIMEOUT_MSECS; | 470 | ORANGEFS_PARAM_REQUEST_OP_NCACHE_TIMEOUT_MSECS; |
765 | 471 | ||
766 | if (!strcmp(ncache_attr->attr.name, "hard_limit")) | 472 | if (!strcmp(orangefs_attr->attr.name, "hard_limit")) |
767 | new_op->upcall.req.param.op = | 473 | new_op->upcall.req.param.op = |
768 | ORANGEFS_PARAM_REQUEST_OP_NCACHE_HARD_LIMIT; | 474 | ORANGEFS_PARAM_REQUEST_OP_NCACHE_HARD_LIMIT; |
769 | 475 | ||
770 | if (!strcmp(ncache_attr->attr.name, "soft_limit")) | 476 | if (!strcmp(orangefs_attr->attr.name, "soft_limit")) |
771 | new_op->upcall.req.param.op = | 477 | new_op->upcall.req.param.op = |
772 | ORANGEFS_PARAM_REQUEST_OP_NCACHE_SOFT_LIMIT; | 478 | ORANGEFS_PARAM_REQUEST_OP_NCACHE_SOFT_LIMIT; |
773 | 479 | ||
774 | if (!strcmp(ncache_attr->attr.name, "reclaim_percentage")) | 480 | if (!strcmp(orangefs_attr->attr.name, "reclaim_percentage")) |
775 | new_op->upcall.req.param.op = | 481 | new_op->upcall.req.param.op = |
776 | ORANGEFS_PARAM_REQUEST_OP_NCACHE_RECLAIM_PERCENTAGE; | 482 | ORANGEFS_PARAM_REQUEST_OP_NCACHE_RECLAIM_PERCENTAGE; |
777 | 483 | ||
778 | } else if (!strcmp(kobj_id, PC_KOBJ_ID)) { | 484 | } else if (!strcmp(kobj_id, PC_KOBJ_ID)) { |
779 | pc_attr = (struct pc_orangefs_attribute *)attr; | 485 | if (!strcmp(orangefs_attr->attr.name, ACACHE_KOBJ_ID)) |
780 | |||
781 | if (!strcmp(pc_attr->attr.name, ACACHE_KOBJ_ID)) | ||
782 | new_op->upcall.req.perf_count.type = | 486 | new_op->upcall.req.perf_count.type = |
783 | ORANGEFS_PERF_COUNT_REQUEST_ACACHE; | 487 | ORANGEFS_PERF_COUNT_REQUEST_ACACHE; |
784 | 488 | ||
785 | if (!strcmp(pc_attr->attr.name, CAPCACHE_KOBJ_ID)) | 489 | if (!strcmp(orangefs_attr->attr.name, CAPCACHE_KOBJ_ID)) |
786 | new_op->upcall.req.perf_count.type = | 490 | new_op->upcall.req.perf_count.type = |
787 | ORANGEFS_PERF_COUNT_REQUEST_CAPCACHE; | 491 | ORANGEFS_PERF_COUNT_REQUEST_CAPCACHE; |
788 | 492 | ||
789 | if (!strcmp(pc_attr->attr.name, NCACHE_KOBJ_ID)) | 493 | if (!strcmp(orangefs_attr->attr.name, NCACHE_KOBJ_ID)) |
790 | new_op->upcall.req.perf_count.type = | 494 | new_op->upcall.req.perf_count.type = |
791 | ORANGEFS_PERF_COUNT_REQUEST_NCACHE; | 495 | ORANGEFS_PERF_COUNT_REQUEST_NCACHE; |
792 | 496 | ||
@@ -849,7 +553,7 @@ static ssize_t service_orangefs_show(struct orangefs_attribute *attr, | |||
849 | } | 553 | } |
850 | 554 | ||
851 | static ssize_t | 555 | static ssize_t |
852 | service_acache_show(struct acache_orangefs_attribute *attr, | 556 | service_acache_show(struct orangefs_attribute *attr, |
853 | char *buf) | 557 | char *buf) |
854 | { | 558 | { |
855 | int rc = 0; | 559 | int rc = 0; |
@@ -859,7 +563,7 @@ static ssize_t | |||
859 | return rc; | 563 | return rc; |
860 | } | 564 | } |
861 | 565 | ||
862 | static ssize_t service_capcache_show(struct capcache_orangefs_attribute *attr, | 566 | static ssize_t service_capcache_show(struct orangefs_attribute *attr, |
863 | char *buf) | 567 | char *buf) |
864 | { | 568 | { |
865 | int rc = 0; | 569 | int rc = 0; |
@@ -869,7 +573,7 @@ static ssize_t service_capcache_show(struct capcache_orangefs_attribute *attr, | |||
869 | return rc; | 573 | return rc; |
870 | } | 574 | } |
871 | 575 | ||
872 | static ssize_t service_ccache_show(struct ccache_orangefs_attribute *attr, | 576 | static ssize_t service_ccache_show(struct orangefs_attribute *attr, |
873 | char *buf) | 577 | char *buf) |
874 | { | 578 | { |
875 | int rc = 0; | 579 | int rc = 0; |
@@ -880,7 +584,7 @@ static ssize_t service_ccache_show(struct ccache_orangefs_attribute *attr, | |||
880 | } | 584 | } |
881 | 585 | ||
882 | static ssize_t | 586 | static ssize_t |
883 | service_ncache_show(struct ncache_orangefs_attribute *attr, | 587 | service_ncache_show(struct orangefs_attribute *attr, |
884 | char *buf) | 588 | char *buf) |
885 | { | 589 | { |
886 | int rc = 0; | 590 | int rc = 0; |
@@ -891,7 +595,7 @@ static ssize_t | |||
891 | } | 595 | } |
892 | 596 | ||
893 | static ssize_t | 597 | static ssize_t |
894 | service_pc_show(struct pc_orangefs_attribute *attr, | 598 | service_pc_show(struct orangefs_attribute *attr, |
895 | char *buf) | 599 | char *buf) |
896 | { | 600 | { |
897 | int rc = 0; | 601 | int rc = 0; |
@@ -917,11 +621,7 @@ static int sysfs_service_op_store(char *kobj_id, const char *buf, void *attr) | |||
917 | struct orangefs_kernel_op_s *new_op = NULL; | 621 | struct orangefs_kernel_op_s *new_op = NULL; |
918 | int val = 0; | 622 | int val = 0; |
919 | int rc = 0; | 623 | int rc = 0; |
920 | struct orangefs_attribute *orangefs_attr; | 624 | struct orangefs_attribute *orangefs_attr = attr; |
921 | struct acache_orangefs_attribute *acache_attr; | ||
922 | struct capcache_orangefs_attribute *capcache_attr; | ||
923 | struct ccache_orangefs_attribute *ccache_attr; | ||
924 | struct ncache_orangefs_attribute *ncache_attr; | ||
925 | 625 | ||
926 | gossip_debug(GOSSIP_SYSFS_DEBUG, | 626 | gossip_debug(GOSSIP_SYSFS_DEBUG, |
927 | "sysfs_service_op_store: id:%s:\n", | 627 | "sysfs_service_op_store: id:%s:\n", |
@@ -955,8 +655,6 @@ static int sysfs_service_op_store(char *kobj_id, const char *buf, void *attr) | |||
955 | new_op->upcall.req.param.type = ORANGEFS_PARAM_REQUEST_SET; | 655 | new_op->upcall.req.param.type = ORANGEFS_PARAM_REQUEST_SET; |
956 | 656 | ||
957 | if (!strcmp(kobj_id, ORANGEFS_KOBJ_ID)) { | 657 | if (!strcmp(kobj_id, ORANGEFS_KOBJ_ID)) { |
958 | orangefs_attr = (struct orangefs_attribute *)attr; | ||
959 | |||
960 | if (!strcmp(orangefs_attr->attr.name, "perf_history_size")) { | 658 | if (!strcmp(orangefs_attr->attr.name, "perf_history_size")) { |
961 | if (val > 0) { | 659 | if (val > 0) { |
962 | new_op->upcall.req.param.op = | 660 | new_op->upcall.req.param.op = |
@@ -1031,9 +729,7 @@ static int sysfs_service_op_store(char *kobj_id, const char *buf, void *attr) | |||
1031 | } | 729 | } |
1032 | 730 | ||
1033 | } else if (!strcmp(kobj_id, ACACHE_KOBJ_ID)) { | 731 | } else if (!strcmp(kobj_id, ACACHE_KOBJ_ID)) { |
1034 | acache_attr = (struct acache_orangefs_attribute *)attr; | 732 | if (!strcmp(orangefs_attr->attr.name, "hard_limit")) { |
1035 | |||
1036 | if (!strcmp(acache_attr->attr.name, "hard_limit")) { | ||
1037 | if (val > -1) { | 733 | if (val > -1) { |
1038 | new_op->upcall.req.param.op = | 734 | new_op->upcall.req.param.op = |
1039 | ORANGEFS_PARAM_REQUEST_OP_ACACHE_HARD_LIMIT; | 735 | ORANGEFS_PARAM_REQUEST_OP_ACACHE_HARD_LIMIT; |
@@ -1041,7 +737,7 @@ static int sysfs_service_op_store(char *kobj_id, const char *buf, void *attr) | |||
1041 | rc = 0; | 737 | rc = 0; |
1042 | goto out; | 738 | goto out; |
1043 | } | 739 | } |
1044 | } else if (!strcmp(acache_attr->attr.name, "soft_limit")) { | 740 | } else if (!strcmp(orangefs_attr->attr.name, "soft_limit")) { |
1045 | if (val > -1) { | 741 | if (val > -1) { |
1046 | new_op->upcall.req.param.op = | 742 | new_op->upcall.req.param.op = |
1047 | ORANGEFS_PARAM_REQUEST_OP_ACACHE_SOFT_LIMIT; | 743 | ORANGEFS_PARAM_REQUEST_OP_ACACHE_SOFT_LIMIT; |
@@ -1049,7 +745,7 @@ static int sysfs_service_op_store(char *kobj_id, const char *buf, void *attr) | |||
1049 | rc = 0; | 745 | rc = 0; |
1050 | goto out; | 746 | goto out; |
1051 | } | 747 | } |
1052 | } else if (!strcmp(acache_attr->attr.name, | 748 | } else if (!strcmp(orangefs_attr->attr.name, |
1053 | "reclaim_percentage")) { | 749 | "reclaim_percentage")) { |
1054 | if ((val > -1) && (val < 101)) { | 750 | if ((val > -1) && (val < 101)) { |
1055 | new_op->upcall.req.param.op = | 751 | new_op->upcall.req.param.op = |
@@ -1058,7 +754,7 @@ static int sysfs_service_op_store(char *kobj_id, const char *buf, void *attr) | |||
1058 | rc = 0; | 754 | rc = 0; |
1059 | goto out; | 755 | goto out; |
1060 | } | 756 | } |
1061 | } else if (!strcmp(acache_attr->attr.name, "timeout_msecs")) { | 757 | } else if (!strcmp(orangefs_attr->attr.name, "timeout_msecs")) { |
1062 | if (val > -1) { | 758 | if (val > -1) { |
1063 | new_op->upcall.req.param.op = | 759 | new_op->upcall.req.param.op = |
1064 | ORANGEFS_PARAM_REQUEST_OP_ACACHE_TIMEOUT_MSECS; | 760 | ORANGEFS_PARAM_REQUEST_OP_ACACHE_TIMEOUT_MSECS; |
@@ -1069,9 +765,7 @@ static int sysfs_service_op_store(char *kobj_id, const char *buf, void *attr) | |||
1069 | } | 765 | } |
1070 | 766 | ||
1071 | } else if (!strcmp(kobj_id, CAPCACHE_KOBJ_ID)) { | 767 | } else if (!strcmp(kobj_id, CAPCACHE_KOBJ_ID)) { |
1072 | capcache_attr = (struct capcache_orangefs_attribute *)attr; | 768 | if (!strcmp(orangefs_attr->attr.name, "hard_limit")) { |
1073 | |||
1074 | if (!strcmp(capcache_attr->attr.name, "hard_limit")) { | ||
1075 | if (val > -1) { | 769 | if (val > -1) { |
1076 | new_op->upcall.req.param.op = | 770 | new_op->upcall.req.param.op = |
1077 | ORANGEFS_PARAM_REQUEST_OP_CAPCACHE_HARD_LIMIT; | 771 | ORANGEFS_PARAM_REQUEST_OP_CAPCACHE_HARD_LIMIT; |
@@ -1079,7 +773,7 @@ static int sysfs_service_op_store(char *kobj_id, const char *buf, void *attr) | |||
1079 | rc = 0; | 773 | rc = 0; |
1080 | goto out; | 774 | goto out; |
1081 | } | 775 | } |
1082 | } else if (!strcmp(capcache_attr->attr.name, "soft_limit")) { | 776 | } else if (!strcmp(orangefs_attr->attr.name, "soft_limit")) { |
1083 | if (val > -1) { | 777 | if (val > -1) { |
1084 | new_op->upcall.req.param.op = | 778 | new_op->upcall.req.param.op = |
1085 | ORANGEFS_PARAM_REQUEST_OP_CAPCACHE_SOFT_LIMIT; | 779 | ORANGEFS_PARAM_REQUEST_OP_CAPCACHE_SOFT_LIMIT; |
@@ -1087,7 +781,7 @@ static int sysfs_service_op_store(char *kobj_id, const char *buf, void *attr) | |||
1087 | rc = 0; | 781 | rc = 0; |
1088 | goto out; | 782 | goto out; |
1089 | } | 783 | } |
1090 | } else if (!strcmp(capcache_attr->attr.name, | 784 | } else if (!strcmp(orangefs_attr->attr.name, |
1091 | "reclaim_percentage")) { | 785 | "reclaim_percentage")) { |
1092 | if ((val > -1) && (val < 101)) { | 786 | if ((val > -1) && (val < 101)) { |
1093 | new_op->upcall.req.param.op = | 787 | new_op->upcall.req.param.op = |
@@ -1096,7 +790,7 @@ static int sysfs_service_op_store(char *kobj_id, const char *buf, void *attr) | |||
1096 | rc = 0; | 790 | rc = 0; |
1097 | goto out; | 791 | goto out; |
1098 | } | 792 | } |
1099 | } else if (!strcmp(capcache_attr->attr.name, "timeout_secs")) { | 793 | } else if (!strcmp(orangefs_attr->attr.name, "timeout_secs")) { |
1100 | if (val > -1) { | 794 | if (val > -1) { |
1101 | new_op->upcall.req.param.op = | 795 | new_op->upcall.req.param.op = |
1102 | ORANGEFS_PARAM_REQUEST_OP_CAPCACHE_TIMEOUT_SECS; | 796 | ORANGEFS_PARAM_REQUEST_OP_CAPCACHE_TIMEOUT_SECS; |
@@ -1107,9 +801,7 @@ static int sysfs_service_op_store(char *kobj_id, const char *buf, void *attr) | |||
1107 | } | 801 | } |
1108 | 802 | ||
1109 | } else if (!strcmp(kobj_id, CCACHE_KOBJ_ID)) { | 803 | } else if (!strcmp(kobj_id, CCACHE_KOBJ_ID)) { |
1110 | ccache_attr = (struct ccache_orangefs_attribute *)attr; | 804 | if (!strcmp(orangefs_attr->attr.name, "hard_limit")) { |
1111 | |||
1112 | if (!strcmp(ccache_attr->attr.name, "hard_limit")) { | ||
1113 | if (val > -1) { | 805 | if (val > -1) { |
1114 | new_op->upcall.req.param.op = | 806 | new_op->upcall.req.param.op = |
1115 | ORANGEFS_PARAM_REQUEST_OP_CCACHE_HARD_LIMIT; | 807 | ORANGEFS_PARAM_REQUEST_OP_CCACHE_HARD_LIMIT; |
@@ -1117,7 +809,7 @@ static int sysfs_service_op_store(char *kobj_id, const char *buf, void *attr) | |||
1117 | rc = 0; | 809 | rc = 0; |
1118 | goto out; | 810 | goto out; |
1119 | } | 811 | } |
1120 | } else if (!strcmp(ccache_attr->attr.name, "soft_limit")) { | 812 | } else if (!strcmp(orangefs_attr->attr.name, "soft_limit")) { |
1121 | if (val > -1) { | 813 | if (val > -1) { |
1122 | new_op->upcall.req.param.op = | 814 | new_op->upcall.req.param.op = |
1123 | ORANGEFS_PARAM_REQUEST_OP_CCACHE_SOFT_LIMIT; | 815 | ORANGEFS_PARAM_REQUEST_OP_CCACHE_SOFT_LIMIT; |
@@ -1125,7 +817,7 @@ static int sysfs_service_op_store(char *kobj_id, const char *buf, void *attr) | |||
1125 | rc = 0; | 817 | rc = 0; |
1126 | goto out; | 818 | goto out; |
1127 | } | 819 | } |
1128 | } else if (!strcmp(ccache_attr->attr.name, | 820 | } else if (!strcmp(orangefs_attr->attr.name, |
1129 | "reclaim_percentage")) { | 821 | "reclaim_percentage")) { |
1130 | if ((val > -1) && (val < 101)) { | 822 | if ((val > -1) && (val < 101)) { |
1131 | new_op->upcall.req.param.op = | 823 | new_op->upcall.req.param.op = |
@@ -1134,7 +826,7 @@ static int sysfs_service_op_store(char *kobj_id, const char *buf, void *attr) | |||
1134 | rc = 0; | 826 | rc = 0; |
1135 | goto out; | 827 | goto out; |
1136 | } | 828 | } |
1137 | } else if (!strcmp(ccache_attr->attr.name, "timeout_secs")) { | 829 | } else if (!strcmp(orangefs_attr->attr.name, "timeout_secs")) { |
1138 | if (val > -1) { | 830 | if (val > -1) { |
1139 | new_op->upcall.req.param.op = | 831 | new_op->upcall.req.param.op = |
1140 | ORANGEFS_PARAM_REQUEST_OP_CCACHE_TIMEOUT_SECS; | 832 | ORANGEFS_PARAM_REQUEST_OP_CCACHE_TIMEOUT_SECS; |
@@ -1145,9 +837,7 @@ static int sysfs_service_op_store(char *kobj_id, const char *buf, void *attr) | |||
1145 | } | 837 | } |
1146 | 838 | ||
1147 | } else if (!strcmp(kobj_id, NCACHE_KOBJ_ID)) { | 839 | } else if (!strcmp(kobj_id, NCACHE_KOBJ_ID)) { |
1148 | ncache_attr = (struct ncache_orangefs_attribute *)attr; | 840 | if (!strcmp(orangefs_attr->attr.name, "hard_limit")) { |
1149 | |||
1150 | if (!strcmp(ncache_attr->attr.name, "hard_limit")) { | ||
1151 | if (val > -1) { | 841 | if (val > -1) { |
1152 | new_op->upcall.req.param.op = | 842 | new_op->upcall.req.param.op = |
1153 | ORANGEFS_PARAM_REQUEST_OP_NCACHE_HARD_LIMIT; | 843 | ORANGEFS_PARAM_REQUEST_OP_NCACHE_HARD_LIMIT; |
@@ -1155,7 +845,7 @@ static int sysfs_service_op_store(char *kobj_id, const char *buf, void *attr) | |||
1155 | rc = 0; | 845 | rc = 0; |
1156 | goto out; | 846 | goto out; |
1157 | } | 847 | } |
1158 | } else if (!strcmp(ncache_attr->attr.name, "soft_limit")) { | 848 | } else if (!strcmp(orangefs_attr->attr.name, "soft_limit")) { |
1159 | if (val > -1) { | 849 | if (val > -1) { |
1160 | new_op->upcall.req.param.op = | 850 | new_op->upcall.req.param.op = |
1161 | ORANGEFS_PARAM_REQUEST_OP_NCACHE_SOFT_LIMIT; | 851 | ORANGEFS_PARAM_REQUEST_OP_NCACHE_SOFT_LIMIT; |
@@ -1163,7 +853,7 @@ static int sysfs_service_op_store(char *kobj_id, const char *buf, void *attr) | |||
1163 | rc = 0; | 853 | rc = 0; |
1164 | goto out; | 854 | goto out; |
1165 | } | 855 | } |
1166 | } else if (!strcmp(ncache_attr->attr.name, | 856 | } else if (!strcmp(orangefs_attr->attr.name, |
1167 | "reclaim_percentage")) { | 857 | "reclaim_percentage")) { |
1168 | if ((val > -1) && (val < 101)) { | 858 | if ((val > -1) && (val < 101)) { |
1169 | new_op->upcall.req.param.op = | 859 | new_op->upcall.req.param.op = |
@@ -1172,7 +862,7 @@ static int sysfs_service_op_store(char *kobj_id, const char *buf, void *attr) | |||
1172 | rc = 0; | 862 | rc = 0; |
1173 | goto out; | 863 | goto out; |
1174 | } | 864 | } |
1175 | } else if (!strcmp(ncache_attr->attr.name, "timeout_msecs")) { | 865 | } else if (!strcmp(orangefs_attr->attr.name, "timeout_msecs")) { |
1176 | if (val > -1) { | 866 | if (val > -1) { |
1177 | new_op->upcall.req.param.op = | 867 | new_op->upcall.req.param.op = |
1178 | ORANGEFS_PARAM_REQUEST_OP_NCACHE_TIMEOUT_MSECS; | 868 | ORANGEFS_PARAM_REQUEST_OP_NCACHE_TIMEOUT_MSECS; |
@@ -1232,7 +922,7 @@ static ssize_t | |||
1232 | } | 922 | } |
1233 | 923 | ||
1234 | static ssize_t | 924 | static ssize_t |
1235 | service_acache_store(struct acache_orangefs_attribute *attr, | 925 | service_acache_store(struct orangefs_attribute *attr, |
1236 | const char *buf, | 926 | const char *buf, |
1237 | size_t count) | 927 | size_t count) |
1238 | { | 928 | { |
@@ -1248,7 +938,7 @@ static ssize_t | |||
1248 | } | 938 | } |
1249 | 939 | ||
1250 | static ssize_t | 940 | static ssize_t |
1251 | service_capcache_store(struct capcache_orangefs_attribute *attr, | 941 | service_capcache_store(struct orangefs_attribute *attr, |
1252 | const char *buf, | 942 | const char *buf, |
1253 | size_t count) | 943 | size_t count) |
1254 | { | 944 | { |
@@ -1263,7 +953,7 @@ static ssize_t | |||
1263 | return rc; | 953 | return rc; |
1264 | } | 954 | } |
1265 | 955 | ||
1266 | static ssize_t service_ccache_store(struct ccache_orangefs_attribute *attr, | 956 | static ssize_t service_ccache_store(struct orangefs_attribute *attr, |
1267 | const char *buf, | 957 | const char *buf, |
1268 | size_t count) | 958 | size_t count) |
1269 | { | 959 | { |
@@ -1279,7 +969,7 @@ static ssize_t service_ccache_store(struct ccache_orangefs_attribute *attr, | |||
1279 | } | 969 | } |
1280 | 970 | ||
1281 | static ssize_t | 971 | static ssize_t |
1282 | service_ncache_store(struct ncache_orangefs_attribute *attr, | 972 | service_ncache_store(struct orangefs_attribute *attr, |
1283 | const char *buf, | 973 | const char *buf, |
1284 | size_t count) | 974 | size_t count) |
1285 | { | 975 | { |
@@ -1355,25 +1045,25 @@ static struct kobj_type orangefs_ktype = { | |||
1355 | .default_attrs = orangefs_default_attrs, | 1045 | .default_attrs = orangefs_default_attrs, |
1356 | }; | 1046 | }; |
1357 | 1047 | ||
1358 | static struct acache_orangefs_attribute acache_hard_limit_attribute = | 1048 | static struct orangefs_attribute acache_hard_limit_attribute = |
1359 | __ATTR(hard_limit, | 1049 | __ATTR(hard_limit, |
1360 | 0664, | 1050 | 0664, |
1361 | service_acache_show, | 1051 | service_acache_show, |
1362 | service_acache_store); | 1052 | service_acache_store); |
1363 | 1053 | ||
1364 | static struct acache_orangefs_attribute acache_reclaim_percent_attribute = | 1054 | static struct orangefs_attribute acache_reclaim_percent_attribute = |
1365 | __ATTR(reclaim_percentage, | 1055 | __ATTR(reclaim_percentage, |
1366 | 0664, | 1056 | 0664, |
1367 | service_acache_show, | 1057 | service_acache_show, |
1368 | service_acache_store); | 1058 | service_acache_store); |
1369 | 1059 | ||
1370 | static struct acache_orangefs_attribute acache_soft_limit_attribute = | 1060 | static struct orangefs_attribute acache_soft_limit_attribute = |
1371 | __ATTR(soft_limit, | 1061 | __ATTR(soft_limit, |
1372 | 0664, | 1062 | 0664, |
1373 | service_acache_show, | 1063 | service_acache_show, |
1374 | service_acache_store); | 1064 | service_acache_store); |
1375 | 1065 | ||
1376 | static struct acache_orangefs_attribute acache_timeout_msecs_attribute = | 1066 | static struct orangefs_attribute acache_timeout_msecs_attribute = |
1377 | __ATTR(timeout_msecs, | 1067 | __ATTR(timeout_msecs, |
1378 | 0664, | 1068 | 0664, |
1379 | service_acache_show, | 1069 | service_acache_show, |
@@ -1392,25 +1082,25 @@ static struct kobj_type acache_orangefs_ktype = { | |||
1392 | .default_attrs = acache_orangefs_default_attrs, | 1082 | .default_attrs = acache_orangefs_default_attrs, |
1393 | }; | 1083 | }; |
1394 | 1084 | ||
1395 | static struct capcache_orangefs_attribute capcache_hard_limit_attribute = | 1085 | static struct orangefs_attribute capcache_hard_limit_attribute = |
1396 | __ATTR(hard_limit, | 1086 | __ATTR(hard_limit, |
1397 | 0664, | 1087 | 0664, |
1398 | service_capcache_show, | 1088 | service_capcache_show, |
1399 | service_capcache_store); | 1089 | service_capcache_store); |
1400 | 1090 | ||
1401 | static struct capcache_orangefs_attribute capcache_reclaim_percent_attribute = | 1091 | static struct orangefs_attribute capcache_reclaim_percent_attribute = |
1402 | __ATTR(reclaim_percentage, | 1092 | __ATTR(reclaim_percentage, |
1403 | 0664, | 1093 | 0664, |
1404 | service_capcache_show, | 1094 | service_capcache_show, |
1405 | service_capcache_store); | 1095 | service_capcache_store); |
1406 | 1096 | ||
1407 | static struct capcache_orangefs_attribute capcache_soft_limit_attribute = | 1097 | static struct orangefs_attribute capcache_soft_limit_attribute = |
1408 | __ATTR(soft_limit, | 1098 | __ATTR(soft_limit, |
1409 | 0664, | 1099 | 0664, |
1410 | service_capcache_show, | 1100 | service_capcache_show, |
1411 | service_capcache_store); | 1101 | service_capcache_store); |
1412 | 1102 | ||
1413 | static struct capcache_orangefs_attribute capcache_timeout_secs_attribute = | 1103 | static struct orangefs_attribute capcache_timeout_secs_attribute = |
1414 | __ATTR(timeout_secs, | 1104 | __ATTR(timeout_secs, |
1415 | 0664, | 1105 | 0664, |
1416 | service_capcache_show, | 1106 | service_capcache_show, |
@@ -1429,25 +1119,25 @@ static struct kobj_type capcache_orangefs_ktype = { | |||
1429 | .default_attrs = capcache_orangefs_default_attrs, | 1119 | .default_attrs = capcache_orangefs_default_attrs, |
1430 | }; | 1120 | }; |
1431 | 1121 | ||
1432 | static struct ccache_orangefs_attribute ccache_hard_limit_attribute = | 1122 | static struct orangefs_attribute ccache_hard_limit_attribute = |
1433 | __ATTR(hard_limit, | 1123 | __ATTR(hard_limit, |
1434 | 0664, | 1124 | 0664, |
1435 | service_ccache_show, | 1125 | service_ccache_show, |
1436 | service_ccache_store); | 1126 | service_ccache_store); |
1437 | 1127 | ||
1438 | static struct ccache_orangefs_attribute ccache_reclaim_percent_attribute = | 1128 | static struct orangefs_attribute ccache_reclaim_percent_attribute = |
1439 | __ATTR(reclaim_percentage, | 1129 | __ATTR(reclaim_percentage, |
1440 | 0664, | 1130 | 0664, |
1441 | service_ccache_show, | 1131 | service_ccache_show, |
1442 | service_ccache_store); | 1132 | service_ccache_store); |
1443 | 1133 | ||
1444 | static struct ccache_orangefs_attribute ccache_soft_limit_attribute = | 1134 | static struct orangefs_attribute ccache_soft_limit_attribute = |
1445 | __ATTR(soft_limit, | 1135 | __ATTR(soft_limit, |
1446 | 0664, | 1136 | 0664, |
1447 | service_ccache_show, | 1137 | service_ccache_show, |
1448 | service_ccache_store); | 1138 | service_ccache_store); |
1449 | 1139 | ||
1450 | static struct ccache_orangefs_attribute ccache_timeout_secs_attribute = | 1140 | static struct orangefs_attribute ccache_timeout_secs_attribute = |
1451 | __ATTR(timeout_secs, | 1141 | __ATTR(timeout_secs, |
1452 | 0664, | 1142 | 0664, |
1453 | service_ccache_show, | 1143 | service_ccache_show, |
@@ -1466,25 +1156,25 @@ static struct kobj_type ccache_orangefs_ktype = { | |||
1466 | .default_attrs = ccache_orangefs_default_attrs, | 1156 | .default_attrs = ccache_orangefs_default_attrs, |
1467 | }; | 1157 | }; |
1468 | 1158 | ||
1469 | static struct ncache_orangefs_attribute ncache_hard_limit_attribute = | 1159 | static struct orangefs_attribute ncache_hard_limit_attribute = |
1470 | __ATTR(hard_limit, | 1160 | __ATTR(hard_limit, |
1471 | 0664, | 1161 | 0664, |
1472 | service_ncache_show, | 1162 | service_ncache_show, |
1473 | service_ncache_store); | 1163 | service_ncache_store); |
1474 | 1164 | ||
1475 | static struct ncache_orangefs_attribute ncache_reclaim_percent_attribute = | 1165 | static struct orangefs_attribute ncache_reclaim_percent_attribute = |
1476 | __ATTR(reclaim_percentage, | 1166 | __ATTR(reclaim_percentage, |
1477 | 0664, | 1167 | 0664, |
1478 | service_ncache_show, | 1168 | service_ncache_show, |
1479 | service_ncache_store); | 1169 | service_ncache_store); |
1480 | 1170 | ||
1481 | static struct ncache_orangefs_attribute ncache_soft_limit_attribute = | 1171 | static struct orangefs_attribute ncache_soft_limit_attribute = |
1482 | __ATTR(soft_limit, | 1172 | __ATTR(soft_limit, |
1483 | 0664, | 1173 | 0664, |
1484 | service_ncache_show, | 1174 | service_ncache_show, |
1485 | service_ncache_store); | 1175 | service_ncache_store); |
1486 | 1176 | ||
1487 | static struct ncache_orangefs_attribute ncache_timeout_msecs_attribute = | 1177 | static struct orangefs_attribute ncache_timeout_msecs_attribute = |
1488 | __ATTR(timeout_msecs, | 1178 | __ATTR(timeout_msecs, |
1489 | 0664, | 1179 | 0664, |
1490 | service_ncache_show, | 1180 | service_ncache_show, |
@@ -1503,19 +1193,19 @@ static struct kobj_type ncache_orangefs_ktype = { | |||
1503 | .default_attrs = ncache_orangefs_default_attrs, | 1193 | .default_attrs = ncache_orangefs_default_attrs, |
1504 | }; | 1194 | }; |
1505 | 1195 | ||
1506 | static struct pc_orangefs_attribute pc_acache_attribute = | 1196 | static struct orangefs_attribute pc_acache_attribute = |
1507 | __ATTR(acache, | 1197 | __ATTR(acache, |
1508 | 0664, | 1198 | 0664, |
1509 | service_pc_show, | 1199 | service_pc_show, |
1510 | NULL); | 1200 | NULL); |
1511 | 1201 | ||
1512 | static struct pc_orangefs_attribute pc_capcache_attribute = | 1202 | static struct orangefs_attribute pc_capcache_attribute = |
1513 | __ATTR(capcache, | 1203 | __ATTR(capcache, |
1514 | 0664, | 1204 | 0664, |
1515 | service_pc_show, | 1205 | service_pc_show, |
1516 | NULL); | 1206 | NULL); |
1517 | 1207 | ||
1518 | static struct pc_orangefs_attribute pc_ncache_attribute = | 1208 | static struct orangefs_attribute pc_ncache_attribute = |
1519 | __ATTR(ncache, | 1209 | __ATTR(ncache, |
1520 | 0664, | 1210 | 0664, |
1521 | service_pc_show, | 1211 | service_pc_show, |
@@ -1533,13 +1223,13 @@ static struct kobj_type pc_orangefs_ktype = { | |||
1533 | .default_attrs = pc_orangefs_default_attrs, | 1223 | .default_attrs = pc_orangefs_default_attrs, |
1534 | }; | 1224 | }; |
1535 | 1225 | ||
1536 | static struct stats_orangefs_attribute stats_reads_attribute = | 1226 | static struct orangefs_attribute stats_reads_attribute = |
1537 | __ATTR(reads, | 1227 | __ATTR(reads, |
1538 | 0664, | 1228 | 0664, |
1539 | int_stats_show, | 1229 | int_stats_show, |
1540 | NULL); | 1230 | NULL); |
1541 | 1231 | ||
1542 | static struct stats_orangefs_attribute stats_writes_attribute = | 1232 | static struct orangefs_attribute stats_writes_attribute = |
1543 | __ATTR(writes, | 1233 | __ATTR(writes, |
1544 | 0664, | 1234 | 0664, |
1545 | int_stats_show, | 1235 | int_stats_show, |