LASSERT(mds->mds_lov_objids != NULL);
+ // FIXME remove all this debug stuff
+ CERROR("Clearorphans, %d targets\n", mds->mds_lov_desc.ld_tgt_count);
+ for (rc = 0; rc < mds->mds_lov_desc.ld_tgt_count; rc++)
+ CDEBUG(D_WARNING, "clearorphans "LPU64" for idx %d\n",
+ mds->mds_lov_objids[rc], rc);
+ /* FIXME --- can't clearorphans for lov tgts that the mds does not
+ know about yet! can only clearorphans on
+ mds->mds_lov_desc.ld_tgt_count (if that - if late tgt joins
+ first, is that okay?) */
+
/* This create will in fact either create or destroy: If the OST is
* missing objects below this ID, they will be created. If it finds
* objects above this ID, they will be removed. */
LASSERT(obd != NULL);
/* We can't change the target count in one of these sync
- threads while another sync thread is doing the clearorphans on
- all the targets. */
+ threads while another sync thread is doing clearorphans on
+ all the targets.
+ If we're syncing a particular target, or we're not
+ changing the target_count, then we don't need the sem */
if (!watched || (idx != MLSI_NO_INDEX)) {
- /* if we're syncing a particular target, or we're not
- changing the target_count, then we don't need the sem */
down(&mds->mds_lov_sem);
have_sem++;
}
- rc = obd_set_info(mds->mds_osc_exp, strlen(KEY_MDS_CONN),
- KEY_MDS_CONN, 0, uuid);
- if (rc != 0)
- GOTO(out, rc);
-
if (idx != MLSI_NO_INDEX) {
rc = mds_lov_add_ost(obd, watched, idx);
if (rc != 0)
GOTO(out, rc);
}
+
+ rc = obd_set_info(mds->mds_osc_exp, strlen(KEY_MDS_CONN),
+ KEY_MDS_CONN, 0, uuid);
+ if (rc != 0)
+ GOTO(out, rc);
rc = llog_connect(llog_get_context(obd, LLOG_MDS_OST_ORIG_CTXT),
mds->mds_lov_desc.ld_tgt_count,
void usage(FILE *out)
{
- fprintf(out, "usage: %s [options] <device>\n", progname);
+ fprintf(out, "usage: %s <target types> [options] <device>\n", progname);
fprintf(out,
"\t<device>:block device or file (e.g /dev/sda or /tmp/ost1)\n"
- "\toptions:\n"
+ "\ttarget types:\n"
"\t\t--ost: object storage, mutually exclusive with mdt\n"
"\t\t--mdt: metadata storage, mutually exclusive with ost\n"
"\t\t--mgmt: configuration management service - one per site\n"
- "\t\t--mgmtnid=<nid>[,<...>]:nid(s) of a remote mgmt node\n"
- "\t\t--fsname=<filesystem_name>\n"
+ "\toptions:\n"
+ "\t\t--mgmtnid=<nid>[,<...>] : NID(s) of a remote mgmt node\n"
+ "\t\t\trequired for all targets other than the mgmt node\n"
+ "\t\t--fsname=<filesystem_name> : default is 'lustre'\n"
+#if 0 /* FIXME implement */
"\t\t--configdev=<altdevice|file>: store configuration info\n"
"\t\t\tfor this device on an alternate device\n"
- "\t\t--failover=<failover-address>\n"
- "\t\t--backfstype=<fstype>: backing fs type (ext3, ldiskfs)\n"
- "\t\t--device-size=#N(KB):device size \n"
- "\t\t--stripe-count=#N:number of stripe\n"
- "\t\t--stripe-size=#N(KB):stripe size\n"
- "\t\t--index=#N:target index\n"
- "\t\t--mountfsoptions=<opts>: permanent mount options\n"
+#endif
+ "\t\t--failover=<nid>[,<...>] : list of NIDs for the failover\n"
+ "\t\t\tpartners for this target\n"
+ "\t\t--backfstype=<fstype> : backing fs type (ext3, ldiskfs)\n"
+ "\t\t--device-size=#N(KB) : device size for loop devices\n"
+ "\t\t--stripe-count=#N : default number of stripes\n"
+ "\t\t--stripe-size=#N(KB) : default stripe size\n"
+ "\t\t--index=#N : target index\n"
+ "\t\t--mountfsoptions=<opts> : permanent mount options\n"
#ifndef TUNEFS
- "\t\t--mkfsoptions=<opts>: format options\n"
+ "\t\t--mkfsoptions=<opts> : format options\n"
"\t\t--reformat: overwrite an existing disk\n"
#endif
- "\t\t--timeout=<secs>: system timeout period\n"
+ "\t\t--timeout=<secs> : system timeout period\n"
"\t\t--verbose\n"
"\t\t--quiet\n");
return;
vprint("formatting backing filesystem %s on %s\n",
MT_STR(&mop->mo_ldd), dev);
- vprint("\tservice name %s\n", mop->mo_ldd.ldd_svname);
+ vprint("\ttarget name %s\n", mop->mo_ldd.ldd_svname);
vprint("\t4k blocks %d\n", block_count);
vprint("\toptions %s\n", mop->mo_mkfsopts);
{
int i = 0;
printf("\nPermanent disk data:\n");
- printf("Server: %s\n", ldd->ldd_svname);
+ printf("Target: %s\n", ldd->ldd_svname);
printf("Lustre FS: %s\n", ldd->ldd_fsname);
printf("Mount type: %s\n", MT_STR(ldd));
printf("Flags: %s%s%s%s\n",
case 'f':
/* we must pass this info on when we register with
the mgs */
- //mop.mo_hostnid.backup = libcfs_str2nid(optarg);
+ // FIXME
break;
case 'G':
mop.mo_ldd.ldd_flags |= LDD_F_SV_TYPE_MGMT;
if (!(IS_MDT(&mop.mo_ldd) || IS_OST(&mop.mo_ldd) ||
IS_MGMT(&mop.mo_ldd))) {
fatal();
- fprintf(stderr, "must set server type :{mdt,ost,mgmt}\n");
+ fprintf(stderr, "must set target type :{mdt,ost,mgmt}\n");
usage(stderr);
exit(1);
}