Commit 8faeebdf authored by Joe Perches's avatar Joe Perches Committed by Greg Kroah-Hartman

staging: lustre: Convert "return seq_printf(...)" uses

The seq_printf return value, because it's frequently misused,
will eventually be converted to void.

See: commit 1f33c41c ("seq_file: Rename seq_overflow() to
     seq_has_overflowed() and make public")

Convert these "return seq_printf(...)" uses to:

	seq_printf(seq, ...);
	return 0;

Done via cocci script:

@@
struct seq_file *seq;
@@

-	return
	\(seq_printf\|seq_puts\|seq_putc\)(seq,
	...);

+	return 0;

With some additional reformatting and typing post conversion.

Miscellanea:

o convert an rc++ use to a bool
o use seq_puts with fixed strings where appropriate
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Cc: Oleg Drokin <oleg.drokin@intel.com>
Cc: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 4643b70a
...@@ -2010,11 +2010,12 @@ EXPORT_SYMBOL(cfs_hash_rehash_key); ...@@ -2010,11 +2010,12 @@ EXPORT_SYMBOL(cfs_hash_rehash_key);
int cfs_hash_debug_header(struct seq_file *m) int cfs_hash_debug_header(struct seq_file *m)
{ {
return seq_printf(m, "%-*s%6s%6s%6s%6s%6s%6s%6s%7s%8s%8s%8s%s\n", seq_printf(m, "%-*s%6s%6s%6s%6s%6s%6s%6s%7s%8s%8s%8s%s\n",
CFS_HASH_BIGNAME_LEN, CFS_HASH_BIGNAME_LEN,
"name", "cur", "min", "max", "theta", "t-min", "t-max", "name", "cur", "min", "max", "theta", "t-min", "t-max",
"flags", "rehash", "count", "maxdep", "maxdepb", "flags", "rehash", "count", "maxdep", "maxdepb",
" distribution"); " distribution");
return 0;
} }
EXPORT_SYMBOL(cfs_hash_debug_header); EXPORT_SYMBOL(cfs_hash_debug_header);
......
...@@ -187,7 +187,8 @@ static int ll_fstype_seq_show(struct seq_file *m, void *v) ...@@ -187,7 +187,8 @@ static int ll_fstype_seq_show(struct seq_file *m, void *v)
struct super_block *sb = (struct super_block *)m->private; struct super_block *sb = (struct super_block *)m->private;
LASSERT(sb != NULL); LASSERT(sb != NULL);
return seq_printf(m, "%s\n", sb->s_type->name); seq_printf(m, "%s\n", sb->s_type->name);
return 0;
} }
LPROC_SEQ_FOPS_RO(ll_fstype); LPROC_SEQ_FOPS_RO(ll_fstype);
...@@ -196,7 +197,8 @@ static int ll_sb_uuid_seq_show(struct seq_file *m, void *v) ...@@ -196,7 +197,8 @@ static int ll_sb_uuid_seq_show(struct seq_file *m, void *v)
struct super_block *sb = (struct super_block *)m->private; struct super_block *sb = (struct super_block *)m->private;
LASSERT(sb != NULL); LASSERT(sb != NULL);
return seq_printf(m, "%s\n", ll_s2sbi(sb)->ll_sb_uuid.uuid); seq_printf(m, "%s\n", ll_s2sbi(sb)->ll_sb_uuid.uuid);
return 0;
} }
LPROC_SEQ_FOPS_RO(ll_sb_uuid); LPROC_SEQ_FOPS_RO(ll_sb_uuid);
...@@ -353,17 +355,18 @@ static int ll_max_cached_mb_seq_show(struct seq_file *m, void *v) ...@@ -353,17 +355,18 @@ static int ll_max_cached_mb_seq_show(struct seq_file *m, void *v)
max_cached_mb = cache->ccc_lru_max >> shift; max_cached_mb = cache->ccc_lru_max >> shift;
unused_mb = atomic_read(&cache->ccc_lru_left) >> shift; unused_mb = atomic_read(&cache->ccc_lru_left) >> shift;
return seq_printf(m, seq_printf(m,
"users: %d\n" "users: %d\n"
"max_cached_mb: %d\n" "max_cached_mb: %d\n"
"used_mb: %d\n" "used_mb: %d\n"
"unused_mb: %d\n" "unused_mb: %d\n"
"reclaim_count: %u\n", "reclaim_count: %u\n",
atomic_read(&cache->ccc_users), atomic_read(&cache->ccc_users),
max_cached_mb, max_cached_mb,
max_cached_mb - unused_mb, max_cached_mb - unused_mb,
unused_mb, unused_mb,
cache->ccc_lru_shrinkers); cache->ccc_lru_shrinkers);
return 0;
} }
static ssize_t ll_max_cached_mb_seq_write(struct file *file, static ssize_t ll_max_cached_mb_seq_write(struct file *file,
...@@ -467,7 +470,8 @@ static int ll_checksum_seq_show(struct seq_file *m, void *v) ...@@ -467,7 +470,8 @@ static int ll_checksum_seq_show(struct seq_file *m, void *v)
struct super_block *sb = m->private; struct super_block *sb = m->private;
struct ll_sb_info *sbi = ll_s2sbi(sb); struct ll_sb_info *sbi = ll_s2sbi(sb);
return seq_printf(m, "%u\n", (sbi->ll_flags & LL_SBI_CHECKSUM) ? 1 : 0); seq_printf(m, "%u\n", (sbi->ll_flags & LL_SBI_CHECKSUM) ? 1 : 0);
return 0;
} }
static ssize_t ll_checksum_seq_write(struct file *file, static ssize_t ll_checksum_seq_write(struct file *file,
...@@ -503,7 +507,8 @@ static int ll_max_rw_chunk_seq_show(struct seq_file *m, void *v) ...@@ -503,7 +507,8 @@ static int ll_max_rw_chunk_seq_show(struct seq_file *m, void *v)
{ {
struct super_block *sb = m->private; struct super_block *sb = m->private;
return seq_printf(m, "%lu\n", ll_s2sbi(sb)->ll_max_rw_chunk); seq_printf(m, "%lu\n", ll_s2sbi(sb)->ll_max_rw_chunk);
return 0;
} }
static ssize_t ll_max_rw_chunk_seq_write(struct file *file, static ssize_t ll_max_rw_chunk_seq_write(struct file *file,
...@@ -525,15 +530,14 @@ static int ll_rd_track_id(struct seq_file *m, enum stats_track_type type) ...@@ -525,15 +530,14 @@ static int ll_rd_track_id(struct seq_file *m, enum stats_track_type type)
{ {
struct super_block *sb = m->private; struct super_block *sb = m->private;
if (ll_s2sbi(sb)->ll_stats_track_type == type) { if (ll_s2sbi(sb)->ll_stats_track_type == type)
return seq_printf(m, "%d\n", seq_printf(m, "%d\n", ll_s2sbi(sb)->ll_stats_track_id);
ll_s2sbi(sb)->ll_stats_track_id); else if (ll_s2sbi(sb)->ll_stats_track_type == STATS_TRACK_ALL)
seq_puts(m, "0 (all)\n");
else
seq_puts(m, "untracked\n");
} else if (ll_s2sbi(sb)->ll_stats_track_type == STATS_TRACK_ALL) { return 0;
return seq_printf(m, "0 (all)\n");
} else {
return seq_printf(m, "untracked\n");
}
} }
static int ll_wr_track_id(const char __user *buffer, unsigned long count, static int ll_wr_track_id(const char __user *buffer, unsigned long count,
...@@ -601,7 +605,8 @@ static int ll_statahead_max_seq_show(struct seq_file *m, void *v) ...@@ -601,7 +605,8 @@ static int ll_statahead_max_seq_show(struct seq_file *m, void *v)
struct super_block *sb = m->private; struct super_block *sb = m->private;
struct ll_sb_info *sbi = ll_s2sbi(sb); struct ll_sb_info *sbi = ll_s2sbi(sb);
return seq_printf(m, "%u\n", sbi->ll_sa_max); seq_printf(m, "%u\n", sbi->ll_sa_max);
return 0;
} }
static ssize_t ll_statahead_max_seq_write(struct file *file, static ssize_t ll_statahead_max_seq_write(struct file *file,
...@@ -631,8 +636,8 @@ static int ll_statahead_agl_seq_show(struct seq_file *m, void *v) ...@@ -631,8 +636,8 @@ static int ll_statahead_agl_seq_show(struct seq_file *m, void *v)
struct super_block *sb = m->private; struct super_block *sb = m->private;
struct ll_sb_info *sbi = ll_s2sbi(sb); struct ll_sb_info *sbi = ll_s2sbi(sb);
return seq_printf(m, "%u\n", seq_printf(m, "%u\n", sbi->ll_flags & LL_SBI_AGL_ENABLED ? 1 : 0);
sbi->ll_flags & LL_SBI_AGL_ENABLED ? 1 : 0); return 0;
} }
static ssize_t ll_statahead_agl_seq_write(struct file *file, static ssize_t ll_statahead_agl_seq_write(struct file *file,
...@@ -661,13 +666,14 @@ static int ll_statahead_stats_seq_show(struct seq_file *m, void *v) ...@@ -661,13 +666,14 @@ static int ll_statahead_stats_seq_show(struct seq_file *m, void *v)
struct super_block *sb = m->private; struct super_block *sb = m->private;
struct ll_sb_info *sbi = ll_s2sbi(sb); struct ll_sb_info *sbi = ll_s2sbi(sb);
return seq_printf(m, seq_printf(m,
"statahead total: %u\n" "statahead total: %u\n"
"statahead wrong: %u\n" "statahead wrong: %u\n"
"agl total: %u\n", "agl total: %u\n",
atomic_read(&sbi->ll_sa_total), atomic_read(&sbi->ll_sa_total),
atomic_read(&sbi->ll_sa_wrong), atomic_read(&sbi->ll_sa_wrong),
atomic_read(&sbi->ll_agl_total)); atomic_read(&sbi->ll_agl_total));
return 0;
} }
LPROC_SEQ_FOPS_RO(ll_statahead_stats); LPROC_SEQ_FOPS_RO(ll_statahead_stats);
...@@ -676,8 +682,8 @@ static int ll_lazystatfs_seq_show(struct seq_file *m, void *v) ...@@ -676,8 +682,8 @@ static int ll_lazystatfs_seq_show(struct seq_file *m, void *v)
struct super_block *sb = m->private; struct super_block *sb = m->private;
struct ll_sb_info *sbi = ll_s2sbi(sb); struct ll_sb_info *sbi = ll_s2sbi(sb);
return seq_printf(m, "%u\n", seq_printf(m, "%u\n", sbi->ll_flags & LL_SBI_LAZYSTATFS ? 1 : 0);
(sbi->ll_flags & LL_SBI_LAZYSTATFS) ? 1 : 0); return 0;
} }
static ssize_t ll_lazystatfs_seq_write(struct file *file, static ssize_t ll_lazystatfs_seq_write(struct file *file,
...@@ -712,7 +718,8 @@ static int ll_max_easize_seq_show(struct seq_file *m, void *v) ...@@ -712,7 +718,8 @@ static int ll_max_easize_seq_show(struct seq_file *m, void *v)
if (rc) if (rc)
return rc; return rc;
return seq_printf(m, "%u\n", ealen); seq_printf(m, "%u\n", ealen);
return 0;
} }
LPROC_SEQ_FOPS_RO(ll_max_easize); LPROC_SEQ_FOPS_RO(ll_max_easize);
...@@ -727,7 +734,8 @@ static int ll_defult_easize_seq_show(struct seq_file *m, void *v) ...@@ -727,7 +734,8 @@ static int ll_defult_easize_seq_show(struct seq_file *m, void *v)
if (rc) if (rc)
return rc; return rc;
return seq_printf(m, "%u\n", ealen); seq_printf(m, "%u\n", ealen);
return 0;
} }
LPROC_SEQ_FOPS_RO(ll_defult_easize); LPROC_SEQ_FOPS_RO(ll_defult_easize);
...@@ -742,7 +750,8 @@ static int ll_max_cookiesize_seq_show(struct seq_file *m, void *v) ...@@ -742,7 +750,8 @@ static int ll_max_cookiesize_seq_show(struct seq_file *m, void *v)
if (rc) if (rc)
return rc; return rc;
return seq_printf(m, "%u\n", cookielen); seq_printf(m, "%u\n", cookielen);
return 0;
} }
LPROC_SEQ_FOPS_RO(ll_max_cookiesize); LPROC_SEQ_FOPS_RO(ll_max_cookiesize);
...@@ -757,7 +766,8 @@ static int ll_defult_cookiesize_seq_show(struct seq_file *m, void *v) ...@@ -757,7 +766,8 @@ static int ll_defult_cookiesize_seq_show(struct seq_file *m, void *v)
if (rc) if (rc)
return rc; return rc;
return seq_printf(m, "%u\n", cookielen); seq_printf(m, "%u\n", cookielen);
return 0;
} }
LPROC_SEQ_FOPS_RO(ll_defult_cookiesize); LPROC_SEQ_FOPS_RO(ll_defult_cookiesize);
......
...@@ -48,7 +48,8 @@ static int lmv_numobd_seq_show(struct seq_file *m, void *v) ...@@ -48,7 +48,8 @@ static int lmv_numobd_seq_show(struct seq_file *m, void *v)
LASSERT(dev != NULL); LASSERT(dev != NULL);
desc = &dev->u.lmv.desc; desc = &dev->u.lmv.desc;
return seq_printf(m, "%u\n", desc->ld_tgt_count); seq_printf(m, "%u\n", desc->ld_tgt_count);
return 0;
} }
LPROC_SEQ_FOPS_RO(lmv_numobd); LPROC_SEQ_FOPS_RO(lmv_numobd);
...@@ -82,7 +83,8 @@ static int lmv_placement_seq_show(struct seq_file *m, void *v) ...@@ -82,7 +83,8 @@ static int lmv_placement_seq_show(struct seq_file *m, void *v)
LASSERT(dev != NULL); LASSERT(dev != NULL);
lmv = &dev->u.lmv; lmv = &dev->u.lmv;
return seq_printf(m, "%s\n", placement_policy2name(lmv->lmv_placement)); seq_printf(m, "%s\n", placement_policy2name(lmv->lmv_placement));
return 0;
} }
#define MAX_POLICY_STRING_SIZE 64 #define MAX_POLICY_STRING_SIZE 64
...@@ -130,7 +132,8 @@ static int lmv_activeobd_seq_show(struct seq_file *m, void *v) ...@@ -130,7 +132,8 @@ static int lmv_activeobd_seq_show(struct seq_file *m, void *v)
LASSERT(dev != NULL); LASSERT(dev != NULL);
desc = &dev->u.lmv.desc; desc = &dev->u.lmv.desc;
return seq_printf(m, "%u\n", desc->ld_active_tgt_count); seq_printf(m, "%u\n", desc->ld_active_tgt_count);
return 0;
} }
LPROC_SEQ_FOPS_RO(lmv_activeobd); LPROC_SEQ_FOPS_RO(lmv_activeobd);
...@@ -141,7 +144,8 @@ static int lmv_desc_uuid_seq_show(struct seq_file *m, void *v) ...@@ -141,7 +144,8 @@ static int lmv_desc_uuid_seq_show(struct seq_file *m, void *v)
LASSERT(dev != NULL); LASSERT(dev != NULL);
lmv = &dev->u.lmv; lmv = &dev->u.lmv;
return seq_printf(m, "%s\n", lmv->desc.ld_uuid.uuid); seq_printf(m, "%s\n", lmv->desc.ld_uuid.uuid);
return 0;
} }
LPROC_SEQ_FOPS_RO(lmv_desc_uuid); LPROC_SEQ_FOPS_RO(lmv_desc_uuid);
...@@ -171,8 +175,10 @@ static int lmv_tgt_seq_show(struct seq_file *p, void *v) ...@@ -171,8 +175,10 @@ static int lmv_tgt_seq_show(struct seq_file *p, void *v)
if (tgt == NULL) if (tgt == NULL)
return 0; return 0;
return seq_printf(p, "%d: %s %sACTIVE\n", tgt->ltd_idx, seq_printf(p, "%d: %s %sACTIVE\n",
tgt->ltd_uuid.uuid, tgt->ltd_active ? "" : "IN"); tgt->ltd_idx, tgt->ltd_uuid.uuid,
tgt->ltd_active ? "" : "IN");
return 0;
} }
static struct seq_operations lmv_tgt_sops = { static struct seq_operations lmv_tgt_sops = {
......
...@@ -48,7 +48,8 @@ static int lov_stripesize_seq_show(struct seq_file *m, void *v) ...@@ -48,7 +48,8 @@ static int lov_stripesize_seq_show(struct seq_file *m, void *v)
LASSERT(dev != NULL); LASSERT(dev != NULL);
desc = &dev->u.lov.desc; desc = &dev->u.lov.desc;
return seq_printf(m, "%llu\n", desc->ld_default_stripe_size); seq_printf(m, "%llu\n", desc->ld_default_stripe_size);
return 0;
} }
static ssize_t lov_stripesize_seq_write(struct file *file, static ssize_t lov_stripesize_seq_write(struct file *file,
...@@ -79,7 +80,8 @@ static int lov_stripeoffset_seq_show(struct seq_file *m, void *v) ...@@ -79,7 +80,8 @@ static int lov_stripeoffset_seq_show(struct seq_file *m, void *v)
LASSERT(dev != NULL); LASSERT(dev != NULL);
desc = &dev->u.lov.desc; desc = &dev->u.lov.desc;
return seq_printf(m, "%llu\n", desc->ld_default_stripe_offset); seq_printf(m, "%llu\n", desc->ld_default_stripe_offset);
return 0;
} }
static ssize_t lov_stripeoffset_seq_write(struct file *file, static ssize_t lov_stripeoffset_seq_write(struct file *file,
...@@ -109,7 +111,8 @@ static int lov_stripetype_seq_show(struct seq_file *m, void *v) ...@@ -109,7 +111,8 @@ static int lov_stripetype_seq_show(struct seq_file *m, void *v)
LASSERT(dev != NULL); LASSERT(dev != NULL);
desc = &dev->u.lov.desc; desc = &dev->u.lov.desc;
return seq_printf(m, "%u\n", desc->ld_pattern); seq_printf(m, "%u\n", desc->ld_pattern);
return 0;
} }
static ssize_t lov_stripetype_seq_write(struct file *file, static ssize_t lov_stripetype_seq_write(struct file *file,
...@@ -139,8 +142,8 @@ static int lov_stripecount_seq_show(struct seq_file *m, void *v) ...@@ -139,8 +142,8 @@ static int lov_stripecount_seq_show(struct seq_file *m, void *v)
LASSERT(dev != NULL); LASSERT(dev != NULL);
desc = &dev->u.lov.desc; desc = &dev->u.lov.desc;
return seq_printf(m, "%d\n", seq_printf(m, "%d\n", (__s16)(desc->ld_default_stripe_count + 1) - 1);
(__s16)(desc->ld_default_stripe_count + 1) - 1); return 0;
} }
static ssize_t lov_stripecount_seq_write(struct file *file, static ssize_t lov_stripecount_seq_write(struct file *file,
...@@ -170,7 +173,8 @@ static int lov_numobd_seq_show(struct seq_file *m, void *v) ...@@ -170,7 +173,8 @@ static int lov_numobd_seq_show(struct seq_file *m, void *v)
LASSERT(dev != NULL); LASSERT(dev != NULL);
desc = &dev->u.lov.desc; desc = &dev->u.lov.desc;
return seq_printf(m, "%u\n", desc->ld_tgt_count); seq_printf(m, "%u\n", desc->ld_tgt_count);
return 0;
} }
LPROC_SEQ_FOPS_RO(lov_numobd); LPROC_SEQ_FOPS_RO(lov_numobd);
...@@ -181,7 +185,8 @@ static int lov_activeobd_seq_show(struct seq_file *m, void *v) ...@@ -181,7 +185,8 @@ static int lov_activeobd_seq_show(struct seq_file *m, void *v)
LASSERT(dev != NULL); LASSERT(dev != NULL);
desc = &dev->u.lov.desc; desc = &dev->u.lov.desc;
return seq_printf(m, "%u\n", desc->ld_active_tgt_count); seq_printf(m, "%u\n", desc->ld_active_tgt_count);
return 0;
} }
LPROC_SEQ_FOPS_RO(lov_activeobd); LPROC_SEQ_FOPS_RO(lov_activeobd);
...@@ -192,7 +197,8 @@ static int lov_desc_uuid_seq_show(struct seq_file *m, void *v) ...@@ -192,7 +197,8 @@ static int lov_desc_uuid_seq_show(struct seq_file *m, void *v)
LASSERT(dev != NULL); LASSERT(dev != NULL);
lov = &dev->u.lov; lov = &dev->u.lov;
return seq_printf(m, "%s\n", lov->desc.ld_uuid.uuid); seq_printf(m, "%s\n", lov->desc.ld_uuid.uuid);
return 0;
} }
LPROC_SEQ_FOPS_RO(lov_desc_uuid); LPROC_SEQ_FOPS_RO(lov_desc_uuid);
...@@ -228,9 +234,11 @@ static void *lov_tgt_seq_next(struct seq_file *p, void *v, loff_t *pos) ...@@ -228,9 +234,11 @@ static void *lov_tgt_seq_next(struct seq_file *p, void *v, loff_t *pos)
static int lov_tgt_seq_show(struct seq_file *p, void *v) static int lov_tgt_seq_show(struct seq_file *p, void *v)
{ {
struct lov_tgt_desc *tgt = v; struct lov_tgt_desc *tgt = v;
return seq_printf(p, "%d: %s %sACTIVE\n", tgt->ltd_index,
obd_uuid2str(&tgt->ltd_uuid), seq_printf(p, "%d: %s %sACTIVE\n",
tgt->ltd_active ? "" : "IN"); tgt->ltd_index, obd_uuid2str(&tgt->ltd_uuid),
tgt->ltd_active ? "" : "IN");
return 0;
} }
struct seq_operations lov_tgt_sops = { struct seq_operations lov_tgt_sops = {
......
...@@ -219,21 +219,23 @@ struct miscdevice obd_psdev = { ...@@ -219,21 +219,23 @@ struct miscdevice obd_psdev = {
#if defined (CONFIG_PROC_FS) #if defined (CONFIG_PROC_FS)
int obd_proc_version_seq_show(struct seq_file *m, void *v) int obd_proc_version_seq_show(struct seq_file *m, void *v)
{ {
return seq_printf(m, "lustre: %s\nkernel: %s\nbuild: %s\n", seq_printf(m, "lustre: %s\nkernel: %s\nbuild: %s\n",
LUSTRE_VERSION_STRING, "patchless_client", LUSTRE_VERSION_STRING, "patchless_client", BUILD_VERSION);
BUILD_VERSION); return 0;
} }
LPROC_SEQ_FOPS_RO(obd_proc_version); LPROC_SEQ_FOPS_RO(obd_proc_version);
int obd_proc_pinger_seq_show(struct seq_file *m, void *v) int obd_proc_pinger_seq_show(struct seq_file *m, void *v)
{ {
return seq_printf(m, "%s\n", "on"); seq_printf(m, "%s\n", "on");
return 0;
} }
LPROC_SEQ_FOPS_RO(obd_proc_pinger); LPROC_SEQ_FOPS_RO(obd_proc_pinger);
static int obd_proc_health_seq_show(struct seq_file *m, void *v) static int obd_proc_health_seq_show(struct seq_file *m, void *v)
{ {
int rc = 0, i; bool healthy = true;
int i;
if (libcfs_catastrophe) if (libcfs_catastrophe)
seq_printf(m, "LBUG\n"); seq_printf(m, "LBUG\n");
...@@ -255,25 +257,27 @@ static int obd_proc_health_seq_show(struct seq_file *m, void *v) ...@@ -255,25 +257,27 @@ static int obd_proc_health_seq_show(struct seq_file *m, void *v)
if (obd_health_check(NULL, obd)) { if (obd_health_check(NULL, obd)) {
seq_printf(m, "device %s reported unhealthy\n", seq_printf(m, "device %s reported unhealthy\n",
obd->obd_name); obd->obd_name);
rc++; healthy = false;
} }
class_decref(obd, __func__, current); class_decref(obd, __func__, current);
read_lock(&obd_dev_lock); read_lock(&obd_dev_lock);
} }
read_unlock(&obd_dev_lock); read_unlock(&obd_dev_lock);
if (rc == 0) if (healthy)
return seq_printf(m, "healthy\n"); seq_puts(m, "healthy\n");
else
seq_puts(m, "NOT HEALTHY\n");
seq_printf(m, "NOT HEALTHY\n");
return 0; return 0;
} }
LPROC_SEQ_FOPS_RO(obd_proc_health); LPROC_SEQ_FOPS_RO(obd_proc_health);
static int obd_proc_jobid_var_seq_show(struct seq_file *m, void *v) static int obd_proc_jobid_var_seq_show(struct seq_file *m, void *v)
{ {
return seq_printf(m, "%s\n", obd_jobid_var); seq_printf(m, "%s\n", obd_jobid_var);
return 0;
} }
static ssize_t obd_proc_jobid_var_seq_write(struct file *file, static ssize_t obd_proc_jobid_var_seq_write(struct file *file,
...@@ -299,7 +303,8 @@ LPROC_SEQ_FOPS(obd_proc_jobid_var); ...@@ -299,7 +303,8 @@ LPROC_SEQ_FOPS(obd_proc_jobid_var);
static int obd_proc_jobid_name_seq_show(struct seq_file *m, void *v) static int obd_proc_jobid_name_seq_show(struct seq_file *m, void *v)
{ {
return seq_printf(m, "%s\n", obd_jobid_var); seq_printf(m, "%s\n", obd_jobid_var);
return 0;
} }
static ssize_t obd_proc_jobid_name_seq_write(struct file *file, static ssize_t obd_proc_jobid_name_seq_write(struct file *file,
...@@ -378,10 +383,11 @@ static int obd_device_list_seq_show(struct seq_file *p, void *v) ...@@ -378,10 +383,11 @@ static int obd_device_list_seq_show(struct seq_file *p, void *v)
else else
status = "--"; status = "--";
return seq_printf(p, "%3d %s %s %s %s %d\n", seq_printf(p, "%3d %s %s %s %s %d\n",
(int)index, status, obd->obd_type->typ_name, (int)index, status, obd->obd_type->typ_name,
obd->obd_name, obd->obd_uuid.uuid, obd->obd_name, obd->obd_uuid.uuid,
atomic_read(&obd->obd_refcount)); atomic_read(&obd->obd_refcount));
return 0;
} }
struct seq_operations obd_device_list_sops = { struct seq_operations obd_device_list_sops = {
......
...@@ -377,7 +377,8 @@ EXPORT_SYMBOL(lprocfs_register); ...@@ -377,7 +377,8 @@ EXPORT_SYMBOL(lprocfs_register);
/* Generic callbacks */ /* Generic callbacks */
int lprocfs_rd_uint(struct seq_file *m, void *data) int lprocfs_rd_uint(struct seq_file *m, void *data)
{ {
return seq_printf(m, "%u\n", *(unsigned int *)data); seq_printf(m, "%u\n", *(unsigned int *)data);
return 0;
} }
EXPORT_SYMBOL(lprocfs_rd_uint); EXPORT_SYMBOL(lprocfs_rd_uint);
...@@ -403,7 +404,8 @@ EXPORT_SYMBOL(lprocfs_wr_uint); ...@@ -403,7 +404,8 @@ EXPORT_SYMBOL(lprocfs_wr_uint);
int lprocfs_rd_u64(struct seq_file *m, void *data) int lprocfs_rd_u64(struct seq_file *m, void *data)
{ {
return seq_printf(m, "%llu\n", *(__u64 *)data); seq_printf(m, "%llu\n", *(__u64 *)data);
return 0;
} }
EXPORT_SYMBOL(lprocfs_rd_u64); EXPORT_SYMBOL(lprocfs_rd_u64);
...@@ -411,7 +413,8 @@ int lprocfs_rd_atomic(struct seq_file *m, void *data) ...@@ -411,7 +413,8 @@ int lprocfs_rd_atomic(struct seq_file *m, void *data)
{ {
atomic_t *atom = data; atomic_t *atom = data;
LASSERT(atom != NULL); LASSERT(atom != NULL);
return seq_printf(m, "%d\n", atomic_read(atom)); seq_printf(m, "%d\n", atomic_read(atom));
return 0;
} }
EXPORT_SYMBOL(lprocfs_rd_atomic); EXPORT_SYMBOL(lprocfs_rd_atomic);
...@@ -439,7 +442,8 @@ int lprocfs_rd_uuid(struct seq_file *m, void *data) ...@@ -439,7 +442,8 @@ int lprocfs_rd_uuid(struct seq_file *m, void *data)
struct obd_device *obd = data; struct obd_device *obd = data;
LASSERT(obd != NULL); LASSERT(obd != NULL);
return seq_printf(m, "%s\n", obd->obd_uuid.uuid); seq_printf(m, "%s\n", obd->obd_uuid.uuid);
return 0;
} }
EXPORT_SYMBOL(lprocfs_rd_uuid); EXPORT_SYMBOL(lprocfs_rd_uuid);
...@@ -448,7 +452,8 @@ int lprocfs_rd_name(struct seq_file *m, void *data) ...@@ -448,7 +452,8 @@ int lprocfs_rd_name(struct seq_file *m, void *data)
struct obd_device *dev = data; struct obd_device *dev = data;
LASSERT(dev != NULL); LASSERT(dev != NULL);
return seq_printf(m, "%s\n", dev->obd_name); seq_printf(m, "%s\n", dev->obd_name);
return 0;
} }
EXPORT_SYMBOL(lprocfs_rd_name); EXPORT_SYMBOL(lprocfs_rd_name);
...@@ -924,7 +929,8 @@ int lprocfs_rd_num_exports(struct seq_file *m, void *data) ...@@ -924,7 +929,8 @@ int lprocfs_rd_num_exports(struct seq_file *m, void *data)
struct obd_device *obd = data; struct obd_device *obd = data;
LASSERT(obd != NULL); LASSERT(obd != NULL);
return seq_printf(m, "%u\n", obd->obd_num_exports); seq_printf(m, "%u\n", obd->obd_num_exports);
return 0;
} }
EXPORT_SYMBOL(lprocfs_rd_num_exports); EXPORT_SYMBOL(lprocfs_rd_num_exports);
...@@ -933,7 +939,8 @@ int lprocfs_rd_numrefs(struct seq_file *m, void *data) ...@@ -933,7 +939,8 @@ int lprocfs_rd_numrefs(struct seq_file *m, void *data)
struct obd_type *class = (struct obd_type *) data; struct obd_type *class = (struct obd_type *) data;
LASSERT(class != NULL); LASSERT(class != NULL);
return seq_printf(m, "%d\n", class->typ_refcnt); seq_printf(m, "%d\n", class->typ_refcnt);
return 0;
} }
EXPORT_SYMBOL(lprocfs_rd_numrefs); EXPORT_SYMBOL(lprocfs_rd_numrefs);
...@@ -1606,8 +1613,9 @@ LPROC_SEQ_FOPS_RO(lproc_exp_hash); ...@@ -1606,8 +1613,9 @@ LPROC_SEQ_FOPS_RO(lproc_exp_hash);
int lprocfs_nid_stats_clear_read(struct seq_file *m, void *data) int lprocfs_nid_stats_clear_read(struct seq_file *m, void *data)
{ {
return seq_printf(m, "%s\n", seq_printf(m, "%s\n",
"Write into this file to clear all nid stats and stale nid entries"); "Write into this file to clear all nid stats and stale nid entries");
return 0;
} }
EXPORT_SYMBOL(lprocfs_nid_stats_clear_read); EXPORT_SYMBOL(lprocfs_nid_stats_clear_read);
......
...@@ -2010,18 +2010,19 @@ int lu_site_stats_print(const struct lu_site *s, struct seq_file *m) ...@@ -2010,18 +2010,19 @@ int lu_site_stats_print(const struct lu_site *s, struct seq_file *m)
memset(&stats, 0, sizeof(stats)); memset(&stats, 0, sizeof(stats));
lu_site_stats_get(s->ls_obj_hash, &stats, 1); lu_site_stats_get(s->ls_obj_hash, &stats, 1);
return seq_printf(m, "%d/%d %d/%d %d %d %d %d %d %d %d\n", seq_printf(m, "%d/%d %d/%d %d %d %d %d %d %d %d\n",
stats.lss_busy, stats.lss_busy,
stats.lss_total, stats.lss_total,
stats.lss_populated, stats.lss_populated,
CFS_HASH_NHLIST(s->ls_obj_hash), CFS_HASH_NHLIST(s->ls_obj_hash),
stats.lss_max_search, stats.lss_max_search,
ls_stats_read(s->ls_stats, LU_SS_CREATED), ls_stats_read(s->ls_stats, LU_SS_CREATED),
ls_stats_read(s->ls_stats, LU_SS_CACHE_HIT), ls_stats_read(s->ls_stats, LU_SS_CACHE_HIT),
ls_stats_read(s->ls_stats, LU_SS_CACHE_MISS), ls_stats_read(s->ls_stats, LU_SS_CACHE_MISS),
ls_stats_read(s->ls_stats, LU_SS_CACHE_RACE), ls_stats_read(s->ls_stats, LU_SS_CACHE_RACE),
ls_stats_read(s->ls_stats, LU_SS_CACHE_DEATH_RACE), ls_stats_read(s->ls_stats, LU_SS_CACHE_DEATH_RACE),
ls_stats_read(s->ls_stats, LU_SS_LRU_PURGED)); ls_stats_read(s->ls_stats, LU_SS_LRU_PURGED));
return 0;
} }
EXPORT_SYMBOL(lu_site_stats_print); EXPORT_SYMBOL(lu_site_stats_print);
......
...@@ -286,8 +286,8 @@ static int osc_grant_shrink_interval_seq_show(struct seq_file *m, void *v) ...@@ -286,8 +286,8 @@ static int osc_grant_shrink_interval_seq_show(struct seq_file *m, void *v)
if (obd == NULL) if (obd == NULL)
return 0; return 0;
return seq_printf(m, "%d\n", seq_printf(m, "%d\n", obd->u.cli.cl_grant_shrink_interval);
obd->u.cli.cl_grant_shrink_interval); return 0;
} }
static ssize_t osc_grant_shrink_interval_seq_write(struct file *file, static ssize_t osc_grant_shrink_interval_seq_write(struct file *file,
...@@ -320,8 +320,8 @@ static int osc_checksum_seq_show(struct seq_file *m, void *v) ...@@ -320,8 +320,8 @@ static int osc_checksum_seq_show(struct seq_file *m, void *v)
if (obd == NULL) if (obd == NULL)
return 0; return 0;
return seq_printf(m, "%d\n", seq_printf(m, "%d\n", obd->u.cli.cl_checksum ? 1 : 0);
obd->u.cli.cl_checksum ? 1 : 0); return 0;
} }
static ssize_t osc_checksum_seq_write(struct file *file, static ssize_t osc_checksum_seq_write(struct file *file,
...@@ -402,7 +402,8 @@ static int osc_resend_count_seq_show(struct seq_file *m, void *v) ...@@ -402,7 +402,8 @@ static int osc_resend_count_seq_show(struct seq_file *m, void *v)
{ {
struct obd_device *obd = m->private; struct obd_device *obd = m->private;
return seq_printf(m, "%u\n", atomic_read(&obd->u.cli.cl_resends)); seq_printf(m, "%u\n", atomic_read(&obd->u.cli.cl_resends));
return 0;
} }
static ssize_t osc_resend_count_seq_write(struct file *file, static ssize_t osc_resend_count_seq_write(struct file *file,
...@@ -430,7 +431,8 @@ static int osc_contention_seconds_seq_show(struct seq_file *m, void *v) ...@@ -430,7 +431,8 @@ static int osc_contention_seconds_seq_show(struct seq_file *m, void *v)
struct obd_device *obd = m->private; struct obd_device *obd = m->private;
struct osc_device *od = obd2osc_dev(obd); struct osc_device *od = obd2osc_dev(obd);
return seq_printf(m, "%u\n", od->od_contention_time); seq_printf(m, "%u\n", od->od_contention_time);
return 0;
} }
static ssize_t osc_contention_seconds_seq_write(struct file *file, static ssize_t osc_contention_seconds_seq_write(struct file *file,
...@@ -450,7 +452,8 @@ static int osc_lockless_truncate_seq_show(struct seq_file *m, void *v) ...@@ -450,7 +452,8 @@ static int osc_lockless_truncate_seq_show(struct seq_file *m, void *v)
struct obd_device *obd = m->private; struct obd_device *obd = m->private;
struct osc_device *od = obd2osc_dev(obd); struct osc_device *od = obd2osc_dev(obd);
return seq_printf(m, "%u\n", od->od_lockless_truncate); seq_printf(m, "%u\n", od->od_lockless_truncate);
return 0;
} }
static ssize_t osc_lockless_truncate_seq_write(struct file *file, static ssize_t osc_lockless_truncate_seq_write(struct file *file,
...@@ -468,8 +471,9 @@ LPROC_SEQ_FOPS(osc_lockless_truncate); ...@@ -468,8 +471,9 @@ LPROC_SEQ_FOPS(osc_lockless_truncate);
static int osc_destroys_in_flight_seq_show(struct seq_file *m, void *v) static int osc_destroys_in_flight_seq_show(struct seq_file *m, void *v)
{ {
struct obd_device *obd = m->private; struct obd_device *obd = m->private;
return seq_printf(m, "%u\n",
atomic_read(&obd->u.cli.cl_destroy_in_flight)); seq_printf(m, "%u\n", atomic_read(&obd->u.cli.cl_destroy_in_flight));
return 0;
} }
LPROC_SEQ_FOPS_RO(osc_destroys_in_flight); LPROC_SEQ_FOPS_RO(osc_destroys_in_flight);
......
...@@ -267,7 +267,8 @@ ptlrpc_lprocfs_req_history_len_seq_show(struct seq_file *m, void *v) ...@@ -267,7 +267,8 @@ ptlrpc_lprocfs_req_history_len_seq_show(struct seq_file *m, void *v)
ptlrpc_service_for_each_part(svcpt, i, svc) ptlrpc_service_for_each_part(svcpt, i, svc)
total += svcpt->scp_hist_nrqbds; total += svcpt->scp_hist_nrqbds;
return seq_printf(m, "%d\n", total); seq_printf(m, "%d\n", total);
return 0;
} }
LPROC_SEQ_FOPS_RO(ptlrpc_lprocfs_req_history_len); LPROC_SEQ_FOPS_RO(ptlrpc_lprocfs_req_history_len);
...@@ -282,7 +283,8 @@ ptlrpc_lprocfs_req_history_max_seq_show(struct seq_file *m, void *n) ...@@ -282,7 +283,8 @@ ptlrpc_lprocfs_req_history_max_seq_show(struct seq_file *m, void *n)
ptlrpc_service_for_each_part(svcpt, i, svc) ptlrpc_service_for_each_part(svcpt, i, svc)
total += svc->srv_hist_nrqbds_cpt_max; total += svc->srv_hist_nrqbds_cpt_max;
return seq_printf(m, "%d\n", total); seq_printf(m, "%d\n", total);
return 0;
} }
static ssize_t static ssize_t
...@@ -327,8 +329,8 @@ ptlrpc_lprocfs_threads_min_seq_show(struct seq_file *m, void *n) ...@@ -327,8 +329,8 @@ ptlrpc_lprocfs_threads_min_seq_show(struct seq_file *m, void *n)
{ {
struct ptlrpc_service *svc = m->private; struct ptlrpc_service *svc = m->private;
return seq_printf(m, "%d\n", seq_printf(m, "%d\n", svc->srv_nthrs_cpt_init * svc->srv_ncpts);
svc->srv_nthrs_cpt_init * svc->srv_ncpts); return 0;
} }
static ssize_t static ssize_t
...@@ -371,7 +373,8 @@ ptlrpc_lprocfs_threads_started_seq_show(struct seq_file *m, void *n) ...@@ -371,7 +373,8 @@ ptlrpc_lprocfs_threads_started_seq_show(struct seq_file *m, void *n)
ptlrpc_service_for_each_part(svcpt, i, svc) ptlrpc_service_for_each_part(svcpt, i, svc)
total += svcpt->scp_nthrs_running; total += svcpt->scp_nthrs_running;
return seq_printf(m, "%d\n", total); seq_printf(m, "%d\n", total);
return 0;
} }
LPROC_SEQ_FOPS_RO(ptlrpc_lprocfs_threads_started); LPROC_SEQ_FOPS_RO(ptlrpc_lprocfs_threads_started);
...@@ -380,8 +383,8 @@ ptlrpc_lprocfs_threads_max_seq_show(struct seq_file *m, void *n) ...@@ -380,8 +383,8 @@ ptlrpc_lprocfs_threads_max_seq_show(struct seq_file *m, void *n)
{ {
struct ptlrpc_service *svc = m->private; struct ptlrpc_service *svc = m->private;
return seq_printf(m, "%d\n", seq_printf(m, "%d\n", svc->srv_nthrs_cpt_limit * svc->srv_ncpts);
svc->srv_nthrs_cpt_limit * svc->srv_ncpts); return 0;
} }
static ssize_t static ssize_t
...@@ -1026,7 +1029,8 @@ LPROC_SEQ_FOPS_RO(ptlrpc_lprocfs_timeouts); ...@@ -1026,7 +1029,8 @@ LPROC_SEQ_FOPS_RO(ptlrpc_lprocfs_timeouts);
static int ptlrpc_lprocfs_hp_ratio_seq_show(struct seq_file *m, void *v) static int ptlrpc_lprocfs_hp_ratio_seq_show(struct seq_file *m, void *v)
{ {
struct ptlrpc_service *svc = m->private; struct ptlrpc_service *svc = m->private;
return seq_printf(m, "%d", svc->srv_hpreq_ratio); seq_printf(m, "%d", svc->srv_hpreq_ratio);
return 0;
} }
static ssize_t ptlrpc_lprocfs_hp_ratio_seq_write(struct file *file, static ssize_t ptlrpc_lprocfs_hp_ratio_seq_write(struct file *file,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment