Lines Matching +full:lite +full:- +full:on
2 * Copyright (c) 1998-2001 Apple Computer, Inc. All rights reserved.
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
27 * Rewrite and enhancements 1998-2001 Conrad Minshall -- conrad@mac.com
31 * Small changes to work under Linux -- davej@suse.de
35 * Checks for mmap last-page zero fill.
37 * Updated license to APSL 2.0, 2004/7/27 - Jordan Hubbard
64 #define NUMPRINTCOLUMNS 32 /* # columns of data to print on each line */
108 long simulatedopcount = 0; /* -b flag */
109 int closeprob = 0; /* -c flag */
110 int invlprob = 0; /* -i flag */
111 int debug = 0; /* -d flag */
112 long debugstart = 0; /* -D flag */
113 off_t maxfilelen = 256 * 1024; /* -l flag */
114 int sizechecks = 1; /* -n flag disables them */
115 int maxoplen = 64 * 1024; /* -o flag */
116 int quiet = 0; /* -q flag */
117 unsigned long progressinterval = 0; /* -p flag */
118 int readbdy = 1; /* -r flag */
119 int style = 0; /* -s flag */
120 int truncbdy = 1; /* -t flag */
121 int writebdy = 1; /* -w flag */
122 long monitorstart = -1; /* -m flag */
123 long monitorend = -1; /* -m flag */
124 int lite = 0; /* -L flag */ variable
125 long numops = -1; /* -N flag */
126 int randomoplen = 1; /* -O flag disables it */
127 int seed = 1; /* -S flag */
128 int mapped_writes = 1; /* -W flag disables */
129 int mapped_reads = 1; /* -R flag disables it */
130 int mapped_msync = 1; /* -U flag disables */
133 int badoff = -1;
167 le->operation = operation; in do_log4()
168 le->args[0] = arg0; in do_log4()
169 le->args[1] = arg1; in do_log4()
170 le->args[2] = arg2; in do_log4()
205 for ( ; count > 0; count--) { in logdump()
208 if (lp->operation == OP_CLOSEOPEN || in logdump()
209 lp->operation == OP_INVALIDATE) { in logdump()
210 switch (lp->operation) { in logdump()
225 switch (lp->operation) { in logdump()
228 lp->args[0], lp->args[0] + lp->args[1] - 1, in logdump()
229 lp->args[1]); in logdump()
230 if (badoff >= lp->args[0] && badoff < in logdump()
231 lp->args[0] + lp->args[1]) in logdump()
236 lp->args[0], lp->args[0] + lp->args[1] - 1, in logdump()
237 lp->args[1]); in logdump()
238 if (badoff >= lp->args[0] && badoff < in logdump()
239 lp->args[0] + lp->args[1]) in logdump()
244 lp->args[0], lp->args[0] + lp->args[1] - 1, in logdump()
245 lp->args[1]); in logdump()
246 if (badoff >= lp->args[0] && in logdump()
247 badoff < lp->args[0] + lp->args[1]) in logdump()
252 int offset = lp->args[0]; in logdump()
253 int len = lp->args[1]; in logdump()
254 int oldlen = lp->args[2]; in logdump()
257 offset, offset + len - 1, in logdump()
269 down = lp->args[0] < lp->args[1]; in logdump()
271 down ? "DOWN" : "UP", lp->args[1], lp->args[0]); in logdump()
272 if (badoff >= lp->args[!down] && in logdump()
273 badoff < lp->args[!!down]) in logdump()
281 lp->operation); in logdump()
305 if (lite) { in save_buffer()
307 if (size_by_seek == (off_t)-1) in save_buffer()
317 if (ret == (off_t)-1) in save_buffer()
322 if (byteswritten == -1) in save_buffer()
381 size--; in check_buffers()
404 statbuf.st_size = -1; in check_size()
426 prt("no extend on truncate! not posix!\n"); in check_trunc_hack()
439 offset -= offset % readbdy; in doread()
461 (monitorstart == -1 || in doread()
463 (monitorend == -1 || offset <= monitorend)))))) in doread()
465 offset, offset + size - 1, size); in doread()
467 if (ret == (off_t)-1) { in doread()
473 if (iret == -1) in doread()
503 prt("Mapped %s: non-zero data past EOF (0x%llx) page offset 0x%x is 0x%04x\n", in check_eofpage()
504 s, file_size - 1, should_be_zero & page_mask, in check_eofpage()
518 offset -= offset % readbdy; in domapread()
540 (monitorstart == -1 || in domapread()
542 (monitorend == -1 || offset <= monitorend)))))) in domapread()
544 offset, offset + size - 1, size); in domapread()
550 (off_t)(offset - pg_offset))) == (char *)-1) { in domapread()
570 while (size--) { in gendata()
585 offset -= offset % writebdy; in dowrite()
598 memset(good_buf + file_size, '\0', offset - file_size); in dowrite()
600 if (lite) { in dowrite()
601 warn("Lite file size bug in fsx!"); in dowrite()
612 (monitorstart == -1 || in dowrite()
614 (monitorend == -1 || offset <= monitorend)))))) in dowrite()
616 offset, offset + size - 1, size); in dowrite()
618 if (ret == (off_t)-1) { in dowrite()
624 if (iret == -1) in dowrite()
642 offset -= offset % writebdy; in domapwrite()
656 memset(good_buf + file_size, '\0', offset - file_size); in domapwrite()
658 if (lite) { in domapwrite()
659 warn("Lite file size bug in fsx!"); in domapwrite()
670 (monitorstart == -1 || in domapwrite()
672 (monitorend == -1 || offset <= monitorend)))))) in domapwrite()
674 offset, offset + size - 1, size); in domapwrite()
677 if (ftruncate(fd, file_size) == -1) { in domapwrite()
687 (off_t)(offset - pg_offset))) == MAP_FAILED) { in domapwrite()
711 size -= size % truncbdy; in dotruncate()
721 memset(good_buf + file_size, '\0', size - file_size); in dotruncate()
728 (debug && (monitorstart == -1 || monitorend == -1 || in dotruncate()
731 if (ftruncate(fd, (off_t)size) == -1) { in dotruncate()
744 if (lseek(fd, (off_t)0, SEEK_SET) == (off_t)-1) { in writefileimage()
750 if (iret == -1) in writefileimage()
757 if (lite ? 0 : ftruncate(fd, file_size) == -1) { in writefileimage()
821 unsigned long op = rv % (3 + !lite + mapped_writes); in test()
851 if (lite ? 0 : op == 3 && style == 0) /* vanilla truncate? */ in test()
856 if (lite ? 0 : op == 3) in test()
860 if (op == 1 || op == (lite ? 3 : 4)) { in test()
863 size = maxfilelen - offset; in test()
874 size = file_size - offset; in test()
906 …-dnqLOW] [-b opnum] [-c Prob] [-l flen] [-m start:end] [-o oplen] [-p progressinterval] [-r readbd… in usage()
907 -b opnum: beginning operation number (default 1)\n\ in usage()
908 -c P: 1 in P chance of file close+open at each op (default infinity)\n\ in usage()
909 -d: debug output for all operations\n\ in usage()
910 -i P: 1 in P chance of calling msync(MS_INVALIDATE) (default infinity)\n\ in usage()
911 -l flen: the upper bound on file size (default 262144, max 2147483647)\n\ in usage()
912 -m startop:endop: monitor (print debug output) specified byte range (default 0:infinity)\n\ in usage()
913 -n: no verifications of file size\n\ in usage()
914 -o oplen: the upper bound on operation size (default 65536)\n\ in usage()
915 -p progressinterval: debug output at specified operation interval\n\ in usage()
916 -q: quieter operation\n\ in usage()
917 -r readbdy: 4096 would make reads page aligned (default 1)\n\ in usage()
918 -s style: 1 gives smaller truncates (default 0)\n\ in usage()
919 -t truncbdy: 4096 would make truncates page aligned (default 1)\n\ in usage()
920 -w writebdy: 4096 would make writes page aligned (default 1)\n\ in usage()
921 -D startingop: debug output starting at specified operation\n\ in usage()
922 -L: fsxLite - no file creations & no file size changes\n\ in usage()
923 -N numops: total # operations to do (default infinity)\n\ in usage()
924 -O: use oplen (see -o flag) for every op (default random)\n\ in usage()
925 -P dirpath: save .fsxlog and .fsxgood files in dirpath (default ./)\n\ in usage()
926 -S seed: for random # generator (default 1) 0 gets timestamp\n\ in usage()
927 -W: mapped write operations DISabled\n\ in usage()
928 -R: mapped read operations DISabled)\n\ in usage()
929 -U: msync after mapped write operations DISabled\n\ in usage()
938 long long ret = -1; in getnum()
947 return (-1); in getnum()
954 return (-1); in getnum()
961 return (-1); in getnum()
968 return (-1); in getnum()
974 return (-1); in getnum()
993 page_mask = page_size - 1; in main()
998 "b:c:di:l:m:no:p:qr:s:t:w:D:LN:OP:RS:UW")) != -1) in main()
1007 simulatedopcount -= 1; in main()
1045 monitorend = -1; /* aka infinity */ in main()
1089 lite = 1; in main()
1137 argc -= optind; in main()
1156 fd = open(fname, O_RDWR|(lite ? 0 : O_CREAT|O_TRUNC), 0666); in main()
1175 if (lite) { in main()
1178 if (file_size == (off_t)-1) { in main()
1184 if (ret == (off_t)-1) { in main()
1197 if (lite) { /* zero entire existing file */ in main()
1202 if (written == -1) { in main()
1204 warn("main: error on write"); in main()
1213 while (numops == -1 || numops--) in main()
1220 prt("All operations completed A-OK!\n"); in main()