diff options
author | aw148015 <none@none> | 2008-03-27 14:55:06 -0700 |
---|---|---|
committer | aw148015 <none@none> | 2008-03-27 14:55:06 -0700 |
commit | 29c773b378195388268beedd40b7b2732967d9e2 (patch) | |
tree | 51831beac6914e285c2ad34c9df71780f5b6b6af /usr/src/cmd/filebench/common/fileset.c | |
parent | c5f58477f1b190d049c5f4fedeed36e5cc22a1c7 (diff) | |
download | illumos-joyent-29c773b378195388268beedd40b7b2732967d9e2.tar.gz |
6549500 Filebench error reporting requires traditionalization
6672924 The fileserver.f FileBench workload needs to create files too.
6673349 seg fault when variables defined after define stmt
6673391 go_filebench exit code 1
6673928 creating large filesets is slow
Diffstat (limited to 'usr/src/cmd/filebench/common/fileset.c')
-rw-r--r-- | usr/src/cmd/filebench/common/fileset.c | 41 |
1 files changed, 39 insertions, 2 deletions
diff --git a/usr/src/cmd/filebench/common/fileset.c b/usr/src/cmd/filebench/common/fileset.c index 497894ccf6..2a2819a287 100644 --- a/usr/src/cmd/filebench/common/fileset.c +++ b/usr/src/cmd/filebench/common/fileset.c @@ -46,6 +46,8 @@ * corresponding to the fileset's filesetentry tree. */ +static int fileset_checkraw(fileset_t *fileset); + /* parallel allocation control */ #define MAX_PARALLOC_THREADS 32 static pthread_mutex_t paralloc_lock = PTHREAD_MUTEX_INITIALIZER; @@ -1065,6 +1067,15 @@ fileset_createset(fileset_t *fileset) if (fileset && avd_get_bool(fileset->fs_prealloc)) { + /* check for raw files */ + if (fileset_checkraw(fileset)) { + filebench_log(LOG_INFO, + "file %s/%s is a RAW device", + avd_get_str(fileset->fs_path), + avd_get_str(fileset->fs_name)); + return (0); + } + filebench_log(LOG_INFO, "creating/pre-allocating %s %s", fileset_entity_name(fileset), @@ -1082,6 +1093,16 @@ fileset_createset(fileset_t *fileset) list = filebench_shm->filesetlist; while (list) { + /* check for raw files */ + if (fileset_checkraw(list)) { + filebench_log(LOG_INFO, + "file %s/%s is a RAW device", + avd_get_str(list->fs_path), + avd_get_str(list->fs_name)); + list = list->fs_next; + continue; + } + if ((ret = fileset_populate(list)) != 0) return (ret); if ((ret = fileset_create(list)) != 0) @@ -1220,17 +1241,33 @@ fileset_checkraw(fileset_t *fileset) { char path[MAXPATHLEN]; struct stat64 sb; + char *pathname; + char *setname; fileset->fs_attrs &= (~FILESET_IS_RAW_DEV); #ifdef HAVE_RAW_SUPPORT /* check for raw device */ - (void) strcpy(path, avd_get_str(fileset->fs_path)); + if ((pathname = avd_get_str(fileset->fs_path)) == NULL) + return (0); + + if ((setname = avd_get_str(fileset->fs_name)) == NULL) + return (0); + + (void) strcpy(path, pathname); (void) strcat(path, "/"); - (void) strcat(path, avd_get_str(fileset->fs_name)); + (void) strcat(path, setname); if ((stat64(path, &sb) == 0) && ((sb.st_mode & S_IFMT) == S_IFBLK) && sb.st_rdev) { fileset->fs_attrs |= FILESET_IS_RAW_DEV; + if (!(fileset->fs_attrs & FILESET_IS_FILE)) { + filebench_log(LOG_ERROR, + "WARNING Fileset %s/%s Cannot be RAW device", + avd_get_str(fileset->fs_path), + avd_get_str(fileset->fs_name)); + filebench_shutdown(1); + } + return (1); } #endif /* HAVE_RAW_SUPPORT */ |