Whamcloud - gitweb
- trivial fixes in mdd;
authoryury <yury>
Mon, 26 Jun 2006 08:06:14 +0000 (08:06 +0000)
committeryury <yury>
Mon, 26 Jun 2006 08:06:14 +0000 (08:06 +0000)
- added fld "targets" procfs entry to see what MDT targets fld does work with and send RPCs to.

lustre/fld/lproc_fld.c
lustre/mdd/mdd_lov.c

index e9820c2..ec4d6f9 100644 (file)
 #include "fld_internal.h"
 
 #ifdef LPROCFS
+static int
+fld_proc_read_targets(char *page, char **start, off_t off,
+                      int count, int *eof, void *data)
+{
+        struct lu_client_fld *fld = (struct lu_client_fld *)data;
+        struct obd_export *fld_exp;
+       int total = 0, rc;
+       ENTRY;
+
+        LASSERT(fld != NULL);
+
+        spin_lock(&fld->fld_lock);
+        list_for_each_entry(fld_exp,
+                            &fld->fld_exports, exp_fld_chain) {
+                rc = snprintf(page, count, "%s\n",
+                              fld_exp->exp_client_uuid.uuid);
+                page += rc;
+                count -= rc;
+                total += rc;
+                if (count == 0)
+                        break;
+        }
+        spin_unlock(&fld->fld_lock);
+       RETURN(total);
+}
+
 struct lprocfs_vars fld_server_proc_list[] = {
        { NULL }};
 
 struct lprocfs_vars fld_client_proc_list[] = {
+       { "targets", fld_proc_read_targets, NULL, NULL },
        { NULL }};
 #endif
index 253a89d..0716da6 100644 (file)
@@ -330,11 +330,13 @@ int mdd_lov_init(const struct lu_context *ctxt, struct mdd_device *mdd,
         rc = mdd_lov_connect(ctxt, mdd, lov_name);
         if (rc)
                 GOTO(out, rc);
+        EXIT;
 out: 
         if (rc)
                 mdd_lov_fini(ctxt, mdd);
-        RETURN(rc);
+        return rc;
 }
+EXPORT_SYMBOL(mdd_lov_init);
 
 /* update the LOV-OSC knowledge of the last used object id's */
 int mdd_lov_set_nextid(struct mdd_device *mdd)