summaryrefslogtreecommitdiff
path: root/usr/src/cmd/filebench/common/misc.c
diff options
context:
space:
mode:
authoraw148015 <Andrew.W.Wilson@sun.com>2009-01-26 09:32:31 -0800
committeraw148015 <Andrew.W.Wilson@sun.com>2009-01-26 09:32:31 -0800
commit4432feae5fd55150d54ce309a84a0a321b4d5449 (patch)
tree47c44a6b0775df40dc750359bd6ee22c218c2041 /usr/src/cmd/filebench/common/misc.c
parentedd20d23d143338b5e74d55a15257d4cccac7523 (diff)
downloadillumos-joyent-4432feae5fd55150d54ce309a84a0a321b4d5449.tar.gz
6792062 FileBench needs work to allow plug-in file system clients
Diffstat (limited to 'usr/src/cmd/filebench/common/misc.c')
-rw-r--r--usr/src/cmd/filebench/common/misc.c37
1 files changed, 32 insertions, 5 deletions
diff --git a/usr/src/cmd/filebench/common/misc.c b/usr/src/cmd/filebench/common/misc.c
index 553d28bcee..6f2eb4db2f 100644
--- a/usr/src/cmd/filebench/common/misc.c
+++ b/usr/src/cmd/filebench/common/misc.c
@@ -19,12 +19,10 @@
* CDDL HEADER END
*/
/*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
-#pragma ident "%Z%%M% %I% %E% SMI"
-
#include <stdio.h>
#include <fcntl.h>
#include <limits.h>
@@ -36,6 +34,10 @@
#include "ipc.h"
#include "eventgen.h"
#include "utils.h"
+#include "fsplug.h"
+
+/* File System functions vector */
+fsplug_func_t *fs_functions_vec;
/*
* Routines to access high resolution system time, initialize and
@@ -43,7 +45,6 @@
* access system information strings.
*/
-
#if !defined(sun) && defined(USE_RDTSC)
/*
* Lets us use the rdtsc instruction to get highres time.
@@ -159,7 +160,6 @@ filebench_init(void)
filebench_shutdown(1);
}
#endif /* USE_RDTSC */
-
}
extern int lex_lineno;
@@ -454,3 +454,30 @@ script_var(var_t *var)
return (var);
}
+
+void fb_lfs_funcvecinit(void);
+
+/*
+ * Initialize any "plug-in" I/O function vectors. Called by each
+ * filebench process that is forked, as the vector is relative to
+ * its image.
+ */
+void
+filebench_plugin_funcvecinit(void)
+{
+
+ switch (filebench_shm->shm_filesys_type) {
+ case LOCAL_FS_PLUG:
+ fb_lfs_funcvecinit();
+ break;
+
+ case NFS3_PLUG:
+ case NFS4_PLUG:
+ case CIFS_PLUG:
+ break;
+ default:
+ filebench_log(LOG_ERROR,
+ "filebench_plugin_funcvecinit: unknown file system");
+ break;
+ }
+}