hc
2024-05-10 23fa18eaa71266feff7ba8d83022d9e1cc83c65a
kernel/fs/orangefs/orangefs-sysfs.c
....@@ -62,6 +62,14 @@
6262 * Slots are requested and waited for,
6363 * the wait times out after slot_timeout_secs.
6464 *
65
+ * What: /sys/fs/orangefs/cache_timeout_msecs
66
+ * Date: Mar 2018
67
+ * Contact: Martin Brandenburg <martin@omnibond.com>
68
+ * Description:
69
+ * Time in milliseconds between which
70
+ * orangefs_revalidate_mapping will invalidate the page
71
+ * cache.
72
+ *
6573 * What: /sys/fs/orangefs/dcache_timeout_msecs
6674 * Date: Jul 2016
6775 * Contact: Martin Brandenburg <martin@omnibond.com>
....@@ -222,6 +230,13 @@
222230 slot_timeout_secs);
223231 goto out;
224232 } else if (!strcmp(attr->attr.name,
233
+ "cache_timeout_msecs")) {
234
+ rc = scnprintf(buf,
235
+ PAGE_SIZE,
236
+ "%d\n",
237
+ orangefs_cache_timeout_msecs);
238
+ goto out;
239
+ } else if (!strcmp(attr->attr.name,
225240 "dcache_timeout_msecs")) {
226241 rc = scnprintf(buf,
227242 PAGE_SIZE,
....@@ -276,6 +291,9 @@
276291 goto out;
277292 } else if (!strcmp(attr->attr.name, "slot_timeout_secs")) {
278293 rc = kstrtoint(buf, 0, &slot_timeout_secs);
294
+ goto out;
295
+ } else if (!strcmp(attr->attr.name, "cache_timeout_msecs")) {
296
+ rc = kstrtoint(buf, 0, &orangefs_cache_timeout_msecs);
279297 goto out;
280298 } else if (!strcmp(attr->attr.name, "dcache_timeout_msecs")) {
281299 rc = kstrtoint(buf, 0, &orangefs_dcache_timeout_msecs);
....@@ -818,6 +836,9 @@
818836 static struct orangefs_attribute slot_timeout_secs_attribute =
819837 __ATTR(slot_timeout_secs, 0664, sysfs_int_show, sysfs_int_store);
820838
839
+static struct orangefs_attribute cache_timeout_msecs_attribute =
840
+ __ATTR(cache_timeout_msecs, 0664, sysfs_int_show, sysfs_int_store);
841
+
821842 static struct orangefs_attribute dcache_timeout_msecs_attribute =
822843 __ATTR(dcache_timeout_msecs, 0664, sysfs_int_show, sysfs_int_store);
823844
....@@ -861,6 +882,7 @@
861882 static struct attribute *orangefs_default_attrs[] = {
862883 &op_timeout_secs_attribute.attr,
863884 &slot_timeout_secs_attribute.attr,
885
+ &cache_timeout_msecs_attribute.attr,
864886 &dcache_timeout_msecs_attribute.attr,
865887 &getattr_timeout_msecs_attribute.attr,
866888 &readahead_count_attribute.attr,