Commit 634725a9 authored by Roman Zippel's avatar Roman Zippel Committed by Linus Torvalds

[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: default avatarRoman Zippel <zippel@linux-m68k.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 5131cf15
...@@ -64,7 +64,6 @@ int __hfs_brec_find(struct hfs_bnode *bnode, struct hfs_find_data *fd) ...@@ -64,7 +64,6 @@ int __hfs_brec_find(struct hfs_bnode *bnode, struct hfs_find_data *fd)
else else
e = rec - 1; e = rec - 1;
} while (b <= e); } while (b <= e);
//printk("%d: %d,%d,%d\n", bnode->this, b, e, rec);
if (rec != e && e >= 0) { if (rec != e && e >= 0) {
len = hfs_brec_lenoff(bnode, e, &off); len = hfs_brec_lenoff(bnode, e, &off);
keylen = hfs_brec_keylen(bnode, e); keylen = hfs_brec_keylen(bnode, e);
...@@ -127,7 +126,7 @@ int hfs_brec_find(struct hfs_find_data *fd) ...@@ -127,7 +126,7 @@ int hfs_brec_find(struct hfs_find_data *fd)
return res; return res;
invalid: invalid:
printk("HFS+-fs: inconsistency in B*Tree (%d,%d,%d,%u,%u)\n", printk(KERN_ERR "hfs: inconsistency in B*Tree (%d,%d,%d,%u,%u)\n",
height, bnode->height, bnode->type, nidx, parent); height, bnode->height, bnode->type, nidx, parent);
res = -EIO; res = -EIO;
release: release:
......
...@@ -358,7 +358,7 @@ void hfs_bnode_unlink(struct hfs_bnode *node) ...@@ -358,7 +358,7 @@ void hfs_bnode_unlink(struct hfs_bnode *node)
// move down? // move down?
if (!node->prev && !node->next) { if (!node->prev && !node->next) {
printk("hfs_btree_del_level\n"); printk(KERN_DEBUG "hfs_btree_del_level\n");
} }
if (!node->parent) { if (!node->parent) {
tree->root = 0; tree->root = 0;
...@@ -379,7 +379,7 @@ struct hfs_bnode *hfs_bnode_findhash(struct hfs_btree *tree, u32 cnid) ...@@ -379,7 +379,7 @@ struct hfs_bnode *hfs_bnode_findhash(struct hfs_btree *tree, u32 cnid)
struct hfs_bnode *node; struct hfs_bnode *node;
if (cnid >= tree->node_count) { if (cnid >= tree->node_count) {
printk("HFS+-fs: request for non-existent node %d in B*Tree\n", cnid); printk(KERN_ERR "hfs: request for non-existent node %d in B*Tree\n", cnid);
return NULL; return NULL;
} }
...@@ -402,7 +402,7 @@ static struct hfs_bnode *__hfs_bnode_create(struct hfs_btree *tree, u32 cnid) ...@@ -402,7 +402,7 @@ static struct hfs_bnode *__hfs_bnode_create(struct hfs_btree *tree, u32 cnid)
loff_t off; loff_t off;
if (cnid >= tree->node_count) { if (cnid >= tree->node_count) {
printk("HFS+-fs: request for non-existent node %d in B*Tree\n", cnid); printk(KERN_ERR "hfs: request for non-existent node %d in B*Tree\n", cnid);
return NULL; return NULL;
} }
...@@ -576,8 +576,9 @@ struct hfs_bnode *hfs_bnode_create(struct hfs_btree *tree, u32 num) ...@@ -576,8 +576,9 @@ struct hfs_bnode *hfs_bnode_create(struct hfs_btree *tree, u32 num)
node = hfs_bnode_findhash(tree, num); node = hfs_bnode_findhash(tree, num);
spin_unlock(&tree->hash_lock); spin_unlock(&tree->hash_lock);
if (node) { if (node) {
printk("new node %u already hashed?\n", num); printk(KERN_CRIT "new node %u already hashed?\n", num);
BUG(); WARN_ON(1);
return node;
} }
node = __hfs_bnode_create(tree, num); node = __hfs_bnode_create(tree, num);
if (!node) if (!node)
......
...@@ -360,7 +360,7 @@ static int hfs_brec_update_parent(struct hfs_find_data *fd) ...@@ -360,7 +360,7 @@ static int hfs_brec_update_parent(struct hfs_find_data *fd)
end_off = hfs_bnode_read_u16(parent, end_rec_off); end_off = hfs_bnode_read_u16(parent, end_rec_off);
if (end_rec_off - end_off < diff) { if (end_rec_off - end_off < diff) {
printk("splitting index node...\n"); printk(KERN_DEBUG "hfs: splitting index node...\n");
fd->bnode = parent; fd->bnode = parent;
new_node = hfs_bnode_split(fd); new_node = hfs_bnode_split(fd);
if (IS_ERR(new_node)) if (IS_ERR(new_node))
......
...@@ -39,7 +39,7 @@ struct hfs_btree *hfs_btree_open(struct super_block *sb, u32 id) ...@@ -39,7 +39,7 @@ struct hfs_btree *hfs_btree_open(struct super_block *sb, u32 id)
} else if (id == HFSPLUS_CAT_CNID) { } else if (id == HFSPLUS_CAT_CNID) {
tree->keycmp = hfsplus_cat_cmp_key; tree->keycmp = hfsplus_cat_cmp_key;
} else { } else {
printk("HFS+-fs: unknown B*Tree requested\n"); printk(KERN_ERR "hfs: unknown B*Tree requested\n");
goto free_tree; goto free_tree;
} }
tree->inode = iget(sb, id); tree->inode = iget(sb, id);
...@@ -99,7 +99,7 @@ void hfs_btree_close(struct hfs_btree *tree) ...@@ -99,7 +99,7 @@ void hfs_btree_close(struct hfs_btree *tree)
while ((node = tree->node_hash[i])) { while ((node = tree->node_hash[i])) {
tree->node_hash[i] = node->next_hash; tree->node_hash[i] = node->next_hash;
if (atomic_read(&node->refcnt)) if (atomic_read(&node->refcnt))
printk("HFS+: node %d:%d still has %d user(s)!\n", printk(KERN_CRIT "hfs: node %d:%d still has %d user(s)!\n",
node->tree->cnid, node->this, atomic_read(&node->refcnt)); node->tree->cnid, node->this, atomic_read(&node->refcnt));
hfs_bnode_free(node); hfs_bnode_free(node);
tree->node_hash_cnt--; tree->node_hash_cnt--;
...@@ -223,10 +223,6 @@ struct hfs_bnode *hfs_bmap_alloc(struct hfs_btree *tree) ...@@ -223,10 +223,6 @@ struct hfs_bnode *hfs_bmap_alloc(struct hfs_btree *tree)
tree->free_nodes--; tree->free_nodes--;
mark_inode_dirty(tree->inode); mark_inode_dirty(tree->inode);
hfs_bnode_put(node); hfs_bnode_put(node);
if (!idx) {
printk("unexpected idx %u (%u)\n", idx, node->this);
BUG();
}
return hfs_bnode_create(tree, idx); return hfs_bnode_create(tree, idx);
} }
} }
...@@ -242,7 +238,7 @@ struct hfs_bnode *hfs_bmap_alloc(struct hfs_btree *tree) ...@@ -242,7 +238,7 @@ struct hfs_bnode *hfs_bmap_alloc(struct hfs_btree *tree)
kunmap(*pagep); kunmap(*pagep);
nidx = node->next; nidx = node->next;
if (!nidx) { if (!nidx) {
printk("create new bmap node...\n"); printk(KERN_DEBUG "hfs: create new bmap node...\n");
next_node = hfs_bmap_new_bmap(node, idx); next_node = hfs_bmap_new_bmap(node, idx);
} else } else
next_node = hfs_bnode_find(tree, nidx); next_node = hfs_bnode_find(tree, nidx);
...@@ -284,7 +280,7 @@ void hfs_bmap_free(struct hfs_bnode *node) ...@@ -284,7 +280,7 @@ void hfs_bmap_free(struct hfs_bnode *node)
hfs_bnode_put(node); hfs_bnode_put(node);
if (!i) { if (!i) {
/* panic */; /* panic */;
printk("HFS: unable to free bnode %u. bmap not found!\n", node->this); printk(KERN_CRIT "hfs: unable to free bnode %u. bmap not found!\n", node->this);
return; return;
} }
node = hfs_bnode_find(tree, i); node = hfs_bnode_find(tree, i);
...@@ -292,7 +288,7 @@ void hfs_bmap_free(struct hfs_bnode *node) ...@@ -292,7 +288,7 @@ void hfs_bmap_free(struct hfs_bnode *node)
return; return;
if (node->type != HFS_NODE_MAP) { if (node->type != HFS_NODE_MAP) {
/* panic */; /* panic */;
printk("HFS: invalid bmap found! (%u,%d)\n", node->this, node->type); printk(KERN_CRIT "hfs: invalid bmap found! (%u,%d)\n", node->this, node->type);
hfs_bnode_put(node); hfs_bnode_put(node);
return; return;
} }
...@@ -305,7 +301,7 @@ void hfs_bmap_free(struct hfs_bnode *node) ...@@ -305,7 +301,7 @@ void hfs_bmap_free(struct hfs_bnode *node)
m = 1 << (~nidx & 7); m = 1 << (~nidx & 7);
byte = data[off]; byte = data[off];
if (!(byte & m)) { if (!(byte & m)) {
printk("HFS: trying to free free bnode %u(%d)\n", node->this, node->type); printk(KERN_CRIT "hfs: trying to free free bnode %u(%d)\n", node->this, node->type);
kunmap(page); kunmap(page);
hfs_bnode_put(node); hfs_bnode_put(node);
return; return;
......
...@@ -139,7 +139,7 @@ int hfsplus_find_cat(struct super_block *sb, u32 cnid, ...@@ -139,7 +139,7 @@ int hfsplus_find_cat(struct super_block *sb, u32 cnid,
type = be16_to_cpu(tmp.type); type = be16_to_cpu(tmp.type);
if (type != HFSPLUS_FOLDER_THREAD && type != HFSPLUS_FILE_THREAD) { if (type != HFSPLUS_FOLDER_THREAD && type != HFSPLUS_FILE_THREAD) {
printk("HFS+-fs: Found bad thread record in catalog\n"); printk(KERN_ERR "hfs: found bad thread record in catalog\n");
return -EIO; return -EIO;
} }
......
...@@ -84,7 +84,7 @@ static struct dentry *hfsplus_lookup(struct inode *dir, struct dentry *dentry, ...@@ -84,7 +84,7 @@ static struct dentry *hfsplus_lookup(struct inode *dir, struct dentry *dentry,
} else if (!dentry->d_fsdata) } else if (!dentry->d_fsdata)
dentry->d_fsdata = (void *)(unsigned long)cnid; dentry->d_fsdata = (void *)(unsigned long)cnid;
} else { } else {
printk("HFS+-fs: Illegal catalog entry type in lookup\n"); printk(KERN_ERR "hfs: invalid catalog entry type in lookup\n");
err = -EIO; err = -EIO;
goto fail; goto fail;
} }
...@@ -132,12 +132,12 @@ static int hfsplus_readdir(struct file *filp, void *dirent, filldir_t filldir) ...@@ -132,12 +132,12 @@ static int hfsplus_readdir(struct file *filp, void *dirent, filldir_t filldir)
case 1: case 1:
hfs_bnode_read(fd.bnode, &entry, fd.entryoffset, fd.entrylength); hfs_bnode_read(fd.bnode, &entry, fd.entryoffset, fd.entrylength);
if (be16_to_cpu(entry.type) != HFSPLUS_FOLDER_THREAD) { if (be16_to_cpu(entry.type) != HFSPLUS_FOLDER_THREAD) {
printk("HFS+-fs: bad catalog folder thread\n"); printk(KERN_ERR "hfs: bad catalog folder thread\n");
err = -EIO; err = -EIO;
goto out; goto out;
} }
if (fd.entrylength < HFSPLUS_MIN_THREAD_SZ) { if (fd.entrylength < HFSPLUS_MIN_THREAD_SZ) {
printk("HFS+-fs: truncated catalog thread\n"); printk(KERN_ERR "hfs: truncated catalog thread\n");
err = -EIO; err = -EIO;
goto out; goto out;
} }
...@@ -156,7 +156,7 @@ static int hfsplus_readdir(struct file *filp, void *dirent, filldir_t filldir) ...@@ -156,7 +156,7 @@ static int hfsplus_readdir(struct file *filp, void *dirent, filldir_t filldir)
for (;;) { for (;;) {
if (be32_to_cpu(fd.key->cat.parent) != inode->i_ino) { if (be32_to_cpu(fd.key->cat.parent) != inode->i_ino) {
printk("HFS+-fs: walked past end of dir\n"); printk(KERN_ERR "hfs: walked past end of dir\n");
err = -EIO; err = -EIO;
goto out; goto out;
} }
...@@ -168,7 +168,7 @@ static int hfsplus_readdir(struct file *filp, void *dirent, filldir_t filldir) ...@@ -168,7 +168,7 @@ static int hfsplus_readdir(struct file *filp, void *dirent, filldir_t filldir)
goto out; goto out;
if (type == HFSPLUS_FOLDER) { if (type == HFSPLUS_FOLDER) {
if (fd.entrylength < sizeof(struct hfsplus_cat_folder)) { if (fd.entrylength < sizeof(struct hfsplus_cat_folder)) {
printk("HFS+-fs: small dir entry\n"); printk(KERN_ERR "hfs: small dir entry\n");
err = -EIO; err = -EIO;
goto out; goto out;
} }
...@@ -180,7 +180,7 @@ static int hfsplus_readdir(struct file *filp, void *dirent, filldir_t filldir) ...@@ -180,7 +180,7 @@ static int hfsplus_readdir(struct file *filp, void *dirent, filldir_t filldir)
break; break;
} else if (type == HFSPLUS_FILE) { } else if (type == HFSPLUS_FILE) {
if (fd.entrylength < sizeof(struct hfsplus_cat_file)) { if (fd.entrylength < sizeof(struct hfsplus_cat_file)) {
printk("HFS+-fs: small file entry\n"); printk(KERN_ERR "hfs: small file entry\n");
err = -EIO; err = -EIO;
goto out; goto out;
} }
...@@ -188,7 +188,7 @@ static int hfsplus_readdir(struct file *filp, void *dirent, filldir_t filldir) ...@@ -188,7 +188,7 @@ static int hfsplus_readdir(struct file *filp, void *dirent, filldir_t filldir)
be32_to_cpu(entry.file.id), DT_REG)) be32_to_cpu(entry.file.id), DT_REG))
break; break;
} else { } else {
printk("HFS+-fs: bad catalog entry type\n"); printk(KERN_ERR "hfs: bad catalog entry type\n");
err = -EIO; err = -EIO;
goto out; goto out;
} }
......
...@@ -349,10 +349,9 @@ int hfsplus_file_extend(struct inode *inode) ...@@ -349,10 +349,9 @@ int hfsplus_file_extend(struct inode *inode)
if (HFSPLUS_SB(sb).alloc_file->i_size * 8 < HFSPLUS_SB(sb).total_blocks - HFSPLUS_SB(sb).free_blocks + 8) { if (HFSPLUS_SB(sb).alloc_file->i_size * 8 < HFSPLUS_SB(sb).total_blocks - HFSPLUS_SB(sb).free_blocks + 8) {
// extend alloc file // extend alloc file
printk("extend alloc file! (%Lu,%u,%u)\n", HFSPLUS_SB(sb).alloc_file->i_size * 8, printk(KERN_ERR "hfs: extend alloc file! (%Lu,%u,%u)\n", HFSPLUS_SB(sb).alloc_file->i_size * 8,
HFSPLUS_SB(sb).total_blocks, HFSPLUS_SB(sb).free_blocks); HFSPLUS_SB(sb).total_blocks, HFSPLUS_SB(sb).free_blocks);
return -ENOSPC; return -ENOSPC;
//BUG();
} }
down(&HFSPLUS_I(inode).extents_lock); down(&HFSPLUS_I(inode).extents_lock);
......
...@@ -18,13 +18,11 @@ ...@@ -18,13 +18,11 @@
static int hfsplus_readpage(struct file *file, struct page *page) static int hfsplus_readpage(struct file *file, struct page *page)
{ {
//printk("readpage: %lu\n", page->index);
return block_read_full_page(page, hfsplus_get_block); return block_read_full_page(page, hfsplus_get_block);
} }
static int hfsplus_writepage(struct page *page, struct writeback_control *wbc) static int hfsplus_writepage(struct page *page, struct writeback_control *wbc)
{ {
//printk("writepage: %lu\n", page->index);
return block_write_full_page(page, hfsplus_get_block, wbc); return block_write_full_page(page, hfsplus_get_block, wbc);
} }
...@@ -92,7 +90,6 @@ static int hfsplus_releasepage(struct page *page, gfp_t mask) ...@@ -92,7 +90,6 @@ static int hfsplus_releasepage(struct page *page, gfp_t mask)
} while (--i && nidx < tree->node_count); } while (--i && nidx < tree->node_count);
spin_unlock(&tree->hash_lock); spin_unlock(&tree->hash_lock);
} }
//printk("releasepage: %lu,%x = %d\n", page->index, mask, res);
return res ? try_to_free_buffers(page) : 0; return res ? try_to_free_buffers(page) : 0;
} }
...@@ -467,7 +464,7 @@ int hfsplus_cat_read_inode(struct inode *inode, struct hfs_find_data *fd) ...@@ -467,7 +464,7 @@ int hfsplus_cat_read_inode(struct inode *inode, struct hfs_find_data *fd)
inode->i_mtime = hfsp_mt2ut(file->content_mod_date); inode->i_mtime = hfsp_mt2ut(file->content_mod_date);
inode->i_ctime = inode->i_mtime; inode->i_ctime = inode->i_mtime;
} else { } else {
printk("HFS+-fs: bad catalog entry used to create inode\n"); printk(KERN_ERR "hfs: bad catalog entry used to create inode\n");
res = -EIO; res = -EIO;
} }
return res; return res;
......
...@@ -83,58 +83,58 @@ int hfsplus_parse_options(char *input, struct hfsplus_sb_info *sbi) ...@@ -83,58 +83,58 @@ int hfsplus_parse_options(char *input, struct hfsplus_sb_info *sbi)
switch (token) { switch (token) {
case opt_creator: case opt_creator:
if (match_fourchar(&args[0], &sbi->creator)) { if (match_fourchar(&args[0], &sbi->creator)) {
printk("HFS+-fs: creator requires a 4 character value\n"); printk(KERN_ERR "hfs: creator requires a 4 character value\n");
return 0; return 0;
} }
break; break;
case opt_type: case opt_type:
if (match_fourchar(&args[0], &sbi->type)) { if (match_fourchar(&args[0], &sbi->type)) {
printk("HFS+-fs: type requires a 4 character value\n"); printk(KERN_ERR "hfs: type requires a 4 character value\n");
return 0; return 0;
} }
break; break;
case opt_umask: case opt_umask:
if (match_octal(&args[0], &tmp)) { if (match_octal(&args[0], &tmp)) {
printk("HFS+-fs: umask requires a value\n"); printk(KERN_ERR "hfs: umask requires a value\n");
return 0; return 0;
} }
sbi->umask = (umode_t)tmp; sbi->umask = (umode_t)tmp;
break; break;
case opt_uid: case opt_uid:
if (match_int(&args[0], &tmp)) { if (match_int(&args[0], &tmp)) {
printk("HFS+-fs: uid requires an argument\n"); printk(KERN_ERR "hfs: uid requires an argument\n");
return 0; return 0;
} }
sbi->uid = (uid_t)tmp; sbi->uid = (uid_t)tmp;
break; break;
case opt_gid: case opt_gid:
if (match_int(&args[0], &tmp)) { if (match_int(&args[0], &tmp)) {
printk("HFS+-fs: gid requires an argument\n"); printk(KERN_ERR "hfs: gid requires an argument\n");
return 0; return 0;
} }
sbi->gid = (gid_t)tmp; sbi->gid = (gid_t)tmp;
break; break;
case opt_part: case opt_part:
if (match_int(&args[0], &sbi->part)) { if (match_int(&args[0], &sbi->part)) {
printk("HFS+-fs: part requires an argument\n"); printk(KERN_ERR "hfs: part requires an argument\n");
return 0; return 0;
} }
break; break;
case opt_session: case opt_session:
if (match_int(&args[0], &sbi->session)) { if (match_int(&args[0], &sbi->session)) {
printk("HFS+-fs: session requires an argument\n"); printk(KERN_ERR "hfs: session requires an argument\n");
return 0; return 0;
} }
break; break;
case opt_nls: case opt_nls:
if (sbi->nls) { if (sbi->nls) {
printk("HFS+-fs: unable to change nls mapping\n"); printk(KERN_ERR "hfs: unable to change nls mapping\n");
return 0; return 0;
} }
p = match_strdup(&args[0]); p = match_strdup(&args[0]);
sbi->nls = load_nls(p); sbi->nls = load_nls(p);
if (!sbi->nls) { if (!sbi->nls) {
printk("HFS+-fs: unable to load nls mapping \"%s\"\n", p); printk(KERN_ERR "hfs: unable to load nls mapping \"%s\"\n", p);
kfree(p); kfree(p);
return 0; return 0;
} }
......
...@@ -169,7 +169,7 @@ static void hfsplus_write_super(struct super_block *sb) ...@@ -169,7 +169,7 @@ static void hfsplus_write_super(struct super_block *sb)
block = HFSPLUS_SB(sb).blockoffset; block = HFSPLUS_SB(sb).blockoffset;
block += (HFSPLUS_SB(sb).sect_count - 2) >> (sb->s_blocksize_bits - 9); block += (HFSPLUS_SB(sb).sect_count - 2) >> (sb->s_blocksize_bits - 9);
offset = ((HFSPLUS_SB(sb).sect_count - 2) << 9) & (sb->s_blocksize - 1); offset = ((HFSPLUS_SB(sb).sect_count - 2) << 9) & (sb->s_blocksize - 1);
printk("backup: %u,%u,%u,%u\n", HFSPLUS_SB(sb).blockoffset, printk(KERN_DEBUG "hfs: backup: %u,%u,%u,%u\n", HFSPLUS_SB(sb).blockoffset,
HFSPLUS_SB(sb).sect_count, block, offset); HFSPLUS_SB(sb).sect_count, block, offset);
bh = sb_bread(sb, block); bh = sb_bread(sb, block);
if (bh) { if (bh) {
...@@ -179,7 +179,7 @@ static void hfsplus_write_super(struct super_block *sb) ...@@ -179,7 +179,7 @@ static void hfsplus_write_super(struct super_block *sb)
mark_buffer_dirty(bh); mark_buffer_dirty(bh);
brelse(bh); brelse(bh);
} else } else
printk("backup not found!\n"); printk(KERN_WARNING "hfs: backup not found!\n");
} }
} }
HFSPLUS_SB(sb).flags &= ~HFSPLUS_SB_WRITEBACKUP; HFSPLUS_SB(sb).flags &= ~HFSPLUS_SB_WRITEBACKUP;
...@@ -240,18 +240,18 @@ static int hfsplus_remount(struct super_block *sb, int *flags, char *data) ...@@ -240,18 +240,18 @@ static int hfsplus_remount(struct super_block *sb, int *flags, char *data)
return -EINVAL; return -EINVAL;
if (!(vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_UNMNT))) { if (!(vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_UNMNT))) {
printk("HFS+-fs warning: Filesystem was not cleanly unmounted, " printk(KERN_WARNING "hfs: filesystem was not cleanly unmounted, "
"running fsck.hfsplus is recommended. leaving read-only.\n"); "running fsck.hfsplus is recommended. leaving read-only.\n");
sb->s_flags |= MS_RDONLY; sb->s_flags |= MS_RDONLY;
*flags |= MS_RDONLY; *flags |= MS_RDONLY;
} else if (sbi.flags & HFSPLUS_SB_FORCE) { } else if (sbi.flags & HFSPLUS_SB_FORCE) {
/* nothing */ /* nothing */
} else if (vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_SOFTLOCK)) { } else if (vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_SOFTLOCK)) {
printk("HFS+-fs: Filesystem is marked locked, leaving read-only.\n"); printk(KERN_WARNING "hfs: filesystem is marked locked, leaving read-only.\n");
sb->s_flags |= MS_RDONLY; sb->s_flags |= MS_RDONLY;
*flags |= MS_RDONLY; *flags |= MS_RDONLY;
} else if (vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_JOURNALED)) { } else if (vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_JOURNALED)) {
printk("HFS+-fs: Filesystem is marked journaled, leaving read-only.\n"); printk(KERN_WARNING "hfs: filesystem is marked journaled, leaving read-only.\n");
sb->s_flags |= MS_RDONLY; sb->s_flags |= MS_RDONLY;
*flags |= MS_RDONLY; *flags |= MS_RDONLY;
} }
...@@ -292,8 +292,7 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent) ...@@ -292,8 +292,7 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent)
INIT_HLIST_HEAD(&sbi->rsrc_inodes); INIT_HLIST_HEAD(&sbi->rsrc_inodes);
hfsplus_fill_defaults(sbi); hfsplus_fill_defaults(sbi);
if (!hfsplus_parse_options(data, sbi)) { if (!hfsplus_parse_options(data, sbi)) {
if (!silent) printk(KERN_ERR "hfs: unable to parse mount options\n");
printk("HFS+-fs: unable to parse mount options\n");
err = -EINVAL; err = -EINVAL;
goto cleanup; goto cleanup;
} }
...@@ -302,7 +301,7 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent) ...@@ -302,7 +301,7 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent)
nls = sbi->nls; nls = sbi->nls;
sbi->nls = load_nls("utf8"); sbi->nls = load_nls("utf8");
if (!sbi->nls) { if (!sbi->nls) {
printk("HFS+: unable to load nls for utf8\n"); printk(KERN_ERR "hfs: unable to load nls for utf8\n");
err = -EINVAL; err = -EINVAL;
goto cleanup; goto cleanup;
} }
...@@ -310,7 +309,7 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent) ...@@ -310,7 +309,7 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent)
/* Grab the volume header */ /* Grab the volume header */
if (hfsplus_read_wrapper(sb)) { if (hfsplus_read_wrapper(sb)) {
if (!silent) if (!silent)
printk("HFS+-fs: unable to find HFS+ superblock\n"); printk(KERN_WARNING "hfs: unable to find HFS+ superblock\n");
err = -EINVAL; err = -EINVAL;
goto cleanup; goto cleanup;
} }
...@@ -319,8 +318,7 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent) ...@@ -319,8 +318,7 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent)
/* Copy parts of the volume header into the superblock */ /* Copy parts of the volume header into the superblock */
sb->s_magic = be16_to_cpu(vhdr->signature); sb->s_magic = be16_to_cpu(vhdr->signature);
if (be16_to_cpu(vhdr->version) != HFSPLUS_CURRENT_VERSION) { if (be16_to_cpu(vhdr->version) != HFSPLUS_CURRENT_VERSION) {
if (!silent) printk(KERN_ERR "hfs: wrong filesystem version\n");
printk("HFS+-fs: wrong filesystem version\n");
goto cleanup; goto cleanup;
} }
HFSPLUS_SB(sb).total_blocks = be32_to_cpu(vhdr->total_blocks); HFSPLUS_SB(sb).total_blocks = be32_to_cpu(vhdr->total_blocks);
...@@ -341,19 +339,16 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent) ...@@ -341,19 +339,16 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent)
sb->s_maxbytes = MAX_LFS_FILESIZE; sb->s_maxbytes = MAX_LFS_FILESIZE;
if (!(vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_UNMNT))) { if (!(vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_UNMNT))) {
if (!silent) printk(KERN_WARNING "hfs: Filesystem was not cleanly unmounted, "
printk("HFS+-fs warning: Filesystem was not cleanly unmounted, "
"running fsck.hfsplus is recommended. mounting read-only.\n"); "running fsck.hfsplus is recommended. mounting read-only.\n");
sb->s_flags |= MS_RDONLY; sb->s_flags |= MS_RDONLY;
} else if (sbi->flags & HFSPLUS_SB_FORCE) { } else if (sbi->flags & HFSPLUS_SB_FORCE) {
/* nothing */ /* nothing */
} else if (vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_SOFTLOCK)) { } else if (vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_SOFTLOCK)) {
if (!silent) printk(KERN_WARNING "hfs: Filesystem is marked locked, mounting read-only.\n");
printk("HFS+-fs: Filesystem is marked locked, mounting read-only.\n");
sb->s_flags |= MS_RDONLY; sb->s_flags |= MS_RDONLY;
} else if (vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_JOURNALED)) { } else if (vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_JOURNALED)) {
if (!silent) printk(KERN_WARNING "hfs: write access to a jounaled filesystem is not supported, "
printk("HFS+-fs: write access to a jounaled filesystem is not supported, "
"use the force option at your own risk, mounting read-only.\n"); "use the force option at your own risk, mounting read-only.\n");
sb->s_flags |= MS_RDONLY; sb->s_flags |= MS_RDONLY;
} }
...@@ -362,21 +357,18 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent) ...@@ -362,21 +357,18 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent)
/* Load metadata objects (B*Trees) */ /* Load metadata objects (B*Trees) */
HFSPLUS_SB(sb).ext_tree = hfs_btree_open(sb, HFSPLUS_EXT_CNID); HFSPLUS_SB(sb).ext_tree = hfs_btree_open(sb, HFSPLUS_EXT_CNID);
if (!HFSPLUS_SB(sb).ext_tree) { if (!HFSPLUS_SB(sb).ext_tree) {
if (!silent) printk(KERN_ERR "hfs: failed to load extents file\n");
printk("HFS+-fs: failed to load extents file\n");
goto cleanup; goto cleanup;
} }
HFSPLUS_SB(sb).cat_tree = hfs_btree_open(sb, HFSPLUS_CAT_CNID); HFSPLUS_SB(sb).cat_tree = hfs_btree_open(sb, HFSPLUS_CAT_CNID);
if (!HFSPLUS_SB(sb).cat_tree) { if (!HFSPLUS_SB(sb).cat_tree) {
if (!silent) printk(KERN_ERR "hfs: failed to load catalog file\n");
printk("HFS+-fs: failed to load catalog file\n");
goto cleanup; goto cleanup;
} }
HFSPLUS_SB(sb).alloc_file = iget(sb, HFSPLUS_ALLOC_CNID); HFSPLUS_SB(sb).alloc_file = iget(sb, HFSPLUS_ALLOC_CNID);
if (!HFSPLUS_SB(sb).alloc_file) { if (!HFSPLUS_SB(sb).alloc_file) {
if (!silent) printk(KERN_ERR "hfs: failed to load allocation file\n");
printk("HFS+-fs: failed to load allocation file\n");
goto cleanup; goto cleanup;
} }
...@@ -384,8 +376,7 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent) ...@@ -384,8 +376,7 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent)
root = iget(sb, HFSPLUS_ROOT_CNID); root = iget(sb, HFSPLUS_ROOT_CNID);
sb->s_root = d_alloc_root(root); sb->s_root = d_alloc_root(root);
if (!sb->s_root) { if (!sb->s_root) {
if (!silent) printk(KERN_ERR "hfs: failed to load root directory\n");
printk("HFS+-fs: failed to load root directory\n");
iput(root); iput(root);
goto cleanup; goto cleanup;
} }
...@@ -419,7 +410,7 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent) ...@@ -419,7 +410,7 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent)
sync_dirty_buffer(HFSPLUS_SB(sb).s_vhbh); sync_dirty_buffer(HFSPLUS_SB(sb).s_vhbh);
if (!HFSPLUS_SB(sb).hidden_dir) { if (!HFSPLUS_SB(sb).hidden_dir) {
printk("HFS+: create hidden dir...\n"); printk(KERN_DEBUG "hfs: create hidden dir...\n");
HFSPLUS_SB(sb).hidden_dir = hfsplus_new_inode(sb, S_IFDIR); HFSPLUS_SB(sb).hidden_dir = hfsplus_new_inode(sb, S_IFDIR);
hfsplus_create_cat(HFSPLUS_SB(sb).hidden_dir->i_ino, sb->s_root->d_inode, hfsplus_create_cat(HFSPLUS_SB(sb).hidden_dir->i_ino, sb->s_root->d_inode,
&str, HFSPLUS_SB(sb).hidden_dir); &str, HFSPLUS_SB(sb).hidden_dir);
...@@ -499,7 +490,7 @@ static void __exit exit_hfsplus_fs(void) ...@@ -499,7 +490,7 @@ static void __exit exit_hfsplus_fs(void)
{ {
unregister_filesystem(&hfsplus_fs_type); unregister_filesystem(&hfsplus_fs_type);
if (kmem_cache_destroy(hfsplus_inode_cachep)) if (kmem_cache_destroy(hfsplus_inode_cachep))
printk(KERN_INFO "hfsplus_inode_cache: not all structures were freed\n"); printk(KERN_ERR "hfsplus_inode_cache: not all structures were freed\n");
} }
module_init(init_hfsplus_fs) module_init(init_hfsplus_fs)
......
...@@ -70,7 +70,7 @@ static int hfsplus_get_last_session(struct super_block *sb, ...@@ -70,7 +70,7 @@ static int hfsplus_get_last_session(struct super_block *sb,
*start = (sector_t)te.cdte_addr.lba << 2; *start = (sector_t)te.cdte_addr.lba << 2;
return 0; return 0;
} }
printk(KERN_ERR "HFS: Invalid session number or type of track\n"); printk(KERN_ERR "hfs: invalid session number or type of track\n");
return -EINVAL; return -EINVAL;
} }
ms_info.addr_format = CDROM_LBA; ms_info.addr_format = CDROM_LBA;
...@@ -143,7 +143,7 @@ int hfsplus_read_wrapper(struct super_block *sb) ...@@ -143,7 +143,7 @@ int hfsplus_read_wrapper(struct super_block *sb)
blocksize >>= 1; blocksize >>= 1;
if (sb_set_blocksize(sb, blocksize) != blocksize) { if (sb_set_blocksize(sb, blocksize) != blocksize) {
printk("HFS+: unable to blocksize to %u!\n", blocksize); printk(KERN_ERR "hfs: unable to set blocksize to %u!\n", blocksize);
return -EINVAL; return -EINVAL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment