generic: verify ciphertext of IV_INO_LBLK_32 encryption policies
[xfstests-dev.git] / src / t_holes.c
1 // SPDX-License-Identifier: GPL-2.0
2 /*
3  * Copyright (c) 2010 Silicon Graphics, Inc.  All Rights Reserved.
4  */
5 #include <stdio.h>
6 #include <stdlib.h>
7 #include <unistd.h>
8 #include <fcntl.h>
9 #include <sys/types.h>
10
11 int main(int argc, char **argv)
12 {
13         int buf[1024];
14         int fd, i, j;
15
16         fd = open(argv[1], O_RDWR|O_CREAT, 0666);
17         for (i = 1; i < 9100; i++) {
18                 for (j = 0; j < 1024; j++)
19                         buf[j]  = i | i << 5;
20
21                 if (write(fd,buf,253*4*sizeof(int))!= 253*4*sizeof(int)) {
22                         printf("Write did not return correct amount\n");
23                         exit(EXIT_FAILURE);
24                 }
25
26                 if ((i % 9) == 0 && i < 9001)
27                         lseek(fd, 4096 * 110,SEEK_CUR);
28         }
29
30         close(fd);
31         return 0;
32 }