Whamcloud - gitweb
LU-12610 misc: remove OBD_ -> CFS_ macros 09/50809/4
authorTimothy Day <timday@amazon.com>
Wed, 24 May 2023 16:31:12 +0000 (16:31 +0000)
committerOleg Drokin <green@whamcloud.com>
Fri, 9 Jun 2023 05:26:47 +0000 (05:26 +0000)
Remove OBD macros that are simply redefinitions
of CFS macros.

Test-Parameters: trivial
Signed-off-by: Timothy Day <timday@amazon.com>
Signed-off-by: Ben Evans <beevans@whamcloud.com>
Change-Id: I15fe8aa22cb0203bed102a35361f4854ddaabecb
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/50809
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Neil Brown <neilb@suse.de>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
25 files changed:
lustre/fid/fid_handler.c
lustre/fid/fid_request.c
lustre/fld/fld_request.c
lustre/include/lustre_log.h
lustre/lfsck/lfsck_engine.c
lustre/lfsck/lfsck_layout.c
lustre/lfsck/lfsck_lib.c
lustre/lfsck/lfsck_striped_dir.c
lustre/ofd/ofd_dev.c
lustre/ofd/ofd_dlm.c
lustre/ofd/ofd_fs.c
lustre/ofd/ofd_io.c
lustre/ofd/ofd_lvb.c
lustre/ofd/ofd_obd.c
lustre/ofd/ofd_objects.c
lustre/osp/osp_internal.h
lustre/osp/osp_md_object.c
lustre/osp/osp_object.c
lustre/osp/osp_precreate.c
lustre/osp/osp_sync.c
lustre/osp/osp_trans.c
lustre/quota/qmt_handler.c
lustre/quota/qmt_pool.c
lustre/quota/qsd_handler.c
lustre/quota/qsd_reint.c

index 06196e6..93b5b01 100644 (file)
@@ -219,7 +219,7 @@ static int range_alloc_set(const struct lu_env *env,
        if (lu_seq_range_is_zero(loset))
                __seq_set_init(env, seq);
 
-       if (OBD_FAIL_CHECK(OBD_FAIL_SEQ_ALLOC)) /* exhaust set */
+       if (CFS_FAIL_CHECK(OBD_FAIL_SEQ_ALLOC)) /* exhaust set */
                loset->lsr_start = loset->lsr_end;
 
        if (lu_seq_range_is_exhausted(loset)) {
index 2fa8590..ed6cd85 100644 (file)
@@ -317,7 +317,7 @@ int seq_client_alloc_fid(const struct lu_env *env,
 
        mutex_lock(&seq->lcs_mutex);
 
-       if (OBD_FAIL_CHECK(OBD_FAIL_SEQ_EXHAUST))
+       if (CFS_FAIL_CHECK(OBD_FAIL_SEQ_EXHAUST))
                seq->lcs_fid.f_oid = seq->lcs_width;
 
        if (unlikely(!fid_is_zero(&seq->lcs_fid) &&
index 28dee3d..8148ad7 100644 (file)
@@ -385,7 +385,7 @@ again:
        req->rq_reply_portal = MDC_REPLY_PORTAL;
        ptlrpc_at_set_req_timeout(req);
 
-       if (OBD_FAIL_CHECK(OBD_FAIL_FLD_QUERY_REQ) && req->rq_no_delay) {
+       if (CFS_FAIL_CHECK(OBD_FAIL_FLD_QUERY_REQ) && req->rq_no_delay) {
                /* the same error returned by ptlrpc_import_delay_req */
                rc = -EAGAIN;
                req->rq_status = rc;
index 87b4ec9..14e5668 100644 (file)
@@ -529,7 +529,7 @@ static inline int llog_connect(struct llog_ctxt *ctxt,
 
 static inline int llog_max_idx(struct llog_log_hdr *lh)
 {
-       if (OBD_FAIL_PRECHECK(OBD_FAIL_CAT_RECORDS) &&
+       if (CFS_FAIL_PRECHECK(OBD_FAIL_CAT_RECORDS) &&
            unlikely(lh->llh_flags & LLOG_F_IS_CAT))
                return cfs_fail_val;
        else
index 29b6b44..8d4e380 100644 (file)
@@ -766,7 +766,7 @@ checkpoint:
                        GOTO(out, rc = 0);
                }
 
-               if (OBD_FAIL_CHECK(OBD_FAIL_LFSCK_FATAL2)) {
+               if (CFS_FAIL_CHECK(OBD_FAIL_LFSCK_FATAL2)) {
                        spin_lock(&lfsck->li_lock);
                        thread_set_flags(thread, SVC_STOPPING);
                        spin_unlock(&lfsck->li_lock);
@@ -854,7 +854,7 @@ static int lfsck_master_oit_engine(const struct lu_env *env,
                        RETURN(0);
                }
 
-               if (OBD_FAIL_CHECK(OBD_FAIL_LFSCK_CRASH))
+               if (CFS_FAIL_CHECK(OBD_FAIL_LFSCK_CRASH))
                        RETURN(0);
 
                lfsck->li_current_oit_processed = 1;
@@ -976,7 +976,7 @@ checkpoint:
                /* Rate control. */
                lfsck_control_speed(lfsck);
 
-               if (OBD_FAIL_CHECK(OBD_FAIL_LFSCK_FATAL1)) {
+               if (CFS_FAIL_CHECK(OBD_FAIL_LFSCK_FATAL1)) {
                        spin_lock(&lfsck->li_lock);
                        thread_set_flags(thread, SVC_STOPPING);
                        spin_unlock(&lfsck->li_lock);
@@ -1093,7 +1093,7 @@ int lfsck_master_engine(void *args)
               PFID(&lfsck->li_pos_checkpoint.lp_dir_parent),
               current->pid, rc);
 
-       if (!OBD_FAIL_CHECK(OBD_FAIL_LFSCK_CRASH))
+       if (!CFS_FAIL_CHECK(OBD_FAIL_LFSCK_CRASH))
                rc = lfsck_post(env, lfsck, rc);
        else
                lfsck_close_dir(env, lfsck, rc);
@@ -1697,7 +1697,7 @@ int lfsck_assistant_engine(void *args)
                               "scan start, synced: rc = %d\n",
                               lfsck_lfsck2name(lfsck), rc2);
 
-                       if (OBD_FAIL_CHECK(OBD_FAIL_LFSCK_NO_DOUBLESCAN))
+                       if (CFS_FAIL_CHECK(OBD_FAIL_LFSCK_NO_DOUBLESCAN))
                                GOTO(cleanup, rc = 0);
 
                        while (test_bit(LAD_IN_DOUBLE_SCAN, &lad->lad_flags)) {
index 8875f5e..f2f2a16 100644 (file)
@@ -1437,7 +1437,7 @@ lfsck_layout_lastid_load(const struct lu_env *env,
                               "LAST_ID file for sequence %#llx\n",
                               lfsck_lfsck2name(lfsck), lls->lls_seq);
 
-                       if (OBD_FAIL_CHECK(OBD_FAIL_LFSCK_DELAY4) &&
+                       if (CFS_FAIL_CHECK(OBD_FAIL_LFSCK_DELAY4) &&
                            cfs_fail_val > 0) {
                                struct ptlrpc_thread *thread =
                                        &lfsck->li_thread;
@@ -5946,7 +5946,7 @@ static int lfsck_layout_slave_exec_oit(const struct lu_env *env,
 
        LASSERT(llsd != NULL);
 
-       if (OBD_FAIL_CHECK(OBD_FAIL_LFSCK_DELAY5) &&
+       if (CFS_FAIL_CHECK(OBD_FAIL_LFSCK_DELAY5) &&
            cfs_fail_val == lfsck_dev_idx(lfsck)) {
                struct ptlrpc_thread    *thread = &lfsck->li_thread;
 
index 421e65f..3713f15 100644 (file)
@@ -3110,7 +3110,7 @@ int lfsck_start(const struct lu_env *env, struct dt_device *key,
        /* start == NULL means auto trigger paused LFSCK. */
        if (!start) {
                if (list_empty(&lfsck->li_list_scan) ||
-                   OBD_FAIL_CHECK(OBD_FAIL_LFSCK_NO_AUTO))
+                   CFS_FAIL_CHECK(OBD_FAIL_LFSCK_NO_AUTO))
                        GOTO(put, rc = 0);
        } else if (start->ls_flags & LPF_BROADCAST && !lfsck->li_master) {
                CERROR("%s: only allow to specify '-A | -o' via MDS\n",
index b0c77dc..fe18e10 100644 (file)
@@ -1702,7 +1702,7 @@ int lfsck_namespace_scan_shard(const struct lu_env *env,
                if (unlikely(!thread_is_running(thread)))
                        GOTO(out, rc = 0);
 
-               if (OBD_FAIL_CHECK(OBD_FAIL_LFSCK_FATAL2)) {
+               if (CFS_FAIL_CHECK(OBD_FAIL_LFSCK_FATAL2)) {
                        spin_lock(&lfsck->li_lock);
                        thread_set_flags(thread, SVC_STOPPING);
                        spin_unlock(&lfsck->li_lock);
index 0c600d4..e1e97a9 100644 (file)
@@ -647,7 +647,7 @@ static int ofd_prepare(const struct lu_env *env, struct lu_device *pdev,
        LASSERTF(rc == 0, "register namespace failed: rc = %d\n", rc);
 
        target_recovery_init(&ofd->ofd_lut, tgt_request_handle);
-       OBD_FAIL_TIMEOUT_ORSET(OBD_FAIL_OST_PREPARE_DELAY, OBD_FAIL_ONCE,
+       CFS_FAIL_TIMEOUT_ORSET(OBD_FAIL_OST_PREPARE_DELAY, CFS_FAIL_ONCE,
                               (OBD_TIMEOUT_DEFAULT + 1) / 4);
        LASSERT(obd->obd_no_conn);
        spin_lock(&obd->obd_dev_lock);
@@ -1384,7 +1384,7 @@ static int ofd_orphans_destroy(const struct lu_env *env,
        LASSERT(exp != NULL);
        skip_orphan = !!(exp_connect_flags(exp) & OBD_CONNECT_SKIP_ORPHAN);
 
-       if (OBD_FAIL_CHECK(OBD_FAIL_OST_NODESTROY))
+       if (CFS_FAIL_CHECK(OBD_FAIL_OST_NODESTROY))
                goto done;
 
        LCONSOLE(D_INFO, "%s: deleting orphan objects from "DOSTID
@@ -1465,7 +1465,7 @@ static int ofd_create_hdl(struct tgt_session_info *tsi)
 
        ENTRY;
 
-       if (OBD_FAIL_CHECK(OBD_FAIL_OST_EROFS))
+       if (CFS_FAIL_CHECK(OBD_FAIL_OST_EROFS))
                RETURN(-EROFS);
 
        if (ofd->ofd_no_precreate)
@@ -1739,7 +1739,7 @@ static int ofd_destroy_hdl(struct tgt_session_info *tsi)
 
        ENTRY;
 
-       if (OBD_FAIL_CHECK(OBD_FAIL_OST_EROFS))
+       if (CFS_FAIL_CHECK(OBD_FAIL_OST_EROFS))
                RETURN(-EROFS);
 
        /* This is old case for clients before Lustre 2.4 */
@@ -1822,7 +1822,7 @@ static int ofd_statfs_hdl(struct tgt_session_info *tsi)
 
        ENTRY;
 
-       OBD_FAIL_TIMEOUT(OBD_FAIL_OST_STATFS_DELAY, 10);
+       CFS_FAIL_TIMEOUT(OBD_FAIL_OST_STATFS_DELAY, 10);
 
        osfs = req_capsule_server_get(tsi->tsi_pill, &RMF_OBD_STATFS);
 
@@ -1832,7 +1832,7 @@ static int ofd_statfs_hdl(struct tgt_session_info *tsi)
                CERROR("%s: statfs failed: rc = %d\n",
                       tgt_name(tsi->tsi_tgt), rc);
 
-       if (OBD_FAIL_CHECK(OBD_FAIL_OST_STATFS_EINPROGRESS))
+       if (CFS_FAIL_CHECK(OBD_FAIL_OST_STATFS_EINPROGRESS))
                rc = -EINPROGRESS;
 
        ofd_counter_incr(tsi->tsi_exp, LPROC_OFD_STATS_STATFS,
@@ -2079,7 +2079,7 @@ static int ofd_punch_hdl(struct tgt_session_info *tsi)
 
        ENTRY;
 
-       OBD_FAIL_TIMEOUT(OBD_FAIL_OST_PAUSE_PUNCH, cfs_fail_val);
+       CFS_FAIL_TIMEOUT(OBD_FAIL_OST_PAUSE_PUNCH, cfs_fail_val);
 
        if ((oa->o_valid & (OBD_MD_FLSIZE | OBD_MD_FLBLOCKS)) !=
            (OBD_MD_FLSIZE | OBD_MD_FLBLOCKS))
index 403c8e2..baec254 100644 (file)
@@ -161,7 +161,7 @@ static enum interval_iter ofd_intent_cb(struct interval_node *n, void *args)
                        GOTO(out_release, rc);
        }
 
-       if (!OBD_FAIL_CHECK(OBD_FAIL_OST_GL_WORK_ALLOC))
+       if (!CFS_FAIL_CHECK(OBD_FAIL_OST_GL_WORK_ALLOC))
                OBD_SLAB_ALLOC_PTR_GFP(gl_work, ldlm_glimpse_work_kmem,
                                       GFP_ATOMIC);
 
@@ -264,9 +264,9 @@ int ofd_intent_policy(const struct lu_env *env, struct ldlm_namespace *ns,
         */
 
        if (flags & LDLM_FL_BLOCK_NOWAIT) {
-               OBD_FAIL_TIMEOUT(OBD_FAIL_LDLM_AGL_DELAY, 5);
+               CFS_FAIL_TIMEOUT(OBD_FAIL_LDLM_AGL_DELAY, 5);
 
-               if (OBD_FAIL_CHECK(OBD_FAIL_LDLM_AGL_NOLOCK))
+               if (CFS_FAIL_CHECK(OBD_FAIL_LDLM_AGL_NOLOCK))
                        RETURN(ELDLM_LOCK_ABORTED);
        }
 
@@ -286,7 +286,7 @@ int ofd_intent_policy(const struct lu_env *env, struct ldlm_namespace *ns,
 
        /* The lock met with no resistance; we're finished. */
        if (rc == LDLM_ITER_CONTINUE) {
-               if (OBD_FAIL_TIMEOUT(OBD_FAIL_LDLM_GLIMPSE, 2)) {
+               if (CFS_FAIL_TIMEOUT(OBD_FAIL_LDLM_GLIMPSE, 2)) {
                        ldlm_resource_unlink_lock(lock);
                        err = ELDLM_LOCK_ABORTED;
                } else {
index 04af82b..4b56664 100644 (file)
@@ -419,7 +419,7 @@ struct ofd_seq *ofd_seq_load(const struct lu_env *env, struct ofd_device *ofd,
 
        if (info->fti_attr.la_size == 0) {
                /* object is just created, initialize last id */
-               if (OBD_FAIL_CHECK(OBD_FAIL_OFD_SET_OID)) {
+               if (CFS_FAIL_CHECK(OBD_FAIL_OFD_SET_OID)) {
                        struct seq_server_site *ss = &ofd->ofd_seq_site;
                        struct lu_client_seq *client_seq = ss->ss_client_seq;
                        __u64 seq_width = fid_seq_is_norm(seq) ?
@@ -654,7 +654,7 @@ int ofd_fs_setup(const struct lu_env *env, struct ofd_device *ofd,
        if (rc)
                GOTO(out, rc);
 
-       if (OBD_FAIL_CHECK(OBD_FAIL_MDS_FS_SETUP))
+       if (CFS_FAIL_CHECK(OBD_FAIL_MDS_FS_SETUP))
                GOTO(out_seqs, rc = -ENOENT);
 
        lu_local_obj_fid(&info->fti_fid, OFD_HEALTH_CHECK_OID);
index 123dd27..32e55d8 100644 (file)
@@ -442,7 +442,7 @@ int ofd_verify_layout_version(const struct lu_env *env,
        int rc;
        ENTRY;
 
-       if (unlikely(OBD_FAIL_CHECK(OBD_FAIL_OST_SKIP_LV_CHECK)))
+       if (unlikely(CFS_FAIL_CHECK(OBD_FAIL_OST_SKIP_LV_CHECK)))
                GOTO(out, rc = 0);
 
        rc = ofd_object_ff_load(env, fo);
@@ -493,7 +493,7 @@ static void ofd_handle_attrs(const struct lu_env *env, struct ofd_device *ofd,
        if (need_atime && ofd->ofd_atime_diff == 0)
                need_atime = false;
 
-       if (need_encfl && OBD_FAIL_CHECK(OBD_FAIL_LFSCK_NO_ENCFLAG))
+       if (need_encfl && CFS_FAIL_CHECK(OBD_FAIL_LFSCK_NO_ENCFLAG))
                need_encfl = false;
 
        if (!need_atime && !need_encfl)
@@ -622,7 +622,7 @@ static int ofd_preprw_read(const struct lu_env *env, struct obd_export *exp,
                begin = min_t(__u64, begin, rnb[i].rnb_offset);
                end = max_t(__u64, end, rnb[i].rnb_offset + rnb[i].rnb_len);
 
-               if (OBD_FAIL_CHECK(OBD_FAIL_OST_2BIG_NIOBUF))
+               if (CFS_FAIL_CHECK(OBD_FAIL_OST_2BIG_NIOBUF))
                        rnb[i].rnb_len = 100 * 1024 * 1024;
 
                rc = dt_bufs_get(env, ofd_object_child(fo), rnb + i,
@@ -795,7 +795,7 @@ static int ofd_preprw_write(const struct lu_env *env, struct obd_export *exp,
                begin = min_t(__u64, begin, rnb[i].rnb_offset);
                end = max_t(__u64, end, rnb[i].rnb_offset + rnb[i].rnb_len);
 
-               if (OBD_FAIL_CHECK(OBD_FAIL_OST_2BIG_NIOBUF))
+               if (CFS_FAIL_CHECK(OBD_FAIL_OST_2BIG_NIOBUF))
                        rnb[i].rnb_len += PAGE_SIZE;
                rc = dt_bufs_get(env, ofd_object_child(fo),
                                 rnb + i, lnb + j, maxlnb, dbt);
@@ -915,7 +915,7 @@ int ofd_preprw(const struct lu_env *env, int cmd, struct obd_export *exp,
 
        LASSERT(oa != NULL);
 
-       if (OBD_FAIL_CHECK(OBD_FAIL_SRV_ENOENT)) {
+       if (CFS_FAIL_CHECK(OBD_FAIL_SRV_ENOENT)) {
                struct ofd_seq          *oseq;
 
                oseq = ofd_seq_load(env, ofd, ostid_seq(&oa->o_oi));
@@ -1033,7 +1033,7 @@ ofd_write_attr_set(const struct lu_env *env, struct ofd_device *ofd,
 
        la->la_valid &= LA_UID | LA_GID | LA_PROJID;
        if (oa->o_valid & OBD_MD_FLFLAGS && oa->o_flags & LUSTRE_ENCRYPT_FL &&
-           !OBD_FAIL_CHECK(OBD_FAIL_LFSCK_NO_ENCFLAG)) {
+           !CFS_FAIL_CHECK(OBD_FAIL_LFSCK_NO_ENCFLAG)) {
                la->la_valid |= LA_FLAGS;
                la->la_flags = LUSTRE_ENCRYPT_FL;
        }
@@ -1100,11 +1100,11 @@ ofd_write_attr_set(const struct lu_env *env, struct ofd_device *ofd,
         * write RPCs only modify ff_{parent,layout} and those information will
         * be the same from all the write RPCs. The reason that fl is not used
         * in dt_xattr_set() is to allow this race. */
-       if (OBD_FAIL_CHECK(OBD_FAIL_LFSCK_NOPFID))
+       if (CFS_FAIL_CHECK(OBD_FAIL_LFSCK_NOPFID))
                GOTO(out_unlock, rc);
-       if (OBD_FAIL_CHECK(OBD_FAIL_LFSCK_UNMATCHED_PAIR1))
+       if (CFS_FAIL_CHECK(OBD_FAIL_LFSCK_UNMATCHED_PAIR1))
                ff->ff_parent.f_oid = cpu_to_le32(1UL << 31);
-       else if (OBD_FAIL_CHECK(OBD_FAIL_LFSCK_UNMATCHED_PAIR2))
+       else if (CFS_FAIL_CHECK(OBD_FAIL_LFSCK_UNMATCHED_PAIR2))
                le32_add_cpu(&ff->ff_parent.f_oid, -1);
 
        info->fti_buf.lb_buf = ff;
@@ -1266,7 +1266,7 @@ ofd_commitrw_write(const struct lu_env *env, struct obd_export *exp,
        la->la_valid &= LA_ATIME | LA_MTIME | LA_CTIME;
 
        /* do fake write, to simulate the write case for performance testing */
-       if (OBD_FAIL_CHECK_QUIET(OBD_FAIL_OST_FAKE_RW)) {
+       if (CFS_FAIL_CHECK_QUIET(OBD_FAIL_OST_FAKE_RW)) {
                struct niobuf_local *last = &lnb[niocount - 1];
                __u64 file_size = last->lnb_file_offset + last->lnb_len;
                __u64 valid = la->la_valid;
@@ -1306,7 +1306,7 @@ retry:
                }
        }
 
-       if (OBD_FAIL_CHECK(OBD_FAIL_OST_DQACQ_NET))
+       if (CFS_FAIL_CHECK(OBD_FAIL_OST_DQACQ_NET))
                GOTO(out_stop, rc = -EINPROGRESS);
 
        if (likely(!fake_write)) {
@@ -1345,8 +1345,8 @@ retry:
        }
 
        if (likely(!fake_write)) {
-               OBD_FAIL_TIMEOUT_ORSET(OBD_FAIL_OST_WR_ATTR_DELAY,
-                                      OBD_FAIL_ONCE, cfs_fail_val);
+               CFS_FAIL_TIMEOUT_ORSET(OBD_FAIL_OST_WR_ATTR_DELAY,
+                                      CFS_FAIL_ONCE, cfs_fail_val);
                rc = dt_write_commit(env, o, lnb, niocount, th, oa->o_size);
                if (rc) {
                        restart = th->th_restart_tran;
index ed8ea92..f220ded 100644 (file)
@@ -114,7 +114,7 @@ static int ofd_lvbo_init(struct ldlm_resource *res)
        ofd = ldlm_res_to_ns(res)->ns_lvbp;
        LASSERT(ofd != NULL);
 
-       if (OBD_FAIL_CHECK(OBD_FAIL_LDLM_OST_LVB))
+       if (CFS_FAIL_CHECK(OBD_FAIL_LDLM_OST_LVB))
                RETURN(-ENOMEM);
 
        env = lu_env_find();
index 1f59f94..be70c7c 100644 (file)
@@ -170,7 +170,7 @@ static int ofd_parse_connect_data(const struct lu_env *env,
                RETURN(-EPROTO);
 
        /* Determine optimal brw size before calculating grant */
-       if (OBD_FAIL_CHECK(OBD_FAIL_OST_BRW_SIZE)) {
+       if (CFS_FAIL_CHECK(OBD_FAIL_OST_BRW_SIZE)) {
                data->ocd_brw_size = 65536;
        } else if (OCD_HAS_FLAG(data, BRW_SIZE)) {
                if (data->ocd_brw_size > ofd->ofd_brw_size)
@@ -766,7 +766,7 @@ int ofd_statfs(const struct lu_env *env,  struct obd_export *exp,
               osfs->os_blocks, osfs->os_bfree, osfs->os_bavail,
               osfs->os_files, osfs->os_ffree, osfs->os_state);
 
-       if (OBD_FAIL_CHECK_VALUE(OBD_FAIL_OST_ENOINO,
+       if (CFS_FAIL_CHECK_VALUE(OBD_FAIL_OST_ENOINO,
                                 ofd->ofd_lut.lut_lsd.lsd_osd_index)) {
                /* Reduce free inode count to zero, but keep "used" intact */
                osfs->os_files -= osfs->os_ffree;
@@ -796,7 +796,7 @@ int ofd_statfs(const struct lu_env *env,  struct obd_export *exp,
                osfs->os_bsize    = 1 << COMPAT_BSIZE_SHIFT;
        }
 
-       if (OBD_FAIL_CHECK_VALUE(OBD_FAIL_OST_ENOSPC,
+       if (CFS_FAIL_CHECK_VALUE(OBD_FAIL_OST_ENOSPC,
                                 ofd->ofd_lut.lut_lsd.lsd_osd_index)) {
                /* Reduce free blocks count near zero, but keep "used" intact */
                osfs->os_bavail -= osfs->os_bavail - 2;
index 8423734..c1d8c62 100644 (file)
@@ -379,7 +379,7 @@ int ofd_precreate_objects(const struct lu_env *env, struct ofd_device *ofd,
          * To make above mechanism to work, before OFD pre-create OST-objects,
          * it needs to update the LAST_ID file firstly, otherwise, the LFSCK
          * may cannot get latest last_id although new OST-object created. */
-       if (!OBD_FAIL_CHECK(OBD_FAIL_LFSCK_SKIP_LASTID)) {
+       if (!CFS_FAIL_CHECK(OBD_FAIL_LFSCK_SKIP_LASTID)) {
                tmp = cpu_to_le64(id + nr - 1);
                dt_write_lock(env, oseq->os_lastid_obj, DT_LASTID);
                rc = dt_record_write(env, oseq->os_lastid_obj,
@@ -405,7 +405,7 @@ int ofd_precreate_objects(const struct lu_env *env, struct ofd_device *ofd,
                }
 
                if (likely(!ofd_object_exists(fo) &&
-                          !OBD_FAIL_CHECK(OBD_FAIL_LFSCK_DANGLING))) {
+                          !CFS_FAIL_CHECK(OBD_FAIL_LFSCK_DANGLING))) {
                        next = ofd_object_child(fo);
                        LASSERT(next != NULL);
 
@@ -714,11 +714,11 @@ int ofd_attr_set(const struct lu_env *env, struct ofd_object *fo,
                GOTO(unlock, rc = fl);
 
        if (fl) {
-               if (OBD_FAIL_CHECK(OBD_FAIL_LFSCK_UNMATCHED_PAIR1))
+               if (CFS_FAIL_CHECK(OBD_FAIL_LFSCK_UNMATCHED_PAIR1))
                        ff->ff_parent.f_oid = cpu_to_le32(1UL << 31);
-               else if (OBD_FAIL_CHECK(OBD_FAIL_LFSCK_UNMATCHED_PAIR2))
+               else if (CFS_FAIL_CHECK(OBD_FAIL_LFSCK_UNMATCHED_PAIR2))
                        le32_add_cpu(&ff->ff_parent.f_oid, -1);
-               else if (OBD_FAIL_CHECK(OBD_FAIL_LFSCK_NOPFID))
+               else if (CFS_FAIL_CHECK(OBD_FAIL_LFSCK_NOPFID))
                        GOTO(unlock, rc);
 
                info->fti_buf.lb_buf = ff;
@@ -968,11 +968,11 @@ int ofd_object_punch(const struct lu_env *env, struct ofd_object *fo,
                GOTO(unlock, rc);
 
        if (fl) {
-               if (OBD_FAIL_CHECK(OBD_FAIL_LFSCK_UNMATCHED_PAIR1))
+               if (CFS_FAIL_CHECK(OBD_FAIL_LFSCK_UNMATCHED_PAIR1))
                        ff->ff_parent.f_oid = cpu_to_le32(1UL << 31);
-               else if (OBD_FAIL_CHECK(OBD_FAIL_LFSCK_UNMATCHED_PAIR2))
+               else if (CFS_FAIL_CHECK(OBD_FAIL_LFSCK_UNMATCHED_PAIR2))
                        le32_add_cpu(&ff->ff_parent.f_oid, -1);
-               else if (OBD_FAIL_CHECK(OBD_FAIL_LFSCK_NOPFID))
+               else if (CFS_FAIL_CHECK(OBD_FAIL_LFSCK_NOPFID))
                        GOTO(unlock, rc);
 
                info->fti_buf.lb_buf = ff;
index a499075..c1383c2 100644 (file)
@@ -589,7 +589,7 @@ static bool osp_fid_end_seq(const struct lu_env *env, struct lu_fid *fid,
        /* Skip IDIF sequence for MDT0000 */
        if (fid_is_idif(fid))
                return true;
-       if (OBD_FAIL_CHECK(OBD_FAIL_OSP_FORCE_NEW_SEQ))
+       if (CFS_FAIL_CHECK(OBD_FAIL_OSP_FORCE_NEW_SEQ))
                return true;
        return fid_oid(fid) >= min(OBIF_MAX_OID, seq_width);
 }
index 13bb6e1..c6e6ed7 100644 (file)
@@ -1186,7 +1186,7 @@ static int osp_write_interpreter(const struct lu_env *env,
        if (rc) {
                CDEBUG(D_HA, "error "DFID": rc = %d\n",
                       PFID(lu_object_fid(&obj->opo_obj.do_lu)), rc);
-               OBD_RACE(OBD_FAIL_OUT_OBJECT_MISS);
+               CFS_RACE(OBD_FAIL_OUT_OBJECT_MISS);
                spin_lock(&obj->opo_lock);
                obj->opo_attr.la_valid = 0;
                obj->opo_stale = 1;
index 078b1e3..b9cbe72 100644 (file)
@@ -1011,7 +1011,7 @@ int osp_xattr_get(const struct lu_env *env, struct dt_object *dt,
        LASSERT(buf != NULL);
        LASSERT(name != NULL);
 
-       if (OBD_FAIL_CHECK(OBD_FAIL_LFSCK_BAD_NETWORK) &&
+       if (CFS_FAIL_CHECK(OBD_FAIL_LFSCK_BAD_NETWORK) &&
            osp->opd_index == cfs_fail_val) {
                if (is_ost_obj(&dt->do_lu)) {
                        if (osp_dev2node(osp) == cfs_fail_val)
@@ -1476,7 +1476,7 @@ static int osp_declare_create(const struct lu_env *env, struct dt_object *dt,
        /* should happen to non-0 OSP only so that at least one object
         * has been already declared in the scenario and LOD should
         * cleanup that */
-       if (OBD_FAIL_CHECK(OBD_FAIL_MDS_OSC_CREATE_FAIL) && d->opd_index == 1)
+       if (CFS_FAIL_CHECK(OBD_FAIL_MDS_OSC_CREATE_FAIL) && d->opd_index == 1)
                RETURN(-ENOSPC);
 
        LASSERT(d->opd_last_used_oid_file);
@@ -1681,7 +1681,7 @@ int osp_declare_destroy(const struct lu_env *env, struct dt_object *dt,
 
        LASSERT(!osp->opd_connect_mdt);
 
-       if (!OBD_FAIL_CHECK(OBD_FAIL_LFSCK_LOST_MDTOBJ))
+       if (!CFS_FAIL_CHECK(OBD_FAIL_LFSCK_LOST_MDTOBJ))
                rc = osp_sync_declare_add(env, o, MDS_UNLINK64_REC, th);
 
        RETURN(rc);
@@ -1717,7 +1717,7 @@ static int osp_destroy(const struct lu_env *env, struct dt_object *dt,
 
        LASSERT(!osp->opd_connect_mdt);
 
-       if (!OBD_FAIL_CHECK(OBD_FAIL_LFSCK_LOST_MDTOBJ)) {
+       if (!CFS_FAIL_CHECK(OBD_FAIL_LFSCK_LOST_MDTOBJ)) {
                /* once transaction is committed put proper command on
                 * the queue going to our OST. */
                rc = osp_sync_add(env, o, MDS_UNLINK64_REC, th, NULL);
index 44129f0..ba10932 100644 (file)
@@ -672,7 +672,7 @@ static int osp_precreate_send(const struct lu_env *env, struct osp_device *d)
 
        ptlrpc_request_set_replen(req);
 
-       if (OBD_FAIL_CHECK(OBD_FAIL_OSP_FAKE_PRECREATE))
+       if (CFS_FAIL_CHECK(OBD_FAIL_OSP_FAKE_PRECREATE))
                GOTO(ready, rc = 0);
 
        rc = ptlrpc_queue_wait(req);
@@ -903,7 +903,7 @@ static int osp_precreate_cleanup_orphans(struct lu_env *env,
        CDEBUG(D_HA, "%s: going to cleanup orphans since "DFID"\n",
               d->opd_obd->obd_name, PFID(&d->opd_last_used_fid));
 
-       OBD_FAIL_TIMEOUT(OBD_FAIL_MDS_DELAY_DELORPHAN, cfs_fail_val);
+       CFS_FAIL_TIMEOUT(OBD_FAIL_MDS_DELAY_DELORPHAN, cfs_fail_val);
 
        *last_fid = d->opd_last_used_fid;
        /* The OSP should already get the valid seq now */
@@ -1283,7 +1283,7 @@ static int osp_precreate_thread(void *_args)
                        if (!d->opd_new_connection)
                                continue;
 
-                       OBD_FAIL_TIMEOUT(OBD_FAIL_OSP_CON_EVENT_DELAY,
+                       CFS_FAIL_TIMEOUT(OBD_FAIL_OSP_CON_EVENT_DELAY,
                                         cfs_fail_val);
                        d->opd_new_connection = 0;
                        d->opd_got_disconnected = 0;
index f4a97bb..51b1a4b 100644 (file)
@@ -677,7 +677,7 @@ static struct ptlrpc_request *osp_sync_new_job(struct osp_device *d,
        imp = d->opd_obd->u.cli.cl_import;
        LASSERT(imp);
 
-       if (OBD_FAIL_CHECK(OBD_FAIL_OSP_CHECK_ENOMEM))
+       if (CFS_FAIL_CHECK(OBD_FAIL_OSP_CHECK_ENOMEM))
                RETURN(ERR_PTR(-ENOMEM));
 
        req = ptlrpc_request_alloc(imp, format);
@@ -724,7 +724,7 @@ static int osp_sync_new_setattr_job(struct osp_device *d,
        ENTRY;
        LASSERT(h->lrh_type == MDS_SETATTR64_REC);
 
-       if (OBD_FAIL_CHECK(OBD_FAIL_OSP_CHECK_INVALID_REC))
+       if (CFS_FAIL_CHECK(OBD_FAIL_OSP_CHECK_INVALID_REC))
                RETURN(1);
 
        /* lsr_valid can only be 0 or HAVE OBD_MD_{FLUID, FLGID, FLPROJID} set,
@@ -1164,7 +1164,7 @@ static int osp_sync_process_queues(const struct lu_env *env,
                        llh = NULL;
                        rec = NULL;
                }
-               if (OBD_FAIL_PRECHECK(OBD_FAIL_CATALOG_FULL_CHECK) &&
+               if (CFS_FAIL_PRECHECK(OBD_FAIL_CATALOG_FULL_CHECK) &&
                            cfs_fail_val != 1)
                        msleep(1 * MSEC_PER_SEC);
 
@@ -1240,7 +1240,7 @@ again:
                int     size;
 
                wrapped = llog_cat_is_wrapped(llh);
-               if (OBD_FAIL_CHECK(OBD_FAIL_OSP_CANT_PROCESS_LLOG)) {
+               if (CFS_FAIL_CHECK(OBD_FAIL_OSP_CANT_PROCESS_LLOG)) {
                        rc = -EINPROGRESS;
                        goto next;
                }
index 49cd0d7..33adf2a 100644 (file)
@@ -1480,7 +1480,7 @@ int osp_send_update_thread(void *arg)
                        osp_trans_callback(env, our->our_th,
                                our->our_th->ot_super.th_result);
                        rc = our->our_th->ot_super.th_result;
-               } else if (OBD_FAIL_CHECK(OBD_FAIL_INVALIDATE_UPDATE)) {
+               } else if (CFS_FAIL_CHECK(OBD_FAIL_INVALIDATE_UPDATE)) {
                        rc = -EIO;
                        osp_trans_callback(env, our->our_th, rc);
                } else {
index ba4edf4..5db3dfe 100644 (file)
@@ -905,10 +905,10 @@ int qmt_dqacq0(const struct lu_env *env, struct qmt_device *qmt,
        memset(repbody, 0, sizeof(*repbody));
        memcpy(&repbody->qb_id, &lqe->lqe_id, sizeof(repbody->qb_id));
 
-       if (OBD_FAIL_CHECK(OBD_FAIL_QUOTA_RECOVERABLE_ERR))
+       if (CFS_FAIL_CHECK(OBD_FAIL_QUOTA_RECOVERABLE_ERR))
                RETURN(-cfs_fail_val);
 
-       if (OBD_FAIL_CHECK(OBD_FAIL_QUOTA_PREACQ) &&
+       if (CFS_FAIL_CHECK(OBD_FAIL_QUOTA_PREACQ) &&
           (req_is_preacq(qb_flags) || req_is_rel(qb_flags)))
                RETURN(-EAGAIN);
 
@@ -1061,7 +1061,7 @@ out_write:
        /* start/stop grace timer if required */
        qmt_lqes_tune_grace(env, now);
 
-       if (OBD_FAIL_CHECK(OBD_FAIL_QUOTA_GRANT))
+       if (CFS_FAIL_CHECK(OBD_FAIL_QUOTA_GRANT))
                slv_granted = 0xFFFFFFFFFFF00000;
 
        /* Update slave index first since it is easier to roll back */
@@ -1115,7 +1115,7 @@ out:
                dt_object_put(env, slv_obj);
 
        if ((req_is_acq(qb_flags) || req_is_preacq(qb_flags)) &&
-           OBD_FAIL_CHECK(OBD_FAIL_QUOTA_EDQUOT)) {
+           CFS_FAIL_CHECK(OBD_FAIL_QUOTA_EDQUOT)) {
                /* introduce inconsistency between granted value in slave index
                 * and slave index copy of slave */
                repbody->qb_count = 0;
index bd00257..ad04b4c 100644 (file)
@@ -1177,7 +1177,7 @@ static int qmt_pool_recalc(void *args)
                while (obd->obd_process_conf)
                        schedule_timeout_uninterruptible(cfs_time_seconds(1));
 
-       OBD_FAIL_TIMEOUT(OBD_FAIL_QUOTA_RECALC, cfs_fail_val);
+       CFS_FAIL_TIMEOUT(OBD_FAIL_QUOTA_RECALC, cfs_fail_val);
        sem = qmt_sarr_rwsem(pool);
        LASSERT(sem);
        down_read(sem);
index c6db0de..57fe0c0 100644 (file)
@@ -381,7 +381,7 @@ static void qsd_req_completion(const struct lu_env *env,
                 * We don't update the version of slave index copy on DQACQ.
                 * No locking is necessary since nobody can change
                 * lqe->lqe_granted while lqe->lqe_pending_req > 0 */
-               if (OBD_FAIL_CHECK(OBD_FAIL_QUOTA_GRANT))
+               if (CFS_FAIL_CHECK(OBD_FAIL_QUOTA_GRANT))
                        qti->qti_rec.lqr_slv_rec.qsr_granted =
                                                        0xFFFFFFFFFFDEC80CULL;
                qsd_upd_schedule(qqi, lqe, &lqe->lqe_id, &qti->qti_rec, 0,
index 666df96..6621e50 100644 (file)
@@ -488,7 +488,7 @@ static int qsd_reint_main(void *_args)
        if (kthread_should_stop())
                GOTO(out_lock, rc = 0);
 
-       OBD_FAIL_TIMEOUT(OBD_FAIL_QUOTA_DELAY_REINT, 10);
+       CFS_FAIL_TIMEOUT(OBD_FAIL_QUOTA_DELAY_REINT, 10);
 
        if (qqi->qqi_glb_ver != qti->qti_lvb.lvb_glb_ver) {
                rc = qsd_reint_index(env, qqi, true);