aboutsummaryrefslogtreecommitdiffstats
path: root/fs/hfsplus/super.c
diff options
context:
space:
mode:
authorRoman Zippel <zippel@linux-m68k.org>2006-01-18 20:43:05 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-18 22:20:22 -0500
commit634725a92938b0f282b17cec0b007dca77adebd2 (patch)
treec4dacf0c74ae3d322c37c010ee5cada2280eccca /fs/hfsplus/super.c
parent5131cf154ad1c6e584efa58d17a469d0b80f49bd (diff)
[PATCH] hfs: cleanup HFS+ prints
Add the log level and a "hfs: " prefix to all kernel prints. (HFS and HFS+ will use the same prefix, as they share some code and could be merged at some point.) Signed-off-by: Roman Zippel <zippel@linux-m68k.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/hfsplus/super.c')
-rw-r--r--fs/hfsplus/super.c49
1 files changed, 20 insertions, 29 deletions
diff --git a/fs/hfsplus/super.c b/fs/hfsplus/super.c
index d791780def5..b712d34d458 100644
--- a/fs/hfsplus/super.c
+++ b/fs/hfsplus/super.c
@@ -169,7 +169,7 @@ static void hfsplus_write_super(struct super_block *sb)
169 block = HFSPLUS_SB(sb).blockoffset; 169 block = HFSPLUS_SB(sb).blockoffset;
170 block += (HFSPLUS_SB(sb).sect_count - 2) >> (sb->s_blocksize_bits - 9); 170 block += (HFSPLUS_SB(sb).sect_count - 2) >> (sb->s_blocksize_bits - 9);
171 offset = ((HFSPLUS_SB(sb).sect_count - 2) << 9) & (sb->s_blocksize - 1); 171 offset = ((HFSPLUS_SB(sb).sect_count - 2) << 9) & (sb->s_blocksize - 1);
172 printk("backup: %u,%u,%u,%u\n", HFSPLUS_SB(sb).blockoffset, 172 printk(KERN_DEBUG "hfs: backup: %u,%u,%u,%u\n", HFSPLUS_SB(sb).blockoffset,
173 HFSPLUS_SB(sb).sect_count, block, offset); 173 HFSPLUS_SB(sb).sect_count, block, offset);
174 bh = sb_bread(sb, block); 174 bh = sb_bread(sb, block);
175 if (bh) { 175 if (bh) {
@@ -179,7 +179,7 @@ static void hfsplus_write_super(struct super_block *sb)
179 mark_buffer_dirty(bh); 179 mark_buffer_dirty(bh);
180 brelse(bh); 180 brelse(bh);
181 } else 181 } else
182 printk("backup not found!\n"); 182 printk(KERN_WARNING "hfs: backup not found!\n");
183 } 183 }
184 } 184 }
185 HFSPLUS_SB(sb).flags &= ~HFSPLUS_SB_WRITEBACKUP; 185 HFSPLUS_SB(sb).flags &= ~HFSPLUS_SB_WRITEBACKUP;
@@ -240,18 +240,18 @@ static int hfsplus_remount(struct super_block *sb, int *flags, char *data)
240 return -EINVAL; 240 return -EINVAL;
241 241
242 if (!(vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_UNMNT))) { 242 if (!(vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_UNMNT))) {
243 printk("HFS+-fs warning: Filesystem was not cleanly unmounted, " 243 printk(KERN_WARNING "hfs: filesystem was not cleanly unmounted, "
244 "running fsck.hfsplus is recommended. leaving read-only.\n"); 244 "running fsck.hfsplus is recommended. leaving read-only.\n");
245 sb->s_flags |= MS_RDONLY; 245 sb->s_flags |= MS_RDONLY;
246 *flags |= MS_RDONLY; 246 *flags |= MS_RDONLY;
247 } else if (sbi.flags & HFSPLUS_SB_FORCE) { 247 } else if (sbi.flags & HFSPLUS_SB_FORCE) {
248 /* nothing */ 248 /* nothing */
249 } else if (vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_SOFTLOCK)) { 249 } else if (vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_SOFTLOCK)) {
250 printk("HFS+-fs: Filesystem is marked locked, leaving read-only.\n"); 250 printk(KERN_WARNING "hfs: filesystem is marked locked, leaving read-only.\n");
251 sb->s_flags |= MS_RDONLY; 251 sb->s_flags |= MS_RDONLY;
252 *flags |= MS_RDONLY; 252 *flags |= MS_RDONLY;
253 } else if (vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_JOURNALED)) { 253 } else if (vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_JOURNALED)) {
254 printk("HFS+-fs: Filesystem is marked journaled, leaving read-only.\n"); 254 printk(KERN_WARNING "hfs: filesystem is marked journaled, leaving read-only.\n");
255 sb->s_flags |= MS_RDONLY; 255 sb->s_flags |= MS_RDONLY;
256 *flags |= MS_RDONLY; 256 *flags |= MS_RDONLY;
257 } 257 }
@@ -292,8 +292,7 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent)
292 INIT_HLIST_HEAD(&sbi->rsrc_inodes); 292 INIT_HLIST_HEAD(&sbi->rsrc_inodes);
293 hfsplus_fill_defaults(sbi); 293 hfsplus_fill_defaults(sbi);
294 if (!hfsplus_parse_options(data, sbi)) { 294 if (!hfsplus_parse_options(data, sbi)) {
295 if (!silent) 295 printk(KERN_ERR "hfs: unable to parse mount options\n");
296 printk("HFS+-fs: unable to parse mount options\n");
297 err = -EINVAL; 296 err = -EINVAL;
298 goto cleanup; 297 goto cleanup;
299 } 298 }
@@ -302,7 +301,7 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent)
302 nls = sbi->nls; 301 nls = sbi->nls;
303 sbi->nls = load_nls("utf8"); 302 sbi->nls = load_nls("utf8");
304 if (!sbi->nls) { 303 if (!sbi->nls) {
305 printk("HFS+: unable to load nls for utf8\n"); 304 printk(KERN_ERR "hfs: unable to load nls for utf8\n");
306 err = -EINVAL; 305 err = -EINVAL;
307 goto cleanup; 306 goto cleanup;
308 } 307 }
@@ -310,7 +309,7 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent)
310 /* Grab the volume header */ 309 /* Grab the volume header */
311 if (hfsplus_read_wrapper(sb)) { 310 if (hfsplus_read_wrapper(sb)) {
312 if (!silent) 311 if (!silent)
313 printk("HFS+-fs: unable to find HFS+ superblock\n"); 312 printk(KERN_WARNING "hfs: unable to find HFS+ superblock\n");
314 err = -EINVAL; 313 err = -EINVAL;
315 goto cleanup; 314 goto cleanup;
316 } 315 }
@@ -319,8 +318,7 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent)
319 /* Copy parts of the volume header into the superblock */ 318 /* Copy parts of the volume header into the superblock */
320 sb->s_magic = be16_to_cpu(vhdr->signature); 319 sb->s_magic = be16_to_cpu(vhdr->signature);
321 if (be16_to_cpu(vhdr->version) != HFSPLUS_CURRENT_VERSION) { 320 if (be16_to_cpu(vhdr->version) != HFSPLUS_CURRENT_VERSION) {
322 if (!silent) 321 printk(KERN_ERR "hfs: wrong filesystem version\n");
323 printk("HFS+-fs: wrong filesystem version\n");
324 goto cleanup; 322 goto cleanup;
325 } 323 }
326 HFSPLUS_SB(sb).total_blocks = be32_to_cpu(vhdr->total_blocks); 324 HFSPLUS_SB(sb).total_blocks = be32_to_cpu(vhdr->total_blocks);
@@ -341,20 +339,17 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent)
341 sb->s_maxbytes = MAX_LFS_FILESIZE; 339 sb->s_maxbytes = MAX_LFS_FILESIZE;
342 340
343 if (!(vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_UNMNT))) { 341 if (!(vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_UNMNT))) {
344 if (!silent) 342 printk(KERN_WARNING "hfs: Filesystem was not cleanly unmounted, "
345 printk("HFS+-fs warning: Filesystem was not cleanly unmounted, " 343 "running fsck.hfsplus is recommended. mounting read-only.\n");
346 "running fsck.hfsplus is recommended. mounting read-only.\n");
347 sb->s_flags |= MS_RDONLY; 344 sb->s_flags |= MS_RDONLY;
348 } else if (sbi->flags & HFSPLUS_SB_FORCE) { 345 } else if (sbi->flags & HFSPLUS_SB_FORCE) {
349 /* nothing */ 346 /* nothing */
350 } else if (vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_SOFTLOCK)) { 347 } else if (vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_SOFTLOCK)) {
351 if (!silent) 348 printk(KERN_WARNING "hfs: Filesystem is marked locked, mounting read-only.\n");
352 printk("HFS+-fs: Filesystem is marked locked, mounting read-only.\n");
353 sb->s_flags |= MS_RDONLY; 349 sb->s_flags |= MS_RDONLY;
354 } else if (vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_JOURNALED)) { 350 } else if (vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_JOURNALED)) {
355 if (!silent) 351 printk(KERN_WARNING "hfs: write access to a jounaled filesystem is not supported, "
356 printk("HFS+-fs: write access to a jounaled filesystem is not supported, " 352 "use the force option at your own risk, mounting read-only.\n");
357 "use the force option at your own risk, mounting read-only.\n");
358 sb->s_flags |= MS_RDONLY; 353 sb->s_flags |= MS_RDONLY;
359 } 354 }
360 sbi->flags &= ~HFSPLUS_SB_FORCE; 355 sbi->flags &= ~HFSPLUS_SB_FORCE;
@@ -362,21 +357,18 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent)
362 /* Load metadata objects (B*Trees) */ 357 /* Load metadata objects (B*Trees) */
363 HFSPLUS_SB(sb).ext_tree = hfs_btree_open(sb, HFSPLUS_EXT_CNID); 358 HFSPLUS_SB(sb).ext_tree = hfs_btree_open(sb, HFSPLUS_EXT_CNID);
364 if (!HFSPLUS_SB(sb).ext_tree) { 359 if (!HFSPLUS_SB(sb).ext_tree) {
365 if (!silent) 360 printk(KERN_ERR "hfs: failed to load extents file\n");
366 printk("HFS+-fs: failed to load extents file\n");
367 goto cleanup; 361 goto cleanup;
368 } 362 }
369 HFSPLUS_SB(sb).cat_tree = hfs_btree_open(sb, HFSPLUS_CAT_CNID); 363 HFSPLUS_SB(sb).cat_tree = hfs_btree_open(sb, HFSPLUS_CAT_CNID);
370 if (!HFSPLUS_SB(sb).cat_tree) { 364 if (!HFSPLUS_SB(sb).cat_tree) {
371 if (!silent) 365 printk(KERN_ERR "hfs: failed to load catalog file\n");
372 printk("HFS+-fs: failed to load catalog file\n");
373 goto cleanup; 366 goto cleanup;
374 } 367 }
375 368
376 HFSPLUS_SB(sb).alloc_file = iget(sb, HFSPLUS_ALLOC_CNID); 369 HFSPLUS_SB(sb).alloc_file = iget(sb, HFSPLUS_ALLOC_CNID);
377 if (!HFSPLUS_SB(sb).alloc_file) { 370 if (!HFSPLUS_SB(sb).alloc_file) {
378 if (!silent) 371 printk(KERN_ERR "hfs: failed to load allocation file\n");
379 printk("HFS+-fs: failed to load allocation file\n");
380 goto cleanup; 372 goto cleanup;
381 } 373 }
382 374
@@ -384,8 +376,7 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent)
384 root = iget(sb, HFSPLUS_ROOT_CNID); 376 root = iget(sb, HFSPLUS_ROOT_CNID);
385 sb->s_root = d_alloc_root(root); 377 sb->s_root = d_alloc_root(root);
386 if (!sb->s_root) { 378 if (!sb->s_root) {
387 if (!silent) 379 printk(KERN_ERR "hfs: failed to load root directory\n");
388 printk("HFS+-fs: failed to load root directory\n");
389 iput(root); 380 iput(root);
390 goto cleanup; 381 goto cleanup;
391 } 382 }
@@ -419,7 +410,7 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent)
419 sync_dirty_buffer(HFSPLUS_SB(sb).s_vhbh); 410 sync_dirty_buffer(HFSPLUS_SB(sb).s_vhbh);
420 411
421 if (!HFSPLUS_SB(sb).hidden_dir) { 412 if (!HFSPLUS_SB(sb).hidden_dir) {
422 printk("HFS+: create hidden dir...\n"); 413 printk(KERN_DEBUG "hfs: create hidden dir...\n");
423 HFSPLUS_SB(sb).hidden_dir = hfsplus_new_inode(sb, S_IFDIR); 414 HFSPLUS_SB(sb).hidden_dir = hfsplus_new_inode(sb, S_IFDIR);
424 hfsplus_create_cat(HFSPLUS_SB(sb).hidden_dir->i_ino, sb->s_root->d_inode, 415 hfsplus_create_cat(HFSPLUS_SB(sb).hidden_dir->i_ino, sb->s_root->d_inode,
425 &str, HFSPLUS_SB(sb).hidden_dir); 416 &str, HFSPLUS_SB(sb).hidden_dir);
@@ -499,7 +490,7 @@ static void __exit exit_hfsplus_fs(void)
499{ 490{
500 unregister_filesystem(&hfsplus_fs_type); 491 unregister_filesystem(&hfsplus_fs_type);
501 if (kmem_cache_destroy(hfsplus_inode_cachep)) 492 if (kmem_cache_destroy(hfsplus_inode_cachep))
502 printk(KERN_INFO "hfsplus_inode_cache: not all structures were freed\n"); 493 printk(KERN_ERR "hfsplus_inode_cache: not all structures were freed\n");
503} 494}
504 495
505module_init(init_hfsplus_fs) 496module_init(init_hfsplus_fs)