Skip to content

Commit fc554ed

Browse files
Fabian Frederickswhiteho
authored andcommitted
GFS2: global conversion to pr_foo()
-All printk(KERN_foo converted to pr_foo(). -Messages updated to fit in 80 columns. -fs_macros converted as well. -fs_printk removed. Signed-off-by: Fabian Frederick <fabf@skynet.be> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
1 parent f2113eb commit fc554ed

10 files changed

Lines changed: 48 additions & 52 deletions

File tree

‎fs/gfs2/dir.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ static int gfs2_check_dirent(struct gfs2_dirent *dent, unsigned int offset,
507507
goto error;
508508
return 0;
509509
error:
510-
printk(KERN_WARNING "gfs2_check_dirent: %s (%s)\n", msg,
510+
pr_warn("gfs2_check_dirent: %s (%s)\n", msg,
511511
first ? "first in block" : "not first in block");
512512
return -EIO;
513513
}
@@ -531,8 +531,8 @@ static int gfs2_dirent_offset(const void *buf)
531531
}
532532
return offset;
533533
wrong_type:
534-
printk(KERN_WARNING "gfs2_scan_dirent: wrong block type %u\n",
535-
be32_to_cpu(h->mh_type));
534+
pr_warn("gfs2_scan_dirent: wrong block type %u\n",
535+
be32_to_cpu(h->mh_type));
536536
return -1;
537537
}
538538

@@ -1006,7 +1006,7 @@ static int dir_split_leaf(struct inode *inode, const struct qstr *name)
10061006
len = 1 << (dip->i_depth - be16_to_cpu(oleaf->lf_depth));
10071007
half_len = len >> 1;
10081008
if (!half_len) {
1009-
printk(KERN_WARNING "i_depth %u lf_depth %u index %u\n", dip->i_depth, be16_to_cpu(oleaf->lf_depth), index);
1009+
pr_warn("i_depth %u lf_depth %u index %u\n", dip->i_depth, be16_to_cpu(oleaf->lf_depth), index);
10101010
gfs2_consist_inode(dip);
10111011
error = -EIO;
10121012
goto fail_brelse;

‎fs/gfs2/glock.c‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ static void finish_xmote(struct gfs2_glock *gl, unsigned int ret)
468468
do_xmote(gl, gh, LM_ST_UNLOCKED);
469469
break;
470470
default: /* Everything else */
471-
printk(KERN_ERR "GFS2: wanted %u got %u\n", gl->gl_target, state);
471+
pr_err("GFS2: wanted %u got %u\n", gl->gl_target, state);
472472
GLOCK_BUG_ON(gl, 1);
473473
}
474474
spin_unlock(&gl->gl_spin);
@@ -542,7 +542,7 @@ __acquires(&gl->gl_spin)
542542
/* lock_dlm */
543543
ret = sdp->sd_lockstruct.ls_ops->lm_lock(gl, target, lck_flags);
544544
if (ret) {
545-
printk(KERN_ERR "GFS2: lm_lock ret %d\n", ret);
545+
pr_err("GFS2: lm_lock ret %d\n", ret);
546546
GLOCK_BUG_ON(gl, 1);
547547
}
548548
} else { /* lock_nolock */
@@ -935,7 +935,7 @@ void gfs2_print_dbg(struct seq_file *seq, const char *fmt, ...)
935935
vaf.fmt = fmt;
936936
vaf.va = &args;
937937

938-
printk(KERN_ERR " %pV", &vaf);
938+
pr_err(" %pV", &vaf);
939939
}
940940

941941
va_end(args);
@@ -1010,13 +1010,13 @@ __acquires(&gl->gl_spin)
10101010
return;
10111011

10121012
trap_recursive:
1013-
printk(KERN_ERR "original: %pSR\n", (void *)gh2->gh_ip);
1014-
printk(KERN_ERR "pid: %d\n", pid_nr(gh2->gh_owner_pid));
1015-
printk(KERN_ERR "lock type: %d req lock state : %d\n",
1013+
pr_err("original: %pSR\n", (void *)gh2->gh_ip);
1014+
pr_err("pid: %d\n", pid_nr(gh2->gh_owner_pid));
1015+
pr_err("lock type: %d req lock state : %d\n",
10161016
gh2->gh_gl->gl_name.ln_type, gh2->gh_state);
1017-
printk(KERN_ERR "new: %pSR\n", (void *)gh->gh_ip);
1018-
printk(KERN_ERR "pid: %d\n", pid_nr(gh->gh_owner_pid));
1019-
printk(KERN_ERR "lock type: %d req lock state : %d\n",
1017+
pr_err("new: %pSR\n", (void *)gh->gh_ip);
1018+
pr_err("pid: %d\n", pid_nr(gh->gh_owner_pid));
1019+
pr_err("lock type: %d req lock state : %d\n",
10201020
gh->gh_gl->gl_name.ln_type, gh->gh_state);
10211021
gfs2_dump_glock(NULL, gl);
10221022
BUG();

‎fs/gfs2/lock_dlm.c‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ static void gdlm_bast(void *arg, int mode)
176176
gfs2_glock_cb(gl, LM_ST_SHARED);
177177
break;
178178
default:
179-
printk(KERN_ERR "unknown bast mode %d", mode);
179+
pr_err("unknown bast mode %d", mode);
180180
BUG();
181181
}
182182
}
@@ -195,7 +195,7 @@ static int make_mode(const unsigned int lmstate)
195195
case LM_ST_SHARED:
196196
return DLM_LOCK_PR;
197197
}
198-
printk(KERN_ERR "unknown LM state %d", lmstate);
198+
pr_err("unknown LM state %d", lmstate);
199199
BUG();
200200
return -1;
201201
}
@@ -308,8 +308,7 @@ static void gdlm_put_lock(struct gfs2_glock *gl)
308308
error = dlm_unlock(ls->ls_dlm, gl->gl_lksb.sb_lkid, DLM_LKF_VALBLK,
309309
NULL, gl);
310310
if (error) {
311-
printk(KERN_ERR "gdlm_unlock %x,%llx err=%d\n",
312-
gl->gl_name.ln_type,
311+
pr_err("gdlm_unlock %x,%llx err=%d\n", gl->gl_name.ln_type,
313312
(unsigned long long)gl->gl_name.ln_number, error);
314313
return;
315314
}

‎fs/gfs2/main.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ static int __init init_gfs2_fs(void)
165165

166166
gfs2_register_debugfs();
167167

168-
printk("GFS2 installed\n");
168+
pr_info("GFS2 installed\n");
169169

170170
return 0;
171171

‎fs/gfs2/ops_fstype.c‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ static int gfs2_check_sb(struct gfs2_sbd *sdp, int silent)
152152
if (sb->sb_magic != GFS2_MAGIC ||
153153
sb->sb_type != GFS2_METATYPE_SB) {
154154
if (!silent)
155-
printk(KERN_WARNING "GFS2: not a GFS2 filesystem\n");
155+
pr_warn("GFS2: not a GFS2 filesystem\n");
156156
return -EINVAL;
157157
}
158158

@@ -174,7 +174,7 @@ static void end_bio_io_page(struct bio *bio, int error)
174174
if (!error)
175175
SetPageUptodate(page);
176176
else
177-
printk(KERN_WARNING "gfs2: error %d reading superblock\n", error);
177+
pr_warn("gfs2: error %d reading superblock\n", error);
178178
unlock_page(page);
179179
}
180180

@@ -945,7 +945,7 @@ static int gfs2_lm_mount(struct gfs2_sbd *sdp, int silent)
945945
lm = &gfs2_dlm_ops;
946946
#endif
947947
} else {
948-
printk(KERN_INFO "GFS2: can't find protocol %s\n", proto);
948+
pr_info("GFS2: can't find protocol %s\n", proto);
949949
return -ENOENT;
950950
}
951951

@@ -1052,7 +1052,7 @@ static int fill_super(struct super_block *sb, struct gfs2_args *args, int silent
10521052

10531053
sdp = init_sbd(sb);
10541054
if (!sdp) {
1055-
printk(KERN_WARNING "GFS2: can't alloc struct gfs2_sbd\n");
1055+
pr_warn("GFS2: can't alloc struct gfs2_sbd\n");
10561056
return -ENOMEM;
10571057
}
10581058
sdp->sd_args = *args;
@@ -1300,7 +1300,7 @@ static struct dentry *gfs2_mount(struct file_system_type *fs_type, int flags,
13001300

13011301
error = gfs2_mount_args(&args, data);
13021302
if (error) {
1303-
printk(KERN_WARNING "GFS2: can't parse mount arguments\n");
1303+
pr_warn("GFS2: can't parse mount arguments\n");
13041304
goto error_super;
13051305
}
13061306

@@ -1350,15 +1350,15 @@ static struct dentry *gfs2_mount_meta(struct file_system_type *fs_type,
13501350

13511351
error = kern_path(dev_name, LOOKUP_FOLLOW, &path);
13521352
if (error) {
1353-
printk(KERN_WARNING "GFS2: path_lookup on %s returned error %d\n",
1353+
pr_warn("GFS2: path_lookup on %s returned error %d\n",
13541354
dev_name, error);
13551355
return ERR_PTR(error);
13561356
}
13571357
s = sget(&gfs2_fs_type, test_gfs2_super, set_meta_super, flags,
13581358
path.dentry->d_inode->i_sb->s_bdev);
13591359
path_put(&path);
13601360
if (IS_ERR(s)) {
1361-
printk(KERN_WARNING "GFS2: gfs2 mount does not exist\n");
1361+
pr_warn("GFS2: gfs2 mount does not exist\n");
13621362
return ERR_CAST(s);
13631363
}
13641364
if ((flags ^ s->s_flags) & MS_RDONLY) {

‎fs/gfs2/quota.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1081,7 +1081,7 @@ static int print_message(struct gfs2_quota_data *qd, char *type)
10811081
{
10821082
struct gfs2_sbd *sdp = qd->qd_gl->gl_sbd;
10831083

1084-
printk(KERN_INFO "GFS2: fsid=%s: quota %s for %s %u\n",
1084+
pr_info("GFS2: fsid=%s: quota %s for %s %u\n",
10851085
sdp->sd_fsname, type,
10861086
(qd->qd_id.type == USRQUOTA) ? "user" : "group",
10871087
from_kqid(&init_user_ns, qd->qd_id));

‎fs/gfs2/rgrp.c‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,11 @@ static inline void gfs2_setbit(const struct gfs2_rbm *rbm, bool do_clone,
9999
cur_state = (*byte1 >> bit) & GFS2_BIT_MASK;
100100

101101
if (unlikely(!valid_change[new_state * 4 + cur_state])) {
102-
printk(KERN_WARNING "GFS2: buf_blk = 0x%x old_state=%d, "
102+
pr_warn("GFS2: buf_blk = 0x%x old_state=%d, "
103103
"new_state=%d\n", rbm->offset, cur_state, new_state);
104-
printk(KERN_WARNING "GFS2: rgrp=0x%llx bi_start=0x%x\n",
104+
pr_warn("GFS2: rgrp=0x%llx bi_start=0x%x\n",
105105
(unsigned long long)rbm->rgd->rd_addr, bi->bi_start);
106-
printk(KERN_WARNING "GFS2: bi_offset=0x%x bi_len=0x%x\n",
106+
pr_warn("GFS2: bi_offset=0x%x bi_len=0x%x\n",
107107
bi->bi_offset, bi->bi_len);
108108
dump_stack();
109109
gfs2_consist_rgrpd(rbm->rgd);
@@ -736,11 +736,11 @@ void gfs2_clear_rgrpd(struct gfs2_sbd *sdp)
736736

737737
static void gfs2_rindex_print(const struct gfs2_rgrpd *rgd)
738738
{
739-
printk(KERN_INFO " ri_addr = %llu\n", (unsigned long long)rgd->rd_addr);
740-
printk(KERN_INFO " ri_length = %u\n", rgd->rd_length);
741-
printk(KERN_INFO " ri_data0 = %llu\n", (unsigned long long)rgd->rd_data0);
742-
printk(KERN_INFO " ri_data = %u\n", rgd->rd_data);
743-
printk(KERN_INFO " ri_bitbytes = %u\n", rgd->rd_bitbytes);
739+
pr_info(" ri_addr = %llu\n", (unsigned long long)rgd->rd_addr);
740+
pr_info(" ri_length = %u\n", rgd->rd_length);
741+
pr_info(" ri_data0 = %llu\n", (unsigned long long)rgd->rd_data0);
742+
pr_info(" ri_data = %u\n", rgd->rd_data);
743+
pr_info(" ri_bitbytes = %u\n", rgd->rd_bitbytes);
744744
}
745745

746746
/**
@@ -2278,7 +2278,7 @@ int gfs2_alloc_blocks(struct gfs2_inode *ip, u64 *bn, unsigned int *nblocks,
22782278
}
22792279
}
22802280
if (rbm.rgd->rd_free < *nblocks) {
2281-
printk(KERN_WARNING "nblocks=%u\n", *nblocks);
2281+
pr_warn("nblocks=%u\n", *nblocks);
22822282
goto rgrp_error;
22832283
}
22842284

‎fs/gfs2/super.c‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ int gfs2_mount_args(struct gfs2_args *args, char *options)
175175
break;
176176
case Opt_debug:
177177
if (args->ar_errors == GFS2_ERRORS_PANIC) {
178-
printk(KERN_WARNING "GFS2: -o debug and -o errors=panic "
178+
pr_warn("GFS2: -o debug and -o errors=panic "
179179
"are mutually exclusive.\n");
180180
return -EINVAL;
181181
}
@@ -228,29 +228,29 @@ int gfs2_mount_args(struct gfs2_args *args, char *options)
228228
case Opt_commit:
229229
rv = match_int(&tmp[0], &args->ar_commit);
230230
if (rv || args->ar_commit <= 0) {
231-
printk(KERN_WARNING "GFS2: commit mount option requires a positive numeric argument\n");
231+
pr_warn("GFS2: commit mount option requires a positive numeric argument\n");
232232
return rv ? rv : -EINVAL;
233233
}
234234
break;
235235
case Opt_statfs_quantum:
236236
rv = match_int(&tmp[0], &args->ar_statfs_quantum);
237237
if (rv || args->ar_statfs_quantum < 0) {
238-
printk(KERN_WARNING "GFS2: statfs_quantum mount option requires a non-negative numeric argument\n");
238+
pr_warn("GFS2: statfs_quantum mount option requires a non-negative numeric argument\n");
239239
return rv ? rv : -EINVAL;
240240
}
241241
break;
242242
case Opt_quota_quantum:
243243
rv = match_int(&tmp[0], &args->ar_quota_quantum);
244244
if (rv || args->ar_quota_quantum <= 0) {
245-
printk(KERN_WARNING "GFS2: quota_quantum mount option requires a positive numeric argument\n");
245+
pr_warn("GFS2: quota_quantum mount option requires a positive numeric argument\n");
246246
return rv ? rv : -EINVAL;
247247
}
248248
break;
249249
case Opt_statfs_percent:
250250
rv = match_int(&tmp[0], &args->ar_statfs_percent);
251251
if (rv || args->ar_statfs_percent < 0 ||
252252
args->ar_statfs_percent > 100) {
253-
printk(KERN_WARNING "statfs_percent mount option requires a numeric argument between 0 and 100\n");
253+
pr_warn("statfs_percent mount option requires a numeric argument between 0 and 100\n");
254254
return rv ? rv : -EINVAL;
255255
}
256256
break;
@@ -259,7 +259,7 @@ int gfs2_mount_args(struct gfs2_args *args, char *options)
259259
break;
260260
case Opt_err_panic:
261261
if (args->ar_debug) {
262-
printk(KERN_WARNING "GFS2: -o debug and -o errors=panic "
262+
pr_warn("GFS2: -o debug and -o errors=panic "
263263
"are mutually exclusive.\n");
264264
return -EINVAL;
265265
}
@@ -279,7 +279,7 @@ int gfs2_mount_args(struct gfs2_args *args, char *options)
279279
break;
280280
case Opt_error:
281281
default:
282-
printk(KERN_WARNING "GFS2: invalid mount option: %s\n", o);
282+
pr_warn("GFS2: invalid mount option: %s\n", o);
283283
return -EINVAL;
284284
}
285285
}

‎fs/gfs2/trans.c‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,10 @@ static void gfs2_log_release(struct gfs2_sbd *sdp, unsigned int blks)
9999

100100
static void gfs2_print_trans(const struct gfs2_trans *tr)
101101
{
102-
printk(KERN_WARNING "GFS2: Transaction created at: %pSR\n",
103-
(void *)tr->tr_ip);
104-
printk(KERN_WARNING "GFS2: blocks=%u revokes=%u reserved=%u touched=%u\n",
102+
pr_warn("GFS2: Transaction created at: %pSR\n", (void *)tr->tr_ip);
103+
pr_warn("GFS2: blocks=%u revokes=%u reserved=%u touched=%u\n",
105104
tr->tr_blocks, tr->tr_revokes, tr->tr_reserved, tr->tr_touched);
106-
printk(KERN_WARNING "GFS2: Buf %u/%u Databuf %u/%u Revoke %u/%u\n",
105+
pr_warn("GFS2: Buf %u/%u Databuf %u/%u Revoke %u/%u\n",
107106
tr->tr_num_buf_new, tr->tr_num_buf_rm,
108107
tr->tr_num_databuf_new, tr->tr_num_databuf_rm,
109108
tr->tr_num_revoke, tr->tr_num_revoke_rm);
@@ -232,8 +231,8 @@ static void meta_lo_add(struct gfs2_sbd *sdp, struct gfs2_bufdata *bd)
232231
set_bit(GLF_DIRTY, &bd->bd_gl->gl_flags);
233232
mh = (struct gfs2_meta_header *)bd->bd_bh->b_data;
234233
if (unlikely(mh->mh_magic != cpu_to_be32(GFS2_MAGIC))) {
235-
printk(KERN_ERR
236-
"Attempting to add uninitialised block to journal (inplace block=%lld)\n",
234+
pr_err("Attempting to add uninitialised block to journal "
235+
"(inplace block=%lld)\n",
237236
(unsigned long long)bd->bd_bh->b_blocknr);
238237
BUG();
239238
}

‎fs/gfs2/util.c‎

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ mempool_t *gfs2_page_pool __read_mostly;
3030

3131
void gfs2_assert_i(struct gfs2_sbd *sdp)
3232
{
33-
printk(KERN_EMERG "GFS2: fsid=%s: fatal assertion failed\n",
34-
sdp->sd_fsname);
33+
pr_emerg("GFS2: fsid=%s: fatal assertion failed\n", sdp->sd_fsname);
3534
}
3635

3736
int gfs2_lm_withdraw(struct gfs2_sbd *sdp, char *fmt, ...)
@@ -105,8 +104,7 @@ int gfs2_assert_warn_i(struct gfs2_sbd *sdp, char *assertion,
105104
return -2;
106105

107106
if (sdp->sd_args.ar_errors == GFS2_ERRORS_WITHDRAW)
108-
printk(KERN_WARNING
109-
"GFS2: fsid=%s: warning: assertion \"%s\" failed\n"
107+
pr_warn("GFS2: fsid=%s: warning: assertion \"%s\" failed\n"
110108
"GFS2: fsid=%s: function = %s, file = %s, line = %u\n",
111109
sdp->sd_fsname, assertion,
112110
sdp->sd_fsname, function, file, line);

0 commit comments

Comments
 (0)