Fix some bugs when testing opensds ansible
[stor4nfv.git] / src / ceph / src / test / old / test_setlayout.c
1 #define __USE_GNU 1
2 #include <fcntl.h>
3 #include <netinet/in.h>
4 #include <linux/types.h>
5 #include "include/ceph_fs.h"
6 #include <stdlib.h>
7 #include <stdio.h>
8 #include <string.h>
9
10 #include "kernel/ioctl.h"
11
12
13 main() {
14         struct ceph_file_layout l;
15         int fd = open("foo.txt", O_RDONLY);
16         int r = ioctl(fd, CEPH_IOC_GET_LAYOUT, &l, sizeof(l));
17         printf("get = %d\n", r);
18
19         l.fl_stripe_unit = 65536;
20         l.fl_object_size = 65536;
21         
22         r = ioctl(fd, CEPH_IOC_SET_LAYOUT, &l, sizeof(l));
23         printf("set = %d\n", r);
24 }