#define MTI_NIDS_MAX 64
#endif
-#define LDD_SIZE 4096
-
#define LDD_INCOMPAT_SUPP 0
#define LDD_ROCOMPAT_SUPP 0
/* COMPAT_146 */
__u8 ldd_uuid[40]; /* server UUID */
/* end COMPAT_146 */
- char ldd_mount_opts[2048]; /* target fs mount opts */
-
- /* Below here is required for writing mdt, ost,or client logs,
- and is ignored after that. */
- /* FIXME Everything should be removed from here and set via ioctls */
+/*1228*/
+ /* These are required for writing mdt, ost,or client logs,
+ and are ignored after that. */
+ /* FIXME these should be removed from here and set via ioctls or proc */
int ldd_stripe_sz;
int ldd_stripe_count;
int ldd_stripe_pattern;
int ldd_stripe_offset;
int ldd_timeout; /* obd timeout */
- __u8 ldd_padding[LDD_SIZE - 3296];
+/*1248*/
+ __u8 ldd_padding[4096 - 1248];
+ char ldd_mount_opts[4096]; /* target fs mount opts */
};
-
+
#define IS_MDT(data) ((data)->ldd_flags & LDD_F_SV_TYPE_MDT)
#define IS_OST(data) ((data)->ldd_flags & LDD_F_SV_TYPE_OST)
#define IS_MGS(data) ((data)->ldd_flags & LDD_F_SV_TYPE_MGS)
uuid->uuid[sizeof(*uuid) - 1] = '\0';
}
+static inline char *obd_uuid2str(struct obd_uuid *uuid)
+{
+ return (char *)uuid->uuid;
+}
+
#define LUSTRE_Q_QUOTAON 0x800002 /* turn quotas on */
#define LUSTRE_Q_QUOTAOFF 0x800003 /* turn quotas off */
#define LUSTRE_Q_GETINFO 0x800005 /* get information about quota files */
RETURN(fl);
}
+/* non-client-specific mount options are parsed in lmd_parse */
void ll_options(char *options, int *flags)
{
int tmp;
RETURN(0);
}
-static int lov_del_obd(struct obd_device *obd, struct obd_uuid *uuidp,
- int index, int gen);
+static int lov_del_target(struct obd_device *obd, struct obd_uuid *uuidp,
+ int index, int gen);
static int lov_disconnect(struct obd_export *exp)
{
for (i = 0, tgt = lov->tgts; i < lov->desc.ld_tgt_count; i++, tgt++) {
if (tgt->ltd_exp) {
/* Disconnection is the last we know about an obd */
- lov_del_obd(obd, &tgt->uuid, i, tgt->ltd_gen);
+ lov_del_target(obd, &tgt->uuid, i, tgt->ltd_gen);
}
}
lov_putref(obd);
RETURN(rc);
}
-static int
-lov_add_obd(struct obd_device *obd, struct obd_uuid *uuidp, int index, int gen)
+static int lov_add_target(struct obd_device *obd, struct obd_uuid *uuidp,
+ int index, int gen)
{
struct lov_obd *lov = &obd->u.lov;
struct lov_tgt_desc *tgt;
tgt = &lov->tgts[index];
if (!obd_uuid_empty(&tgt->uuid)) {
- CERROR("OBD already assigned at LOV target index %d\n",
- index);
+ CERROR("UUID %.40s already assigned at LOV target index %d\n",
+ obd_uuid2str(&tgt->uuid), index);
RETURN(-EEXIST);
}
if (rc) {
CERROR("add failed (%d), deleting %s\n", rc,
(char *)tgt->uuid.uuid);
- lov_del_obd(obd, &tgt->uuid, index, 0);
+ lov_del_target(obd, &tgt->uuid, index, 0);
}
RETURN(rc);
}
/* Schedule a target for deletion */
-static int
-lov_del_obd(struct obd_device *obd, struct obd_uuid *uuidp, int index, int gen)
+static int lov_del_target(struct obd_device *obd, struct obd_uuid *uuidp,
+ int index, int gen)
{
struct lov_obd *lov = &obd->u.lov;
struct lov_tgt_desc *tgt;
" deathrow=%d, lovrc=%d\n",
i, lov->death_row,
atomic_read(&lov->refcount));
- lov_del_obd(obd, &tgt->uuid, i, 0);
+ lov_del_target(obd, &tgt->uuid, i, 0);
}
}
OBD_FREE(lov->tgts, lov->bufsize);
if (sscanf(lustre_cfg_buf(lcfg, 3), "%d", &gen) != 1)
GOTO(out, rc = -EINVAL);
if (cmd == LCFG_LOV_ADD_OBD)
- rc = lov_add_obd(obd, &obd_uuid, index, gen);
+ rc = lov_add_target(obd, &obd_uuid, index, gen);
else
- rc = lov_del_obd(obd, &obd_uuid, index, gen);
+ rc = lov_del_target(obd, &obd_uuid, index, gen);
GOTO(out, rc);
}
case LCFG_PARAM: {
if (!(lsd->lsd_feature_incompat & cpu_to_le32(OBD_INCOMPAT_COMMON_LR))){
/* Swap to the old mds_server_data format, in case
someone wants to revert to a pre-1.6 lustre */
- CDEBUG(D_WARNING, "writing old last_rcvd format\n");
+ CDEBUG(D_CONFIG, "writing old last_rcvd format\n");
/* malloc new struct instead of swap in-place because
we don't have a lock on the last_trasno or mount count -
someone may modify it while we're here, and we don't want
lsd->lsd_client_start = cpu_to_le32(LR_CLIENT_START);
lsd->lsd_client_size = cpu_to_le16(LR_CLIENT_SIZE);
lsd->lsd_feature_rocompat = cpu_to_le32(OBD_ROCOMPAT_LOVOBJID);
- lsd->lsd_feature_incompat = cpu_to_le32(MDT_INCOMPAT_SUPP);
+ lsd->lsd_feature_incompat = cpu_to_le32(OBD_INCOMPAT_MDT |
+ OBD_INCOMPAT_COMMON_LR);
} else {
rc = fsfilt_read_record(obd, file, lsd, sizeof(*lsd), &off);
if (rc) {
while(*s1) {
while (*s1 == ' ' || *s1 == ',')
s1++;
- /* FIXME do something with the RECOVER flag - see lconf */
- if (strncmp(s1, "recov", 5) == 0)
+ /* Client options are parsed in ll_options: eg. flock,
+ user_xattr, acl */
+
+ if (strncmp(s1, "recov", 5) == 0)
+ /* FIXME do something with the RECOVER flag - see lconf */
lmd->lmd_flags |= LMD_FLG_RECOVER;
- if (strncmp(s1, "norecov", 7) == 0)
+ else if (strncmp(s1, "norecov", 7) == 0)
lmd->lmd_flags &= ~LMD_FLG_RECOVER;
- if (strncmp(s1, "nosvc", 5) == 0)
+ else if (strncmp(s1, "nosvc", 5) == 0)
lmd->lmd_flags |= LMD_FLG_NOSVC;
- /* Client options are parsed in ll_options: eg. flock,
- user_xattr, acl */
+
+ else if (strncmp(s1, "exclude=", 8) == 0) {
+ CERROR("Exclude: %s\n", s1);
+ /* FIXME implement */
+ /* store exlusion list in lmd_exclude, mdt & client
+ must check */
+ }
/* Linux 2.4 doesn't pass the device, so we stuck it at the
end of the options. */
- if (strncmp(s1, "device=", 7) == 0) {
+ else if (strncmp(s1, "device=", 7) == 0) {
devname = s1 + 7;
/* terminate options right before device. device
must be the last one. */
fsd->lsd_client_size = cpu_to_le16(LR_CLIENT_SIZE);
fsd->lsd_subdir_count = cpu_to_le16(FILTER_SUBDIR_COUNT);
filter->fo_subdir_count = FILTER_SUBDIR_COUNT;
- fsd->lsd_feature_incompat = cpu_to_le32(FILTER_INCOMPAT_SUPP);
+ fsd->lsd_feature_incompat = cpu_to_le32(OBD_INCOMPAT_OST);
} else {
rc = fsfilt_read_record(obd, filp, fsd, sizeof(*fsd), &off);
if (rc) {
void usage(FILE *out)
{
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"
"\ttarget types:\n"
"\t\t--mgsnid=<nid>[,<...>] : NID(s) of a remote mgs node\n"
"\t\t\trequired for all targets other than the mgs node\n"
"\t\t--fsname=<filesystem_name> : default is 'lustre'\n"
-#if 0 /* FIXME implement 1.6.x */
+ /* FIXME implement 1.6.x
"\t\t--configdev=<altdevice|file>: store configuration info\n"
"\t\t\tfor this device on an alternate device\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"
void usage(FILE *out)
{
fprintf(out, "%s v2.0\n", progname);
- fprintf(out, "usage: %s <mgmtnid>[:<altmgtnid>...]:/<filesystem>[/<cfgname>] <mountpt> "
- "[-fhnv] [-o mntopt]\n", progname);
- fprintf(out, "\t<mdsnode>: nid of MDS (config) node\n"
+ fprintf(out, "usage: %s [-fhnv] [-o <mntopt>] <device> <mountpt>\n",
+ progname);
+ fprintf(out,
+ "\t<device>: the disk device, or for a client:\n"
+ "\t\t<mgmtnid>[:<altmgtnid>...]:/<filesystem>-client\n"
"\t<filesystem>: name of the Lustre filesystem (e.g. lustre1)\n"
- "\t<cfgname>: name of client config (e.g. client)\n"
"\t<mountpt>: filesystem mountpoint (e.g. /mnt/lustre)\n"
"\t-f|--fake: fake mount (updates /etc/mtab)\n"
"\t--force: force mount even if already in /etc/mtab\n"
"\t-h|--help: print this usage message\n"
"\t-n|--nomtab: do not update /etc/mtab after mount\n"
- "\t-v|--verbose: print verbose config settings\n");
+ "\t-v|--verbose: print verbose config settings\n"
+ "\t<mntopt>: one or more comma separated of:\n"
+ "\t\t(no)flock,(no)user_xattr,(no)acl\n"
+ "\t\tnosvc: only start MGC/MGS obds\n"
+ "\t\texclude=<ost1>[:<ost2>] : colon-separated list of inactive OSTs\n"
+ );
exit((out != stdout) ? EINVAL : 0);
}
return rc;
}
-/* Get rid of symbolic hostnames for tcp */
+/* Get rid of symbolic hostnames for tcp, since kernel can't do lookups */
#define MAXNIDSTR 1024
static char *convert_hostnames(char *s1)
{
int mask; /* flag mask value */
};
-/* These flags are parsed by mount, not lustre */
static const struct opt_map opt_map[] = {
+ /* These flags are parsed by mount, not lustre */
{ "defaults", 0, 0, 0 }, /* default options */
{ "rw", 1, 1, MS_RDONLY }, /* read-write */
{ "ro", 0, 0, MS_RDONLY }, /* read-only */
{ "nodev", 0, 0, MS_NODEV }, /* don't interpret devices */
{ "async", 0, 1, MS_SYNCHRONOUS}, /* asynchronous I/O */
{ "auto", 0, 0, 0 }, /* Can be mounted using -a */
- { "noauto", 0, 0, 0 }, /* Can only be mounted explicitly */
+ { "noauto", 0, 0, 0 }, /* Can only be mounted explicitly */
{ "nousers", 0, 1, 0 }, /* Forbid ordinary user to mount */
{ "nouser", 0, 1, 0 }, /* Forbid ordinary user to mount */
{ "noowner", 0, 1, 0 }, /* Device owner has no special privs */
{ "acl", 0, 0, 0 }, /* Enable ACL support */
{ "noacl", 1, 1, 0 }, /* Disable ACL support */
{ "nosvc", 0, 0, 0 }, /* Only start MGS/MGC, no other services */
+ { "exclude", 0, 0, 0 }, /* OST exclusion list */
{ NULL, 0, 0, 0 }
};
/****************************************************************************/
+/* 1 = found, flag set
+ 0 = found, no flag set
+ -1 = not found in above list */
static int parse_one_option(const char *check, int *flagp)
{
const struct opt_map *opt;
for (opt = &opt_map[0]; opt->opt != NULL; opt++) {
if (strncmp(check, opt->opt, strlen(opt->opt)) == 0) {
if (!opt->mask)
- return -1;
+ return 0;
if (opt->inv)
*flagp &= ~(opt->mask);
else
return 1;
}
}
- fprintf(stderr, "%s: unknown option '%s', continuing\n", progname,
+ fprintf(stderr, "%s: ignoring unknown option '%s'\n", progname,
check);
- return 0;
+ return -1;
}
int parse_options(char *orig_options, int *flagp)
if (!*opt)
/* empty option */
continue;
- if (parse_one_option(opt, flagp) > 0)
- continue;
- /* no mount flags set, so pass this on as an option */
- if (*options)
- strcat(options, ",");
- strcat(options, opt);
+ if (parse_one_option(opt, flagp) == 0) {
+ /* no mount flags set, so pass this on as an option */
+ if (*options)
+ strcat(options, ",");
+ strcat(options, opt);
+ }
}
/* options will always be <= orig_options */
strcpy(orig_options, options);