diff options
Diffstat (limited to 'fs/hpfs/dnode.c')
-rw-r--r-- | fs/hpfs/dnode.c | 42 |
1 files changed, 25 insertions, 17 deletions
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) |