Whamcloud - gitweb
LU-1644 mgc: remove obsolete IR swabbing workaround
[fs/lustre-release.git] / lustre / obdclass / lprocfs_status.c
index 5d985fd..0c434f2 100644 (file)
@@ -730,7 +730,6 @@ static void obd_import_flags2str(struct obd_import *imp, struct seq_file *m)
        flag2str(imp, pingable);
        flag2str(imp, resend_replay);
        flag2str(imp, no_pinger_recover);
-       flag2str(imp, need_mne_swab);
        flag2str(imp, connect_tried);
 }
 
@@ -2173,7 +2172,7 @@ int lprocfs_str_with_units_to_s64(const char __user *buffer,
 }
 EXPORT_SYMBOL(lprocfs_str_with_units_to_s64);
 
-static char *lprocfs_strnstr(const char *s1, const char *s2, size_t len)
+char *lprocfs_strnstr(const char *s1, const char *s2, size_t len)
 {
        size_t l2;
 
@@ -2188,6 +2187,7 @@ static char *lprocfs_strnstr(const char *s1, const char *s2, size_t len)
        }
        return NULL;
 }
+EXPORT_SYMBOL(lprocfs_strnstr);
 
 /**
  * Find the string \a name in the input \a buffer, and return a pointer to the
@@ -2385,34 +2385,36 @@ ssize_t lprocfs_obd_max_pages_per_rpc_seq_write(struct file *file,
 }
 EXPORT_SYMBOL(lprocfs_obd_max_pages_per_rpc_seq_write);
 
-int lprocfs_obd_short_io_bytes_seq_show(struct seq_file *m, void *data)
+ssize_t short_io_bytes_show(struct kobject *kobj, struct attribute *attr,
+                           char *buf)
 {
-       struct obd_device *dev = data;
+       struct obd_device *dev = container_of(kobj, struct obd_device,
+                                             obd_kset.kobj);
        struct client_obd *cli = &dev->u.cli;
+       int rc;
 
        spin_lock(&cli->cl_loi_list_lock);
-       seq_printf(m, "%d\n", cli->cl_short_io_bytes);
+       rc = sprintf(buf, "%d\n", cli->cl_short_io_bytes);
        spin_unlock(&cli->cl_loi_list_lock);
-       return 0;
+       return rc;
 }
-EXPORT_SYMBOL(lprocfs_obd_short_io_bytes_seq_show);
+EXPORT_SYMBOL(short_io_bytes_show);
 
 /* Used to catch people who think they're specifying pages. */
 #define MIN_SHORT_IO_BYTES 64
 
-ssize_t lprocfs_obd_short_io_bytes_seq_write(struct file *file,
-                                            const char __user *buffer,
-                                            size_t count, loff_t *off)
+ssize_t short_io_bytes_store(struct kobject *kobj, struct attribute *attr,
+                            const char *buffer, size_t count)
 {
-       struct obd_device *dev = ((struct seq_file *)
-                                               file->private_data)->private;
+       struct obd_device *dev = container_of(kobj, struct obd_device,
+                                             obd_kset.kobj);
        struct client_obd *cli = &dev->u.cli;
-       int val;
+       u32 val;
        int rc;
 
        LPROCFS_CLIMP_CHECK(dev);
 
-       rc = kstrtoint_from_user(buffer, count, 0, &val);
+       rc = kstrtouint(buffer, 0, &val);
        if (rc)
                GOTO(out, rc);
 
@@ -2432,7 +2434,7 @@ out:
        LPROCFS_CLIMP_EXIT(dev);
        return rc;
 }
-EXPORT_SYMBOL(lprocfs_obd_short_io_bytes_seq_write);
+EXPORT_SYMBOL(short_io_bytes_store);
 
 int lprocfs_wr_root_squash(const char __user *buffer, unsigned long count,
                           struct root_squash_info *squash, char *name)