Files
apfstests/src/iopat.c
T
Dave Chinner c432589da3 src/: spdx license conversion
Mostly scripted like all the others, manually added tags to
Makefile, nsexec.c and t_mmap_writev.c. Manually touched up
open_by_handle.c and t_encrypted_d_revalidate.c post script.

Notes for future reference:
- src/log-writes/ code has no explicit copyright or license tags,
  nor does the upstream repository, hence license is unknown.
  Need Josef to clarify the license and send a patch adding SPDX
  tags to those files.

- src/perf code has no explicit copyright or license tags, but it
  was code submitted explictly for fstests so it is assumed to be
  GPLv2.0 and tagged as such. If this is incorrect, Josef will need
  to clarify copyright and the license and send patches to correct
  it.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
2018-06-22 10:38:07 +08:00

51 lines
870 B
C

// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (c) 2000-2003 Silicon Graphics, Inc.
* All Rights Reserved.
*/
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <xfs/xfs.h>
struct xfs_flock64 f;
int main(int argc, char **argv)
{
int fd, i;
int64_t x[131072];
for (i = 0; i < 131072; i++) {
x[i] = -1;
}
fd = open(argv[1], O_RDWR | O_CREAT, 0644);
#ifdef WRITE
f.l_whence = 0;
f.l_start = 0;
f.l_len = 1048576;
xfsctl (argv[1], fd, XFS_IOC_RESVSP, &f);
for (i = 0; i < 131072; i++) {
x[i] = i;
}
write(fd, &x, 1048576);
#endif
#ifdef READ
read(fd, &x, 1048576);
for (i = 0; i < 131072; i++) {
if (x[i] != i) {
printf("error: %d %d %lld\n", i ,8 * i, (long long)x[i]);
exit(1);
}
}
#endif
close(fd);
exit(0);
}