diff options
author | Jiaying Zhang <jiayingz@google.com> | 2010-07-20 10:54:43 -0400 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2010-07-21 10:05:58 -0400 |
commit | fb5ffb0e160c93c3fe08ab83845eb9a2768af812 (patch) | |
tree | 1f3488ab93f21a30f9a60f612de63adce3ce1599 /fs/quota/quota_v2.c | |
parent | 01971952582068c4eaaef7410f32d16daa178a0d (diff) |
quota: Change quota error message to print out disk and function name
The current quota error message doesn't always print the disk name, so
it is hard to identify the "bad" disk when quota error happens.
This patch changes the standardized quota error message to print out disk name
and function name. It also uses a combination of cpp macro and inline function
to provide better type checking and to lower the text size of the message.
[Jan Kara: Export __quota_error]
Signed-off-by: Jiaying Zhang <jiayingz@google.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/quota/quota_v2.c')
-rw-r--r-- | fs/quota/quota_v2.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/fs/quota/quota_v2.c b/fs/quota/quota_v2.c index 135206af1458..65444d29406b 100644 --- a/fs/quota/quota_v2.c +++ b/fs/quota/quota_v2.c | |||
@@ -63,9 +63,8 @@ static int v2_read_header(struct super_block *sb, int type, | |||
63 | size = sb->s_op->quota_read(sb, type, (char *)dqhead, | 63 | size = sb->s_op->quota_read(sb, type, (char *)dqhead, |
64 | sizeof(struct v2_disk_dqheader), 0); | 64 | sizeof(struct v2_disk_dqheader), 0); |
65 | if (size != sizeof(struct v2_disk_dqheader)) { | 65 | if (size != sizeof(struct v2_disk_dqheader)) { |
66 | q_warn(KERN_WARNING "quota_v2: Failed header read:" | 66 | quota_error(sb, "Failed header read: expected=%zd got=%zd", |
67 | " expected=%zd got=%zd\n", | 67 | sizeof(struct v2_disk_dqheader), size); |
68 | sizeof(struct v2_disk_dqheader), size); | ||
69 | return 0; | 68 | return 0; |
70 | } | 69 | } |
71 | return 1; | 70 | return 1; |
@@ -106,8 +105,7 @@ static int v2_read_file_info(struct super_block *sb, int type) | |||
106 | size = sb->s_op->quota_read(sb, type, (char *)&dinfo, | 105 | size = sb->s_op->quota_read(sb, type, (char *)&dinfo, |
107 | sizeof(struct v2_disk_dqinfo), V2_DQINFOOFF); | 106 | sizeof(struct v2_disk_dqinfo), V2_DQINFOOFF); |
108 | if (size != sizeof(struct v2_disk_dqinfo)) { | 107 | if (size != sizeof(struct v2_disk_dqinfo)) { |
109 | q_warn(KERN_WARNING "quota_v2: Can't read info structure on device %s.\n", | 108 | quota_error(sb, "Can't read info structure"); |
110 | sb->s_id); | ||
111 | return -1; | 109 | return -1; |
112 | } | 110 | } |
113 | info->dqi_priv = kmalloc(sizeof(struct qtree_mem_dqinfo), GFP_NOFS); | 111 | info->dqi_priv = kmalloc(sizeof(struct qtree_mem_dqinfo), GFP_NOFS); |
@@ -167,8 +165,7 @@ static int v2_write_file_info(struct super_block *sb, int type) | |||
167 | size = sb->s_op->quota_write(sb, type, (char *)&dinfo, | 165 | size = sb->s_op->quota_write(sb, type, (char *)&dinfo, |
168 | sizeof(struct v2_disk_dqinfo), V2_DQINFOOFF); | 166 | sizeof(struct v2_disk_dqinfo), V2_DQINFOOFF); |
169 | if (size != sizeof(struct v2_disk_dqinfo)) { | 167 | if (size != sizeof(struct v2_disk_dqinfo)) { |
170 | q_warn(KERN_WARNING "Can't write info structure on device %s.\n", | 168 | quota_error(sb, "Can't write info structure"); |
171 | sb->s_id); | ||
172 | return -1; | 169 | return -1; |
173 | } | 170 | } |
174 | return 0; | 171 | return 0; |