summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
128137a)
This patch replaces remaining CLASSERT() with kernel defined
BUILD_BUG_ON()
Test-Parameters: trivial
Signed-off-by: Arshad Hussain <arshad.super@gmail.com>
Change-Id: Ie23846f8d67cac1872bda9c7e20fe9bc888bf365
Reviewed-on: https://review.whamcloud.com/37111
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Petros Koutoupis <pkoutoupis@cray.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
- CLASSERT(PAGE_SIZE >= sizeof(*value)); \
+ BUILD_BUG_ON(PAGE_SIZE < sizeof(*value)); \
\
OBD_ALLOC_PTR(value); \
if (value == NULL) \
\
OBD_ALLOC_PTR(value); \
if (value == NULL) \
#define REQ_MAX_ACK_LOCKS 8
union ptlrpc_async_args {
#define REQ_MAX_ACK_LOCKS 8
union ptlrpc_async_args {
- /**
- * Scratchpad for passing args to completion interpreter. Users
- * cast to the struct of their choosing, and CLASSERT that this is
- * big enough. For _tons_ of context, OBD_ALLOC a struct and store
- * a pointer to it here. The pointer_arg ensures this struct is at
- * least big enough for that.
- */
- void *pointer_arg[11];
- __u64 space[7];
+ /**
+ * Scratchpad for passing args to completion interpreter. Users
+ * cast to the struct of their choosing, and BUILD_BUG_ON that this is
+ * big enough. For _tons_ of context, OBD_ALLOC a struct and store
+ * a pointer to it here. The pointer_arg ensures this struct is at
+ * least big enough for that.
+ */
+ void *pointer_arg[11];
+ __u64 space[7];
};
struct ptlrpc_request_set;
};
struct ptlrpc_request_set;
- CLASSERT(ARRAY_SIZE(info->mti_buf) >= 4);
+ BUILD_BUG_ON(ARRAY_SIZE(info->mti_buf) < 4);
memset(info->mti_buf, 0, sizeof(info->mti_buf));
/* we have to sort the 2 obj, so locking will always
memset(info->mti_buf, 0, sizeof(info->mti_buf));
/* we have to sort the 2 obj, so locking will always
-#ifndef CLASSERT
-#define CLASSERT(cond) do {switch(42) {case (cond): case 0: break;}} while (0)
-#endif
/* implication */
#define ergo(a, b) (!(a) || (b))
/* logical equivalence */
/* implication */
#define ergo(a, b) (!(a) || (b))
/* logical equivalence */
- CLASSERT(sizeof(zde->lzd_reg) == 8);
- CLASSERT(sizeof(*zde) % 8 == 0);
+ BUILD_BUG_ON(sizeof(zde->lzd_reg) != 8);
+ BUILD_BUG_ON(sizeof(*zde) % 8 != 0);
memset(&zde->lzd_reg, 0, sizeof(zde->lzd_reg));
zde->lzd_reg.zde_type = IFTODT(rec1->rec_type & S_IFMT);
memset(&zde->lzd_reg, 0, sizeof(zde->lzd_reg));
zde->lzd_reg.zde_type = IFTODT(rec1->rec_type & S_IFMT);
ENTRY;
/* temp. storage should be enough for any key supported by ZFS */
ENTRY;
/* temp. storage should be enough for any key supported by ZFS */
- CLASSERT(sizeof(za->za_name) <= sizeof(it->ozi_name));
+ BUILD_BUG_ON(sizeof(za->za_name) > sizeof(it->ozi_name));
/*
* the first ->next() moves the cursor to .
/*
* the first ->next() moves the cursor to .
struct dt_device *dev = lu2dt_dev(idx->do_lu.lo_dev);
int rc;
struct dt_device *dev = lu2dt_dev(idx->do_lu.lo_dev);
int rc;
- CLASSERT(sizeof(union nodemap_rec) == 32);
+ BUILD_BUG_ON(sizeof(union nodemap_rec) != 32);
th = dt_trans_create(env, dev);
th = dt_trans_create(env, dev);