Whamcloud - gitweb
LU-18009 obd: remove o_fid_init/o_fid_fini 67/55667/2
authorTimothy Day <timday@amazon.com>
Mon, 8 Jul 2024 21:22:55 +0000 (21:22 +0000)
committerOleg Drokin <green@whamcloud.com>
Sat, 13 Jul 2024 20:58:33 +0000 (20:58 +0000)
In every case, o_fid_init is client_fid_init and o_fid_fini is
client_fid_fini. Remove these function pointers.

Test-Parameters: trivial
Signed-off-by: Timothy Day <timday@amazon.com>
Change-Id: Idec4e5d7948b12d67f919f58b97a7119775aaf4e
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/55667
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/include/obd.h
lustre/include/obd_class.h
lustre/llite/llite_lib.c
lustre/lmv/lmv_obd.c
lustre/mdc/mdc_request.c
lustre/osp/osp_dev.c

index f09c2cd..41d9211 100644 (file)
@@ -1126,11 +1126,6 @@ struct obd_ops {
                           void *localdata);
        int (*o_disconnect)(struct obd_export *exp);
 
-       /* Initialize/finalize fids infrastructure. */
-       int (*o_fid_init)(struct obd_device *obd,
-                         struct obd_export *exp, enum lu_cli_type type);
-       int (*o_fid_fini)(struct obd_device *obd);
-
        /* Allocate new fid according to passed @hint. */
        int (*o_fid_alloc)(const struct lu_env *env, struct obd_export *exp,
                           struct lu_fid *fid, struct md_op_data *op_data);
index 9a25aa2..e66c519 100644 (file)
@@ -944,32 +944,6 @@ static inline int obd_disconnect(struct obd_export *exp)
        RETURN(rc);
 }
 
-static inline int obd_fid_init(struct obd_device *obd, struct obd_export *exp,
-                              enum lu_cli_type type)
-{
-       int rc;
-
-       ENTRY;
-
-       if (!obd->obd_type || !obd->obd_type->typ_dt_ops->o_fid_init)
-               RETURN(0);
-
-       rc = obd->obd_type->typ_dt_ops->o_fid_init(obd, exp, type);
-       RETURN(rc);
-}
-
-static inline int obd_fid_fini(struct obd_device *obd)
-{
-       int rc;
-
-       ENTRY;
-       if (!obd->obd_type || !obd->obd_type->typ_dt_ops->o_fid_fini)
-               RETURN(0);
-
-       rc = obd->obd_type->typ_dt_ops->o_fid_fini(obd);
-       RETURN(rc);
-}
-
 static inline int obd_fid_alloc(const struct lu_env *env,
                                struct obd_export *exp,
                                struct lu_fid *fid,
index 82b1de3..7643624 100644 (file)
@@ -442,8 +442,8 @@ retry_connect:
 
        sbi->ll_md_exp->exp_connect_data = *data;
 
-       err = obd_fid_init(sbi->ll_md_exp->exp_obd, sbi->ll_md_exp,
-                          LUSTRE_SEQ_METADATA);
+       err = client_fid_init(sbi->ll_md_exp->exp_obd, sbi->ll_md_exp,
+                             LUSTRE_SEQ_METADATA);
        if (err) {
                CERROR("%s: Can't init metadata layer FID infrastructure: rc = %d\n",
                       sbi->ll_md_exp->exp_obd->obd_name, err);
@@ -464,7 +464,7 @@ retry_connect:
                CERROR("%s: mount failed with %d, forcing read-only mount.\n",
                       sbi->ll_md_exp->exp_obd->obd_name, err);
                sb->s_flags |= SB_RDONLY;
-               obd_fid_fini(sbi->ll_md_exp->exp_obd);
+               client_fid_fini(sbi->ll_md_exp->exp_obd);
                obd_disconnect(sbi->ll_md_exp);
                GOTO(retry_connect, err);
        } else if (err) {
@@ -682,8 +682,8 @@ retry_connect:
                                sbi->ll_ra_info.ra_max_pages_per_file;
        }
 
-       err = obd_fid_init(sbi->ll_dt_exp->exp_obd, sbi->ll_dt_exp,
-                          LUSTRE_SEQ_METADATA);
+       err = client_fid_init(sbi->ll_dt_exp->exp_obd, sbi->ll_dt_exp,
+                             LUSTRE_SEQ_METADATA);
        if (err) {
                CERROR("%s: Can't init data layer FID infrastructure: rc = %d\n",
                       sbi->ll_dt_exp->exp_obd->obd_name, err);
@@ -854,13 +854,13 @@ retry_connect:
 out_root:
        iput(root);
 out_lock_cn_cb:
-       obd_fid_fini(sbi->ll_dt_exp->exp_obd);
+       client_fid_fini(sbi->ll_dt_exp->exp_obd);
 out_dt:
        obd_disconnect(sbi->ll_dt_exp);
        sbi->ll_dt_exp = NULL;
        sbi->ll_dt_obd = NULL;
 out_md_fid:
-       obd_fid_fini(sbi->ll_md_exp->exp_obd);
+       client_fid_fini(sbi->ll_md_exp->exp_obd);
 out_md:
        obd_disconnect(sbi->ll_md_exp);
        sbi->ll_md_exp = NULL;
@@ -956,13 +956,13 @@ static void client_common_put_super(struct super_block *sb)
 
        cl_sb_fini(sb);
 
-       obd_fid_fini(sbi->ll_dt_exp->exp_obd);
+       client_fid_fini(sbi->ll_dt_exp->exp_obd);
        obd_disconnect(sbi->ll_dt_exp);
        sbi->ll_dt_exp = NULL;
 
        ll_debugfs_unregister_super(sb);
 
-       obd_fid_fini(sbi->ll_md_exp->exp_obd);
+       client_fid_fini(sbi->ll_md_exp->exp_obd);
        obd_disconnect(sbi->ll_md_exp);
        sbi->ll_md_exp = NULL;
 
index cd8d42c..bb08666 100644 (file)
@@ -357,7 +357,7 @@ static int lmv_connect_mdc(struct obd_device *obd, struct lmv_tgt_desc *tgt)
        }
 
        /* Init fid sequence client for this mdc and add new fld target.  */
-       rc = obd_fid_init(mdc_obd, mdc_exp, LUSTRE_SEQ_METADATA);
+       rc = client_fid_init(mdc_obd, mdc_exp, LUSTRE_SEQ_METADATA);
        if (rc)
                RETURN(rc);
 
@@ -566,7 +566,7 @@ static int lmv_disconnect_mdc(struct obd_device *obd, struct lmv_tgt_desc *tgt)
                CERROR("%s: Can't del fld targets: rc = %d\n",
                       tgt->ltd_exp->exp_obd->obd_name, rc);
 
-       rc = obd_fid_fini(tgt->ltd_exp->exp_obd);
+       rc = client_fid_fini(tgt->ltd_exp->exp_obd);
        if (rc)
                CERROR("%s: Can't finalize fids factory: rc = %d\n",
                       tgt->ltd_exp->exp_obd->obd_name, rc);
index a0ae7ec..23b1cb4 100644 (file)
@@ -3063,8 +3063,6 @@ static const struct obd_ops mdc_obd_ops = {
        .o_set_info_async   = mdc_set_info_async,
        .o_statfs           = mdc_statfs,
        .o_statfs_async     = mdc_statfs_async,
-       .o_fid_init         = client_fid_init,
-       .o_fid_fini         = client_fid_fini,
        .o_fid_alloc        = mdc_fid_alloc,
        .o_import_event     = mdc_import_event,
        .o_get_info         = mdc_get_info,
index 2906366..d7ed568 100644 (file)
@@ -650,7 +650,7 @@ static int osp_shutdown(const struct lu_env *env, struct osp_device *d)
                osp_last_used_fini(env, d);
        }
 
-       obd_fid_fini(d->opd_obd);
+       client_fid_fini(d->opd_obd);
 
        RETURN(rc);
 }
@@ -1227,8 +1227,8 @@ static int osp_init0(const struct lu_env *env, struct osp_device *osp,
 
        osp_tunables_init(osp);
 
-       rc = obd_fid_init(osp->opd_obd, NULL, osp->opd_connect_mdt ?
-                         LUSTRE_SEQ_METADATA : LUSTRE_SEQ_DATA);
+       rc = client_fid_init(osp->opd_obd, NULL, osp->opd_connect_mdt ?
+                            LUSTRE_SEQ_METADATA : LUSTRE_SEQ_DATA);
        if (rc) {
                CERROR("%s: fid init error: rc = %d\n",
                       osp->opd_obd->obd_name, rc);
@@ -1298,7 +1298,7 @@ out_last_used:
        if (!osp->opd_connect_mdt)
                osp_last_used_fini(env, osp);
 out_fid:
-       obd_fid_fini(osp->opd_obd);
+       client_fid_fini(osp->opd_obd);
 out_proc:
        osp_tunables_fini(osp);
        client_obd_cleanup(obd);
@@ -1886,8 +1886,6 @@ static const struct obd_ops osp_obd_device_ops = {
        .o_import_event = osp_import_event,
        .o_iocontrol    = osp_iocontrol,
        .o_statfs       = osp_obd_statfs,
-       .o_fid_init     = client_fid_init,
-       .o_fid_fini     = client_fid_fini,
 };
 
 /**