diff options
author | Joe Perches <joe@perches.com> | 2013-04-30 18:27:55 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-04-30 20:04:05 -0400 |
commit | d614267329f2bee7a082ed8781c581c0f3aaa808 (patch) | |
tree | edade57808a2a2e327daf83991a31a76660b7a41 /fs/hfs | |
parent | c2b3e1f76e5c90215bc7f740b376c0220eb8a8e3 (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>
Diffstat (limited to 'fs/hfs')
-rw-r--r-- | fs/hfs/bfind.c | 4 | ||||
-rw-r--r-- | fs/hfs/bnode.c | 4 | ||||
-rw-r--r-- | fs/hfs/brec.c | 8 | ||||
-rw-r--r-- | fs/hfs/btree.c | 29 | ||||
-rw-r--r-- | fs/hfs/catalog.c | 4 | ||||
-rw-r--r-- | fs/hfs/dir.c | 12 | ||||
-rw-r--r-- | fs/hfs/hfs_fs.h | 22 | ||||
-rw-r--r-- | fs/hfs/mdb.c | 23 | ||||
-rw-r--r-- | fs/hfs/super.c | 43 |
9 files changed, 77 insertions, 72 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 | ||
139 | invalid: | 139 | invalid: |
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; |
143 | release: | 143 | release: |
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, ...) \ |
38 | do { \ | 44 | do { \ |
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, ...) \ |
44 | do { \ | 50 | do { \ |
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 | ||
451 | bail_no_root: | 450 | bail_no_root: |
452 | printk(KERN_ERR "hfs: get root inode failed.\n"); | 451 | pr_err("get root inode failed\n"); |
453 | bail: | 452 | bail: |
454 | hfs_mdb_put(sb); | 453 | hfs_mdb_put(sb); |
455 | return res; | 454 | return res; |