]>
git.proxmox.com Git - ceph.git/blob - ceph/src/test/fs/test_trim_caps.cc
1 #define _FILE_OFFSET_BITS 64
13 #include <include/cephfs/libcephfs.h>
15 int main(int argc
, char *argv
[])
19 int rc
= pipe(pipefd
);
29 struct ceph_mount_info
*cmount
= NULL
;
31 ceph_create(&cmount
, "admin");
32 ceph_conf_read_file(cmount
, NULL
);
34 int ret
= ceph_mount(cmount
, NULL
);
38 ret
= read(pipefd
[0], &buf
, 1);
41 ret
= ceph_rename(cmount
, "1", "3");
44 ret
= ceph_rename(cmount
, "2", "1");
48 printf("child exits\n");
50 ret
= ceph_mkdirs(cmount
, "1/2", 0755);
53 struct ceph_statx stx
;
54 ret
= ceph_statx(cmount
, "1", &stx
, 0, 0);
56 uint64_t orig_ino
= stx
.stx_ino
;
59 ret
= ceph_mkdir(cmount
, "2", 0755);
62 ret
= write(pipefd
[1], &buf
, 1);
66 ret
= waitpid(pid
, &wstatus
, 0);
70 // make origin '1' no parent dentry
71 ret
= ceph_statx(cmount
, "1", &stx
, 0, 0);
73 assert(orig_ino
!= stx
.stx_ino
);
75 // move root inode's cap_item to tail of session->caps
76 ret
= ceph_statx(cmount
, ".", &stx
, 0, 0);
79 printf("waiting for crash\n");