aboutsummaryrefslogtreecommitdiffstats
path: root/fs/efs
diff options
context:
space:
mode:
Diffstat (limited to 'fs/efs')
-rw-r--r--fs/efs/dir.c8
-rw-r--r--fs/efs/file.c10
-rw-r--r--fs/efs/inode.c20
-rw-r--r--fs/efs/namei.c6
-rw-r--r--fs/efs/super.c23
5 files changed, 32 insertions, 35 deletions
diff --git a/fs/efs/dir.c b/fs/efs/dir.c
index b72307ccdf7a..46a9a607e4ac 100644
--- a/fs/efs/dir.c
+++ b/fs/efs/dir.c
@@ -26,7 +26,7 @@ static int efs_readdir(struct file *file, struct dir_context *ctx)
26 int slot; 26 int slot;
27 27
28 if (inode->i_size & (EFS_DIRBSIZE-1)) 28 if (inode->i_size & (EFS_DIRBSIZE-1))
29 printk(KERN_WARNING "EFS: WARNING: readdir(): directory size not a multiple of EFS_DIRBSIZE\n"); 29 pr_warn("EFS: WARNING: readdir(): directory size not a multiple of EFS_DIRBSIZE\n");
30 30
31 /* work out where this entry can be found */ 31 /* work out where this entry can be found */
32 block = ctx->pos >> EFS_DIRBSIZE_BITS; 32 block = ctx->pos >> EFS_DIRBSIZE_BITS;
@@ -43,14 +43,14 @@ static int efs_readdir(struct file *file, struct dir_context *ctx)
43 bh = sb_bread(inode->i_sb, efs_bmap(inode, block)); 43 bh = sb_bread(inode->i_sb, efs_bmap(inode, block));
44 44
45 if (!bh) { 45 if (!bh) {
46 printk(KERN_ERR "EFS: readdir(): failed to read dir block %d\n", block); 46 pr_err("EFS: readdir(): failed to read dir block %d\n", block);
47 break; 47 break;
48 } 48 }
49 49
50 dirblock = (struct efs_dir *) bh->b_data; 50 dirblock = (struct efs_dir *) bh->b_data;
51 51
52 if (be16_to_cpu(dirblock->magic) != EFS_DIRBLK_MAGIC) { 52 if (be16_to_cpu(dirblock->magic) != EFS_DIRBLK_MAGIC) {
53 printk(KERN_ERR "EFS: readdir(): invalid directory block\n"); 53 pr_err("EFS: readdir(): invalid directory block\n");
54 brelse(bh); 54 brelse(bh);
55 break; 55 break;
56 } 56 }
@@ -80,7 +80,7 @@ static int efs_readdir(struct file *file, struct dir_context *ctx)
80 80
81 /* sanity check */ 81 /* sanity check */
82 if (nameptr - (char *) dirblock + namelen > EFS_DIRBSIZE) { 82 if (nameptr - (char *) dirblock + namelen > EFS_DIRBSIZE) {
83 printk(KERN_WARNING "EFS: directory entry %d exceeds directory block\n", slot); 83 pr_warn("EFS: directory entry %d exceeds directory block\n", slot);
84 continue; 84 continue;
85 } 85 }
86 86
diff --git a/fs/efs/file.c b/fs/efs/file.c
index 1ccb364ffa63..a75c7100aa01 100644
--- a/fs/efs/file.c
+++ b/fs/efs/file.c
@@ -22,7 +22,7 @@ int efs_get_block(struct inode *inode, sector_t iblock,
22 /* 22 /*
23 * i have no idea why this happens as often as it does 23 * i have no idea why this happens as often as it does
24 */ 24 */
25 printk(KERN_WARNING "EFS: bmap(): block %d >= %ld (filesize %ld)\n", 25 pr_warn("EFS: bmap(): block %d >= %ld (filesize %ld)\n",
26 block, 26 block,
27 inode->i_blocks, 27 inode->i_blocks,
28 inode->i_size); 28 inode->i_size);
@@ -38,7 +38,7 @@ int efs_get_block(struct inode *inode, sector_t iblock,
38int efs_bmap(struct inode *inode, efs_block_t block) { 38int efs_bmap(struct inode *inode, efs_block_t block) {
39 39
40 if (block < 0) { 40 if (block < 0) {
41 printk(KERN_WARNING "EFS: bmap(): block < 0\n"); 41 pr_warn("EFS: bmap(): block < 0\n");
42 return 0; 42 return 0;
43 } 43 }
44 44
@@ -48,10 +48,8 @@ int efs_bmap(struct inode *inode, efs_block_t block) {
48 /* 48 /*
49 * i have no idea why this happens as often as it does 49 * i have no idea why this happens as often as it does
50 */ 50 */
51 printk(KERN_WARNING "EFS: bmap(): block %d >= %ld (filesize %ld)\n", 51 pr_warn("EFS: bmap(): block %d >= %ld (filesize %ld)\n",
52 block, 52 block, inode->i_blocks, inode->i_size);
53 inode->i_blocks,
54 inode->i_size);
55#endif 53#endif
56 return 0; 54 return 0;
57 } 55 }
diff --git a/fs/efs/inode.c b/fs/efs/inode.c
index d15ccf20f1b3..54f1cbbf48a9 100644
--- a/fs/efs/inode.c
+++ b/fs/efs/inode.c
@@ -89,7 +89,7 @@ struct inode *efs_iget(struct super_block *super, unsigned long ino)
89 89
90 bh = sb_bread(inode->i_sb, block); 90 bh = sb_bread(inode->i_sb, block);
91 if (!bh) { 91 if (!bh) {
92 printk(KERN_WARNING "EFS: bread() failed at block %d\n", block); 92 pr_warn("EFS: bread() failed at block %d\n", block);
93 goto read_inode_error; 93 goto read_inode_error;
94 } 94 }
95 95
@@ -130,7 +130,7 @@ struct inode *efs_iget(struct super_block *super, unsigned long ino)
130 for(i = 0; i < EFS_DIRECTEXTENTS; i++) { 130 for(i = 0; i < EFS_DIRECTEXTENTS; i++) {
131 extent_copy(&(efs_inode->di_u.di_extents[i]), &(in->extents[i])); 131 extent_copy(&(efs_inode->di_u.di_extents[i]), &(in->extents[i]));
132 if (i < in->numextents && in->extents[i].cooked.ex_magic != 0) { 132 if (i < in->numextents && in->extents[i].cooked.ex_magic != 0) {
133 printk(KERN_WARNING "EFS: extent %d has bad magic number in inode %lu\n", i, inode->i_ino); 133 pr_warn("EFS: extent %d has bad magic number in inode %lu\n", i, inode->i_ino);
134 brelse(bh); 134 brelse(bh);
135 goto read_inode_error; 135 goto read_inode_error;
136 } 136 }
@@ -162,7 +162,7 @@ struct inode *efs_iget(struct super_block *super, unsigned long ino)
162 init_special_inode(inode, inode->i_mode, device); 162 init_special_inode(inode, inode->i_mode, device);
163 break; 163 break;
164 default: 164 default:
165 printk(KERN_WARNING "EFS: unsupported inode mode %o\n", inode->i_mode); 165 pr_warn("EFS: unsupported inode mode %o\n", inode->i_mode);
166 goto read_inode_error; 166 goto read_inode_error;
167 break; 167 break;
168 } 168 }
@@ -171,7 +171,7 @@ struct inode *efs_iget(struct super_block *super, unsigned long ino)
171 return inode; 171 return inode;
172 172
173read_inode_error: 173read_inode_error:
174 printk(KERN_WARNING "EFS: failed to read inode %lu\n", inode->i_ino); 174 pr_warn("EFS: failed to read inode %lu\n", inode->i_ino);
175 iget_failed(inode); 175 iget_failed(inode);
176 return ERR_PTR(-EIO); 176 return ERR_PTR(-EIO);
177} 177}
@@ -216,7 +216,7 @@ efs_block_t efs_map_block(struct inode *inode, efs_block_t block) {
216 216
217 /* if we only have one extent then nothing can be found */ 217 /* if we only have one extent then nothing can be found */
218 if (in->numextents == 1) { 218 if (in->numextents == 1) {
219 printk(KERN_ERR "EFS: map_block() failed to map (1 extent)\n"); 219 pr_err("EFS: map_block() failed to map (1 extent)\n");
220 return 0; 220 return 0;
221 } 221 }
222 222
@@ -234,7 +234,7 @@ efs_block_t efs_map_block(struct inode *inode, efs_block_t block) {
234 } 234 }
235 } 235 }
236 236
237 printk(KERN_ERR "EFS: map_block() failed to map block %u (dir)\n", block); 237 pr_err("EFS: map_block() failed to map block %u (dir)\n", block);
238 return 0; 238 return 0;
239 } 239 }
240 240
@@ -262,7 +262,7 @@ efs_block_t efs_map_block(struct inode *inode, efs_block_t block) {
262 262
263 if (dirext == direxts) { 263 if (dirext == direxts) {
264 /* should never happen */ 264 /* should never happen */
265 printk(KERN_ERR "EFS: couldn't find direct extent for indirect extent %d (block %u)\n", cur, block); 265 pr_err("EFS: couldn't find direct extent for indirect extent %d (block %u)\n", cur, block);
266 if (bh) brelse(bh); 266 if (bh) brelse(bh);
267 return 0; 267 return 0;
268 } 268 }
@@ -279,7 +279,7 @@ efs_block_t efs_map_block(struct inode *inode, efs_block_t block) {
279 279
280 bh = sb_bread(inode->i_sb, iblock); 280 bh = sb_bread(inode->i_sb, iblock);
281 if (!bh) { 281 if (!bh) {
282 printk(KERN_ERR "EFS: bread() failed at block %d\n", iblock); 282 pr_err("EFS: bread() failed at block %d\n", iblock);
283 return 0; 283 return 0;
284 } 284 }
285#ifdef DEBUG 285#ifdef DEBUG
@@ -294,7 +294,7 @@ efs_block_t efs_map_block(struct inode *inode, efs_block_t block) {
294 extent_copy(&(exts[ioffset]), &ext); 294 extent_copy(&(exts[ioffset]), &ext);
295 295
296 if (ext.cooked.ex_magic != 0) { 296 if (ext.cooked.ex_magic != 0) {
297 printk(KERN_ERR "EFS: extent %d has bad magic number in block %d\n", cur, iblock); 297 pr_err("EFS: extent %d has bad magic number in block %d\n", cur, iblock);
298 if (bh) brelse(bh); 298 if (bh) brelse(bh);
299 return 0; 299 return 0;
300 } 300 }
@@ -306,7 +306,7 @@ efs_block_t efs_map_block(struct inode *inode, efs_block_t block) {
306 } 306 }
307 } 307 }
308 if (bh) brelse(bh); 308 if (bh) brelse(bh);
309 printk(KERN_ERR "EFS: map_block() failed to map block %u (indir)\n", block); 309 pr_err("EFS: map_block() failed to map block %u (indir)\n", block);
310 return 0; 310 return 0;
311} 311}
312 312
diff --git a/fs/efs/namei.c b/fs/efs/namei.c
index 96f66d213a19..527d0b914915 100644
--- a/fs/efs/namei.c
+++ b/fs/efs/namei.c
@@ -23,20 +23,20 @@ static efs_ino_t efs_find_entry(struct inode *inode, const char *name, int len)
23 efs_block_t block; 23 efs_block_t block;
24 24
25 if (inode->i_size & (EFS_DIRBSIZE-1)) 25 if (inode->i_size & (EFS_DIRBSIZE-1))
26 printk(KERN_WARNING "EFS: WARNING: find_entry(): directory size not a multiple of EFS_DIRBSIZE\n"); 26 pr_warn("EFS: WARNING: find_entry(): directory size not a multiple of EFS_DIRBSIZE\n");
27 27
28 for(block = 0; block < inode->i_blocks; block++) { 28 for(block = 0; block < inode->i_blocks; block++) {
29 29
30 bh = sb_bread(inode->i_sb, efs_bmap(inode, block)); 30 bh = sb_bread(inode->i_sb, efs_bmap(inode, block));
31 if (!bh) { 31 if (!bh) {
32 printk(KERN_ERR "EFS: find_entry(): failed to read dir block %d\n", block); 32 pr_err("EFS: find_entry(): failed to read dir block %d\n", block);
33 return 0; 33 return 0;
34 } 34 }
35 35
36 dirblock = (struct efs_dir *) bh->b_data; 36 dirblock = (struct efs_dir *) bh->b_data;
37 37
38 if (be16_to_cpu(dirblock->magic) != EFS_DIRBLK_MAGIC) { 38 if (be16_to_cpu(dirblock->magic) != EFS_DIRBLK_MAGIC) {
39 printk(KERN_ERR "EFS: find_entry(): invalid directory block\n"); 39 pr_err("EFS: find_entry(): invalid directory block\n");
40 brelse(bh); 40 brelse(bh);
41 return(0); 41 return(0);
42 } 42 }
diff --git a/fs/efs/super.c b/fs/efs/super.c
index 3befcc9f5d63..059023226d55 100644
--- a/fs/efs/super.c
+++ b/fs/efs/super.c
@@ -134,7 +134,7 @@ static const struct export_operations efs_export_ops = {
134 134
135static int __init init_efs_fs(void) { 135static int __init init_efs_fs(void) {
136 int err; 136 int err;
137 printk("EFS: "EFS_VERSION" - http://aeschi.ch.eu.org/efs/\n"); 137 pr_info("EFS: "EFS_VERSION" - http://aeschi.ch.eu.org/efs/\n");
138 err = init_inodecache(); 138 err = init_inodecache();
139 if (err) 139 if (err)
140 goto out1; 140 goto out1;
@@ -179,7 +179,7 @@ static efs_block_t efs_validate_vh(struct volume_header *vh) {
179 csum += be32_to_cpu(cs); 179 csum += be32_to_cpu(cs);
180 } 180 }
181 if (csum) { 181 if (csum) {
182 printk(KERN_INFO "EFS: SGI disklabel: checksum bad, label corrupted\n"); 182 pr_warn("EFS: SGI disklabel: checksum bad, label corrupted\n");
183 return 0; 183 return 0;
184 } 184 }
185 185
@@ -226,11 +226,10 @@ static efs_block_t efs_validate_vh(struct volume_header *vh) {
226 } 226 }
227 227
228 if (slice == -1) { 228 if (slice == -1) {
229 printk(KERN_NOTICE "EFS: partition table contained no EFS partitions\n"); 229 pr_notice("EFS: partition table contained no EFS partitions\n");
230#ifdef DEBUG 230#ifdef DEBUG
231 } else { 231 } else {
232 printk(KERN_INFO "EFS: using slice %d (type %s, offset 0x%x)\n", 232 pr_info("EFS: using slice %d (type %s, offset 0x%x)\n", slice,
233 slice,
234 (pt_entry->pt_name) ? pt_entry->pt_name : "unknown", 233 (pt_entry->pt_name) ? pt_entry->pt_name : "unknown",
235 sblock); 234 sblock);
236#endif 235#endif
@@ -268,7 +267,7 @@ static int efs_fill_super(struct super_block *s, void *d, int silent)
268 267
269 s->s_magic = EFS_SUPER_MAGIC; 268 s->s_magic = EFS_SUPER_MAGIC;
270 if (!sb_set_blocksize(s, EFS_BLOCKSIZE)) { 269 if (!sb_set_blocksize(s, EFS_BLOCKSIZE)) {
271 printk(KERN_ERR "EFS: device does not support %d byte blocks\n", 270 pr_err("EFS: device does not support %d byte blocks\n",
272 EFS_BLOCKSIZE); 271 EFS_BLOCKSIZE);
273 return -EINVAL; 272 return -EINVAL;
274 } 273 }
@@ -277,7 +276,7 @@ static int efs_fill_super(struct super_block *s, void *d, int silent)
277 bh = sb_bread(s, 0); 276 bh = sb_bread(s, 0);
278 277
279 if (!bh) { 278 if (!bh) {
280 printk(KERN_ERR "EFS: cannot read volume header\n"); 279 pr_err("EFS: cannot read volume header\n");
281 return -EINVAL; 280 return -EINVAL;
282 } 281 }
283 282
@@ -295,13 +294,13 @@ static int efs_fill_super(struct super_block *s, void *d, int silent)
295 294
296 bh = sb_bread(s, sb->fs_start + EFS_SUPER); 295 bh = sb_bread(s, sb->fs_start + EFS_SUPER);
297 if (!bh) { 296 if (!bh) {
298 printk(KERN_ERR "EFS: cannot read superblock\n"); 297 pr_err("EFS: cannot read superblock\n");
299 return -EINVAL; 298 return -EINVAL;
300 } 299 }
301 300
302 if (efs_validate_super(sb, (struct efs_super *) bh->b_data)) { 301 if (efs_validate_super(sb, (struct efs_super *) bh->b_data)) {
303#ifdef DEBUG 302#ifdef DEBUG
304 printk(KERN_WARNING "EFS: invalid superblock at block %u\n", sb->fs_start + EFS_SUPER); 303 pr_warn("EFS: invalid superblock at block %u\n", sb->fs_start + EFS_SUPER);
305#endif 304#endif
306 brelse(bh); 305 brelse(bh);
307 return -EINVAL; 306 return -EINVAL;
@@ -310,7 +309,7 @@ static int efs_fill_super(struct super_block *s, void *d, int silent)
310 309
311 if (!(s->s_flags & MS_RDONLY)) { 310 if (!(s->s_flags & MS_RDONLY)) {
312#ifdef DEBUG 311#ifdef DEBUG
313 printk(KERN_INFO "EFS: forcing read-only mode\n"); 312 pr_info("EFS: forcing read-only mode\n");
314#endif 313#endif
315 s->s_flags |= MS_RDONLY; 314 s->s_flags |= MS_RDONLY;
316 } 315 }
@@ -318,13 +317,13 @@ static int efs_fill_super(struct super_block *s, void *d, int silent)
318 s->s_export_op = &efs_export_ops; 317 s->s_export_op = &efs_export_ops;
319 root = efs_iget(s, EFS_ROOTINODE); 318 root = efs_iget(s, EFS_ROOTINODE);
320 if (IS_ERR(root)) { 319 if (IS_ERR(root)) {
321 printk(KERN_ERR "EFS: get root inode failed\n"); 320 pr_err("EFS: get root inode failed\n");
322 return PTR_ERR(root); 321 return PTR_ERR(root);
323 } 322 }
324 323
325 s->s_root = d_make_root(root); 324 s->s_root = d_make_root(root);
326 if (!(s->s_root)) { 325 if (!(s->s_root)) {
327 printk(KERN_ERR "EFS: get root dentry failed\n"); 326 pr_err("EFS: get root dentry failed\n");
328 return -ENOMEM; 327 return -ENOMEM;
329 } 328 }
330 329