summaryrefslogtreecommitdiff
path: root/usr/src/cmd/filebench/common/fb_localfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/cmd/filebench/common/fb_localfs.c')
-rw-r--r--usr/src/cmd/filebench/common/fb_localfs.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/usr/src/cmd/filebench/common/fb_localfs.c b/usr/src/cmd/filebench/common/fb_localfs.c
index df5ebad7cd..b1958073c5 100644
--- a/usr/src/cmd/filebench/common/fb_localfs.c
+++ b/usr/src/cmd/filebench/common/fb_localfs.c
@@ -96,6 +96,7 @@ static int fb_lfs_fsync(fb_fdesc_t *);
static int fb_lfs_stat(char *, struct stat64 *);
static int fb_lfs_fstat(fb_fdesc_t *, struct stat64 *);
static int fb_lfs_access(const char *, int);
+static void fb_lfs_recur_rm(char *);
static fsplug_func_t fb_lfs_funcs =
{
@@ -122,7 +123,8 @@ static fsplug_func_t fb_lfs_funcs =
fb_lfs_fsync, /* fsync */
fb_lfs_stat, /* stat */
fb_lfs_fstat, /* fstat */
- fb_lfs_access /* access */
+ fb_lfs_access, /* access */
+ fb_lfs_recur_rm /* recursive rm */
};
#ifdef HAVE_AIO
@@ -577,6 +579,19 @@ fb_lfs_rmdir(char *path)
}
/*
+ * does a recursive rm to remove an entire directory tree (i.e. a fileset).
+ * Supplied with the path to the root of the tree.
+ */
+static void
+fb_lfs_recur_rm(char *path)
+{
+ char cmd[MAXPATHLEN];
+
+ (void) snprintf(cmd, sizeof (cmd), "rm -rf %s", path);
+ (void) system(cmd);
+}
+
+/*
* Does a posix opendir(), Returns a directory handle on success,
* NULL on failure.
*/