Whamcloud - gitweb
LU-18155 ptlrpc: use LASSERT/F instead of if () LBUG()
We should use a proper LASSERT statement rather than
more verbose if/LBUG blocks.
The patch has been generated with the coccinelle script below.
I manually inverted the logic in the asserts.
@@
expression L;
expression list F;
@@
- if (L) {
(
- CDEBUG(F);
|
- CWARN(F);
|
- CERROR(F);
|
- CEMERG(F);
|
- CNETERR(F);
|
- LCONSOLE(F);
|
- LCONSOLE_INFO(F);
|
- LCONSOLE_WARN(F);
|
- LCONSOLE_ERROR(F);
|
- LCONSOLE_EMERG(F);
)
- LBUG();
- }
+ LASSERTF(L, F);
@@
expression L;
@@
-if (L) LBUG();
+LASSERT(L);
Test-Parameters: trivial
Signed-off-by: Timothy Day <timday@amazon.com>
Change-Id: If3b2d519239ec2c86bc940135346b37ebe1d050e
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/56114
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>