#define DEBUG_SUBSYSTEM S_CLASS
-
#include <obd_class.h>
#include <lprocfs_status.h>
-#include <lustre/lustre_idl.h>
#ifdef CONFIG_PROC_FS
struct hlist_node js_hash; /* hash struct for this jobid */
struct list_head js_list; /* on ojs_list, with ojs_lock */
atomic_t js_refcount; /* num users of this struct */
- char js_jobid[LUSTRE_JOBID_SIZE]; /* job name */
+ char js_jobid[LUSTRE_JOBID_SIZE]; /* job name + NUL*/
time64_t js_timestamp; /* seconds of most recent stat*/
struct lprocfs_stats *js_stats; /* per-job statistics */
struct obd_job_stats *js_jobstats; /* for accessing ojs_lock */
jobs->ojs_cntr_init_fn(job->js_stats);
- memcpy(job->js_jobid, jobid, LUSTRE_JOBID_SIZE);
+ memcpy(job->js_jobid, jobid, sizeof(job->js_jobid));
job->js_timestamp = ktime_get_real_seconds();
job->js_jobstats = jobs;
INIT_HLIST_NODE(&job->js_hash);
{
struct obd_device *obd;
struct obd_job_stats *stats;
+ unsigned int val;
int rc;
- __s64 val;
obd = ((struct seq_file *)file->private_data)->private;
if (obd == NULL)
stats = &obd->u.obt.obt_jobstats;
- rc = lprocfs_str_to_s64(buffer, count, &val);
+ rc = kstrtouint_from_user(buffer, count, 0, &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);