Whamcloud - gitweb
LU-12967 ofd: restore sync_on_lock_cancel tunable
[fs/lustre-release.git] / lustre / ofd / lproc_ofd.c
index 71ee75a..22946c5 100644 (file)
@@ -409,9 +409,33 @@ ofd_brw_size_seq_write(struct file *file, const char __user *buffer,
 
        return count;
 }
-
 LPROC_SEQ_FOPS(ofd_brw_size);
 
+#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 16, 53, 0)
+static bool sync_on_lock_cancel_warned;
+static ssize_t sync_on_lock_cancel_show(struct kobject *kobj,
+                                       struct attribute *attr, char *buf)
+{
+       if (!sync_on_lock_cancel_warned) {
+               sync_on_lock_cancel_warned = true;
+               pr_info("ofd: 'obdfilter.*.sync_on_lock_cancel' is deprecated, use 'obdfilter.*.sync_lock_cancel' instead\n");
+       }
+       return sync_lock_cancel_show(kobj, attr, buf);
+}
+
+static ssize_t sync_on_lock_cancel_store(struct kobject *kobj,
+                                        struct attribute *attr,
+                                        const char *buffer, size_t count)
+{
+       if (!sync_on_lock_cancel_warned) {
+               sync_on_lock_cancel_warned = true;
+               pr_info("ofd: 'obdfilter.*.sync_on_lock_cancel' is deprecated, use 'obdfilter.*.sync_lock_cancel' instead\n");
+       }
+       return sync_lock_cancel_store(kobj, attr, buffer, count);
+}
+LUSTRE_RW_ATTR(sync_on_lock_cancel);
+#endif
+
 /**
  * Show the limit of soft sync RPCs.
  *
@@ -892,6 +916,9 @@ static struct attribute *ofd_attrs[] = {
        &lustre_attr_fstype.attr,
        &lustre_attr_no_precreate.attr,
        &lustre_attr_sync_journal.attr,
+#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 16, 53, 0)
+       &lustre_attr_sync_on_lock_cancel.attr,
+#endif
        &lustre_attr_soft_sync_limit.attr,
        &lustre_attr_lfsck_speed_limit.attr,
        &lustre_attr_job_cleanup_interval.attr,