1 # cython: embedsignature=True
3 from libc.stdint cimport *
4 from types cimport timespec
8 cdef struct statx "ceph_statx":
27 cdef struct ceph_mount_info:
30 cdef struct ceph_dir_result:
33 cdef struct snap_metadata:
37 cdef struct snap_info:
39 size_t nr_snap_metadata
40 snap_metadata *snap_metadata
42 cdef struct ceph_snapdiff_info:
45 cdef struct ceph_snapdiff_entry_t:
48 ctypedef void* rados_t
50 const char *ceph_version(int *major, int *minor, int *patch):
53 int ceph_create(ceph_mount_info **cmount, const char * const id):
55 int ceph_create_from_rados(ceph_mount_info **cmount, rados_t cluster):
57 int ceph_init(ceph_mount_info *cmount):
59 void ceph_shutdown(ceph_mount_info *cmount):
62 int ceph_getaddrs(ceph_mount_info* cmount, char** addrs):
64 int64_t ceph_get_fs_cid(ceph_mount_info *cmount):
66 int ceph_conf_read_file(ceph_mount_info *cmount, const char *path_list):
68 int ceph_conf_parse_argv(ceph_mount_info *cmount, int argc, const char **argv):
70 int ceph_conf_get(ceph_mount_info *cmount, const char *option, char *buf, size_t len):
72 int ceph_conf_set(ceph_mount_info *cmount, const char *option, const char *value):
74 int ceph_set_mount_timeout(ceph_mount_info *cmount, uint32_t timeout):
77 int ceph_mount(ceph_mount_info *cmount, const char *root):
79 int ceph_select_filesystem(ceph_mount_info *cmount, const char *fs_name):
81 int ceph_unmount(ceph_mount_info *cmount):
83 int ceph_abort_conn(ceph_mount_info *cmount):
85 uint64_t ceph_get_instance_id(ceph_mount_info *cmount):
87 int ceph_fstatx(ceph_mount_info *cmount, int fd, statx *stx, unsigned want, unsigned flags):
89 int ceph_statx(ceph_mount_info *cmount, const char *path, statx *stx, unsigned want, unsigned flags):
91 int ceph_statfs(ceph_mount_info *cmount, const char *path, statvfs *stbuf):
94 int ceph_setattrx(ceph_mount_info *cmount, const char *relpath, statx *stx, int mask, int flags):
96 int ceph_fsetattrx(ceph_mount_info *cmount, int fd, statx *stx, int mask):
98 int ceph_mds_command(ceph_mount_info *cmount, const char *mds_spec, const char **cmd, size_t cmdlen,
99 const char *inbuf, size_t inbuflen, char **outbuf, size_t *outbuflen,
100 char **outs, size_t *outslen):
102 int ceph_rename(ceph_mount_info *cmount, const char *from_, const char *to):
104 int ceph_link(ceph_mount_info *cmount, const char *existing, const char *newname):
106 int ceph_unlink(ceph_mount_info *cmount, const char *path):
108 int ceph_symlink(ceph_mount_info *cmount, const char *existing, const char *newname):
110 int ceph_readlink(ceph_mount_info *cmount, const char *path, char *buf, int64_t size):
112 int ceph_setxattr(ceph_mount_info *cmount, const char *path, const char *name,
113 const void *value, size_t size, int flags):
115 int ceph_fsetxattr(ceph_mount_info *cmount, int fd, const char *name,
116 const void *value, size_t size, int flags):
118 int ceph_lsetxattr(ceph_mount_info *cmount, const char *path, const char *name,
119 const void *value, size_t size, int flags):
121 int ceph_getxattr(ceph_mount_info *cmount, const char *path, const char *name,
122 void *value, size_t size):
124 int ceph_fgetxattr(ceph_mount_info *cmount, int fd, const char *name,
125 void *value, size_t size):
127 int ceph_lgetxattr(ceph_mount_info *cmount, const char *path, const char *name,
128 void *value, size_t size):
130 int ceph_removexattr(ceph_mount_info *cmount, const char *path, const char *name):
132 int ceph_fremovexattr(ceph_mount_info *cmount, int fd, const char *name):
134 int ceph_lremovexattr(ceph_mount_info *cmount, const char *path, const char *name):
136 int ceph_listxattr(ceph_mount_info *cmount, const char *path, char *list, size_t size):
138 int ceph_flistxattr(ceph_mount_info *cmount, int fd, char *list, size_t size):
140 int ceph_llistxattr(ceph_mount_info *cmount, const char *path, char *list, size_t size):
142 int ceph_write(ceph_mount_info *cmount, int fd, const char *buf, int64_t size, int64_t offset):
144 int ceph_pwritev(ceph_mount_info *cmount, int fd, iovec *iov, int iovcnt, int64_t offset):
146 int ceph_read(ceph_mount_info *cmount, int fd, char *buf, int64_t size, int64_t offset):
148 int ceph_preadv(ceph_mount_info *cmount, int fd, iovec *iov, int iovcnt, int64_t offset):
150 int ceph_flock(ceph_mount_info *cmount, int fd, int operation, uint64_t owner):
152 int ceph_mknod(ceph_mount_info *cmount, const char *path, mode_t mode, dev_t rdev):
154 int ceph_close(ceph_mount_info *cmount, int fd):
156 int ceph_open(ceph_mount_info *cmount, const char *path, int flags, mode_t mode):
158 int ceph_mkdir(ceph_mount_info *cmount, const char *path, mode_t mode):
160 int ceph_mksnap(ceph_mount_info *cmount, const char *path, const char *name, mode_t mode, snap_metadata *snap_metadata, size_t nr_snap_metadata):
162 int ceph_rmsnap(ceph_mount_info *cmount, const char *path, const char *name):
164 int ceph_get_snap_info(ceph_mount_info *cmount, const char *path, snap_info *snap_info):
166 void ceph_free_snap_info_buffer(snap_info *snap_info):
168 int ceph_mkdirs(ceph_mount_info *cmount, const char *path, mode_t mode):
170 int ceph_closedir(ceph_mount_info *cmount, ceph_dir_result *dirp):
172 int ceph_opendir(ceph_mount_info *cmount, const char *name, ceph_dir_result **dirpp):
174 void ceph_rewinddir(ceph_mount_info *cmount, ceph_dir_result *dirp):
176 int64_t ceph_telldir(ceph_mount_info *cmount, ceph_dir_result *dirp):
178 void ceph_seekdir(ceph_mount_info *cmount, ceph_dir_result *dirp, int64_t offset):
180 int ceph_chdir(ceph_mount_info *cmount, const char *path):
182 dirent * ceph_readdir(ceph_mount_info *cmount, ceph_dir_result *dirp):
184 int ceph_open_snapdiff(ceph_mount_info *cmount, const char *root_path, const char *rel_path, const char *snap1path, const char *snap2root, ceph_snapdiff_info *out):
186 int ceph_readdir_snapdiff(ceph_snapdiff_info *snapdiff, ceph_snapdiff_entry_t *out):
188 int ceph_close_snapdiff(ceph_snapdiff_info *snapdiff):
190 int ceph_rmdir(ceph_mount_info *cmount, const char *path):
192 const char* ceph_getcwd(ceph_mount_info *cmount):
194 int ceph_sync_fs(ceph_mount_info *cmount):
196 int ceph_fsync(ceph_mount_info *cmount, int fd, int syncdataonly):
198 int ceph_lazyio(ceph_mount_info *cmount, int fd, int enable):
200 int ceph_lazyio_propagate(ceph_mount_info *cmount, int fd, int64_t offset, size_t count):
202 int ceph_lazyio_synchronize(ceph_mount_info *cmount, int fd, int64_t offset, size_t count):
204 int ceph_fallocate(ceph_mount_info *cmount, int fd, int mode, int64_t offset, int64_t length):
206 int ceph_chmod(ceph_mount_info *cmount, const char *path, mode_t mode):
208 int ceph_lchmod(ceph_mount_info *cmount, const char *path, mode_t mode):
210 int ceph_fchmod(ceph_mount_info *cmount, int fd, mode_t mode):
212 int ceph_chown(ceph_mount_info *cmount, const char *path, int uid, int gid):
214 int ceph_lchown(ceph_mount_info *cmount, const char *path, int uid, int gid):
216 int ceph_fchown(ceph_mount_info *cmount, int fd, int uid, int gid):
218 int64_t ceph_lseek(ceph_mount_info *cmount, int fd, int64_t offset, int whence):
220 void ceph_buffer_free(char *buf):
222 mode_t ceph_umask(ceph_mount_info *cmount, mode_t mode):
224 int ceph_utime(ceph_mount_info *cmount, const char *path, utimbuf *buf):
226 int ceph_futime(ceph_mount_info *cmount, int fd, utimbuf *buf):
228 int ceph_utimes(ceph_mount_info *cmount, const char *path, timeval times[2]):
230 int ceph_lutimes(ceph_mount_info *cmount, const char *path, timeval times[2]):
232 int ceph_futimes(ceph_mount_info *cmount, int fd, timeval times[2]):
234 int ceph_futimens(ceph_mount_info *cmount, int fd, timespec times[2]):
236 int ceph_get_file_replication(ceph_mount_info *cmount, int fh):
238 int ceph_get_path_replication(ceph_mount_info *cmount, const char *path):
240 int ceph_get_pool_id(ceph_mount_info *cmount, const char *pool_name):
242 int ceph_get_pool_replication(ceph_mount_info *cmount, int pool_id):
244 int ceph_debug_get_fd_caps(ceph_mount_info *cmount, int fd):
246 int ceph_debug_get_file_caps(ceph_mount_info *cmount, const char *path):
248 uint32_t ceph_get_cap_return_timeout(ceph_mount_info *cmount):
250 void ceph_set_uuid(ceph_mount_info *cmount, const char *uuid):
252 void ceph_set_session_timeout(ceph_mount_info *cmount, unsigned timeout):
254 int ceph_get_file_layout(ceph_mount_info *cmount, int fh, int *stripe_unit, int *stripe_count, int *object_size, int *pg_pool):
256 int ceph_get_file_pool_name(ceph_mount_info *cmount, int fh, char *buf, size_t buflen):
258 int ceph_get_default_data_pool_name(ceph_mount_info *cmount, char *buf, size_t buflen):