Whamcloud - gitweb
LU-12610 obd: remove OBD_ -> CFS_ macros 08/50808/2
authorTimothy Day <timday@amazon.com>
Wed, 19 Apr 2023 01:46:34 +0000 (01:46 +0000)
committerOleg Drokin <green@whamcloud.com>
Fri, 19 May 2023 07:09:25 +0000 (07:09 +0000)
Remove OBD macros that are simply redefinitions
of CFS macros.

Signed-off-by: Timothy Day <timday@amazon.com>
Signed-off-by: Ben Evans <beevans@whamcloud.com>
Change-Id: Id9e312a6074c5e11370f018afd3201d73b53e7e0
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/50808
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
14 files changed:
lustre/obdclass/cl_page.c
lustre/obdclass/class_obd.c
lustre/obdclass/dt_object.c
lustre/obdclass/kernelcomm.c
lustre/obdclass/linkea.c
lustre/obdclass/llog.c
lustre/obdclass/llog_cat.c
lustre/obdclass/llog_ioctl.c
lustre/obdclass/llog_obd.c
lustre/obdclass/llog_osd.c
lustre/obdclass/llog_test.c
lustre/obdclass/lu_object.c
lustre/obdclass/obd_config.c
lustre/obdclass/scrub.c

index 9d07df9..39a7f72 100644 (file)
@@ -202,7 +202,7 @@ static struct cl_page *__cl_page_alloc(struct cl_object *o)
        struct cl_page *cl_page = NULL;
        unsigned short bufsize = cl_object_header(o)->coh_page_bufsize;
 
-       if (OBD_FAIL_CHECK(OBD_FAIL_LLITE_PAGE_ALLOC))
+       if (CFS_FAIL_CHECK(OBD_FAIL_LLITE_PAGE_ALLOC))
                return NULL;
 
 check:
index 6b13000..3c7862b 100644 (file)
@@ -793,7 +793,7 @@ static int __init obdclass_init(void)
        /* simulate a late OOM situation now to require all
         * alloc'ed/initialized resources to be freed
         */
-       if (OBD_FAIL_CHECK(OBD_FAIL_OBDCLASS_MODULE_LOAD)) {
+       if (CFS_FAIL_CHECK(OBD_FAIL_OBDCLASS_MODULE_LOAD)) {
                /* force error to ensure module will be unloaded/cleaned */
                err = -ENOMEM;
                goto cleanup_all;
index a5975f9..6e36919 100644 (file)
@@ -115,7 +115,7 @@ int dt_txn_hook_stop(const struct lu_env *env, struct thandle *th)
        if (th->th_local)
                return 0;
 
-       if (OBD_FAIL_CHECK(OBD_FAIL_DT_TXN_STOP))
+       if (CFS_FAIL_CHECK(OBD_FAIL_DT_TXN_STOP))
                return -EIO;
 
        list_for_each_entry(cb, &dev->dd_txn_callbacks, dtc_linkage) {
@@ -757,7 +757,7 @@ static int dt_index_page_build(const struct lu_env *env, struct dt_object *obj,
                hash = iops->store(env, it);
                ii->ii_hash_end = hash;
 
-               if (OBD_FAIL_CHECK(OBD_FAIL_OBD_IDX_READ_BREAK)) {
+               if (CFS_FAIL_CHECK(OBD_FAIL_OBD_IDX_READ_BREAK)) {
                        if (lip->lip_nr != 0)
                                GOTO(out, rc = 0);
                }
index 61cad4a..f0e28ce 100644 (file)
@@ -488,7 +488,7 @@ int libcfs_kkuc_group_put(const struct obd_uuid *uuid, int group, void *payload)
        down_write(&kg_sem);
 
        if (unlikely(list_empty(&kkuc_groups[group])) ||
-           unlikely(OBD_FAIL_CHECK(OBD_FAIL_MDS_HSM_CT_REGISTER_NET))) {
+           unlikely(CFS_FAIL_CHECK(OBD_FAIL_MDS_HSM_CT_REGISTER_NET))) {
                /* no agent have fully registered, CDT will retry */
                up_write(&kg_sem);
                RETURN(-EAGAIN);
index 2ea560f..6a6a1f8 100644 (file)
@@ -96,9 +96,9 @@ int linkea_entry_pack(struct link_ea_entry *lee, const struct lu_name *lname,
        int             reclen;
 
        tmpfid = *pfid;
-       if (OBD_FAIL_CHECK(OBD_FAIL_LFSCK_MUL_REF))
+       if (CFS_FAIL_CHECK(OBD_FAIL_LFSCK_MUL_REF))
                tmpfid.f_oid--;
-       if (OBD_FAIL_CHECK(OBD_FAIL_LFSCK_LINKEA_CRASH))
+       if (CFS_FAIL_CHECK(OBD_FAIL_LFSCK_LINKEA_CRASH))
                tmpfid.f_ver = ~0;
        fid_cpu_to_be(&tmpfid, &tmpfid);
        memcpy(&lee->lee_parent_fid, &tmpfid, sizeof(tmpfid));
index c464b96..634903b 100644 (file)
@@ -627,11 +627,11 @@ repeat:
                            synced_idx == LLOG_HDR_TAIL(llh)->lrt_index)
                                GOTO(out, rc = 0);
 
-                       if (OBD_FAIL_PRECHECK(OBD_FAIL_LLOG_PROCESS_TIMEOUT) &&
+                       if (CFS_FAIL_PRECHECK(OBD_FAIL_LLOG_PROCESS_TIMEOUT) &&
                                cfs_fail_val == (unsigned int)
                                        (loghandle->lgh_id.lgl_oi.oi.oi_id &
                                         0xFFFFFFFF)) {
-                               OBD_RACE(OBD_FAIL_LLOG_PROCESS_TIMEOUT);
+                               CFS_RACE(OBD_FAIL_LLOG_PROCESS_TIMEOUT);
                        }
 
                        /* the bitmap could be changed during processing
index 164055e..3d9cceb 100644 (file)
@@ -102,7 +102,7 @@ static int llog_cat_new_log(const struct lu_env *env,
                RETURN(-ENOSPC);
        }
 
-       if (OBD_FAIL_CHECK(OBD_FAIL_MDS_LLOG_CREATE_FAILED))
+       if (CFS_FAIL_CHECK(OBD_FAIL_MDS_LLOG_CREATE_FAILED))
                RETURN(-ENOSPC);
 
        if (loghandle->lgh_hdr != NULL) {
@@ -199,8 +199,8 @@ static int llog_cat_new_log(const struct lu_env *env,
                if (freespace > (128 << 20))
                        loghandle->lgh_max_size = 128 << 20;
        }
-       if (unlikely(OBD_FAIL_PRECHECK(OBD_FAIL_PLAIN_RECORDS) ||
-                    OBD_FAIL_PRECHECK(OBD_FAIL_CATALOG_FULL_CHECK))) {
+       if (unlikely(CFS_FAIL_PRECHECK(OBD_FAIL_PLAIN_RECORDS) ||
+                    CFS_FAIL_PRECHECK(OBD_FAIL_CATALOG_FULL_CHECK))) {
                // limit the numer of plain records for test
                loghandle->lgh_max_size = loghandle->lgh_hdr_size +
                       cfs_fail_val * 64;
@@ -481,7 +481,7 @@ static struct llog_handle *llog_cat_current_log(struct llog_handle *cathandle,
         ENTRY;
 
 
-       if (OBD_FAIL_CHECK(OBD_FAIL_MDS_LLOG_CREATE_FAILED2)) {
+       if (CFS_FAIL_CHECK(OBD_FAIL_MDS_LLOG_CREATE_FAILED2)) {
                down_write_nested(&cathandle->lgh_lock, LLOGH_CAT);
                GOTO(next, loghandle);
        }
@@ -1046,7 +1046,7 @@ EXPORT_SYMBOL(llog_cat_size);
 __u32 llog_cat_free_space(struct llog_handle *cat_llh)
 {
        /* simulate almost full Catalog */
-       if (OBD_FAIL_CHECK(OBD_FAIL_CAT_FREE_RECORDS))
+       if (CFS_FAIL_CHECK(OBD_FAIL_CAT_FREE_RECORDS))
                return cfs_fail_val;
 
        if (cat_llh->lgh_hdr->llh_count == 1)
index e1afb48..e8ef97b 100644 (file)
@@ -540,7 +540,7 @@ int llog_catalog_list(const struct lu_env *env, struct dt_device *d,
        out = data->ioc_bulk;
        remains = data->ioc_inllen1;
        /* OBD_FAIL: fetch the catalog records from the specified one */
-       if (OBD_FAIL_CHECK(OBD_FAIL_CATLIST))
+       if (CFS_FAIL_CHECK(OBD_FAIL_CATLIST))
                data->ioc_count = cfs_fail_val - 1;
        for (i = data->ioc_count; i < count; i++) {
                id = &idarray[i].lci_logid;
index 0d05e64..94d889c 100644 (file)
@@ -196,7 +196,7 @@ int llog_setup(const struct lu_env *env, struct obd_device *obd,
        }
 
        if (op->lop_setup) {
-               if (OBD_FAIL_CHECK(OBD_FAIL_OBD_LLOG_SETUP))
+               if (CFS_FAIL_CHECK(OBD_FAIL_OBD_LLOG_SETUP))
                        rc = -EOPNOTSUPP;
                else
                        rc = op->lop_setup(env, obd, olg, index, disk_obd);
index 4f9d774..adbcd2a 100644 (file)
@@ -556,7 +556,7 @@ static int llog_osd_write_rec(const struct lu_env *env,
 
        /* simulate ENOSPC when new plain llog is being added to the
         * catalog */
-       if (OBD_FAIL_CHECK(OBD_FAIL_MDS_LLOG_CREATE_FAILED2) &&
+       if (CFS_FAIL_CHECK(OBD_FAIL_MDS_LLOG_CREATE_FAILED2) &&
            llh->llh_flags & LLOG_F_IS_CAT)
                RETURN(-ENOSPC);
 
@@ -599,7 +599,7 @@ static int llog_osd_write_rec(const struct lu_env *env,
        down_write(&loghandle->lgh_last_sem);
        /* increment the last_idx along with llh_tail index, they should
         * be equal for a llog lifetime */
-       if (OBD_FAIL_CHECK(OBD_FAIL_LLOG_ADD_GAP) && --cfs_fail_val == 0)
+       if (CFS_FAIL_CHECK(OBD_FAIL_LLOG_ADD_GAP) && --cfs_fail_val == 0)
                loghandle->lgh_last_idx++;
        loghandle->lgh_last_idx++;
        index = loghandle->lgh_last_idx;
@@ -684,9 +684,9 @@ static int llog_osd_write_rec(const struct lu_env *env,
                if (rc != 0)
                        GOTO(out_unlock, rc);
        }
-       if (OBD_FAIL_PRECHECK(OBD_FAIL_LLOG_PAUSE_AFTER_PAD) && pad) {
+       if (CFS_FAIL_PRECHECK(OBD_FAIL_LLOG_PAUSE_AFTER_PAD) && pad) {
                /* a window for concurrent llog reader, see LU-12577 */
-               OBD_FAIL_TIMEOUT(OBD_FAIL_LLOG_PAUSE_AFTER_PAD,
+               CFS_FAIL_TIMEOUT(OBD_FAIL_LLOG_PAUSE_AFTER_PAD,
                                 cfs_fail_val ?: 1);
        }
 
@@ -698,10 +698,10 @@ out_unlock:
                GOTO(out, rc);
        }
 
-       if (OBD_FAIL_PRECHECK(OBD_FAIL_LLOG_PROCESS_TIMEOUT) &&
+       if (CFS_FAIL_PRECHECK(OBD_FAIL_LLOG_PROCESS_TIMEOUT) &&
           cfs_fail_val == (unsigned int)(loghandle->lgh_id.lgl_oi.oi.oi_id &
                                          0xFFFFFFFF)) {
-               OBD_RACE(OBD_FAIL_LLOG_PROCESS_TIMEOUT);
+               CFS_RACE(OBD_FAIL_LLOG_PROCESS_TIMEOUT);
                msleep(1 * MSEC_PER_SEC);
        }
        /* computed index can be used to determine offset for fixed-size
@@ -927,9 +927,9 @@ static int llog_osd_next_block(const struct lu_env *env,
        LASSERT(loghandle);
        LASSERT(loghandle->lgh_ctxt);
 
-       if (OBD_FAIL_PRECHECK(OBD_FAIL_MDS_CHANGELOG_DEL) &&
+       if (CFS_FAIL_PRECHECK(OBD_FAIL_MDS_CHANGELOG_DEL) &&
            cfs_fail_val == ((unsigned long)loghandle & 0xFFFFFFFF)) {
-               OBD_RACE(OBD_FAIL_MDS_CHANGELOG_DEL);
+               CFS_RACE(OBD_FAIL_MDS_CHANGELOG_DEL);
                msleep(MSEC_PER_SEC >> 2);
        }
 
@@ -1353,10 +1353,10 @@ generate:
                        GOTO(out, rc);
                new_id = true;
        }
-       if (OBD_FAIL_PRECHECK(OBD_FAIL_MDS_LLOG_UMOUNT_RACE) &&
+       if (CFS_FAIL_PRECHECK(OBD_FAIL_MDS_LLOG_UMOUNT_RACE) &&
            cfs_fail_val == 1) {
                cfs_fail_val = 2;
-               OBD_RACE(OBD_FAIL_MDS_LLOG_UMOUNT_RACE);
+               CFS_RACE(OBD_FAIL_MDS_LLOG_UMOUNT_RACE);
                msleep(MSEC_PER_SEC);
        }
        o = ls_locate(env, ls, &lgi->lgi_fid, NULL);
index 6b32d80..e06ee0a 100644 (file)
@@ -1560,7 +1560,7 @@ static int cat_check_old_cb(const struct lu_env *env, struct llog_handle *llh,
        }
 
        if (prev_fid->f_oid == 0) {
-               cfs_fail_loc = OBD_FAIL_ONCE | OBD_FAIL_LLOG_PROCESS_TIMEOUT;
+               cfs_fail_loc = CFS_FAIL_ONCE | OBD_FAIL_LLOG_PROCESS_TIMEOUT;
                cfs_fail_val = (unsigned int) (llh->lgh_id.lgl_oi.oi.oi_id &
                                               0xFFFFFFFF);
                msleep(1 * MSEC_PER_SEC);
index 5389a86..776d1c8 100644 (file)
@@ -434,7 +434,7 @@ int lu_site_purge_objects(const struct lu_env *env, struct lu_site *s,
        int                      bnr;
        unsigned int             i;
 
-       if (OBD_FAIL_CHECK(OBD_FAIL_OBD_NO_LRU))
+       if (CFS_FAIL_CHECK(OBD_FAIL_OBD_NO_LRU))
                RETURN(0);
 
        /*
@@ -843,7 +843,7 @@ struct lu_object *lu_object_find_at(const struct lu_env *env,
        s  = dev->ld_site;
        hs = &s->ls_obj_hash;
 
-       if (unlikely(OBD_FAIL_PRECHECK(OBD_FAIL_OBD_ZERO_NLINK_RACE)))
+       if (unlikely(CFS_FAIL_PRECHECK(OBD_FAIL_OBD_ZERO_NLINK_RACE)))
                lu_site_purge(env, s, -1);
 
        bkt = &s->ls_bkts[lu_bkt_hash(s, f)];
index a4f6907..431d0a5 100644 (file)
@@ -822,7 +822,7 @@ int class_cleanup(struct obd_device *obd, struct lustre_cfg *lcfg)
        char *flag;
        ENTRY;
 
-       OBD_RACE(OBD_FAIL_LDLM_RECOV_CLIENTS);
+       CFS_RACE(OBD_FAIL_LDLM_RECOV_CLIENTS);
 
        if (!obd->obd_set_up) {
                CERROR("Device %d not setup\n", obd->obd_minor);
index dadeb12..f1da24c 100644 (file)
@@ -1011,7 +1011,7 @@ static int lustre_index_backup_one(const struct lu_env *env,
        if (!rc)
                rc = lustre_index_update_lma(env, tgt_obj, buf, bufsize);
 
-       if (!rc && OBD_FAIL_CHECK(OBD_FAIL_OSD_INDEX_CRASH)) {
+       if (!rc && CFS_FAIL_CHECK(OBD_FAIL_OSD_INDEX_CRASH)) {
                LASSERT(bufsize >= 512);
 
                pos = 0;