orangefs-sysfs.c 31 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213
  1. /*
  2. * Documentation/ABI/stable/orangefs-sysfs:
  3. *
  4. * What: /sys/fs/orangefs/perf_counter_reset
  5. * Date: June 2015
  6. * Contact: Mike Marshall <hubcap@omnibond.com>
  7. * Description:
  8. * echo a 0 or a 1 into perf_counter_reset to
  9. * reset all the counters in
  10. * /sys/fs/orangefs/perf_counters
  11. * except ones with PINT_PERF_PRESERVE set.
  12. *
  13. *
  14. * What: /sys/fs/orangefs/perf_counters/...
  15. * Date: Jun 2015
  16. * Contact: Mike Marshall <hubcap@omnibond.com>
  17. * Description:
  18. * Counters and settings for various caches.
  19. * Read only.
  20. *
  21. *
  22. * What: /sys/fs/orangefs/perf_time_interval_secs
  23. * Date: Jun 2015
  24. * Contact: Mike Marshall <hubcap@omnibond.com>
  25. * Description:
  26. * Length of perf counter intervals in
  27. * seconds.
  28. *
  29. *
  30. * What: /sys/fs/orangefs/perf_history_size
  31. * Date: Jun 2015
  32. * Contact: Mike Marshall <hubcap@omnibond.com>
  33. * Description:
  34. * The perf_counters cache statistics have N, or
  35. * perf_history_size, samples. The default is
  36. * one.
  37. *
  38. * Every perf_time_interval_secs the (first)
  39. * samples are reset.
  40. *
  41. * If N is greater than one, the "current" set
  42. * of samples is reset, and the samples from the
  43. * other N-1 intervals remain available.
  44. *
  45. *
  46. * What: /sys/fs/orangefs/op_timeout_secs
  47. * Date: Jun 2015
  48. * Contact: Mike Marshall <hubcap@omnibond.com>
  49. * Description:
  50. * Service operation timeout in seconds.
  51. *
  52. *
  53. * What: /sys/fs/orangefs/slot_timeout_secs
  54. * Date: Jun 2015
  55. * Contact: Mike Marshall <hubcap@omnibond.com>
  56. * Description:
  57. * "Slot" timeout in seconds. A "slot"
  58. * is an indexed buffer in the shared
  59. * memory segment used for communication
  60. * between the kernel module and userspace.
  61. * Slots are requested and waited for,
  62. * the wait times out after slot_timeout_secs.
  63. *
  64. * What: /sys/fs/orangefs/dcache_timeout_msecs
  65. * Date: Jul 2016
  66. * Contact: Martin Brandenburg <martin@omnibond.com>
  67. * Description:
  68. * Time lookup is valid in milliseconds.
  69. *
  70. * What: /sys/fs/orangefs/getattr_timeout_msecs
  71. * Date: Jul 2016
  72. * Contact: Martin Brandenburg <martin@omnibond.com>
  73. * Description:
  74. * Time getattr is valid in milliseconds.
  75. *
  76. * What: /sys/fs/orangefs/readahead_count
  77. * Date: Aug 2016
  78. * Contact: Martin Brandenburg <martin@omnibond.com>
  79. * Description:
  80. * Readahead cache buffer count.
  81. *
  82. * What: /sys/fs/orangefs/readahead_size
  83. * Date: Aug 2016
  84. * Contact: Martin Brandenburg <martin@omnibond.com>
  85. * Description:
  86. * Readahead cache buffer size.
  87. *
  88. * What: /sys/fs/orangefs/readahead_count_size
  89. * Date: Aug 2016
  90. * Contact: Martin Brandenburg <martin@omnibond.com>
  91. * Description:
  92. * Readahead cache buffer count and size.
  93. *
  94. * What: /sys/fs/orangefs/acache/...
  95. * Date: Jun 2015
  96. * Contact: Martin Brandenburg <martin@omnibond.com>
  97. * Description:
  98. * Attribute cache configurable settings.
  99. *
  100. *
  101. * What: /sys/fs/orangefs/ncache/...
  102. * Date: Jun 2015
  103. * Contact: Mike Marshall <hubcap@omnibond.com>
  104. * Description:
  105. * Name cache configurable settings.
  106. *
  107. *
  108. * What: /sys/fs/orangefs/capcache/...
  109. * Date: Jun 2015
  110. * Contact: Mike Marshall <hubcap@omnibond.com>
  111. * Description:
  112. * Capability cache configurable settings.
  113. *
  114. *
  115. * What: /sys/fs/orangefs/ccache/...
  116. * Date: Jun 2015
  117. * Contact: Mike Marshall <hubcap@omnibond.com>
  118. * Description:
  119. * Credential cache configurable settings.
  120. *
  121. */
  122. #include <linux/fs.h>
  123. #include <linux/kobject.h>
  124. #include <linux/string.h>
  125. #include <linux/sysfs.h>
  126. #include <linux/module.h>
  127. #include <linux/init.h>
  128. #include "protocol.h"
  129. #include "orangefs-kernel.h"
  130. #include "orangefs-sysfs.h"
  131. #define ORANGEFS_KOBJ_ID "orangefs"
  132. #define ACACHE_KOBJ_ID "acache"
  133. #define CAPCACHE_KOBJ_ID "capcache"
  134. #define CCACHE_KOBJ_ID "ccache"
  135. #define NCACHE_KOBJ_ID "ncache"
  136. #define PC_KOBJ_ID "pc"
  137. #define STATS_KOBJ_ID "stats"
  138. /*
  139. * Every item calls orangefs_attr_show and orangefs_attr_store through
  140. * orangefs_sysfs_ops. They look at the orangefs_attributes further below to
  141. * call one of sysfs_int_show, sysfs_int_store, sysfs_service_op_show, or
  142. * sysfs_service_op_store.
  143. */
  144. struct orangefs_attribute {
  145. struct attribute attr;
  146. ssize_t (*show)(struct kobject *kobj,
  147. struct orangefs_attribute *attr,
  148. char *buf);
  149. ssize_t (*store)(struct kobject *kobj,
  150. struct orangefs_attribute *attr,
  151. const char *buf,
  152. size_t count);
  153. };
  154. static ssize_t orangefs_attr_show(struct kobject *kobj,
  155. struct attribute *attr,
  156. char *buf)
  157. {
  158. struct orangefs_attribute *attribute;
  159. attribute = container_of(attr, struct orangefs_attribute, attr);
  160. if (!attribute->show)
  161. return -EIO;
  162. return attribute->show(kobj, attribute, buf);
  163. }
  164. static ssize_t orangefs_attr_store(struct kobject *kobj,
  165. struct attribute *attr,
  166. const char *buf,
  167. size_t len)
  168. {
  169. struct orangefs_attribute *attribute;
  170. if (!strcmp(kobj->name, PC_KOBJ_ID) ||
  171. !strcmp(kobj->name, STATS_KOBJ_ID))
  172. return -EPERM;
  173. attribute = container_of(attr, struct orangefs_attribute, attr);
  174. if (!attribute->store)
  175. return -EIO;
  176. return attribute->store(kobj, attribute, buf, len);
  177. }
  178. static const struct sysfs_ops orangefs_sysfs_ops = {
  179. .show = orangefs_attr_show,
  180. .store = orangefs_attr_store,
  181. };
  182. static ssize_t sysfs_int_show(struct kobject *kobj,
  183. struct orangefs_attribute *attr, char *buf)
  184. {
  185. int rc = -EIO;
  186. gossip_debug(GOSSIP_SYSFS_DEBUG, "sysfs_int_show: id:%s:\n",
  187. kobj->name);
  188. if (!strcmp(kobj->name, ORANGEFS_KOBJ_ID)) {
  189. if (!strcmp(attr->attr.name, "op_timeout_secs")) {
  190. rc = scnprintf(buf,
  191. PAGE_SIZE,
  192. "%d\n",
  193. op_timeout_secs);
  194. goto out;
  195. } else if (!strcmp(attr->attr.name,
  196. "slot_timeout_secs")) {
  197. rc = scnprintf(buf,
  198. PAGE_SIZE,
  199. "%d\n",
  200. slot_timeout_secs);
  201. goto out;
  202. } else if (!strcmp(attr->attr.name,
  203. "dcache_timeout_msecs")) {
  204. rc = scnprintf(buf,
  205. PAGE_SIZE,
  206. "%d\n",
  207. orangefs_dcache_timeout_msecs);
  208. goto out;
  209. } else if (!strcmp(attr->attr.name,
  210. "getattr_timeout_msecs")) {
  211. rc = scnprintf(buf,
  212. PAGE_SIZE,
  213. "%d\n",
  214. orangefs_getattr_timeout_msecs);
  215. goto out;
  216. } else {
  217. goto out;
  218. }
  219. } else if (!strcmp(kobj->name, STATS_KOBJ_ID)) {
  220. if (!strcmp(attr->attr.name, "reads")) {
  221. rc = scnprintf(buf,
  222. PAGE_SIZE,
  223. "%lu\n",
  224. orangefs_stats.reads);
  225. goto out;
  226. } else if (!strcmp(attr->attr.name, "writes")) {
  227. rc = scnprintf(buf,
  228. PAGE_SIZE,
  229. "%lu\n",
  230. orangefs_stats.writes);
  231. goto out;
  232. } else {
  233. goto out;
  234. }
  235. }
  236. out:
  237. return rc;
  238. }
  239. static ssize_t sysfs_int_store(struct kobject *kobj,
  240. struct orangefs_attribute *attr, const char *buf, size_t count)
  241. {
  242. int rc = 0;
  243. gossip_debug(GOSSIP_SYSFS_DEBUG,
  244. "sysfs_int_store: start attr->attr.name:%s: buf:%s:\n",
  245. attr->attr.name, buf);
  246. if (!strcmp(attr->attr.name, "op_timeout_secs")) {
  247. rc = kstrtoint(buf, 0, &op_timeout_secs);
  248. goto out;
  249. } else if (!strcmp(attr->attr.name, "slot_timeout_secs")) {
  250. rc = kstrtoint(buf, 0, &slot_timeout_secs);
  251. goto out;
  252. } else if (!strcmp(attr->attr.name, "dcache_timeout_msecs")) {
  253. rc = kstrtoint(buf, 0, &orangefs_dcache_timeout_msecs);
  254. goto out;
  255. } else if (!strcmp(attr->attr.name, "getattr_timeout_msecs")) {
  256. rc = kstrtoint(buf, 0, &orangefs_getattr_timeout_msecs);
  257. goto out;
  258. } else {
  259. goto out;
  260. }
  261. out:
  262. if (rc)
  263. rc = -EINVAL;
  264. else
  265. rc = count;
  266. return rc;
  267. }
  268. /*
  269. * obtain attribute values from userspace with a service operation.
  270. */
  271. static ssize_t sysfs_service_op_show(struct kobject *kobj,
  272. struct orangefs_attribute *attr, char *buf)
  273. {
  274. struct orangefs_kernel_op_s *new_op = NULL;
  275. int rc = 0;
  276. char *ser_op_type = NULL;
  277. __u32 op_alloc_type;
  278. gossip_debug(GOSSIP_SYSFS_DEBUG,
  279. "sysfs_service_op_show: id:%s:\n",
  280. kobj->name);
  281. if (strcmp(kobj->name, PC_KOBJ_ID))
  282. op_alloc_type = ORANGEFS_VFS_OP_PARAM;
  283. else
  284. op_alloc_type = ORANGEFS_VFS_OP_PERF_COUNT;
  285. new_op = op_alloc(op_alloc_type);
  286. if (!new_op)
  287. return -ENOMEM;
  288. /* Can't do a service_operation if the client is not running... */
  289. rc = is_daemon_in_service();
  290. if (rc) {
  291. pr_info("%s: Client not running :%d:\n",
  292. __func__,
  293. is_daemon_in_service());
  294. goto out;
  295. }
  296. if (strcmp(kobj->name, PC_KOBJ_ID))
  297. new_op->upcall.req.param.type = ORANGEFS_PARAM_REQUEST_GET;
  298. if (!strcmp(kobj->name, ORANGEFS_KOBJ_ID)) {
  299. /* Drop unsupported requests first. */
  300. if (!(orangefs_features & ORANGEFS_FEATURE_READAHEAD) &&
  301. (!strcmp(attr->attr.name, "readahead_count") ||
  302. !strcmp(attr->attr.name, "readahead_size") ||
  303. !strcmp(attr->attr.name, "readahead_count_size"))) {
  304. rc = -EINVAL;
  305. goto out;
  306. }
  307. if (!strcmp(attr->attr.name, "perf_history_size"))
  308. new_op->upcall.req.param.op =
  309. ORANGEFS_PARAM_REQUEST_OP_PERF_HISTORY_SIZE;
  310. else if (!strcmp(attr->attr.name,
  311. "perf_time_interval_secs"))
  312. new_op->upcall.req.param.op =
  313. ORANGEFS_PARAM_REQUEST_OP_PERF_TIME_INTERVAL_SECS;
  314. else if (!strcmp(attr->attr.name,
  315. "perf_counter_reset"))
  316. new_op->upcall.req.param.op =
  317. ORANGEFS_PARAM_REQUEST_OP_PERF_RESET;
  318. else if (!strcmp(attr->attr.name,
  319. "readahead_count"))
  320. new_op->upcall.req.param.op =
  321. ORANGEFS_PARAM_REQUEST_OP_READAHEAD_COUNT;
  322. else if (!strcmp(attr->attr.name,
  323. "readahead_size"))
  324. new_op->upcall.req.param.op =
  325. ORANGEFS_PARAM_REQUEST_OP_READAHEAD_SIZE;
  326. else if (!strcmp(attr->attr.name,
  327. "readahead_count_size"))
  328. new_op->upcall.req.param.op =
  329. ORANGEFS_PARAM_REQUEST_OP_READAHEAD_COUNT_SIZE;
  330. } else if (!strcmp(kobj->name, ACACHE_KOBJ_ID)) {
  331. if (!strcmp(attr->attr.name, "timeout_msecs"))
  332. new_op->upcall.req.param.op =
  333. ORANGEFS_PARAM_REQUEST_OP_ACACHE_TIMEOUT_MSECS;
  334. if (!strcmp(attr->attr.name, "hard_limit"))
  335. new_op->upcall.req.param.op =
  336. ORANGEFS_PARAM_REQUEST_OP_ACACHE_HARD_LIMIT;
  337. if (!strcmp(attr->attr.name, "soft_limit"))
  338. new_op->upcall.req.param.op =
  339. ORANGEFS_PARAM_REQUEST_OP_ACACHE_SOFT_LIMIT;
  340. if (!strcmp(attr->attr.name, "reclaim_percentage"))
  341. new_op->upcall.req.param.op =
  342. ORANGEFS_PARAM_REQUEST_OP_ACACHE_RECLAIM_PERCENTAGE;
  343. } else if (!strcmp(kobj->name, CAPCACHE_KOBJ_ID)) {
  344. if (!strcmp(attr->attr.name, "timeout_secs"))
  345. new_op->upcall.req.param.op =
  346. ORANGEFS_PARAM_REQUEST_OP_CAPCACHE_TIMEOUT_SECS;
  347. if (!strcmp(attr->attr.name, "hard_limit"))
  348. new_op->upcall.req.param.op =
  349. ORANGEFS_PARAM_REQUEST_OP_CAPCACHE_HARD_LIMIT;
  350. if (!strcmp(attr->attr.name, "soft_limit"))
  351. new_op->upcall.req.param.op =
  352. ORANGEFS_PARAM_REQUEST_OP_CAPCACHE_SOFT_LIMIT;
  353. if (!strcmp(attr->attr.name, "reclaim_percentage"))
  354. new_op->upcall.req.param.op =
  355. ORANGEFS_PARAM_REQUEST_OP_CAPCACHE_RECLAIM_PERCENTAGE;
  356. } else if (!strcmp(kobj->name, CCACHE_KOBJ_ID)) {
  357. if (!strcmp(attr->attr.name, "timeout_secs"))
  358. new_op->upcall.req.param.op =
  359. ORANGEFS_PARAM_REQUEST_OP_CCACHE_TIMEOUT_SECS;
  360. if (!strcmp(attr->attr.name, "hard_limit"))
  361. new_op->upcall.req.param.op =
  362. ORANGEFS_PARAM_REQUEST_OP_CCACHE_HARD_LIMIT;
  363. if (!strcmp(attr->attr.name, "soft_limit"))
  364. new_op->upcall.req.param.op =
  365. ORANGEFS_PARAM_REQUEST_OP_CCACHE_SOFT_LIMIT;
  366. if (!strcmp(attr->attr.name, "reclaim_percentage"))
  367. new_op->upcall.req.param.op =
  368. ORANGEFS_PARAM_REQUEST_OP_CCACHE_RECLAIM_PERCENTAGE;
  369. } else if (!strcmp(kobj->name, NCACHE_KOBJ_ID)) {
  370. if (!strcmp(attr->attr.name, "timeout_msecs"))
  371. new_op->upcall.req.param.op =
  372. ORANGEFS_PARAM_REQUEST_OP_NCACHE_TIMEOUT_MSECS;
  373. if (!strcmp(attr->attr.name, "hard_limit"))
  374. new_op->upcall.req.param.op =
  375. ORANGEFS_PARAM_REQUEST_OP_NCACHE_HARD_LIMIT;
  376. if (!strcmp(attr->attr.name, "soft_limit"))
  377. new_op->upcall.req.param.op =
  378. ORANGEFS_PARAM_REQUEST_OP_NCACHE_SOFT_LIMIT;
  379. if (!strcmp(attr->attr.name, "reclaim_percentage"))
  380. new_op->upcall.req.param.op =
  381. ORANGEFS_PARAM_REQUEST_OP_NCACHE_RECLAIM_PERCENTAGE;
  382. } else if (!strcmp(kobj->name, PC_KOBJ_ID)) {
  383. if (!strcmp(attr->attr.name, ACACHE_KOBJ_ID))
  384. new_op->upcall.req.perf_count.type =
  385. ORANGEFS_PERF_COUNT_REQUEST_ACACHE;
  386. if (!strcmp(attr->attr.name, CAPCACHE_KOBJ_ID))
  387. new_op->upcall.req.perf_count.type =
  388. ORANGEFS_PERF_COUNT_REQUEST_CAPCACHE;
  389. if (!strcmp(attr->attr.name, NCACHE_KOBJ_ID))
  390. new_op->upcall.req.perf_count.type =
  391. ORANGEFS_PERF_COUNT_REQUEST_NCACHE;
  392. } else {
  393. gossip_err("sysfs_service_op_show: unknown kobj_id:%s:\n",
  394. kobj->name);
  395. rc = -EINVAL;
  396. goto out;
  397. }
  398. if (strcmp(kobj->name, PC_KOBJ_ID))
  399. ser_op_type = "orangefs_param";
  400. else
  401. ser_op_type = "orangefs_perf_count";
  402. /*
  403. * The service_operation will return an errno return code on
  404. * error, and zero on success.
  405. */
  406. rc = service_operation(new_op, ser_op_type, ORANGEFS_OP_INTERRUPTIBLE);
  407. out:
  408. if (!rc) {
  409. if (strcmp(kobj->name, PC_KOBJ_ID)) {
  410. if (new_op->upcall.req.param.op ==
  411. ORANGEFS_PARAM_REQUEST_OP_READAHEAD_COUNT_SIZE) {
  412. rc = scnprintf(buf, PAGE_SIZE, "%d %d\n",
  413. (int)new_op->downcall.resp.param.u.
  414. value32[0],
  415. (int)new_op->downcall.resp.param.u.
  416. value32[1]);
  417. } else {
  418. rc = scnprintf(buf, PAGE_SIZE, "%d\n",
  419. (int)new_op->downcall.resp.param.u.value64);
  420. }
  421. } else {
  422. rc = scnprintf(
  423. buf,
  424. PAGE_SIZE,
  425. "%s",
  426. new_op->downcall.resp.perf_count.buffer);
  427. }
  428. }
  429. op_release(new_op);
  430. return rc;
  431. }
  432. /*
  433. * pass attribute values back to userspace with a service operation.
  434. *
  435. * We have to do a memory allocation, an sscanf and a service operation.
  436. * And we have to evaluate what the user entered, to make sure the
  437. * value is within the range supported by the attribute. So, there's
  438. * a lot of return code checking and mapping going on here.
  439. *
  440. * We want to return 1 if we think everything went OK, and
  441. * EINVAL if not.
  442. */
  443. static ssize_t sysfs_service_op_store(struct kobject *kobj,
  444. struct orangefs_attribute *attr, const char *buf, size_t count)
  445. {
  446. struct orangefs_kernel_op_s *new_op = NULL;
  447. int val = 0;
  448. int rc = 0;
  449. gossip_debug(GOSSIP_SYSFS_DEBUG,
  450. "sysfs_service_op_store: id:%s:\n",
  451. kobj->name);
  452. new_op = op_alloc(ORANGEFS_VFS_OP_PARAM);
  453. if (!new_op)
  454. return -EINVAL; /* sic */
  455. /* Can't do a service_operation if the client is not running... */
  456. rc = is_daemon_in_service();
  457. if (rc) {
  458. pr_info("%s: Client not running :%d:\n",
  459. __func__,
  460. is_daemon_in_service());
  461. goto out;
  462. }
  463. /*
  464. * The value we want to send back to userspace is in buf, unless this
  465. * there are two parameters, which is specially handled below.
  466. */
  467. if (strcmp(kobj->name, ORANGEFS_KOBJ_ID) ||
  468. strcmp(attr->attr.name, "readahead_count_size")) {
  469. rc = kstrtoint(buf, 0, &val);
  470. if (rc)
  471. goto out;
  472. }
  473. new_op->upcall.req.param.type = ORANGEFS_PARAM_REQUEST_SET;
  474. if (!strcmp(kobj->name, ORANGEFS_KOBJ_ID)) {
  475. /* Drop unsupported requests first. */
  476. if (!(orangefs_features & ORANGEFS_FEATURE_READAHEAD) &&
  477. (!strcmp(attr->attr.name, "readahead_count") ||
  478. !strcmp(attr->attr.name, "readahead_size") ||
  479. !strcmp(attr->attr.name, "readahead_count_size"))) {
  480. rc = -EINVAL;
  481. goto out;
  482. }
  483. if (!strcmp(attr->attr.name, "perf_history_size")) {
  484. if (val > 0) {
  485. new_op->upcall.req.param.op =
  486. ORANGEFS_PARAM_REQUEST_OP_PERF_HISTORY_SIZE;
  487. } else {
  488. rc = 0;
  489. goto out;
  490. }
  491. } else if (!strcmp(attr->attr.name,
  492. "perf_time_interval_secs")) {
  493. if (val > 0) {
  494. new_op->upcall.req.param.op =
  495. ORANGEFS_PARAM_REQUEST_OP_PERF_TIME_INTERVAL_SECS;
  496. } else {
  497. rc = 0;
  498. goto out;
  499. }
  500. } else if (!strcmp(attr->attr.name,
  501. "perf_counter_reset")) {
  502. if ((val == 0) || (val == 1)) {
  503. new_op->upcall.req.param.op =
  504. ORANGEFS_PARAM_REQUEST_OP_PERF_RESET;
  505. } else {
  506. rc = 0;
  507. goto out;
  508. }
  509. } else if (!strcmp(attr->attr.name,
  510. "readahead_count")) {
  511. if ((val >= 0)) {
  512. new_op->upcall.req.param.op =
  513. ORANGEFS_PARAM_REQUEST_OP_READAHEAD_COUNT;
  514. } else {
  515. rc = 0;
  516. goto out;
  517. }
  518. } else if (!strcmp(attr->attr.name,
  519. "readahead_size")) {
  520. if ((val >= 0)) {
  521. new_op->upcall.req.param.op =
  522. ORANGEFS_PARAM_REQUEST_OP_READAHEAD_SIZE;
  523. } else {
  524. rc = 0;
  525. goto out;
  526. }
  527. } else if (!strcmp(attr->attr.name,
  528. "readahead_count_size")) {
  529. int val1, val2;
  530. rc = sscanf(buf, "%d %d", &val1, &val2);
  531. if (rc < 2) {
  532. rc = 0;
  533. goto out;
  534. }
  535. if ((val1 >= 0) && (val2 >= 0)) {
  536. new_op->upcall.req.param.op =
  537. ORANGEFS_PARAM_REQUEST_OP_READAHEAD_COUNT_SIZE;
  538. } else {
  539. rc = 0;
  540. goto out;
  541. }
  542. new_op->upcall.req.param.u.value32[0] = val1;
  543. new_op->upcall.req.param.u.value32[1] = val2;
  544. goto value_set;
  545. }
  546. } else if (!strcmp(kobj->name, ACACHE_KOBJ_ID)) {
  547. if (!strcmp(attr->attr.name, "hard_limit")) {
  548. if (val > -1) {
  549. new_op->upcall.req.param.op =
  550. ORANGEFS_PARAM_REQUEST_OP_ACACHE_HARD_LIMIT;
  551. } else {
  552. rc = 0;
  553. goto out;
  554. }
  555. } else if (!strcmp(attr->attr.name, "soft_limit")) {
  556. if (val > -1) {
  557. new_op->upcall.req.param.op =
  558. ORANGEFS_PARAM_REQUEST_OP_ACACHE_SOFT_LIMIT;
  559. } else {
  560. rc = 0;
  561. goto out;
  562. }
  563. } else if (!strcmp(attr->attr.name,
  564. "reclaim_percentage")) {
  565. if ((val > -1) && (val < 101)) {
  566. new_op->upcall.req.param.op =
  567. ORANGEFS_PARAM_REQUEST_OP_ACACHE_RECLAIM_PERCENTAGE;
  568. } else {
  569. rc = 0;
  570. goto out;
  571. }
  572. } else if (!strcmp(attr->attr.name, "timeout_msecs")) {
  573. if (val > -1) {
  574. new_op->upcall.req.param.op =
  575. ORANGEFS_PARAM_REQUEST_OP_ACACHE_TIMEOUT_MSECS;
  576. } else {
  577. rc = 0;
  578. goto out;
  579. }
  580. }
  581. } else if (!strcmp(kobj->name, CAPCACHE_KOBJ_ID)) {
  582. if (!strcmp(attr->attr.name, "hard_limit")) {
  583. if (val > -1) {
  584. new_op->upcall.req.param.op =
  585. ORANGEFS_PARAM_REQUEST_OP_CAPCACHE_HARD_LIMIT;
  586. } else {
  587. rc = 0;
  588. goto out;
  589. }
  590. } else if (!strcmp(attr->attr.name, "soft_limit")) {
  591. if (val > -1) {
  592. new_op->upcall.req.param.op =
  593. ORANGEFS_PARAM_REQUEST_OP_CAPCACHE_SOFT_LIMIT;
  594. } else {
  595. rc = 0;
  596. goto out;
  597. }
  598. } else if (!strcmp(attr->attr.name,
  599. "reclaim_percentage")) {
  600. if ((val > -1) && (val < 101)) {
  601. new_op->upcall.req.param.op =
  602. ORANGEFS_PARAM_REQUEST_OP_CAPCACHE_RECLAIM_PERCENTAGE;
  603. } else {
  604. rc = 0;
  605. goto out;
  606. }
  607. } else if (!strcmp(attr->attr.name, "timeout_secs")) {
  608. if (val > -1) {
  609. new_op->upcall.req.param.op =
  610. ORANGEFS_PARAM_REQUEST_OP_CAPCACHE_TIMEOUT_SECS;
  611. } else {
  612. rc = 0;
  613. goto out;
  614. }
  615. }
  616. } else if (!strcmp(kobj->name, CCACHE_KOBJ_ID)) {
  617. if (!strcmp(attr->attr.name, "hard_limit")) {
  618. if (val > -1) {
  619. new_op->upcall.req.param.op =
  620. ORANGEFS_PARAM_REQUEST_OP_CCACHE_HARD_LIMIT;
  621. } else {
  622. rc = 0;
  623. goto out;
  624. }
  625. } else if (!strcmp(attr->attr.name, "soft_limit")) {
  626. if (val > -1) {
  627. new_op->upcall.req.param.op =
  628. ORANGEFS_PARAM_REQUEST_OP_CCACHE_SOFT_LIMIT;
  629. } else {
  630. rc = 0;
  631. goto out;
  632. }
  633. } else if (!strcmp(attr->attr.name,
  634. "reclaim_percentage")) {
  635. if ((val > -1) && (val < 101)) {
  636. new_op->upcall.req.param.op =
  637. ORANGEFS_PARAM_REQUEST_OP_CCACHE_RECLAIM_PERCENTAGE;
  638. } else {
  639. rc = 0;
  640. goto out;
  641. }
  642. } else if (!strcmp(attr->attr.name, "timeout_secs")) {
  643. if (val > -1) {
  644. new_op->upcall.req.param.op =
  645. ORANGEFS_PARAM_REQUEST_OP_CCACHE_TIMEOUT_SECS;
  646. } else {
  647. rc = 0;
  648. goto out;
  649. }
  650. }
  651. } else if (!strcmp(kobj->name, NCACHE_KOBJ_ID)) {
  652. if (!strcmp(attr->attr.name, "hard_limit")) {
  653. if (val > -1) {
  654. new_op->upcall.req.param.op =
  655. ORANGEFS_PARAM_REQUEST_OP_NCACHE_HARD_LIMIT;
  656. } else {
  657. rc = 0;
  658. goto out;
  659. }
  660. } else if (!strcmp(attr->attr.name, "soft_limit")) {
  661. if (val > -1) {
  662. new_op->upcall.req.param.op =
  663. ORANGEFS_PARAM_REQUEST_OP_NCACHE_SOFT_LIMIT;
  664. } else {
  665. rc = 0;
  666. goto out;
  667. }
  668. } else if (!strcmp(attr->attr.name,
  669. "reclaim_percentage")) {
  670. if ((val > -1) && (val < 101)) {
  671. new_op->upcall.req.param.op =
  672. ORANGEFS_PARAM_REQUEST_OP_NCACHE_RECLAIM_PERCENTAGE;
  673. } else {
  674. rc = 0;
  675. goto out;
  676. }
  677. } else if (!strcmp(attr->attr.name, "timeout_msecs")) {
  678. if (val > -1) {
  679. new_op->upcall.req.param.op =
  680. ORANGEFS_PARAM_REQUEST_OP_NCACHE_TIMEOUT_MSECS;
  681. } else {
  682. rc = 0;
  683. goto out;
  684. }
  685. }
  686. } else {
  687. gossip_err("sysfs_service_op_store: unknown kobj_id:%s:\n",
  688. kobj->name);
  689. rc = -EINVAL;
  690. goto out;
  691. }
  692. new_op->upcall.req.param.u.value64 = val;
  693. value_set:
  694. /*
  695. * The service_operation will return a errno return code on
  696. * error, and zero on success.
  697. */
  698. rc = service_operation(new_op, "orangefs_param", ORANGEFS_OP_INTERRUPTIBLE);
  699. if (rc < 0) {
  700. gossip_err("sysfs_service_op_store: service op returned:%d:\n",
  701. rc);
  702. rc = 0;
  703. } else {
  704. rc = count;
  705. }
  706. out:
  707. op_release(new_op);
  708. if (rc == -ENOMEM || rc == 0)
  709. rc = -EINVAL;
  710. return rc;
  711. }
  712. static struct orangefs_attribute op_timeout_secs_attribute =
  713. __ATTR(op_timeout_secs, 0664, sysfs_int_show, sysfs_int_store);
  714. static struct orangefs_attribute slot_timeout_secs_attribute =
  715. __ATTR(slot_timeout_secs, 0664, sysfs_int_show, sysfs_int_store);
  716. static struct orangefs_attribute dcache_timeout_msecs_attribute =
  717. __ATTR(dcache_timeout_msecs, 0664, sysfs_int_show, sysfs_int_store);
  718. static struct orangefs_attribute getattr_timeout_msecs_attribute =
  719. __ATTR(getattr_timeout_msecs, 0664, sysfs_int_show, sysfs_int_store);
  720. static struct orangefs_attribute readahead_count_attribute =
  721. __ATTR(readahead_count, 0664, sysfs_service_op_show,
  722. sysfs_service_op_store);
  723. static struct orangefs_attribute readahead_size_attribute =
  724. __ATTR(readahead_size, 0664, sysfs_service_op_show,
  725. sysfs_service_op_store);
  726. static struct orangefs_attribute readahead_count_size_attribute =
  727. __ATTR(readahead_count_size, 0664, sysfs_service_op_show,
  728. sysfs_service_op_store);
  729. static struct orangefs_attribute perf_counter_reset_attribute =
  730. __ATTR(perf_counter_reset,
  731. 0664,
  732. sysfs_service_op_show,
  733. sysfs_service_op_store);
  734. static struct orangefs_attribute perf_history_size_attribute =
  735. __ATTR(perf_history_size,
  736. 0664,
  737. sysfs_service_op_show,
  738. sysfs_service_op_store);
  739. static struct orangefs_attribute perf_time_interval_secs_attribute =
  740. __ATTR(perf_time_interval_secs,
  741. 0664,
  742. sysfs_service_op_show,
  743. sysfs_service_op_store);
  744. static struct attribute *orangefs_default_attrs[] = {
  745. &op_timeout_secs_attribute.attr,
  746. &slot_timeout_secs_attribute.attr,
  747. &dcache_timeout_msecs_attribute.attr,
  748. &getattr_timeout_msecs_attribute.attr,
  749. &readahead_count_attribute.attr,
  750. &readahead_size_attribute.attr,
  751. &readahead_count_size_attribute.attr,
  752. &perf_counter_reset_attribute.attr,
  753. &perf_history_size_attribute.attr,
  754. &perf_time_interval_secs_attribute.attr,
  755. NULL,
  756. };
  757. static struct kobj_type orangefs_ktype = {
  758. .sysfs_ops = &orangefs_sysfs_ops,
  759. .default_attrs = orangefs_default_attrs,
  760. };
  761. static struct orangefs_attribute acache_hard_limit_attribute =
  762. __ATTR(hard_limit,
  763. 0664,
  764. sysfs_service_op_show,
  765. sysfs_service_op_store);
  766. static struct orangefs_attribute acache_reclaim_percent_attribute =
  767. __ATTR(reclaim_percentage,
  768. 0664,
  769. sysfs_service_op_show,
  770. sysfs_service_op_store);
  771. static struct orangefs_attribute acache_soft_limit_attribute =
  772. __ATTR(soft_limit,
  773. 0664,
  774. sysfs_service_op_show,
  775. sysfs_service_op_store);
  776. static struct orangefs_attribute acache_timeout_msecs_attribute =
  777. __ATTR(timeout_msecs,
  778. 0664,
  779. sysfs_service_op_show,
  780. sysfs_service_op_store);
  781. static struct attribute *acache_orangefs_default_attrs[] = {
  782. &acache_hard_limit_attribute.attr,
  783. &acache_reclaim_percent_attribute.attr,
  784. &acache_soft_limit_attribute.attr,
  785. &acache_timeout_msecs_attribute.attr,
  786. NULL,
  787. };
  788. static struct kobj_type acache_orangefs_ktype = {
  789. .sysfs_ops = &orangefs_sysfs_ops,
  790. .default_attrs = acache_orangefs_default_attrs,
  791. };
  792. static struct orangefs_attribute capcache_hard_limit_attribute =
  793. __ATTR(hard_limit,
  794. 0664,
  795. sysfs_service_op_show,
  796. sysfs_service_op_store);
  797. static struct orangefs_attribute capcache_reclaim_percent_attribute =
  798. __ATTR(reclaim_percentage,
  799. 0664,
  800. sysfs_service_op_show,
  801. sysfs_service_op_store);
  802. static struct orangefs_attribute capcache_soft_limit_attribute =
  803. __ATTR(soft_limit,
  804. 0664,
  805. sysfs_service_op_show,
  806. sysfs_service_op_store);
  807. static struct orangefs_attribute capcache_timeout_secs_attribute =
  808. __ATTR(timeout_secs,
  809. 0664,
  810. sysfs_service_op_show,
  811. sysfs_service_op_store);
  812. static struct attribute *capcache_orangefs_default_attrs[] = {
  813. &capcache_hard_limit_attribute.attr,
  814. &capcache_reclaim_percent_attribute.attr,
  815. &capcache_soft_limit_attribute.attr,
  816. &capcache_timeout_secs_attribute.attr,
  817. NULL,
  818. };
  819. static struct kobj_type capcache_orangefs_ktype = {
  820. .sysfs_ops = &orangefs_sysfs_ops,
  821. .default_attrs = capcache_orangefs_default_attrs,
  822. };
  823. static struct orangefs_attribute ccache_hard_limit_attribute =
  824. __ATTR(hard_limit,
  825. 0664,
  826. sysfs_service_op_show,
  827. sysfs_service_op_store);
  828. static struct orangefs_attribute ccache_reclaim_percent_attribute =
  829. __ATTR(reclaim_percentage,
  830. 0664,
  831. sysfs_service_op_show,
  832. sysfs_service_op_store);
  833. static struct orangefs_attribute ccache_soft_limit_attribute =
  834. __ATTR(soft_limit,
  835. 0664,
  836. sysfs_service_op_show,
  837. sysfs_service_op_store);
  838. static struct orangefs_attribute ccache_timeout_secs_attribute =
  839. __ATTR(timeout_secs,
  840. 0664,
  841. sysfs_service_op_show,
  842. sysfs_service_op_store);
  843. static struct attribute *ccache_orangefs_default_attrs[] = {
  844. &ccache_hard_limit_attribute.attr,
  845. &ccache_reclaim_percent_attribute.attr,
  846. &ccache_soft_limit_attribute.attr,
  847. &ccache_timeout_secs_attribute.attr,
  848. NULL,
  849. };
  850. static struct kobj_type ccache_orangefs_ktype = {
  851. .sysfs_ops = &orangefs_sysfs_ops,
  852. .default_attrs = ccache_orangefs_default_attrs,
  853. };
  854. static struct orangefs_attribute ncache_hard_limit_attribute =
  855. __ATTR(hard_limit,
  856. 0664,
  857. sysfs_service_op_show,
  858. sysfs_service_op_store);
  859. static struct orangefs_attribute ncache_reclaim_percent_attribute =
  860. __ATTR(reclaim_percentage,
  861. 0664,
  862. sysfs_service_op_show,
  863. sysfs_service_op_store);
  864. static struct orangefs_attribute ncache_soft_limit_attribute =
  865. __ATTR(soft_limit,
  866. 0664,
  867. sysfs_service_op_show,
  868. sysfs_service_op_store);
  869. static struct orangefs_attribute ncache_timeout_msecs_attribute =
  870. __ATTR(timeout_msecs,
  871. 0664,
  872. sysfs_service_op_show,
  873. sysfs_service_op_store);
  874. static struct attribute *ncache_orangefs_default_attrs[] = {
  875. &ncache_hard_limit_attribute.attr,
  876. &ncache_reclaim_percent_attribute.attr,
  877. &ncache_soft_limit_attribute.attr,
  878. &ncache_timeout_msecs_attribute.attr,
  879. NULL,
  880. };
  881. static struct kobj_type ncache_orangefs_ktype = {
  882. .sysfs_ops = &orangefs_sysfs_ops,
  883. .default_attrs = ncache_orangefs_default_attrs,
  884. };
  885. static struct orangefs_attribute pc_acache_attribute =
  886. __ATTR(acache,
  887. 0664,
  888. sysfs_service_op_show,
  889. NULL);
  890. static struct orangefs_attribute pc_capcache_attribute =
  891. __ATTR(capcache,
  892. 0664,
  893. sysfs_service_op_show,
  894. NULL);
  895. static struct orangefs_attribute pc_ncache_attribute =
  896. __ATTR(ncache,
  897. 0664,
  898. sysfs_service_op_show,
  899. NULL);
  900. static struct attribute *pc_orangefs_default_attrs[] = {
  901. &pc_acache_attribute.attr,
  902. &pc_capcache_attribute.attr,
  903. &pc_ncache_attribute.attr,
  904. NULL,
  905. };
  906. static struct kobj_type pc_orangefs_ktype = {
  907. .sysfs_ops = &orangefs_sysfs_ops,
  908. .default_attrs = pc_orangefs_default_attrs,
  909. };
  910. static struct orangefs_attribute stats_reads_attribute =
  911. __ATTR(reads,
  912. 0664,
  913. sysfs_int_show,
  914. NULL);
  915. static struct orangefs_attribute stats_writes_attribute =
  916. __ATTR(writes,
  917. 0664,
  918. sysfs_int_show,
  919. NULL);
  920. static struct attribute *stats_orangefs_default_attrs[] = {
  921. &stats_reads_attribute.attr,
  922. &stats_writes_attribute.attr,
  923. NULL,
  924. };
  925. static struct kobj_type stats_orangefs_ktype = {
  926. .sysfs_ops = &orangefs_sysfs_ops,
  927. .default_attrs = stats_orangefs_default_attrs,
  928. };
  929. static struct kobject *orangefs_obj;
  930. static struct kobject *acache_orangefs_obj;
  931. static struct kobject *capcache_orangefs_obj;
  932. static struct kobject *ccache_orangefs_obj;
  933. static struct kobject *ncache_orangefs_obj;
  934. static struct kobject *pc_orangefs_obj;
  935. static struct kobject *stats_orangefs_obj;
  936. int orangefs_sysfs_init(void)
  937. {
  938. int rc = -EINVAL;
  939. gossip_debug(GOSSIP_SYSFS_DEBUG, "orangefs_sysfs_init: start\n");
  940. /* create /sys/fs/orangefs. */
  941. orangefs_obj = kzalloc(sizeof(*orangefs_obj), GFP_KERNEL);
  942. if (!orangefs_obj)
  943. goto out;
  944. rc = kobject_init_and_add(orangefs_obj,
  945. &orangefs_ktype,
  946. fs_kobj,
  947. ORANGEFS_KOBJ_ID);
  948. if (rc)
  949. goto ofs_obj_bail;
  950. kobject_uevent(orangefs_obj, KOBJ_ADD);
  951. /* create /sys/fs/orangefs/acache. */
  952. acache_orangefs_obj = kzalloc(sizeof(*acache_orangefs_obj), GFP_KERNEL);
  953. if (!acache_orangefs_obj) {
  954. rc = -EINVAL;
  955. goto ofs_obj_bail;
  956. }
  957. rc = kobject_init_and_add(acache_orangefs_obj,
  958. &acache_orangefs_ktype,
  959. orangefs_obj,
  960. ACACHE_KOBJ_ID);
  961. if (rc)
  962. goto acache_obj_bail;
  963. kobject_uevent(acache_orangefs_obj, KOBJ_ADD);
  964. /* create /sys/fs/orangefs/capcache. */
  965. capcache_orangefs_obj =
  966. kzalloc(sizeof(*capcache_orangefs_obj), GFP_KERNEL);
  967. if (!capcache_orangefs_obj) {
  968. rc = -EINVAL;
  969. goto acache_obj_bail;
  970. }
  971. rc = kobject_init_and_add(capcache_orangefs_obj,
  972. &capcache_orangefs_ktype,
  973. orangefs_obj,
  974. CAPCACHE_KOBJ_ID);
  975. if (rc)
  976. goto capcache_obj_bail;
  977. kobject_uevent(capcache_orangefs_obj, KOBJ_ADD);
  978. /* create /sys/fs/orangefs/ccache. */
  979. ccache_orangefs_obj =
  980. kzalloc(sizeof(*ccache_orangefs_obj), GFP_KERNEL);
  981. if (!ccache_orangefs_obj) {
  982. rc = -EINVAL;
  983. goto capcache_obj_bail;
  984. }
  985. rc = kobject_init_and_add(ccache_orangefs_obj,
  986. &ccache_orangefs_ktype,
  987. orangefs_obj,
  988. CCACHE_KOBJ_ID);
  989. if (rc)
  990. goto ccache_obj_bail;
  991. kobject_uevent(ccache_orangefs_obj, KOBJ_ADD);
  992. /* create /sys/fs/orangefs/ncache. */
  993. ncache_orangefs_obj = kzalloc(sizeof(*ncache_orangefs_obj), GFP_KERNEL);
  994. if (!ncache_orangefs_obj) {
  995. rc = -EINVAL;
  996. goto ccache_obj_bail;
  997. }
  998. rc = kobject_init_and_add(ncache_orangefs_obj,
  999. &ncache_orangefs_ktype,
  1000. orangefs_obj,
  1001. NCACHE_KOBJ_ID);
  1002. if (rc)
  1003. goto ncache_obj_bail;
  1004. kobject_uevent(ncache_orangefs_obj, KOBJ_ADD);
  1005. /* create /sys/fs/orangefs/perf_counters. */
  1006. pc_orangefs_obj = kzalloc(sizeof(*pc_orangefs_obj), GFP_KERNEL);
  1007. if (!pc_orangefs_obj) {
  1008. rc = -EINVAL;
  1009. goto ncache_obj_bail;
  1010. }
  1011. rc = kobject_init_and_add(pc_orangefs_obj,
  1012. &pc_orangefs_ktype,
  1013. orangefs_obj,
  1014. "perf_counters");
  1015. if (rc)
  1016. goto pc_obj_bail;
  1017. kobject_uevent(pc_orangefs_obj, KOBJ_ADD);
  1018. /* create /sys/fs/orangefs/stats. */
  1019. stats_orangefs_obj = kzalloc(sizeof(*stats_orangefs_obj), GFP_KERNEL);
  1020. if (!stats_orangefs_obj) {
  1021. rc = -EINVAL;
  1022. goto pc_obj_bail;
  1023. }
  1024. rc = kobject_init_and_add(stats_orangefs_obj,
  1025. &stats_orangefs_ktype,
  1026. orangefs_obj,
  1027. STATS_KOBJ_ID);
  1028. if (rc)
  1029. goto stats_obj_bail;
  1030. kobject_uevent(stats_orangefs_obj, KOBJ_ADD);
  1031. goto out;
  1032. stats_obj_bail:
  1033. kobject_put(stats_orangefs_obj);
  1034. pc_obj_bail:
  1035. kobject_put(pc_orangefs_obj);
  1036. ncache_obj_bail:
  1037. kobject_put(ncache_orangefs_obj);
  1038. ccache_obj_bail:
  1039. kobject_put(ccache_orangefs_obj);
  1040. capcache_obj_bail:
  1041. kobject_put(capcache_orangefs_obj);
  1042. acache_obj_bail:
  1043. kobject_put(acache_orangefs_obj);
  1044. ofs_obj_bail:
  1045. kobject_put(orangefs_obj);
  1046. out:
  1047. return rc;
  1048. }
  1049. void orangefs_sysfs_exit(void)
  1050. {
  1051. gossip_debug(GOSSIP_SYSFS_DEBUG, "orangefs_sysfs_exit: start\n");
  1052. kobject_put(acache_orangefs_obj);
  1053. kobject_put(capcache_orangefs_obj);
  1054. kobject_put(ccache_orangefs_obj);
  1055. kobject_put(ncache_orangefs_obj);
  1056. kobject_put(pc_orangefs_obj);
  1057. kobject_put(stats_orangefs_obj);
  1058. kobject_put(orangefs_obj);
  1059. }