Trim off some LOOKUP calls we do not need in the nfs loadfile to initialize
[tridge/dbench.git] / nfsio.c
diff --git a/nfsio.c b/nfsio.c
index e51ca18ae8919c1d780f5ca8329307ce1edfd840..c95f8c3519edff1db34add82cde1aba6fc7e6317 100644 (file)
--- a/nfsio.c
+++ b/nfsio.c
@@ -54,6 +54,7 @@ static void nfs3_cleanup(struct child_struct *child)
 static void nfs3_setup(struct child_struct *child)
 {
        const char *status = "0x00000000";
+       nfsstat3 res;
 
        child->rate.last_time = timeval_current();
        child->rate.last_bytes = 0;
@@ -67,6 +68,17 @@ static void nfs3_setup(struct child_struct *child)
                printf("nfsio_connect() failed\n");
                exit(10);
        }
+
+       /* create '/clients' */
+       res = nfsio_lookup(child->private, "/clients", NULL);
+       if (res == NFS3ERR_NOENT) {
+               res = nfsio_mkdir(child->private, "/clients");
+               if( (res != NFS3_OK) &&
+                   (res != NFS3ERR_EXIST) ) {
+                       printf("Failed to create '/clients' directory. res:%u\n", res);
+                       exit(10);
+               }
+       }
 }