Whamcloud - gitweb
LU-7845 obd: add 'network' client mount option
[fs/lustre-release.git] / lustre / obdclass / lprocfs_jobstats.c
index af6cc5f..ca5223b 100644 (file)
@@ -14,7 +14,7 @@
  *
  * You should have received a copy of the GNU General Public License
  * version 2 along with this program; If not, see
- * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
+ * http://www.gnu.org/licenses/gpl-2.0.html
  *
  * GPL HEADER END
  */
@@ -451,7 +451,7 @@ static int lprocfs_jobstats_seq_show(struct seq_file *p, void *v)
                cntr_header = &s->ls_cnt_header[i];
                lprocfs_stats_collect(s, i, &ret);
 
-               seq_printf(p, "  %s:%.*s { samples: %11"LPF64"u",
+               seq_printf(p, "  %s:%.*s { samples: %11llu",
                           cntr_header->lc_name,
                           width(cntr_header->lc_name, 15), spaces,
                           ret.lc_count);
@@ -459,14 +459,14 @@ static int lprocfs_jobstats_seq_show(struct seq_file *p, void *v)
                        seq_printf(p, ", unit: %5s", cntr_header->lc_units);
 
                if (cntr_header->lc_config & LPROCFS_CNTR_AVGMINMAX) {
-                       seq_printf(p, ", min:%8"LPF64"u, max:%8"LPF64"u,"
-                                  " sum:%16"LPF64"u",
+                       seq_printf(p, ", min:%8llu, max:%8llu,"
+                                  " sum:%16llu",
                                   ret.lc_count ? ret.lc_min : 0,
                                   ret.lc_count ? ret.lc_max : 0,
                                   ret.lc_count ? ret.lc_sum : 0);
                }
                if (cntr_header->lc_config & LPROCFS_CNTR_STDDEV) {
-                       seq_printf(p, ", sumsq: %18"LPF64"u",
+                       seq_printf(p, ", sumsq: %18llu",
                                   ret.lc_count ? ret.lc_sumsquare : 0);
                }
 
@@ -647,7 +647,8 @@ lprocfs_job_interval_seq_write(struct file *file, const char __user *buffer,
 {
        struct obd_device *obd;
        struct obd_job_stats *stats;
-       int val, rc;
+       int rc;
+       __s64 val;
 
        obd = ((struct seq_file *)file->private_data)->private;
        if (obd == NULL)
@@ -655,9 +656,11 @@ lprocfs_job_interval_seq_write(struct file *file, const char __user *buffer,
 
        stats = &obd->u.obt.obt_jobstats;
 
-       rc = lprocfs_write_helper(buffer, count, &val);
+       rc = lprocfs_str_to_s64(buffer, count, &val);
        if (rc)
                return rc;
+       if (val < 0 || val > UINT_MAX)
+               return -ERANGE;
 
        stats->ojs_cleanup_interval = val;
        lprocfs_job_cleanup(stats, stats->ojs_cleanup_interval);