aboutsummaryrefslogtreecommitdiffstats
path: root/fs/hfsplus/super.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/hfsplus/super.c')
-rw-r--r--fs/hfsplus/super.c54
1 files changed, 23 insertions, 31 deletions
diff --git a/fs/hfsplus/super.c b/fs/hfsplus/super.c
index d791780def5..7843f792a4b 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,17 +309,17 @@ 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 }
317 vhdr = HFSPLUS_SB(sb).s_vhdr; 316 vhdr = HFSPLUS_SB(sb).s_vhdr;
318 317
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 = HFSPLUS_VOLHEAD_SIG;
321 if (be16_to_cpu(vhdr->version) != HFSPLUS_CURRENT_VERSION) { 320 if (be16_to_cpu(vhdr->version) < HFSPLUS_MIN_VERSION ||
322 if (!silent) 321 be16_to_cpu(vhdr->version) > HFSPLUS_CURRENT_VERSION) {
323 printk("HFS+-fs: wrong filesystem version\n"); 322 printk(KERN_ERR "hfs: wrong filesystem version\n");
324 goto cleanup; 323 goto cleanup;
325 } 324 }
326 HFSPLUS_SB(sb).total_blocks = be32_to_cpu(vhdr->total_blocks); 325 HFSPLUS_SB(sb).total_blocks = be32_to_cpu(vhdr->total_blocks);
@@ -341,20 +340,17 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent)
341 sb->s_maxbytes = MAX_LFS_FILESIZE; 340 sb->s_maxbytes = MAX_LFS_FILESIZE;
342 341
343 if (!(vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_UNMNT))) { 342 if (!(vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_UNMNT))) {
344 if (!silent) 343 printk(KERN_WARNING "hfs: Filesystem was not cleanly unmounted, "
345 printk("HFS+-fs warning: Filesystem was not cleanly unmounted, " 344 "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; 345 sb->s_flags |= MS_RDONLY;
348 } else if (sbi->flags & HFSPLUS_SB_FORCE) { 346 } else if (sbi->flags & HFSPLUS_SB_FORCE) {
349 /* nothing */ 347 /* nothing */
350 } else if (vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_SOFTLOCK)) { 348 } else if (vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_SOFTLOCK)) {
351 if (!silent) 349 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; 350 sb->s_flags |= MS_RDONLY;
354 } else if (vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_JOURNALED)) { 351 } else if (vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_JOURNALED)) {
355 if (!silent) 352 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, " 353 "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; 354 sb->s_flags |= MS_RDONLY;
359 } 355 }
360 sbi->flags &= ~HFSPLUS_SB_FORCE; 356 sbi->flags &= ~HFSPLUS_SB_FORCE;
@@ -362,21 +358,18 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent)
362 /* Load metadata objects (B*Trees) */ 358 /* Load metadata objects (B*Trees) */
363 HFSPLUS_SB(sb).ext_tree = hfs_btree_open(sb, HFSPLUS_EXT_CNID); 359 HFSPLUS_SB(sb).ext_tree = hfs_btree_open(sb, HFSPLUS_EXT_CNID);
364 if (!HFSPLUS_SB(sb).ext_tree) { 360 if (!HFSPLUS_SB(sb).ext_tree) {
365 if (!silent) 361 printk(KERN_ERR "hfs: failed to load extents file\n");
366 printk("HFS+-fs: failed to load extents file\n");
367 goto cleanup; 362 goto cleanup;
368 } 363 }
369 HFSPLUS_SB(sb).cat_tree = hfs_btree_open(sb, HFSPLUS_CAT_CNID); 364 HFSPLUS_SB(sb).cat_tree = hfs_btree_open(sb, HFSPLUS_CAT_CNID);
370 if (!HFSPLUS_SB(sb).cat_tree) { 365 if (!HFSPLUS_SB(sb).cat_tree) {
371 if (!silent) 366 printk(KERN_ERR "hfs: failed to load catalog file\n");
372 printk("HFS+-fs: failed to load catalog file\n");
373 goto cleanup; 367 goto cleanup;
374 } 368 }
375 369
376 HFSPLUS_SB(sb).alloc_file = iget(sb, HFSPLUS_ALLOC_CNID); 370 HFSPLUS_SB(sb).alloc_file = iget(sb, HFSPLUS_ALLOC_CNID);
377 if (!HFSPLUS_SB(sb).alloc_file) { 371 if (!HFSPLUS_SB(sb).alloc_file) {
378 if (!silent) 372 printk(KERN_ERR "hfs: failed to load allocation file\n");
379 printk("HFS+-fs: failed to load allocation file\n");
380 goto cleanup; 373 goto cleanup;
381 } 374 }
382 375
@@ -384,8 +377,7 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent)
384 root = iget(sb, HFSPLUS_ROOT_CNID); 377 root = iget(sb, HFSPLUS_ROOT_CNID);
385 sb->s_root = d_alloc_root(root); 378 sb->s_root = d_alloc_root(root);
386 if (!sb->s_root) { 379 if (!sb->s_root) {
387 if (!silent) 380 printk(KERN_ERR "hfs: failed to load root directory\n");
388 printk("HFS+-fs: failed to load root directory\n");
389 iput(root); 381 iput(root);
390 goto cleanup; 382 goto cleanup;
391 } 383 }
@@ -419,7 +411,7 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent)
419 sync_dirty_buffer(HFSPLUS_SB(sb).s_vhbh); 411 sync_dirty_buffer(HFSPLUS_SB(sb).s_vhbh);
420 412
421 if (!HFSPLUS_SB(sb).hidden_dir) { 413 if (!HFSPLUS_SB(sb).hidden_dir) {
422 printk("HFS+: create hidden dir...\n"); 414 printk(KERN_DEBUG "hfs: create hidden dir...\n");
423 HFSPLUS_SB(sb).hidden_dir = hfsplus_new_inode(sb, S_IFDIR); 415 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, 416 hfsplus_create_cat(HFSPLUS_SB(sb).hidden_dir->i_ino, sb->s_root->d_inode,
425 &str, HFSPLUS_SB(sb).hidden_dir); 417 &str, HFSPLUS_SB(sb).hidden_dir);
@@ -499,7 +491,7 @@ static void __exit exit_hfsplus_fs(void)
499{ 491{
500 unregister_filesystem(&hfsplus_fs_type); 492 unregister_filesystem(&hfsplus_fs_type);
501 if (kmem_cache_destroy(hfsplus_inode_cachep)) 493 if (kmem_cache_destroy(hfsplus_inode_cachep))
502 printk(KERN_INFO "hfsplus_inode_cache: not all structures were freed\n"); 494 printk(KERN_ERR "hfsplus_inode_cache: not all structures were freed\n");
503} 495}
504 496
505module_init(init_hfsplus_fs) 497module_init(init_hfsplus_fs)