static void nodemap_cluster_rec_init(union nodemap_rec *nr,
const struct lu_nodemap *nodemap)
{
- CLASSERT(sizeof(nr->ncr.ncr_name) == sizeof(nodemap->nm_name));
+ BUILD_BUG_ON(sizeof(nr->ncr.ncr_name) != sizeof(nodemap->nm_name));
strncpy(nr->ncr.ncr_name, nodemap->nm_name, sizeof(nr->ncr.ncr_name));
nr->ncr.ncr_squash_uid = cpu_to_le32(nodemap->nm_squash_uid);
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);
ENTRY;
- CLASSERT(sizeof(union nodemap_rec) == 32);
+ BUILD_BUG_ON(sizeof(union nodemap_rec) != 32);
nodemap_id = le32_to_cpu(key->nk_nodemap_id);
type = nodemap_get_key_type(key);
if (nodemap_id == LUSTRE_NODEMAP_DEFAULT_ID) {
nodemap = nodemap_create(rec->ncr.ncr_name,
config, 1);
- config->nmc_default_nodemap = nodemap;
} else {
nodemap = nodemap_create(rec->ncr.ncr_name,
config, 0);
if (new_config->nmc_default_nodemap == NULL) {
/* new MGS won't have a default nm on disk, so create it here */
- new_config->nmc_default_nodemap =
+ struct lu_nodemap *nodemap =
nodemap_create(DEFAULT_NODEMAP, new_config, 1);
- if (IS_ERR(new_config->nmc_default_nodemap)) {
- rc = PTR_ERR(new_config->nmc_default_nodemap);
+ if (IS_ERR(nodemap)) {
+ rc = PTR_ERR(nodemap);
} else {
rc = nodemap_idx_nodemap_add_update(
new_config->nmc_default_nodemap,