Commit e00d5b5a authored by Fabian Frederick's avatar Fabian Frederick Committed by Linus Torvalds

fs/qnx6: convert printk to pr_foo()

Use current logging functions.

Coalesce formats.
Signed-off-by: default avatarFabian Frederick <fabf@skynet.be>
Cc: Joe Perches <joe@perches.com>
Cc: Kai Bankett <chaosman@ontika.net>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent b6d53b1b
...@@ -77,13 +77,12 @@ static int qnx6_dir_longfilename(struct inode *inode, ...@@ -77,13 +77,12 @@ static int qnx6_dir_longfilename(struct inode *inode,
if (de->de_size != 0xff) { if (de->de_size != 0xff) {
/* error - long filename entries always have size 0xff /* error - long filename entries always have size 0xff
in direntry */ in direntry */
printk(KERN_ERR "qnx6: invalid direntry size (%i).\n", pr_err("qnx6: invalid direntry size (%i).\n", de->de_size);
de->de_size);
return 0; return 0;
} }
lf = qnx6_longname(s, de, &page); lf = qnx6_longname(s, de, &page);
if (IS_ERR(lf)) { if (IS_ERR(lf)) {
printk(KERN_ERR "qnx6:Error reading longname\n"); pr_err("qnx6:Error reading longname\n");
return 0; return 0;
} }
...@@ -91,7 +90,7 @@ static int qnx6_dir_longfilename(struct inode *inode, ...@@ -91,7 +90,7 @@ static int qnx6_dir_longfilename(struct inode *inode,
if (lf_size > QNX6_LONG_NAME_MAX) { if (lf_size > QNX6_LONG_NAME_MAX) {
QNX6DEBUG((KERN_INFO "file %s\n", lf->lf_fname)); QNX6DEBUG((KERN_INFO "file %s\n", lf->lf_fname));
printk(KERN_ERR "qnx6:Filename too long (%i)\n", lf_size); pr_err("qnx6:Filename too long (%i)\n", lf_size);
qnx6_put_page(page); qnx6_put_page(page);
return 0; return 0;
} }
...@@ -100,7 +99,7 @@ static int qnx6_dir_longfilename(struct inode *inode, ...@@ -100,7 +99,7 @@ static int qnx6_dir_longfilename(struct inode *inode,
mmi 3g filesystem does not have that checksum */ mmi 3g filesystem does not have that checksum */
if (!test_opt(s, MMI_FS) && fs32_to_cpu(sbi, de->de_checksum) != if (!test_opt(s, MMI_FS) && fs32_to_cpu(sbi, de->de_checksum) !=
qnx6_lfile_checksum(lf->lf_fname, lf_size)) qnx6_lfile_checksum(lf->lf_fname, lf_size))
printk(KERN_INFO "qnx6: long filename checksum error.\n"); pr_info("qnx6: long filename checksum error.\n");
QNX6DEBUG((KERN_INFO "qnx6_readdir:%.*s inode:%u\n", QNX6DEBUG((KERN_INFO "qnx6_readdir:%.*s inode:%u\n",
lf_size, lf->lf_fname, de_inode)); lf_size, lf->lf_fname, de_inode));
...@@ -136,7 +135,7 @@ static int qnx6_readdir(struct file *file, struct dir_context *ctx) ...@@ -136,7 +135,7 @@ static int qnx6_readdir(struct file *file, struct dir_context *ctx)
int i = start; int i = start;
if (IS_ERR(page)) { if (IS_ERR(page)) {
printk(KERN_ERR "qnx6_readdir: read failed\n"); pr_err("qnx6_readdir: read failed\n");
ctx->pos = (n + 1) << PAGE_CACHE_SHIFT; ctx->pos = (n + 1) << PAGE_CACHE_SHIFT;
return PTR_ERR(page); return PTR_ERR(page);
} }
...@@ -259,8 +258,7 @@ unsigned qnx6_find_entry(int len, struct inode *dir, const char *name, ...@@ -259,8 +258,7 @@ unsigned qnx6_find_entry(int len, struct inode *dir, const char *name,
if (ino) if (ino)
goto found; goto found;
} else } else
printk(KERN_ERR "qnx6: undefined " pr_err("qnx6: undefined filename size in inode.\n");
"filename size in inode.\n");
} }
qnx6_put_page(page); qnx6_put_page(page);
} }
......
...@@ -87,7 +87,7 @@ static int qnx6_get_block(struct inode *inode, sector_t iblock, ...@@ -87,7 +87,7 @@ static int qnx6_get_block(struct inode *inode, sector_t iblock,
static int qnx6_check_blockptr(__fs32 ptr) static int qnx6_check_blockptr(__fs32 ptr)
{ {
if (ptr == ~(__fs32)0) { if (ptr == ~(__fs32)0) {
printk(KERN_ERR "qnx6: hit unused blockpointer.\n"); pr_err("qnx6: hit unused blockpointer.\n");
return 0; return 0;
} }
return 1; return 1;
...@@ -127,8 +127,7 @@ static unsigned qnx6_block_map(struct inode *inode, unsigned no) ...@@ -127,8 +127,7 @@ static unsigned qnx6_block_map(struct inode *inode, unsigned no)
levelptr = no >> bitdelta; levelptr = no >> bitdelta;
if (levelptr > QNX6_NO_DIRECT_POINTERS - 1) { if (levelptr > QNX6_NO_DIRECT_POINTERS - 1) {
printk(KERN_ERR "qnx6:Requested file block number (%u) too big.", pr_err("qnx6:Requested file block number (%u) too big.", no);
no);
return 0; return 0;
} }
...@@ -137,8 +136,7 @@ static unsigned qnx6_block_map(struct inode *inode, unsigned no) ...@@ -137,8 +136,7 @@ static unsigned qnx6_block_map(struct inode *inode, unsigned no)
for (i = 0; i < depth; i++) { for (i = 0; i < depth; i++) {
bh = sb_bread(s, block); bh = sb_bread(s, block);
if (!bh) { if (!bh) {
printk(KERN_ERR "qnx6:Error reading block (%u)\n", pr_err("qnx6:Error reading block (%u)\n", block);
block);
return 0; return 0;
} }
bitdelta -= ptrbits; bitdelta -= ptrbits;
...@@ -277,7 +275,7 @@ static struct buffer_head *qnx6_check_first_superblock(struct super_block *s, ...@@ -277,7 +275,7 @@ static struct buffer_head *qnx6_check_first_superblock(struct super_block *s,
start with the first superblock */ start with the first superblock */
bh = sb_bread(s, offset); bh = sb_bread(s, offset);
if (!bh) { if (!bh) {
printk(KERN_ERR "qnx6: unable to read the first superblock\n"); pr_err("qnx6: unable to read the first superblock\n");
return NULL; return NULL;
} }
sb = (struct qnx6_super_block *)bh->b_data; sb = (struct qnx6_super_block *)bh->b_data;
...@@ -292,13 +290,10 @@ static struct buffer_head *qnx6_check_first_superblock(struct super_block *s, ...@@ -292,13 +290,10 @@ static struct buffer_head *qnx6_check_first_superblock(struct super_block *s,
sbi->s_bytesex = BYTESEX_LE; sbi->s_bytesex = BYTESEX_LE;
if (!silent) { if (!silent) {
if (offset == 0) { if (offset == 0) {
printk(KERN_ERR "qnx6: wrong signature (magic)" pr_err("qnx6: wrong signature (magic) in superblock #1.\n");
" in superblock #1.\n");
} else { } else {
printk(KERN_INFO "qnx6: wrong signature (magic)" pr_info("qnx6: wrong signature (magic) at position (0x%lx) - will try alternative position (0x0000).\n",
" at position (0x%lx) - will try" offset * s->s_blocksize);
" alternative position (0x0000).\n",
offset * s->s_blocksize);
} }
} }
brelse(bh); brelse(bh);
...@@ -329,13 +324,13 @@ static int qnx6_fill_super(struct super_block *s, void *data, int silent) ...@@ -329,13 +324,13 @@ static int qnx6_fill_super(struct super_block *s, void *data, int silent)
/* Superblock always is 512 Byte long */ /* Superblock always is 512 Byte long */
if (!sb_set_blocksize(s, QNX6_SUPERBLOCK_SIZE)) { if (!sb_set_blocksize(s, QNX6_SUPERBLOCK_SIZE)) {
printk(KERN_ERR "qnx6: unable to set blocksize\n"); pr_err("qnx6: unable to set blocksize\n");
goto outnobh; goto outnobh;
} }
/* parse the mount-options */ /* parse the mount-options */
if (!qnx6_parse_options((char *) data, s)) { if (!qnx6_parse_options((char *) data, s)) {
printk(KERN_ERR "qnx6: invalid mount options.\n"); pr_err("qnx6: invalid mount options.\n");
goto outnobh; goto outnobh;
} }
if (test_opt(s, MMI_FS)) { if (test_opt(s, MMI_FS)) {
...@@ -355,7 +350,7 @@ static int qnx6_fill_super(struct super_block *s, void *data, int silent) ...@@ -355,7 +350,7 @@ static int qnx6_fill_super(struct super_block *s, void *data, int silent)
/* try again without bootblock offset */ /* try again without bootblock offset */
bh1 = qnx6_check_first_superblock(s, 0, silent); bh1 = qnx6_check_first_superblock(s, 0, silent);
if (!bh1) { if (!bh1) {
printk(KERN_ERR "qnx6: unable to read the first superblock\n"); pr_err("qnx6: unable to read the first superblock\n");
goto outnobh; goto outnobh;
} }
/* seems that no bootblock at partition start */ /* seems that no bootblock at partition start */
...@@ -370,13 +365,13 @@ static int qnx6_fill_super(struct super_block *s, void *data, int silent) ...@@ -370,13 +365,13 @@ static int qnx6_fill_super(struct super_block *s, void *data, int silent)
/* checksum check - start at byte 8 and end at byte 512 */ /* checksum check - start at byte 8 and end at byte 512 */
if (fs32_to_cpu(sbi, sb1->sb_checksum) != if (fs32_to_cpu(sbi, sb1->sb_checksum) !=
crc32_be(0, (char *)(bh1->b_data + 8), 504)) { crc32_be(0, (char *)(bh1->b_data + 8), 504)) {
printk(KERN_ERR "qnx6: superblock #1 checksum error\n"); pr_err("qnx6: superblock #1 checksum error\n");
goto out; goto out;
} }
/* set new blocksize */ /* set new blocksize */
if (!sb_set_blocksize(s, fs32_to_cpu(sbi, sb1->sb_blocksize))) { if (!sb_set_blocksize(s, fs32_to_cpu(sbi, sb1->sb_blocksize))) {
printk(KERN_ERR "qnx6: unable to set blocksize\n"); pr_err("qnx6: unable to set blocksize\n");
goto out; goto out;
} }
/* blocksize invalidates bh - pull it back in */ /* blocksize invalidates bh - pull it back in */
...@@ -398,21 +393,20 @@ static int qnx6_fill_super(struct super_block *s, void *data, int silent) ...@@ -398,21 +393,20 @@ static int qnx6_fill_super(struct super_block *s, void *data, int silent)
/* next the second superblock */ /* next the second superblock */
bh2 = sb_bread(s, offset); bh2 = sb_bread(s, offset);
if (!bh2) { if (!bh2) {
printk(KERN_ERR "qnx6: unable to read the second superblock\n"); pr_err("qnx6: unable to read the second superblock\n");
goto out; goto out;
} }
sb2 = (struct qnx6_super_block *)bh2->b_data; sb2 = (struct qnx6_super_block *)bh2->b_data;
if (fs32_to_cpu(sbi, sb2->sb_magic) != QNX6_SUPER_MAGIC) { if (fs32_to_cpu(sbi, sb2->sb_magic) != QNX6_SUPER_MAGIC) {
if (!silent) if (!silent)
printk(KERN_ERR "qnx6: wrong signature (magic)" pr_err("qnx6: wrong signature (magic) in superblock #2.\n");
" in superblock #2.\n");
goto out; goto out;
} }
/* checksum check - start at byte 8 and end at byte 512 */ /* checksum check - start at byte 8 and end at byte 512 */
if (fs32_to_cpu(sbi, sb2->sb_checksum) != if (fs32_to_cpu(sbi, sb2->sb_checksum) !=
crc32_be(0, (char *)(bh2->b_data + 8), 504)) { crc32_be(0, (char *)(bh2->b_data + 8), 504)) {
printk(KERN_ERR "qnx6: superblock #2 checksum error\n"); pr_err("qnx6: superblock #2 checksum error\n");
goto out; goto out;
} }
...@@ -422,25 +416,24 @@ static int qnx6_fill_super(struct super_block *s, void *data, int silent) ...@@ -422,25 +416,24 @@ static int qnx6_fill_super(struct super_block *s, void *data, int silent)
sbi->sb_buf = bh1; sbi->sb_buf = bh1;
sbi->sb = (struct qnx6_super_block *)bh1->b_data; sbi->sb = (struct qnx6_super_block *)bh1->b_data;
brelse(bh2); brelse(bh2);
printk(KERN_INFO "qnx6: superblock #1 active\n"); pr_info("qnx6: superblock #1 active\n");
} else { } else {
/* superblock #2 active */ /* superblock #2 active */
sbi->sb_buf = bh2; sbi->sb_buf = bh2;
sbi->sb = (struct qnx6_super_block *)bh2->b_data; sbi->sb = (struct qnx6_super_block *)bh2->b_data;
brelse(bh1); brelse(bh1);
printk(KERN_INFO "qnx6: superblock #2 active\n"); pr_info("qnx6: superblock #2 active\n");
} }
mmi_success: mmi_success:
/* sanity check - limit maximum indirect pointer levels */ /* sanity check - limit maximum indirect pointer levels */
if (sb1->Inode.levels > QNX6_PTR_MAX_LEVELS) { if (sb1->Inode.levels > QNX6_PTR_MAX_LEVELS) {
printk(KERN_ERR "qnx6: too many inode levels (max %i, sb %i)\n", pr_err("qnx6: too many inode levels (max %i, sb %i)\n",
QNX6_PTR_MAX_LEVELS, sb1->Inode.levels); QNX6_PTR_MAX_LEVELS, sb1->Inode.levels);
goto out; goto out;
} }
if (sb1->Longfile.levels > QNX6_PTR_MAX_LEVELS) { if (sb1->Longfile.levels > QNX6_PTR_MAX_LEVELS) {
printk(KERN_ERR "qnx6: too many longfilename levels" pr_err("qnx6: too many longfilename levels (max %i, sb %i)\n",
" (max %i, sb %i)\n", QNX6_PTR_MAX_LEVELS, sb1->Longfile.levels);
QNX6_PTR_MAX_LEVELS, sb1->Longfile.levels);
goto out; goto out;
} }
s->s_op = &qnx6_sops; s->s_op = &qnx6_sops;
...@@ -460,7 +453,7 @@ static int qnx6_fill_super(struct super_block *s, void *data, int silent) ...@@ -460,7 +453,7 @@ static int qnx6_fill_super(struct super_block *s, void *data, int silent)
/* prefetch root inode */ /* prefetch root inode */
root = qnx6_iget(s, QNX6_ROOT_INO); root = qnx6_iget(s, QNX6_ROOT_INO);
if (IS_ERR(root)) { if (IS_ERR(root)) {
printk(KERN_ERR "qnx6: get inode failed\n"); pr_err("qnx6: get inode failed\n");
ret = PTR_ERR(root); ret = PTR_ERR(root);
goto out2; goto out2;
} }
...@@ -474,7 +467,7 @@ static int qnx6_fill_super(struct super_block *s, void *data, int silent) ...@@ -474,7 +467,7 @@ static int qnx6_fill_super(struct super_block *s, void *data, int silent)
errmsg = qnx6_checkroot(s); errmsg = qnx6_checkroot(s);
if (errmsg != NULL) { if (errmsg != NULL) {
if (!silent) if (!silent)
printk(KERN_ERR "qnx6: %s\n", errmsg); pr_err("qnx6: %s\n", errmsg);
goto out3; goto out3;
} }
return 0; return 0;
...@@ -555,8 +548,7 @@ struct inode *qnx6_iget(struct super_block *sb, unsigned ino) ...@@ -555,8 +548,7 @@ struct inode *qnx6_iget(struct super_block *sb, unsigned ino)
inode->i_mode = 0; inode->i_mode = 0;
if (ino == 0) { if (ino == 0) {
printk(KERN_ERR "qnx6: bad inode number on dev %s: %u is " pr_err("qnx6: bad inode number on dev %s: %u is out of range\n",
"out of range\n",
sb->s_id, ino); sb->s_id, ino);
iget_failed(inode); iget_failed(inode);
return ERR_PTR(-EIO); return ERR_PTR(-EIO);
...@@ -566,8 +558,8 @@ struct inode *qnx6_iget(struct super_block *sb, unsigned ino) ...@@ -566,8 +558,8 @@ struct inode *qnx6_iget(struct super_block *sb, unsigned ino)
mapping = sbi->inodes->i_mapping; mapping = sbi->inodes->i_mapping;
page = read_mapping_page(mapping, n, NULL); page = read_mapping_page(mapping, n, NULL);
if (IS_ERR(page)) { if (IS_ERR(page)) {
printk(KERN_ERR "qnx6: major problem: unable to read inode from " pr_err("qnx6: major problem: unable to read inode from dev %s\n",
"dev %s\n", sb->s_id); sb->s_id);
iget_failed(inode); iget_failed(inode);
return ERR_CAST(page); return ERR_CAST(page);
} }
...@@ -689,7 +681,7 @@ static int __init init_qnx6_fs(void) ...@@ -689,7 +681,7 @@ static int __init init_qnx6_fs(void)
return err; return err;
} }
printk(KERN_INFO "QNX6 filesystem 1.0.0 registered.\n"); pr_info("QNX6 filesystem 1.0.0 registered.\n");
return 0; return 0;
} }
......
...@@ -44,15 +44,14 @@ struct qnx6_super_block *qnx6_mmi_fill_super(struct super_block *s, int silent) ...@@ -44,15 +44,14 @@ struct qnx6_super_block *qnx6_mmi_fill_super(struct super_block *s, int silent)
start with the first superblock */ start with the first superblock */
bh1 = sb_bread(s, 0); bh1 = sb_bread(s, 0);
if (!bh1) { if (!bh1) {
printk(KERN_ERR "qnx6: Unable to read first mmi superblock\n"); pr_err("qnx6: Unable to read first mmi superblock\n");
return NULL; return NULL;
} }
sb1 = (struct qnx6_mmi_super_block *)bh1->b_data; sb1 = (struct qnx6_mmi_super_block *)bh1->b_data;
sbi = QNX6_SB(s); sbi = QNX6_SB(s);
if (fs32_to_cpu(sbi, sb1->sb_magic) != QNX6_SUPER_MAGIC) { if (fs32_to_cpu(sbi, sb1->sb_magic) != QNX6_SUPER_MAGIC) {
if (!silent) { if (!silent) {
printk(KERN_ERR "qnx6: wrong signature (magic) in" pr_err("qnx6: wrong signature (magic) in superblock #1.\n");
" superblock #1.\n");
goto out; goto out;
} }
} }
...@@ -60,7 +59,7 @@ struct qnx6_super_block *qnx6_mmi_fill_super(struct super_block *s, int silent) ...@@ -60,7 +59,7 @@ struct qnx6_super_block *qnx6_mmi_fill_super(struct super_block *s, int silent)
/* checksum check - start at byte 8 and end at byte 512 */ /* checksum check - start at byte 8 and end at byte 512 */
if (fs32_to_cpu(sbi, sb1->sb_checksum) != if (fs32_to_cpu(sbi, sb1->sb_checksum) !=
crc32_be(0, (char *)(bh1->b_data + 8), 504)) { crc32_be(0, (char *)(bh1->b_data + 8), 504)) {
printk(KERN_ERR "qnx6: superblock #1 checksum error\n"); pr_err("qnx6: superblock #1 checksum error\n");
goto out; goto out;
} }
...@@ -70,7 +69,7 @@ struct qnx6_super_block *qnx6_mmi_fill_super(struct super_block *s, int silent) ...@@ -70,7 +69,7 @@ struct qnx6_super_block *qnx6_mmi_fill_super(struct super_block *s, int silent)
/* set new blocksize */ /* set new blocksize */
if (!sb_set_blocksize(s, fs32_to_cpu(sbi, sb1->sb_blocksize))) { if (!sb_set_blocksize(s, fs32_to_cpu(sbi, sb1->sb_blocksize))) {
printk(KERN_ERR "qnx6: unable to set blocksize\n"); pr_err("qnx6: unable to set blocksize\n");
goto out; goto out;
} }
/* blocksize invalidates bh - pull it back in */ /* blocksize invalidates bh - pull it back in */
...@@ -83,27 +82,26 @@ struct qnx6_super_block *qnx6_mmi_fill_super(struct super_block *s, int silent) ...@@ -83,27 +82,26 @@ struct qnx6_super_block *qnx6_mmi_fill_super(struct super_block *s, int silent)
/* read second superblock */ /* read second superblock */
bh2 = sb_bread(s, offset); bh2 = sb_bread(s, offset);
if (!bh2) { if (!bh2) {
printk(KERN_ERR "qnx6: unable to read the second superblock\n"); pr_err("qnx6: unable to read the second superblock\n");
goto out; goto out;
} }
sb2 = (struct qnx6_mmi_super_block *)bh2->b_data; sb2 = (struct qnx6_mmi_super_block *)bh2->b_data;
if (fs32_to_cpu(sbi, sb2->sb_magic) != QNX6_SUPER_MAGIC) { if (fs32_to_cpu(sbi, sb2->sb_magic) != QNX6_SUPER_MAGIC) {
if (!silent) if (!silent)
printk(KERN_ERR "qnx6: wrong signature (magic) in" pr_err("qnx6: wrong signature (magic) in superblock #2.\n");
" superblock #2.\n");
goto out; goto out;
} }
/* checksum check - start at byte 8 and end at byte 512 */ /* checksum check - start at byte 8 and end at byte 512 */
if (fs32_to_cpu(sbi, sb2->sb_checksum) if (fs32_to_cpu(sbi, sb2->sb_checksum)
!= crc32_be(0, (char *)(bh2->b_data + 8), 504)) { != crc32_be(0, (char *)(bh2->b_data + 8), 504)) {
printk(KERN_ERR "qnx6: superblock #1 checksum error\n"); pr_err("qnx6: superblock #1 checksum error\n");
goto out; goto out;
} }
qsb = kmalloc(sizeof(*qsb), GFP_KERNEL); qsb = kmalloc(sizeof(*qsb), GFP_KERNEL);
if (!qsb) { if (!qsb) {
printk(KERN_ERR "qnx6: unable to allocate memory.\n"); pr_err("qnx6: unable to allocate memory.\n");
goto out; goto out;
} }
...@@ -119,7 +117,7 @@ struct qnx6_super_block *qnx6_mmi_fill_super(struct super_block *s, int silent) ...@@ -119,7 +117,7 @@ struct qnx6_super_block *qnx6_mmi_fill_super(struct super_block *s, int silent)
sbi->sb_buf = bh1; sbi->sb_buf = bh1;
sbi->sb = (struct qnx6_super_block *)bh1->b_data; sbi->sb = (struct qnx6_super_block *)bh1->b_data;
brelse(bh2); brelse(bh2);
printk(KERN_INFO "qnx6: superblock #1 active\n"); pr_info("qnx6: superblock #1 active\n");
} else { } else {
/* superblock #2 active */ /* superblock #2 active */
qnx6_mmi_copy_sb(qsb, sb2); qnx6_mmi_copy_sb(qsb, sb2);
...@@ -131,7 +129,7 @@ struct qnx6_super_block *qnx6_mmi_fill_super(struct super_block *s, int silent) ...@@ -131,7 +129,7 @@ struct qnx6_super_block *qnx6_mmi_fill_super(struct super_block *s, int silent)
sbi->sb_buf = bh2; sbi->sb_buf = bh2;
sbi->sb = (struct qnx6_super_block *)bh2->b_data; sbi->sb = (struct qnx6_super_block *)bh2->b_data;
brelse(bh1); brelse(bh1);
printk(KERN_INFO "qnx6: superblock #2 active\n"); pr_info("qnx6: superblock #2 active\n");
} }
kfree(qsb); kfree(qsb);
......
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