diff options
author | Luis de Bethencourt <luisbg@osg.samsung.com> | 2016-07-03 11:29:44 -0400 |
---|---|---|
committer | Luis de Bethencourt <luisbg@osg.samsung.com> | 2016-10-08 05:01:16 -0400 |
commit | 4c3897cce0774b6196f59f98a44eed7e011db5aa (patch) | |
tree | 68c49115da8af4bfc61fbf685cd22be127500596 /fs/befs | |
parent | 9ae51a32b1a060d2db4340d853d989ae622d273f (diff) |
befs: make consistent use of befs_error()
befs_error() is used in potential errors that could happen in befs to
provide informational log messages. befs_debug() is silent when
CONFIG_BEFS_DEBUG=no, and very verbose when switched on, which is why it is
used for general debugging but not for errors.
Fix a few cases where the befs debug utility usage isn't following the
expected pattern. To make sure we have consistent information in the logs.
Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com>
Diffstat (limited to 'fs/befs')
-rw-r--r-- | fs/befs/btree.c | 6 | ||||
-rw-r--r-- | fs/befs/datastream.c | 5 | ||||
-rw-r--r-- | fs/befs/linuxvfs.c | 2 |
3 files changed, 9 insertions, 4 deletions
diff --git a/fs/befs/btree.c b/fs/befs/btree.c index 307645f9e284..679f69df3817 100644 --- a/fs/befs/btree.c +++ b/fs/befs/btree.c | |||
@@ -301,7 +301,8 @@ befs_btree_find(struct super_block *sb, const befs_data_stream *ds, | |||
301 | kfree(this_node); | 301 | kfree(this_node); |
302 | 302 | ||
303 | if (res != BEFS_BT_MATCH) { | 303 | if (res != BEFS_BT_MATCH) { |
304 | befs_debug(sb, "<--- %s Key %s not found", __func__, key); | 304 | befs_error(sb, "<--- %s Key %s not found", __func__, key); |
305 | befs_debug(sb, "<--- %s ERROR", __func__); | ||
305 | *value = 0; | 306 | *value = 0; |
306 | return BEFS_BT_NOT_FOUND; | 307 | return BEFS_BT_NOT_FOUND; |
307 | } | 308 | } |
@@ -358,7 +359,8 @@ befs_find_key(struct super_block *sb, struct befs_btree_node *node, | |||
358 | 359 | ||
359 | eq = befs_compare_strings(thiskey, keylen, findkey, findkey_len); | 360 | eq = befs_compare_strings(thiskey, keylen, findkey, findkey_len); |
360 | if (eq < 0) { | 361 | if (eq < 0) { |
361 | befs_debug(sb, "<--- %s %s not found", __func__, findkey); | 362 | befs_error(sb, "<--- %s %s not found", __func__, findkey); |
363 | befs_debug(sb, "<--- %s ERROR", __func__); | ||
362 | return BEFS_BT_NOT_FOUND; | 364 | return BEFS_BT_NOT_FOUND; |
363 | } | 365 | } |
364 | 366 | ||
diff --git a/fs/befs/datastream.c b/fs/befs/datastream.c index 26cc417cbdce..740fabcd57c0 100644 --- a/fs/befs/datastream.c +++ b/fs/befs/datastream.c | |||
@@ -275,6 +275,8 @@ befs_find_brun_direct(struct super_block *sb, const befs_data_stream *data, | |||
275 | } | 275 | } |
276 | } | 276 | } |
277 | 277 | ||
278 | befs_error(sb, "%s failed to find file block %lu", __func__, | ||
279 | (unsigned long)blockno); | ||
278 | befs_debug(sb, "---> %s ERROR", __func__); | 280 | befs_debug(sb, "---> %s ERROR", __func__); |
279 | return BEFS_ERR; | 281 | return BEFS_ERR; |
280 | } | 282 | } |
@@ -328,9 +330,10 @@ befs_find_brun_indirect(struct super_block *sb, | |||
328 | for (i = 0; i < indirect.len; i++) { | 330 | for (i = 0; i < indirect.len; i++) { |
329 | indirblock = sb_bread(sb, indirblockno + i); | 331 | indirblock = sb_bread(sb, indirblockno + i); |
330 | if (indirblock == NULL) { | 332 | if (indirblock == NULL) { |
331 | befs_debug(sb, "---> %s failed to read " | 333 | befs_error(sb, "---> %s failed to read " |
332 | "disk block %lu from the indirect brun", | 334 | "disk block %lu from the indirect brun", |
333 | __func__, (unsigned long)indirblockno + i); | 335 | __func__, (unsigned long)indirblockno + i); |
336 | befs_debug(sb, "<--- %s ERROR", __func__); | ||
334 | return BEFS_ERR; | 337 | return BEFS_ERR; |
335 | } | 338 | } |
336 | 339 | ||
diff --git a/fs/befs/linuxvfs.c b/fs/befs/linuxvfs.c index e0979a471e84..67669a81cfd1 100644 --- a/fs/befs/linuxvfs.c +++ b/fs/befs/linuxvfs.c | |||
@@ -187,7 +187,7 @@ befs_lookup(struct inode *dir, struct dentry *dentry, unsigned int flags) | |||
187 | return ERR_PTR(-ENOENT); | 187 | return ERR_PTR(-ENOENT); |
188 | 188 | ||
189 | } else if (ret != BEFS_OK || offset == 0) { | 189 | } else if (ret != BEFS_OK || offset == 0) { |
190 | befs_warning(sb, "<--- %s Error", __func__); | 190 | befs_error(sb, "<--- %s Error", __func__); |
191 | return ERR_PTR(-ENODATA); | 191 | return ERR_PTR(-ENODATA); |
192 | } | 192 | } |
193 | 193 | ||