RETURN(retval);
}
-int ll_set_opt(const char *opt, char *data, int fl)
+static inline int ll_set_opt(const char *opt, char *data, int fl)
{
- ENTRY;
-
- CDEBUG(D_SUPER, "option: %s, data %s\n", opt, data);
if (strncmp(opt, data, strlen(opt)) != 0)
- RETURN(0);
+ return(0);
else
- RETURN(fl);
+ return(fl);
}
/* non-client-specific mount options are parsed in lmd_parse */
void ll_options(char *options, int *flags)
{
int tmp;
- char *this_char;
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0))
- char *opt_ptr = options;
-#endif
+ char *s1 = options, *s2;
ENTRY;
if (!options) {
}
CDEBUG(D_CONFIG, "Parsing opts %s\n", options);
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
- for (this_char = strtok (options, ",");
- this_char != NULL;
- this_char = strtok (NULL, ","))
-#else
- while ((this_char = strsep (&opt_ptr, ",")) != NULL)
-#endif
- {
- CDEBUG(D_SUPER, "this_char %s\n", this_char);
- tmp = ll_set_opt("nolock", this_char, LL_SBI_NOLCK);
+
+ while (*s1) {
+ CDEBUG(D_SUPER, "next opt=%s\n", s1);
+ tmp = ll_set_opt("nolock", s1, LL_SBI_NOLCK);
if (tmp) {
*flags |= tmp;
- continue;
+ goto next;
}
- tmp = ll_set_opt("flock", this_char, LL_SBI_FLOCK);
+ tmp = ll_set_opt("flock", s1, LL_SBI_FLOCK);
if (tmp) {
*flags |= tmp;
- continue;
+ goto next;
}
- tmp = ll_set_opt("noflock", this_char, LL_SBI_FLOCK);
+ tmp = ll_set_opt("noflock", s1, LL_SBI_FLOCK);
if (tmp) {
*flags &= ~tmp;
- continue;
+ goto next;
}
- tmp = ll_set_opt("user_xattr", this_char, LL_SBI_USER_XATTR);
+ tmp = ll_set_opt("user_xattr", s1, LL_SBI_USER_XATTR);
if (tmp) {
*flags |= tmp;
- continue;
+ goto next;
}
- tmp = ll_set_opt("nouser_xattr", this_char, LL_SBI_USER_XATTR);
+ tmp = ll_set_opt("nouser_xattr", s1, LL_SBI_USER_XATTR);
if (tmp) {
*flags &= ~tmp;
- continue;
+ goto next;
}
- tmp = ll_set_opt("acl", this_char, LL_SBI_ACL);
+ tmp = ll_set_opt("acl", s1, LL_SBI_ACL);
if (tmp) {
/* Ignore deprecated mount option. The client will
* always try to mount with ACL support, whether this
* is used depends on whether server supports it. */
- continue;
+ goto next;
}
- tmp = ll_set_opt("noacl", this_char, LL_SBI_ACL);
+ tmp = ll_set_opt("noacl", s1, LL_SBI_ACL);
if (tmp) {
- continue;
+ goto next;
}
+
+next:
+ /* Find next opt */
+ s2 = strchr(s1, ',');
+ if (s2 == NULL)
+ break;
+ s1 = s2 + 1;
}
EXIT;
}
lustre_common_put_super(sb);
+ CDEBUG(D_WARNING, "client umount done\n");
EXIT;
} /* client_put_super */
echo "Memory leaks detected"
return 254
fi
- return 0
}
# Facet functions
shift
device=$1
shift
- echo "Starting ${device} as /mnt/${facet} (opts:$@)"
- mkdir -p /mnt/${facet}
+ echo "Starting ${facet}: $@ ${device} /mnt/${facet}"
+ do_facet ${facet} mkdir -p /mnt/${facet}
do_facet ${facet} mount -t lustre $@ ${device} /mnt/${facet}
#do_facet $facet $LCONF --select ${facet}_svc=${active}_facet \
# --node ${active}_facet --ptldebug $PTLDEBUG --subsystem $SUBSYSTEM \
echo No mount point given: zconf_mount $*
exit 1
fi
-
- do_node $client mkdir $mnt 2> /dev/null || :
-
# Only supply -o to mount if we have options
if [ -n "$MOUNTOPT" ]; then
OPTIONS="-o $MOUNTOPT"
fi
+ echo "Starting client: $OPTIONS `facet_nid mgs`:/$FSNAME $mnt"
+ do_node $client mkdir -p $mnt
do_node $client mount -t lustre $OPTIONS \
- `facet_nid mgs`:/lustre $mnt || return 1
+ `facet_nid mgs`:/$FSNAME $mnt || return 1
do_node $client "sysctl -w lnet.debug=$PTLDEBUG; sysctl -w lnet.subsystem_debug=${SUBSYSTEM# }"
##################################
# Test interface
error() {
- sysctl -w lustre.fail_loc=0 || true
+ sysctl -w lustre.fail_loc=0 > /dev/null 2>&1 || true
echo "${TESTSUITE}: **** FAIL:" $@
log "FAIL: $@"
exit 1