summaryrefslogtreecommitdiffstats
path: root/src/test/old/test_setlayout.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-21 11:54:28 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-21 11:54:28 +0000
commite6918187568dbd01842d8d1d2c808ce16a894239 (patch)
tree64f88b554b444a49f656b6c656111a145cbbaa28 /src/test/old/test_setlayout.c
parentInitial commit. (diff)
downloadceph-e6918187568dbd01842d8d1d2c808ce16a894239.tar.xz
ceph-e6918187568dbd01842d8d1d2c808ce16a894239.zip
Adding upstream version 18.2.2.upstream/18.2.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/old/test_setlayout.c')
-rw-r--r--src/test/old/test_setlayout.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/test/old/test_setlayout.c b/src/test/old/test_setlayout.c
new file mode 100644
index 000000000..d0ad8954e
--- /dev/null
+++ b/src/test/old/test_setlayout.c
@@ -0,0 +1,24 @@
+#define __USE_GNU 1
+#include <fcntl.h>
+#include <netinet/in.h>
+#include <linux/types.h>
+#include "include/ceph_fs.h"
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "kernel/ioctl.h"
+
+
+main() {
+ struct ceph_file_layout l;
+ int fd = open("foo.txt", O_RDONLY);
+ int r = ioctl(fd, CEPH_IOC_GET_LAYOUT, &l, sizeof(l));
+ printf("get = %d\n", r);
+
+ l.fl_stripe_unit = 65536;
+ l.fl_object_size = 65536;
+
+ r = ioctl(fd, CEPH_IOC_SET_LAYOUT, &l, sizeof(l));
+ printf("set = %d\n", r);
+}