From 24ada119f28045eba84f6089ca8761165d7efbec Mon Sep 17 00:00:00 2001 From: Timothy Day Date: Wed, 19 Apr 2023 01:46:34 +0000 Subject: [PATCH] LU-12610 obd: remove OBD_ -> CFS_ macros Remove OBD macros that are simply redefinitions of CFS macros. Signed-off-by: Timothy Day Signed-off-by: Ben Evans Change-Id: Id9e312a6074c5e11370f018afd3201d73b53e7e0 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/50808 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: James Simmons Reviewed-by: Arshad Hussain Reviewed-by: Oleg Drokin --- lustre/obdclass/cl_page.c | 2 +- lustre/obdclass/class_obd.c | 2 +- lustre/obdclass/dt_object.c | 4 ++-- lustre/obdclass/kernelcomm.c | 2 +- lustre/obdclass/linkea.c | 4 ++-- lustre/obdclass/llog.c | 4 ++-- lustre/obdclass/llog_cat.c | 10 +++++----- lustre/obdclass/llog_ioctl.c | 2 +- lustre/obdclass/llog_obd.c | 2 +- lustre/obdclass/llog_osd.c | 20 ++++++++++---------- lustre/obdclass/llog_test.c | 2 +- lustre/obdclass/lu_object.c | 4 ++-- lustre/obdclass/obd_config.c | 2 +- lustre/obdclass/scrub.c | 2 +- 14 files changed, 31 insertions(+), 31 deletions(-) diff --git a/lustre/obdclass/cl_page.c b/lustre/obdclass/cl_page.c index 9d07df9..39a7f72 100644 --- a/lustre/obdclass/cl_page.c +++ b/lustre/obdclass/cl_page.c @@ -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: diff --git a/lustre/obdclass/class_obd.c b/lustre/obdclass/class_obd.c index 6b13000..3c7862b 100644 --- a/lustre/obdclass/class_obd.c +++ b/lustre/obdclass/class_obd.c @@ -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; diff --git a/lustre/obdclass/dt_object.c b/lustre/obdclass/dt_object.c index a5975f9..6e36919 100644 --- a/lustre/obdclass/dt_object.c +++ b/lustre/obdclass/dt_object.c @@ -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); } diff --git a/lustre/obdclass/kernelcomm.c b/lustre/obdclass/kernelcomm.c index 61cad4a..f0e28ce 100644 --- a/lustre/obdclass/kernelcomm.c +++ b/lustre/obdclass/kernelcomm.c @@ -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); diff --git a/lustre/obdclass/linkea.c b/lustre/obdclass/linkea.c index 2ea560f..6a6a1f8 100644 --- a/lustre/obdclass/linkea.c +++ b/lustre/obdclass/linkea.c @@ -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)); diff --git a/lustre/obdclass/llog.c b/lustre/obdclass/llog.c index c464b96..634903b 100644 --- a/lustre/obdclass/llog.c +++ b/lustre/obdclass/llog.c @@ -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 diff --git a/lustre/obdclass/llog_cat.c b/lustre/obdclass/llog_cat.c index 164055e..3d9cceb 100644 --- a/lustre/obdclass/llog_cat.c +++ b/lustre/obdclass/llog_cat.c @@ -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) diff --git a/lustre/obdclass/llog_ioctl.c b/lustre/obdclass/llog_ioctl.c index e1afb48..e8ef97b 100644 --- a/lustre/obdclass/llog_ioctl.c +++ b/lustre/obdclass/llog_ioctl.c @@ -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; diff --git a/lustre/obdclass/llog_obd.c b/lustre/obdclass/llog_obd.c index 0d05e64..94d889c 100644 --- a/lustre/obdclass/llog_obd.c +++ b/lustre/obdclass/llog_obd.c @@ -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); diff --git a/lustre/obdclass/llog_osd.c b/lustre/obdclass/llog_osd.c index 4f9d774..adbcd2a 100644 --- a/lustre/obdclass/llog_osd.c +++ b/lustre/obdclass/llog_osd.c @@ -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); diff --git a/lustre/obdclass/llog_test.c b/lustre/obdclass/llog_test.c index 6b32d80..e06ee0a 100644 --- a/lustre/obdclass/llog_test.c +++ b/lustre/obdclass/llog_test.c @@ -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); diff --git a/lustre/obdclass/lu_object.c b/lustre/obdclass/lu_object.c index 5389a86..776d1c8 100644 --- a/lustre/obdclass/lu_object.c +++ b/lustre/obdclass/lu_object.c @@ -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)]; diff --git a/lustre/obdclass/obd_config.c b/lustre/obdclass/obd_config.c index a4f6907..431d0a5 100644 --- a/lustre/obdclass/obd_config.c +++ b/lustre/obdclass/obd_config.c @@ -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); diff --git a/lustre/obdclass/scrub.c b/lustre/obdclass/scrub.c index dadeb12..f1da24c 100644 --- a/lustre/obdclass/scrub.c +++ b/lustre/obdclass/scrub.c @@ -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; -- 1.8.3.1