* ENOSPC error
* can_mmap: file-system supports share writable 'mmap()' operation
* fstype: file-system type (e.g., "ubifs")
+ * mount_point: tested file-system mount point path
*/
static struct {
int max_name_len;
unsigned int nospc_size_ok:1;
unsigned int can_mmap:1;
const char *fstype;
+ const char *mount_point;
} fsinfo = {
.nospc_size_ok = 1,
.can_mmap = 1,
{
struct statvfs st;
- CHECK(statvfs(args.mount_point, &st) != -1);
+ CHECK(statvfs(fsinfo.mount_point, &st) != -1);
return (uint64_t)st.f_bavail * (uint64_t)st.f_frsize;
}
char *path;
if (!parent)
- return cat_paths(args.mount_point, name);
+ return cat_paths(fsinfo.mount_point, name);
parent_path = dir_path(parent->parent, parent->name);
path = cat_paths(parent_path, name);
free(parent_path);
const char *mp;
FILE *f;
uint64_t z;
+ char *p;
- CHECK(statfs(args.mount_point, &fs_info) == 0);
+ /* Remove trailing '/' symbols from the mount point */
+ p = dup_string(args.mount_point);
+ fsinfo.mount_point = p;
+ p += strlen(p);
+ while (*--p == '/');
+ *(p + 1) = '\0';
+ CHECK(statfs(fsinfo.mount_point, &fs_info) == 0);
fsinfo.max_name_len = fs_info.f_namelen;
mp = "/proc/mounts";
CHECK(0);
}
- if (!strcmp(mntent->mnt_dir, args.mount_point))
+ if (!strcmp(mntent->mnt_dir, fsinfo.mount_point))
break;
}
fclose(f);
get_tested_fs_info();
/* Temporary hack - will be fixed a bit later */
- tests_file_system_mount_dir = (void *)args.mount_point;
+ tests_file_system_mount_dir = (void *)fsinfo.mount_point;
tests_file_system_type = (void *)fsinfo.fstype;
/* Do the actual test */