aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2013-04-30 18:27:55 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-04-30 20:04:05 -0400
commitd614267329f2bee7a082ed8781c581c0f3aaa808 (patch)
treeedade57808a2a2e327daf83991a31a76660b7a41
parentc2b3e1f76e5c90215bc7f740b376c0220eb8a8e3 (diff)
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: Joe 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: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--fs/hfs/bfind.c4
-rw-r--r--fs/hfs/bnode.c4
-rw-r--r--fs/hfs/brec.c8
-rw-r--r--fs/hfs/btree.c29
-rw-r--r--fs/hfs/catalog.c4
-rw-r--r--fs/hfs/dir.c12
-rw-r--r--fs/hfs/hfs_fs.h22
-rw-r--r--fs/hfs/mdb.c23
-rw-r--r--fs/hfs/super.c43
-rw-r--r--fs/hfsplus/attributes.c18
-rw-r--r--fs/hfsplus/bfind.c2
-rw-r--r--fs/hfsplus/bitmap.c2
-rw-r--r--fs/hfsplus/bnode.c6
-rw-r--r--fs/hfsplus/brec.c4
-rw-r--r--fs/hfsplus/btree.c25
-rw-r--r--fs/hfsplus/catalog.c4
-rw-r--r--fs/hfsplus/dir.c14
-rw-r--r--fs/hfsplus/extents.c6
-rw-r--r--fs/hfsplus/hfsplus_fs.h22
-rw-r--r--fs/hfsplus/inode.c4
-rw-r--r--fs/hfsplus/options.c22
-rw-r--r--fs/hfsplus/super.c48
-rw-r--r--fs/hfsplus/wrapper.c8
-rw-r--r--fs/hfsplus/xattr.c41
24 files changed, 185 insertions, 190 deletions
diff --git a/fs/hfs/bfind.c b/fs/hfs/bfind.c
index e928f6cfb05b..de69d8a24f6d 100644
--- a/fs/hfs/bfind.c
+++ b/fs/hfs/bfind.c
@@ -137,8 +137,8 @@ int hfs_brec_find(struct hfs_find_data *fd)
137 return res; 137 return res;
138 138
139invalid: 139invalid:
140 printk(KERN_ERR "hfs: inconsistency in B*Tree (%d,%d,%d,%u,%u)\n", 140 pr_err("inconsistency in B*Tree (%d,%d,%d,%u,%u)\n",
141 height, bnode->height, bnode->type, nidx, parent); 141 height, bnode->height, bnode->type, nidx, parent);
142 res = -EIO; 142 res = -EIO;
143release: 143release:
144 hfs_bnode_put(bnode); 144 hfs_bnode_put(bnode);
diff --git a/fs/hfs/bnode.c b/fs/hfs/bnode.c
index 869391902575..f3b1a15ccd59 100644
--- a/fs/hfs/bnode.c
+++ b/fs/hfs/bnode.c
@@ -221,7 +221,7 @@ struct hfs_bnode *hfs_bnode_findhash(struct hfs_btree *tree, u32 cnid)
221 struct hfs_bnode *node; 221 struct hfs_bnode *node;
222 222
223 if (cnid >= tree->node_count) { 223 if (cnid >= tree->node_count) {
224 printk(KERN_ERR "hfs: request for non-existent node %d in B*Tree\n", cnid); 224 pr_err("request for non-existent node %d in B*Tree\n", cnid);
225 return NULL; 225 return NULL;
226 } 226 }
227 227
@@ -244,7 +244,7 @@ static struct hfs_bnode *__hfs_bnode_create(struct hfs_btree *tree, u32 cnid)
244 loff_t off; 244 loff_t off;
245 245
246 if (cnid >= tree->node_count) { 246 if (cnid >= tree->node_count) {
247 printk(KERN_ERR "hfs: request for non-existent node %d in B*Tree\n", cnid); 247 pr_err("request for non-existent node %d in B*Tree\n", cnid);
248 return NULL; 248 return NULL;
249 } 249 }
250 250
diff --git a/fs/hfs/brec.c b/fs/hfs/brec.c
index 57642570c6d8..9f4ee7f52026 100644
--- a/fs/hfs/brec.c
+++ b/fs/hfs/brec.c
@@ -47,15 +47,13 @@ u16 hfs_brec_keylen(struct hfs_bnode *node, u16 rec)
47 if (node->tree->attributes & HFS_TREE_BIGKEYS) { 47 if (node->tree->attributes & HFS_TREE_BIGKEYS) {
48 retval = hfs_bnode_read_u16(node, recoff) + 2; 48 retval = hfs_bnode_read_u16(node, recoff) + 2;
49 if (retval > node->tree->max_key_len + 2) { 49 if (retval > node->tree->max_key_len + 2) {
50 printk(KERN_ERR "hfs: keylen %d too large\n", 50 pr_err("keylen %d too large\n", retval);
51 retval);
52 retval = 0; 51 retval = 0;
53 } 52 }
54 } else { 53 } else {
55 retval = (hfs_bnode_read_u8(node, recoff) | 1) + 1; 54 retval = (hfs_bnode_read_u8(node, recoff) | 1) + 1;
56 if (retval > node->tree->max_key_len + 1) { 55 if (retval > node->tree->max_key_len + 1) {
57 printk(KERN_ERR "hfs: keylen %d too large\n", 56 pr_err("keylen %d too large\n", retval);
58 retval);
59 retval = 0; 57 retval = 0;
60 } 58 }
61 } 59 }
@@ -388,7 +386,7 @@ again:
388 end_off = hfs_bnode_read_u16(parent, end_rec_off); 386 end_off = hfs_bnode_read_u16(parent, end_rec_off);
389 if (end_rec_off - end_off < diff) { 387 if (end_rec_off - end_off < diff) {
390 388
391 printk(KERN_DEBUG "hfs: splitting index node...\n"); 389 printk(KERN_DEBUG "splitting index node...\n");
392 fd->bnode = parent; 390 fd->bnode = parent;
393 new_node = hfs_bnode_split(fd); 391 new_node = hfs_bnode_split(fd);
394 if (IS_ERR(new_node)) 392 if (IS_ERR(new_node))
diff --git a/fs/hfs/btree.c b/fs/hfs/btree.c
index 07d94ce1d278..1ab19e660e69 100644
--- a/fs/hfs/btree.c
+++ b/fs/hfs/btree.c
@@ -48,7 +48,7 @@ struct hfs_btree *hfs_btree_open(struct super_block *sb, u32 id, btree_keycmp ke
48 mdb->drXTFlSize, be32_to_cpu(mdb->drXTClpSiz)); 48 mdb->drXTFlSize, be32_to_cpu(mdb->drXTClpSiz));
49 if (HFS_I(tree->inode)->alloc_blocks > 49 if (HFS_I(tree->inode)->alloc_blocks >
50 HFS_I(tree->inode)->first_blocks) { 50 HFS_I(tree->inode)->first_blocks) {
51 printk(KERN_ERR "hfs: invalid btree extent records\n"); 51 pr_err("invalid btree extent records\n");
52 unlock_new_inode(tree->inode); 52 unlock_new_inode(tree->inode);
53 goto free_inode; 53 goto free_inode;
54 } 54 }
@@ -60,8 +60,7 @@ struct hfs_btree *hfs_btree_open(struct super_block *sb, u32 id, btree_keycmp ke
60 mdb->drCTFlSize, be32_to_cpu(mdb->drCTClpSiz)); 60 mdb->drCTFlSize, be32_to_cpu(mdb->drCTClpSiz));
61 61
62 if (!HFS_I(tree->inode)->first_blocks) { 62 if (!HFS_I(tree->inode)->first_blocks) {
63 printk(KERN_ERR "hfs: invalid btree extent records " 63 pr_err("invalid btree extent records (0 size)\n");
64 "(0 size).\n");
65 unlock_new_inode(tree->inode); 64 unlock_new_inode(tree->inode);
66 goto free_inode; 65 goto free_inode;
67 } 66 }
@@ -100,15 +99,15 @@ struct hfs_btree *hfs_btree_open(struct super_block *sb, u32 id, btree_keycmp ke
100 switch (id) { 99 switch (id) {
101 case HFS_EXT_CNID: 100 case HFS_EXT_CNID:
102 if (tree->max_key_len != HFS_MAX_EXT_KEYLEN) { 101 if (tree->max_key_len != HFS_MAX_EXT_KEYLEN) {
103 printk(KERN_ERR "hfs: invalid extent max_key_len %d\n", 102 pr_err("invalid extent max_key_len %d\n",
104 tree->max_key_len); 103 tree->max_key_len);
105 goto fail_page; 104 goto fail_page;
106 } 105 }
107 break; 106 break;
108 case HFS_CAT_CNID: 107 case HFS_CAT_CNID:
109 if (tree->max_key_len != HFS_MAX_CAT_KEYLEN) { 108 if (tree->max_key_len != HFS_MAX_CAT_KEYLEN) {
110 printk(KERN_ERR "hfs: invalid catalog max_key_len %d\n", 109 pr_err("invalid catalog max_key_len %d\n",
111 tree->max_key_len); 110 tree->max_key_len);
112 goto fail_page; 111 goto fail_page;
113 } 112 }
114 break; 113 break;
@@ -146,8 +145,9 @@ void hfs_btree_close(struct hfs_btree *tree)
146 while ((node = tree->node_hash[i])) { 145 while ((node = tree->node_hash[i])) {
147 tree->node_hash[i] = node->next_hash; 146 tree->node_hash[i] = node->next_hash;
148 if (atomic_read(&node->refcnt)) 147 if (atomic_read(&node->refcnt))
149 printk(KERN_ERR "hfs: node %d:%d still has %d user(s)!\n", 148 pr_err("node %d:%d still has %d user(s)!\n",
150 node->tree->cnid, node->this, atomic_read(&node->refcnt)); 149 node->tree->cnid, node->this,
150 atomic_read(&node->refcnt));
151 hfs_bnode_free(node); 151 hfs_bnode_free(node);
152 tree->node_hash_cnt--; 152 tree->node_hash_cnt--;
153 } 153 }
@@ -290,7 +290,7 @@ struct hfs_bnode *hfs_bmap_alloc(struct hfs_btree *tree)
290 kunmap(*pagep); 290 kunmap(*pagep);
291 nidx = node->next; 291 nidx = node->next;
292 if (!nidx) { 292 if (!nidx) {
293 printk(KERN_DEBUG "hfs: create new bmap node...\n"); 293 printk(KERN_DEBUG "create new bmap node...\n");
294 next_node = hfs_bmap_new_bmap(node, idx); 294 next_node = hfs_bmap_new_bmap(node, idx);
295 } else 295 } else
296 next_node = hfs_bnode_find(tree, nidx); 296 next_node = hfs_bnode_find(tree, nidx);
@@ -331,7 +331,8 @@ void hfs_bmap_free(struct hfs_bnode *node)
331 hfs_bnode_put(node); 331 hfs_bnode_put(node);
332 if (!i) { 332 if (!i) {
333 /* panic */; 333 /* panic */;
334 printk(KERN_CRIT "hfs: unable to free bnode %u. bmap not found!\n", node->this); 334 pr_crit("unable to free bnode %u. bmap not found!\n",
335 node->this);
335 return; 336 return;
336 } 337 }
337 node = hfs_bnode_find(tree, i); 338 node = hfs_bnode_find(tree, i);
@@ -339,7 +340,8 @@ void hfs_bmap_free(struct hfs_bnode *node)
339 return; 340 return;
340 if (node->type != HFS_NODE_MAP) { 341 if (node->type != HFS_NODE_MAP) {
341 /* panic */; 342 /* panic */;
342 printk(KERN_CRIT "hfs: invalid bmap found! (%u,%d)\n", node->this, node->type); 343 pr_crit("invalid bmap found! (%u,%d)\n",
344 node->this, node->type);
343 hfs_bnode_put(node); 345 hfs_bnode_put(node);
344 return; 346 return;
345 } 347 }
@@ -352,7 +354,8 @@ void hfs_bmap_free(struct hfs_bnode *node)
352 m = 1 << (~nidx & 7); 354 m = 1 << (~nidx & 7);
353 byte = data[off]; 355 byte = data[off];
354 if (!(byte & m)) { 356 if (!(byte & m)) {
355 printk(KERN_CRIT "hfs: trying to free free bnode %u(%d)\n", node->this, node->type); 357 pr_crit("trying to free free bnode %u(%d)\n",
358 node->this, node->type);
356 kunmap(page); 359 kunmap(page);
357 hfs_bnode_put(node); 360 hfs_bnode_put(node);
358 return; 361 return;
diff --git a/fs/hfs/catalog.c b/fs/hfs/catalog.c
index 6ecb3d7efb78..ff0316b925a5 100644
--- a/fs/hfs/catalog.c
+++ b/fs/hfs/catalog.c
@@ -187,14 +187,14 @@ int hfs_cat_find_brec(struct super_block *sb, u32 cnid,
187 187
188 type = rec.type; 188 type = rec.type;
189 if (type != HFS_CDR_THD && type != HFS_CDR_FTH) { 189 if (type != HFS_CDR_THD && type != HFS_CDR_FTH) {
190 printk(KERN_ERR "hfs: found bad thread record in catalog\n"); 190 pr_err("found bad thread record in catalog\n");
191 return -EIO; 191 return -EIO;
192 } 192 }
193 193
194 fd->search_key->cat.ParID = rec.thread.ParID; 194 fd->search_key->cat.ParID = rec.thread.ParID;
195 len = fd->search_key->cat.CName.len = rec.thread.CName.len; 195 len = fd->search_key->cat.CName.len = rec.thread.CName.len;
196 if (len > HFS_NAMELEN) { 196 if (len > HFS_NAMELEN) {
197 printk(KERN_ERR "hfs: bad catalog namelength\n"); 197 pr_err("bad catalog namelength\n");
198 return -EIO; 198 return -EIO;
199 } 199 }
200 memcpy(fd->search_key->cat.CName.name, rec.thread.CName.name, len); 200 memcpy(fd->search_key->cat.CName.name, rec.thread.CName.name, len);
diff --git a/fs/hfs/dir.c b/fs/hfs/dir.c
index e1c80482a292..17c22a8fd40a 100644
--- a/fs/hfs/dir.c
+++ b/fs/hfs/dir.c
@@ -88,12 +88,12 @@ static int hfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
88 88
89 hfs_bnode_read(fd.bnode, &entry, fd.entryoffset, fd.entrylength); 89 hfs_bnode_read(fd.bnode, &entry, fd.entryoffset, fd.entrylength);
90 if (entry.type != HFS_CDR_THD) { 90 if (entry.type != HFS_CDR_THD) {
91 printk(KERN_ERR "hfs: bad catalog folder thread\n"); 91 pr_err("bad catalog folder thread\n");
92 err = -EIO; 92 err = -EIO;
93 goto out; 93 goto out;
94 } 94 }
95 //if (fd.entrylength < HFS_MIN_THREAD_SZ) { 95 //if (fd.entrylength < HFS_MIN_THREAD_SZ) {
96 // printk(KERN_ERR "hfs: truncated catalog thread\n"); 96 // pr_err("truncated catalog thread\n");
97 // err = -EIO; 97 // err = -EIO;
98 // goto out; 98 // goto out;
99 //} 99 //}
@@ -112,7 +112,7 @@ static int hfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
112 112
113 for (;;) { 113 for (;;) {
114 if (be32_to_cpu(fd.key->cat.ParID) != inode->i_ino) { 114 if (be32_to_cpu(fd.key->cat.ParID) != inode->i_ino) {
115 printk(KERN_ERR "hfs: walked past end of dir\n"); 115 pr_err("walked past end of dir\n");
116 err = -EIO; 116 err = -EIO;
117 goto out; 117 goto out;
118 } 118 }
@@ -127,7 +127,7 @@ static int hfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
127 len = hfs_mac2asc(sb, strbuf, &fd.key->cat.CName); 127 len = hfs_mac2asc(sb, strbuf, &fd.key->cat.CName);
128 if (type == HFS_CDR_DIR) { 128 if (type == HFS_CDR_DIR) {
129 if (fd.entrylength < sizeof(struct hfs_cat_dir)) { 129 if (fd.entrylength < sizeof(struct hfs_cat_dir)) {
130 printk(KERN_ERR "hfs: small dir entry\n"); 130 pr_err("small dir entry\n");
131 err = -EIO; 131 err = -EIO;
132 goto out; 132 goto out;
133 } 133 }
@@ -136,7 +136,7 @@ static int hfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
136 break; 136 break;
137 } else if (type == HFS_CDR_FIL) { 137 } else if (type == HFS_CDR_FIL) {
138 if (fd.entrylength < sizeof(struct hfs_cat_file)) { 138 if (fd.entrylength < sizeof(struct hfs_cat_file)) {
139 printk(KERN_ERR "hfs: small file entry\n"); 139 pr_err("small file entry\n");
140 err = -EIO; 140 err = -EIO;
141 goto out; 141 goto out;
142 } 142 }
@@ -144,7 +144,7 @@ static int hfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
144 be32_to_cpu(entry.file.FlNum), DT_REG)) 144 be32_to_cpu(entry.file.FlNum), DT_REG))
145 break; 145 break;
146 } else { 146 } else {
147 printk(KERN_ERR "hfs: bad catalog entry type %d\n", type); 147 pr_err("bad catalog entry type %d\n", type);
148 err = -EIO; 148 err = -EIO;
149 goto out; 149 goto out;
150 } 150 }
diff --git a/fs/hfs/hfs_fs.h b/fs/hfs/hfs_fs.h
index d363b1e81ae9..a73b11839a41 100644
--- a/fs/hfs/hfs_fs.h
+++ b/fs/hfs/hfs_fs.h
@@ -9,6 +9,12 @@
9#ifndef _LINUX_HFS_FS_H 9#ifndef _LINUX_HFS_FS_H
10#define _LINUX_HFS_FS_H 10#define _LINUX_HFS_FS_H
11 11
12#ifdef pr_fmt
13#undef pr_fmt
14#endif
15
16#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
17
12#include <linux/slab.h> 18#include <linux/slab.h>
13#include <linux/types.h> 19#include <linux/types.h>
14#include <linux/mutex.h> 20#include <linux/mutex.h>
@@ -34,16 +40,16 @@
34//#define DBG_MASK (DBG_CAT_MOD|DBG_BNODE_REFS|DBG_INODE|DBG_EXTENT) 40//#define DBG_MASK (DBG_CAT_MOD|DBG_BNODE_REFS|DBG_INODE|DBG_EXTENT)
35#define DBG_MASK (0) 41#define DBG_MASK (0)
36 42
37#define hfs_dbg(flg, fmt, ...) \ 43#define hfs_dbg(flg, fmt, ...) \
38do { \ 44do { \
39 if (DBG_##flg & DBG_MASK) \ 45 if (DBG_##flg & DBG_MASK) \
40 printk(KERN_DEBUG fmt, ##__VA_ARGS__); \ 46 printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); \
41} while (0) 47} while (0)
42 48
43#define hfs_dbg_cont(flg, fmt, ...) \ 49#define hfs_dbg_cont(flg, fmt, ...) \
44do { \ 50do { \
45 if (DBG_##flg & DBG_MASK) \ 51 if (DBG_##flg & DBG_MASK) \
46 printk(KERN_CONT fmt, ##__VA_ARGS__); \ 52 pr_cont(fmt, ##__VA_ARGS__); \
47} while (0) 53} while (0)
48 54
49 55
diff --git a/fs/hfs/mdb.c b/fs/hfs/mdb.c
index b7ec224910c5..aa3f0d6d043c 100644
--- a/fs/hfs/mdb.c
+++ b/fs/hfs/mdb.c
@@ -48,7 +48,7 @@ static int hfs_get_last_session(struct super_block *sb,
48 *start = (sector_t)te.cdte_addr.lba << 2; 48 *start = (sector_t)te.cdte_addr.lba << 2;
49 return 0; 49 return 0;
50 } 50 }
51 printk(KERN_ERR "hfs: invalid session number or type of track\n"); 51 pr_err("invalid session number or type of track\n");
52 return -EINVAL; 52 return -EINVAL;
53 } 53 }
54 ms_info.addr_format = CDROM_LBA; 54 ms_info.addr_format = CDROM_LBA;
@@ -101,7 +101,7 @@ int hfs_mdb_get(struct super_block *sb)
101 101
102 HFS_SB(sb)->alloc_blksz = size = be32_to_cpu(mdb->drAlBlkSiz); 102 HFS_SB(sb)->alloc_blksz = size = be32_to_cpu(mdb->drAlBlkSiz);
103 if (!size || (size & (HFS_SECTOR_SIZE - 1))) { 103 if (!size || (size & (HFS_SECTOR_SIZE - 1))) {
104 printk(KERN_ERR "hfs: bad allocation block size %d\n", size); 104 pr_err("bad allocation block size %d\n", size);
105 goto out_bh; 105 goto out_bh;
106 } 106 }
107 107
@@ -118,7 +118,7 @@ int hfs_mdb_get(struct super_block *sb)
118 size >>= 1; 118 size >>= 1;
119 brelse(bh); 119 brelse(bh);
120 if (!sb_set_blocksize(sb, size)) { 120 if (!sb_set_blocksize(sb, size)) {
121 printk(KERN_ERR "hfs: unable to set blocksize to %u\n", size); 121 pr_err("unable to set blocksize to %u\n", size);
122 goto out; 122 goto out;
123 } 123 }
124 124
@@ -162,8 +162,8 @@ int hfs_mdb_get(struct super_block *sb)
162 } 162 }
163 163
164 if (!HFS_SB(sb)->alt_mdb) { 164 if (!HFS_SB(sb)->alt_mdb) {
165 printk(KERN_WARNING "hfs: unable to locate alternate MDB\n"); 165 pr_warn("unable to locate alternate MDB\n");
166 printk(KERN_WARNING "hfs: continuing without an alternate MDB\n"); 166 pr_warn("continuing without an alternate MDB\n");
167 } 167 }
168 168
169 HFS_SB(sb)->bitmap = (__be32 *)__get_free_pages(GFP_KERNEL, PAGE_SIZE < 8192 ? 1 : 0); 169 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 while (size) { 178 while (size) {
179 bh = sb_bread(sb, off >> sb->s_blocksize_bits); 179 bh = sb_bread(sb, off >> sb->s_blocksize_bits);
180 if (!bh) { 180 if (!bh) {
181 printk(KERN_ERR "hfs: unable to read volume bitmap\n"); 181 pr_err("unable to read volume bitmap\n");
182 goto out; 182 goto out;
183 } 183 }
184 off2 = off & (sb->s_blocksize - 1); 184 off2 = off & (sb->s_blocksize - 1);
@@ -192,23 +192,22 @@ int hfs_mdb_get(struct super_block *sb)
192 192
193 HFS_SB(sb)->ext_tree = hfs_btree_open(sb, HFS_EXT_CNID, hfs_ext_keycmp); 193 HFS_SB(sb)->ext_tree = hfs_btree_open(sb, HFS_EXT_CNID, hfs_ext_keycmp);
194 if (!HFS_SB(sb)->ext_tree) { 194 if (!HFS_SB(sb)->ext_tree) {
195 printk(KERN_ERR "hfs: unable to open extent tree\n"); 195 pr_err("unable to open extent tree\n");
196 goto out; 196 goto out;
197 } 197 }
198 HFS_SB(sb)->cat_tree = hfs_btree_open(sb, HFS_CAT_CNID, hfs_cat_keycmp); 198 HFS_SB(sb)->cat_tree = hfs_btree_open(sb, HFS_CAT_CNID, hfs_cat_keycmp);
199 if (!HFS_SB(sb)->cat_tree) { 199 if (!HFS_SB(sb)->cat_tree) {
200 printk(KERN_ERR "hfs: unable to open catalog tree\n"); 200 pr_err("unable to open catalog tree\n");
201 goto out; 201 goto out;
202 } 202 }
203 203
204 attrib = mdb->drAtrb; 204 attrib = mdb->drAtrb;
205 if (!(attrib & cpu_to_be16(HFS_SB_ATTRIB_UNMNT))) { 205 if (!(attrib & cpu_to_be16(HFS_SB_ATTRIB_UNMNT))) {
206 printk(KERN_WARNING "hfs: filesystem was not cleanly unmounted, " 206 pr_warn("filesystem was not cleanly unmounted, running fsck.hfs is recommended. mounting read-only.\n");
207 "running fsck.hfs is recommended. mounting read-only.\n");
208 sb->s_flags |= MS_RDONLY; 207 sb->s_flags |= MS_RDONLY;
209 } 208 }
210 if ((attrib & cpu_to_be16(HFS_SB_ATTRIB_SLOCK))) { 209 if ((attrib & cpu_to_be16(HFS_SB_ATTRIB_SLOCK))) {
211 printk(KERN_WARNING "hfs: filesystem is marked locked, mounting read-only.\n"); 210 pr_warn("filesystem is marked locked, mounting read-only.\n");
212 sb->s_flags |= MS_RDONLY; 211 sb->s_flags |= MS_RDONLY;
213 } 212 }
214 if (!(sb->s_flags & MS_RDONLY)) { 213 if (!(sb->s_flags & MS_RDONLY)) {
@@ -312,7 +311,7 @@ void hfs_mdb_commit(struct super_block *sb)
312 while (size) { 311 while (size) {
313 bh = sb_bread(sb, block); 312 bh = sb_bread(sb, block);
314 if (!bh) { 313 if (!bh) {
315 printk(KERN_ERR "hfs: unable to read volume bitmap\n"); 314 pr_err("unable to read volume bitmap\n");
316 break; 315 break;
317 } 316 }
318 len = min((int)sb->s_blocksize - off, size); 317 len = min((int)sb->s_blocksize - off, size);
diff --git a/fs/hfs/super.c b/fs/hfs/super.c
index 719760b2b0a6..2d2039e754cd 100644
--- a/fs/hfs/super.c
+++ b/fs/hfs/super.c
@@ -117,12 +117,11 @@ static int hfs_remount(struct super_block *sb, int *flags, char *data)
117 return 0; 117 return 0;
118 if (!(*flags & MS_RDONLY)) { 118 if (!(*flags & MS_RDONLY)) {
119 if (!(HFS_SB(sb)->mdb->drAtrb & cpu_to_be16(HFS_SB_ATTRIB_UNMNT))) { 119 if (!(HFS_SB(sb)->mdb->drAtrb & cpu_to_be16(HFS_SB_ATTRIB_UNMNT))) {
120 printk(KERN_WARNING "hfs: filesystem was not cleanly unmounted, " 120 pr_warn("filesystem was not cleanly unmounted, running fsck.hfs is recommended. leaving read-only.\n");
121 "running fsck.hfs is recommended. leaving read-only.\n");
122 sb->s_flags |= MS_RDONLY; 121 sb->s_flags |= MS_RDONLY;
123 *flags |= MS_RDONLY; 122 *flags |= MS_RDONLY;
124 } else if (HFS_SB(sb)->mdb->drAtrb & cpu_to_be16(HFS_SB_ATTRIB_SLOCK)) { 123 } else if (HFS_SB(sb)->mdb->drAtrb & cpu_to_be16(HFS_SB_ATTRIB_SLOCK)) {
125 printk(KERN_WARNING "hfs: filesystem is marked locked, leaving read-only.\n"); 124 pr_warn("filesystem is marked locked, leaving read-only.\n");
126 sb->s_flags |= MS_RDONLY; 125 sb->s_flags |= MS_RDONLY;
127 *flags |= MS_RDONLY; 126 *flags |= MS_RDONLY;
128 } 127 }
@@ -253,29 +252,29 @@ static int parse_options(char *options, struct hfs_sb_info *hsb)
253 switch (token) { 252 switch (token) {
254 case opt_uid: 253 case opt_uid:
255 if (match_int(&args[0], &tmp)) { 254 if (match_int(&args[0], &tmp)) {
256 printk(KERN_ERR "hfs: uid requires an argument\n"); 255 pr_err("uid requires an argument\n");
257 return 0; 256 return 0;
258 } 257 }
259 hsb->s_uid = make_kuid(current_user_ns(), (uid_t)tmp); 258 hsb->s_uid = make_kuid(current_user_ns(), (uid_t)tmp);
260 if (!uid_valid(hsb->s_uid)) { 259 if (!uid_valid(hsb->s_uid)) {
261 printk(KERN_ERR "hfs: invalid uid %d\n", tmp); 260 pr_err("invalid uid %d\n", tmp);
262 return 0; 261 return 0;
263 } 262 }
264 break; 263 break;
265 case opt_gid: 264 case opt_gid:
266 if (match_int(&args[0], &tmp)) { 265 if (match_int(&args[0], &tmp)) {
267 printk(KERN_ERR "hfs: gid requires an argument\n"); 266 pr_err("gid requires an argument\n");
268 return 0; 267 return 0;
269 } 268 }
270 hsb->s_gid = make_kgid(current_user_ns(), (gid_t)tmp); 269 hsb->s_gid = make_kgid(current_user_ns(), (gid_t)tmp);
271 if (!gid_valid(hsb->s_gid)) { 270 if (!gid_valid(hsb->s_gid)) {
272 printk(KERN_ERR "hfs: invalid gid %d\n", tmp); 271 pr_err("invalid gid %d\n", tmp);
273 return 0; 272 return 0;
274 } 273 }
275 break; 274 break;
276 case opt_umask: 275 case opt_umask:
277 if (match_octal(&args[0], &tmp)) { 276 if (match_octal(&args[0], &tmp)) {
278 printk(KERN_ERR "hfs: umask requires a value\n"); 277 pr_err("umask requires a value\n");
279 return 0; 278 return 0;
280 } 279 }
281 hsb->s_file_umask = (umode_t)tmp; 280 hsb->s_file_umask = (umode_t)tmp;
@@ -283,39 +282,39 @@ static int parse_options(char *options, struct hfs_sb_info *hsb)
283 break; 282 break;
284 case opt_file_umask: 283 case opt_file_umask:
285 if (match_octal(&args[0], &tmp)) { 284 if (match_octal(&args[0], &tmp)) {
286 printk(KERN_ERR "hfs: file_umask requires a value\n"); 285 pr_err("file_umask requires a value\n");
287 return 0; 286 return 0;
288 } 287 }
289 hsb->s_file_umask = (umode_t)tmp; 288 hsb->s_file_umask = (umode_t)tmp;
290 break; 289 break;
291 case opt_dir_umask: 290 case opt_dir_umask:
292 if (match_octal(&args[0], &tmp)) { 291 if (match_octal(&args[0], &tmp)) {
293 printk(KERN_ERR "hfs: dir_umask requires a value\n"); 292 pr_err("dir_umask requires a value\n");
294 return 0; 293 return 0;
295 } 294 }
296 hsb->s_dir_umask = (umode_t)tmp; 295 hsb->s_dir_umask = (umode_t)tmp;
297 break; 296 break;
298 case opt_part: 297 case opt_part:
299 if (match_int(&args[0], &hsb->part)) { 298 if (match_int(&args[0], &hsb->part)) {
300 printk(KERN_ERR "hfs: part requires an argument\n"); 299 pr_err("part requires an argument\n");
301 return 0; 300 return 0;
302 } 301 }
303 break; 302 break;
304 case opt_session: 303 case opt_session:
305 if (match_int(&args[0], &hsb->session)) { 304 if (match_int(&args[0], &hsb->session)) {
306 printk(KERN_ERR "hfs: session requires an argument\n"); 305 pr_err("session requires an argument\n");
307 return 0; 306 return 0;
308 } 307 }
309 break; 308 break;
310 case opt_type: 309 case opt_type:
311 if (match_fourchar(&args[0], &hsb->s_type)) { 310 if (match_fourchar(&args[0], &hsb->s_type)) {
312 printk(KERN_ERR "hfs: type requires a 4 character value\n"); 311 pr_err("type requires a 4 character value\n");
313 return 0; 312 return 0;
314 } 313 }
315 break; 314 break;
316 case opt_creator: 315 case opt_creator:
317 if (match_fourchar(&args[0], &hsb->s_creator)) { 316 if (match_fourchar(&args[0], &hsb->s_creator)) {
318 printk(KERN_ERR "hfs: creator requires a 4 character value\n"); 317 pr_err("creator requires a 4 character value\n");
319 return 0; 318 return 0;
320 } 319 }
321 break; 320 break;
@@ -324,14 +323,14 @@ static int parse_options(char *options, struct hfs_sb_info *hsb)
324 break; 323 break;
325 case opt_codepage: 324 case opt_codepage:
326 if (hsb->nls_disk) { 325 if (hsb->nls_disk) {
327 printk(KERN_ERR "hfs: unable to change codepage\n"); 326 pr_err("unable to change codepage\n");
328 return 0; 327 return 0;
329 } 328 }
330 p = match_strdup(&args[0]); 329 p = match_strdup(&args[0]);
331 if (p) 330 if (p)
332 hsb->nls_disk = load_nls(p); 331 hsb->nls_disk = load_nls(p);
333 if (!hsb->nls_disk) { 332 if (!hsb->nls_disk) {
334 printk(KERN_ERR "hfs: unable to load codepage \"%s\"\n", p); 333 pr_err("unable to load codepage \"%s\"\n", p);
335 kfree(p); 334 kfree(p);
336 return 0; 335 return 0;
337 } 336 }
@@ -339,14 +338,14 @@ static int parse_options(char *options, struct hfs_sb_info *hsb)
339 break; 338 break;
340 case opt_iocharset: 339 case opt_iocharset:
341 if (hsb->nls_io) { 340 if (hsb->nls_io) {
342 printk(KERN_ERR "hfs: unable to change iocharset\n"); 341 pr_err("unable to change iocharset\n");
343 return 0; 342 return 0;
344 } 343 }
345 p = match_strdup(&args[0]); 344 p = match_strdup(&args[0]);
346 if (p) 345 if (p)
347 hsb->nls_io = load_nls(p); 346 hsb->nls_io = load_nls(p);
348 if (!hsb->nls_io) { 347 if (!hsb->nls_io) {
349 printk(KERN_ERR "hfs: unable to load iocharset \"%s\"\n", p); 348 pr_err("unable to load iocharset \"%s\"\n", p);
350 kfree(p); 349 kfree(p);
351 return 0; 350 return 0;
352 } 351 }
@@ -360,7 +359,7 @@ static int parse_options(char *options, struct hfs_sb_info *hsb)
360 if (hsb->nls_disk && !hsb->nls_io) { 359 if (hsb->nls_disk && !hsb->nls_io) {
361 hsb->nls_io = load_nls_default(); 360 hsb->nls_io = load_nls_default();
362 if (!hsb->nls_io) { 361 if (!hsb->nls_io) {
363 printk(KERN_ERR "hfs: unable to load default iocharset\n"); 362 pr_err("unable to load default iocharset\n");
364 return 0; 363 return 0;
365 } 364 }
366 } 365 }
@@ -400,7 +399,7 @@ static int hfs_fill_super(struct super_block *sb, void *data, int silent)
400 399
401 res = -EINVAL; 400 res = -EINVAL;
402 if (!parse_options((char *)data, sbi)) { 401 if (!parse_options((char *)data, sbi)) {
403 printk(KERN_ERR "hfs: unable to parse mount options.\n"); 402 pr_err("unable to parse mount options\n");
404 goto bail; 403 goto bail;
405 } 404 }
406 405
@@ -411,7 +410,7 @@ static int hfs_fill_super(struct super_block *sb, void *data, int silent)
411 res = hfs_mdb_get(sb); 410 res = hfs_mdb_get(sb);
412 if (res) { 411 if (res) {
413 if (!silent) 412 if (!silent)
414 printk(KERN_WARNING "hfs: can't find a HFS filesystem on dev %s.\n", 413 pr_warn("can't find a HFS filesystem on dev %s\n",
415 hfs_mdb_name(sb)); 414 hfs_mdb_name(sb));
416 res = -EINVAL; 415 res = -EINVAL;
417 goto bail; 416 goto bail;
@@ -449,7 +448,7 @@ static int hfs_fill_super(struct super_block *sb, void *data, int silent)
449 return 0; 448 return 0;
450 449
451bail_no_root: 450bail_no_root:
452 printk(KERN_ERR "hfs: get root inode failed.\n"); 451 pr_err("get root inode failed\n");
453bail: 452bail:
454 hfs_mdb_put(sb); 453 hfs_mdb_put(sb);
455 return res; 454 return res;
diff --git a/fs/hfsplus/attributes.c b/fs/hfsplus/attributes.c
index 2043b50c5418..0f47890299c4 100644
--- a/fs/hfsplus/attributes.c
+++ b/fs/hfsplus/attributes.c
@@ -56,7 +56,7 @@ int hfsplus_attr_build_key(struct super_block *sb, hfsplus_btree_key *key,
56 if (name) { 56 if (name) {
57 len = strlen(name); 57 len = strlen(name);
58 if (len > HFSPLUS_ATTR_MAX_STRLEN) { 58 if (len > HFSPLUS_ATTR_MAX_STRLEN) {
59 printk(KERN_ERR "hfs: invalid xattr name's length\n"); 59 pr_err("invalid xattr name's length\n");
60 return -EINVAL; 60 return -EINVAL;
61 } 61 }
62 hfsplus_asc2uni(sb, 62 hfsplus_asc2uni(sb,
@@ -169,7 +169,7 @@ int hfsplus_find_attr(struct super_block *sb, u32 cnid,
169 hfs_dbg(ATTR_MOD, "find_attr: %s,%d\n", name ? name : NULL, cnid); 169 hfs_dbg(ATTR_MOD, "find_attr: %s,%d\n", name ? name : NULL, cnid);
170 170
171 if (!HFSPLUS_SB(sb)->attr_tree) { 171 if (!HFSPLUS_SB(sb)->attr_tree) {
172 printk(KERN_ERR "hfs: attributes file doesn't exist\n"); 172 pr_err("attributes file doesn't exist\n");
173 return -EINVAL; 173 return -EINVAL;
174 } 174 }
175 175
@@ -232,7 +232,7 @@ int hfsplus_create_attr(struct inode *inode,
232 name ? name : NULL, inode->i_ino); 232 name ? name : NULL, inode->i_ino);
233 233
234 if (!HFSPLUS_SB(sb)->attr_tree) { 234 if (!HFSPLUS_SB(sb)->attr_tree) {
235 printk(KERN_ERR "hfs: attributes file doesn't exist\n"); 235 pr_err("attributes file doesn't exist\n");
236 return -EINVAL; 236 return -EINVAL;
237 } 237 }
238 238
@@ -307,10 +307,10 @@ static int __hfsplus_delete_attr(struct inode *inode, u32 cnid,
307 break; 307 break;
308 case HFSPLUS_ATTR_FORK_DATA: 308 case HFSPLUS_ATTR_FORK_DATA:
309 case HFSPLUS_ATTR_EXTENTS: 309 case HFSPLUS_ATTR_EXTENTS:
310 printk(KERN_ERR "hfs: only inline data xattr are supported\n"); 310 pr_err("only inline data xattr are supported\n");
311 return -EOPNOTSUPP; 311 return -EOPNOTSUPP;
312 default: 312 default:
313 printk(KERN_ERR "hfs: invalid extended attribute record\n"); 313 pr_err("invalid extended attribute record\n");
314 return -ENOENT; 314 return -ENOENT;
315 } 315 }
316 316
@@ -332,7 +332,7 @@ int hfsplus_delete_attr(struct inode *inode, const char *name)
332 name ? name : NULL, inode->i_ino); 332 name ? name : NULL, inode->i_ino);
333 333
334 if (!HFSPLUS_SB(sb)->attr_tree) { 334 if (!HFSPLUS_SB(sb)->attr_tree) {
335 printk(KERN_ERR "hfs: attributes file doesn't exist\n"); 335 pr_err("attributes file doesn't exist\n");
336 return -EINVAL; 336 return -EINVAL;
337 } 337 }
338 338
@@ -346,7 +346,7 @@ int hfsplus_delete_attr(struct inode *inode, const char *name)
346 if (err) 346 if (err)
347 goto out; 347 goto out;
348 } else { 348 } else {
349 printk(KERN_ERR "hfs: invalid extended attribute name\n"); 349 pr_err("invalid extended attribute name\n");
350 err = -EINVAL; 350 err = -EINVAL;
351 goto out; 351 goto out;
352 } 352 }
@@ -372,7 +372,7 @@ int hfsplus_delete_all_attrs(struct inode *dir, u32 cnid)
372 hfs_dbg(ATTR_MOD, "delete_all_attrs: %d\n", cnid); 372 hfs_dbg(ATTR_MOD, "delete_all_attrs: %d\n", cnid);
373 373
374 if (!HFSPLUS_SB(dir->i_sb)->attr_tree) { 374 if (!HFSPLUS_SB(dir->i_sb)->attr_tree) {
375 printk(KERN_ERR "hfs: attributes file doesn't exist\n"); 375 pr_err("attributes file doesn't exist\n");
376 return -EINVAL; 376 return -EINVAL;
377 } 377 }
378 378
@@ -384,7 +384,7 @@ int hfsplus_delete_all_attrs(struct inode *dir, u32 cnid)
384 err = hfsplus_find_attr(dir->i_sb, cnid, NULL, &fd); 384 err = hfsplus_find_attr(dir->i_sb, cnid, NULL, &fd);
385 if (err) { 385 if (err) {
386 if (err != -ENOENT) 386 if (err != -ENOENT)
387 printk(KERN_ERR "hfs: xattr search failed.\n"); 387 pr_err("xattr search failed\n");
388 goto end_delete_all; 388 goto end_delete_all;
389 } 389 }
390 390
diff --git a/fs/hfsplus/bfind.c b/fs/hfsplus/bfind.c
index d27f37f04ffc..c1422d91cd36 100644
--- a/fs/hfsplus/bfind.c
+++ b/fs/hfsplus/bfind.c
@@ -208,7 +208,7 @@ int hfs_brec_find(struct hfs_find_data *fd, search_strategy_t do_key_compare)
208 return res; 208 return res;
209 209
210invalid: 210invalid:
211 printk(KERN_ERR "hfs: inconsistency in B*Tree (%d,%d,%d,%u,%u)\n", 211 pr_err("inconsistency in B*Tree (%d,%d,%d,%u,%u)\n",
212 height, bnode->height, bnode->type, nidx, parent); 212 height, bnode->height, bnode->type, nidx, parent);
213 res = -EIO; 213 res = -EIO;
214release: 214release:
diff --git a/fs/hfsplus/bitmap.c b/fs/hfsplus/bitmap.c
index 7da6d46882a1..826e864acb54 100644
--- a/fs/hfsplus/bitmap.c
+++ b/fs/hfsplus/bitmap.c
@@ -238,7 +238,7 @@ out:
238 return 0; 238 return 0;
239 239
240kaboom: 240kaboom:
241 printk(KERN_CRIT "hfsplus: unable to mark blocks free: error %ld\n", 241 pr_crit("hfsplus: unable to mark blocks free: error %ld\n",
242 PTR_ERR(page)); 242 PTR_ERR(page));
243 mutex_unlock(&sbi->alloc_mutex); 243 mutex_unlock(&sbi->alloc_mutex);
244 244
diff --git a/fs/hfsplus/bnode.c b/fs/hfsplus/bnode.c
index 1ca93044644c..11c860204520 100644
--- a/fs/hfsplus/bnode.c
+++ b/fs/hfsplus/bnode.c
@@ -386,7 +386,7 @@ struct hfs_bnode *hfs_bnode_findhash(struct hfs_btree *tree, u32 cnid)
386 struct hfs_bnode *node; 386 struct hfs_bnode *node;
387 387
388 if (cnid >= tree->node_count) { 388 if (cnid >= tree->node_count) {
389 printk(KERN_ERR "hfs: request for non-existent node " 389 pr_err("request for non-existent node "
390 "%d in B*Tree\n", 390 "%d in B*Tree\n",
391 cnid); 391 cnid);
392 return NULL; 392 return NULL;
@@ -409,7 +409,7 @@ static struct hfs_bnode *__hfs_bnode_create(struct hfs_btree *tree, u32 cnid)
409 loff_t off; 409 loff_t off;
410 410
411 if (cnid >= tree->node_count) { 411 if (cnid >= tree->node_count) {
412 printk(KERN_ERR "hfs: request for non-existent node " 412 pr_err("request for non-existent node "
413 "%d in B*Tree\n", 413 "%d in B*Tree\n",
414 cnid); 414 cnid);
415 return NULL; 415 return NULL;
@@ -588,7 +588,7 @@ struct hfs_bnode *hfs_bnode_create(struct hfs_btree *tree, u32 num)
588 node = hfs_bnode_findhash(tree, num); 588 node = hfs_bnode_findhash(tree, num);
589 spin_unlock(&tree->hash_lock); 589 spin_unlock(&tree->hash_lock);
590 if (node) { 590 if (node) {
591 printk(KERN_CRIT "new node %u already hashed?\n", num); 591 pr_crit("new node %u already hashed?\n", num);
592 WARN_ON(1); 592 WARN_ON(1);
593 return node; 593 return node;
594 } 594 }
diff --git a/fs/hfsplus/brec.c b/fs/hfsplus/brec.c
index e238ba8cce26..6e560d56094b 100644
--- a/fs/hfsplus/brec.c
+++ b/fs/hfsplus/brec.c
@@ -45,13 +45,13 @@ u16 hfs_brec_keylen(struct hfs_bnode *node, u16 rec)
45 if (!recoff) 45 if (!recoff)
46 return 0; 46 return 0;
47 if (recoff > node->tree->node_size - 2) { 47 if (recoff > node->tree->node_size - 2) {
48 printk(KERN_ERR "hfs: recoff %d too large\n", recoff); 48 pr_err("recoff %d too large\n", recoff);
49 return 0; 49 return 0;
50 } 50 }
51 51
52 retval = hfs_bnode_read_u16(node, recoff) + 2; 52 retval = hfs_bnode_read_u16(node, recoff) + 2;
53 if (retval > node->tree->max_key_len + 2) { 53 if (retval > node->tree->max_key_len + 2) {
54 printk(KERN_ERR "hfs: keylen %d too large\n", 54 pr_err("keylen %d too large\n",
55 retval); 55 retval);
56 retval = 0; 56 retval = 0;
57 } 57 }
diff --git a/fs/hfsplus/btree.c b/fs/hfsplus/btree.c
index c2fa4bf5629c..0c6540c91167 100644
--- a/fs/hfsplus/btree.c
+++ b/fs/hfsplus/btree.c
@@ -40,8 +40,7 @@ struct hfs_btree *hfs_btree_open(struct super_block *sb, u32 id)
40 tree->inode = inode; 40 tree->inode = inode;
41 41
42 if (!HFSPLUS_I(tree->inode)->first_blocks) { 42 if (!HFSPLUS_I(tree->inode)->first_blocks) {
43 printk(KERN_ERR 43 pr_err("invalid btree extent records (0 size)\n");
44 "hfs: invalid btree extent records (0 size).\n");
45 goto free_inode; 44 goto free_inode;
46 } 45 }
47 46
@@ -68,12 +67,12 @@ struct hfs_btree *hfs_btree_open(struct super_block *sb, u32 id)
68 switch (id) { 67 switch (id) {
69 case HFSPLUS_EXT_CNID: 68 case HFSPLUS_EXT_CNID:
70 if (tree->max_key_len != HFSPLUS_EXT_KEYLEN - sizeof(u16)) { 69 if (tree->max_key_len != HFSPLUS_EXT_KEYLEN - sizeof(u16)) {
71 printk(KERN_ERR "hfs: invalid extent max_key_len %d\n", 70 pr_err("invalid extent max_key_len %d\n",
72 tree->max_key_len); 71 tree->max_key_len);
73 goto fail_page; 72 goto fail_page;
74 } 73 }
75 if (tree->attributes & HFS_TREE_VARIDXKEYS) { 74 if (tree->attributes & HFS_TREE_VARIDXKEYS) {
76 printk(KERN_ERR "hfs: invalid extent btree flag\n"); 75 pr_err("invalid extent btree flag\n");
77 goto fail_page; 76 goto fail_page;
78 } 77 }
79 78
@@ -81,12 +80,12 @@ struct hfs_btree *hfs_btree_open(struct super_block *sb, u32 id)
81 break; 80 break;
82 case HFSPLUS_CAT_CNID: 81 case HFSPLUS_CAT_CNID:
83 if (tree->max_key_len != HFSPLUS_CAT_KEYLEN - sizeof(u16)) { 82 if (tree->max_key_len != HFSPLUS_CAT_KEYLEN - sizeof(u16)) {
84 printk(KERN_ERR "hfs: invalid catalog max_key_len %d\n", 83 pr_err("invalid catalog max_key_len %d\n",
85 tree->max_key_len); 84 tree->max_key_len);
86 goto fail_page; 85 goto fail_page;
87 } 86 }
88 if (!(tree->attributes & HFS_TREE_VARIDXKEYS)) { 87 if (!(tree->attributes & HFS_TREE_VARIDXKEYS)) {
89 printk(KERN_ERR "hfs: invalid catalog btree flag\n"); 88 pr_err("invalid catalog btree flag\n");
90 goto fail_page; 89 goto fail_page;
91 } 90 }
92 91
@@ -100,19 +99,19 @@ struct hfs_btree *hfs_btree_open(struct super_block *sb, u32 id)
100 break; 99 break;
101 case HFSPLUS_ATTR_CNID: 100 case HFSPLUS_ATTR_CNID:
102 if (tree->max_key_len != HFSPLUS_ATTR_KEYLEN - sizeof(u16)) { 101 if (tree->max_key_len != HFSPLUS_ATTR_KEYLEN - sizeof(u16)) {
103 printk(KERN_ERR "hfs: invalid attributes max_key_len %d\n", 102 pr_err("invalid attributes max_key_len %d\n",
104 tree->max_key_len); 103 tree->max_key_len);
105 goto fail_page; 104 goto fail_page;
106 } 105 }
107 tree->keycmp = hfsplus_attr_bin_cmp_key; 106 tree->keycmp = hfsplus_attr_bin_cmp_key;
108 break; 107 break;
109 default: 108 default:
110 printk(KERN_ERR "hfs: unknown B*Tree requested\n"); 109 pr_err("unknown B*Tree requested\n");
111 goto fail_page; 110 goto fail_page;
112 } 111 }
113 112
114 if (!(tree->attributes & HFS_TREE_BIGKEYS)) { 113 if (!(tree->attributes & HFS_TREE_BIGKEYS)) {
115 printk(KERN_ERR "hfs: invalid btree flag\n"); 114 pr_err("invalid btree flag\n");
116 goto fail_page; 115 goto fail_page;
117 } 116 }
118 117
@@ -155,7 +154,7 @@ void hfs_btree_close(struct hfs_btree *tree)
155 while ((node = tree->node_hash[i])) { 154 while ((node = tree->node_hash[i])) {
156 tree->node_hash[i] = node->next_hash; 155 tree->node_hash[i] = node->next_hash;
157 if (atomic_read(&node->refcnt)) 156 if (atomic_read(&node->refcnt))
158 printk(KERN_CRIT "hfs: node %d:%d " 157 pr_crit("node %d:%d "
159 "still has %d user(s)!\n", 158 "still has %d user(s)!\n",
160 node->tree->cnid, node->this, 159 node->tree->cnid, node->this,
161 atomic_read(&node->refcnt)); 160 atomic_read(&node->refcnt));
@@ -345,7 +344,7 @@ void hfs_bmap_free(struct hfs_bnode *node)
345 hfs_bnode_put(node); 344 hfs_bnode_put(node);
346 if (!i) { 345 if (!i) {
347 /* panic */; 346 /* panic */;
348 printk(KERN_CRIT "hfs: unable to free bnode %u. " 347 pr_crit("unable to free bnode %u. "
349 "bmap not found!\n", 348 "bmap not found!\n",
350 node->this); 349 node->this);
351 return; 350 return;
@@ -355,7 +354,7 @@ void hfs_bmap_free(struct hfs_bnode *node)
355 return; 354 return;
356 if (node->type != HFS_NODE_MAP) { 355 if (node->type != HFS_NODE_MAP) {
357 /* panic */; 356 /* panic */;
358 printk(KERN_CRIT "hfs: invalid bmap found! " 357 pr_crit("invalid bmap found! "
359 "(%u,%d)\n", 358 "(%u,%d)\n",
360 node->this, node->type); 359 node->this, node->type);
361 hfs_bnode_put(node); 360 hfs_bnode_put(node);
@@ -370,7 +369,7 @@ void hfs_bmap_free(struct hfs_bnode *node)
370 m = 1 << (~nidx & 7); 369 m = 1 << (~nidx & 7);
371 byte = data[off]; 370 byte = data[off];
372 if (!(byte & m)) { 371 if (!(byte & m)) {
373 printk(KERN_CRIT "hfs: trying to free free bnode " 372 pr_crit("trying to free free bnode "
374 "%u(%d)\n", 373 "%u(%d)\n",
375 node->this, node->type); 374 node->this, node->type);
376 kunmap(page); 375 kunmap(page);
diff --git a/fs/hfsplus/catalog.c b/fs/hfsplus/catalog.c
index 12cea2370713..968ce411db53 100644
--- a/fs/hfsplus/catalog.c
+++ b/fs/hfsplus/catalog.c
@@ -188,12 +188,12 @@ int hfsplus_find_cat(struct super_block *sb, u32 cnid,
188 188
189 type = be16_to_cpu(tmp.type); 189 type = be16_to_cpu(tmp.type);
190 if (type != HFSPLUS_FOLDER_THREAD && type != HFSPLUS_FILE_THREAD) { 190 if (type != HFSPLUS_FOLDER_THREAD && type != HFSPLUS_FILE_THREAD) {
191 printk(KERN_ERR "hfs: found bad thread record in catalog\n"); 191 pr_err("found bad thread record in catalog\n");
192 return -EIO; 192 return -EIO;
193 } 193 }
194 194
195 if (be16_to_cpu(tmp.thread.nodeName.length) > 255) { 195 if (be16_to_cpu(tmp.thread.nodeName.length) > 255) {
196 printk(KERN_ERR "hfs: catalog name length corrupted\n"); 196 pr_err("catalog name length corrupted\n");
197 return -EIO; 197 return -EIO;
198 } 198 }
199 199
diff --git a/fs/hfsplus/dir.c b/fs/hfsplus/dir.c
index 031c24e50521..a37ac934732f 100644
--- a/fs/hfsplus/dir.c
+++ b/fs/hfsplus/dir.c
@@ -103,7 +103,7 @@ again:
103 } else if (!dentry->d_fsdata) 103 } else if (!dentry->d_fsdata)
104 dentry->d_fsdata = (void *)(unsigned long)cnid; 104 dentry->d_fsdata = (void *)(unsigned long)cnid;
105 } else { 105 } else {
106 printk(KERN_ERR "hfs: invalid catalog entry type in lookup\n"); 106 pr_err("invalid catalog entry type in lookup\n");
107 err = -EIO; 107 err = -EIO;
108 goto fail; 108 goto fail;
109 } 109 }
@@ -159,12 +159,12 @@ static int hfsplus_readdir(struct file *filp, void *dirent, filldir_t filldir)
159 hfs_bnode_read(fd.bnode, &entry, fd.entryoffset, 159 hfs_bnode_read(fd.bnode, &entry, fd.entryoffset,
160 fd.entrylength); 160 fd.entrylength);
161 if (be16_to_cpu(entry.type) != HFSPLUS_FOLDER_THREAD) { 161 if (be16_to_cpu(entry.type) != HFSPLUS_FOLDER_THREAD) {
162 printk(KERN_ERR "hfs: bad catalog folder thread\n"); 162 pr_err("bad catalog folder thread\n");
163 err = -EIO; 163 err = -EIO;
164 goto out; 164 goto out;
165 } 165 }
166 if (fd.entrylength < HFSPLUS_MIN_THREAD_SZ) { 166 if (fd.entrylength < HFSPLUS_MIN_THREAD_SZ) {
167 printk(KERN_ERR "hfs: truncated catalog thread\n"); 167 pr_err("truncated catalog thread\n");
168 err = -EIO; 168 err = -EIO;
169 goto out; 169 goto out;
170 } 170 }
@@ -183,7 +183,7 @@ static int hfsplus_readdir(struct file *filp, void *dirent, filldir_t filldir)
183 183
184 for (;;) { 184 for (;;) {
185 if (be32_to_cpu(fd.key->cat.parent) != inode->i_ino) { 185 if (be32_to_cpu(fd.key->cat.parent) != inode->i_ino) {
186 printk(KERN_ERR "hfs: walked past end of dir\n"); 186 pr_err("walked past end of dir\n");
187 err = -EIO; 187 err = -EIO;
188 goto out; 188 goto out;
189 } 189 }
@@ -203,7 +203,7 @@ static int hfsplus_readdir(struct file *filp, void *dirent, filldir_t filldir)
203 if (type == HFSPLUS_FOLDER) { 203 if (type == HFSPLUS_FOLDER) {
204 if (fd.entrylength < 204 if (fd.entrylength <
205 sizeof(struct hfsplus_cat_folder)) { 205 sizeof(struct hfsplus_cat_folder)) {
206 printk(KERN_ERR "hfs: small dir entry\n"); 206 pr_err("small dir entry\n");
207 err = -EIO; 207 err = -EIO;
208 goto out; 208 goto out;
209 } 209 }
@@ -216,7 +216,7 @@ static int hfsplus_readdir(struct file *filp, void *dirent, filldir_t filldir)
216 break; 216 break;
217 } else if (type == HFSPLUS_FILE) { 217 } else if (type == HFSPLUS_FILE) {
218 if (fd.entrylength < sizeof(struct hfsplus_cat_file)) { 218 if (fd.entrylength < sizeof(struct hfsplus_cat_file)) {
219 printk(KERN_ERR "hfs: small file entry\n"); 219 pr_err("small file entry\n");
220 err = -EIO; 220 err = -EIO;
221 goto out; 221 goto out;
222 } 222 }
@@ -224,7 +224,7 @@ static int hfsplus_readdir(struct file *filp, void *dirent, filldir_t filldir)
224 be32_to_cpu(entry.file.id), DT_REG)) 224 be32_to_cpu(entry.file.id), DT_REG))
225 break; 225 break;
226 } else { 226 } else {
227 printk(KERN_ERR "hfs: bad catalog entry type\n"); 227 pr_err("bad catalog entry type\n");
228 err = -EIO; 228 err = -EIO;
229 goto out; 229 goto out;
230 } 230 }
diff --git a/fs/hfsplus/extents.c b/fs/hfsplus/extents.c
index 64a532acc5e2..43658c6694c8 100644
--- a/fs/hfsplus/extents.c
+++ b/fs/hfsplus/extents.c
@@ -349,7 +349,7 @@ found:
349 if (count <= block_nr) { 349 if (count <= block_nr) {
350 err = hfsplus_block_free(sb, start, count); 350 err = hfsplus_block_free(sb, start, count);
351 if (err) { 351 if (err) {
352 printk(KERN_ERR "hfs: can't free extent\n"); 352 pr_err("can't free extent\n");
353 hfs_dbg(EXTENT, " start: %u count: %u\n", 353 hfs_dbg(EXTENT, " start: %u count: %u\n",
354 start, count); 354 start, count);
355 } 355 }
@@ -360,7 +360,7 @@ found:
360 count -= block_nr; 360 count -= block_nr;
361 err = hfsplus_block_free(sb, start + count, block_nr); 361 err = hfsplus_block_free(sb, start + count, block_nr);
362 if (err) { 362 if (err) {
363 printk(KERN_ERR "hfs: can't free extent\n"); 363 pr_err("can't free extent\n");
364 hfs_dbg(EXTENT, " start: %u count: %u\n", 364 hfs_dbg(EXTENT, " start: %u count: %u\n",
365 start, count); 365 start, count);
366 } 366 }
@@ -433,7 +433,7 @@ int hfsplus_file_extend(struct inode *inode)
433 if (sbi->alloc_file->i_size * 8 < 433 if (sbi->alloc_file->i_size * 8 <
434 sbi->total_blocks - sbi->free_blocks + 8) { 434 sbi->total_blocks - sbi->free_blocks + 8) {
435 /* extend alloc file */ 435 /* extend alloc file */
436 printk(KERN_ERR "hfs: extend alloc file! " 436 pr_err("extend alloc file! "
437 "(%llu,%u,%u)\n", 437 "(%llu,%u,%u)\n",
438 sbi->alloc_file->i_size * 8, 438 sbi->alloc_file->i_size * 8,
439 sbi->total_blocks, sbi->free_blocks); 439 sbi->total_blocks, sbi->free_blocks);
diff --git a/fs/hfsplus/hfsplus_fs.h b/fs/hfsplus/hfsplus_fs.h
index 910ea98e92df..60b0a3388b26 100644
--- a/fs/hfsplus/hfsplus_fs.h
+++ b/fs/hfsplus/hfsplus_fs.h
@@ -10,6 +10,12 @@
10#ifndef _LINUX_HFSPLUS_FS_H 10#ifndef _LINUX_HFSPLUS_FS_H
11#define _LINUX_HFSPLUS_FS_H 11#define _LINUX_HFSPLUS_FS_H
12 12
13#ifdef pr_fmt
14#undef pr_fmt
15#endif
16
17#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
18
13#include <linux/fs.h> 19#include <linux/fs.h>
14#include <linux/mutex.h> 20#include <linux/mutex.h>
15#include <linux/buffer_head.h> 21#include <linux/buffer_head.h>
@@ -32,16 +38,16 @@
32#endif 38#endif
33#define DBG_MASK (0) 39#define DBG_MASK (0)
34 40
35#define hfs_dbg(flg, fmt, ...) \ 41#define hfs_dbg(flg, fmt, ...) \
36do { \ 42do { \
37 if (DBG_##flg & DBG_MASK) \ 43 if (DBG_##flg & DBG_MASK) \
38 printk(KERN_DEBUG fmt, ##__VA_ARGS__); \ 44 printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__); \
39} while (0) 45} while (0)
40 46
41#define hfs_dbg_cont(flg, fmt, ...) \ 47#define hfs_dbg_cont(flg, fmt, ...) \
42do { \ 48do { \
43 if (DBG_##flg & DBG_MASK) \ 49 if (DBG_##flg & DBG_MASK) \
44 printk(KERN_CONT fmt, ##__VA_ARGS__); \ 50 pr_cont(fmt, ##__VA_ARGS__); \
45} while (0) 51} while (0)
46 52
47/* Runtime config options */ 53/* Runtime config options */
diff --git a/fs/hfsplus/inode.c b/fs/hfsplus/inode.c
index 160ccc9cdb4b..7faaa964968e 100644
--- a/fs/hfsplus/inode.c
+++ b/fs/hfsplus/inode.c
@@ -357,7 +357,7 @@ int hfsplus_file_fsync(struct file *file, loff_t start, loff_t end,
357 if (!error) 357 if (!error)
358 error = error2; 358 error = error2;
359 } else { 359 } else {
360 printk(KERN_ERR "hfs: sync non-existent attributes tree\n"); 360 pr_err("sync non-existent attributes tree\n");
361 } 361 }
362 } 362 }
363 363
@@ -573,7 +573,7 @@ int hfsplus_cat_read_inode(struct inode *inode, struct hfs_find_data *fd)
573 inode->i_ctime = hfsp_mt2ut(file->attribute_mod_date); 573 inode->i_ctime = hfsp_mt2ut(file->attribute_mod_date);
574 HFSPLUS_I(inode)->create_date = file->create_date; 574 HFSPLUS_I(inode)->create_date = file->create_date;
575 } else { 575 } else {
576 printk(KERN_ERR "hfs: bad catalog entry used to create inode\n"); 576 pr_err("bad catalog entry used to create inode\n");
577 res = -EIO; 577 res = -EIO;
578 } 578 }
579 return res; 579 return res;
diff --git a/fs/hfsplus/options.c b/fs/hfsplus/options.c
index ed257c671615..968eab5bc1f5 100644
--- a/fs/hfsplus/options.c
+++ b/fs/hfsplus/options.c
@@ -113,67 +113,67 @@ int hfsplus_parse_options(char *input, struct hfsplus_sb_info *sbi)
113 switch (token) { 113 switch (token) {
114 case opt_creator: 114 case opt_creator:
115 if (match_fourchar(&args[0], &sbi->creator)) { 115 if (match_fourchar(&args[0], &sbi->creator)) {
116 printk(KERN_ERR "hfs: creator requires a 4 character value\n"); 116 pr_err("creator requires a 4 character value\n");
117 return 0; 117 return 0;
118 } 118 }
119 break; 119 break;
120 case opt_type: 120 case opt_type:
121 if (match_fourchar(&args[0], &sbi->type)) { 121 if (match_fourchar(&args[0], &sbi->type)) {
122 printk(KERN_ERR "hfs: type requires a 4 character value\n"); 122 pr_err("type requires a 4 character value\n");
123 return 0; 123 return 0;
124 } 124 }
125 break; 125 break;
126 case opt_umask: 126 case opt_umask:
127 if (match_octal(&args[0], &tmp)) { 127 if (match_octal(&args[0], &tmp)) {
128 printk(KERN_ERR "hfs: umask requires a value\n"); 128 pr_err("umask requires a value\n");
129 return 0; 129 return 0;
130 } 130 }
131 sbi->umask = (umode_t)tmp; 131 sbi->umask = (umode_t)tmp;
132 break; 132 break;
133 case opt_uid: 133 case opt_uid:
134 if (match_int(&args[0], &tmp)) { 134 if (match_int(&args[0], &tmp)) {
135 printk(KERN_ERR "hfs: uid requires an argument\n"); 135 pr_err("uid requires an argument\n");
136 return 0; 136 return 0;
137 } 137 }
138 sbi->uid = make_kuid(current_user_ns(), (uid_t)tmp); 138 sbi->uid = make_kuid(current_user_ns(), (uid_t)tmp);
139 if (!uid_valid(sbi->uid)) { 139 if (!uid_valid(sbi->uid)) {
140 printk(KERN_ERR "hfs: invalid uid specified\n"); 140 pr_err("invalid uid specified\n");
141 return 0; 141 return 0;
142 } 142 }
143 break; 143 break;
144 case opt_gid: 144 case opt_gid:
145 if (match_int(&args[0], &tmp)) { 145 if (match_int(&args[0], &tmp)) {
146 printk(KERN_ERR "hfs: gid requires an argument\n"); 146 pr_err("gid requires an argument\n");
147 return 0; 147 return 0;
148 } 148 }
149 sbi->gid = make_kgid(current_user_ns(), (gid_t)tmp); 149 sbi->gid = make_kgid(current_user_ns(), (gid_t)tmp);
150 if (!gid_valid(sbi->gid)) { 150 if (!gid_valid(sbi->gid)) {
151 printk(KERN_ERR "hfs: invalid gid specified\n"); 151 pr_err("invalid gid specified\n");
152 return 0; 152 return 0;
153 } 153 }
154 break; 154 break;
155 case opt_part: 155 case opt_part:
156 if (match_int(&args[0], &sbi->part)) { 156 if (match_int(&args[0], &sbi->part)) {
157 printk(KERN_ERR "hfs: part requires an argument\n"); 157 pr_err("part requires an argument\n");
158 return 0; 158 return 0;
159 } 159 }
160 break; 160 break;
161 case opt_session: 161 case opt_session:
162 if (match_int(&args[0], &sbi->session)) { 162 if (match_int(&args[0], &sbi->session)) {
163 printk(KERN_ERR "hfs: session requires an argument\n"); 163 pr_err("session requires an argument\n");
164 return 0; 164 return 0;
165 } 165 }
166 break; 166 break;
167 case opt_nls: 167 case opt_nls:
168 if (sbi->nls) { 168 if (sbi->nls) {
169 printk(KERN_ERR "hfs: unable to change nls mapping\n"); 169 pr_err("unable to change nls mapping\n");
170 return 0; 170 return 0;
171 } 171 }
172 p = match_strdup(&args[0]); 172 p = match_strdup(&args[0]);
173 if (p) 173 if (p)
174 sbi->nls = load_nls(p); 174 sbi->nls = load_nls(p);
175 if (!sbi->nls) { 175 if (!sbi->nls) {
176 printk(KERN_ERR "hfs: unable to load " 176 pr_err("unable to load "
177 "nls mapping \"%s\"\n", 177 "nls mapping \"%s\"\n",
178 p); 178 p);
179 kfree(p); 179 kfree(p);
diff --git a/fs/hfsplus/super.c b/fs/hfsplus/super.c
index 4886fd37c082..4c4d142cf890 100644
--- a/fs/hfsplus/super.c
+++ b/fs/hfsplus/super.c
@@ -132,7 +132,7 @@ static int hfsplus_system_write_inode(struct inode *inode)
132 if (tree) { 132 if (tree) {
133 int err = hfs_btree_write(tree); 133 int err = hfs_btree_write(tree);
134 if (err) { 134 if (err) {
135 printk(KERN_ERR "hfs: b-tree write err: %d, ino %lu\n", 135 pr_err("b-tree write err: %d, ino %lu\n",
136 err, inode->i_ino); 136 err, inode->i_ino);
137 return err; 137 return err;
138 } 138 }
@@ -251,7 +251,7 @@ static void delayed_sync_fs(struct work_struct *work)
251 251
252 err = hfsplus_sync_fs(sbi->alloc_file->i_sb, 1); 252 err = hfsplus_sync_fs(sbi->alloc_file->i_sb, 1);
253 if (err) 253 if (err)
254 printk(KERN_ERR "hfs: delayed sync fs err %d\n", err); 254 pr_err("delayed sync fs err %d\n", err);
255} 255}
256 256
257void hfsplus_mark_mdb_dirty(struct super_block *sb) 257void 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 return -EINVAL; 333 return -EINVAL;
334 334
335 if (!(vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_UNMNT))) { 335 if (!(vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_UNMNT))) {
336 printk(KERN_WARNING "hfs: filesystem was " 336 pr_warn("filesystem was not cleanly unmounted, running fsck.hfsplus is recommended. leaving read-only.\n");
337 "not cleanly unmounted, "
338 "running fsck.hfsplus is recommended. "
339 "leaving read-only.\n");
340 sb->s_flags |= MS_RDONLY; 337 sb->s_flags |= MS_RDONLY;
341 *flags |= MS_RDONLY; 338 *flags |= MS_RDONLY;
342 } else if (force) { 339 } else if (force) {
343 /* nothing */ 340 /* nothing */
344 } else if (vhdr->attributes & 341 } else if (vhdr->attributes &
345 cpu_to_be32(HFSPLUS_VOL_SOFTLOCK)) { 342 cpu_to_be32(HFSPLUS_VOL_SOFTLOCK)) {
346 printk(KERN_WARNING "hfs: filesystem is marked locked, " 343 pr_warn("filesystem is marked locked, leaving read-only.\n");
347 "leaving read-only.\n");
348 sb->s_flags |= MS_RDONLY; 344 sb->s_flags |= MS_RDONLY;
349 *flags |= MS_RDONLY; 345 *flags |= MS_RDONLY;
350 } else if (vhdr->attributes & 346 } else if (vhdr->attributes &
351 cpu_to_be32(HFSPLUS_VOL_JOURNALED)) { 347 cpu_to_be32(HFSPLUS_VOL_JOURNALED)) {
352 printk(KERN_WARNING "hfs: filesystem is " 348 pr_warn("filesystem is marked journaled, leaving read-only.\n");
353 "marked journaled, "
354 "leaving read-only.\n");
355 sb->s_flags |= MS_RDONLY; 349 sb->s_flags |= MS_RDONLY;
356 *flags |= MS_RDONLY; 350 *flags |= MS_RDONLY;
357 } 351 }
@@ -397,7 +391,7 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent)
397 391
398 err = -EINVAL; 392 err = -EINVAL;
399 if (!hfsplus_parse_options(data, sbi)) { 393 if (!hfsplus_parse_options(data, sbi)) {
400 printk(KERN_ERR "hfs: unable to parse mount options\n"); 394 pr_err("unable to parse mount options\n");
401 goto out_unload_nls; 395 goto out_unload_nls;
402 } 396 }
403 397
@@ -405,14 +399,14 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent)
405 nls = sbi->nls; 399 nls = sbi->nls;
406 sbi->nls = load_nls("utf8"); 400 sbi->nls = load_nls("utf8");
407 if (!sbi->nls) { 401 if (!sbi->nls) {
408 printk(KERN_ERR "hfs: unable to load nls for utf8\n"); 402 pr_err("unable to load nls for utf8\n");
409 goto out_unload_nls; 403 goto out_unload_nls;
410 } 404 }
411 405
412 /* Grab the volume header */ 406 /* Grab the volume header */
413 if (hfsplus_read_wrapper(sb)) { 407 if (hfsplus_read_wrapper(sb)) {
414 if (!silent) 408 if (!silent)
415 printk(KERN_WARNING "hfs: unable to find HFS+ superblock\n"); 409 pr_warn("unable to find HFS+ superblock\n");
416 goto out_unload_nls; 410 goto out_unload_nls;
417 } 411 }
418 vhdr = sbi->s_vhdr; 412 vhdr = sbi->s_vhdr;
@@ -421,7 +415,7 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent)
421 sb->s_magic = HFSPLUS_VOLHEAD_SIG; 415 sb->s_magic = HFSPLUS_VOLHEAD_SIG;
422 if (be16_to_cpu(vhdr->version) < HFSPLUS_MIN_VERSION || 416 if (be16_to_cpu(vhdr->version) < HFSPLUS_MIN_VERSION ||
423 be16_to_cpu(vhdr->version) > HFSPLUS_CURRENT_VERSION) { 417 be16_to_cpu(vhdr->version) > HFSPLUS_CURRENT_VERSION) {
424 printk(KERN_ERR "hfs: wrong filesystem version\n"); 418 pr_err("wrong filesystem version\n");
425 goto out_free_vhdr; 419 goto out_free_vhdr;
426 } 420 }
427 sbi->total_blocks = be32_to_cpu(vhdr->total_blocks); 421 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 439
446 if ((last_fs_block > (sector_t)(~0ULL) >> (sbi->alloc_blksz_shift - 9)) || 440 if ((last_fs_block > (sector_t)(~0ULL) >> (sbi->alloc_blksz_shift - 9)) ||
447 (last_fs_page > (pgoff_t)(~0ULL))) { 441 (last_fs_page > (pgoff_t)(~0ULL))) {
448 printk(KERN_ERR "hfs: filesystem size too large.\n"); 442 pr_err("filesystem size too large\n");
449 goto out_free_vhdr; 443 goto out_free_vhdr;
450 } 444 }
451 445
@@ -454,22 +448,16 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent)
454 sb->s_maxbytes = MAX_LFS_FILESIZE; 448 sb->s_maxbytes = MAX_LFS_FILESIZE;
455 449
456 if (!(vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_UNMNT))) { 450 if (!(vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_UNMNT))) {
457 printk(KERN_WARNING "hfs: Filesystem was " 451 pr_warn("Filesystem was not cleanly unmounted, running fsck.hfsplus is recommended. mounting read-only.\n");
458 "not cleanly unmounted, "
459 "running fsck.hfsplus is recommended. "
460 "mounting read-only.\n");
461 sb->s_flags |= MS_RDONLY; 452 sb->s_flags |= MS_RDONLY;
462 } else if (test_and_clear_bit(HFSPLUS_SB_FORCE, &sbi->flags)) { 453 } else if (test_and_clear_bit(HFSPLUS_SB_FORCE, &sbi->flags)) {
463 /* nothing */ 454 /* nothing */
464 } else if (vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_SOFTLOCK)) { 455 } else if (vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_SOFTLOCK)) {
465 printk(KERN_WARNING "hfs: Filesystem is marked locked, mounting read-only.\n"); 456 pr_warn("Filesystem is marked locked, mounting read-only.\n");
466 sb->s_flags |= MS_RDONLY; 457 sb->s_flags |= MS_RDONLY;
467 } else if ((vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_JOURNALED)) && 458 } else if ((vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_JOURNALED)) &&
468 !(sb->s_flags & MS_RDONLY)) { 459 !(sb->s_flags & MS_RDONLY)) {
469 printk(KERN_WARNING "hfs: write access to " 460 pr_warn("write access to a journaled filesystem is not supported, use the force option at your own risk, mounting read-only.\n");
470 "a journaled filesystem is not supported, "
471 "use the force option at your own risk, "
472 "mounting read-only.\n");
473 sb->s_flags |= MS_RDONLY; 461 sb->s_flags |= MS_RDONLY;
474 } 462 }
475 463
@@ -478,18 +466,18 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent)
478 /* Load metadata objects (B*Trees) */ 466 /* Load metadata objects (B*Trees) */
479 sbi->ext_tree = hfs_btree_open(sb, HFSPLUS_EXT_CNID); 467 sbi->ext_tree = hfs_btree_open(sb, HFSPLUS_EXT_CNID);
480 if (!sbi->ext_tree) { 468 if (!sbi->ext_tree) {
481 printk(KERN_ERR "hfs: failed to load extents file\n"); 469 pr_err("failed to load extents file\n");
482 goto out_free_vhdr; 470 goto out_free_vhdr;
483 } 471 }
484 sbi->cat_tree = hfs_btree_open(sb, HFSPLUS_CAT_CNID); 472 sbi->cat_tree = hfs_btree_open(sb, HFSPLUS_CAT_CNID);
485 if (!sbi->cat_tree) { 473 if (!sbi->cat_tree) {
486 printk(KERN_ERR "hfs: failed to load catalog file\n"); 474 pr_err("failed to load catalog file\n");
487 goto out_close_ext_tree; 475 goto out_close_ext_tree;
488 } 476 }
489 if (vhdr->attr_file.total_blocks != 0) { 477 if (vhdr->attr_file.total_blocks != 0) {
490 sbi->attr_tree = hfs_btree_open(sb, HFSPLUS_ATTR_CNID); 478 sbi->attr_tree = hfs_btree_open(sb, HFSPLUS_ATTR_CNID);
491 if (!sbi->attr_tree) { 479 if (!sbi->attr_tree) {
492 printk(KERN_ERR "hfs: failed to load attributes file\n"); 480 pr_err("failed to load attributes file\n");
493 goto out_close_cat_tree; 481 goto out_close_cat_tree;
494 } 482 }
495 } 483 }
@@ -497,7 +485,7 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent)
497 485
498 inode = hfsplus_iget(sb, HFSPLUS_ALLOC_CNID); 486 inode = hfsplus_iget(sb, HFSPLUS_ALLOC_CNID);
499 if (IS_ERR(inode)) { 487 if (IS_ERR(inode)) {
500 printk(KERN_ERR "hfs: failed to load allocation file\n"); 488 pr_err("failed to load allocation file\n");
501 err = PTR_ERR(inode); 489 err = PTR_ERR(inode);
502 goto out_close_attr_tree; 490 goto out_close_attr_tree;
503 } 491 }
@@ -506,7 +494,7 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent)
506 /* Load the root directory */ 494 /* Load the root directory */
507 root = hfsplus_iget(sb, HFSPLUS_ROOT_CNID); 495 root = hfsplus_iget(sb, HFSPLUS_ROOT_CNID);
508 if (IS_ERR(root)) { 496 if (IS_ERR(root)) {
509 printk(KERN_ERR "hfs: failed to load root directory\n"); 497 pr_err("failed to load root directory\n");
510 err = PTR_ERR(root); 498 err = PTR_ERR(root);
511 goto out_put_alloc_file; 499 goto out_put_alloc_file;
512 } 500 }
diff --git a/fs/hfsplus/wrapper.c b/fs/hfsplus/wrapper.c
index 90effcccca9a..b51a6079108d 100644
--- a/fs/hfsplus/wrapper.c
+++ b/fs/hfsplus/wrapper.c
@@ -156,7 +156,7 @@ static int hfsplus_get_last_session(struct super_block *sb,
156 *start = (sector_t)te.cdte_addr.lba << 2; 156 *start = (sector_t)te.cdte_addr.lba << 2;
157 return 0; 157 return 0;
158 } 158 }
159 printk(KERN_ERR "hfs: invalid session number or type of track\n"); 159 pr_err("invalid session number or type of track\n");
160 return -EINVAL; 160 return -EINVAL;
161 } 161 }
162 ms_info.addr_format = CDROM_LBA; 162 ms_info.addr_format = CDROM_LBA;
@@ -234,8 +234,7 @@ reread:
234 234
235 error = -EINVAL; 235 error = -EINVAL;
236 if (sbi->s_backup_vhdr->signature != sbi->s_vhdr->signature) { 236 if (sbi->s_backup_vhdr->signature != sbi->s_vhdr->signature) {
237 printk(KERN_WARNING 237 pr_warn("invalid secondary volume header\n");
238 "hfs: invalid secondary volume header\n");
239 goto out_free_backup_vhdr; 238 goto out_free_backup_vhdr;
240 } 239 }
241 240
@@ -259,8 +258,7 @@ reread:
259 blocksize >>= 1; 258 blocksize >>= 1;
260 259
261 if (sb_set_blocksize(sb, blocksize) != blocksize) { 260 if (sb_set_blocksize(sb, blocksize) != blocksize) {
262 printk(KERN_ERR "hfs: unable to set blocksize to %u!\n", 261 pr_err("unable to set blocksize to %u!\n", blocksize);
263 blocksize);
264 goto out_free_backup_vhdr; 262 goto out_free_backup_vhdr;
265 } 263 }
266 264
diff --git a/fs/hfsplus/xattr.c b/fs/hfsplus/xattr.c
index e8a4b0815c61..f66346155df5 100644
--- a/fs/hfsplus/xattr.c
+++ b/fs/hfsplus/xattr.c
@@ -107,19 +107,19 @@ int __hfsplus_setxattr(struct inode *inode, const char *name,
107 107
108 err = hfs_find_init(HFSPLUS_SB(inode->i_sb)->cat_tree, &cat_fd); 108 err = hfs_find_init(HFSPLUS_SB(inode->i_sb)->cat_tree, &cat_fd);
109 if (err) { 109 if (err) {
110 printk(KERN_ERR "hfs: can't init xattr find struct\n"); 110 pr_err("can't init xattr find struct\n");
111 return err; 111 return err;
112 } 112 }
113 113
114 err = hfsplus_find_cat(inode->i_sb, inode->i_ino, &cat_fd); 114 err = hfsplus_find_cat(inode->i_sb, inode->i_ino, &cat_fd);
115 if (err) { 115 if (err) {
116 printk(KERN_ERR "hfs: catalog searching failed\n"); 116 pr_err("catalog searching failed\n");
117 goto end_setxattr; 117 goto end_setxattr;
118 } 118 }
119 119
120 if (!strcmp_xattr_finder_info(name)) { 120 if (!strcmp_xattr_finder_info(name)) {
121 if (flags & XATTR_CREATE) { 121 if (flags & XATTR_CREATE) {
122 printk(KERN_ERR "hfs: xattr exists yet\n"); 122 pr_err("xattr exists yet\n");
123 err = -EOPNOTSUPP; 123 err = -EOPNOTSUPP;
124 goto end_setxattr; 124 goto end_setxattr;
125 } 125 }
@@ -165,7 +165,7 @@ int __hfsplus_setxattr(struct inode *inode, const char *name,
165 165
166 if (hfsplus_attr_exists(inode, name)) { 166 if (hfsplus_attr_exists(inode, name)) {
167 if (flags & XATTR_CREATE) { 167 if (flags & XATTR_CREATE) {
168 printk(KERN_ERR "hfs: xattr exists yet\n"); 168 pr_err("xattr exists yet\n");
169 err = -EOPNOTSUPP; 169 err = -EOPNOTSUPP;
170 goto end_setxattr; 170 goto end_setxattr;
171 } 171 }
@@ -177,7 +177,7 @@ int __hfsplus_setxattr(struct inode *inode, const char *name,
177 goto end_setxattr; 177 goto end_setxattr;
178 } else { 178 } else {
179 if (flags & XATTR_REPLACE) { 179 if (flags & XATTR_REPLACE) {
180 printk(KERN_ERR "hfs: cannot replace xattr\n"); 180 pr_err("cannot replace xattr\n");
181 err = -EOPNOTSUPP; 181 err = -EOPNOTSUPP;
182 goto end_setxattr; 182 goto end_setxattr;
183 } 183 }
@@ -210,7 +210,7 @@ int __hfsplus_setxattr(struct inode *inode, const char *name,
210 cat_entry_flags); 210 cat_entry_flags);
211 hfsplus_mark_inode_dirty(inode, HFSPLUS_I_CAT_DIRTY); 211 hfsplus_mark_inode_dirty(inode, HFSPLUS_I_CAT_DIRTY);
212 } else { 212 } else {
213 printk(KERN_ERR "hfs: invalid catalog entry type\n"); 213 pr_err("invalid catalog entry type\n");
214 err = -EIO; 214 err = -EIO;
215 goto end_setxattr; 215 goto end_setxattr;
216 } 216 }
@@ -269,7 +269,7 @@ static ssize_t hfsplus_getxattr_finder_info(struct dentry *dentry,
269 if (size >= record_len) { 269 if (size >= record_len) {
270 res = hfs_find_init(HFSPLUS_SB(inode->i_sb)->cat_tree, &fd); 270 res = hfs_find_init(HFSPLUS_SB(inode->i_sb)->cat_tree, &fd);
271 if (res) { 271 if (res) {
272 printk(KERN_ERR "hfs: can't init xattr find struct\n"); 272 pr_err("can't init xattr find struct\n");
273 return res; 273 return res;
274 } 274 }
275 res = hfsplus_find_cat(inode->i_sb, inode->i_ino, &fd); 275 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 340
341 entry = hfsplus_alloc_attr_entry(); 341 entry = hfsplus_alloc_attr_entry();
342 if (!entry) { 342 if (!entry) {
343 printk(KERN_ERR "hfs: can't allocate xattr entry\n"); 343 pr_err("can't allocate xattr entry\n");
344 return -ENOMEM; 344 return -ENOMEM;
345 } 345 }
346 346
347 res = hfs_find_init(HFSPLUS_SB(inode->i_sb)->attr_tree, &fd); 347 res = hfs_find_init(HFSPLUS_SB(inode->i_sb)->attr_tree, &fd);
348 if (res) { 348 if (res) {
349 printk(KERN_ERR "hfs: can't init xattr find struct\n"); 349 pr_err("can't init xattr find struct\n");
350 goto failed_getxattr_init; 350 goto failed_getxattr_init;
351 } 351 }
352 352
@@ -355,7 +355,7 @@ ssize_t hfsplus_getxattr(struct dentry *dentry, const char *name,
355 if (res == -ENOENT) 355 if (res == -ENOENT)
356 res = -ENODATA; 356 res = -ENODATA;
357 else 357 else
358 printk(KERN_ERR "hfs: xattr searching failed\n"); 358 pr_err("xattr searching failed\n");
359 goto out; 359 goto out;
360 } 360 }
361 361
@@ -368,17 +368,17 @@ ssize_t hfsplus_getxattr(struct dentry *dentry, const char *name,
368 offsetof(struct hfsplus_attr_inline_data, 368 offsetof(struct hfsplus_attr_inline_data,
369 length)); 369 length));
370 if (record_length > HFSPLUS_MAX_INLINE_DATA_SIZE) { 370 if (record_length > HFSPLUS_MAX_INLINE_DATA_SIZE) {
371 printk(KERN_ERR "hfs: invalid xattr record size\n"); 371 pr_err("invalid xattr record size\n");
372 res = -EIO; 372 res = -EIO;
373 goto out; 373 goto out;
374 } 374 }
375 } else if (record_type == HFSPLUS_ATTR_FORK_DATA || 375 } else if (record_type == HFSPLUS_ATTR_FORK_DATA ||
376 record_type == HFSPLUS_ATTR_EXTENTS) { 376 record_type == HFSPLUS_ATTR_EXTENTS) {
377 printk(KERN_ERR "hfs: only inline data xattr are supported\n"); 377 pr_err("only inline data xattr are supported\n");
378 res = -EOPNOTSUPP; 378 res = -EOPNOTSUPP;
379 goto out; 379 goto out;
380 } else { 380 } else {
381 printk(KERN_ERR "hfs: invalid xattr record\n"); 381 pr_err("invalid xattr record\n");
382 res = -EIO; 382 res = -EIO;
383 goto out; 383 goto out;
384 } 384 }
@@ -427,7 +427,7 @@ static ssize_t hfsplus_listxattr_finder_info(struct dentry *dentry,
427 427
428 res = hfs_find_init(HFSPLUS_SB(inode->i_sb)->cat_tree, &fd); 428 res = hfs_find_init(HFSPLUS_SB(inode->i_sb)->cat_tree, &fd);
429 if (res) { 429 if (res) {
430 printk(KERN_ERR "hfs: can't init xattr find struct\n"); 430 pr_err("can't init xattr find struct\n");
431 return res; 431 return res;
432 } 432 }
433 433
@@ -506,7 +506,7 @@ ssize_t hfsplus_listxattr(struct dentry *dentry, char *buffer, size_t size)
506 506
507 err = hfs_find_init(HFSPLUS_SB(inode->i_sb)->attr_tree, &fd); 507 err = hfs_find_init(HFSPLUS_SB(inode->i_sb)->attr_tree, &fd);
508 if (err) { 508 if (err) {
509 printk(KERN_ERR "hfs: can't init xattr find struct\n"); 509 pr_err("can't init xattr find struct\n");
510 return err; 510 return err;
511 } 511 }
512 512
@@ -525,8 +525,7 @@ ssize_t hfsplus_listxattr(struct dentry *dentry, char *buffer, size_t size)
525 for (;;) { 525 for (;;) {
526 key_len = hfs_bnode_read_u16(fd.bnode, fd.keyoffset); 526 key_len = hfs_bnode_read_u16(fd.bnode, fd.keyoffset);
527 if (key_len == 0 || key_len > fd.tree->max_key_len) { 527 if (key_len == 0 || key_len > fd.tree->max_key_len) {
528 printk(KERN_ERR "hfs: invalid xattr key length: %d\n", 528 pr_err("invalid xattr key length: %d\n", key_len);
529 key_len);
530 res = -EIO; 529 res = -EIO;
531 goto end_listxattr; 530 goto end_listxattr;
532 } 531 }
@@ -541,7 +540,7 @@ ssize_t hfsplus_listxattr(struct dentry *dentry, char *buffer, size_t size)
541 if (hfsplus_uni2asc(inode->i_sb, 540 if (hfsplus_uni2asc(inode->i_sb,
542 (const struct hfsplus_unistr *)&fd.key->attr.key_name, 541 (const struct hfsplus_unistr *)&fd.key->attr.key_name,
543 strbuf, &xattr_name_len)) { 542 strbuf, &xattr_name_len)) {
544 printk(KERN_ERR "hfs: unicode conversion failed\n"); 543 pr_err("unicode conversion failed\n");
545 res = -EIO; 544 res = -EIO;
546 goto end_listxattr; 545 goto end_listxattr;
547 } 546 }
@@ -598,13 +597,13 @@ int hfsplus_removexattr(struct dentry *dentry, const char *name)
598 597
599 err = hfs_find_init(HFSPLUS_SB(inode->i_sb)->cat_tree, &cat_fd); 598 err = hfs_find_init(HFSPLUS_SB(inode->i_sb)->cat_tree, &cat_fd);
600 if (err) { 599 if (err) {
601 printk(KERN_ERR "hfs: can't init xattr find struct\n"); 600 pr_err("can't init xattr find struct\n");
602 return err; 601 return err;
603 } 602 }
604 603
605 err = hfsplus_find_cat(inode->i_sb, inode->i_ino, &cat_fd); 604 err = hfsplus_find_cat(inode->i_sb, inode->i_ino, &cat_fd);
606 if (err) { 605 if (err) {
607 printk(KERN_ERR "hfs: catalog searching failed\n"); 606 pr_err("catalog searching failed\n");
608 goto end_removexattr; 607 goto end_removexattr;
609 } 608 }
610 609
@@ -643,7 +642,7 @@ int hfsplus_removexattr(struct dentry *dentry, const char *name)
643 flags); 642 flags);
644 hfsplus_mark_inode_dirty(inode, HFSPLUS_I_CAT_DIRTY); 643 hfsplus_mark_inode_dirty(inode, HFSPLUS_I_CAT_DIRTY);
645 } else { 644 } else {
646 printk(KERN_ERR "hfs: invalid catalog entry type\n"); 645 pr_err("invalid catalog entry type\n");
647 err = -EIO; 646 err = -EIO;
648 goto end_removexattr; 647 goto end_removexattr;
649 } 648 }