Whamcloud - gitweb
LU-8066 sysfs: make ping sysfs file read and writable
[fs/lustre-release.git] / lustre / include / lprocfs_status.h
index d0bd2af..acf1bc0 100644 (file)
@@ -58,6 +58,11 @@ struct lprocfs_vars {
        mode_t                           proc_mode;
 };
 
+static inline u32 pct(s64 a, s64 b)
+{
+       return b ? a * 100 / b : 0;
+}
+
 /**
  * Append a space separated list of current set flags to str.
  */
@@ -571,9 +576,7 @@ extern int lprocfs_obd_seq_create(struct obd_device *dev, const char *name,
 
 /* Generic callbacks */
 extern int lprocfs_uuid_seq_show(struct seq_file *m, void *data);
-extern int lprocfs_name_seq_show(struct seq_file *m, void *data);
 extern int lprocfs_server_uuid_seq_show(struct seq_file *m, void *data);
-extern int lprocfs_conn_uuid_seq_show(struct seq_file *m, void *data);
 ssize_t conn_uuid_show(struct kobject *kobj, struct attribute *attr, char *buf);
 extern int lprocfs_import_seq_show(struct seq_file *m, void *data);
 extern int lprocfs_state_seq_show(struct seq_file *m, void *data);
@@ -595,9 +598,9 @@ lprocfs_evict_client_seq_write(struct file *file, const char __user *buffer,
 #endif
 ssize_t ping_store(struct kobject *kobj, struct attribute *attr,
                   const char *buffer, size_t count);
-extern ssize_t
-lprocfs_ping_seq_write(struct file *file, const char __user *buffer,
-                      size_t count, loff_t *off);
+ssize_t ping_show(struct kobject *kobj, struct attribute *attr,
+                 char *buffer);
+
 extern ssize_t
 lprocfs_import_seq_write(struct file *file, const char __user *buffer,
                         size_t count, loff_t *off);
@@ -958,12 +961,8 @@ static inline int lprocfs_obd_cleanup(struct obd_device *dev)
 { return 0; }
 static inline int lprocfs_uuid_seq_show(struct seq_file *m, void *data)
 { return 0; }
-static inline int lprocfs_name_seq_show(struct seq_file *m, void *data)
-{ return 0; }
 static inline int lprocfs_server_seq_show(struct seq_file *m, void *data)
 { return 0; }
-static inline int lprocfs_conn_uuid_seq_show(struct seq_file *m, void *data)
-{ return 0; }
 static inline int lprocfs_import_seq_show(struct seq_file *m, void *data)
 { return 0; }
 static inline int lprocfs_state_seq_show(struct seq_file *m, void *data)