From 407d34a639c93dc3b4c984249a632cee70c25d05 Mon Sep 17 00:00:00 2001 From: Timothy Day Date: Wed, 19 Apr 2023 01:53:53 +0000 Subject: [PATCH] LU-12610 llite: 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: I7bbcc3e1fda6418c258eb4d1c52b929a7cf72ed1 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/50804 Tested-by: jenkins Tested-by: Maloo Reviewed-by: James Simmons Reviewed-by: Arshad Hussain Reviewed-by: Neil Brown Reviewed-by: Oleg Drokin --- lustre/llite/dir.c | 2 +- lustre/llite/file.c | 8 +++---- lustre/llite/glimpse.c | 2 +- lustre/llite/llite_lib.c | 10 ++++---- lustre/llite/namei.c | 6 ++--- lustre/llite/pcc.c | 8 +++---- lustre/llite/rw.c | 4 ++-- lustre/llite/rw26.c | 4 ++-- lustre/llite/vvp_io.c | 8 +++---- lustre/llite/vvp_object.c | 2 +- lustre/llite/xattr_cache.c | 2 +- lustre/lmv/lmv_obd.c | 2 +- lustre/lod/lod_dev.c | 8 +++---- lustre/lod/lod_lov.c | 8 +++---- lustre/lod/lod_object.c | 58 +++++++++++++++++++++++----------------------- lustre/lod/lod_pool.c | 2 +- lustre/lod/lod_qos.c | 12 +++++----- lustre/lov/lov_object.c | 2 +- 18 files changed, 74 insertions(+), 74 deletions(-) diff --git a/lustre/llite/dir.c b/lustre/llite/dir.c index 7714fdac..8037785 100644 --- a/lustre/llite/dir.c +++ b/lustre/llite/dir.c @@ -490,7 +490,7 @@ static int ll_dir_setdirstripe(struct dentry *dparent, struct lmv_user_md *lump, RETURN(-EINVAL); if (IS_DEADDIR(parent) && - !OBD_FAIL_CHECK(OBD_FAIL_LLITE_NO_CHECK_DEAD)) + !CFS_FAIL_CHECK(OBD_FAIL_LLITE_NO_CHECK_DEAD)) RETURN(-ENOENT); /* MDS < 2.14 doesn't support 'crush' hash type, and cannot handle diff --git a/lustre/llite/file.c b/lustre/llite/file.c index e56aa36..619dbe3 100644 --- a/lustre/llite/file.c +++ b/lustre/llite/file.c @@ -637,7 +637,7 @@ static int ll_intent_file_open(struct dentry *de, void *lmm, int lmmsize, /* if server supports open-by-fid, or file name is invalid, don't pack * name in open request */ - if (OBD_FAIL_CHECK(OBD_FAIL_LLITE_OPEN_BY_NAME) || + if (CFS_FAIL_CHECK(OBD_FAIL_LLITE_OPEN_BY_NAME) || !(exp_connect_flags(sbi->ll_md_exp) & OBD_CONNECT_OPEN_BY_FID)) { retry: len = de->d_name.len; @@ -671,7 +671,7 @@ retry: op_data->op_data = lmm; op_data->op_data_size = lmmsize; - OBD_FAIL_TIMEOUT(OBD_FAIL_LLITE_OPEN_DELAY, cfs_fail_val); + CFS_FAIL_TIMEOUT(OBD_FAIL_LLITE_OPEN_DELAY, cfs_fail_val); rc = md_intent_lock(sbi->ll_md_exp, op_data, itp, &req, &ll_md_blocking_ast, 0); @@ -1460,7 +1460,7 @@ static int ll_merge_attr_nolock(const struct lu_env *env, struct inode *inode) ctime = inode->i_ctime.tv_sec; cl_object_attr_lock(obj); - if (OBD_FAIL_CHECK(OBD_FAIL_MDC_MERGE)) + if (CFS_FAIL_CHECK(OBD_FAIL_MDC_MERGE)) rc = -EINVAL; else rc = cl_object_attr_get(env, obj, attr); @@ -5535,7 +5535,7 @@ int ll_getattr_dentry(struct dentry *de, struct kstat *stat, u32 request_mask, } fill_attr: - OBD_FAIL_TIMEOUT(OBD_FAIL_GETATTR_DELAY, 30); + CFS_FAIL_TIMEOUT(OBD_FAIL_GETATTR_DELAY, 30); if (ll_need_32bit_api(sbi)) { stat->ino = cl_fid_build_ino(&lli->lli_fid, 1); diff --git a/lustre/llite/glimpse.c b/lustre/llite/glimpse.c index bd5e6b6..5c1919c 100644 --- a/lustre/llite/glimpse.c +++ b/lustre/llite/glimpse.c @@ -219,7 +219,7 @@ int cl_glimpse_size0(struct inode *inode, int agl) io->ci_need_restart = 1; } - OBD_FAIL_TIMEOUT(OBD_FAIL_GLIMPSE_DELAY, cfs_fail_val ?: 4); + CFS_FAIL_TIMEOUT(OBD_FAIL_GLIMPSE_DELAY, cfs_fail_val ?: 4); cl_io_fini(env, io); } while (unlikely(io->ci_need_restart)); diff --git a/lustre/llite/llite_lib.c b/lustre/llite/llite_lib.c index dd522a4..7d6d7a2 100644 --- a/lustre/llite/llite_lib.c +++ b/lustre/llite/llite_lib.c @@ -363,7 +363,7 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt) data->ocd_cksum_types = obd_cksum_types_supported_client(); - if (OBD_FAIL_CHECK(OBD_FAIL_MDC_LIGHTWEIGHT)) + if (CFS_FAIL_CHECK(OBD_FAIL_MDC_LIGHTWEIGHT)) /* flag mdc connection as lightweight, only used for test * purpose, use with care */ data->ocd_connect_flags |= OBD_CONNECT_LIGHTWEIGHT; @@ -580,7 +580,7 @@ retry_connect: OBD_CONNECT2_INC_XID | OBD_CONNECT2_LSEEK | OBD_CONNECT2_REP_MBITS; - if (!OBD_FAIL_CHECK(OBD_FAIL_OSC_CONNECT_GRANT_PARAM)) + if (!CFS_FAIL_CHECK(OBD_FAIL_OSC_CONNECT_GRANT_PARAM)) data->ocd_connect_flags |= OBD_CONNECT_GRANT_PARAM; /* OBD_CONNECT_CKSUM should always be set, even if checksums are @@ -590,7 +590,7 @@ retry_connect: */ data->ocd_connect_flags |= OBD_CONNECT_CKSUM; - if (OBD_FAIL_CHECK(OBD_FAIL_OSC_CKSUM_ADLER_ONLY)) + if (CFS_FAIL_CHECK(OBD_FAIL_OSC_CKSUM_ADLER_ONLY)) data->ocd_cksum_types = OBD_CKSUM_ADLER; else data->ocd_cksum_types = obd_cksum_types_supported_client(); @@ -1334,7 +1334,7 @@ int ll_fill_super(struct super_block *sb) CDEBUG(D_VFSTRACE, "VFS Op: cfg_instance %s-%016lx (sb %p)\n", profilenm, cfg_instance, sb); - OBD_RACE(OBD_FAIL_LLITE_RACE_MOUNT); + CFS_RACE(OBD_FAIL_LLITE_RACE_MOUNT); OBD_ALLOC_PTR(cfg); if (cfg == NULL) @@ -1536,7 +1536,7 @@ void ll_put_super(struct super_block *sb) } /* imitate failed cleanup */ - if (OBD_FAIL_CHECK(OBD_FAIL_OBD_CLEANUP)) + if (CFS_FAIL_CHECK(OBD_FAIL_OBD_CLEANUP)) goto skip_cleanup; next = 0; diff --git a/lustre/llite/namei.c b/lustre/llite/namei.c index cd59429..bd397fa 100644 --- a/lustre/llite/namei.c +++ b/lustre/llite/namei.c @@ -224,7 +224,7 @@ static int ll_dom_lock_cancel(struct inode *inode, struct ldlm_lock *lock) if (IS_ERR(env)) RETURN(PTR_ERR(env)); - OBD_FAIL_TIMEOUT(OBD_FAIL_LDLM_REPLAY_PAUSE, cfs_fail_val); + CFS_FAIL_TIMEOUT(OBD_FAIL_LDLM_REPLAY_PAUSE, cfs_fail_val); /* reach MDC layer to flush data under the DoM ldlm lock */ rc = cl_object_flush(env, lli->lli_clob, lock); @@ -1230,7 +1230,7 @@ static int ll_atomic_open(struct inode *dir, struct dentry *dentry, } } - OBD_FAIL_TIMEOUT(OBD_FAIL_LLITE_CREATE_FILE_PAUSE2, cfs_fail_val); + CFS_FAIL_TIMEOUT(OBD_FAIL_LLITE_CREATE_FILE_PAUSE2, cfs_fail_val); /* We can only arrive at this path when we have no inode, so * we only need to request open lock if it was requested @@ -1356,7 +1356,7 @@ static struct inode *ll_create_node(struct inode *dir, struct lookup_intent *it) GOTO(out, inode = ERR_PTR(rc)); /* Pause to allow for a race with concurrent access by fid */ - OBD_FAIL_TIMEOUT(OBD_FAIL_LLITE_CREATE_NODE_PAUSE, cfs_fail_val); + CFS_FAIL_TIMEOUT(OBD_FAIL_LLITE_CREATE_NODE_PAUSE, cfs_fail_val); /* We asked for a lock on the directory, but were granted a * lock on the inode. Since we finally have an inode pointer, diff --git a/lustre/llite/pcc.c b/lustre/llite/pcc.c index 9f176b5..eeda3a1 100644 --- a/lustre/llite/pcc.c +++ b/lustre/llite/pcc.c @@ -1732,7 +1732,7 @@ ssize_t pcc_file_write_iter(struct kiocb *iocb, if (!*cached) RETURN(0); - if (OBD_FAIL_CHECK(OBD_FAIL_LLITE_PCC_FAKE_ERROR)) + if (CFS_FAIL_CHECK(OBD_FAIL_LLITE_PCC_FAKE_ERROR)) GOTO(out, result = -ENOSPC); iocb->ki_filp = pccf->pccf_file; @@ -2017,7 +2017,7 @@ int pcc_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf, RETURN(VM_FAULT_RETRY | VM_FAULT_NOPAGE); } /* Pause to allow for a race with concurrent detach */ - OBD_FAIL_TIMEOUT(OBD_FAIL_LLITE_PCC_MKWRITE_PAUSE, cfs_fail_val); + CFS_FAIL_TIMEOUT(OBD_FAIL_LLITE_PCC_MKWRITE_PAUSE, cfs_fail_val); pcc_io_init(inode, PIT_PAGE_MKWRITE, cached); if (!*cached) { @@ -2050,7 +2050,7 @@ int pcc_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf, * This fault injection can also be used to simulate -ENOSPC and * -EDQUOT failure of underlying PCC backend fs. */ - if (OBD_FAIL_CHECK(OBD_FAIL_LLITE_PCC_DETACH_MKWRITE)) { + if (CFS_FAIL_CHECK(OBD_FAIL_LLITE_PCC_DETACH_MKWRITE)) { pcc_io_fini(inode); pcc_ioctl_detach(inode, PCC_DETACH_OPT_UNCACHE); mmap_read_unlock(mm); @@ -2523,7 +2523,7 @@ int pcc_readwrite_attach(struct file *file, struct inode *inode, GOTO(out_fput, rc); /* Pause to allow for a race with concurrent HSM remove */ - OBD_FAIL_TIMEOUT(OBD_FAIL_LLITE_PCC_ATTACH_PAUSE, cfs_fail_val); + CFS_FAIL_TIMEOUT(OBD_FAIL_LLITE_PCC_ATTACH_PAUSE, cfs_fail_val); pcc_inode_lock(inode); pcci = ll_i2pcci(inode); diff --git a/lustre/llite/rw.c b/lustre/llite/rw.c index 7493b42..0fc48f0 100644 --- a/lustre/llite/rw.c +++ b/lustre/llite/rw.c @@ -1875,9 +1875,9 @@ int ll_readpage(struct file *file, struct page *vmpage) int result; ENTRY; - if (OBD_FAIL_PRECHECK(OBD_FAIL_LLITE_READPAGE_PAUSE)) { + if (CFS_FAIL_PRECHECK(OBD_FAIL_LLITE_READPAGE_PAUSE)) { unlock_page(vmpage); - OBD_FAIL_TIMEOUT(OBD_FAIL_LLITE_READPAGE_PAUSE, cfs_fail_val); + CFS_FAIL_TIMEOUT(OBD_FAIL_LLITE_READPAGE_PAUSE, cfs_fail_val); lock_page(vmpage); } diff --git a/lustre/llite/rw26.c b/lustre/llite/rw26.c index 5e78e23..3fd25e4 100644 --- a/lustre/llite/rw26.c +++ b/lustre/llite/rw26.c @@ -157,9 +157,9 @@ static void ll_invalidatepage(struct page *vmpage, cl_env_percpu_put(env); } - if (OBD_FAIL_PRECHECK(OBD_FAIL_LLITE_PAGE_INVALIDATE_PAUSE)) { + if (CFS_FAIL_PRECHECK(OBD_FAIL_LLITE_PAGE_INVALIDATE_PAUSE)) { unlock_page(vmpage); - OBD_FAIL_TIMEOUT(OBD_FAIL_LLITE_PAGE_INVALIDATE_PAUSE, + CFS_FAIL_TIMEOUT(OBD_FAIL_LLITE_PAGE_INVALIDATE_PAUSE, cfs_fail_val); lock_page(vmpage); } diff --git a/lustre/llite/vvp_io.c b/lustre/llite/vvp_io.c index e66d8bc..edc821d 100644 --- a/lustre/llite/vvp_io.c +++ b/lustre/llite/vvp_io.c @@ -75,7 +75,7 @@ static bool can_populate_pages(const struct lu_env *env, struct cl_io *io, /* don't need lock here to check lli_layout_gen as we have held * extent lock and GROUP lock has to hold to swap layout */ if (ll_layout_version_get(lli) != vio->vui_layout_gen || - OBD_FAIL_CHECK_RESET(OBD_FAIL_LLITE_LOST_LAYOUT, 0)) { + CFS_FAIL_CHECK_RESET(OBD_FAIL_LLITE_LOST_LAYOUT, 0)) { io->ci_need_restart = 1; /* this will cause a short read/write */ io->ci_continue = 0; @@ -1310,10 +1310,10 @@ static int vvp_io_write_start(const struct lu_env *env, } /* Tests to verify we take the i_mutex correctly */ - if (OBD_FAIL_CHECK(OBD_FAIL_LLITE_IMUTEX_SEC) && !lock_inode) + if (CFS_FAIL_CHECK(OBD_FAIL_LLITE_IMUTEX_SEC) && !lock_inode) RETURN(-EINVAL); - if (OBD_FAIL_CHECK(OBD_FAIL_LLITE_IMUTEX_NOSEC) && lock_inode) + if (CFS_FAIL_CHECK(OBD_FAIL_LLITE_IMUTEX_NOSEC) && lock_inode) RETURN(-EINVAL); if (!(file->f_flags & O_DIRECT)) { @@ -1515,7 +1515,7 @@ static int vvp_io_fault_start(const struct lu_env *env, vmpage = cfio->ft_vmpage; LASSERT(PageLocked(vmpage)); - if (OBD_FAIL_CHECK(OBD_FAIL_LLITE_FAULT_TRUNC_RACE)) + if (CFS_FAIL_CHECK(OBD_FAIL_LLITE_FAULT_TRUNC_RACE)) generic_error_remove_page(vmpage->mapping, vmpage); size = i_size_read(inode); diff --git a/lustre/llite/vvp_object.c b/lustre/llite/vvp_object.c index 3e089df..2e890ad 100644 --- a/lustre/llite/vvp_object.c +++ b/lustre/llite/vvp_object.c @@ -221,7 +221,7 @@ static void vvp_req_attr_set(const struct lu_env *env, struct cl_object *obj, } obdo_from_inode(oa, inode, valid_flags & attr->cra_flags); obdo_set_parent_fid(oa, &ll_i2info(inode)->lli_fid); - if (OBD_FAIL_CHECK(OBD_FAIL_LFSCK_INVALID_PFID)) + if (CFS_FAIL_CHECK(OBD_FAIL_LFSCK_INVALID_PFID)) oa->o_parent_oid++; attr->cra_uid = lli->lli_uid; diff --git a/lustre/llite/xattr_cache.c b/lustre/llite/xattr_cache.c index 0a75174..a980496 100644 --- a/lustre/llite/xattr_cache.c +++ b/lustre/llite/xattr_cache.c @@ -498,7 +498,7 @@ static int ll_xattr_cache_refill(struct inode *inode) } else if (xval + *xsizes > xvtail) { CERROR("xattr protocol violation (vals are broken)\n"); rc = -EPROTO; - } else if (OBD_FAIL_CHECK(OBD_FAIL_LLITE_XATTR_ENOMEM)) { + } else if (CFS_FAIL_CHECK(OBD_FAIL_LLITE_XATTR_ENOMEM)) { rc = -ENOMEM; } else if (!strcmp(xdata, XATTR_NAME_ACL_ACCESS)) { /* Filter out ACL ACCESS since it's cached separately */ diff --git a/lustre/lmv/lmv_obd.c b/lustre/lmv/lmv_obd.c index 6d75167..37182bf 100644 --- a/lustre/lmv/lmv_obd.c +++ b/lustre/lmv/lmv_obd.c @@ -1715,7 +1715,7 @@ lmv_locate_tgt_by_name(struct lmv_obd *lmv, struct lmv_stripe_md *lsm, return tgt; } - if (OBD_FAIL_CHECK(OBD_FAIL_LFSCK_BAD_NAME_HASH)) { + if (CFS_FAIL_CHECK(OBD_FAIL_LFSCK_BAD_NAME_HASH)) { if (cfs_fail_val >= lsm->lsm_md_stripe_count) return ERR_PTR(-EBADF); oinfo = &lsm->lsm_md_oinfo[cfs_fail_val]; diff --git a/lustre/lod/lod_dev.c b/lustre/lod/lod_dev.c index 7ecd1e9..0cd2ea3 100644 --- a/lustre/lod/lod_dev.c +++ b/lustre/lod/lod_dev.c @@ -470,9 +470,9 @@ static int lod_sub_recovery_thread(void *arg) again: - if (unlikely(OBD_FAIL_PRECHECK(OBD_FAIL_TGT_RECOVERY_CONNECT)) && + if (unlikely(CFS_FAIL_PRECHECK(OBD_FAIL_TGT_RECOVERY_CONNECT)) && lrd->lrd_ltd) { - OBD_FAIL_TIMEOUT(OBD_FAIL_TGT_RECOVERY_CONNECT, cfs_fail_val); + CFS_FAIL_TIMEOUT(OBD_FAIL_TGT_RECOVERY_CONNECT, cfs_fail_val); rc = -EIO; } else { rc = lod_sub_prep_llog(env, lod, dt, lrd->lrd_idx); @@ -1127,7 +1127,7 @@ static int lod_process_config(const struct lu_env *env, case LCFG_PRE_CLEANUP: { lod_sub_process_config(env, lod, &lod->lod_mdt_descs, lcfg); lod_sub_process_config(env, lod, &lod->lod_ost_descs, lcfg); - OBD_FAIL_TIMEOUT(OBD_FAIL_TGT_RECOVERY_CONNECT, cfs_fail_val * 2); + CFS_FAIL_TIMEOUT(OBD_FAIL_TGT_RECOVERY_CONNECT, cfs_fail_val * 2); next = &lod->lod_child->dd_lu_dev; rc = next->ld_ops->ldo_process_config(env, next, lcfg); if (rc != 0) @@ -1823,7 +1823,7 @@ static int lod_add_noop_records(const struct lu_env *env, static int lod_trans_stop(const struct lu_env *env, struct dt_device *dt, struct thandle *th) { - if (OBD_FAIL_CHECK(OBD_FAIL_SPLIT_UPDATE_REC)) { + if (CFS_FAIL_CHECK(OBD_FAIL_SPLIT_UPDATE_REC)) { int rc; rc = lod_add_noop_records(env, dt, th, 5000); diff --git a/lustre/lod/lod_lov.c b/lustre/lod/lod_lov.c index 525c9d5..a641090 100644 --- a/lustre/lod/lod_lov.c +++ b/lustre/lod/lod_lov.c @@ -744,7 +744,7 @@ static int lod_gen_component_ea(const struct lu_env *env, lmm->lmm_magic = cpu_to_le32(magic); lmm->lmm_pattern = cpu_to_le32(lod_comp->llc_pattern); fid_to_lmm_oi(fid, &lmm->lmm_oi); - if (OBD_FAIL_CHECK(OBD_FAIL_LFSCK_BAD_LMMOI)) + if (CFS_FAIL_CHECK(OBD_FAIL_LFSCK_BAD_LMMOI)) lmm->lmm_oi.oi.oi_id++; lmm_oi_cpu_to_le(&lmm->lmm_oi, &lmm->lmm_oi); @@ -800,7 +800,7 @@ static int lod_gen_component_ea(const struct lu_env *env, /* instantiated component */ info->lti_fid = *lu_object_fid(&object->do_lu); - if (OBD_FAIL_CHECK(OBD_FAIL_LFSCK_MULTIPLE_REF) && + if (CFS_FAIL_CHECK(OBD_FAIL_LFSCK_MULTIPLE_REF) && comp_idx == 0) { if (cfs_fail_val == 0) cfs_fail_val = info->lti_fid.f_oid; @@ -813,7 +813,7 @@ static int lod_gen_component_ea(const struct lu_env *env, ostid_cpu_to_le(&info->lti_ostid, &objs[i].l_ost_oi); objs[i].l_ost_gen = cpu_to_le32(0); - if (OBD_FAIL_CHECK(OBD_FAIL_MDS_FLD_LOOKUP)) + if (CFS_FAIL_CHECK(OBD_FAIL_MDS_FLD_LOOKUP)) rc = -ENOENT; else rc = lod_fld_lookup(env, lod, &info->lti_fid, @@ -1828,7 +1828,7 @@ static __u32 lod_dom_stripesize_limit(const struct lu_env *env, int rc; /* set bfree as fraction of total space */ - if (OBD_FAIL_CHECK(OBD_FAIL_MDS_STATFS_SPOOF)) { + if (CFS_FAIL_CHECK(OBD_FAIL_MDS_STATFS_SPOOF)) { spin_lock(&d->lod_lsfs_lock); d->lod_lsfs_free_mb = mult_frac(d->lod_lsfs_total_mb, min_t(int, cfs_fail_val, 100), 100); diff --git a/lustre/lod/lod_object.c b/lustre/lod/lod_object.c index 963fb3c..d069041 100644 --- a/lustre/lod/lod_object.c +++ b/lustre/lod/lod_object.c @@ -1279,7 +1279,7 @@ static int lod_declare_attr_set(const struct lu_env *env, if (!(attr->la_valid & LA_REMOTE_ATTR_SET)) RETURN(rc); - if (OBD_FAIL_CHECK(OBD_FAIL_LFSCK_BAD_OWNER)) + if (CFS_FAIL_CHECK(OBD_FAIL_LFSCK_BAD_OWNER)) RETURN(0); } else { if (!(attr->la_valid & (LA_UID | LA_GID | LA_PROJID | LA_MODE | @@ -1330,13 +1330,13 @@ static int lod_declare_attr_set(const struct lu_env *env, !S_ISREG(attr->la_mode)) RETURN(0); - if (OBD_FAIL_CHECK(OBD_FAIL_LFSCK_LOST_STRIPE)) { + if (CFS_FAIL_CHECK(OBD_FAIL_LFSCK_LOST_STRIPE)) { rc = lod_sub_declare_xattr_del(env, next, XATTR_NAME_LOV, th); RETURN(rc); } - if (OBD_FAIL_CHECK(OBD_FAIL_LFSCK_CHANGE_STRIPE) || - OBD_FAIL_CHECK(OBD_FAIL_LFSCK_BAD_PFL_RANGE)) { + if (CFS_FAIL_CHECK(OBD_FAIL_LFSCK_CHANGE_STRIPE) || + CFS_FAIL_CHECK(OBD_FAIL_LFSCK_BAD_PFL_RANGE)) { struct lod_thread_info *info = lod_env_info(env); struct lu_buf *buf = &info->lti_buf; @@ -1378,7 +1378,7 @@ static int lod_attr_set(const struct lu_env *env, if (!(attr->la_valid & LA_REMOTE_ATTR_SET)) RETURN(rc); - if (OBD_FAIL_CHECK(OBD_FAIL_LFSCK_BAD_OWNER)) + if (CFS_FAIL_CHECK(OBD_FAIL_LFSCK_BAD_OWNER)) RETURN(0); } else { if (!(attr->la_valid & (LA_UID | LA_GID | LA_MODE | LA_PROJID | @@ -1430,12 +1430,12 @@ static int lod_attr_set(const struct lu_env *env, !S_ISREG(attr->la_mode)) RETURN(0); - if (OBD_FAIL_CHECK(OBD_FAIL_LFSCK_LOST_STRIPE)) { + if (CFS_FAIL_CHECK(OBD_FAIL_LFSCK_LOST_STRIPE)) { rc = lod_sub_xattr_del(env, next, XATTR_NAME_LOV, th); RETURN(rc); } - if (OBD_FAIL_CHECK(OBD_FAIL_LFSCK_CHANGE_STRIPE)) { + if (CFS_FAIL_CHECK(OBD_FAIL_LFSCK_CHANGE_STRIPE)) { struct lod_thread_info *info = lod_env_info(env); struct lu_buf *buf = &info->lti_buf; struct ost_id *oi = &info->lti_ostid; @@ -1473,7 +1473,7 @@ static int lod_attr_set(const struct lu_env *env, rc = lod_sub_xattr_set(env, next, buf, XATTR_NAME_LOV, LU_XATTR_REPLACE, th); - } else if (OBD_FAIL_CHECK(OBD_FAIL_LFSCK_BAD_PFL_RANGE)) { + } else if (CFS_FAIL_CHECK(OBD_FAIL_LFSCK_BAD_PFL_RANGE)) { struct lod_thread_info *info = lod_env_info(env); struct lu_buf *buf = &info->lti_buf; struct lov_comp_md_v1 *lcm; @@ -1921,7 +1921,7 @@ static int lod_dir_declare_create_stripes(const struct lu_env *env, if (rc != 0) GOTO(out, rc); - if (OBD_FAIL_CHECK(OBD_FAIL_LFSCK_BAD_SLAVE_NAME) && + if (CFS_FAIL_CHECK(OBD_FAIL_LFSCK_BAD_SLAVE_NAME) && cfs_fail_val == i) snprintf(stripe_name, sizeof(info->lti_key), DFID":%u", @@ -1959,9 +1959,9 @@ static int lod_dir_declare_create_stripes(const struct lu_env *env, GOTO(out, rc); } - if (!OBD_FAIL_CHECK(OBD_FAIL_LFSCK_LOST_SLAVE_LMV) || + if (!CFS_FAIL_CHECK(OBD_FAIL_LFSCK_LOST_SLAVE_LMV) || cfs_fail_val != i) { - if (OBD_FAIL_CHECK(OBD_FAIL_LFSCK_BAD_SLAVE_LMV) && + if (CFS_FAIL_CHECK(OBD_FAIL_LFSCK_BAD_SLAVE_LMV) && cfs_fail_val == i) slave_lmm->lmv_master_mdt_index = cpu_to_le32(i + 1); @@ -2047,7 +2047,7 @@ static int lod_mdt_alloc_specific(const struct lu_env *env, idx, lod->lod_remote_mdt_count + 1, stripe_idx); if (likely(!is_specific && - !OBD_FAIL_CHECK(OBD_FAIL_LARGE_STRIPE))) { + !CFS_FAIL_CHECK(OBD_FAIL_LARGE_STRIPE))) { /* check whether the idx already exists * in current allocated array */ for (k = 0; k < stripe_idx; k++) { @@ -2112,7 +2112,7 @@ static int lod_mdt_alloc_specific(const struct lu_env *env, * remote MDT, otherwise we may save too many local * slave locks which will exceed RS_MAX_LOCKS. */ - if (unlikely(OBD_FAIL_CHECK(OBD_FAIL_LARGE_STRIPE))) + if (unlikely(CFS_FAIL_CHECK(OBD_FAIL_LARGE_STRIPE))) idx = master_index; mdt_indices[stripe_idx + 1] = (idx + 1) % (lod->lod_remote_mdt_count + 1); @@ -2123,7 +2123,7 @@ static int lod_mdt_alloc_specific(const struct lu_env *env, LASSERT(fid_is_sane(&fid)); /* fail a remote stripe FID allocation */ - if (stripe_idx && OBD_FAIL_CHECK(OBD_FAIL_MDS_STRIPE_FID)) + if (stripe_idx && CFS_FAIL_CHECK(OBD_FAIL_MDS_STRIPE_FID)) continue; dto = dt_locate_at(env, tgt_dt, &fid, @@ -4275,7 +4275,7 @@ static int lod_xattr_set_lmv(const struct lu_env *env, struct dt_object *dt, continue; /* fail a remote stripe creation */ - if (i && OBD_FAIL_CHECK(OBD_FAIL_MDS_STRIPE_CREATE)) + if (i && CFS_FAIL_CHECK(OBD_FAIL_MDS_STRIPE_CREATE)) continue; /* don't create stripe if: @@ -4307,9 +4307,9 @@ static int lod_xattr_set_lmv(const struct lu_env *env, struct dt_object *dt, GOTO(out, rc); } - if (!OBD_FAIL_CHECK(OBD_FAIL_LFSCK_LOST_SLAVE_LMV) || + if (!CFS_FAIL_CHECK(OBD_FAIL_LFSCK_LOST_SLAVE_LMV) || cfs_fail_val != i) { - if (OBD_FAIL_CHECK(OBD_FAIL_LFSCK_BAD_SLAVE_LMV) && + if (CFS_FAIL_CHECK(OBD_FAIL_LFSCK_BAD_SLAVE_LMV) && cfs_fail_val == i) slave_lmm->lmv_master_mdt_index = cpu_to_le32(i + 1); @@ -4338,7 +4338,7 @@ static int lod_xattr_set_lmv(const struct lu_env *env, struct dt_object *dt, if (rc != 0) GOTO(out, rc); - if (OBD_FAIL_CHECK(OBD_FAIL_LFSCK_BAD_SLAVE_NAME) && + if (CFS_FAIL_CHECK(OBD_FAIL_LFSCK_BAD_SLAVE_NAME) && cfs_fail_val == i) snprintf(stripe_name, sizeof(info->lti_key), DFID":%d", PFID(lu_object_fid(&dto->do_lu)), i + 1); @@ -4371,7 +4371,7 @@ static int lod_xattr_set_lmv(const struct lu_env *env, struct dt_object *dt, GOTO(out, rc); } - if (!OBD_FAIL_CHECK(OBD_FAIL_LFSCK_LOST_MASTER_LMV)) + if (!CFS_FAIL_CHECK(OBD_FAIL_LFSCK_LOST_MASTER_LMV)) rc = lod_sub_xattr_set(env, dt_object_child(dt), &lmv_buf, XATTR_NAME_LMV, fl, th); out: @@ -5772,7 +5772,7 @@ static void lod_ah_init(const struct lu_env *env, /* shrink the stripe_count to the avaible MDT count */ if (lc->ldo_dir_stripe_count > d->lod_remote_mdt_count + 1 && - !OBD_FAIL_CHECK(OBD_FAIL_LARGE_STRIPE)) { + !CFS_FAIL_CHECK(OBD_FAIL_LARGE_STRIPE)) { lc->ldo_dir_stripe_count = d->lod_remote_mdt_count + 1; if (lc->ldo_dir_stripe_count == 1) lc->ldo_dir_stripe_count = 0; @@ -6018,7 +6018,7 @@ int lod_declare_striped_create(const struct lu_env *env, struct dt_object *dt, int rc; ENTRY; - if (OBD_FAIL_CHECK(OBD_FAIL_MDS_ALLOC_OBDO)) + if (CFS_FAIL_CHECK(OBD_FAIL_MDS_ALLOC_OBDO)) GOTO(out, rc = -ENOMEM); if (!dt_object_remote(next)) { @@ -6165,7 +6165,7 @@ static int lod_declare_create(const struct lu_env *env, struct dt_object *dt, * striped directory with specified stripeEA, then it * should ignore the default stripeEA */ if (hint != NULL && hint->dah_eadata == NULL) { - if (OBD_FAIL_CHECK(OBD_FAIL_MDS_STALE_DIR_LAYOUT)) + if (CFS_FAIL_CHECK(OBD_FAIL_MDS_STALE_DIR_LAYOUT)) GOTO(out, rc = -EREMOTE); if (lo->ldo_dir_stripe_offset != LMV_OFFSET_DEFAULT && @@ -6419,7 +6419,7 @@ lod_obj_stripe_destroy_cb(const struct lu_env *env, struct lod_object *lo, if (data->locd_declare) return lod_sub_declare_destroy(env, dt, th); - if (!OBD_FAIL_CHECK(OBD_FAIL_LFSCK_LOST_SPEOBJ) || + if (!CFS_FAIL_CHECK(OBD_FAIL_LFSCK_LOST_SPEOBJ) || stripe_idx == cfs_fail_val) return lod_sub_destroy(env, dt, th); @@ -6491,8 +6491,8 @@ static int lod_declare_destroy(const struct lu_env *env, struct dt_object *dt, if (rc) RETURN(rc); - if (OBD_FAIL_CHECK(OBD_FAIL_LFSCK_LOST_MDTOBJ) || - OBD_FAIL_CHECK(OBD_FAIL_LFSCK_LOST_MDTOBJ2)) + if (CFS_FAIL_CHECK(OBD_FAIL_LFSCK_LOST_MDTOBJ) || + CFS_FAIL_CHECK(OBD_FAIL_LFSCK_LOST_MDTOBJ2)) RETURN(0); if (!lod_obj_is_striped(dt)) @@ -6583,8 +6583,8 @@ static int lod_destroy(const struct lu_env *env, struct dt_object *dt, if (rc != 0) RETURN(rc); - if (OBD_FAIL_CHECK(OBD_FAIL_LFSCK_LOST_MDTOBJ) || - OBD_FAIL_CHECK(OBD_FAIL_LFSCK_LOST_MDTOBJ2)) + if (CFS_FAIL_CHECK(OBD_FAIL_LFSCK_LOST_MDTOBJ) || + CFS_FAIL_CHECK(OBD_FAIL_LFSCK_LOST_MDTOBJ2)) RETURN(0); if (!lod_obj_is_striped(dt)) @@ -6600,7 +6600,7 @@ static int lod_destroy(const struct lu_env *env, struct dt_object *dt, if (!dt_object_exists(stripe)) continue; - if (!OBD_FAIL_CHECK(OBD_FAIL_LFSCK_LOST_SPEOBJ) || + if (!CFS_FAIL_CHECK(OBD_FAIL_LFSCK_LOST_SPEOBJ) || i == cfs_fail_val) { dt_write_lock(env, stripe, DT_TGT_CHILD); rc = lod_sub_ref_del(env, stripe, th); @@ -7679,7 +7679,7 @@ static int lod_primary_pick(const struct lu_env *env, struct lod_object *lo, int picked = -1, second_pick = -1, third_pick = -1; ENTRY; - if (OBD_FAIL_CHECK(OBD_FAIL_FLR_RANDOM_PICK_MIRROR)) { + if (CFS_FAIL_CHECK(OBD_FAIL_FLR_RANDOM_PICK_MIRROR)) { get_random_bytes(&seq, sizeof(seq)); seq %= lo->ldo_mirror_count; } diff --git a/lustre/lod/lod_pool.c b/lustre/lod/lod_pool.c index e0671b0..a2e7df4 100644 --- a/lustre/lod/lod_pool.c +++ b/lustre/lod/lod_pool.c @@ -170,7 +170,7 @@ static void *pool_proc_next(struct seq_file *seq, void *v, loff_t *pos) if (*pos > pool_tgt_count(iter->lpi_pool)) return NULL; - OBD_FAIL_TIMEOUT(OBD_FAIL_OST_LIST_ASSERT, cfs_fail_val); + CFS_FAIL_TIMEOUT(OBD_FAIL_OST_LIST_ASSERT, cfs_fail_val); /* iterate to find a non empty entry */ prev_idx = iter->lpi_idx; diff --git a/lustre/lod/lod_qos.c b/lustre/lod/lod_qos.c index d5ffeb7..4775b40 100644 --- a/lustre/lod/lod_qos.c +++ b/lustre/lod/lod_qos.c @@ -702,7 +702,7 @@ static int lod_check_and_reserve_ost(const struct lu_env *env, lod_qos_tgt_in_use(env, stripe_idx, ost_idx); stripe[stripe_idx] = o; ost_indices[stripe_idx] = ost_idx; - OBD_FAIL_TIMEOUT(OBD_FAIL_MDS_LOV_CREATE_RACE, 2); + CFS_FAIL_TIMEOUT(OBD_FAIL_MDS_LOV_CREATE_RACE, 2); stripe_idx++; *s_idx = stripe_idx; @@ -827,13 +827,13 @@ repeat_find: /* Fail Check before osc_precreate() is called so we can only 'fail' single OSC. */ - if (OBD_FAIL_CHECK(OBD_FAIL_MDS_OSC_PRECREATE) && ost_idx == 0) + if (CFS_FAIL_CHECK(OBD_FAIL_MDS_OSC_PRECREATE) && ost_idx == 0) continue; - if (OBD_FAIL_PRECHECK(OBD_FAIL_MDS_LOD_CREATE_PAUSE)) { + if (CFS_FAIL_PRECHECK(OBD_FAIL_MDS_LOD_CREATE_PAUSE)) { clear_bit(LQ_SAME_SPACE, &m->lod_ost_descs.ltd_qos.lq_flags); - OBD_FAIL_TIMEOUT(OBD_FAIL_MDS_LOD_CREATE_PAUSE, + CFS_FAIL_TIMEOUT(OBD_FAIL_MDS_LOD_CREATE_PAUSE, cfs_fail_val); } rc = lod_check_and_reserve_ost(env, lo, lod_comp, ost_idx, @@ -1284,7 +1284,7 @@ repeat_find: /* Fail Check before osc_precreate() is called so we can only 'fail' single OSC. */ - if (OBD_FAIL_CHECK(OBD_FAIL_MDS_OSC_PRECREATE) && ost_idx == 0) + if (CFS_FAIL_CHECK(OBD_FAIL_MDS_OSC_PRECREATE) && ost_idx == 0) continue; /* @@ -1635,7 +1635,7 @@ static int lod_ost_alloc_qos(const struct lu_env *env, struct lod_object *lo, /* Fail Check before osc_precreate() is called * so we can only 'fail' single OSC. */ - if (OBD_FAIL_CHECK(OBD_FAIL_MDS_OSC_PRECREATE) && + if (CFS_FAIL_CHECK(OBD_FAIL_MDS_OSC_PRECREATE) && osts->op_array[i] == 0) continue; diff --git a/lustre/lov/lov_object.c b/lustre/lov/lov_object.c index f8e7886..0c10925 100644 --- a/lustre/lov/lov_object.c +++ b/lustre/lov/lov_object.c @@ -134,7 +134,7 @@ static int lov_init_sub(const struct lu_env *env, struct lov_object *lov, int stripe = lov_comp_stripe(idx); int result; - if (OBD_FAIL_CHECK(OBD_FAIL_LOV_INIT)) { + if (CFS_FAIL_CHECK(OBD_FAIL_LOV_INIT)) { /* For sanity:test_206. * Do not leave the object in cache to avoid accessing * freed memory. This is because osc_object is referring to -- 1.8.3.1