extern int llapi_file_get_stripe(const char *path, struct lov_user_md *lum);
#define HAVE_LLAPI_FILE_LOOKUP
extern int llapi_file_lookup(int dirfd, const char *name);
-
+
struct find_param {
unsigned int maxdepth;
time_t atime;
extern int llapi_target_check(int num_types, char **obd_types, char *dir);
extern int llapi_catinfo(char *dir, char *keyword, char *node_name);
extern int llapi_lov_get_uuids(int fd, struct obd_uuid *uuidp, int *ost_count);
-extern int llapi_is_lustre_mnttype(struct mntent *mnt);
+extern int llapi_is_lustre_mnttype(const char *type);
+struct mntent;
+#define HAVE_LLAPI_IS_LUSTRE_MNT
+extern int llapi_is_lustre_mnt(struct mntent *mnt);
extern int llapi_quotachown(char *path, int flag);
extern int llapi_quotacheck(char *mnt, int check_type);
extern int llapi_poll_quotacheck(char *mnt, struct if_quotacheck *qchk);
memset(¶m, 0, sizeof(param));
param.obduuid = obduuid;
while (feof(fp) == 0 && ferror(fp) ==0) {
- if (llapi_is_lustre_mnttype(mnt)) {
+ if (llapi_is_lustre_mnt(mnt)) {
rc = llapi_getstripe(mnt->mnt_dir, ¶m);
if (rc)
fprintf(stderr,
len = 0;
mnt = getmntent(fp);
while (feof(fp) == 0 && ferror(fp) == 0) {
- if (llapi_is_lustre_mnttype(mnt)) {
+ if (llapi_is_lustre_mnt(mnt)) {
len = strlen(mnt->mnt_dir);
if (len > out_len &&
!strncmp(rpath, mnt->mnt_dir, len)) {
} else {
mnt = getmntent(fp);
while (feof(fp) == 0 && ferror(fp) == 0) {
- if (llapi_is_lustre_mnttype(mnt)) {
+ if (llapi_is_lustre_mnt(mnt)) {
rc = mntdf(mnt->mnt_dir, ishow, cooked);
if (rc)
break;
} else {
mnt = getmntent(fp);
while (feof(fp) == 0 && ferror(fp) ==0) {
- if (llapi_is_lustre_mnttype(mnt))
+ if (llapi_is_lustre_mnt(mnt))
break;
mnt = getmntent(fp);
}
} else {
mnt = getmntent(fp);
while (feof(fp) == 0 && ferror(fp) == 0) {
- if (llapi_is_lustre_mnttype(mnt))
+ if (llapi_is_lustre_mnt(mnt))
break;
mnt = getmntent(fp);
}
"expected (%u).\n", page_size, LOV_MIN_STRIPE_SIZE);
}
if (stripe_size < 0 || (stripe_size & (LOV_MIN_STRIPE_SIZE - 1))) {
+ errno = rc = -EINVAL;
err_msg("error: bad stripe_size %lu, must be an even "
"multiple of %d bytes", stripe_size, page_size);
- errno = rc = -EINVAL;
goto out;
}
if (stripe_offset < -1 || stripe_offset > MAX_OBD_DEVICES) {
- err_msg("error: bad stripe offset %d", stripe_offset);
errno = rc = -EINVAL;
+ err_msg("error: bad stripe offset %d", stripe_offset);
goto out;
}
if (stripe_count < -1 || stripe_count > LOV_MAX_STRIPE_COUNT) {
- err_msg("error: bad stripe count %d", stripe_count);
errno = rc = -EINVAL;
+ err_msg("error: bad stripe count %d", stripe_count);
goto out;
}
if (stripe_count > 0 && (__u64)stripe_size * stripe_count > 0xffffffff){
+ errno = rc = -EINVAL;
err_msg("error: stripe_size %lu * stripe_count %u "
"exceeds 4GB", stripe_size, stripe_count);
- errno = rc = -EINVAL;
goto out;
}
return rc;
}
+/* Is this a lustre fs? */
+int llapi_is_lustre_mnttype(const char *type)
+{
+ return (strcmp(type, "lustre") == 0 || strcmp(type,"lustre_lite") == 0);
+}
+
/* Is this a lustre client fs? */
-int llapi_is_lustre_mnttype(struct mntent *mnt)
+int llapi_is_lustre_mnt(struct mntent *mnt)
{
- char *type = mnt->mnt_type;
- return ((strcmp(type, "lustre") == 0 || strcmp(type,"lustre_lite") == 0)
- && (strstr(mnt->mnt_fsname, ":/") != NULL));
+ return (llapi_is_lustre_mnttype(mnt->mnt_type) &&
+ strstr(mnt->mnt_fsname, ":/") != NULL);
}
int llapi_quotacheck(char *mnt, int check_type)