From: adilger Date: Tue, 19 Aug 2003 22:19:25 +0000 (+0000) Subject: Add truncate-to-zero to multiop commands. X-Git-Tag: v1_7_0_51~2^7~656 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=2897761e12d5dacb69b8e49961b19ff483852453;p=fs%2Flustre-release.git Add truncate-to-zero to multiop commands. --- diff --git a/lustre/tests/multiop.c b/lustre/tests/multiop.c index d8fec95..d02c3e3 100755 --- a/lustre/tests/multiop.c +++ b/lustre/tests/multiop.c @@ -25,6 +25,7 @@ char usage[] = " s stat\n" " S fstat\n" " t fchmod\n" +" T ftruncate to zero\n" " w write\n" " z seek to zero\n"; @@ -96,12 +97,18 @@ int main(int argc, char **argv) exit(1); } break; - case 't': + case 't': if (fchmod(fd, 0) == -1) { perror("fchmod"); exit(1); } break; + case 'T': + if (ftruncate(fd, 0) == -1) { + perror("ftruncate"); + exit(1); + } + break; case 'u': if (unlink(fname) == -1) { perror("unlink"); @@ -126,6 +133,6 @@ int main(int argc, char **argv) exit(1); } } - + return 0; }