Whamcloud - gitweb
LU-3222 ofd: use of ofd_XXX helpers
[fs/lustre-release.git] / lustre / ofd / ofd_dev.c
index 56e20c1..ae96044 100644 (file)
@@ -81,7 +81,7 @@ static int ofd_connect_to_next(const struct lu_env *env, struct ofd_device *m,
        obd = class_name2obd(next);
        if (obd == NULL) {
                CERROR("%s: can't locate next device: %s\n",
-                      m->ofd_dt_dev.dd_lu_dev.ld_obd->obd_name, next);
+                      ofd_name(m), next);
                GOTO(out, rc = -ENOTCONN);
        }
 
@@ -91,7 +91,7 @@ static int ofd_connect_to_next(const struct lu_env *env, struct ofd_device *m,
        rc = obd_connect(NULL, exp, obd, &obd->obd_uuid, data, NULL);
        if (rc) {
                CERROR("%s: cannot connect to next dev %s: rc = %d\n",
-                      m->ofd_dt_dev.dd_lu_dev.ld_obd->obd_name, next, rc);
+                      ofd_name(m), next, rc);
                GOTO(out, rc);
        }
 
@@ -182,7 +182,6 @@ static void ofd_stack_fini(const struct lu_env *env, struct ofd_device *m,
 
        LASSERT(m->ofd_osd_exp);
        obd_disconnect(m->ofd_osd_exp);
-       m->ofd_osd = NULL;
 
        EXIT;
 }
@@ -406,7 +405,7 @@ static int ofd_lfsck_out_notify(const struct lu_env *env, void *data,
        }
        default:
                CERROR("%s: unknown lfsck event: rc = %d\n",
-                      ofd_obd(ofd)->obd_name, event);
+                      ofd_name(ofd), event);
                return -EINVAL;
        }
 
@@ -420,7 +419,6 @@ static int ofd_prepare(const struct lu_env *env, struct lu_device *pdev,
        struct ofd_device               *ofd = ofd_dev(dev);
        struct obd_device               *obd = ofd_obd(ofd);
        struct lu_device                *next = &ofd->ofd_osd->dd_lu_dev;
-       struct lfsck_start_param         lsp;
        int                              rc;
 
        ENTRY;
@@ -447,15 +445,6 @@ static int ofd_prepare(const struct lu_env *env, struct lu_device *pdev,
         * register the namespace to such instance. */
        LASSERTF(rc == 0, "register namespace failed: rc = %d\n", rc);
 
-       lsp.lsp_start = NULL;
-       lsp.lsp_index_valid = 0;
-       rc = lfsck_start(env, ofd->ofd_osd, &lsp);
-       if (rc != 0) {
-               CWARN("%s: auto trigger paused LFSCK failed: rc = %d\n",
-                     obd->obd_name, rc);
-               rc = 0;
-       }
-
        target_recovery_init(&ofd->ofd_lut, tgt_request_handle);
        LASSERT(obd->obd_no_conn);
        spin_lock(&obd->obd_dev_lock);
@@ -2294,7 +2283,7 @@ static void ofd_fini(const struct lu_env *env, struct ofd_device *m)
        ofd_stack_fini(env, m, &m->ofd_dt_dev.dd_lu_dev);
        ofd_procfs_fini(m);
        LASSERT(atomic_read(&d->ld_ref) == 0);
-       server_put_mount(obd->obd_name);
+       server_put_mount(obd->obd_name, true);
        EXIT;
 }