From 8bbc27d31389cabe992d68dd9b0900bb26971e66 Mon Sep 17 00:00:00 2001 From: Arshad Hussain Date: Tue, 29 Oct 2019 21:18:40 +0530 Subject: [PATCH] LU-12923 target: Use BUILD_BUG_ON() for tgt_lastrcvd.c This patch replaces all CLASSERT() with kernel defined BUILD_BUG_ON() for file lustre/target/tgt_lastrcvd.c Test-Parameters: trivial Signed-off-by: Arshad Hussain Change-Id: I72df471f3480ae2267be08103ae4fae62c94b2ff Reviewed-on: https://review.whamcloud.com/36721 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Petros Koutoupis Reviewed-by: Ben Evans Reviewed-by: Shaun Tancheff Reviewed-by: Oleg Drokin --- lustre/target/tgt_lastrcvd.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lustre/target/tgt_lastrcvd.c b/lustre/target/tgt_lastrcvd.c index f31a6a3..99a39c3 100644 --- a/lustre/target/tgt_lastrcvd.c +++ b/lustre/target/tgt_lastrcvd.c @@ -1499,8 +1499,8 @@ static int tgt_clients_data_init(const struct lu_env *env, if (tgt->lut_bottom->dd_rdonly) RETURN(0); - CLASSERT(offsetof(struct lsd_client_data, lcd_padding) + - sizeof(lcd->lcd_padding) == LR_CLIENT_SIZE); + BUILD_BUG_ON(offsetof(struct lsd_client_data, lcd_padding) + + sizeof(lcd->lcd_padding) != LR_CLIENT_SIZE); OBD_ALLOC_PTR(lcd); if (lcd == NULL) @@ -1654,8 +1654,8 @@ int tgt_server_data_init(const struct lu_env *env, struct lu_target *tgt) last_rcvd_size = (unsigned long)tti->tti_attr.la_size; /* ensure padding in the struct is the correct size */ - CLASSERT(offsetof(struct lr_server_data, lsd_padding) + - sizeof(lsd->lsd_padding) == LR_SERVER_SIZE); + BUILD_BUG_ON(offsetof(struct lr_server_data, lsd_padding) + + sizeof(lsd->lsd_padding) != LR_SERVER_SIZE); rc = server_name2index(tgt_name(tgt), &index, NULL); if (rc < 0) { -- 1.8.3.1