@@ -726,7 +726,7 @@ static ssize_t statahead_running_max_show(struct kobject *kobj,
struct ll_sb_info *sbi = container_of(kobj, struct ll_sb_info,
ll_kset.kobj);
- return snprintf(buf, 16, "%u\n", sbi->ll_sa_running_max);
+ return scnprintf(buf, 16, "%u\n", sbi->ll_sa_running_max);
}
static ssize_t statahead_running_max_store(struct kobject *kobj,
@@ -882,7 +882,7 @@ static ssize_t statfs_max_age_show(struct kobject *kobj, struct attribute *attr,
struct ll_sb_info *sbi = container_of(kobj, struct ll_sb_info,
ll_kset.kobj);
- return snprintf(buf, PAGE_SIZE, "%u\n", sbi->ll_statfs_max_age);
+ return scnprintf(buf, PAGE_SIZE, "%u\n", sbi->ll_statfs_max_age);
}
static ssize_t statfs_max_age_store(struct kobject *kobj,
@@ -920,8 +920,8 @@ static ssize_t max_easize_show(struct kobject *kobj,
return rc;
/* Limit xattr size returned to userspace based on kernel maximum */
- return snprintf(buf, PAGE_SIZE, "%u\n",
- ealen > XATTR_SIZE_MAX ? XATTR_SIZE_MAX : ealen);
+ return scnprintf(buf, PAGE_SIZE, "%u\n",
+ ealen > XATTR_SIZE_MAX ? XATTR_SIZE_MAX : ealen);
}
LUSTRE_RO_ATTR(max_easize);
@@ -951,8 +951,8 @@ static ssize_t default_easize_show(struct kobject *kobj,
return rc;
/* Limit xattr size returned to userspace based on kernel maximum */
- return snprintf(buf, PAGE_SIZE, "%u\n",
- ealen > XATTR_SIZE_MAX ? XATTR_SIZE_MAX : ealen);
+ return scnprintf(buf, PAGE_SIZE, "%u\n",
+ ealen > XATTR_SIZE_MAX ? XATTR_SIZE_MAX : ealen);
}
/**
@@ -1094,8 +1094,8 @@ static ssize_t max_read_ahead_async_active_show(struct kobject *kobj,
struct ll_sb_info *sbi = container_of(kobj, struct ll_sb_info,
ll_kset.kobj);
- return snprintf(buf, PAGE_SIZE, "%u\n",
- sbi->ll_ra_info.ra_async_max_active);
+ return scnprintf(buf, PAGE_SIZE, "%u\n",
+ sbi->ll_ra_info.ra_async_max_active);
}
static ssize_t max_read_ahead_async_active_store(struct kobject *kobj,
@@ -1139,8 +1139,8 @@ static ssize_t read_ahead_async_file_threshold_mb_show(struct kobject *kobj,
struct ll_sb_info *sbi = container_of(kobj, struct ll_sb_info,
ll_kset.kobj);
- return snprintf(buf, PAGE_SIZE, "%lu\n",
- PAGES_TO_MiB(sbi->ll_ra_info.ra_async_pages_per_file_threshold));
+ return scnprintf(buf, PAGE_SIZE, "%lu\n",
+ PAGES_TO_MiB(sbi->ll_ra_info.ra_async_pages_per_file_threshold));
}
static ssize_t
@@ -1260,8 +1260,8 @@ static ssize_t file_heat_show(struct kobject *kobj,
struct ll_sb_info *sbi = container_of(kobj, struct ll_sb_info,
ll_kset.kobj);
- return snprintf(buf, PAGE_SIZE, "%u\n",
- !!(sbi->ll_flags & LL_SBI_FILE_HEAT));
+ return scnprintf(buf, PAGE_SIZE, "%u\n",
+ !!(sbi->ll_flags & LL_SBI_FILE_HEAT));
}
static ssize_t file_heat_store(struct kobject *kobj,
@@ -1296,8 +1296,8 @@ static ssize_t heat_decay_percentage_show(struct kobject *kobj,
struct ll_sb_info *sbi = container_of(kobj, struct ll_sb_info,
ll_kset.kobj);
- return snprintf(buf, PAGE_SIZE, "%u\n",
- (sbi->ll_heat_decay_weight * 100 + 128) / 256);
+ return scnprintf(buf, PAGE_SIZE, "%u\n",
+ (sbi->ll_heat_decay_weight * 100 + 128) / 256);
}
static ssize_t heat_decay_percentage_store(struct kobject *kobj,
@@ -1330,7 +1330,7 @@ static ssize_t heat_period_second_show(struct kobject *kobj,
struct ll_sb_info *sbi = container_of(kobj, struct ll_sb_info,
ll_kset.kobj);
- return snprintf(buf, PAGE_SIZE, "%u\n", sbi->ll_heat_period_second);
+ return scnprintf(buf, PAGE_SIZE, "%u\n", sbi->ll_heat_period_second);
}
static ssize_t heat_period_second_store(struct kobject *kobj,
@@ -1088,15 +1088,15 @@ void pcc_inode_free(struct inode *inode)
#define MAX_PCC_DATABASE_PATH (6 * 5 + FID_NOBRACE_LEN + 1)
static int pcc_fid2dataset_path(char *buf, int sz, struct lu_fid *fid)
{
- return snprintf(buf, sz, "%04x/%04x/%04x/%04x/%04x/%04x/"
- DFID_NOBRACE,
- (fid)->f_oid & 0xFFFF,
- (fid)->f_oid >> 16 & 0xFFFF,
- (unsigned int)((fid)->f_seq & 0xFFFF),
- (unsigned int)((fid)->f_seq >> 16 & 0xFFFF),
- (unsigned int)((fid)->f_seq >> 32 & 0xFFFF),
- (unsigned int)((fid)->f_seq >> 48 & 0xFFFF),
- PFID(fid));
+ return scnprintf(buf, sz, "%04x/%04x/%04x/%04x/%04x/%04x/"
+ DFID_NOBRACE,
+ (fid)->f_oid & 0xFFFF,
+ (fid)->f_oid >> 16 & 0xFFFF,
+ (unsigned int)((fid)->f_seq & 0xFFFF),
+ (unsigned int)((fid)->f_seq >> 16 & 0xFFFF),
+ (unsigned int)((fid)->f_seq >> 32 & 0xFFFF),
+ (unsigned int)((fid)->f_seq >> 48 & 0xFFFF),
+ PFID(fid));
}
static inline const struct cred *pcc_super_cred(struct super_block *sb)
@@ -1163,16 +1163,16 @@ static int pcc_get_layout_info(struct inode *inode, struct cl_layout *clt)
static int pcc_fid2dataset_fullpath(char *buf, int sz, struct lu_fid *fid,
struct pcc_dataset *dataset)
{
- return snprintf(buf, sz, "%s/%04x/%04x/%04x/%04x/%04x/%04x/"
- DFID_NOBRACE,
- dataset->pccd_pathname,
- (fid)->f_oid & 0xFFFF,
- (fid)->f_oid >> 16 & 0xFFFF,
- (unsigned int)((fid)->f_seq & 0xFFFF),
- (unsigned int)((fid)->f_seq >> 16 & 0xFFFF),
- (unsigned int)((fid)->f_seq >> 32 & 0xFFFF),
- (unsigned int)((fid)->f_seq >> 48 & 0xFFFF),
- PFID(fid));
+ return scnprintf(buf, sz, "%s/%04x/%04x/%04x/%04x/%04x/%04x/"
+ DFID_NOBRACE,
+ dataset->pccd_pathname,
+ (fid)->f_oid & 0xFFFF,
+ (fid)->f_oid >> 16 & 0xFFFF,
+ (unsigned int)((fid)->f_seq & 0xFFFF),
+ (unsigned int)((fid)->f_seq >> 16 & 0xFFFF),
+ (unsigned int)((fid)->f_seq >> 32 & 0xFFFF),
+ (unsigned int)((fid)->f_seq >> 48 & 0xFFFF),
+ PFID(fid));
}
/* Must be called with pcci->pcci_lock held */
@@ -218,7 +218,7 @@ static ssize_t pinger_show(struct kobject *kobj, struct attribute *attr,
static ssize_t jobid_var_show(struct kobject *kobj, struct attribute *attr,
char *buf)
{
- return snprintf(buf, PAGE_SIZE, "%s\n", obd_jobid_var);
+ return scnprintf(buf, PAGE_SIZE, "%s\n", obd_jobid_var);
}
static ssize_t jobid_var_store(struct kobject *kobj, struct attribute *attr,
@@ -252,7 +252,7 @@ static ssize_t jobid_var_store(struct kobject *kobj, struct attribute *attr,
static ssize_t jobid_name_show(struct kobject *kobj, struct attribute *attr,
char *buf)
{
- return snprintf(buf, PAGE_SIZE, "%s\n", obd_jobid_name);
+ return scnprintf(buf, PAGE_SIZE, "%s\n", obd_jobid_name);
}
static ssize_t jobid_name_store(struct kobject *kobj, struct attribute *attr,
@@ -283,7 +283,7 @@ static ssize_t jobid_this_session_show(struct kobject *kobj,
rcu_read_lock();
jid = jobid_current();
if (jid)
- ret = snprintf(buf, PAGE_SIZE, "%s\n", jid);
+ ret = scnprintf(buf, PAGE_SIZE, "%s\n", jid);
rcu_read_unlock();
return ret;
}