From 4072f026a706fcabb9b8cbaec4dcd534e9de7c95 Mon Sep 17 00:00:00 2001 From: James Simmons Date: Tue, 10 Jan 2012 08:59:23 -0500 Subject: [PATCH] LU-80 utils: Large stripe support Currently a file can be stripped across OSTs up to a limit of 160 stripes due to the ldiskfs xattr size limit of 4096 bytes. This limit will be increased to 2000 stripes or more by increasing the maximum xattr size for the MDT. During testing, issues emerged with clients that are not expecting more than 160 stripes. This patch allows clients to interoperate with servers that do not support large xattrs, and also servers with support with at least 2000 stripes, though it is intended not to have any hard upper limit. Change-Id: Idbaeb98919aea6b4cd375b881ed87661034d9394 Signed-off-by: James Simmons Reviewed-on: http://review.whamcloud.com/1194 Reviewed-by: Yu Jian Tested-by: Hudson Tested-by: Maloo Reviewed-by: Andreas Dilger Tested-by: Yu Jian --- lustre/include/lustre/liblustreapi.h | 6 - lustre/llite/lproc_llite.c | 18 +- lustre/utils/lfs.c | 71 ++++--- lustre/utils/liblustreapi.c | 384 +++++++++++++++++++++++------------ lustre/utils/obd.c | 7 +- 5 files changed, 323 insertions(+), 163 deletions(-) diff --git a/lustre/include/lustre/liblustreapi.h b/lustre/include/lustre/liblustreapi.h index 68d8bff..2cb4ad9 100644 --- a/lustre/include/lustre/liblustreapi.h +++ b/lustre/include/lustre/liblustreapi.h @@ -47,12 +47,6 @@ #include -/* Initially allocate for these many OSTs, realloc if needed */ -#define INIT_ALLOC_NUM_OSTS 1024 - -/* Maximum number of osts that can be specified to lfs find */ -#define FIND_MAX_OSTS 1024 - typedef void (*llapi_cb_t)(char *obd_type_name, char *obd_name, char *obd_uuid, void *args); /* liblustreapi message severity level */ diff --git a/lustre/llite/lproc_llite.c b/lustre/llite/lproc_llite.c index 3bfe608..7ed574f 100644 --- a/lustre/llite/lproc_llite.c +++ b/lustre/llite/lproc_llite.c @@ -638,6 +638,21 @@ static int ll_wr_lazystatfs(struct file *file, const char *buffer, return count; } +static int ll_rd_maxea_size(char *page, char **start, off_t off, + int count, int *eof, void *data) +{ + struct super_block *sb = data; + struct ll_sb_info *sbi = ll_s2sbi(sb); + unsigned int ealen; + int rc; + + rc = ll_get_max_mdsize(sbi, &ealen); + if (rc) + return rc; + + return snprintf(page, count, "%u\n", ealen); +} + static struct lprocfs_vars lprocfs_llite_obd_vars[] = { { "uuid", ll_rd_sb_uuid, 0, 0 }, //{ "mntpt_path", ll_rd_path, 0, 0 }, @@ -666,7 +681,8 @@ static struct lprocfs_vars lprocfs_llite_obd_vars[] = { { "statahead_max", ll_rd_statahead_max, ll_wr_statahead_max, 0 }, { "statahead_agl", ll_rd_statahead_agl, ll_wr_statahead_agl, 0 }, { "statahead_stats", ll_rd_statahead_stats, 0, 0 }, - { "lazystatfs", ll_rd_lazystatfs, ll_wr_lazystatfs, 0 }, + { "lazystatfs", ll_rd_lazystatfs, ll_wr_lazystatfs, 0 }, + { "max_easize", ll_rd_maxea_size, 0, 0 }, { 0 } }; diff --git a/lustre/utils/lfs.c b/lustre/utils/lfs.c index 70e3b0f..2bc71a1 100644 --- a/lustre/utils/lfs.c +++ b/lustre/utils/lfs.c @@ -553,7 +553,8 @@ static int lfs_find(int argc, char **argv) fprintf(stderr, "err: %s: filename|dirname must either " "precede options or follow options\n", argv[0]); - return CMD_HELP; + ret = CMD_HELP; + goto err; } if (!isoption && pathstart == -1) pathstart = optind - 1; @@ -593,8 +594,10 @@ static int lfs_find(int argc, char **argv) } new_fashion = 1; ret = set_time(&t, xtime, optarg); - if (ret == INT_MAX) - return -1; + if (ret == INT_MAX) { + ret = -1; + goto err; + } if (ret) *xsign = ret; break; @@ -611,7 +614,8 @@ static int lfs_find(int argc, char **argv) if (*endptr != '\0') { fprintf(stderr, "Group/GID: %s cannot " "be found.\n", optarg); - return -1; + ret = -1; + goto err; } } param.exclude_gid = !!neg_opt; @@ -626,7 +630,8 @@ static int lfs_find(int argc, char **argv) if (*endptr != '\0') { fprintf(stderr, "User/UID: %s cannot " "be found.\n", optarg); - return -1; + ret = -1; + goto err; } } param.exclude_uid = !!neg_opt; @@ -639,7 +644,8 @@ static int lfs_find(int argc, char **argv) "Pool name %s is too long" " (max is %d)\n", optarg, LOV_MAXPOOLNAME); - return -1; + ret = -1; + goto err; } /* we do check for empty pool because empty pool * is used to find V1 lov attributes */ @@ -655,24 +661,37 @@ static int lfs_find(int argc, char **argv) break; case 'O': { char *buf, *token, *next, *p; - int len; + int len = 1; + void *tmp; - len = strlen((char *)optarg); - buf = malloc(len+1); - if (buf == NULL) - return -ENOMEM; - strcpy(buf, (char *)optarg); + buf = strdup(optarg); + if (buf == NULL) { + ret = -ENOMEM; + goto err; + } param.exclude_obd = !!neg_opt; - if (param.num_alloc_obds == 0) { - param.obduuid = malloc(FIND_MAX_OSTS * - sizeof(struct obd_uuid)); - if (param.obduuid == NULL) - return -ENOMEM; - param.num_alloc_obds = INIT_ALLOC_NUM_OSTS; + token = buf; + while (token && *token) { + token = strchr(token, ','); + if (token) { + len++; + token++; + } } + param.num_alloc_obds += len; + tmp = realloc(param.obduuid, + param.num_alloc_obds * + sizeof(*param.obduuid)); + if (tmp == NULL) { + ret = -ENOMEM; + free(buf); + goto err; + } + param.obduuid = tmp; + for (token = buf; token && *token; token = next) { p = strchr(token, ','); next = 0; @@ -718,7 +737,8 @@ static int lfs_find(int argc, char **argv) #endif default: fprintf(stderr, "error: %s: bad type '%s'\n", argv[0], optarg); - return CMD_HELP; + ret = CMD_HELP; + goto err; }; break; case 's': @@ -734,7 +754,7 @@ static int lfs_find(int argc, char **argv) if (ret) { fprintf(stderr,"error: bad size '%s'\n", optarg); - return ret; + goto err; } param.check_size = 1; param.exclude_size = !!neg_opt; @@ -745,18 +765,21 @@ static int lfs_find(int argc, char **argv) param.quiet = 0; break; case '?': - return CMD_HELP; + ret = CMD_HELP; + goto err; default: fprintf(stderr, "error: %s: option '%s' unrecognized\n", argv[0], argv[optind - 1]); - return CMD_HELP; + ret = CMD_HELP; + goto err; }; } if (pathstart == -1) { fprintf(stderr, "error: %s: no filename|pathname\n", argv[0]); - return CMD_HELP; + ret = CMD_HELP; + goto err; } else if (pathend == -1) { /* no options */ pathend = argc; @@ -785,7 +808,7 @@ static int lfs_find(int argc, char **argv) if (ret) fprintf(stderr, "error: %s failed for %s.\n", argv[0], argv[optind - 1]); - +err: if (param.obduuid && param.num_alloc_obds) free(param.obduuid); diff --git a/lustre/utils/liblustreapi.c b/lustre/utils/liblustreapi.c index 2994cdd..f7e012b 100644 --- a/lustre/utils/liblustreapi.c +++ b/lustre/utils/liblustreapi.c @@ -271,6 +271,25 @@ int llapi_stripe_limit_check(unsigned long long stripe_size, int stripe_offset, return 0; } +/* return the first file matching this pattern */ +static int first_match(char *pattern, char *buffer) +{ + glob_t glob_info; + + if (glob(pattern, GLOB_BRACE, NULL, &glob_info)) + return -ENOENT; + + if (glob_info.gl_pathc < 1) { + globfree(&glob_info); + return -ENOENT; + } + + strcpy(buffer, glob_info.gl_pathv[0]); + + globfree(&glob_info); + return 0; +} + static int find_target_obdpath(char *fsname, char *path) { glob_t glob_info; @@ -313,6 +332,135 @@ static int find_poolpath(char *fsname, char *poolname, char *poolpath) return 0; } +/** + * return a parameter string for a specific device type or mountpoint + * + * \param param_path the path to the file containing parameter data + * \param result buffer for parameter value string + * \param result_size size of buffer for return value + * + * The \param param_path is appended to /proc/{fs,sys}/{lnet,lustre} to + * complete the absolute path to the file containing the parameter data + * the user is requesting. If that file exist then the data is read from + * the file and placed into the \param result buffer that is passed by + * the user. Data is only copied up to the \param result_size to prevent + * overflow of the array. + * + * Return 0 for success, with a NUL-terminated string in \param result. + * Return -ve value for error. + */ +static int get_param(const char *param_path, char *result, + unsigned int result_size) +{ + char file[PATH_MAX + 1], pattern[PATH_MAX + 1], buf[result_size]; + FILE *fp = NULL; + int rc = 0; + + snprintf(pattern, PATH_MAX, "/proc/{fs,sys}/{lnet,lustre}/%s", + param_path); + rc = first_match(pattern, file); + if (rc) + return rc; + + fp = fopen(file, "r"); + if (fp != NULL) { + while (fgets(buf, result_size, fp) != NULL) + strcpy(result, buf); + fclose(fp); + } else { + rc = -errno; + } + return rc; +} + +#define DEVICES_LIST "/proc/fs/lustre/devices" + +/** + * return a parameter string for a specific device type or mountpoint + * + * \param fsname Lustre filesystem name (optional) + * \param file_path path to file in filesystem (optional, if fsname unset) + * \param obd_type Lustre OBD device type + * \param param_name parameter name to fetch + * \param value return buffer for parameter value string + * \param val_len size of buffer for return value + * + * If fsname is specified then the parameter will be from that filesystem + * (if it exists). If file_path is given and it is in a mounted Lustre + * filesystem, then the parameter will be otherwise the value may be + * from any mounted filesystem (if there is more than one). + * + * If "obd_type" matches a Lustre device then the first matching device + * (as with "lctl dl", constrained by \param fsname or \param mount_path) + * will be used to provide the return value, otherwise the first such + * device found will be used. + * + * Return 0 for success, with a NUL-terminated string in \param buffer. + * Return -ve value for error. + */ +static int get_param_obdvar(const char *fsname, const char *file_path, + const char *obd_type, const char *param_name, + char *value, unsigned int val_len) +{ + char devices[PATH_MAX + 1], dev[PATH_MAX + 1] = "*", fs[PATH_MAX + 1]; + FILE *fp = fopen(DEVICES_LIST, "r"); + int rc = 0; + + if (!fsname && file_path) { + rc = llapi_search_fsname(file_path, fs); + if (rc) { + llapi_error(LLAPI_MSG_ERROR, rc, + "'%s' is not on a Lustre filesystem", + file_path); + return rc; + } + } else if (fsname) { + strcpy(fs, fsname); + } + + if (fp == NULL) { + rc = -errno; + llapi_error(LLAPI_MSG_ERROR, rc, "error: opening "DEVICES_LIST); + return rc; + } + + while (fgets(devices, sizeof(devices), fp) != NULL) { + char *bufp = devices, *tmp; + + while (bufp[0] == ' ') + ++bufp; + + tmp = strstr(bufp, obd_type); + if (tmp) { + tmp += strlen(obd_type) + 1; + if (strcmp(tmp, fs)) + continue; + strcpy(dev, tmp); + tmp = strchr(dev, ' '); + *tmp = '\0'; + break; + } + } + + if (dev[0] == '*' && strlen(fs)) + snprintf(dev, PATH_MAX, "%s-*", fs); + snprintf(devices, PATH_MAX, "%s/%s/%s", obd_type, dev, param_name); + fclose(fp); + return get_param(devices, value, val_len); +} + +static int get_mds_md_size(char *path) +{ + int lumlen = lov_mds_md_size(LOV_MAX_STRIPE_COUNT, LOV_MAGIC_V3); + char buf[16]; + + /* Now get the maxea from llite proc */ + if (!get_param_obdvar(NULL, path, "llite", "max_easize", + buf, sizeof(buf))) + lumlen = atoi(buf); + return lumlen; +} + /* * if pool is NULL, search ostname in target_obd * if pool is not NULL: @@ -685,25 +833,6 @@ int llapi_getname(const char *path, char *buf, size_t size) } -/* return the first file matching this pattern */ -static int first_match(char *pattern, char *buffer) -{ - glob_t glob_info; - - if (glob(pattern, GLOB_BRACE, NULL, &glob_info)) - return -ENOENT; - - if (glob_info.gl_pathc < 1) { - globfree(&glob_info); - return -ENOENT; - } - - strcpy(buffer, glob_info.gl_pathv[0]); - - globfree(&glob_info); - return 0; -} - /* * find the pool directory path under /proc * (can be also used to test if a fsname is known) @@ -923,42 +1052,72 @@ int llapi_poollist(const char *name) { /* list of pool names (assume that pool count is smaller than OST count) */ - char *list[FIND_MAX_OSTS]; - char *buffer; - /* fsname-OST0000_UUID < 32 char, 1 per OST */ - int bufsize = FIND_MAX_OSTS * 32; - int i, nb; - - buffer = malloc(bufsize); - if (buffer == NULL) - return -ENOMEM; + char **list, *buffer = NULL, *path = NULL, *fsname = NULL; + int obdcount, bufsize, rc, nb, i; + char *poolname = NULL, *tmp = NULL, data[16]; + + if (name[0] != '/') { + fsname = strdup(name); + poolname = strchr(fsname, '.'); + if (poolname) + *poolname = '\0'; + } else { + path = (char *) name; + } - if ((name[0] == '/') || (strchr(name, '.') == NULL)) + rc = get_param_obdvar(fsname, path, "lov", "numobd", + data, sizeof(data)); + if (rc < 0) + goto err; + obdcount = atoi(data); + + /* Allocate space for each fsname-OST0000_UUID, 1 per OST, + * and also an array to store the pointers for all that + * allocated space. */ +retry_get_pools: + bufsize = sizeof(struct obd_uuid) * obdcount; + buffer = realloc(tmp, bufsize + sizeof(*list) * obdcount); + if (buffer == NULL) { + rc = -ENOMEM; + goto err; + } + list = (char **) (buffer + bufsize); + + if (!poolname) { /* name is a path or fsname */ - nb = llapi_get_poollist(name, list, FIND_MAX_OSTS, buffer, - bufsize); - else + nb = llapi_get_poollist(name, list, obdcount, + buffer, bufsize); + } else { /* name is a pool name (.) */ - nb = llapi_get_poolmembers(name, list, FIND_MAX_OSTS, buffer, - bufsize); + nb = llapi_get_poolmembers(name, list, obdcount, + buffer, bufsize); + } + + if (nb == -EOVERFLOW) { + obdcount *= 2; + tmp = buffer; + goto retry_get_pools; + } for (i = 0; i < nb; i++) llapi_printf(LLAPI_MSG_NORMAL, "%s\n", list[i]); - - free(buffer); - return (nb < 0 ? nb : 0); + rc = (nb < 0 ? nb : 0); +err: + if (buffer) + free(buffer); + if (fsname) + free(fsname); + return rc; } - typedef int (semantic_func_t)(char *path, DIR *parent, DIR *d, void *data, cfs_dirent_t *de); -#define MAX_LOV_UUID_COUNT max(LOV_MAX_STRIPE_COUNT, 1000) #define OBD_NOT_FOUND (-1) -static int common_param_init(struct find_param *param) +static int common_param_init(struct find_param *param, char *path) { - param->lumlen = lov_mds_md_size(MAX_LOV_UUID_COUNT, LOV_MAGIC_V3); + param->lumlen = get_mds_md_size(path); param->lmd = malloc(sizeof(lstat_t) + param->lumlen); if (param->lmd == NULL) { llapi_error(LLAPI_MSG_ERROR, -ENOMEM, @@ -1008,21 +1167,27 @@ static DIR *opendir_parent(char *path) return parent; } -int llapi_mds_getfileinfo(char *path, DIR *parent, - struct lov_user_mds_data *lmd) +static int get_lmd_info(char *path, DIR *parent, DIR *dir, + struct lov_user_mds_data *lmd, int lumlen) { lstat_t *st = &lmd->lmd_st; - char *fname = strrchr(path, '/'); int ret = 0; - if (parent == NULL) + if (parent == NULL && dir == NULL) return -EINVAL; - fname = (fname == NULL ? path : fname + 1); - /* retrieve needed file info */ - strncpy((char *)lmd, fname, - lov_mds_md_size(MAX_LOV_UUID_COUNT, LOV_MAGIC)); - ret = ioctl(dirfd(parent), IOC_MDC_GETFILEINFO, (void *)lmd); + if (dir) { + ret = ioctl(dirfd(dir), LL_IOC_MDC_GETINFO, (void *)lmd); + } else if (parent) { + char *fname = strrchr(path, '/'); + + fname = (fname == NULL ? path : fname + 1); + /* retrieve needed file info */ + strncpy((char *)lmd, fname, lumlen); + ret = ioctl(dirfd(parent), IOC_MDC_GETFILEINFO, (void *)lmd); + } else { + return ret; + } if (ret) { if (errno == ENOTTY) { @@ -1034,24 +1199,34 @@ int llapi_mds_getfileinfo(char *path, DIR *parent, llapi_error(LLAPI_MSG_ERROR, ret, "error: %s: lstat failed for %s", __func__, path); - return ret; } } else if (errno == ENOENT) { ret = -errno; llapi_error(LLAPI_MSG_WARN, ret, "warning: %s: %s does not exist", __func__, path); - return ret; + } else if (errno != EISDIR) { + ret = -errno; + llapi_error(LLAPI_MSG_ERROR, ret, + "%s ioctl failed for %s.", + dir ? "LL_IOC_MDC_GETINFO" : + "IOC_MDC_GETFILEINFO", path); } else { ret = -errno; llapi_error(LLAPI_MSG_ERROR, ret, "error: %s: IOC_MDC_GETFILEINFO failed for %s", __func__, path); - return ret; } } + return ret; +} - return 0; +int llapi_mds_getfileinfo(char *path, DIR *parent, + struct lov_user_mds_data *lmd) +{ + int lumlen = get_mds_md_size(path); + + return get_lmd_info(path, parent, NULL, lmd, lumlen); } static int llapi_semantic_traverse(char *path, int size, DIR *parent, @@ -1174,12 +1349,12 @@ static int param_callback(char *path, semantic_func_t sem_init, if (!buf) return -ENOMEM; - ret = common_param_init(param); + strncpy(buf, path, PATH_MAX + 1); + ret = common_param_init(param, buf); if (ret) goto out; param->depth = 0; - strncpy(buf, path, PATH_MAX + 1); ret = llapi_semantic_traverse(buf, PATH_MAX + 1, NULL, sem_init, sem_fini, param, NULL); out: @@ -1253,11 +1428,11 @@ int llapi_lov_get_uuids(int fd, struct obd_uuid *uuidp, int *ost_count) fclose(fp); - if (uuidp && (index >= *ost_count)) - return -EOVERFLOW; + if (uuidp && (index > *ost_count)) + rc = -EOVERFLOW; *ost_count = index; - return 0; + return rc; } int llapi_get_obd_count(char *mnt, int *count, int is_mdt) @@ -1375,13 +1550,19 @@ static int setup_obd_uuid(DIR *dir, char *dname, struct find_param *param) /* In this case, param->obduuid will be an array of obduuids and * obd index for all these obduuids will be returned in * param->obdindexes */ -static int setup_obd_indexes(DIR *dir, struct find_param *param) +static int setup_obd_indexes(DIR *dir, char *path, struct find_param *param) { + int ret, obdcount, obd_valid = 0, obdnum, i; struct obd_uuid *uuids = NULL; - int obdcount = INIT_ALLOC_NUM_OSTS; - int ret, obd_valid = 0, obdnum, i; + char buf[16]; + + ret = get_param_obdvar(NULL, path, "lov", "numobd", + buf, sizeof(buf)); + if (ret) + return ret; - uuids = (struct obd_uuid *)malloc(INIT_ALLOC_NUM_OSTS * + obdcount = atoi(buf); + uuids = (struct obd_uuid *)malloc(obdcount * sizeof(struct obd_uuid)); if (uuids == NULL) return -ENOMEM; @@ -2024,45 +2205,13 @@ static int cb_find_init(char *path, DIR *parent, DIR *dir, decision = 0; if (param->have_fileinfo == 0 && decision == 0) { - if (dir) { - /* retrieve needed file info */ - ret = ioctl(dirfd(dir), LL_IOC_MDC_GETINFO, - (void *)param->lmd); - } else { - char *fname = strrchr(path, '/'); - fname = (fname == NULL ? path : fname + 1); - - /* retrieve needed file info */ - strncpy((char *)param->lmd, fname, param->lumlen); - ret = ioctl(dirfd(parent), IOC_MDC_GETFILEINFO, - (void *)param->lmd); - } - } - - if (ret) { - if (errno == ENOTTY) { - /* ioctl is not supported, it is not a lustre fs. - * Do the regular lstat(2) instead. */ - lustre_fs = 0; - ret = lstat_f(path, st); - if (ret) { - ret = -errno; - llapi_error(LLAPI_MSG_ERROR, ret, - "error: %s: lstat failed for %s", - __func__, path); - return ret; - } - } else if (errno == ENOENT) { - llapi_error(LLAPI_MSG_WARN, -ENOENT, - "warning: %s: %s does not exist", - __func__, path); - goto decided; - } else { - ret = -errno; - llapi_error(LLAPI_MSG_ERROR, ret, - "error: %s: %s failed for %s", - __func__, dir ? "LL_IOC_MDC_GETINFO" : - "IOC_MDC_GETFILEINFO", path); + ret = get_lmd_info(path, parent, dir, param->lmd, + param->lumlen); + if (ret) { + if (ret == -ENOTTY) + lustre_fs = 0; + if (ret == -ENOENT) + goto decided; return ret; } } @@ -2088,7 +2237,8 @@ static int cb_find_init(char *path, DIR *parent, DIR *dir, } if (lustre_fs && !param->got_uuids) { - ret = setup_obd_indexes(dir ? dir : parent, param); + ret = setup_obd_indexes(dir ? dir : parent, path, + param); if (ret) return ret; @@ -2503,7 +2653,6 @@ int llapi_obd_statfs(char *path, __u32 type, __u32 index, } #define MAX_STRING_SIZE 128 -#define DEVICES_LIST "/proc/fs/lustre/devices" int llapi_ping(char *obd_type, char *obd_name) { @@ -2728,36 +2877,15 @@ static int cb_quotachown(char *path, DIR *parent, DIR *d, void *data, LASSERT(parent != NULL || d != NULL); - if (d) { - rc = ioctl(dirfd(d), LL_IOC_MDC_GETINFO, - (void *)param->lmd); - } else if (parent) { - char *fname = strrchr(path, '/'); - fname = (fname == NULL ? path : fname + 1); - - strncpy((char *)param->lmd, fname, param->lumlen); - rc = ioctl(dirfd(parent), IOC_MDC_GETFILEINFO, - (void *)param->lmd); - } else { - return 0; - } - + rc = get_lmd_info(path, parent, d, param->lmd, param->lumlen); if (rc) { - if (errno == ENODATA) { + if (rc == -ENODATA) { if (!param->obduuid && !param->quiet) llapi_error(LLAPI_MSG_ERROR, -ENODATA, "%s has no stripe info", path); rc = 0; - } else if (errno == ENOENT) { - llapi_error(LLAPI_MSG_ERROR, -ENOENT, - "warning: %s: %s does not exist", - __func__, path); + } else if (rc == -ENOENT) { rc = 0; - } else if (errno != EISDIR) { - rc = -errno; - llapi_error(LLAPI_MSG_ERROR, rc, "%s ioctl failed for %s.", - d ? "LL_IOC_MDC_GETINFO" : - "IOC_MDC_GETFILEINFO", path); } return rc; } diff --git a/lustre/utils/obd.c b/lustre/utils/obd.c index 178d1e3..4965781 100644 --- a/lustre/utils/obd.c +++ b/lustre/utils/obd.c @@ -112,12 +112,11 @@ const int nthreads = 1; static int cur_device = -1; -#define MAX_STRIPES 170 -struct lov_oinfo lov_oinfos[MAX_STRIPES]; +struct lov_oinfo lov_oinfos[LOV_MAX_STRIPE_COUNT]; struct lsm_buffer { struct lov_stripe_md lsm; - struct lov_oinfo *ptrs[MAX_STRIPES]; + struct lov_oinfo *ptrs[LOV_MAX_STRIPE_COUNT]; } lsm_buffer; static int l2_ioctl(int dev_id, int opc, void *buf) @@ -2984,7 +2983,7 @@ int obd_initialize(int argc, char **argv) { int i; - for (i = 0; i < MAX_STRIPES; i++) + for (i = 0; i < LOV_MAX_STRIPE_COUNT; i++) lsm_buffer.lsm.lsm_oinfo[i] = lov_oinfos + i; if (shmem_setup() != 0) -- 1.8.3.1