Allow longer server names; fixes (temporarily) a buffer overflow.
[bluesky.git] / TBBT / trace_play / sfs_c_def.h
1 #ifndef _sfs_c_def_h
2 #define _sfs_c_def_h
3
4 #define RFS
5 /*
6  *   Copyright (c) 1992-1997,2001 by Standard Performance Evaluation Corporation
7  *      All rights reserved.
8  *              Standard Performance Evaluation Corporation (SPEC)
9  *              6585 Merchant Place, Suite 100
10  *              Warrenton, VA 20187
11  *
12  *      This product contains benchmarks acquired from several sources who
13  *      understand and agree with SPEC's goal of creating fair and objective
14  *      benchmarks to measure computer performance.
15  *
16  *      This copyright notice is placed here only to protect SPEC in the
17  *      event the source is misused in any manner that is contrary to the
18  *      spirit, the goals and the intent of SPEC.
19  *
20  *      The source code is provided to the user or company under the license
21  *      agreement for the SPEC Benchmark Suite for this product.
22  */
23
24 /*****************************************************************
25  *                                                               *
26  *      Copyright 1991,1992  Legato Systems, Inc.                *
27  *      Copyright 1991,1992  Auspex Systems, Inc.                *
28  *      Copyright 1991,1992  Data General Corporation            *
29  *      Copyright 1991,1992  Digital Equipment Corporation       *
30  *      Copyright 1991,1992  Interphase Corporation              *
31  *      Copyright 1991,1992  Sun Microsystems, Inc.              *
32  *                                                               *
33  *****************************************************************/
34
35 /*
36  * @(#)sfs_c_def.h      2.1     97/10/23
37  *
38  * -------------------------- sfs_c_def.h -----------------------
39  *
40  *      Literals and types for the sfs program.
41  *
42  *.Revision_History
43  *      Wittle          24-Aug-92     - New file set access code.
44  *      Bruce Keith     04-Dec-91     - Fix SVR4 definitions for NGROUPS.
45  *                                    - Include param.h/limits.h as
46  *                                      appropriate (BSD/SVR4).
47  *                                    - Use bcopy, bzero, bcmp for BSD;
48  *                                      memcpy, memset, memcmp for SYSV.
49  *      Richard Bean    17-May-90       Created.
50  */
51
52 #include <sys/stat.h>
53
54 #include <limits.h>
55
56 #if !defined(_XOPEN_SOURCE)
57 /*
58  * Some non-XOPEN_compilent systems are missing these definitions 
59  */
60 #if !defined(SVR4)                      /* Assume BSD */
61 #include <sys/param.h>
62 #endif /* SVR4 */
63 #endif /* !_XOPEN_SOURCE */
64
65 #include <sys/time.h>
66
67 #if defined(SVR4)
68 #include <sys/select.h>
69 #endif
70
71 #include "rpc/rpc.h"
72
73 #if (defined (SVR4) || defined (AIX))
74 #include <netinet/in.h>
75 #endif
76
77 #include <netdb.h>
78
79 #define SFS_MIN_RES             100             /* 100 usec resolution */
80 #define SFS_MAXNAMLEN           128             /* max test file name length */
81 #define SFS_MAXPATHLEN          1024            /* max test path name length */
82 #define HOSTNAME_LEN            63              /* length of client's hostname */
83
84 #include "sfs_c_nfs.h"
85
86 /* --------------------------  Constants  ----------------------- */
87
88 #define SFS_VERSION_DATE        "11 July 2001"
89 #define SFS_VERSION_NUM         "3.0"
90
91 /*
92  * Debugging levels
93  */
94 #define CHILD_TO_DEBUG          0       /* per child debugging uses child 0 */
95
96 #define DEBUG_NEW_CODE          (Debug_level & 0x00000001)              /* 1 */
97 #define DEBUG_PARENT_GENERAL    (Debug_level & 0x00000002)              /* 2 */
98 #define DEBUG_PARENT_SIGNAL     (Debug_level & 0x00000004)              /* 3 */
99 #define DEBUG_CHILD_ERROR       (Debug_level & 0x00000008)              /* 4 */
100 #define DEBUG_CHILD_SIGNAL      (Debug_level & 0x00000010)              /* 5 */
101 #define DEBUG_CHILD_XPOINT      (Debug_level & 0x00000020)              /* 6 */
102 #define DEBUG_CHILD_GENERAL     ((Debug_level & 0x00000040) && \
103                                         (Child_num == CHILD_TO_DEBUG))  /* 7 */
104 #define DEBUG_CHILD_OPS         ((Debug_level & 0x00000080) && \
105                                         (Child_num == CHILD_TO_DEBUG))  /* 8 */
106 #define DEBUG_CHILD_FILES       ((Debug_level & 0x00000100) && \
107                                         (Child_num == CHILD_TO_DEBUG))  /* 9 */
108 #define DEBUG_CHILD_RPC         ((Debug_level & 0x00000200) && \
109                                         (Child_num == CHILD_TO_DEBUG))  /* 10 */
110 #define DEBUG_CHILD_TIMING      ((Debug_level & 0x00000400) && \
111                                         (Child_num == CHILD_TO_DEBUG))  /* 11 */
112 #define DEBUG_CHILD_SETUP       ((Debug_level & 0x00000800) && \
113                                         (Child_num == CHILD_TO_DEBUG))  /* 12 */
114 #define DEBUG_CHILD_FIT         ((Debug_level & 0x00001000) && \
115                                         (Child_num == CHILD_TO_DEBUG))  /* 13 */
116 #define DEBUG_CHILD_BIOD        ((Debug_level & 0x00002000) && \
117                                         (Child_num == CHILD_TO_DEBUG))  /* 14 */
118
119
120 /*
121  * General constants for benchmark
122  */
123 #define DEFAULT_LOAD            60              /* calls per sec */
124 #define DEFAULT_CALLS           5000            /* number of calls */
125 #define DEFAULT_NPROCS          4               /* number of children to run */
126 #define DEFAULT_RUNTIME         (5 * 60)        /* runtime in seconds */
127 #define DEFAULT_WARMUP          (5 * 60)        /* warmup time in seconds */
128 #define DEFAULT_ACCESS          10              /* % of file set accessed */
129 #define DEFAULT_APPEND          70              /* % of writes that append */
130 #define DEFAULT_DELTA_FSS       10              /* % change to file set size */
131 #define DEFAULT_KB_PER_BLOCK    8               /* block xfer size in KB */
132 #define DEFAULT_BYTES_PER_OP    (10*1024*1024)  /* bytes per unit load */
133 #define DEFAULT_NFILES          100             /* # of regular NON-IO files */
134 #define DEFAULT_FILES_PER_DIR   30              /* # of files per directories */
135 #define DEFAULT_NSYMLINKS       20              /* # of symlinks  */
136 #define DEFAULT_FAILED_LOOKUP   35              /* # of failed lookups  */
137
138 #define DEFAULT_WARM_RATE_CHECK 2               /* check progress each 2 secs */
139 #define DEFAULT_RUN_RATE_CHECK  10              /* check progress each 10 sec */
140 #define DEFAULT_MAX_BUFSIZE     NFS_MAXDATA     /* max buffer size for i/o */
141
142 #define DEFAULT_BIOD_MAX_WRITE  2               /* max outstanding biod write */
143 #define DEFAULT_BIOD_MAX_READ   2               /* max outstanding biod reads */
144 #define MAX_BIODS               32
145
146
147 /*
148  * For now we only read a fixed number of  files from a directory.  Ideally
149  * we would like to read a random number from 0-MAX but we will need a new
150  * workload.
151  */
152 #define SFS_MAXDIRENTS  128
153
154 /*
155  * If you change the default Chi_Sqr value,
156  * then also change the field label in the results print out.
157  */
158 #define DEFAULT_CHI_SQR_CI      CHI_SQR_95      /* chi-sqr value to use */
159 #define CHI_SQR_90              2.71            /* chi-sqr value for 90% CI */
160 #define CHI_SQR_95              3.84            /* chi-sqr value for 95% CI */
161 #define CHI_SQR_975             5.02            /* chi-sqr value for 97.5% CI */
162 #define CHI_SQR_99              6.63            /* chi-sqr value for 99% CI */
163 #define CHI_SQR_995             7.88            /* chi-sqr value for 99.5% CI */
164
165 /*
166  * NFS operation numbers
167  */
168 #define NULLCALL        0
169 #define GETATTR         1
170 #define SETATTR         2
171 #define ROOT            3
172 #define LOOKUP          4
173 #define READLINK        5
174 #define READ            6
175 #define WRCACHE         7
176 #define WRITE           8
177 #define CREATE          9
178 #define REMOVE          10
179 #define RENAME          11
180 #define LINK            12
181 #define SYMLINK         13
182 #define MKDIR           14
183 #define RMDIR           15
184 #define READDIR         16
185 #define FSSTAT          17
186 #define ACCESS          18
187 #define COMMIT          19
188 #define FSINFO          20
189 #define MKNOD           21
190 #define PATHCONF        22
191 #define READDIRPLUS     23
192 #define NOPS            (READDIRPLUS+1)         /* number of NFS ops */
193 #define TOTAL           NOPS                    /* slot for totals */
194
195 /*
196  * Constants for i/o distribution table
197  */
198 #define IO_DIST_START   0
199 #define IO_DIST_READ    1
200 #define IO_DIST_WRITE   2
201
202 /*
203  * Ratio of non_io_files that are initialized
204  * NOTE: initializing half the non-i/o files works ok with the
205  *    default op mix.  If the mix is changed affecting the
206  *    ratio of creations to removes, there may not be enough
207  *    empty slots for file creation (or there may not be
208  *    enough created during initialization to handle a lot of
209  *    removes that occur early in the test run), and this would
210  *    cause do_op() to fail to find a file appropriate for the
211  *    chosen op.  This will result in the global variable
212  *    Ops[op].no_calls being incremented (turn on child level
213  *    debugging to check this count), and the do_op() local
214  *    variable aborted_ops to be incremented and checked during
215  *    runtime for too many failures.
216  */
217 #define RATIO_NON_IO_INIT 0.5
218
219 /*
220  *---------------------------- TCP stuff ---------------------
221  */
222
223 #define TCPBUFSIZE      1024 * 32 + 200
224
225 /* --------------------------  Macros  ----------------------- */
226
227 struct ladtime {
228         uint32_t    sec;         /* seconds */
229         uint32_t    usec;        /* and microseconds */
230         uint32_t    esec;        /* seconds since standard epoch */
231 };
232
233 #define SUBTIME(t1, t2) { \
234         if ((t1.sec < t2.sec) || \
235                 ((t1.sec == t2.sec) && (t1.usec < t2.usec))) { \
236                 t1.sec = t1.usec = 0 ; \
237         } else { \
238                 if (t1.usec < t2.usec) { \
239                         t1.usec += 1000000; \
240                         t1.sec--; \
241                 } \
242                 t1.usec -= t2.usec; \
243                 t1.sec -= t2.sec; \
244         } \
245 }
246
247 #define ADDTIME(t1, t2) {if ((t1.usec += t2.usec) >= 1000000) {\
248                                 t1.sec += (t1.usec / 1000000); \
249                                 t1.usec %= 1000000; \
250                          } \
251                          t1.sec += t2.sec; \
252                         }
253
254 #define MINIMUM(a, b) ((a < b) ? (a) : (b))
255 #define MAXIMUM(a, b) ((a > b) ? (a) : (b))
256
257 #define MULTIME(t1, s) { \
258         t1.usec *=s; \
259         t1.sec *=s; \
260         if (t1.usec >= 1000000) {\
261                 t1.sec += (t1.usec/1000000); \
262                 t1.usec %= 1000000; \
263         }\
264         }
265 #define DIVTIME(t1, s) { \
266         t1.usec += (t1.sec % s ) *1000000; \
267         t1.sec /= s; \
268         t1.usec /= s; \
269         }
270 #define LARGERTIME(t1, t2) \
271  ((t1.sec>t2.sec) || ((t1.sec==t2.sec) && (t1.usec>t2.usec))) 
272
273 /* --------------------------  Types  ----------------------- */
274
275 /*
276  * SFS test phases.  Values are well-ordered for use of "<" operations.
277  */
278 #define Mount_phase      1  /* test directories are being mounted */
279 #define Populate_phase   2  /* files being created in the test directories */
280 #define Warmup_phase     3  /* reach steady state (load is being generated) */
281 #define Testrun_phase    4  /* timed test run (load is being generated) */
282 #define Results_phase    5  /* results collection and reporting */
283 typedef int sfs_phase_type;
284
285 /*
286  * Index constants for lookups into the RPC timer array.
287  */
288 #define Init    0
289 #define Lookup  1
290 #define Read    2
291 #define Write   3
292
293 /*
294  * SFS results information structure
295  */
296 typedef struct {
297         int             good_calls;     /* successful calls */
298         int             bad_calls;      /* failed (timed out) calls */
299         int     timeout_calls;  /* RFS timeout calls */
300         int             fast_calls;     /* calls that competed in 0 time */
301         struct ladtime  time;           /* cumulative execution time */
302         double          msec2;          /* cumulative squared time - msecs**2 */
303 } sfs_results_type;
304
305 /*
306  * SFS information reported from child back to parent.
307  */
308 typedef struct {
309         int                     version;
310         sfs_results_type        results_buf[NOPS+1];
311         int                     total_fss_bytes;
312         int                     least_fss_bytes;
313         int                     most_fss_bytes;
314         int                     base_fss_bytes;
315 } sfs_results_report_type;
316
317
318 /*
319  * SFS operation information structure
320  */
321
322 typedef struct {
323         char *          name;           /* operation name */
324         int             mix_pcnt;       /* percentage of call target */
325 #ifndef RFS
326         int             (*funct)();     /* op routine */
327 #endif
328         int             call_class;     /* call class: client handle & timeo */
329         int             target_calls;   /* number of calls to make */
330         int             no_calls;       /* # of times a call couldn't be made */
331         double          req_pcnt;       /* cumulative request percentile */
332         int             req_cnt;        /* number of requests made */
333         int             target_reqs;    /* number of req to be made */
334         sfs_results_type results;       /* test results */
335 } sfs_op_type;
336
337
338 /*
339  * Flags used with randfh
340  */
341 #define RANDFH_TRUNC            0x01    /* pick a file to truncate */
342 #define RANDFH_APPEND           0x02    /* pick a file to append to */
343
344 /*
345  * SFS file information structure
346  * The particular values assiged are used to perform mod operations.
347  */
348 #define Sfs_io_file             0       /* read, write ops only (0) */
349 #define Sfs_non_io_file         1       /* other regular file ops only (1) */
350 #define Sfs_symlink             2       /* symlink ops only (2) */
351 #define Sfs_dir                 3       /* dir ops only (3) */
352 #define Sfs_regular             4       /* any regular file (0,1) */
353 #define Sfs_non_dir             5       /* any non-directory file (0,1,2) */
354 #define Sfs_any_file            6       /* any file, link, or dir (0,1,2,3) */
355 typedef int sfs_file_type;
356
357 #define Exists          1       /* op needs an object that already exists */
358 #define Nonexistent     2       /* op will create an object */
359 #define Empty_dir       3       /* op needs an empty directory */
360 typedef char sfs_state_type;
361
362 /*
363  * One file (dir, or symlink) in the file set.
364  */
365 typedef struct sfs_fh_data {
366         union {
367                 fhandle_t       f_fh2;            /* the NFS V2 file handle */
368                 nfs_fh3         f_fh3;            /* the NFS V3 file handle */
369         } sfs_fh_un;
370         union {
371                 fattr           a_attributes2;    /* its V2 attributes */
372                 fattr3          a_attributes3;    /* its V3 attributes */
373         } sfs_fattr_un;
374         char                    file_name[SFS_MAXNAMLEN]; /* path component*/
375 } sfs_fh_data;
376
377 typedef struct sfs_fh_type {
378         struct sfs_fh_type      *dir;           /* Parent Directory */
379         struct sfs_fh_data      *fh_data;       /* Data area */
380         int                     size;           /* its size */
381         int                     unique_num;     /* unique part of filename */
382         int                     use_cnt;        /* count of op to this file */
383         int                     xfer_cnt;       /* count of KB xfered */
384         sfs_state_type          state;          /* existence state */
385         char                    working_set;    /* is in the working set */
386         char                    initialize;     /* should be initialized */
387 #define attributes2     fh_data->sfs_fattr_un.a_attributes2
388 #define attributes3     fh_data->sfs_fattr_un.a_attributes3
389 #define fh2     fh_data->sfs_fh_un.f_fh2
390 #define fh3     fh_data->sfs_fh_un.f_fh3
391 #define file_name       fh_data->file_name
392 } sfs_fh_type;
393
394 #define fh_size(fhptr)  (nfs_version == NFS_VERSION ? \
395                                                 (fhptr)->attributes2.size : \
396                                                 (fhptr)->attributes3.size._p._l)
397
398 #define fh_uid(fhptr)   (nfs_version == NFS_VERSION ? \
399                                 (uint32_t)((fhptr)->attributes2.uid) : \
400                                 (uint32_t)((fhptr)->attributes3.uid))
401
402 #define fh_gid(fhptr)   (nfs_version == NFS_VERSION ? \
403                                 (uint32_t)((fhptr)->attributes2.gid) : \
404                                 (uint32_t)((fhptr)->attributes3.gid))
405
406 #define fh_mode(fhptr)  (nfs_version == NFS_VERSION ? \
407                                 (uint32_t)((fhptr)->attributes2.mode) : \
408                                 (uint32_t)((fhptr)->attributes3.mode))
409
410 #define fh_isdir(fhptr) (nfs_version == NFS_VERSION ? \
411                                 ((fhptr)->attributes2.type == NFDIR) : \
412                                 ((fhptr)->attributes3.type == NF3DIR))
413
414 #define fh_isfile(fhptr) (nfs_version == NFS_VERSION ? \
415                                 ((fhptr)->attributes2.type == NFREG) : \
416                                 ((fhptr)->attributes3.type == NF3REG))
417
418 /*
419  * One file (dir, or symlink) in the working file set.
420  */
421 typedef struct {
422         int             range;          /* random access range for this file */
423         int             index;          /* points into actual file array */
424 } sfs_work_fh_type;
425
426 typedef struct {
427         sfs_work_fh_type        *entries;          /* array of working files */
428         int                     access_group_size; /* # files in a group */
429         int                     access_group_cnt;  /* # groups in workset */
430         int                     max_range;         /* access range of workset */
431 } sfs_work_set_type;
432
433
434
435 /*
436  * SFS file size distribution structures
437  */
438 typedef struct {
439         int             pcnt;           /* percentile */
440         int             bufs;           /* Block_size KB xfers */
441         int             frags;          /* boolean - is a frag present */
442 } sfs_io_op_dist_type;
443
444 typedef struct {
445         sfs_io_op_dist_type     *read;          /* read size table */
446         sfs_io_op_dist_type     *write;         /* write size table */
447         int                     max_bufs;       /* max # of Block_size xfers */
448         double          avg_ops_per_read_req;   /* avg read ops/req */
449         double          avg_ops_per_write_req;  /* avg write ops/req */
450 } sfs_io_dist_type;
451
452 typedef struct {
453         int             pcnt;           /* percentile */
454         int             size;           /* file size in KB */
455 } sfs_io_file_size_dist;
456
457
458 /* sfs child processes synchronization logfile */
459 #define CHILD_SYNC_LOG  "/tmp/sfs_log"
460 #define SFS_PNT_PID     "/tmp/sfs_pnt_pid"
461 #define SFS_PRM_PID     "/tmp/sfs_prm_pid"
462 #define SFS_SYNCD_PID   "/tmp/sfs_syncd_pid"
463
464 /*
465  * Values for invalid runs
466  */
467 #define INVALID_UNKNOWN         1       /* Old value reserved as unknown */
468 #define INVALID_IODIST          2
469 #define INVALID_MIX             3
470 #define INVALID_RUNTIME         4
471 #define INVALID_ACCESS          5
472 #define INVALID_APPEND          6
473 #define INVALID_KB              7
474 #define INVALID_NDIRS           8
475 #define INVALID_FSS             9
476 #define INVALID_BIODREAD        10
477 #define INVALID_NSYMLINKS       11
478 #define INVALID_BIODWRITE       12
479 #define INVALID_WARMUP          13
480 #define INVALID_GOODCALLS       14
481 #define INVALID_FAILEDRPC       15
482 #define INVALID_NOTMIX          16
483 #define INVALID_MAX             (INVALID_NOTMIX + 1)
484
485 /*
486  * External variable declarations
487  */
488 extern int              Access_percent;
489 extern int              Append_percent;
490 extern int              Base_fss_bytes;
491 extern int              Biod_max_outstanding_reads;
492 extern int              Biod_max_outstanding_writes;
493 extern int              Bytes_per_block;
494 extern int              Child_num;
495 extern int              Client_num;
496 extern sfs_fh_type      *Cur_file_ptr;
497 extern char             Cur_filename[];
498 extern gid_t            Cur_gid;
499 extern struct ladtime   Cur_time;
500 extern uid_t            Cur_uid;
501 extern sfs_phase_type   Current_test_phase;
502 extern int              Debug_level;
503 extern sfs_io_file_size_dist Default_file_size_dist[];
504 extern sfs_fh_type      *Dirs;
505 extern uint32_t         Dump_count;
506 extern int              dump_create_existing_file;
507 extern int              Dump_data;
508 extern uint32_t         Dump_length;
509 extern uint32_t         Dump_offset;
510 extern int              dump_truncate_op;
511 extern sfs_fh_type      Export_dir;
512 extern char             Filespec[];
513 extern char             Dirspec[];
514 extern char             Symspec[];
515 extern int              avg_bytes_per_file;
516 extern int              files_per_megabyte;
517 extern int              Fss_delta_percent;
518 extern int              Interactive;
519 extern sfs_io_dist_type * Io_dist_ptr;
520 extern sfs_fh_type      *Io_files;
521 extern int              Kb_per_block;
522 extern char *           sfs_Myname;
523 extern int              Least_fss_bytes;
524 extern int              Limit_fss_bytes;
525 extern int              Cur_fss_bytes;
526 extern int              Total_fss_bytes;
527 extern int              Log_fd;
528 extern char             Logname[];
529 extern int              Most_fss_bytes;
530 extern int              Msec_per_period;
531 extern CLIENT *         NFS_client;
532 extern CLIENT *         NFS_client_recv;
533 extern struct timeval   *Nfs_timers;
534 extern struct timeval   Nfs_udp_timers[];
535 extern struct timeval   Nfs_tcp_timers[];
536 extern int              nfs_version;
537 extern sfs_fh_type      *Non_io_files;
538 extern int              Num_dirs;
539 extern int              Num_dir_files;
540 extern int              Num_failed_lookup;
541 extern int              Num_io_files;
542 extern int              Num_non_io_files;
543 extern int              Num_symlinks;
544 extern int              Num_symlink_files;
545 extern int              Num_working_dirs;
546 extern int              Num_working_io_files;
547 extern int              Num_working_non_io_files;
548 extern int              Num_working_symlinks;
549 extern sfs_op_type      *Ops;
550 extern int              Populate_only;
551 extern char *           Prime_client;
552 extern uid_t            Real_uid;
553 extern int              Runtime;
554 extern struct ladtime   Starttime;
555 extern int              start_run_phase;
556 extern sfs_fh_type      *Symlinks;
557 extern int              Tcp;
558 extern int              Testop;
559 extern int              Files_per_dir;
560 extern int              Tot_client_num_io_files;
561 extern int              Tot_client_num_non_io_files;
562 extern int              Tot_client_num_symlinks;
563 extern int              Timed_run;
564 extern int              Validate;
565 extern int              Warmuptime;
566 extern char             *invalid_str[];
567 extern char             lad_hostname[];
568
569
570 /*
571  * External function declarations
572  */
573 extern int      biod_init(int, int);
574 extern void     biod_term(void);
575 extern void     biod_turn_on(void);
576 extern int      check_access(struct stat *);
577 extern int      check_fh_access(sfs_fh_type *);
578 extern void     child(int, int, float, int, char **);
579 extern void     generic_catcher(int);
580 extern int      generic_kill(int, int);
581 extern void     init_counters(void);
582 extern void     init_fileinfo(void);
583 extern void     init_mount_point(int, char *, CLIENT *);
584 extern void     init_ops(void);
585 extern char *   init_write_buffer(void);
586 extern CLIENT * lad_getmnt_hand(char *);
587 extern CLIENT * lad_clnt_create(int, struct hostent *, uint32_t,
588                         uint32_t, int, struct timeval *);
589 extern char *   lad_timestamp(void);
590 extern int      set_debug_level(char *s);
591 extern void     sfs_alarm(int);
592 extern void     sfs_cleanup(int);
593 extern void     sfs_elapsedtime(sfs_op_type *, struct ladtime *,
594                                 struct ladtime *);
595 extern void     sfs_gettime(struct ladtime  *);
596 extern int32_t  sfs_random(void);
597 extern void     sfs_srandom(int);
598 extern int      init_rand_range(int);
599 extern int      rand_range(int);
600 extern void     sfs_startup(int);
601 extern void     sfs_stop(int);
602 extern void     log_dump(struct ladtime *, struct ladtime *, int);
603 extern void     parent(int, int, char *, char *);
604 extern void     print_dump(int, int);
605 extern sfs_fh_type *
606                 randfh(int, int, uint_t, sfs_state_type, sfs_file_type);
607 extern int      msec_sleep(int);
608 extern void     Validate_ops(int, char **);
609
610 /* Reliable RPC functions for initialization */
611 extern int      lad_lookup(sfs_fh_type *, char *);
612 extern int      lad_remove(sfs_fh_type *, char *);
613 extern int      lad_rmdir(sfs_fh_type *, char *);
614 extern int      lad_symlink(sfs_fh_type *, char *, char *);
615 extern int      lad_mkdir(sfs_fh_type *, char *);
616 extern int      lad_write(sfs_fh_type *, int32_t, int32_t);
617 extern int      lad_create(sfs_fh_type *, char *);
618 extern int      lad_truncate(sfs_fh_type *, int32_t);
619
620 /* RFS: moved the definition from sfs_c_bio.c to here because it is used in 
621  * sfs_c_chd.c in the new code, information associated with outstanding requests
622  */
623 struct biod_req {
624     uint32_t            xid;            /* RPC transmission ID  */
625     bool_t              in_use;         /* Indicates if the entry is in use */
626         int     dep_tab_index;                  /* corresponding index in dep_tab */
627     unsigned int        count;          /* Count saved for Dump routines */
628     unsigned int        offset;         /* Offset saved for Dump routines */
629     struct ladtime      start;          /* Time RPC call was made */
630     struct ladtime      stop;           /* Time RPC reply was received */
631     struct ladtime      timeout;        /* Time RPC call will time out */
632 };
633
634 #endif /* sfs_def.h */