diff options
author | Jeff Mahoney <jeffm@suse.com> | 2009-03-30 14:02:21 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-03-30 15:16:36 -0400 |
commit | 45b03d5e8e674eb6555b767e1c8eb40b671ff892 (patch) | |
tree | d74acd1be7f5102143df960e8cd692aadcc437df /fs/reiserfs/xattr.c | |
parent | 1d889d9958490888b3fad1d486145d9a03559cbc (diff) |
reiserfs: rework reiserfs_warning
ReiserFS warnings can be somewhat inconsistent.
In some cases:
* a unique identifier may be associated with it
* the function name may be included
* the device may be printed separately
This patch aims to make warnings more consistent. reiserfs_warning() prints
the device name, so printing it a second time is not required. The function
name for a warning is always helpful in debugging, so it is now automatically
inserted into the output. Hans has stated that every warning should have
a unique identifier. Some cases lack them, others really shouldn't have them.
reiserfs_warning() now expects an id associated with each message. In the
rare case where one isn't needed, "" will suffice.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/reiserfs/xattr.c')
-rw-r--r-- | fs/reiserfs/xattr.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/fs/reiserfs/xattr.c b/fs/reiserfs/xattr.c index e11b00472361..d14f5c2c0e4a 100644 --- a/fs/reiserfs/xattr.c +++ b/fs/reiserfs/xattr.c | |||
@@ -259,7 +259,8 @@ static int __xattr_readdir(struct inode *inode, void *dirent, filldir_t filldir) | |||
259 | ih = de.de_ih; | 259 | ih = de.de_ih; |
260 | 260 | ||
261 | if (!is_direntry_le_ih(ih)) { | 261 | if (!is_direntry_le_ih(ih)) { |
262 | reiserfs_warning(inode->i_sb, "not direntry %h", ih); | 262 | reiserfs_warning(inode->i_sb, "jdm-20000", |
263 | "not direntry %h", ih); | ||
263 | break; | 264 | break; |
264 | } | 265 | } |
265 | copy_item_head(&tmp_ih, ih); | 266 | copy_item_head(&tmp_ih, ih); |
@@ -598,7 +599,7 @@ reiserfs_xattr_get(const struct inode *inode, const char *name, void *buffer, | |||
598 | if (rxh->h_magic != cpu_to_le32(REISERFS_XATTR_MAGIC)) { | 599 | if (rxh->h_magic != cpu_to_le32(REISERFS_XATTR_MAGIC)) { |
599 | unlock_page(page); | 600 | unlock_page(page); |
600 | reiserfs_put_page(page); | 601 | reiserfs_put_page(page); |
601 | reiserfs_warning(inode->i_sb, | 602 | reiserfs_warning(inode->i_sb, "jdm-20001", |
602 | "Invalid magic for xattr (%s) " | 603 | "Invalid magic for xattr (%s) " |
603 | "associated with %k", name, | 604 | "associated with %k", name, |
604 | INODE_PKEY(inode)); | 605 | INODE_PKEY(inode)); |
@@ -618,7 +619,7 @@ reiserfs_xattr_get(const struct inode *inode, const char *name, void *buffer, | |||
618 | 619 | ||
619 | if (xattr_hash(buffer, isize - sizeof(struct reiserfs_xattr_header)) != | 620 | if (xattr_hash(buffer, isize - sizeof(struct reiserfs_xattr_header)) != |
620 | hash) { | 621 | hash) { |
621 | reiserfs_warning(inode->i_sb, | 622 | reiserfs_warning(inode->i_sb, "jdm-20002", |
622 | "Invalid hash for xattr (%s) associated " | 623 | "Invalid hash for xattr (%s) associated " |
623 | "with %k", name, INODE_PKEY(inode)); | 624 | "with %k", name, INODE_PKEY(inode)); |
624 | err = -EIO; | 625 | err = -EIO; |
@@ -652,7 +653,8 @@ __reiserfs_xattr_del(struct dentry *xadir, const char *name, int namelen) | |||
652 | goto out_file; | 653 | goto out_file; |
653 | 654 | ||
654 | if (!is_reiserfs_priv_object(dentry->d_inode)) { | 655 | if (!is_reiserfs_priv_object(dentry->d_inode)) { |
655 | reiserfs_warning(dir->i_sb, "OID %08x [%.*s/%.*s] doesn't have " | 656 | reiserfs_warning(dir->i_sb, "jdm-20003", |
657 | "OID %08x [%.*s/%.*s] doesn't have " | ||
656 | "priv flag set [parent is %sset].", | 658 | "priv flag set [parent is %sset].", |
657 | le32_to_cpu(INODE_PKEY(dentry->d_inode)-> | 659 | le32_to_cpu(INODE_PKEY(dentry->d_inode)-> |
658 | k_objectid), xadir->d_name.len, | 660 | k_objectid), xadir->d_name.len, |
@@ -750,7 +752,7 @@ int reiserfs_delete_xattrs(struct inode *inode) | |||
750 | reiserfs_write_unlock_xattrs(inode->i_sb); | 752 | reiserfs_write_unlock_xattrs(inode->i_sb); |
751 | dput(root); | 753 | dput(root); |
752 | } else { | 754 | } else { |
753 | reiserfs_warning(inode->i_sb, | 755 | reiserfs_warning(inode->i_sb, "jdm-20006", |
754 | "Couldn't remove all entries in directory"); | 756 | "Couldn't remove all entries in directory"); |
755 | } | 757 | } |
756 | unlock_kernel(); | 758 | unlock_kernel(); |
@@ -1154,7 +1156,8 @@ int reiserfs_xattr_init(struct super_block *s, int mount_flags) | |||
1154 | } else if (reiserfs_xattrs_optional(s)) { | 1156 | } else if (reiserfs_xattrs_optional(s)) { |
1155 | /* Old format filesystem, but optional xattrs have been enabled | 1157 | /* Old format filesystem, but optional xattrs have been enabled |
1156 | * at mount time. Error out. */ | 1158 | * at mount time. Error out. */ |
1157 | reiserfs_warning(s, "xattrs/ACLs not supported on pre v3.6 " | 1159 | reiserfs_warning(s, "jdm-20005", |
1160 | "xattrs/ACLs not supported on pre v3.6 " | ||
1158 | "format filesystem. Failing mount."); | 1161 | "format filesystem. Failing mount."); |
1159 | err = -EOPNOTSUPP; | 1162 | err = -EOPNOTSUPP; |
1160 | goto error; | 1163 | goto error; |
@@ -1201,8 +1204,10 @@ int reiserfs_xattr_init(struct super_block *s, int mount_flags) | |||
1201 | /* If we're read-only it just means that the dir hasn't been | 1204 | /* If we're read-only it just means that the dir hasn't been |
1202 | * created. Not an error -- just no xattrs on the fs. We'll | 1205 | * created. Not an error -- just no xattrs on the fs. We'll |
1203 | * check again if we go read-write */ | 1206 | * check again if we go read-write */ |
1204 | reiserfs_warning(s, "xattrs/ACLs enabled and couldn't " | 1207 | reiserfs_warning(s, "jdm-20006", |
1205 | "find/create .reiserfs_priv. Failing mount."); | 1208 | "xattrs/ACLs enabled and couldn't " |
1209 | "find/create .reiserfs_priv. " | ||
1210 | "Failing mount."); | ||
1206 | err = -EOPNOTSUPP; | 1211 | err = -EOPNOTSUPP; |
1207 | } | 1212 | } |
1208 | } | 1213 | } |