lustre_nrs_orr.h \
lustre_nrs_tbf.h \
lustre_obdo.h \
- lustre_param.h \
lustre_patchless_compat.h \
lustre_quota.h \
lustre_req_layout.h \
+++ /dev/null
-/*
- * GPL HEADER START
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 only,
- * as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License version 2 for more details (a copy is included
- * in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU General Public License
- * version 2 along with this program; If not, see
- * http://www.gnu.org/licenses/gpl-2.0.html
- *
- * GPL HEADER END
- */
-/*
- * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
- * Use is subject to license terms.
- *
- * Copyright (c) 2011, 2015, Intel Corporation.
- */
-/*
- * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
- *
- * lustre/include/lustre_param.h
- *
- * User-settable parameter keys
- *
- * Author: Nathan Rutman <nathan@clusterfs.com>
- */
-
-#ifndef _LUSTRE_PARAM_H
-#define _LUSTRE_PARAM_H
-
-#include <libcfs/libcfs.h>
-#include <lnet/types.h>
-
-/** \defgroup param param
- *
- * @{
- */
-
-/* For interoperability */
-struct cfg_interop_param {
- char *old_param;
- char *new_param;
-};
-
-/* obd_config.c */
-int class_find_param(char *buf, char *key, char **valp);
-struct cfg_interop_param *class_find_old_param(const char *param,
- struct cfg_interop_param *ptr);
-int class_get_next_param(char **params, char *copy);
-int class_match_param(char *buf, const char *key, char **valp);
-int class_parse_nid(char *buf, lnet_nid_t *nid, char **endh);
-int class_parse_nid_quiet(char *buf, lnet_nid_t *nid, char **endh);
-int class_parse_net(char *buf, __u32 *net, char **endh);
-int class_match_nid(char *buf, char *key, lnet_nid_t nid);
-int class_match_net(char *buf, char *key, __u32 net);
-/* obd_mount.c */
-int do_lcfg(char *cfgname, lnet_nid_t nid, int cmd,
- char *s1, char *s2, char *s3, char *s4);
-
-
-
-/****************** User-settable parameter keys *********************/
-/* e.g.
- tunefs.lustre --param="failover.node=192.168.0.13@tcp0" /dev/sda
- lctl conf_param testfs-OST0000 failover.node=3@elan,192.168.0.3@tcp0
- ... testfs-MDT0000.lov.stripesize=4M
- ... testfs-OST0000.ost.client_cache_seconds=15
- ... testfs.sys.timeout=<secs>
- ... testfs.llite.max_read_ahead_mb=16
-*/
-
-/* System global or special params not handled in obd's proc
- * See mgs_write_log_sys()
- */
-#define PARAM_TIMEOUT "timeout=" /* global */
-#define PARAM_LDLM_TIMEOUT "ldlm_timeout=" /* global */
-#define PARAM_AT_MIN "at_min=" /* global */
-#define PARAM_AT_MAX "at_max=" /* global */
-#define PARAM_AT_EXTRA "at_extra=" /* global */
-#define PARAM_AT_EARLY_MARGIN "at_early_margin=" /* global */
-#define PARAM_AT_HISTORY "at_history=" /* global */
-#define PARAM_JOBID_VAR "jobid_var=" /* global */
-#define PARAM_MGSNODE "mgsnode=" /* only at mounttime */
-#define PARAM_FAILNODE "failover.node=" /* add failover nid */
-#define PARAM_FAILMODE "failover.mode=" /* initial mount only */
-#define PARAM_ACTIVE "active=" /* activate/deactivate */
-#define PARAM_NETWORK "network=" /* bind on nid */
-#define PARAM_ID_UPCALL "identity_upcall=" /* identity upcall */
-
-/* Prefixes for parameters handled by obd's proc methods (XXX_process_config) */
-#define PARAM_OST "ost."
-#define PARAM_OSD "osd."
-#define PARAM_OSC "osc."
-#define PARAM_MDT "mdt."
-#define PARAM_HSM "mdt.hsm."
-#define PARAM_MDD "mdd."
-#define PARAM_MDC "mdc."
-#define PARAM_LLITE "llite."
-#define PARAM_LOV "lov."
-#define PARAM_LOD "lod."
-#define PARAM_OSP "osp."
-#define PARAM_SYS "sys." /* global */
-#define PARAM_SRPC "srpc."
-#define PARAM_SRPC_FLVR "srpc.flavor."
-#define PARAM_SRPC_UDESC "srpc.udesc.cli2mdt"
-#define PARAM_SEC "security."
-#define PARAM_QUOTA "quota." /* global */
-
-/** @} param */
-
-#define LUSTRE_MAXFSNAME 8
-
-/**
- * Check whether the name is valid.
- *
- * \param name [in] the name to be checked
- * \param minlen [in] the minimum length of the name
- * \param maxlen [in] the maximum length of the name
- *
- * \retval 0 the name is valid
- * \retval >0 the invalid character in the name
- * \retval -1 the name is too short
- * \retval -2 the name is too long
- */
-static inline int lustre_is_name_valid(const char *name, const int minlen,
- const int maxlen)
-{
- const char *tmp;
- size_t len;
-
- len = strlen(name);
-
- if (len < minlen)
- return -1;
-
- if (len > maxlen)
- return -2;
-
- for (tmp = name; *tmp != '\0'; ++tmp) {
- if (isalnum(*tmp) || *tmp == '_' || *tmp == '-')
- continue;
- else
- break;
- }
-
- return *tmp == '\0' ? 0 : *tmp;
-}
-
-/**
- * Check whether the fsname is valid.
- *
- * \param fsname [in] the fsname to be checked
- * \param minlen [in] the minimum length of the fsname
- * \param maxlen [in] the maximum length of the fsname
- *
- * \retval 0 the fsname is valid
- * \retval >0 the invalid character in the fsname
- * \retval -1 the fsname is too short
- * \retval -2 the fsname is too long
- */
-static inline int lustre_is_fsname_valid(const char *fsname, const int minlen,
- const int maxlen)
-{
- return lustre_is_name_valid(fsname, minlen, maxlen);
-}
-
-/**
- * Check whether the poolname is valid.
- *
- * \param poolname [in] the poolname to be checked
- * \param minlen [in] the minimum length of the poolname
- * \param maxlen [in] the maximum length of the poolname
- *
- * \retval 0 the poolname is valid
- * \retval >0 the invalid character in the poolname
- * \retval -1 the poolname is too short
- * \retval -2 the poolname is too long
- */
-static inline int lustre_is_poolname_valid(const char *poolname,
- const int minlen, const int maxlen)
-{
- return lustre_is_name_valid(poolname, minlen, maxlen);
-}
-
-#endif /* _LUSTRE_PARAM_H */
void obd_stale_export_adjust(struct obd_export *exp);
/* obd_config.c */
+/* For interoperability */
+struct cfg_interop_param {
+ char *old_param;
+ char *new_param;
+};
+
struct lustre_cfg *lustre_cfg_rename(struct lustre_cfg *cfg,
const char *new_name);
int class_process_config(struct lustre_cfg *lcfg);
int class_setup(struct obd_device *obd, struct lustre_cfg *lcfg);
int class_cleanup(struct obd_device *obd, struct lustre_cfg *lcfg);
int class_detach(struct obd_device *obd, struct lustre_cfg *lcfg);
+
+int class_find_param(char *buf, char *key, char **valp);
+struct cfg_interop_param *class_find_old_param(const char *param,
+ struct cfg_interop_param *ptr);
+int class_get_next_param(char **params, char *copy);
+int class_match_param(char *buf, const char *key, char **valp);
+int class_parse_nid(char *buf, lnet_nid_t *nid, char **endh);
+int class_parse_nid_quiet(char *buf, lnet_nid_t *nid, char **endh);
+int class_parse_net(char *buf, u32 *net, char **endh);
+int class_match_nid(char *buf, char *key, lnet_nid_t nid);
+int class_match_net(char *buf, char *key, u32 net);
+
struct obd_device *class_incref(struct obd_device *obd,
const char *scope, const void *source);
void class_decref(struct obd_device *obd,
lustre_disk.h \
lustre_fid.h \
lustre_ioctl.h \
- lustre_ostid.h
+ lustre_ostid.h \
+ lustre_param.h
--- /dev/null
+/*
+ * GPL HEADER START
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 only,
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License version 2 for more details (a copy is included
+ * in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License
+ * version 2 along with this program; If not, see
+ * http://www.gnu.org/licenses/gpl-2.0.html
+ *
+ * GPL HEADER END
+ */
+/*
+ * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Use is subject to license terms.
+ *
+ * Copyright (c) 2011, 2015, Intel Corporation.
+ */
+/*
+ * This file is part of Lustre, http://www.lustre.org/
+ * Lustre is a trademark of Sun Microsystems, Inc.
+ *
+ * User-settable parameter keys
+ *
+ * Author: Nathan Rutman <nathan@clusterfs.com>
+ */
+
+#ifndef _UAPI_LUSTRE_PARAM_H
+#define _UAPI_LUSTRE_PARAM_H
+
+/** \defgroup param param
+ *
+ * @{
+ */
+
+/****************** User-settable parameter keys *********************/
+/* e.g.
+ * tunefs.lustre --param="failover.node=192.168.0.13@tcp0" /dev/sda
+ * lctl conf_param testfs-OST0000 failover.node=3@elan,192.168.0.3@tcp0
+ * ... testfs-MDT0000.lov.stripesize=4M
+ * ... testfs-OST0000.ost.client_cache_seconds=15
+ * ... testfs.sys.timeout=<secs>
+ * ... testfs.llite.max_read_ahead_mb=16
+ */
+
+/* System global or special params not handled in obd's proc
+ * See mgs_write_log_sys()
+ */
+#define PARAM_TIMEOUT "timeout=" /* global */
+#define PARAM_LDLM_TIMEOUT "ldlm_timeout=" /* global */
+#define PARAM_AT_MIN "at_min=" /* global */
+#define PARAM_AT_MAX "at_max=" /* global */
+#define PARAM_AT_EXTRA "at_extra=" /* global */
+#define PARAM_AT_EARLY_MARGIN "at_early_margin=" /* global */
+#define PARAM_AT_HISTORY "at_history=" /* global */
+#define PARAM_JOBID_VAR "jobid_var=" /* global */
+#define PARAM_MGSNODE "mgsnode=" /* only at mounttime */
+#define PARAM_FAILNODE "failover.node=" /* add failover nid */
+#define PARAM_FAILMODE "failover.mode=" /* initial mount only */
+#define PARAM_ACTIVE "active=" /* activate/deactivate */
+#define PARAM_NETWORK "network=" /* bind on nid */
+#define PARAM_ID_UPCALL "identity_upcall=" /* identity upcall */
+
+/* Prefixes for parameters handled by obd's proc methods (XXX_process_config) */
+#define PARAM_OST "ost."
+#define PARAM_OSD "osd."
+#define PARAM_OSC "osc."
+#define PARAM_MDT "mdt."
+#define PARAM_HSM "mdt.hsm."
+#define PARAM_MDD "mdd."
+#define PARAM_MDC "mdc."
+#define PARAM_LLITE "llite."
+#define PARAM_LOV "lov."
+#define PARAM_LOD "lod."
+#define PARAM_OSP "osp."
+#define PARAM_SYS "sys." /* global */
+#define PARAM_SRPC "srpc."
+#define PARAM_SRPC_FLVR "srpc.flavor."
+#define PARAM_SRPC_UDESC "srpc.udesc.cli2mdt"
+#define PARAM_SEC "security."
+#define PARAM_QUOTA "quota." /* global */
+
+/** @} param */
+
+#endif /* _UAPI_LUSTRE_PARAM_H */
#include <lustre_dlm.h>
#include <lprocfs_status.h>
#include <lustre_disk.h>
-#include <lustre_param.h>
+#include <uapi/linux/lustre_param.h>
#include <lustre_log.h>
#include <cl_object.h>
#include <obd_cksum.h>
#ifdef HAVE_UIDGID_HEADER
# include <linux/uidgid.h>
#endif
-#include <lustre_param.h>
+#include <uapi/linux/lustre_param.h>
#include <lprocfs_status.h>
#include <obd_support.h>
#include <obd_class.h>
#include <md_object.h>
#include <lustre_fid.h>
-#include <lustre_param.h>
+#include <uapi/linux/lustre_param.h>
#include <lustre_update.h>
#include <lustre_log.h>
#include <lustre_fid.h>
#include <lustre_linkea.h>
#include <lustre_lmv.h>
-#include <lustre_param.h>
+#include <uapi/linux/lustre_param.h>
#include <lustre_swab.h>
#include <lustre_ver.h>
#include <lprocfs_status.h>
#include <lprocfs_status.h>
#include <lustre_fid.h>
-#include <lustre_param.h>
+#include <uapi/linux/lustre_param.h>
#include <md_object.h>
#include <lustre_linkea.h>
#include <lustre_log.h>
#include <obd_class.h>
#include <linux/seq_file.h>
#include "lod_internal.h"
-#include <lustre_param.h>
+#include <uapi/linux/lustre_param.h>
/*
* Notice, all the functions below (except for lod_procfs_init() and
#include <lustre_lib.h>
#include <lustre_mds.h>
#include <lustre_net.h>
-#include <lustre_param.h>
+#include <uapi/linux/lustre_param.h>
#include <lustre_swab.h>
#include <lprocfs_status.h>
#include <obd_class.h>
#include <asm/statfs.h>
#include <lprocfs_status.h>
#include <obd_class.h>
-#include <lustre_param.h>
+#include <uapi/linux/lustre_param.h>
#include "lov_internal.h"
#ifdef CONFIG_PROC_FS
#include <lustre_kernelcomm.h>
#include <lustre_lmv.h>
#include <lustre_log.h>
-#include <lustre_param.h>
+#include <uapi/linux/lustre_param.h>
#include <lustre_swab.h>
#include <obd_class.h>
#include <lustre_mds.h>
#include <obd_support.h>
#include <lu_object.h>
-#include <lustre_param.h>
+#include <uapi/linux/lustre_param.h>
#include <lustre_fid.h>
#include <lustre_nodemap.h>
#include <lustre_barrier.h>
/* fid_be_cpu(), fid_cpu_to_be(). */
#include <lustre_fid.h>
#include <lustre_idmap.h>
-#include <lustre_param.h>
+#include <uapi/linux/lustre_param.h>
#include <lustre_mds.h>
#include <lustre/lustre_idl.h>
#include <lustre_net.h>
#include <lustre_nodemap.h>
#include <lustre_mds.h>
-#include <lustre_param.h>
+#include <uapi/linux/lustre_param.h>
#include <lustre_quota.h>
#include <lustre_swab.h>
#include <obd.h>
#include "mdt_internal.h"
#include <lustre_quota.h>
#include <lustre_acl.h>
-#include <lustre_param.h>
+#include <uapi/linux/lustre_param.h>
struct mds_device {
/* super-class */
#include <obd.h>
#include <obd_class.h>
#include <lprocfs_status.h>
-#include <lustre_param.h>
+#include <uapi/linux/lustre_param.h>
#include "mgs_internal.h"
#ifdef CONFIG_PROC_FS
#include <obd_class.h>
#include <lprocfs_status.h>
#include <uapi/linux/lustre_ioctl.h>
-#include <lustre_param.h>
+#include <uapi/linux/lustre_param.h>
#include <lustre/lustre_barrier_user.h>
#include "mgs_internal.h"
RETURN(0);
}
-static int mgs_extract_fs_pool(char * arg, char *fsname, char *poolname)
+static int mgs_extract_fs_pool(char *arg, char *fsname, char *poolname)
{
- char *ptr;
+ size_t len;
+ char *ptr;
- ENTRY;
- for (ptr = arg; (*ptr != '\0') && (*ptr != '.'); ptr++ ) {
- *fsname = *ptr;
- fsname++;
- }
- if (*ptr == '\0')
- return -EINVAL;
- *fsname = '\0';
- ptr++;
- strcpy(poolname, ptr);
+ ENTRY;
+ /* Validate name */
+ for (ptr = arg; *ptr != '\0'; ptr++) {
+ if (!isalnum(*ptr) && *ptr != '_' && *ptr != '-' && *ptr != '.')
+ return -EINVAL;
+ }
- RETURN(0);
+ /* Test for fsname.poolname format.
+ * strlen() test if poolname is empty
+ */
+ ptr = strchr(arg, '.');
+ if (!ptr || !strlen(ptr))
+ return -EINVAL;
+ ptr++;
+
+ /* Also make sure poolname is not to long. */
+ if (strlen(ptr) > LOV_MAXPOOLNAME)
+ return -ENAMETOOLONG;
+ strncpy(poolname, ptr, strlen(ptr));
+
+ /* Test if fsname is empty */
+ len = strlen(arg) - strlen(ptr) - 1;
+ if (!len)
+ return -EINVAL;
+
+ /* or too long */
+ if (len > MTI_NAME_MAXLEN)
+ return -ENAMETOOLONG;
+
+ strncpy(fsname, arg, len);
+
+ RETURN(0);
}
static int mgs_iocontrol_nodemap(const struct lu_env *env,
#include <obd.h>
#include <uapi/linux/lustre_ioctl.h>
-#include <lustre_param.h>
+#include <uapi/linux/lustre_param.h>
#include <lustre_sec.h>
#include <lustre_quota.h>
#include <lustre_disk.h>
#include <uapi/linux/lustre_ioctl.h>
#include <lustre_log.h>
-#include <lustre_param.h>
+#include <uapi/linux/lustre_param.h>
#include <obd_class.h>
#include "llog_internal.h"
#include <linux/version.h>
#include <lustre_log.h>
#include <lustre_disk.h>
-#include <lustre_param.h>
+#include <uapi/linux/lustre_param.h>
static int (*client_fill_super)(struct super_block *sb,
struct vfsmount *mnt);
/** lustre_cfg_bufs are a holdover from 1.4; we can still set these up from
* lctl (and do for echo cli/srv.
*/
-int do_lcfg(char *cfgname, lnet_nid_t nid, int cmd,
- char *s1, char *s2, char *s3, char *s4)
+static int do_lcfg(char *cfgname, lnet_nid_t nid, int cmd,
+ char *s1, char *s2, char *s3, char *s4)
{
struct lustre_cfg_bufs bufs;
- struct lustre_cfg * lcfg = NULL;
+ struct lustre_cfg *lcfg = NULL;
int rc;
CDEBUG(D_TRACE, "lcfg %s %#x %s %s %s %s\n", cfgname,
#include <lustre_disk.h>
#include <uapi/linux/lustre_ioctl.h>
#include <lustre_log.h>
-#include <lustre_param.h>
+#include <uapi/linux/lustre_param.h>
#include <obd.h>
#include <obd_class.h>
#include <obd_class.h>
#include <obd_cksum.h>
-#include <lustre_param.h>
+#include <uapi/linux/lustre_param.h>
#include <lustre_fid.h>
#include <lustre_lfsck.h>
#include <lustre/lustre_idl.h>
#include <uapi/linux/lustre_ioctl.h>
#include <lustre_net.h>
#include <lustre_obdo.h>
-#include <lustre_param.h>
+#include <uapi/linux/lustre_param.h>
#include <obd.h>
#include <obd_cksum.h>
#include <obd_class.h>
#include <lustre_net.h>
#include <lustre_fid.h>
/* process_config */
-#include <lustre_param.h>
+#include <uapi/linux/lustre_param.h>
#include "osd_internal.h"
#include "osd_dynlocks.h"
#include <obd_class.h>
#include <lustre_disk.h>
#include <lustre_fid.h>
-#include <lustre_param.h>
+#include <uapi/linux/lustre_param.h>
#include <md_object.h>
#include "osd_internal.h"
#define DEBUG_SUBSYSTEM S_OST
#include <obd_class.h>
-#include <lustre_param.h>
+#include <uapi/linux/lustre_param.h>
#include <lustre_log.h>
#include <linux/kthread.h>
#include <uapi/linux/lustre_ioctl.h>
#include <lustre_log.h>
#include <lustre_obdo.h>
-#include <lustre_param.h>
+#include <uapi/linux/lustre_param.h>
#include <obd_class.h>
#include "osp_internal.h"
#include <lustre_log.h>
#include <lustre_disk.h>
#include <lustre_dlm.h>
-#include <lustre_param.h>
+#include <uapi/linux/lustre_param.h>
#include <lustre_sec.h>
#include "ptlrpc_internal.h"
#define DEBUG_SUBSYSTEM S_LQUOTA
#include <obd_class.h>
-#include <lustre_param.h>
+#include <uapi/linux/lustre_param.h>
#include "qsd_internal.h"
#include <libcfs/util/parser.h>
#include <lustre/lustreapi.h>
#include <lustre_ver.h>
-#include <lustre_param.h>
+#include <linux/lustre_param.h>
#ifndef ARRAY_SIZE
# define ARRAY_SIZE(a) ((sizeof(a)) / (sizeof((a)[0])))
static int verify_pool_name(char *prog_name, char *pool_name)
{
- char *ptr;
- int rc;
+ char *ptr;
if (pool_name == NULL)
return 0;
ptr = strchr(pool_name, '.');
- if (ptr == NULL) {
- ptr = pool_name;
- } else {
- if (ptr == pool_name) {
- fprintf(stderr, "error: %s: fsname is empty "
- "in pool name '%s'\n",
- prog_name, pool_name);
- return -EINVAL;
- }
- ++ptr;
- }
-
- rc = lustre_is_poolname_valid(ptr, 1, LOV_MAXPOOLNAME);
- if (rc == -1) {
- fprintf(stderr, "error: %s: poolname '%s' is empty\n",
+ if (ptr != NULL && ptr == pool_name) {
+ fprintf(stderr, "error: %s: fsname is empty in pool name '%s'\n",
prog_name, pool_name);
return -EINVAL;
- } else if (rc == -2) {
- fprintf(stderr, "error: %s: pool name '%s' is too long "
- "(max is %d characters)\n",
- prog_name, pool_name, LOV_MAXPOOLNAME);
- return -EINVAL;
- } else if (rc > 0) {
- fprintf(stderr, "error: %s: char '%c' not allowed in "
- "pool name '%s'\n",
- prog_name, rc, pool_name);
- return -EINVAL;
}
- return rc;
+
+ return 0;
}
struct lfs_setstripe_args {
#define _GNU_SOURCE
#endif
+#include <ctype.h>
#include <mntent.h>
#include <stdlib.h>
#include <stdio.h>
#include <limits.h>
#include <ctype.h>
#include <lnet/nidstr.h>
-#include <lustre_param.h>
+#include <linux/lustre_param.h>
#include <lnet/lnetctl.h>
#include <lustre_ver.h>
ldd->ldd_flags &= ~LDD_F_NEED_INDEX;
break;
}
- case 'L': {
- rc = lustre_is_fsname_valid(optarg, 1,
- LUSTRE_MAXFSNAME);
- if (rc < 0) {
- fprintf(stderr, "%s: filesystem name must be "
- "1-%d chars\n", progname,
- LUSTRE_MAXFSNAME);
- return 1;
- } else if (rc > 0) {
- fprintf(stderr, "%s: char '%c' not allowed in "
- "filesystem name\n", progname, rc);
- return 1;
- }
-
+ case 'L':
strscpy(new_fsname, optarg, sizeof(new_fsname));
break;
- }
case 'm': {
char *nids = convert_hostnames(optarg);
#include <libcfs/util/list.h>
#include <linux/lustre_disk.h>
-#include <lustre_param.h>
+#include <linux/lustre_param.h>
extern char *progname;
extern int verbose;
#endif
#include <linux/types.h>
#include <linux/version.h>
-#include <lustre_param.h>
#include <lnet/lnetctl.h>
#include <lustre_ver.h>
#include <lnet/lnetctl.h>
#include <lustre/lustreapi.h>
-#include <lustre_param.h>
+#include <linux/lustre_param.h>
#include <lustre/lustre_barrier_user.h>
#define MAX_STRING_SIZE 128
*ptr = '\0';
++ptr;
- rc = lustre_is_fsname_valid(fsname, 1, LUSTRE_MAXFSNAME);
- if (rc < 0) {
- fprintf(stderr, "filesystem name %s must be 1-%d chars\n",
- fsname, LUSTRE_MAXFSNAME);
- rc = -EINVAL;
- goto err;
- } else if (rc > 0) {
- fprintf(stderr, "char '%c' not allowed in filesystem name\n",
- rc);
- rc = -EINVAL;
- goto err;
- }
-
- rc = lustre_is_poolname_valid(ptr, 1, LOV_MAXPOOLNAME);
- if (rc == -1) {
+ if (strlen(ptr) == 0) {
fprintf(stderr, "poolname is empty\n");
rc = -EINVAL;
goto err;
- } else if (rc == -2) {
- fprintf(stderr,
- "poolname %s is too long (max is %d)\n",
- ptr, LOV_MAXPOOLNAME);
- rc = -ENAMETOOLONG;
- goto err;
- } else if (rc > 0) {
- fprintf(stderr, "char '%c' not allowed in pool name '%s'\n",
- rc, ptr);
- rc = -EINVAL;
- goto err;
}
strncpy(poolname, ptr, LOV_MAXPOOLNAME);