Commit d6142673 authored by Joe Perches's avatar Joe Perches Committed by Linus Torvalds

hfs/hfsplus: convert printks to pr_<level>

Use a more current logging style.

Add #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
hfsplus now uses "hfsplus: " for all messages.
Coalesce formats.
Prefix debugging messages too.
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Cc: Vyacheslav Dubeyko <slava@dubeyko.com>
Cc: Hin-Tak Leung <htl10@users.sourceforge.net>
Cc: Christoph Hellwig <hch@infradead.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent c2b3e1f7
...@@ -137,7 +137,7 @@ int hfs_brec_find(struct hfs_find_data *fd) ...@@ -137,7 +137,7 @@ int hfs_brec_find(struct hfs_find_data *fd)
return res; return res;
invalid: invalid:
printk(KERN_ERR "hfs: inconsistency in B*Tree (%d,%d,%d,%u,%u)\n", pr_err("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:
......
...@@ -221,7 +221,7 @@ struct hfs_bnode *hfs_bnode_findhash(struct hfs_btree *tree, u32 cnid) ...@@ -221,7 +221,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(KERN_ERR "hfs: request for non-existent node %d in B*Tree\n", cnid); pr_err("request for non-existent node %d in B*Tree\n", cnid);
return NULL; return NULL;
} }
...@@ -244,7 +244,7 @@ static struct hfs_bnode *__hfs_bnode_create(struct hfs_btree *tree, u32 cnid) ...@@ -244,7 +244,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(KERN_ERR "hfs: request for non-existent node %d in B*Tree\n", cnid); pr_err("request for non-existent node %d in B*Tree\n", cnid);
return NULL; return NULL;
} }
......
...@@ -47,15 +47,13 @@ u16 hfs_brec_keylen(struct hfs_bnode *node, u16 rec) ...@@ -47,15 +47,13 @@ u16 hfs_brec_keylen(struct hfs_bnode *node, u16 rec)
if (node->tree->attributes & HFS_TREE_BIGKEYS) { if (node->tree->attributes & HFS_TREE_BIGKEYS) {
retval = hfs_bnode_read_u16(node, recoff) + 2; retval = hfs_bnode_read_u16(node, recoff) + 2;
if (retval > node->tree->max_key_len + 2) { if (retval > node->tree->max_key_len + 2) {
printk(KERN_ERR "hfs: keylen %d too large\n", pr_err("keylen %d too large\n", retval);
retval);
retval = 0; retval = 0;
} }
} else { } else {
retval = (hfs_bnode_read_u8(node, recoff) | 1) + 1; retval = (hfs_bnode_read_u8(node, recoff) | 1) + 1;
if (retval > node->tree->max_key_len + 1) { if (retval > node->tree->max_key_len + 1) {
printk(KERN_ERR "hfs: keylen %d too large\n", pr_err("keylen %d too large\n", retval);
retval);
retval = 0; retval = 0;
} }
} }
...@@ -388,7 +386,7 @@ static int hfs_brec_update_parent(struct hfs_find_data *fd) ...@@ -388,7 +386,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(KERN_DEBUG "hfs: splitting index node...\n"); printk(KERN_DEBUG "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))
......
...@@ -48,7 +48,7 @@ struct hfs_btree *hfs_btree_open(struct super_block *sb, u32 id, btree_keycmp ke ...@@ -48,7 +48,7 @@ struct hfs_btree *hfs_btree_open(struct super_block *sb, u32 id, btree_keycmp ke
mdb->drXTFlSize, be32_to_cpu(mdb->drXTClpSiz)); mdb->drXTFlSize, be32_to_cpu(mdb->drXTClpSiz));
if (HFS_I(tree->inode)->alloc_blocks > if (HFS_I(tree->inode)->alloc_blocks >
HFS_I(tree->inode)->first_blocks) { HFS_I(tree->inode)->first_blocks) {
printk(KERN_ERR "hfs: invalid btree extent records\n"); pr_err("invalid btree extent records\n");
unlock_new_inode(tree->inode); unlock_new_inode(tree->inode);
goto free_inode; goto free_inode;
} }
...@@ -60,8 +60,7 @@ struct hfs_btree *hfs_btree_open(struct super_block *sb, u32 id, btree_keycmp ke ...@@ -60,8 +60,7 @@ struct hfs_btree *hfs_btree_open(struct super_block *sb, u32 id, btree_keycmp ke
mdb->drCTFlSize, be32_to_cpu(mdb->drCTClpSiz)); mdb->drCTFlSize, be32_to_cpu(mdb->drCTClpSiz));
if (!HFS_I(tree->inode)->first_blocks) { if (!HFS_I(tree->inode)->first_blocks) {
printk(KERN_ERR "hfs: invalid btree extent records " pr_err("invalid btree extent records (0 size)\n");
"(0 size).\n");
unlock_new_inode(tree->inode); unlock_new_inode(tree->inode);
goto free_inode; goto free_inode;
} }
...@@ -100,14 +99,14 @@ struct hfs_btree *hfs_btree_open(struct super_block *sb, u32 id, btree_keycmp ke ...@@ -100,14 +99,14 @@ struct hfs_btree *hfs_btree_open(struct super_block *sb, u32 id, btree_keycmp ke
switch (id) { switch (id) {
case HFS_EXT_CNID: case HFS_EXT_CNID:
if (tree->max_key_len != HFS_MAX_EXT_KEYLEN) { if (tree->max_key_len != HFS_MAX_EXT_KEYLEN) {
printk(KERN_ERR "hfs: invalid extent max_key_len %d\n", pr_err("invalid extent max_key_len %d\n",
tree->max_key_len); tree->max_key_len);
goto fail_page; goto fail_page;
} }
break; break;
case HFS_CAT_CNID: case HFS_CAT_CNID:
if (tree->max_key_len != HFS_MAX_CAT_KEYLEN) { if (tree->max_key_len != HFS_MAX_CAT_KEYLEN) {
printk(KERN_ERR "hfs: invalid catalog max_key_len %d\n", pr_err("invalid catalog max_key_len %d\n",
tree->max_key_len); tree->max_key_len);
goto fail_page; goto fail_page;
} }
...@@ -146,8 +145,9 @@ void hfs_btree_close(struct hfs_btree *tree) ...@@ -146,8 +145,9 @@ 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(KERN_ERR "hfs: node %d:%d still has %d user(s)!\n", pr_err("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--;
} }
...@@ -290,7 +290,7 @@ struct hfs_bnode *hfs_bmap_alloc(struct hfs_btree *tree) ...@@ -290,7 +290,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(KERN_DEBUG "hfs: create new bmap node...\n"); printk(KERN_DEBUG "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);
...@@ -331,7 +331,8 @@ void hfs_bmap_free(struct hfs_bnode *node) ...@@ -331,7 +331,8 @@ void hfs_bmap_free(struct hfs_bnode *node)
hfs_bnode_put(node); hfs_bnode_put(node);
if (!i) { if (!i) {
/* panic */; /* panic */;
printk(KERN_CRIT "hfs: unable to free bnode %u. bmap not found!\n", node->this); pr_crit("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);
...@@ -339,7 +340,8 @@ void hfs_bmap_free(struct hfs_bnode *node) ...@@ -339,7 +340,8 @@ 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(KERN_CRIT "hfs: invalid bmap found! (%u,%d)\n", node->this, node->type); pr_crit("invalid bmap found! (%u,%d)\n",
node->this, node->type);
hfs_bnode_put(node); hfs_bnode_put(node);
return; return;
} }
...@@ -352,7 +354,8 @@ void hfs_bmap_free(struct hfs_bnode *node) ...@@ -352,7 +354,8 @@ 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(KERN_CRIT "hfs: trying to free free bnode %u(%d)\n", node->this, node->type); pr_crit("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;
......
...@@ -187,14 +187,14 @@ int hfs_cat_find_brec(struct super_block *sb, u32 cnid, ...@@ -187,14 +187,14 @@ int hfs_cat_find_brec(struct super_block *sb, u32 cnid,
type = rec.type; type = rec.type;
if (type != HFS_CDR_THD && type != HFS_CDR_FTH) { if (type != HFS_CDR_THD && type != HFS_CDR_FTH) {
printk(KERN_ERR "hfs: found bad thread record in catalog\n"); pr_err("found bad thread record in catalog\n");
return -EIO; return -EIO;
} }
fd->search_key->cat.ParID = rec.thread.ParID; fd->search_key->cat.ParID = rec.thread.ParID;
len = fd->search_key->cat.CName.len = rec.thread.CName.len; len = fd->search_key->cat.CName.len = rec.thread.CName.len;
if (len > HFS_NAMELEN) { if (len > HFS_NAMELEN) {
printk(KERN_ERR "hfs: bad catalog namelength\n"); pr_err("bad catalog namelength\n");
return -EIO; return -EIO;
} }
memcpy(fd->search_key->cat.CName.name, rec.thread.CName.name, len); memcpy(fd->search_key->cat.CName.name, rec.thread.CName.name, len);
......
...@@ -88,12 +88,12 @@ static int hfs_readdir(struct file *filp, void *dirent, filldir_t filldir) ...@@ -88,12 +88,12 @@ static int hfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
hfs_bnode_read(fd.bnode, &entry, fd.entryoffset, fd.entrylength); hfs_bnode_read(fd.bnode, &entry, fd.entryoffset, fd.entrylength);
if (entry.type != HFS_CDR_THD) { if (entry.type != HFS_CDR_THD) {
printk(KERN_ERR "hfs: bad catalog folder thread\n"); pr_err("bad catalog folder thread\n");
err = -EIO; err = -EIO;
goto out; goto out;
} }
//if (fd.entrylength < HFS_MIN_THREAD_SZ) { //if (fd.entrylength < HFS_MIN_THREAD_SZ) {
// printk(KERN_ERR "hfs: truncated catalog thread\n"); // pr_err("truncated catalog thread\n");
// err = -EIO; // err = -EIO;
// goto out; // goto out;
//} //}
...@@ -112,7 +112,7 @@ static int hfs_readdir(struct file *filp, void *dirent, filldir_t filldir) ...@@ -112,7 +112,7 @@ static int hfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
for (;;) { for (;;) {
if (be32_to_cpu(fd.key->cat.ParID) != inode->i_ino) { if (be32_to_cpu(fd.key->cat.ParID) != inode->i_ino) {
printk(KERN_ERR "hfs: walked past end of dir\n"); pr_err("walked past end of dir\n");
err = -EIO; err = -EIO;
goto out; goto out;
} }
...@@ -127,7 +127,7 @@ static int hfs_readdir(struct file *filp, void *dirent, filldir_t filldir) ...@@ -127,7 +127,7 @@ static int hfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
len = hfs_mac2asc(sb, strbuf, &fd.key->cat.CName); len = hfs_mac2asc(sb, strbuf, &fd.key->cat.CName);
if (type == HFS_CDR_DIR) { if (type == HFS_CDR_DIR) {
if (fd.entrylength < sizeof(struct hfs_cat_dir)) { if (fd.entrylength < sizeof(struct hfs_cat_dir)) {
printk(KERN_ERR "hfs: small dir entry\n"); pr_err("small dir entry\n");
err = -EIO; err = -EIO;
goto out; goto out;
} }
...@@ -136,7 +136,7 @@ static int hfs_readdir(struct file *filp, void *dirent, filldir_t filldir) ...@@ -136,7 +136,7 @@ static int hfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
break; break;
} else if (type == HFS_CDR_FIL) { } else if (type == HFS_CDR_FIL) {
if (fd.entrylength < sizeof(struct hfs_cat_file)) { if (fd.entrylength < sizeof(struct hfs_cat_file)) {
printk(KERN_ERR "hfs: small file entry\n"); pr_err("small file entry\n");
err = -EIO; err = -EIO;
goto out; goto out;
} }
...@@ -144,7 +144,7 @@ static int hfs_readdir(struct file *filp, void *dirent, filldir_t filldir) ...@@ -144,7 +144,7 @@ static int hfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
be32_to_cpu(entry.file.FlNum), DT_REG)) be32_to_cpu(entry.file.FlNum), DT_REG))
break; break;
} else { } else {
printk(KERN_ERR "hfs: bad catalog entry type %d\n", type); pr_err("bad catalog entry type %d\n", type);
err = -EIO; err = -EIO;
goto out; goto out;
} }
......
...@@ -9,6 +9,12 @@ ...@@ -9,6 +9,12 @@
#ifndef _LINUX_HFS_FS_H #ifndef _LINUX_HFS_FS_H
#define _LINUX_HFS_FS_H #define _LINUX_HFS_FS_H
#ifdef pr_fmt
#undef pr_fmt
#endif
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/mutex.h> #include <linux/mutex.h>
...@@ -37,13 +43,13 @@ ...@@ -37,13 +43,13 @@
#define hfs_dbg(flg, fmt, ...) \ #define hfs_dbg(flg, fmt, ...) \
do { \ do { \
if (DBG_##flg & DBG_MASK) \ if (DBG_##flg & DBG_MASK) \
printk(KERN_DEBUG fmt, ##__VA_ARGS__); \ printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); \
} while (0) } while (0)
#define hfs_dbg_cont(flg, fmt, ...) \ #define hfs_dbg_cont(flg, fmt, ...) \
do { \ do { \
if (DBG_##flg & DBG_MASK) \ if (DBG_##flg & DBG_MASK) \
printk(KERN_CONT fmt, ##__VA_ARGS__); \ pr_cont(fmt, ##__VA_ARGS__); \
} while (0) } while (0)
......
...@@ -48,7 +48,7 @@ static int hfs_get_last_session(struct super_block *sb, ...@@ -48,7 +48,7 @@ static int hfs_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"); pr_err("invalid session number or type of track\n");
return -EINVAL; return -EINVAL;
} }
ms_info.addr_format = CDROM_LBA; ms_info.addr_format = CDROM_LBA;
...@@ -101,7 +101,7 @@ int hfs_mdb_get(struct super_block *sb) ...@@ -101,7 +101,7 @@ int hfs_mdb_get(struct super_block *sb)
HFS_SB(sb)->alloc_blksz = size = be32_to_cpu(mdb->drAlBlkSiz); HFS_SB(sb)->alloc_blksz = size = be32_to_cpu(mdb->drAlBlkSiz);
if (!size || (size & (HFS_SECTOR_SIZE - 1))) { if (!size || (size & (HFS_SECTOR_SIZE - 1))) {
printk(KERN_ERR "hfs: bad allocation block size %d\n", size); pr_err("bad allocation block size %d\n", size);
goto out_bh; goto out_bh;
} }
...@@ -118,7 +118,7 @@ int hfs_mdb_get(struct super_block *sb) ...@@ -118,7 +118,7 @@ int hfs_mdb_get(struct super_block *sb)
size >>= 1; size >>= 1;
brelse(bh); brelse(bh);
if (!sb_set_blocksize(sb, size)) { if (!sb_set_blocksize(sb, size)) {
printk(KERN_ERR "hfs: unable to set blocksize to %u\n", size); pr_err("unable to set blocksize to %u\n", size);
goto out; goto out;
} }
...@@ -162,8 +162,8 @@ int hfs_mdb_get(struct super_block *sb) ...@@ -162,8 +162,8 @@ int hfs_mdb_get(struct super_block *sb)
} }
if (!HFS_SB(sb)->alt_mdb) { if (!HFS_SB(sb)->alt_mdb) {
printk(KERN_WARNING "hfs: unable to locate alternate MDB\n"); pr_warn("unable to locate alternate MDB\n");
printk(KERN_WARNING "hfs: continuing without an alternate MDB\n"); pr_warn("continuing without an alternate MDB\n");
} }
HFS_SB(sb)->bitmap = (__be32 *)__get_free_pages(GFP_KERNEL, PAGE_SIZE < 8192 ? 1 : 0); HFS_SB(sb)->bitmap = (__be32 *)__get_free_pages(GFP_KERNEL, PAGE_SIZE < 8192 ? 1 : 0);
...@@ -178,7 +178,7 @@ int hfs_mdb_get(struct super_block *sb) ...@@ -178,7 +178,7 @@ int hfs_mdb_get(struct super_block *sb)
while (size) { while (size) {
bh = sb_bread(sb, off >> sb->s_blocksize_bits); bh = sb_bread(sb, off >> sb->s_blocksize_bits);
if (!bh) { if (!bh) {
printk(KERN_ERR "hfs: unable to read volume bitmap\n"); pr_err("unable to read volume bitmap\n");
goto out; goto out;
} }
off2 = off & (sb->s_blocksize - 1); off2 = off & (sb->s_blocksize - 1);
...@@ -192,23 +192,22 @@ int hfs_mdb_get(struct super_block *sb) ...@@ -192,23 +192,22 @@ int hfs_mdb_get(struct super_block *sb)
HFS_SB(sb)->ext_tree = hfs_btree_open(sb, HFS_EXT_CNID, hfs_ext_keycmp); HFS_SB(sb)->ext_tree = hfs_btree_open(sb, HFS_EXT_CNID, hfs_ext_keycmp);
if (!HFS_SB(sb)->ext_tree) { if (!HFS_SB(sb)->ext_tree) {
printk(KERN_ERR "hfs: unable to open extent tree\n"); pr_err("unable to open extent tree\n");
goto out; goto out;
} }
HFS_SB(sb)->cat_tree = hfs_btree_open(sb, HFS_CAT_CNID, hfs_cat_keycmp); HFS_SB(sb)->cat_tree = hfs_btree_open(sb, HFS_CAT_CNID, hfs_cat_keycmp);
if (!HFS_SB(sb)->cat_tree) { if (!HFS_SB(sb)->cat_tree) {
printk(KERN_ERR "hfs: unable to open catalog tree\n"); pr_err("unable to open catalog tree\n");
goto out; goto out;
} }
attrib = mdb->drAtrb; attrib = mdb->drAtrb;
if (!(attrib & cpu_to_be16(HFS_SB_ATTRIB_UNMNT))) { if (!(attrib & cpu_to_be16(HFS_SB_ATTRIB_UNMNT))) {
printk(KERN_WARNING "hfs: filesystem was not cleanly unmounted, " pr_warn("filesystem was not cleanly unmounted, running fsck.hfs is recommended. mounting read-only.\n");
"running fsck.hfs is recommended. mounting read-only.\n");
sb->s_flags |= MS_RDONLY; sb->s_flags |= MS_RDONLY;
} }
if ((attrib & cpu_to_be16(HFS_SB_ATTRIB_SLOCK))) { if ((attrib & cpu_to_be16(HFS_SB_ATTRIB_SLOCK))) {
printk(KERN_WARNING "hfs: filesystem is marked locked, mounting read-only.\n"); pr_warn("filesystem is marked locked, mounting read-only.\n");
sb->s_flags |= MS_RDONLY; sb->s_flags |= MS_RDONLY;
} }
if (!(sb->s_flags & MS_RDONLY)) { if (!(sb->s_flags & MS_RDONLY)) {
...@@ -312,7 +311,7 @@ void hfs_mdb_commit(struct super_block *sb) ...@@ -312,7 +311,7 @@ void hfs_mdb_commit(struct super_block *sb)
while (size) { while (size) {
bh = sb_bread(sb, block); bh = sb_bread(sb, block);
if (!bh) { if (!bh) {
printk(KERN_ERR "hfs: unable to read volume bitmap\n"); pr_err("unable to read volume bitmap\n");
break; break;
} }
len = min((int)sb->s_blocksize - off, size); len = min((int)sb->s_blocksize - off, size);
......
...@@ -117,12 +117,11 @@ static int hfs_remount(struct super_block *sb, int *flags, char *data) ...@@ -117,12 +117,11 @@ static int hfs_remount(struct super_block *sb, int *flags, char *data)
return 0; return 0;
if (!(*flags & MS_RDONLY)) { if (!(*flags & MS_RDONLY)) {
if (!(HFS_SB(sb)->mdb->drAtrb & cpu_to_be16(HFS_SB_ATTRIB_UNMNT))) { if (!(HFS_SB(sb)->mdb->drAtrb & cpu_to_be16(HFS_SB_ATTRIB_UNMNT))) {
printk(KERN_WARNING "hfs: filesystem was not cleanly unmounted, " pr_warn("filesystem was not cleanly unmounted, running fsck.hfs is recommended. leaving read-only.\n");
"running fsck.hfs is recommended. leaving read-only.\n");
sb->s_flags |= MS_RDONLY; sb->s_flags |= MS_RDONLY;
*flags |= MS_RDONLY; *flags |= MS_RDONLY;
} else if (HFS_SB(sb)->mdb->drAtrb & cpu_to_be16(HFS_SB_ATTRIB_SLOCK)) { } else if (HFS_SB(sb)->mdb->drAtrb & cpu_to_be16(HFS_SB_ATTRIB_SLOCK)) {
printk(KERN_WARNING "hfs: filesystem is marked locked, leaving read-only.\n"); pr_warn("filesystem is marked locked, leaving read-only.\n");
sb->s_flags |= MS_RDONLY; sb->s_flags |= MS_RDONLY;
*flags |= MS_RDONLY; *flags |= MS_RDONLY;
} }
...@@ -253,29 +252,29 @@ static int parse_options(char *options, struct hfs_sb_info *hsb) ...@@ -253,29 +252,29 @@ static int parse_options(char *options, struct hfs_sb_info *hsb)
switch (token) { switch (token) {
case opt_uid: case opt_uid:
if (match_int(&args[0], &tmp)) { if (match_int(&args[0], &tmp)) {
printk(KERN_ERR "hfs: uid requires an argument\n"); pr_err("uid requires an argument\n");
return 0; return 0;
} }
hsb->s_uid = make_kuid(current_user_ns(), (uid_t)tmp); hsb->s_uid = make_kuid(current_user_ns(), (uid_t)tmp);
if (!uid_valid(hsb->s_uid)) { if (!uid_valid(hsb->s_uid)) {
printk(KERN_ERR "hfs: invalid uid %d\n", tmp); pr_err("invalid uid %d\n", tmp);
return 0; return 0;
} }
break; break;
case opt_gid: case opt_gid:
if (match_int(&args[0], &tmp)) { if (match_int(&args[0], &tmp)) {
printk(KERN_ERR "hfs: gid requires an argument\n"); pr_err("gid requires an argument\n");
return 0; return 0;
} }
hsb->s_gid = make_kgid(current_user_ns(), (gid_t)tmp); hsb->s_gid = make_kgid(current_user_ns(), (gid_t)tmp);
if (!gid_valid(hsb->s_gid)) { if (!gid_valid(hsb->s_gid)) {
printk(KERN_ERR "hfs: invalid gid %d\n", tmp); pr_err("invalid gid %d\n", tmp);
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(KERN_ERR "hfs: umask requires a value\n"); pr_err("umask requires a value\n");
return 0; return 0;
} }
hsb->s_file_umask = (umode_t)tmp; hsb->s_file_umask = (umode_t)tmp;
...@@ -283,39 +282,39 @@ static int parse_options(char *options, struct hfs_sb_info *hsb) ...@@ -283,39 +282,39 @@ static int parse_options(char *options, struct hfs_sb_info *hsb)
break; break;
case opt_file_umask: case opt_file_umask:
if (match_octal(&args[0], &tmp)) { if (match_octal(&args[0], &tmp)) {
printk(KERN_ERR "hfs: file_umask requires a value\n"); pr_err("file_umask requires a value\n");
return 0; return 0;
} }
hsb->s_file_umask = (umode_t)tmp; hsb->s_file_umask = (umode_t)tmp;
break; break;
case opt_dir_umask: case opt_dir_umask:
if (match_octal(&args[0], &tmp)) { if (match_octal(&args[0], &tmp)) {
printk(KERN_ERR "hfs: dir_umask requires a value\n"); pr_err("dir_umask requires a value\n");
return 0; return 0;
} }
hsb->s_dir_umask = (umode_t)tmp; hsb->s_dir_umask = (umode_t)tmp;
break; break;
case opt_part: case opt_part:
if (match_int(&args[0], &hsb->part)) { if (match_int(&args[0], &hsb->part)) {
printk(KERN_ERR "hfs: part requires an argument\n"); pr_err("part requires an argument\n");
return 0; return 0;
} }
break; break;
case opt_session: case opt_session:
if (match_int(&args[0], &hsb->session)) { if (match_int(&args[0], &hsb->session)) {
printk(KERN_ERR "hfs: session requires an argument\n"); pr_err("session requires an argument\n");
return 0; return 0;
} }
break; break;
case opt_type: case opt_type:
if (match_fourchar(&args[0], &hsb->s_type)) { if (match_fourchar(&args[0], &hsb->s_type)) {
printk(KERN_ERR "hfs: type requires a 4 character value\n"); pr_err("type requires a 4 character value\n");
return 0; return 0;
} }
break; break;
case opt_creator: case opt_creator:
if (match_fourchar(&args[0], &hsb->s_creator)) { if (match_fourchar(&args[0], &hsb->s_creator)) {
printk(KERN_ERR "hfs: creator requires a 4 character value\n"); pr_err("creator requires a 4 character value\n");
return 0; return 0;
} }
break; break;
...@@ -324,14 +323,14 @@ static int parse_options(char *options, struct hfs_sb_info *hsb) ...@@ -324,14 +323,14 @@ static int parse_options(char *options, struct hfs_sb_info *hsb)
break; break;
case opt_codepage: case opt_codepage:
if (hsb->nls_disk) { if (hsb->nls_disk) {
printk(KERN_ERR "hfs: unable to change codepage\n"); pr_err("unable to change codepage\n");
return 0; return 0;
} }
p = match_strdup(&args[0]); p = match_strdup(&args[0]);
if (p) if (p)
hsb->nls_disk = load_nls(p); hsb->nls_disk = load_nls(p);
if (!hsb->nls_disk) { if (!hsb->nls_disk) {
printk(KERN_ERR "hfs: unable to load codepage \"%s\"\n", p); pr_err("unable to load codepage \"%s\"\n", p);
kfree(p); kfree(p);
return 0; return 0;
} }
...@@ -339,14 +338,14 @@ static int parse_options(char *options, struct hfs_sb_info *hsb) ...@@ -339,14 +338,14 @@ static int parse_options(char *options, struct hfs_sb_info *hsb)
break; break;
case opt_iocharset: case opt_iocharset:
if (hsb->nls_io) { if (hsb->nls_io) {
printk(KERN_ERR "hfs: unable to change iocharset\n"); pr_err("unable to change iocharset\n");
return 0; return 0;
} }
p = match_strdup(&args[0]); p = match_strdup(&args[0]);
if (p) if (p)
hsb->nls_io = load_nls(p); hsb->nls_io = load_nls(p);
if (!hsb->nls_io) { if (!hsb->nls_io) {
printk(KERN_ERR "hfs: unable to load iocharset \"%s\"\n", p); pr_err("unable to load iocharset \"%s\"\n", p);
kfree(p); kfree(p);
return 0; return 0;
} }
...@@ -360,7 +359,7 @@ static int parse_options(char *options, struct hfs_sb_info *hsb) ...@@ -360,7 +359,7 @@ static int parse_options(char *options, struct hfs_sb_info *hsb)
if (hsb->nls_disk && !hsb->nls_io) { if (hsb->nls_disk && !hsb->nls_io) {
hsb->nls_io = load_nls_default(); hsb->nls_io = load_nls_default();
if (!hsb->nls_io) { if (!hsb->nls_io) {
printk(KERN_ERR "hfs: unable to load default iocharset\n"); pr_err("unable to load default iocharset\n");
return 0; return 0;
} }
} }
...@@ -400,7 +399,7 @@ static int hfs_fill_super(struct super_block *sb, void *data, int silent) ...@@ -400,7 +399,7 @@ static int hfs_fill_super(struct super_block *sb, void *data, int silent)
res = -EINVAL; res = -EINVAL;
if (!parse_options((char *)data, sbi)) { if (!parse_options((char *)data, sbi)) {
printk(KERN_ERR "hfs: unable to parse mount options.\n"); pr_err("unable to parse mount options\n");
goto bail; goto bail;
} }
...@@ -411,7 +410,7 @@ static int hfs_fill_super(struct super_block *sb, void *data, int silent) ...@@ -411,7 +410,7 @@ static int hfs_fill_super(struct super_block *sb, void *data, int silent)
res = hfs_mdb_get(sb); res = hfs_mdb_get(sb);
if (res) { if (res) {
if (!silent) if (!silent)
printk(KERN_WARNING "hfs: can't find a HFS filesystem on dev %s.\n", pr_warn("can't find a HFS filesystem on dev %s\n",
hfs_mdb_name(sb)); hfs_mdb_name(sb));
res = -EINVAL; res = -EINVAL;
goto bail; goto bail;
...@@ -449,7 +448,7 @@ static int hfs_fill_super(struct super_block *sb, void *data, int silent) ...@@ -449,7 +448,7 @@ static int hfs_fill_super(struct super_block *sb, void *data, int silent)
return 0; return 0;
bail_no_root: bail_no_root:
printk(KERN_ERR "hfs: get root inode failed.\n"); pr_err("get root inode failed\n");
bail: bail:
hfs_mdb_put(sb); hfs_mdb_put(sb);
return res; return res;
......
...@@ -56,7 +56,7 @@ int hfsplus_attr_build_key(struct super_block *sb, hfsplus_btree_key *key, ...@@ -56,7 +56,7 @@ int hfsplus_attr_build_key(struct super_block *sb, hfsplus_btree_key *key,
if (name) { if (name) {
len = strlen(name); len = strlen(name);
if (len > HFSPLUS_ATTR_MAX_STRLEN) { if (len > HFSPLUS_ATTR_MAX_STRLEN) {
printk(KERN_ERR "hfs: invalid xattr name's length\n"); pr_err("invalid xattr name's length\n");
return -EINVAL; return -EINVAL;
} }
hfsplus_asc2uni(sb, hfsplus_asc2uni(sb,
...@@ -169,7 +169,7 @@ int hfsplus_find_attr(struct super_block *sb, u32 cnid, ...@@ -169,7 +169,7 @@ int hfsplus_find_attr(struct super_block *sb, u32 cnid,
hfs_dbg(ATTR_MOD, "find_attr: %s,%d\n", name ? name : NULL, cnid); hfs_dbg(ATTR_MOD, "find_attr: %s,%d\n", name ? name : NULL, cnid);
if (!HFSPLUS_SB(sb)->attr_tree) { if (!HFSPLUS_SB(sb)->attr_tree) {
printk(KERN_ERR "hfs: attributes file doesn't exist\n"); pr_err("attributes file doesn't exist\n");
return -EINVAL; return -EINVAL;
} }
...@@ -232,7 +232,7 @@ int hfsplus_create_attr(struct inode *inode, ...@@ -232,7 +232,7 @@ int hfsplus_create_attr(struct inode *inode,
name ? name : NULL, inode->i_ino); name ? name : NULL, inode->i_ino);
if (!HFSPLUS_SB(sb)->attr_tree) { if (!HFSPLUS_SB(sb)->attr_tree) {
printk(KERN_ERR "hfs: attributes file doesn't exist\n"); pr_err("attributes file doesn't exist\n");
return -EINVAL; return -EINVAL;
} }
...@@ -307,10 +307,10 @@ static int __hfsplus_delete_attr(struct inode *inode, u32 cnid, ...@@ -307,10 +307,10 @@ static int __hfsplus_delete_attr(struct inode *inode, u32 cnid,
break; break;
case HFSPLUS_ATTR_FORK_DATA: case HFSPLUS_ATTR_FORK_DATA:
case HFSPLUS_ATTR_EXTENTS: case HFSPLUS_ATTR_EXTENTS:
printk(KERN_ERR "hfs: only inline data xattr are supported\n"); pr_err("only inline data xattr are supported\n");
return -EOPNOTSUPP; return -EOPNOTSUPP;
default: default:
printk(KERN_ERR "hfs: invalid extended attribute record\n"); pr_err("invalid extended attribute record\n");
return -ENOENT; return -ENOENT;
} }
...@@ -332,7 +332,7 @@ int hfsplus_delete_attr(struct inode *inode, const char *name) ...@@ -332,7 +332,7 @@ int hfsplus_delete_attr(struct inode *inode, const char *name)
name ? name : NULL, inode->i_ino); name ? name : NULL, inode->i_ino);
if (!HFSPLUS_SB(sb)->attr_tree) { if (!HFSPLUS_SB(sb)->attr_tree) {
printk(KERN_ERR "hfs: attributes file doesn't exist\n"); pr_err("attributes file doesn't exist\n");
return -EINVAL; return -EINVAL;
} }
...@@ -346,7 +346,7 @@ int hfsplus_delete_attr(struct inode *inode, const char *name) ...@@ -346,7 +346,7 @@ int hfsplus_delete_attr(struct inode *inode, const char *name)
if (err) if (err)
goto out; goto out;
} else { } else {
printk(KERN_ERR "hfs: invalid extended attribute name\n"); pr_err("invalid extended attribute name\n");
err = -EINVAL; err = -EINVAL;
goto out; goto out;
} }
...@@ -372,7 +372,7 @@ int hfsplus_delete_all_attrs(struct inode *dir, u32 cnid) ...@@ -372,7 +372,7 @@ int hfsplus_delete_all_attrs(struct inode *dir, u32 cnid)
hfs_dbg(ATTR_MOD, "delete_all_attrs: %d\n", cnid); hfs_dbg(ATTR_MOD, "delete_all_attrs: %d\n", cnid);
if (!HFSPLUS_SB(dir->i_sb)->attr_tree) { if (!HFSPLUS_SB(dir->i_sb)->attr_tree) {
printk(KERN_ERR "hfs: attributes file doesn't exist\n"); pr_err("attributes file doesn't exist\n");
return -EINVAL; return -EINVAL;
} }
...@@ -384,7 +384,7 @@ int hfsplus_delete_all_attrs(struct inode *dir, u32 cnid) ...@@ -384,7 +384,7 @@ int hfsplus_delete_all_attrs(struct inode *dir, u32 cnid)
err = hfsplus_find_attr(dir->i_sb, cnid, NULL, &fd); err = hfsplus_find_attr(dir->i_sb, cnid, NULL, &fd);
if (err) { if (err) {
if (err != -ENOENT) if (err != -ENOENT)
printk(KERN_ERR "hfs: xattr search failed.\n"); pr_err("xattr search failed\n");
goto end_delete_all; goto end_delete_all;
} }
......
...@@ -208,7 +208,7 @@ int hfs_brec_find(struct hfs_find_data *fd, search_strategy_t do_key_compare) ...@@ -208,7 +208,7 @@ int hfs_brec_find(struct hfs_find_data *fd, search_strategy_t do_key_compare)
return res; return res;
invalid: invalid:
printk(KERN_ERR "hfs: inconsistency in B*Tree (%d,%d,%d,%u,%u)\n", pr_err("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:
......
...@@ -238,7 +238,7 @@ int hfsplus_block_free(struct super_block *sb, u32 offset, u32 count) ...@@ -238,7 +238,7 @@ int hfsplus_block_free(struct super_block *sb, u32 offset, u32 count)
return 0; return 0;
kaboom: kaboom:
printk(KERN_CRIT "hfsplus: unable to mark blocks free: error %ld\n", pr_crit("hfsplus: unable to mark blocks free: error %ld\n",
PTR_ERR(page)); PTR_ERR(page));
mutex_unlock(&sbi->alloc_mutex); mutex_unlock(&sbi->alloc_mutex);
......
...@@ -386,7 +386,7 @@ struct hfs_bnode *hfs_bnode_findhash(struct hfs_btree *tree, u32 cnid) ...@@ -386,7 +386,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(KERN_ERR "hfs: request for non-existent node " pr_err("request for non-existent node "
"%d in B*Tree\n", "%d in B*Tree\n",
cnid); cnid);
return NULL; return NULL;
...@@ -409,7 +409,7 @@ static struct hfs_bnode *__hfs_bnode_create(struct hfs_btree *tree, u32 cnid) ...@@ -409,7 +409,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(KERN_ERR "hfs: request for non-existent node " pr_err("request for non-existent node "
"%d in B*Tree\n", "%d in B*Tree\n",
cnid); cnid);
return NULL; return NULL;
...@@ -588,7 +588,7 @@ struct hfs_bnode *hfs_bnode_create(struct hfs_btree *tree, u32 num) ...@@ -588,7 +588,7 @@ 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(KERN_CRIT "new node %u already hashed?\n", num); pr_crit("new node %u already hashed?\n", num);
WARN_ON(1); WARN_ON(1);
return node; return node;
} }
......
...@@ -45,13 +45,13 @@ u16 hfs_brec_keylen(struct hfs_bnode *node, u16 rec) ...@@ -45,13 +45,13 @@ u16 hfs_brec_keylen(struct hfs_bnode *node, u16 rec)
if (!recoff) if (!recoff)
return 0; return 0;
if (recoff > node->tree->node_size - 2) { if (recoff > node->tree->node_size - 2) {
printk(KERN_ERR "hfs: recoff %d too large\n", recoff); pr_err("recoff %d too large\n", recoff);
return 0; return 0;
} }
retval = hfs_bnode_read_u16(node, recoff) + 2; retval = hfs_bnode_read_u16(node, recoff) + 2;
if (retval > node->tree->max_key_len + 2) { if (retval > node->tree->max_key_len + 2) {
printk(KERN_ERR "hfs: keylen %d too large\n", pr_err("keylen %d too large\n",
retval); retval);
retval = 0; retval = 0;
} }
......
...@@ -40,8 +40,7 @@ struct hfs_btree *hfs_btree_open(struct super_block *sb, u32 id) ...@@ -40,8 +40,7 @@ struct hfs_btree *hfs_btree_open(struct super_block *sb, u32 id)
tree->inode = inode; tree->inode = inode;
if (!HFSPLUS_I(tree->inode)->first_blocks) { if (!HFSPLUS_I(tree->inode)->first_blocks) {
printk(KERN_ERR pr_err("invalid btree extent records (0 size)\n");
"hfs: invalid btree extent records (0 size).\n");
goto free_inode; goto free_inode;
} }
...@@ -68,12 +67,12 @@ struct hfs_btree *hfs_btree_open(struct super_block *sb, u32 id) ...@@ -68,12 +67,12 @@ struct hfs_btree *hfs_btree_open(struct super_block *sb, u32 id)
switch (id) { switch (id) {
case HFSPLUS_EXT_CNID: case HFSPLUS_EXT_CNID:
if (tree->max_key_len != HFSPLUS_EXT_KEYLEN - sizeof(u16)) { if (tree->max_key_len != HFSPLUS_EXT_KEYLEN - sizeof(u16)) {
printk(KERN_ERR "hfs: invalid extent max_key_len %d\n", pr_err("invalid extent max_key_len %d\n",
tree->max_key_len); tree->max_key_len);
goto fail_page; goto fail_page;
} }
if (tree->attributes & HFS_TREE_VARIDXKEYS) { if (tree->attributes & HFS_TREE_VARIDXKEYS) {
printk(KERN_ERR "hfs: invalid extent btree flag\n"); pr_err("invalid extent btree flag\n");
goto fail_page; goto fail_page;
} }
...@@ -81,12 +80,12 @@ struct hfs_btree *hfs_btree_open(struct super_block *sb, u32 id) ...@@ -81,12 +80,12 @@ struct hfs_btree *hfs_btree_open(struct super_block *sb, u32 id)
break; break;
case HFSPLUS_CAT_CNID: case HFSPLUS_CAT_CNID:
if (tree->max_key_len != HFSPLUS_CAT_KEYLEN - sizeof(u16)) { if (tree->max_key_len != HFSPLUS_CAT_KEYLEN - sizeof(u16)) {
printk(KERN_ERR "hfs: invalid catalog max_key_len %d\n", pr_err("invalid catalog max_key_len %d\n",
tree->max_key_len); tree->max_key_len);
goto fail_page; goto fail_page;
} }
if (!(tree->attributes & HFS_TREE_VARIDXKEYS)) { if (!(tree->attributes & HFS_TREE_VARIDXKEYS)) {
printk(KERN_ERR "hfs: invalid catalog btree flag\n"); pr_err("invalid catalog btree flag\n");
goto fail_page; goto fail_page;
} }
...@@ -100,19 +99,19 @@ struct hfs_btree *hfs_btree_open(struct super_block *sb, u32 id) ...@@ -100,19 +99,19 @@ struct hfs_btree *hfs_btree_open(struct super_block *sb, u32 id)
break; break;
case HFSPLUS_ATTR_CNID: case HFSPLUS_ATTR_CNID:
if (tree->max_key_len != HFSPLUS_ATTR_KEYLEN - sizeof(u16)) { if (tree->max_key_len != HFSPLUS_ATTR_KEYLEN - sizeof(u16)) {
printk(KERN_ERR "hfs: invalid attributes max_key_len %d\n", pr_err("invalid attributes max_key_len %d\n",
tree->max_key_len); tree->max_key_len);
goto fail_page; goto fail_page;
} }
tree->keycmp = hfsplus_attr_bin_cmp_key; tree->keycmp = hfsplus_attr_bin_cmp_key;
break; break;
default: default:
printk(KERN_ERR "hfs: unknown B*Tree requested\n"); pr_err("unknown B*Tree requested\n");
goto fail_page; goto fail_page;
} }
if (!(tree->attributes & HFS_TREE_BIGKEYS)) { if (!(tree->attributes & HFS_TREE_BIGKEYS)) {
printk(KERN_ERR "hfs: invalid btree flag\n"); pr_err("invalid btree flag\n");
goto fail_page; goto fail_page;
} }
...@@ -155,7 +154,7 @@ void hfs_btree_close(struct hfs_btree *tree) ...@@ -155,7 +154,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(KERN_CRIT "hfs: node %d:%d " pr_crit("node %d:%d "
"still has %d user(s)!\n", "still has %d user(s)!\n",
node->tree->cnid, node->this, node->tree->cnid, node->this,
atomic_read(&node->refcnt)); atomic_read(&node->refcnt));
...@@ -345,7 +344,7 @@ void hfs_bmap_free(struct hfs_bnode *node) ...@@ -345,7 +344,7 @@ void hfs_bmap_free(struct hfs_bnode *node)
hfs_bnode_put(node); hfs_bnode_put(node);
if (!i) { if (!i) {
/* panic */; /* panic */;
printk(KERN_CRIT "hfs: unable to free bnode %u. " pr_crit("unable to free bnode %u. "
"bmap not found!\n", "bmap not found!\n",
node->this); node->this);
return; return;
...@@ -355,7 +354,7 @@ void hfs_bmap_free(struct hfs_bnode *node) ...@@ -355,7 +354,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(KERN_CRIT "hfs: invalid bmap found! " pr_crit("invalid bmap found! "
"(%u,%d)\n", "(%u,%d)\n",
node->this, node->type); node->this, node->type);
hfs_bnode_put(node); hfs_bnode_put(node);
...@@ -370,7 +369,7 @@ void hfs_bmap_free(struct hfs_bnode *node) ...@@ -370,7 +369,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(KERN_CRIT "hfs: trying to free free bnode " pr_crit("trying to free free bnode "
"%u(%d)\n", "%u(%d)\n",
node->this, node->type); node->this, node->type);
kunmap(page); kunmap(page);
......
...@@ -188,12 +188,12 @@ int hfsplus_find_cat(struct super_block *sb, u32 cnid, ...@@ -188,12 +188,12 @@ 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(KERN_ERR "hfs: found bad thread record in catalog\n"); pr_err("found bad thread record in catalog\n");
return -EIO; return -EIO;
} }
if (be16_to_cpu(tmp.thread.nodeName.length) > 255) { if (be16_to_cpu(tmp.thread.nodeName.length) > 255) {
printk(KERN_ERR "hfs: catalog name length corrupted\n"); pr_err("catalog name length corrupted\n");
return -EIO; return -EIO;
} }
......
...@@ -103,7 +103,7 @@ static struct dentry *hfsplus_lookup(struct inode *dir, struct dentry *dentry, ...@@ -103,7 +103,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(KERN_ERR "hfs: invalid catalog entry type in lookup\n"); pr_err("invalid catalog entry type in lookup\n");
err = -EIO; err = -EIO;
goto fail; goto fail;
} }
...@@ -159,12 +159,12 @@ static int hfsplus_readdir(struct file *filp, void *dirent, filldir_t filldir) ...@@ -159,12 +159,12 @@ static int hfsplus_readdir(struct file *filp, void *dirent, filldir_t filldir)
hfs_bnode_read(fd.bnode, &entry, fd.entryoffset, hfs_bnode_read(fd.bnode, &entry, fd.entryoffset,
fd.entrylength); fd.entrylength);
if (be16_to_cpu(entry.type) != HFSPLUS_FOLDER_THREAD) { if (be16_to_cpu(entry.type) != HFSPLUS_FOLDER_THREAD) {
printk(KERN_ERR "hfs: bad catalog folder thread\n"); pr_err("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(KERN_ERR "hfs: truncated catalog thread\n"); pr_err("truncated catalog thread\n");
err = -EIO; err = -EIO;
goto out; goto out;
} }
...@@ -183,7 +183,7 @@ static int hfsplus_readdir(struct file *filp, void *dirent, filldir_t filldir) ...@@ -183,7 +183,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(KERN_ERR "hfs: walked past end of dir\n"); pr_err("walked past end of dir\n");
err = -EIO; err = -EIO;
goto out; goto out;
} }
...@@ -203,7 +203,7 @@ static int hfsplus_readdir(struct file *filp, void *dirent, filldir_t filldir) ...@@ -203,7 +203,7 @@ static int hfsplus_readdir(struct file *filp, void *dirent, filldir_t filldir)
if (type == HFSPLUS_FOLDER) { if (type == HFSPLUS_FOLDER) {
if (fd.entrylength < if (fd.entrylength <
sizeof(struct hfsplus_cat_folder)) { sizeof(struct hfsplus_cat_folder)) {
printk(KERN_ERR "hfs: small dir entry\n"); pr_err("small dir entry\n");
err = -EIO; err = -EIO;
goto out; goto out;
} }
...@@ -216,7 +216,7 @@ static int hfsplus_readdir(struct file *filp, void *dirent, filldir_t filldir) ...@@ -216,7 +216,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(KERN_ERR "hfs: small file entry\n"); pr_err("small file entry\n");
err = -EIO; err = -EIO;
goto out; goto out;
} }
...@@ -224,7 +224,7 @@ static int hfsplus_readdir(struct file *filp, void *dirent, filldir_t filldir) ...@@ -224,7 +224,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(KERN_ERR "hfs: bad catalog entry type\n"); pr_err("bad catalog entry type\n");
err = -EIO; err = -EIO;
goto out; goto out;
} }
......
...@@ -349,7 +349,7 @@ static int hfsplus_free_extents(struct super_block *sb, ...@@ -349,7 +349,7 @@ static int hfsplus_free_extents(struct super_block *sb,
if (count <= block_nr) { if (count <= block_nr) {
err = hfsplus_block_free(sb, start, count); err = hfsplus_block_free(sb, start, count);
if (err) { if (err) {
printk(KERN_ERR "hfs: can't free extent\n"); pr_err("can't free extent\n");
hfs_dbg(EXTENT, " start: %u count: %u\n", hfs_dbg(EXTENT, " start: %u count: %u\n",
start, count); start, count);
} }
...@@ -360,7 +360,7 @@ static int hfsplus_free_extents(struct super_block *sb, ...@@ -360,7 +360,7 @@ static int hfsplus_free_extents(struct super_block *sb,
count -= block_nr; count -= block_nr;
err = hfsplus_block_free(sb, start + count, block_nr); err = hfsplus_block_free(sb, start + count, block_nr);
if (err) { if (err) {
printk(KERN_ERR "hfs: can't free extent\n"); pr_err("can't free extent\n");
hfs_dbg(EXTENT, " start: %u count: %u\n", hfs_dbg(EXTENT, " start: %u count: %u\n",
start, count); start, count);
} }
...@@ -433,7 +433,7 @@ int hfsplus_file_extend(struct inode *inode) ...@@ -433,7 +433,7 @@ int hfsplus_file_extend(struct inode *inode)
if (sbi->alloc_file->i_size * 8 < if (sbi->alloc_file->i_size * 8 <
sbi->total_blocks - sbi->free_blocks + 8) { sbi->total_blocks - sbi->free_blocks + 8) {
/* extend alloc file */ /* extend alloc file */
printk(KERN_ERR "hfs: extend alloc file! " pr_err("extend alloc file! "
"(%llu,%u,%u)\n", "(%llu,%u,%u)\n",
sbi->alloc_file->i_size * 8, sbi->alloc_file->i_size * 8,
sbi->total_blocks, sbi->free_blocks); sbi->total_blocks, sbi->free_blocks);
......
...@@ -10,6 +10,12 @@ ...@@ -10,6 +10,12 @@
#ifndef _LINUX_HFSPLUS_FS_H #ifndef _LINUX_HFSPLUS_FS_H
#define _LINUX_HFSPLUS_FS_H #define _LINUX_HFSPLUS_FS_H
#ifdef pr_fmt
#undef pr_fmt
#endif
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/mutex.h> #include <linux/mutex.h>
#include <linux/buffer_head.h> #include <linux/buffer_head.h>
...@@ -35,13 +41,13 @@ ...@@ -35,13 +41,13 @@
#define hfs_dbg(flg, fmt, ...) \ #define hfs_dbg(flg, fmt, ...) \
do { \ do { \
if (DBG_##flg & DBG_MASK) \ if (DBG_##flg & DBG_MASK) \
printk(KERN_DEBUG fmt, ##__VA_ARGS__); \ printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); \
} while (0) } while (0)
#define hfs_dbg_cont(flg, fmt, ...) \ #define hfs_dbg_cont(flg, fmt, ...) \
do { \ do { \
if (DBG_##flg & DBG_MASK) \ if (DBG_##flg & DBG_MASK) \
printk(KERN_CONT fmt, ##__VA_ARGS__); \ pr_cont(fmt, ##__VA_ARGS__); \
} while (0) } while (0)
/* Runtime config options */ /* Runtime config options */
......
...@@ -357,7 +357,7 @@ int hfsplus_file_fsync(struct file *file, loff_t start, loff_t end, ...@@ -357,7 +357,7 @@ int hfsplus_file_fsync(struct file *file, loff_t start, loff_t end,
if (!error) if (!error)
error = error2; error = error2;
} else { } else {
printk(KERN_ERR "hfs: sync non-existent attributes tree\n"); pr_err("sync non-existent attributes tree\n");
} }
} }
...@@ -573,7 +573,7 @@ int hfsplus_cat_read_inode(struct inode *inode, struct hfs_find_data *fd) ...@@ -573,7 +573,7 @@ int hfsplus_cat_read_inode(struct inode *inode, struct hfs_find_data *fd)
inode->i_ctime = hfsp_mt2ut(file->attribute_mod_date); inode->i_ctime = hfsp_mt2ut(file->attribute_mod_date);
HFSPLUS_I(inode)->create_date = file->create_date; HFSPLUS_I(inode)->create_date = file->create_date;
} else { } else {
printk(KERN_ERR "hfs: bad catalog entry used to create inode\n"); pr_err("bad catalog entry used to create inode\n");
res = -EIO; res = -EIO;
} }
return res; return res;
......
...@@ -113,67 +113,67 @@ int hfsplus_parse_options(char *input, struct hfsplus_sb_info *sbi) ...@@ -113,67 +113,67 @@ 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(KERN_ERR "hfs: creator requires a 4 character value\n"); pr_err("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(KERN_ERR "hfs: type requires a 4 character value\n"); pr_err("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(KERN_ERR "hfs: umask requires a value\n"); pr_err("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(KERN_ERR "hfs: uid requires an argument\n"); pr_err("uid requires an argument\n");
return 0; return 0;
} }
sbi->uid = make_kuid(current_user_ns(), (uid_t)tmp); sbi->uid = make_kuid(current_user_ns(), (uid_t)tmp);
if (!uid_valid(sbi->uid)) { if (!uid_valid(sbi->uid)) {
printk(KERN_ERR "hfs: invalid uid specified\n"); pr_err("invalid uid specified\n");
return 0; return 0;
} }
break; break;
case opt_gid: case opt_gid:
if (match_int(&args[0], &tmp)) { if (match_int(&args[0], &tmp)) {
printk(KERN_ERR "hfs: gid requires an argument\n"); pr_err("gid requires an argument\n");
return 0; return 0;
} }
sbi->gid = make_kgid(current_user_ns(), (gid_t)tmp); sbi->gid = make_kgid(current_user_ns(), (gid_t)tmp);
if (!gid_valid(sbi->gid)) { if (!gid_valid(sbi->gid)) {
printk(KERN_ERR "hfs: invalid gid specified\n"); pr_err("invalid gid specified\n");
return 0; return 0;
} }
break; break;
case opt_part: case opt_part:
if (match_int(&args[0], &sbi->part)) { if (match_int(&args[0], &sbi->part)) {
printk(KERN_ERR "hfs: part requires an argument\n"); pr_err("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(KERN_ERR "hfs: session requires an argument\n"); pr_err("session requires an argument\n");
return 0; return 0;
} }
break; break;
case opt_nls: case opt_nls:
if (sbi->nls) { if (sbi->nls) {
printk(KERN_ERR "hfs: unable to change nls mapping\n"); pr_err("unable to change nls mapping\n");
return 0; return 0;
} }
p = match_strdup(&args[0]); p = match_strdup(&args[0]);
if (p) if (p)
sbi->nls = load_nls(p); sbi->nls = load_nls(p);
if (!sbi->nls) { if (!sbi->nls) {
printk(KERN_ERR "hfs: unable to load " pr_err("unable to load "
"nls mapping \"%s\"\n", "nls mapping \"%s\"\n",
p); p);
kfree(p); kfree(p);
......
...@@ -132,7 +132,7 @@ static int hfsplus_system_write_inode(struct inode *inode) ...@@ -132,7 +132,7 @@ static int hfsplus_system_write_inode(struct inode *inode)
if (tree) { if (tree) {
int err = hfs_btree_write(tree); int err = hfs_btree_write(tree);
if (err) { if (err) {
printk(KERN_ERR "hfs: b-tree write err: %d, ino %lu\n", pr_err("b-tree write err: %d, ino %lu\n",
err, inode->i_ino); err, inode->i_ino);
return err; return err;
} }
...@@ -251,7 +251,7 @@ static void delayed_sync_fs(struct work_struct *work) ...@@ -251,7 +251,7 @@ static void delayed_sync_fs(struct work_struct *work)
err = hfsplus_sync_fs(sbi->alloc_file->i_sb, 1); err = hfsplus_sync_fs(sbi->alloc_file->i_sb, 1);
if (err) if (err)
printk(KERN_ERR "hfs: delayed sync fs err %d\n", err); pr_err("delayed sync fs err %d\n", err);
} }
void hfsplus_mark_mdb_dirty(struct super_block *sb) void hfsplus_mark_mdb_dirty(struct super_block *sb)
...@@ -333,25 +333,19 @@ static int hfsplus_remount(struct super_block *sb, int *flags, char *data) ...@@ -333,25 +333,19 @@ 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(KERN_WARNING "hfs: filesystem was " pr_warn("filesystem was not cleanly unmounted, running fsck.hfsplus is recommended. leaving read-only.\n");
"not cleanly unmounted, "
"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 (force) { } else if (force) {
/* nothing */ /* nothing */
} else if (vhdr->attributes & } else if (vhdr->attributes &
cpu_to_be32(HFSPLUS_VOL_SOFTLOCK)) { cpu_to_be32(HFSPLUS_VOL_SOFTLOCK)) {
printk(KERN_WARNING "hfs: filesystem is marked locked, " pr_warn("filesystem is marked locked, leaving read-only.\n");
"leaving read-only.\n");
sb->s_flags |= MS_RDONLY; sb->s_flags |= MS_RDONLY;
*flags |= MS_RDONLY; *flags |= MS_RDONLY;
} else if (vhdr->attributes & } else if (vhdr->attributes &
cpu_to_be32(HFSPLUS_VOL_JOURNALED)) { cpu_to_be32(HFSPLUS_VOL_JOURNALED)) {
printk(KERN_WARNING "hfs: filesystem is " pr_warn("filesystem is marked journaled, leaving read-only.\n");
"marked journaled, "
"leaving read-only.\n");
sb->s_flags |= MS_RDONLY; sb->s_flags |= MS_RDONLY;
*flags |= MS_RDONLY; *flags |= MS_RDONLY;
} }
...@@ -397,7 +391,7 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent) ...@@ -397,7 +391,7 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent)
err = -EINVAL; err = -EINVAL;
if (!hfsplus_parse_options(data, sbi)) { if (!hfsplus_parse_options(data, sbi)) {
printk(KERN_ERR "hfs: unable to parse mount options\n"); pr_err("unable to parse mount options\n");
goto out_unload_nls; goto out_unload_nls;
} }
...@@ -405,14 +399,14 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent) ...@@ -405,14 +399,14 @@ 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(KERN_ERR "hfs: unable to load nls for utf8\n"); pr_err("unable to load nls for utf8\n");
goto out_unload_nls; goto out_unload_nls;
} }
/* Grab the volume header */ /* Grab the volume header */
if (hfsplus_read_wrapper(sb)) { if (hfsplus_read_wrapper(sb)) {
if (!silent) if (!silent)
printk(KERN_WARNING "hfs: unable to find HFS+ superblock\n"); pr_warn("unable to find HFS+ superblock\n");
goto out_unload_nls; goto out_unload_nls;
} }
vhdr = sbi->s_vhdr; vhdr = sbi->s_vhdr;
...@@ -421,7 +415,7 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent) ...@@ -421,7 +415,7 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent)
sb->s_magic = HFSPLUS_VOLHEAD_SIG; sb->s_magic = HFSPLUS_VOLHEAD_SIG;
if (be16_to_cpu(vhdr->version) < HFSPLUS_MIN_VERSION || if (be16_to_cpu(vhdr->version) < HFSPLUS_MIN_VERSION ||
be16_to_cpu(vhdr->version) > HFSPLUS_CURRENT_VERSION) { be16_to_cpu(vhdr->version) > HFSPLUS_CURRENT_VERSION) {
printk(KERN_ERR "hfs: wrong filesystem version\n"); pr_err("wrong filesystem version\n");
goto out_free_vhdr; goto out_free_vhdr;
} }
sbi->total_blocks = be32_to_cpu(vhdr->total_blocks); sbi->total_blocks = be32_to_cpu(vhdr->total_blocks);
...@@ -445,7 +439,7 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent) ...@@ -445,7 +439,7 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent)
if ((last_fs_block > (sector_t)(~0ULL) >> (sbi->alloc_blksz_shift - 9)) || if ((last_fs_block > (sector_t)(~0ULL) >> (sbi->alloc_blksz_shift - 9)) ||
(last_fs_page > (pgoff_t)(~0ULL))) { (last_fs_page > (pgoff_t)(~0ULL))) {
printk(KERN_ERR "hfs: filesystem size too large.\n"); pr_err("filesystem size too large\n");
goto out_free_vhdr; goto out_free_vhdr;
} }
...@@ -454,22 +448,16 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent) ...@@ -454,22 +448,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))) {
printk(KERN_WARNING "hfs: Filesystem was " pr_warn("Filesystem was not cleanly unmounted, running fsck.hfsplus is recommended. mounting read-only.\n");
"not cleanly unmounted, "
"running fsck.hfsplus is recommended. "
"mounting read-only.\n");
sb->s_flags |= MS_RDONLY; sb->s_flags |= MS_RDONLY;
} else if (test_and_clear_bit(HFSPLUS_SB_FORCE, &sbi->flags)) { } else if (test_and_clear_bit(HFSPLUS_SB_FORCE, &sbi->flags)) {
/* nothing */ /* nothing */
} else if (vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_SOFTLOCK)) { } else if (vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_SOFTLOCK)) {
printk(KERN_WARNING "hfs: Filesystem is marked locked, mounting read-only.\n"); pr_warn("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)) &&
!(sb->s_flags & MS_RDONLY)) { !(sb->s_flags & MS_RDONLY)) {
printk(KERN_WARNING "hfs: write access to " pr_warn("write access to a journaled filesystem is not supported, use the force option at your own risk, mounting read-only.\n");
"a journaled filesystem is not supported, "
"use the force option at your own risk, "
"mounting read-only.\n");
sb->s_flags |= MS_RDONLY; sb->s_flags |= MS_RDONLY;
} }
...@@ -478,18 +466,18 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent) ...@@ -478,18 +466,18 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent)
/* Load metadata objects (B*Trees) */ /* Load metadata objects (B*Trees) */
sbi->ext_tree = hfs_btree_open(sb, HFSPLUS_EXT_CNID); sbi->ext_tree = hfs_btree_open(sb, HFSPLUS_EXT_CNID);
if (!sbi->ext_tree) { if (!sbi->ext_tree) {
printk(KERN_ERR "hfs: failed to load extents file\n"); pr_err("failed to load extents file\n");
goto out_free_vhdr; goto out_free_vhdr;
} }
sbi->cat_tree = hfs_btree_open(sb, HFSPLUS_CAT_CNID); sbi->cat_tree = hfs_btree_open(sb, HFSPLUS_CAT_CNID);
if (!sbi->cat_tree) { if (!sbi->cat_tree) {
printk(KERN_ERR "hfs: failed to load catalog file\n"); pr_err("failed to load catalog file\n");
goto out_close_ext_tree; goto out_close_ext_tree;
} }
if (vhdr->attr_file.total_blocks != 0) { if (vhdr->attr_file.total_blocks != 0) {
sbi->attr_tree = hfs_btree_open(sb, HFSPLUS_ATTR_CNID); sbi->attr_tree = hfs_btree_open(sb, HFSPLUS_ATTR_CNID);
if (!sbi->attr_tree) { if (!sbi->attr_tree) {
printk(KERN_ERR "hfs: failed to load attributes file\n"); pr_err("failed to load attributes file\n");
goto out_close_cat_tree; goto out_close_cat_tree;
} }
} }
...@@ -497,7 +485,7 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent) ...@@ -497,7 +485,7 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent)
inode = hfsplus_iget(sb, HFSPLUS_ALLOC_CNID); inode = hfsplus_iget(sb, HFSPLUS_ALLOC_CNID);
if (IS_ERR(inode)) { if (IS_ERR(inode)) {
printk(KERN_ERR "hfs: failed to load allocation file\n"); pr_err("failed to load allocation file\n");
err = PTR_ERR(inode); err = PTR_ERR(inode);
goto out_close_attr_tree; goto out_close_attr_tree;
} }
...@@ -506,7 +494,7 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent) ...@@ -506,7 +494,7 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent)
/* Load the root directory */ /* Load the root directory */
root = hfsplus_iget(sb, HFSPLUS_ROOT_CNID); root = hfsplus_iget(sb, HFSPLUS_ROOT_CNID);
if (IS_ERR(root)) { if (IS_ERR(root)) {
printk(KERN_ERR "hfs: failed to load root directory\n"); pr_err("failed to load root directory\n");
err = PTR_ERR(root); err = PTR_ERR(root);
goto out_put_alloc_file; goto out_put_alloc_file;
} }
......
...@@ -156,7 +156,7 @@ static int hfsplus_get_last_session(struct super_block *sb, ...@@ -156,7 +156,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"); pr_err("invalid session number or type of track\n");
return -EINVAL; return -EINVAL;
} }
ms_info.addr_format = CDROM_LBA; ms_info.addr_format = CDROM_LBA;
...@@ -234,8 +234,7 @@ int hfsplus_read_wrapper(struct super_block *sb) ...@@ -234,8 +234,7 @@ int hfsplus_read_wrapper(struct super_block *sb)
error = -EINVAL; error = -EINVAL;
if (sbi->s_backup_vhdr->signature != sbi->s_vhdr->signature) { if (sbi->s_backup_vhdr->signature != sbi->s_vhdr->signature) {
printk(KERN_WARNING pr_warn("invalid secondary volume header\n");
"hfs: invalid secondary volume header\n");
goto out_free_backup_vhdr; goto out_free_backup_vhdr;
} }
...@@ -259,8 +258,7 @@ int hfsplus_read_wrapper(struct super_block *sb) ...@@ -259,8 +258,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(KERN_ERR "hfs: unable to set blocksize to %u!\n", pr_err("unable to set blocksize to %u!\n", blocksize);
blocksize);
goto out_free_backup_vhdr; goto out_free_backup_vhdr;
} }
......
...@@ -107,19 +107,19 @@ int __hfsplus_setxattr(struct inode *inode, const char *name, ...@@ -107,19 +107,19 @@ int __hfsplus_setxattr(struct inode *inode, const char *name,
err = hfs_find_init(HFSPLUS_SB(inode->i_sb)->cat_tree, &cat_fd); err = hfs_find_init(HFSPLUS_SB(inode->i_sb)->cat_tree, &cat_fd);
if (err) { if (err) {
printk(KERN_ERR "hfs: can't init xattr find struct\n"); pr_err("can't init xattr find struct\n");
return err; return err;
} }
err = hfsplus_find_cat(inode->i_sb, inode->i_ino, &cat_fd); err = hfsplus_find_cat(inode->i_sb, inode->i_ino, &cat_fd);
if (err) { if (err) {
printk(KERN_ERR "hfs: catalog searching failed\n"); pr_err("catalog searching failed\n");
goto end_setxattr; goto end_setxattr;
} }
if (!strcmp_xattr_finder_info(name)) { if (!strcmp_xattr_finder_info(name)) {
if (flags & XATTR_CREATE) { if (flags & XATTR_CREATE) {
printk(KERN_ERR "hfs: xattr exists yet\n"); pr_err("xattr exists yet\n");
err = -EOPNOTSUPP; err = -EOPNOTSUPP;
goto end_setxattr; goto end_setxattr;
} }
...@@ -165,7 +165,7 @@ int __hfsplus_setxattr(struct inode *inode, const char *name, ...@@ -165,7 +165,7 @@ int __hfsplus_setxattr(struct inode *inode, const char *name,
if (hfsplus_attr_exists(inode, name)) { if (hfsplus_attr_exists(inode, name)) {
if (flags & XATTR_CREATE) { if (flags & XATTR_CREATE) {
printk(KERN_ERR "hfs: xattr exists yet\n"); pr_err("xattr exists yet\n");
err = -EOPNOTSUPP; err = -EOPNOTSUPP;
goto end_setxattr; goto end_setxattr;
} }
...@@ -177,7 +177,7 @@ int __hfsplus_setxattr(struct inode *inode, const char *name, ...@@ -177,7 +177,7 @@ int __hfsplus_setxattr(struct inode *inode, const char *name,
goto end_setxattr; goto end_setxattr;
} else { } else {
if (flags & XATTR_REPLACE) { if (flags & XATTR_REPLACE) {
printk(KERN_ERR "hfs: cannot replace xattr\n"); pr_err("cannot replace xattr\n");
err = -EOPNOTSUPP; err = -EOPNOTSUPP;
goto end_setxattr; goto end_setxattr;
} }
...@@ -210,7 +210,7 @@ int __hfsplus_setxattr(struct inode *inode, const char *name, ...@@ -210,7 +210,7 @@ int __hfsplus_setxattr(struct inode *inode, const char *name,
cat_entry_flags); cat_entry_flags);
hfsplus_mark_inode_dirty(inode, HFSPLUS_I_CAT_DIRTY); hfsplus_mark_inode_dirty(inode, HFSPLUS_I_CAT_DIRTY);
} else { } else {
printk(KERN_ERR "hfs: invalid catalog entry type\n"); pr_err("invalid catalog entry type\n");
err = -EIO; err = -EIO;
goto end_setxattr; goto end_setxattr;
} }
...@@ -269,7 +269,7 @@ static ssize_t hfsplus_getxattr_finder_info(struct dentry *dentry, ...@@ -269,7 +269,7 @@ static ssize_t hfsplus_getxattr_finder_info(struct dentry *dentry,
if (size >= record_len) { if (size >= record_len) {
res = hfs_find_init(HFSPLUS_SB(inode->i_sb)->cat_tree, &fd); res = hfs_find_init(HFSPLUS_SB(inode->i_sb)->cat_tree, &fd);
if (res) { if (res) {
printk(KERN_ERR "hfs: can't init xattr find struct\n"); pr_err("can't init xattr find struct\n");
return res; return res;
} }
res = hfsplus_find_cat(inode->i_sb, inode->i_ino, &fd); res = hfsplus_find_cat(inode->i_sb, inode->i_ino, &fd);
...@@ -340,13 +340,13 @@ ssize_t hfsplus_getxattr(struct dentry *dentry, const char *name, ...@@ -340,13 +340,13 @@ ssize_t hfsplus_getxattr(struct dentry *dentry, const char *name,
entry = hfsplus_alloc_attr_entry(); entry = hfsplus_alloc_attr_entry();
if (!entry) { if (!entry) {
printk(KERN_ERR "hfs: can't allocate xattr entry\n"); pr_err("can't allocate xattr entry\n");
return -ENOMEM; return -ENOMEM;
} }
res = hfs_find_init(HFSPLUS_SB(inode->i_sb)->attr_tree, &fd); res = hfs_find_init(HFSPLUS_SB(inode->i_sb)->attr_tree, &fd);
if (res) { if (res) {
printk(KERN_ERR "hfs: can't init xattr find struct\n"); pr_err("can't init xattr find struct\n");
goto failed_getxattr_init; goto failed_getxattr_init;
} }
...@@ -355,7 +355,7 @@ ssize_t hfsplus_getxattr(struct dentry *dentry, const char *name, ...@@ -355,7 +355,7 @@ ssize_t hfsplus_getxattr(struct dentry *dentry, const char *name,
if (res == -ENOENT) if (res == -ENOENT)
res = -ENODATA; res = -ENODATA;
else else
printk(KERN_ERR "hfs: xattr searching failed\n"); pr_err("xattr searching failed\n");
goto out; goto out;
} }
...@@ -368,17 +368,17 @@ ssize_t hfsplus_getxattr(struct dentry *dentry, const char *name, ...@@ -368,17 +368,17 @@ ssize_t hfsplus_getxattr(struct dentry *dentry, const char *name,
offsetof(struct hfsplus_attr_inline_data, offsetof(struct hfsplus_attr_inline_data,
length)); length));
if (record_length > HFSPLUS_MAX_INLINE_DATA_SIZE) { if (record_length > HFSPLUS_MAX_INLINE_DATA_SIZE) {
printk(KERN_ERR "hfs: invalid xattr record size\n"); pr_err("invalid xattr record size\n");
res = -EIO; res = -EIO;
goto out; goto out;
} }
} else if (record_type == HFSPLUS_ATTR_FORK_DATA || } else if (record_type == HFSPLUS_ATTR_FORK_DATA ||
record_type == HFSPLUS_ATTR_EXTENTS) { record_type == HFSPLUS_ATTR_EXTENTS) {
printk(KERN_ERR "hfs: only inline data xattr are supported\n"); pr_err("only inline data xattr are supported\n");
res = -EOPNOTSUPP; res = -EOPNOTSUPP;
goto out; goto out;
} else { } else {
printk(KERN_ERR "hfs: invalid xattr record\n"); pr_err("invalid xattr record\n");
res = -EIO; res = -EIO;
goto out; goto out;
} }
...@@ -427,7 +427,7 @@ static ssize_t hfsplus_listxattr_finder_info(struct dentry *dentry, ...@@ -427,7 +427,7 @@ static ssize_t hfsplus_listxattr_finder_info(struct dentry *dentry,
res = hfs_find_init(HFSPLUS_SB(inode->i_sb)->cat_tree, &fd); res = hfs_find_init(HFSPLUS_SB(inode->i_sb)->cat_tree, &fd);
if (res) { if (res) {
printk(KERN_ERR "hfs: can't init xattr find struct\n"); pr_err("can't init xattr find struct\n");
return res; return res;
} }
...@@ -506,7 +506,7 @@ ssize_t hfsplus_listxattr(struct dentry *dentry, char *buffer, size_t size) ...@@ -506,7 +506,7 @@ ssize_t hfsplus_listxattr(struct dentry *dentry, char *buffer, size_t size)
err = hfs_find_init(HFSPLUS_SB(inode->i_sb)->attr_tree, &fd); err = hfs_find_init(HFSPLUS_SB(inode->i_sb)->attr_tree, &fd);
if (err) { if (err) {
printk(KERN_ERR "hfs: can't init xattr find struct\n"); pr_err("can't init xattr find struct\n");
return err; return err;
} }
...@@ -525,8 +525,7 @@ ssize_t hfsplus_listxattr(struct dentry *dentry, char *buffer, size_t size) ...@@ -525,8 +525,7 @@ ssize_t hfsplus_listxattr(struct dentry *dentry, char *buffer, size_t size)
for (;;) { for (;;) {
key_len = hfs_bnode_read_u16(fd.bnode, fd.keyoffset); key_len = hfs_bnode_read_u16(fd.bnode, fd.keyoffset);
if (key_len == 0 || key_len > fd.tree->max_key_len) { if (key_len == 0 || key_len > fd.tree->max_key_len) {
printk(KERN_ERR "hfs: invalid xattr key length: %d\n", pr_err("invalid xattr key length: %d\n", key_len);
key_len);
res = -EIO; res = -EIO;
goto end_listxattr; goto end_listxattr;
} }
...@@ -541,7 +540,7 @@ ssize_t hfsplus_listxattr(struct dentry *dentry, char *buffer, size_t size) ...@@ -541,7 +540,7 @@ ssize_t hfsplus_listxattr(struct dentry *dentry, char *buffer, size_t size)
if (hfsplus_uni2asc(inode->i_sb, if (hfsplus_uni2asc(inode->i_sb,
(const struct hfsplus_unistr *)&fd.key->attr.key_name, (const struct hfsplus_unistr *)&fd.key->attr.key_name,
strbuf, &xattr_name_len)) { strbuf, &xattr_name_len)) {
printk(KERN_ERR "hfs: unicode conversion failed\n"); pr_err("unicode conversion failed\n");
res = -EIO; res = -EIO;
goto end_listxattr; goto end_listxattr;
} }
...@@ -598,13 +597,13 @@ int hfsplus_removexattr(struct dentry *dentry, const char *name) ...@@ -598,13 +597,13 @@ int hfsplus_removexattr(struct dentry *dentry, const char *name)
err = hfs_find_init(HFSPLUS_SB(inode->i_sb)->cat_tree, &cat_fd); err = hfs_find_init(HFSPLUS_SB(inode->i_sb)->cat_tree, &cat_fd);
if (err) { if (err) {
printk(KERN_ERR "hfs: can't init xattr find struct\n"); pr_err("can't init xattr find struct\n");
return err; return err;
} }
err = hfsplus_find_cat(inode->i_sb, inode->i_ino, &cat_fd); err = hfsplus_find_cat(inode->i_sb, inode->i_ino, &cat_fd);
if (err) { if (err) {
printk(KERN_ERR "hfs: catalog searching failed\n"); pr_err("catalog searching failed\n");
goto end_removexattr; goto end_removexattr;
} }
...@@ -643,7 +642,7 @@ int hfsplus_removexattr(struct dentry *dentry, const char *name) ...@@ -643,7 +642,7 @@ int hfsplus_removexattr(struct dentry *dentry, const char *name)
flags); flags);
hfsplus_mark_inode_dirty(inode, HFSPLUS_I_CAT_DIRTY); hfsplus_mark_inode_dirty(inode, HFSPLUS_I_CAT_DIRTY);
} else { } else {
printk(KERN_ERR "hfs: invalid catalog entry type\n"); pr_err("invalid catalog entry type\n");
err = -EIO; err = -EIO;
goto end_removexattr; goto end_removexattr;
} }
......
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