aboutsummaryrefslogtreecommitdiffstats
path: root/fs/hfsplus/xattr.c
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 /fs/hfsplus/xattr.c
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>
Diffstat (limited to 'fs/hfsplus/xattr.c')
-rw-r--r--fs/hfsplus/xattr.c41
1 files changed, 20 insertions, 21 deletions
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 }