gfs2: Return bool from gfs2_assert functions
The gfs2_assert functions only print messages when the filesystem hasn't been withdrawn yet, and they indicate whether or not they've printed something in their return value. However, none of the callers use that information, so simply return whether or not the assert has failed. (The gfs2_assert functions are still backwards; they return false when an assertion is true.) Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com> Signed-off-by: Bob Peterson <rpeterso@redhat.com>
This commit is contained in:

committed by
Bob Peterson

parent
a5ca2f1cb6
commit
8e28ef1f2f
@@ -36,21 +36,29 @@ do { \
|
||||
} while (0)
|
||||
|
||||
|
||||
int gfs2_assert_withdraw_i(struct gfs2_sbd *sdp, char *assertion,
|
||||
const char *function, char *file, unsigned int line);
|
||||
void gfs2_assert_withdraw_i(struct gfs2_sbd *sdp, char *assertion,
|
||||
const char *function, char *file, unsigned int line);
|
||||
|
||||
#define gfs2_assert_withdraw(sdp, assertion) \
|
||||
((likely(assertion)) ? 0 : gfs2_assert_withdraw_i((sdp), #assertion, \
|
||||
__func__, __FILE__, __LINE__))
|
||||
({ \
|
||||
bool _bool = (assertion); \
|
||||
if (unlikely(!_bool)) \
|
||||
gfs2_assert_withdraw_i((sdp), #assertion, \
|
||||
__func__, __FILE__, __LINE__); \
|
||||
!_bool; \
|
||||
})
|
||||
|
||||
|
||||
int gfs2_assert_warn_i(struct gfs2_sbd *sdp, char *assertion,
|
||||
const char *function, char *file, unsigned int line);
|
||||
void gfs2_assert_warn_i(struct gfs2_sbd *sdp, char *assertion,
|
||||
const char *function, char *file, unsigned int line);
|
||||
|
||||
#define gfs2_assert_warn(sdp, assertion) \
|
||||
((likely(assertion)) ? 0 : gfs2_assert_warn_i((sdp), #assertion, \
|
||||
__func__, __FILE__, __LINE__))
|
||||
|
||||
({ \
|
||||
bool _bool = (assertion); \
|
||||
if (unlikely(!_bool)) \
|
||||
gfs2_assert_warn_i((sdp), #assertion, \
|
||||
__func__, __FILE__, __LINE__); \
|
||||
!_bool; \
|
||||
})
|
||||
|
||||
void gfs2_consist_i(struct gfs2_sbd *sdp,
|
||||
const char *function, char *file, unsigned int line);
|
||||
|
Reference in New Issue
Block a user