aboutsummaryrefslogtreecommitdiffstats
path: root/fs/hpfs
diff options
context:
space:
mode:
authorFabian Frederick <fabf@skynet.be>2014-06-06 17:36:34 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-06-06 19:08:10 -0400
commitb7cb1ce2205c45bf6d356cd358b52adb55bbcf5d (patch)
tree8ce78fd4de9d804015efe5e94c56f993c50db4b3 /fs/hpfs
parent45641c82c1e3aeaef72d693b24938da45ffb0cfc (diff)
fs/hpfs: convert printk to pr_foo()
No level printk in hptfs_error converted to pr_err (others to pr_warn or pr_info) This patch also fixes if/then/else checkpatch warnings Signed-off-by: Fabian Frederick <fabf@skynet.be> Cc: Mikulas Patocka <mikulas@artax.karlin.mff.cuni.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/hpfs')
-rw-r--r--fs/hpfs/alloc.c2
-rw-r--r--fs/hpfs/buffer.c12
-rw-r--r--fs/hpfs/dir.c6
-rw-r--r--fs/hpfs/dnode.c42
-rw-r--r--fs/hpfs/ea.c6
-rw-r--r--fs/hpfs/inode.c3
-rw-r--r--fs/hpfs/map.c17
-rw-r--r--fs/hpfs/name.c11
-rw-r--r--fs/hpfs/namei.c2
-rw-r--r--fs/hpfs/super.c55
10 files changed, 89 insertions, 67 deletions
diff --git a/fs/hpfs/alloc.c b/fs/hpfs/alloc.c
index 58b5106186d0..f005046e1591 100644
--- a/fs/hpfs/alloc.c
+++ b/fs/hpfs/alloc.c
@@ -316,7 +316,7 @@ void hpfs_free_sectors(struct super_block *s, secno sec, unsigned n)
316 struct quad_buffer_head qbh; 316 struct quad_buffer_head qbh;
317 __le32 *bmp; 317 __le32 *bmp;
318 struct hpfs_sb_info *sbi = hpfs_sb(s); 318 struct hpfs_sb_info *sbi = hpfs_sb(s);
319 /*printk("2 - ");*/ 319 /*pr_info("2 - ");*/
320 if (!n) return; 320 if (!n) return;
321 if (sec < 0x12) { 321 if (sec < 0x12) {
322 hpfs_error(s, "Trying to free reserved sector %08x", sec); 322 hpfs_error(s, "Trying to free reserved sector %08x", sec);
diff --git a/fs/hpfs/buffer.c b/fs/hpfs/buffer.c
index 139ef1684d07..4b61be32a91d 100644
--- a/fs/hpfs/buffer.c
+++ b/fs/hpfs/buffer.c
@@ -55,7 +55,7 @@ void *hpfs_map_sector(struct super_block *s, unsigned secno, struct buffer_head
55 if (bh != NULL) 55 if (bh != NULL)
56 return bh->b_data; 56 return bh->b_data;
57 else { 57 else {
58 printk("HPFS: hpfs_map_sector: read error\n"); 58 pr_warn("HPFS: hpfs_map_sector: read error\n");
59 return NULL; 59 return NULL;
60 } 60 }
61} 61}
@@ -76,7 +76,7 @@ void *hpfs_get_sector(struct super_block *s, unsigned secno, struct buffer_head
76 set_buffer_uptodate(bh); 76 set_buffer_uptodate(bh);
77 return bh->b_data; 77 return bh->b_data;
78 } else { 78 } else {
79 printk("HPFS: hpfs_get_sector: getblk failed\n"); 79 pr_warn("HPFS: hpfs_get_sector: getblk failed\n");
80 return NULL; 80 return NULL;
81 } 81 }
82} 82}
@@ -93,7 +93,7 @@ void *hpfs_map_4sectors(struct super_block *s, unsigned secno, struct quad_buffe
93 cond_resched(); 93 cond_resched();
94 94
95 if (secno & 3) { 95 if (secno & 3) {
96 printk("HPFS: hpfs_map_4sectors: unaligned read\n"); 96 pr_warn("HPFS: hpfs_map_4sectors: unaligned read\n");
97 return NULL; 97 return NULL;
98 } 98 }
99 99
@@ -112,7 +112,7 @@ void *hpfs_map_4sectors(struct super_block *s, unsigned secno, struct quad_buffe
112 112
113 qbh->data = data = kmalloc(2048, GFP_NOFS); 113 qbh->data = data = kmalloc(2048, GFP_NOFS);
114 if (!data) { 114 if (!data) {
115 printk("HPFS: hpfs_map_4sectors: out of memory\n"); 115 pr_warn("HPFS: hpfs_map_4sectors: out of memory\n");
116 goto bail4; 116 goto bail4;
117 } 117 }
118 118
@@ -145,7 +145,7 @@ void *hpfs_get_4sectors(struct super_block *s, unsigned secno,
145 hpfs_lock_assert(s); 145 hpfs_lock_assert(s);
146 146
147 if (secno & 3) { 147 if (secno & 3) {
148 printk("HPFS: hpfs_get_4sectors: unaligned read\n"); 148 pr_warn("HPFS: hpfs_get_4sectors: unaligned read\n");
149 return NULL; 149 return NULL;
150 } 150 }
151 151
@@ -161,7 +161,7 @@ void *hpfs_get_4sectors(struct super_block *s, unsigned secno,
161 } 161 }
162 162
163 if (!(qbh->data = kmalloc(2048, GFP_NOFS))) { 163 if (!(qbh->data = kmalloc(2048, GFP_NOFS))) {
164 printk("HPFS: hpfs_get_4sectors: out of memory\n"); 164 pr_warn("HPFS: hpfs_get_4sectors: out of memory\n");
165 goto bail4; 165 goto bail4;
166 } 166 }
167 return qbh->data; 167 return qbh->data;
diff --git a/fs/hpfs/dir.c b/fs/hpfs/dir.c
index 292b1acb9b81..11ea93637e28 100644
--- a/fs/hpfs/dir.c
+++ b/fs/hpfs/dir.c
@@ -36,7 +36,7 @@ static loff_t hpfs_dir_lseek(struct file *filp, loff_t off, int whence)
36 mutex_lock(&i->i_mutex); 36 mutex_lock(&i->i_mutex);
37 hpfs_lock(s); 37 hpfs_lock(s);
38 38
39 /*printk("dir lseek\n");*/ 39 /*pr_info("dir lseek\n");*/
40 if (new_off == 0 || new_off == 1 || new_off == 11 || new_off == 12 || new_off == 13) goto ok; 40 if (new_off == 0 || new_off == 1 || new_off == 11 || new_off == 12 || new_off == 13) goto ok;
41 pos = ((loff_t) hpfs_de_as_down_as_possible(s, hpfs_inode->i_dno) << 4) + 1; 41 pos = ((loff_t) hpfs_de_as_down_as_possible(s, hpfs_inode->i_dno) << 4) + 1;
42 while (pos != new_off) { 42 while (pos != new_off) {
@@ -51,7 +51,7 @@ ok:
51 mutex_unlock(&i->i_mutex); 51 mutex_unlock(&i->i_mutex);
52 return new_off; 52 return new_off;
53fail: 53fail:
54 /*printk("illegal lseek: %016llx\n", new_off);*/ 54 /*pr_warn("illegal lseek: %016llx\n", new_off);*/
55 hpfs_unlock(s); 55 hpfs_unlock(s);
56 mutex_unlock(&i->i_mutex); 56 mutex_unlock(&i->i_mutex);
57 return -ESPIPE; 57 return -ESPIPE;
@@ -127,7 +127,7 @@ static int hpfs_readdir(struct file *file, struct dir_context *ctx)
127 if (ctx->pos == 12) 127 if (ctx->pos == 12)
128 goto out; 128 goto out;
129 if (ctx->pos == 3 || ctx->pos == 4 || ctx->pos == 5) { 129 if (ctx->pos == 3 || ctx->pos == 4 || ctx->pos == 5) {
130 printk("HPFS: warning: pos==%d\n",(int)ctx->pos); 130 pr_warn("HPFS: warning: pos==%d\n", (int)ctx->pos);
131 goto out; 131 goto out;
132 } 132 }
133 if (ctx->pos == 0) { 133 if (ctx->pos == 0) {
diff --git a/fs/hpfs/dnode.c b/fs/hpfs/dnode.c
index 4364b2a02c5d..ff4f898ab952 100644
--- a/fs/hpfs/dnode.c
+++ b/fs/hpfs/dnode.c
@@ -17,7 +17,7 @@ static loff_t get_pos(struct dnode *d, struct hpfs_dirent *fde)
17 if (de == fde) return ((loff_t) le32_to_cpu(d->self) << 4) | (loff_t)i; 17 if (de == fde) return ((loff_t) le32_to_cpu(d->self) << 4) | (loff_t)i;
18 i++; 18 i++;
19 } 19 }
20 printk("HPFS: get_pos: not_found\n"); 20 pr_info("HPFS: get_pos: not_found\n");
21 return ((loff_t)le32_to_cpu(d->self) << 4) | (loff_t)1; 21 return ((loff_t)le32_to_cpu(d->self) << 4) | (loff_t)1;
22} 22}
23 23
@@ -32,7 +32,7 @@ void hpfs_add_pos(struct inode *inode, loff_t *pos)
32 if (hpfs_inode->i_rddir_off[i] == pos) return; 32 if (hpfs_inode->i_rddir_off[i] == pos) return;
33 if (!(i&0x0f)) { 33 if (!(i&0x0f)) {
34 if (!(ppos = kmalloc((i+0x11) * sizeof(loff_t*), GFP_NOFS))) { 34 if (!(ppos = kmalloc((i+0x11) * sizeof(loff_t*), GFP_NOFS))) {
35 printk("HPFS: out of memory for position list\n"); 35 pr_warn("HPFS: out of memory for position list\n");
36 return; 36 return;
37 } 37 }
38 if (hpfs_inode->i_rddir_off) { 38 if (hpfs_inode->i_rddir_off) {
@@ -63,7 +63,8 @@ void hpfs_del_pos(struct inode *inode, loff_t *pos)
63 } 63 }
64 return; 64 return;
65 not_f: 65 not_f:
66 /*printk("HPFS: warning: position pointer %p->%08x not found\n", pos, (int)*pos);*/ 66 /*pr_info("HPFS: warning: position pointer %p->%08x not found\n",
67 pos, (int)*pos);*/
67 return; 68 return;
68} 69}
69 70
@@ -92,8 +93,11 @@ static void hpfs_pos_ins(loff_t *p, loff_t d, loff_t c)
92{ 93{
93 if ((*p & ~0x3f) == (d & ~0x3f) && (*p & 0x3f) >= (d & 0x3f)) { 94 if ((*p & ~0x3f) == (d & ~0x3f) && (*p & 0x3f) >= (d & 0x3f)) {
94 int n = (*p & 0x3f) + c; 95 int n = (*p & 0x3f) + c;
95 if (n > 0x3f) printk("HPFS: hpfs_pos_ins: %08x + %d\n", (int)*p, (int)c >> 8); 96 if (n > 0x3f)
96 else *p = (*p & ~0x3f) | n; 97 pr_warn("HPFS: hpfs_pos_ins: %08x + %d\n",
98 (int)*p, (int)c >> 8);
99 else
100 *p = (*p & ~0x3f) | n;
97 } 101 }
98} 102}
99 103
@@ -101,8 +105,11 @@ static void hpfs_pos_del(loff_t *p, loff_t d, loff_t c)
101{ 105{
102 if ((*p & ~0x3f) == (d & ~0x3f) && (*p & 0x3f) >= (d & 0x3f)) { 106 if ((*p & ~0x3f) == (d & ~0x3f) && (*p & 0x3f) >= (d & 0x3f)) {
103 int n = (*p & 0x3f) - c; 107 int n = (*p & 0x3f) - c;
104 if (n < 1) printk("HPFS: hpfs_pos_ins: %08x - %d\n", (int)*p, (int)c >> 8); 108 if (n < 1)
105 else *p = (*p & ~0x3f) | n; 109 pr_warn("HPFS: hpfs_pos_ins: %08x - %d\n",
110 (int)*p, (int)c >> 8);
111 else
112 *p = (*p & ~0x3f) | n;
106 } 113 }
107} 114}
108 115
@@ -239,7 +246,7 @@ static int hpfs_add_to_dnode(struct inode *i, dnode_secno dno,
239 struct fnode *fnode; 246 struct fnode *fnode;
240 int c1, c2 = 0; 247 int c1, c2 = 0;
241 if (!(nname = kmalloc(256, GFP_NOFS))) { 248 if (!(nname = kmalloc(256, GFP_NOFS))) {
242 printk("HPFS: out of memory, can't add to dnode\n"); 249 pr_warn("HPFS: out of memory, can't add to dnode\n");
243 return 1; 250 return 1;
244 } 251 }
245 go_up: 252 go_up:
@@ -281,7 +288,7 @@ static int hpfs_add_to_dnode(struct inode *i, dnode_secno dno,
281 not be any error while splitting dnodes, otherwise the 288 not be any error while splitting dnodes, otherwise the
282 whole directory, not only file we're adding, would 289 whole directory, not only file we're adding, would
283 be lost. */ 290 be lost. */
284 printk("HPFS: out of memory for dnode splitting\n"); 291 pr_warn("HPFS: out of memory for dnode splitting\n");
285 hpfs_brelse4(&qbh); 292 hpfs_brelse4(&qbh);
286 kfree(nname); 293 kfree(nname);
287 return 1; 294 return 1;
@@ -597,7 +604,7 @@ static void delete_empty_dnode(struct inode *i, dnode_secno dno)
597 if (!de_next->down) goto endm; 604 if (!de_next->down) goto endm;
598 ndown = de_down_pointer(de_next); 605 ndown = de_down_pointer(de_next);
599 if (!(de_cp = kmalloc(le16_to_cpu(de->length), GFP_NOFS))) { 606 if (!(de_cp = kmalloc(le16_to_cpu(de->length), GFP_NOFS))) {
600 printk("HPFS: out of memory for dtree balancing\n"); 607 pr_warn("HPFS: out of memory for dtree balancing\n");
601 goto endm; 608 goto endm;
602 } 609 }
603 memcpy(de_cp, de, le16_to_cpu(de->length)); 610 memcpy(de_cp, de, le16_to_cpu(de->length));
@@ -612,7 +619,8 @@ static void delete_empty_dnode(struct inode *i, dnode_secno dno)
612 hpfs_brelse4(&qbh1); 619 hpfs_brelse4(&qbh1);
613 } 620 }
614 hpfs_add_to_dnode(i, ndown, de_cp->name, de_cp->namelen, de_cp, de_cp->down ? de_down_pointer(de_cp) : 0); 621 hpfs_add_to_dnode(i, ndown, de_cp->name, de_cp->namelen, de_cp, de_cp->down ? de_down_pointer(de_cp) : 0);
615 /*printk("UP-TO-DNODE: %08x (ndown = %08x, down = %08x, dno = %08x)\n", up, ndown, down, dno);*/ 622 /*pr_info("UP-TO-DNODE: %08x (ndown = %08x, down = %08x, dno = %08x)\n",
623 up, ndown, down, dno);*/
616 dno = up; 624 dno = up;
617 kfree(de_cp); 625 kfree(de_cp);
618 goto try_it_again; 626 goto try_it_again;
@@ -637,15 +645,15 @@ static void delete_empty_dnode(struct inode *i, dnode_secno dno)
637 if (!dlp && down) { 645 if (!dlp && down) {
638 if (le32_to_cpu(d1->first_free) > 2044) { 646 if (le32_to_cpu(d1->first_free) > 2044) {
639 if (hpfs_sb(i->i_sb)->sb_chk >= 2) { 647 if (hpfs_sb(i->i_sb)->sb_chk >= 2) {
640 printk("HPFS: warning: unbalanced dnode tree, see hpfs.txt 4 more info\n"); 648 pr_warn("HPFS: warning: unbalanced dnode tree, see hpfs.txt 4 more info\n");
641 printk("HPFS: warning: terminating balancing operation\n"); 649 pr_warn("HPFS: warning: terminating balancing operation\n");
642 } 650 }
643 hpfs_brelse4(&qbh1); 651 hpfs_brelse4(&qbh1);
644 goto endm; 652 goto endm;
645 } 653 }
646 if (hpfs_sb(i->i_sb)->sb_chk >= 2) { 654 if (hpfs_sb(i->i_sb)->sb_chk >= 2) {
647 printk("HPFS: warning: unbalanced dnode tree, see hpfs.txt 4 more info\n"); 655 pr_warn("HPFS: warning: unbalanced dnode tree, see hpfs.txt 4 more info\n");
648 printk("HPFS: warning: goin'on\n"); 656 pr_warn("HPFS: warning: goin'on\n");
649 } 657 }
650 le16_add_cpu(&del->length, 4); 658 le16_add_cpu(&del->length, 4);
651 del->down = 1; 659 del->down = 1;
@@ -659,7 +667,7 @@ static void delete_empty_dnode(struct inode *i, dnode_secno dno)
659 *(__le32 *) ((void *) del + le16_to_cpu(del->length) - 4) = cpu_to_le32(down); 667 *(__le32 *) ((void *) del + le16_to_cpu(del->length) - 4) = cpu_to_le32(down);
660 } else goto endm; 668 } else goto endm;
661 if (!(de_cp = kmalloc(le16_to_cpu(de_prev->length), GFP_NOFS))) { 669 if (!(de_cp = kmalloc(le16_to_cpu(de_prev->length), GFP_NOFS))) {
662 printk("HPFS: out of memory for dtree balancing\n"); 670 pr_warn("HPFS: out of memory for dtree balancing\n");
663 hpfs_brelse4(&qbh1); 671 hpfs_brelse4(&qbh1);
664 goto endm; 672 goto endm;
665 } 673 }
@@ -1000,7 +1008,7 @@ struct hpfs_dirent *map_fnode_dirent(struct super_block *s, fnode_secno fno,
1000 int d1, d2 = 0; 1008 int d1, d2 = 0;
1001 name1 = f->name; 1009 name1 = f->name;
1002 if (!(name2 = kmalloc(256, GFP_NOFS))) { 1010 if (!(name2 = kmalloc(256, GFP_NOFS))) {
1003 printk("HPFS: out of memory, can't map dirent\n"); 1011 pr_warn("HPFS: out of memory, can't map dirent\n");
1004 return NULL; 1012 return NULL;
1005 } 1013 }
1006 if (f->len <= 15) 1014 if (f->len <= 15)
diff --git a/fs/hpfs/ea.c b/fs/hpfs/ea.c
index bcaafcd2666a..6ac822ae0dc4 100644
--- a/fs/hpfs/ea.c
+++ b/fs/hpfs/ea.c
@@ -51,7 +51,7 @@ static char *get_indirect_ea(struct super_block *s, int ano, secno a, int size)
51{ 51{
52 char *ret; 52 char *ret;
53 if (!(ret = kmalloc(size + 1, GFP_NOFS))) { 53 if (!(ret = kmalloc(size + 1, GFP_NOFS))) {
54 printk("HPFS: out of memory for EA\n"); 54 pr_warn("HPFS: out of memory for EA\n");
55 return NULL; 55 return NULL;
56 } 56 }
57 if (hpfs_ea_read(s, a, ano, 0, size, ret)) { 57 if (hpfs_ea_read(s, a, ano, 0, size, ret)) {
@@ -139,7 +139,7 @@ char *hpfs_get_ea(struct super_block *s, struct fnode *fnode, char *key, int *si
139 if (ea_indirect(ea)) 139 if (ea_indirect(ea))
140 return get_indirect_ea(s, ea_in_anode(ea), ea_sec(ea), *size = ea_len(ea)); 140 return get_indirect_ea(s, ea_in_anode(ea), ea_sec(ea), *size = ea_len(ea));
141 if (!(ret = kmalloc((*size = ea_valuelen(ea)) + 1, GFP_NOFS))) { 141 if (!(ret = kmalloc((*size = ea_valuelen(ea)) + 1, GFP_NOFS))) {
142 printk("HPFS: out of memory for EA\n"); 142 pr_warn("HPFS: out of memory for EA\n");
143 return NULL; 143 return NULL;
144 } 144 }
145 memcpy(ret, ea_data(ea), ea_valuelen(ea)); 145 memcpy(ret, ea_data(ea), ea_valuelen(ea));
@@ -165,7 +165,7 @@ char *hpfs_get_ea(struct super_block *s, struct fnode *fnode, char *key, int *si
165 if (ea_indirect(ea)) 165 if (ea_indirect(ea))
166 return get_indirect_ea(s, ea_in_anode(ea), ea_sec(ea), *size = ea_len(ea)); 166 return get_indirect_ea(s, ea_in_anode(ea), ea_sec(ea), *size = ea_len(ea));
167 if (!(ret = kmalloc((*size = ea_valuelen(ea)) + 1, GFP_NOFS))) { 167 if (!(ret = kmalloc((*size = ea_valuelen(ea)) + 1, GFP_NOFS))) {
168 printk("HPFS: out of memory for EA\n"); 168 pr_warn("HPFS: out of memory for EA\n");
169 return NULL; 169 return NULL;
170 } 170 }
171 if (hpfs_ea_read(s, a, ano, pos + 4 + ea->namelen + 1, ea_valuelen(ea), ret)) { 171 if (hpfs_ea_read(s, a, ano, pos + 4 + ea->namelen + 1, ea_valuelen(ea), ret)) {
diff --git a/fs/hpfs/inode.c b/fs/hpfs/inode.c
index 50a427313835..42c29086c699 100644
--- a/fs/hpfs/inode.c
+++ b/fs/hpfs/inode.c
@@ -183,7 +183,8 @@ void hpfs_write_inode(struct inode *i)
183 struct inode *parent; 183 struct inode *parent;
184 if (i->i_ino == hpfs_sb(i->i_sb)->sb_root) return; 184 if (i->i_ino == hpfs_sb(i->i_sb)->sb_root) return;
185 if (hpfs_inode->i_rddir_off && !atomic_read(&i->i_count)) { 185 if (hpfs_inode->i_rddir_off && !atomic_read(&i->i_count)) {
186 if (*hpfs_inode->i_rddir_off) printk("HPFS: write_inode: some position still there\n"); 186 if (*hpfs_inode->i_rddir_off)
187 pr_warn("HPFS: write_inode: some position still there\n");
187 kfree(hpfs_inode->i_rddir_off); 188 kfree(hpfs_inode->i_rddir_off);
188 hpfs_inode->i_rddir_off = NULL; 189 hpfs_inode->i_rddir_off = NULL;
189 } 190 }
diff --git a/fs/hpfs/map.c b/fs/hpfs/map.c
index 3aa66ae1031e..398d7b1b99c8 100644
--- a/fs/hpfs/map.c
+++ b/fs/hpfs/map.c
@@ -65,12 +65,13 @@ unsigned char *hpfs_load_code_page(struct super_block *s, secno cps)
65 struct code_page_directory *cp = hpfs_map_sector(s, cps, &bh, 0); 65 struct code_page_directory *cp = hpfs_map_sector(s, cps, &bh, 0);
66 if (!cp) return NULL; 66 if (!cp) return NULL;
67 if (le32_to_cpu(cp->magic) != CP_DIR_MAGIC) { 67 if (le32_to_cpu(cp->magic) != CP_DIR_MAGIC) {
68 printk("HPFS: Code page directory magic doesn't match (magic = %08x)\n", le32_to_cpu(cp->magic)); 68 pr_warn("HPFS: Code page directory magic doesn't match (magic = %08x)\n",
69 le32_to_cpu(cp->magic));
69 brelse(bh); 70 brelse(bh);
70 return NULL; 71 return NULL;
71 } 72 }
72 if (!le32_to_cpu(cp->n_code_pages)) { 73 if (!le32_to_cpu(cp->n_code_pages)) {
73 printk("HPFS: n_code_pages == 0\n"); 74 pr_warn("HPFS: n_code_pages == 0\n");
74 brelse(bh); 75 brelse(bh);
75 return NULL; 76 return NULL;
76 } 77 }
@@ -79,19 +80,19 @@ unsigned char *hpfs_load_code_page(struct super_block *s, secno cps)
79 brelse(bh); 80 brelse(bh);
80 81
81 if (cpi >= 3) { 82 if (cpi >= 3) {
82 printk("HPFS: Code page index out of array\n"); 83 pr_warn("HPFS: Code page index out of array\n");
83 return NULL; 84 return NULL;
84 } 85 }
85 86
86 if (!(cpd = hpfs_map_sector(s, cpds, &bh, 0))) return NULL; 87 if (!(cpd = hpfs_map_sector(s, cpds, &bh, 0))) return NULL;
87 if (le16_to_cpu(cpd->offs[cpi]) > 0x178) { 88 if (le16_to_cpu(cpd->offs[cpi]) > 0x178) {
88 printk("HPFS: Code page index out of sector\n"); 89 pr_warn("HPFS: Code page index out of sector\n");
89 brelse(bh); 90 brelse(bh);
90 return NULL; 91 return NULL;
91 } 92 }
92 ptr = (unsigned char *)cpd + le16_to_cpu(cpd->offs[cpi]) + 6; 93 ptr = (unsigned char *)cpd + le16_to_cpu(cpd->offs[cpi]) + 6;
93 if (!(cp_table = kmalloc(256, GFP_KERNEL))) { 94 if (!(cp_table = kmalloc(256, GFP_KERNEL))) {
94 printk("HPFS: out of memory for code page table\n"); 95 pr_warn("HPFS: out of memory for code page table\n");
95 brelse(bh); 96 brelse(bh);
96 return NULL; 97 return NULL;
97 } 98 }
@@ -114,7 +115,7 @@ __le32 *hpfs_load_bitmap_directory(struct super_block *s, secno bmp)
114 int i; 115 int i;
115 __le32 *b; 116 __le32 *b;
116 if (!(b = kmalloc(n * 512, GFP_KERNEL))) { 117 if (!(b = kmalloc(n * 512, GFP_KERNEL))) {
117 printk("HPFS: can't allocate memory for bitmap directory\n"); 118 pr_warn("HPFS: can't allocate memory for bitmap directory\n");
118 return NULL; 119 return NULL;
119 } 120 }
120 for (i=0;i<n;i++) { 121 for (i=0;i<n;i++) {
@@ -281,7 +282,9 @@ struct dnode *hpfs_map_dnode(struct super_block *s, unsigned secno,
281 hpfs_error(s, "dnode %08x does not end with \\377 entry", secno); 282 hpfs_error(s, "dnode %08x does not end with \\377 entry", secno);
282 goto bail; 283 goto bail;
283 } 284 }
284 if (b == 3) printk("HPFS: warning: unbalanced dnode tree, dnode %08x; see hpfs.txt 4 more info\n", secno); 285 if (b == 3)
286 pr_warn("HPFS: warning: unbalanced dnode tree, dnode %08x; see hpfs.txt 4 more info\n",
287 secno);
285 } 288 }
286 return dnode; 289 return dnode;
287 bail: 290 bail:
diff --git a/fs/hpfs/name.c b/fs/hpfs/name.c
index 9acdf338def0..61ffd04bbf8e 100644
--- a/fs/hpfs/name.c
+++ b/fs/hpfs/name.c
@@ -56,14 +56,15 @@ unsigned char *hpfs_translate_name(struct super_block *s, unsigned char *from,
56 unsigned char *to; 56 unsigned char *to;
57 int i; 57 int i;
58 if (hpfs_sb(s)->sb_chk >= 2) if (hpfs_is_name_long(from, len) != lng) { 58 if (hpfs_sb(s)->sb_chk >= 2) if (hpfs_is_name_long(from, len) != lng) {
59 printk("HPFS: Long name flag mismatch - name "); 59 pr_warn("HPFS: Long name flag mismatch - name ");
60 for (i=0; i<len; i++) printk("%c", from[i]); 60 for (i = 0; i < len; i++)
61 printk(" misidentified as %s.\n", lng ? "short" : "long"); 61 pr_cont("%c", from[i]);
62 printk("HPFS: It's nothing serious. It could happen because of bug in OS/2.\nHPFS: Set checks=normal to disable this message.\n"); 62 pr_cont(" misidentified as %s.\n", lng ? "short" : "long");
63 pr_warn("HPFS: It's nothing serious. It could happen because of bug in OS/2.\nHPFS: Set checks=normal to disable this message.\n");
63 } 64 }
64 if (!lc) return from; 65 if (!lc) return from;
65 if (!(to = kmalloc(len, GFP_KERNEL))) { 66 if (!(to = kmalloc(len, GFP_KERNEL))) {
66 printk("HPFS: can't allocate memory for name conversion buffer\n"); 67 pr_warn("HPFS: can't allocate memory for name conversion buffer\n");
67 return from; 68 return from;
68 } 69 }
69 for (i = 0; i < len; i++) to[i] = locase(hpfs_sb(s)->sb_cp_table,from[i]); 70 for (i = 0; i < len; i++) to[i] = locase(hpfs_sb(s)->sb_cp_table,from[i]);
diff --git a/fs/hpfs/namei.c b/fs/hpfs/namei.c
index 1b39afdd86fd..d11e6ed98972 100644
--- a/fs/hpfs/namei.c
+++ b/fs/hpfs/namei.c
@@ -404,7 +404,7 @@ again:
404 d_rehash(dentry); 404 d_rehash(dentry);
405 } else { 405 } else {
406 struct iattr newattrs; 406 struct iattr newattrs;
407 /*printk("HPFS: truncating file before delete.\n");*/ 407 /*pr_info("HPFS: truncating file before delete.\n");*/
408 newattrs.ia_size = 0; 408 newattrs.ia_size = 0;
409 newattrs.ia_valid = ATTR_SIZE | ATTR_CTIME; 409 newattrs.ia_valid = ATTR_SIZE | ATTR_CTIME;
410 err = notify_change(dentry, &newattrs, NULL); 410 err = notify_change(dentry, &newattrs, NULL);
diff --git a/fs/hpfs/super.c b/fs/hpfs/super.c
index fe3463a43236..e229b3f187cf 100644
--- a/fs/hpfs/super.c
+++ b/fs/hpfs/super.c
@@ -62,22 +62,26 @@ void hpfs_error(struct super_block *s, const char *fmt, ...)
62 vsnprintf(err_buf, sizeof(err_buf), fmt, args); 62 vsnprintf(err_buf, sizeof(err_buf), fmt, args);
63 va_end(args); 63 va_end(args);
64 64
65 printk("HPFS: filesystem error: %s", err_buf); 65 pr_err("HPFS: filesystem error: %s", err_buf);
66 if (!hpfs_sb(s)->sb_was_error) { 66 if (!hpfs_sb(s)->sb_was_error) {
67 if (hpfs_sb(s)->sb_err == 2) { 67 if (hpfs_sb(s)->sb_err == 2) {
68 printk("; crashing the system because you wanted it\n"); 68 pr_cont("; crashing the system because you wanted it\n");
69 mark_dirty(s, 0); 69 mark_dirty(s, 0);
70 panic("HPFS panic"); 70 panic("HPFS panic");
71 } else if (hpfs_sb(s)->sb_err == 1) { 71 } else if (hpfs_sb(s)->sb_err == 1) {
72 if (s->s_flags & MS_RDONLY) printk("; already mounted read-only\n"); 72 if (s->s_flags & MS_RDONLY)
73 pr_cont("; already mounted read-only\n");
73 else { 74 else {
74 printk("; remounting read-only\n"); 75 pr_cont("; remounting read-only\n");
75 mark_dirty(s, 0); 76 mark_dirty(s, 0);
76 s->s_flags |= MS_RDONLY; 77 s->s_flags |= MS_RDONLY;
77 } 78 }
78 } else if (s->s_flags & MS_RDONLY) printk("; going on - but anything won't be destroyed because it's read-only\n"); 79 } else if (s->s_flags & MS_RDONLY)
79 else printk("; corrupted filesystem mounted read/write - your computer will explode within 20 seconds ... but you wanted it so!\n"); 80 pr_cont("; going on - but anything won't be destroyed because it's read-only\n");
80 } else printk("\n"); 81 else
82 pr_cont("; corrupted filesystem mounted read/write - your computer will explode within 20 seconds ... but you wanted it so!\n");
83 } else
84 pr_cont("\n");
81 hpfs_sb(s)->sb_was_error = 1; 85 hpfs_sb(s)->sb_was_error = 1;
82} 86}
83 87
@@ -292,7 +296,7 @@ static int parse_opts(char *opts, kuid_t *uid, kgid_t *gid, umode_t *umask,
292 if (!opts) 296 if (!opts)
293 return 1; 297 return 1;
294 298
295 /*printk("Parsing opts: '%s'\n",opts);*/ 299 /*pr_info("Parsing opts: '%s'\n",opts);*/
296 300
297 while ((p = strsep(&opts, ",")) != NULL) { 301 while ((p = strsep(&opts, ",")) != NULL) {
298 substring_t args[MAX_OPT_ARGS]; 302 substring_t args[MAX_OPT_ARGS];
@@ -387,7 +391,7 @@ static int parse_opts(char *opts, kuid_t *uid, kgid_t *gid, umode_t *umask,
387 391
388static inline void hpfs_help(void) 392static inline void hpfs_help(void)
389{ 393{
390 printk("\n\ 394 pr_info("\n\
391HPFS filesystem options:\n\ 395HPFS filesystem options:\n\
392 help do not mount and display this text\n\ 396 help do not mount and display this text\n\
393 uid=xxx set uid of files that don't have uid specified in eas\n\ 397 uid=xxx set uid of files that don't have uid specified in eas\n\
@@ -434,7 +438,7 @@ static int hpfs_remount_fs(struct super_block *s, int *flags, char *data)
434 438
435 if (!(o = parse_opts(data, &uid, &gid, &umask, &lowercase, 439 if (!(o = parse_opts(data, &uid, &gid, &umask, &lowercase,
436 &eas, &chk, &errs, &chkdsk, &timeshift))) { 440 &eas, &chk, &errs, &chkdsk, &timeshift))) {
437 printk("HPFS: bad mount options.\n"); 441 pr_warn("HPFS: bad mount options.\n");
438 goto out_err; 442 goto out_err;
439 } 443 }
440 if (o == 2) { 444 if (o == 2) {
@@ -442,7 +446,7 @@ static int hpfs_remount_fs(struct super_block *s, int *flags, char *data)
442 goto out_err; 446 goto out_err;
443 } 447 }
444 if (timeshift != sbi->sb_timeshift) { 448 if (timeshift != sbi->sb_timeshift) {
445 printk("HPFS: timeshift can't be changed using remount.\n"); 449 pr_warn("HPFS: timeshift can't be changed using remount.\n");
446 goto out_err; 450 goto out_err;
447 } 451 }
448 452
@@ -523,7 +527,7 @@ static int hpfs_fill_super(struct super_block *s, void *options, int silent)
523 527
524 if (!(o = parse_opts(options, &uid, &gid, &umask, &lowercase, 528 if (!(o = parse_opts(options, &uid, &gid, &umask, &lowercase,
525 &eas, &chk, &errs, &chkdsk, &timeshift))) { 529 &eas, &chk, &errs, &chkdsk, &timeshift))) {
526 printk("HPFS: bad mount options.\n"); 530 pr_warn("HPFS: bad mount options.\n");
527 goto bail0; 531 goto bail0;
528 } 532 }
529 if (o==2) { 533 if (o==2) {
@@ -542,16 +546,17 @@ static int hpfs_fill_super(struct super_block *s, void *options, int silent)
542 if (/*le16_to_cpu(bootblock->magic) != BB_MAGIC 546 if (/*le16_to_cpu(bootblock->magic) != BB_MAGIC
543 ||*/ le32_to_cpu(superblock->magic) != SB_MAGIC 547 ||*/ le32_to_cpu(superblock->magic) != SB_MAGIC
544 || le32_to_cpu(spareblock->magic) != SP_MAGIC) { 548 || le32_to_cpu(spareblock->magic) != SP_MAGIC) {
545 if (!silent) printk("HPFS: Bad magic ... probably not HPFS\n"); 549 if (!silent)
550 pr_warn("HPFS: Bad magic ... probably not HPFS\n");
546 goto bail4; 551 goto bail4;
547 } 552 }
548 553
549 /* Check version */ 554 /* Check version */
550 if (!(s->s_flags & MS_RDONLY) && 555 if (!(s->s_flags & MS_RDONLY) &&
551 superblock->funcversion != 2 && superblock->funcversion != 3) { 556 superblock->funcversion != 2 && superblock->funcversion != 3) {
552 printk("HPFS: Bad version %d,%d. Mount readonly to go around\n", 557 pr_warn("HPFS: Bad version %d,%d. Mount readonly to go around\n",
553 (int)superblock->version, (int)superblock->funcversion); 558 (int)superblock->version, (int)superblock->funcversion);
554 printk("HPFS: please try recent version of HPFS driver at http://artax.karlin.mff.cuni.cz/~mikulas/vyplody/hpfs/index-e.cgi and if it still can't understand this format, contact author - mikulas@artax.karlin.mff.cuni.cz\n"); 559 pr_warn("HPFS: please try recent version of HPFS driver at http://artax.karlin.mff.cuni.cz/~mikulas/vyplody/hpfs/index-e.cgi and if it still can't understand this format, contact author - mikulas@artax.karlin.mff.cuni.cz\n");
555 goto bail4; 560 goto bail4;
556 } 561 }
557 562
@@ -597,7 +602,7 @@ static int hpfs_fill_super(struct super_block *s, void *options, int silent)
597 /* Check for general fs errors*/ 602 /* Check for general fs errors*/
598 if (spareblock->dirty && !spareblock->old_wrote) { 603 if (spareblock->dirty && !spareblock->old_wrote) {
599 if (errs == 2) { 604 if (errs == 2) {
600 printk("HPFS: Improperly stopped, not mounted\n"); 605 pr_warn("HPFS: Improperly stopped, not mounted\n");
601 goto bail4; 606 goto bail4;
602 } 607 }
603 hpfs_error(s, "improperly stopped"); 608 hpfs_error(s, "improperly stopped");
@@ -611,22 +616,25 @@ static int hpfs_fill_super(struct super_block *s, void *options, int silent)
611 616
612 if (spareblock->hotfixes_used || spareblock->n_spares_used) { 617 if (spareblock->hotfixes_used || spareblock->n_spares_used) {
613 if (errs >= 2) { 618 if (errs >= 2) {
614 printk("HPFS: Hotfixes not supported here, try chkdsk\n"); 619 pr_warn("HPFS: Hotfixes not supported here, try chkdsk\n");
615 mark_dirty(s, 0); 620 mark_dirty(s, 0);
616 goto bail4; 621 goto bail4;
617 } 622 }
618 hpfs_error(s, "hotfixes not supported here, try chkdsk"); 623 hpfs_error(s, "hotfixes not supported here, try chkdsk");
619 if (errs == 0) printk("HPFS: Proceeding, but your filesystem will be probably corrupted by this driver...\n"); 624 if (errs == 0)
620 else printk("HPFS: This driver may read bad files or crash when operating on disk with hotfixes.\n"); 625 pr_warn("HPFS: Proceeding, but your filesystem will be probably corrupted by this driver...\n");
626 else
627 pr_warn("HPFS: This driver may read bad files or crash when operating on disk with hotfixes.\n");
621 } 628 }
622 if (le32_to_cpu(spareblock->n_dnode_spares) != le32_to_cpu(spareblock->n_dnode_spares_free)) { 629 if (le32_to_cpu(spareblock->n_dnode_spares) != le32_to_cpu(spareblock->n_dnode_spares_free)) {
623 if (errs >= 2) { 630 if (errs >= 2) {
624 printk("HPFS: Spare dnodes used, try chkdsk\n"); 631 pr_warn("HPFS: Spare dnodes used, try chkdsk\n");
625 mark_dirty(s, 0); 632 mark_dirty(s, 0);
626 goto bail4; 633 goto bail4;
627 } 634 }
628 hpfs_error(s, "warning: spare dnodes used, try chkdsk"); 635 hpfs_error(s, "warning: spare dnodes used, try chkdsk");
629 if (errs == 0) printk("HPFS: Proceeding, but your filesystem could be corrupted if you delete files or directories\n"); 636 if (errs == 0)
637 pr_warn("HPFS: Proceeding, but your filesystem could be corrupted if you delete files or directories\n");
630 } 638 }
631 if (chk) { 639 if (chk) {
632 unsigned a; 640 unsigned a;
@@ -645,12 +653,13 @@ static int hpfs_fill_super(struct super_block *s, void *options, int silent)
645 goto bail4; 653 goto bail4;
646 } 654 }
647 sbi->sb_dirband_size = a; 655 sbi->sb_dirband_size = a;
648 } else printk("HPFS: You really don't want any checks? You are crazy...\n"); 656 } else
657 pr_warn("HPFS: You really don't want any checks? You are crazy...\n");
649 658
650 /* Load code page table */ 659 /* Load code page table */
651 if (le32_to_cpu(spareblock->n_code_pages)) 660 if (le32_to_cpu(spareblock->n_code_pages))
652 if (!(sbi->sb_cp_table = hpfs_load_code_page(s, le32_to_cpu(spareblock->code_page_dir)))) 661 if (!(sbi->sb_cp_table = hpfs_load_code_page(s, le32_to_cpu(spareblock->code_page_dir))))
653 printk("HPFS: Warning: code page support is disabled\n"); 662 pr_warn("HPFS: Warning: code page support is disabled\n");
654 663
655 brelse(bh2); 664 brelse(bh2);
656 brelse(bh1); 665 brelse(bh1);