diff options
Diffstat (limited to 'fs/hfsplus')
-rw-r--r-- | fs/hfsplus/attributes.c | 18 | ||||
-rw-r--r-- | fs/hfsplus/bfind.c | 2 | ||||
-rw-r--r-- | fs/hfsplus/bitmap.c | 2 | ||||
-rw-r--r-- | fs/hfsplus/bnode.c | 6 | ||||
-rw-r--r-- | fs/hfsplus/brec.c | 4 | ||||
-rw-r--r-- | fs/hfsplus/btree.c | 25 | ||||
-rw-r--r-- | fs/hfsplus/catalog.c | 4 | ||||
-rw-r--r-- | fs/hfsplus/dir.c | 14 | ||||
-rw-r--r-- | fs/hfsplus/extents.c | 6 | ||||
-rw-r--r-- | fs/hfsplus/hfsplus_fs.h | 22 | ||||
-rw-r--r-- | fs/hfsplus/inode.c | 4 | ||||
-rw-r--r-- | fs/hfsplus/options.c | 22 | ||||
-rw-r--r-- | fs/hfsplus/super.c | 48 | ||||
-rw-r--r-- | fs/hfsplus/wrapper.c | 8 | ||||
-rw-r--r-- | fs/hfsplus/xattr.c | 41 |
15 files changed, 108 insertions, 118 deletions
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 | ||
210 | invalid: | 210 | invalid: |
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; |
214 | release: | 214 | release: |
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 | ||
240 | kaboom: | 240 | kaboom: |
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, ...) \ |
36 | do { \ | 42 | do { \ |
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, ...) \ |
42 | do { \ | 48 | do { \ |
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 | ||
257 | void hfsplus_mark_mdb_dirty(struct super_block *sb) | 257 | void hfsplus_mark_mdb_dirty(struct super_block *sb) |
@@ -333,25 +333,19 @@ static int hfsplus_remount(struct super_block *sb, int *flags, char *data) | |||
333 | 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 | } |