diff options
Diffstat (limited to 'fs/jffs2/read.c')
-rw-r--r-- | fs/jffs2/read.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/fs/jffs2/read.c b/fs/jffs2/read.c index 835dc5d28055..925ec6541504 100644 --- a/fs/jffs2/read.c +++ b/fs/jffs2/read.c | |||
@@ -36,13 +36,14 @@ int jffs2_read_dnode(struct jffs2_sb_info *c, struct jffs2_inode_info *f, | |||
36 | ret = jffs2_flash_read(c, ref_offset(fd->raw), sizeof(*ri), &readlen, (char *)ri); | 36 | ret = jffs2_flash_read(c, ref_offset(fd->raw), sizeof(*ri), &readlen, (char *)ri); |
37 | if (ret) { | 37 | if (ret) { |
38 | jffs2_free_raw_inode(ri); | 38 | jffs2_free_raw_inode(ri); |
39 | printk(KERN_WARNING "Error reading node from 0x%08x: %d\n", ref_offset(fd->raw), ret); | 39 | pr_warn("Error reading node from 0x%08x: %d\n", |
40 | ref_offset(fd->raw), ret); | ||
40 | return ret; | 41 | return ret; |
41 | } | 42 | } |
42 | if (readlen != sizeof(*ri)) { | 43 | if (readlen != sizeof(*ri)) { |
43 | jffs2_free_raw_inode(ri); | 44 | jffs2_free_raw_inode(ri); |
44 | printk(KERN_WARNING "Short read from 0x%08x: wanted 0x%zx bytes, got 0x%zx\n", | 45 | pr_warn("Short read from 0x%08x: wanted 0x%zx bytes, got 0x%zx\n", |
45 | ref_offset(fd->raw), sizeof(*ri), readlen); | 46 | ref_offset(fd->raw), sizeof(*ri), readlen); |
46 | return -EIO; | 47 | return -EIO; |
47 | } | 48 | } |
48 | crc = crc32(0, ri, sizeof(*ri)-8); | 49 | crc = crc32(0, ri, sizeof(*ri)-8); |
@@ -52,8 +53,8 @@ int jffs2_read_dnode(struct jffs2_sb_info *c, struct jffs2_inode_info *f, | |||
52 | crc, je32_to_cpu(ri->dsize), je32_to_cpu(ri->csize), | 53 | crc, je32_to_cpu(ri->dsize), je32_to_cpu(ri->csize), |
53 | je32_to_cpu(ri->offset), buf); | 54 | je32_to_cpu(ri->offset), buf); |
54 | if (crc != je32_to_cpu(ri->node_crc)) { | 55 | if (crc != je32_to_cpu(ri->node_crc)) { |
55 | printk(KERN_WARNING "Node CRC %08x != calculated CRC %08x for node at %08x\n", | 56 | pr_warn("Node CRC %08x != calculated CRC %08x for node at %08x\n", |
56 | je32_to_cpu(ri->node_crc), crc, ref_offset(fd->raw)); | 57 | je32_to_cpu(ri->node_crc), crc, ref_offset(fd->raw)); |
57 | ret = -EIO; | 58 | ret = -EIO; |
58 | goto out_ri; | 59 | goto out_ri; |
59 | } | 60 | } |
@@ -66,8 +67,8 @@ int jffs2_read_dnode(struct jffs2_sb_info *c, struct jffs2_inode_info *f, | |||
66 | } | 67 | } |
67 | 68 | ||
68 | D1(if(ofs + len > je32_to_cpu(ri->dsize)) { | 69 | D1(if(ofs + len > je32_to_cpu(ri->dsize)) { |
69 | printk(KERN_WARNING "jffs2_read_dnode() asked for %d bytes at %d from %d-byte node\n", | 70 | pr_warn("jffs2_read_dnode() asked for %d bytes at %d from %d-byte node\n", |
70 | len, ofs, je32_to_cpu(ri->dsize)); | 71 | len, ofs, je32_to_cpu(ri->dsize)); |
71 | ret = -EINVAL; | 72 | ret = -EINVAL; |
72 | goto out_ri; | 73 | goto out_ri; |
73 | }); | 74 | }); |
@@ -119,8 +120,8 @@ int jffs2_read_dnode(struct jffs2_sb_info *c, struct jffs2_inode_info *f, | |||
119 | 120 | ||
120 | crc = crc32(0, readbuf, je32_to_cpu(ri->csize)); | 121 | crc = crc32(0, readbuf, je32_to_cpu(ri->csize)); |
121 | if (crc != je32_to_cpu(ri->data_crc)) { | 122 | if (crc != je32_to_cpu(ri->data_crc)) { |
122 | printk(KERN_WARNING "Data CRC %08x != calculated CRC %08x for node at %08x\n", | 123 | pr_warn("Data CRC %08x != calculated CRC %08x for node at %08x\n", |
123 | je32_to_cpu(ri->data_crc), crc, ref_offset(fd->raw)); | 124 | je32_to_cpu(ri->data_crc), crc, ref_offset(fd->raw)); |
124 | ret = -EIO; | 125 | ret = -EIO; |
125 | goto out_decomprbuf; | 126 | goto out_decomprbuf; |
126 | } | 127 | } |
@@ -131,7 +132,7 @@ int jffs2_read_dnode(struct jffs2_sb_info *c, struct jffs2_inode_info *f, | |||
131 | je32_to_cpu(ri->dsize), decomprbuf); | 132 | je32_to_cpu(ri->dsize), decomprbuf); |
132 | ret = jffs2_decompress(c, f, ri->compr | (ri->usercompr << 8), readbuf, decomprbuf, je32_to_cpu(ri->csize), je32_to_cpu(ri->dsize)); | 133 | ret = jffs2_decompress(c, f, ri->compr | (ri->usercompr << 8), readbuf, decomprbuf, je32_to_cpu(ri->csize), je32_to_cpu(ri->dsize)); |
133 | if (ret) { | 134 | if (ret) { |
134 | printk(KERN_WARNING "Error: jffs2_decompress returned %d\n", ret); | 135 | pr_warn("Error: jffs2_decompress returned %d\n", ret); |
135 | goto out_decomprbuf; | 136 | goto out_decomprbuf; |
136 | } | 137 | } |
137 | } | 138 | } |