# error libceph: must define __USE_FILE_OFFSET64 or readdir results will be corrupted
#endif
-class ceph_mount_info;
+struct ceph_mount_info;
struct ceph_dir_result;
class CephContext;
* pass in NULL, and the id will be the process id of the client.
* @returns 0 on success, negative error code on failure
*/
-int ceph_create(class ceph_mount_info **cmount, const char * const id);
+int ceph_create(struct ceph_mount_info **cmount, const char * const id);
/**
* Create a mount handle from a CephContext, which holds the configuration
* @param conf reuse this pre-existing CephContext config
* @returns 0 on success, negative error code on failure
*/
-int ceph_create_with_context(class ceph_mount_info **cmount, class CephContext *conf);
+int ceph_create_with_context(struct ceph_mount_info **cmount, class CephContext *conf);
/**
* Perform a mount using the path for the root of the mount.
* be "/". Passing in NULL is equivalent to "/".
* @returns 0 on success, negative error code on failure
*/
-int ceph_mount(class ceph_mount_info *cmount, const char *root);
+int ceph_mount(struct ceph_mount_info *cmount, const char *root);
/**
* Unmount a mount handle.
* @param cmount the mount handle
* @return 0 on success, negative error code on failure
*/
-int ceph_unmount(class ceph_mount_info *cmount);
+int ceph_unmount(struct ceph_mount_info *cmount);
/**
* Destroy the mount handle.
* @param cmount the mount handle
* @return 0 on success, negative error code on failure.
*/
-int ceph_release(class ceph_mount_info *cmount);
+int ceph_release(struct ceph_mount_info *cmount);
/**
* Deprecated. Unmount and destroy the ceph mount handle. This should be
*
* @param cmount the mount handle to shutdown
*/
-void ceph_shutdown(class ceph_mount_info *cmount);
+void ceph_shutdown(struct ceph_mount_info *cmount);
/**
* Extract the CephContext from the mount point handle.
* @param cmount the ceph mount handle to get the context from.
* @returns the CephContext associated with the mount handle.
*/
-class CephContext *ceph_get_mount_context(class ceph_mount_info *cmount);
+class CephContext *ceph_get_mount_context(struct ceph_mount_info *cmount);
/*
* Check mount status.
*
* Return non-zero value if mounted. Otherwise, zero.
*/
-int ceph_is_mounted(class ceph_mount_info *cmount);
+int ceph_is_mounted(struct ceph_mount_info *cmount);
/** @} init */
* @param path_list the configuration file path
* @returns 0 on success, negative error code on failure
*/
-int ceph_conf_read_file(class ceph_mount_info *cmount, const char *path_list);
+int ceph_conf_read_file(struct ceph_mount_info *cmount, const char *path_list);
/**
* Parse the command line arguments and load the configuration parameters.
* @param argv the argument list
* @returns 0 on success, negative error code on failure
*/
-int ceph_conf_parse_argv(class ceph_mount_info *cmount, int argc, const char **argv);
+int ceph_conf_parse_argv(struct ceph_mount_info *cmount, int argc, const char **argv);
/**
* Configure the cluster handle based on an environment variable
* @param var name of the environment variable to read
* @returns 0 on success, negative error code on failure
*/
-int ceph_conf_parse_env(class ceph_mount_info *cmount, const char *var);
+int ceph_conf_parse_env(struct ceph_mount_info *cmount, const char *var);
/** Sets a configuration value from a string.
*
*
* @returns 0 on success, negative error code otherwise.
*/
-int ceph_conf_set(class ceph_mount_info *cmount, const char *option, const char *value);
+int ceph_conf_set(struct ceph_mount_info *cmount, const char *option, const char *value);
/**
* Gets the configuration value as a string.
* @param len the length of the buffer.
* @returns the size of the buffer filled in with the value, or negative error code on failure
*/
-int ceph_conf_get(class ceph_mount_info *cmount, const char *option, char *buf, size_t len);
+int ceph_conf_get(struct ceph_mount_info *cmount, const char *option, char *buf, size_t len);
/** @} config */
* @param stbuf the file system statistics filled in by this function.
* @return 0 on success, negative error code otherwise.
*/
-int ceph_statfs(class ceph_mount_info *cmount, const char *path, struct statvfs *stbuf);
+int ceph_statfs(struct ceph_mount_info *cmount, const char *path, struct statvfs *stbuf);
/**
* Synchronize all filesystem data to persistent media.
* @param cmount the ceph mount handle to use for performing the sync_fs.
* @returns 0 on success or negative error code on failure.
*/
-int ceph_sync_fs(class ceph_mount_info *cmount);
+int ceph_sync_fs(struct ceph_mount_info *cmount);
/**
* Get the current working directory.
* @param cmount the ceph mount to get the current working directory for.
* @returns the path to the current working directory
*/
-const char* ceph_getcwd(class ceph_mount_info *cmount);
+const char* ceph_getcwd(struct ceph_mount_info *cmount);
/**
* Change the current working directory.
* @param path the path to the working directory to change into.
* @returns 0 on success, negative error code otherwise.
*/
-int ceph_chdir(class ceph_mount_info *cmount, const char *s);
+int ceph_chdir(struct ceph_mount_info *cmount, const char *s);
/** @} fsops */
* @param dirpp the directory result pointer structure to fill in.
* @returns 0 on success or negative error code otherwise.
*/
-int ceph_opendir(class ceph_mount_info *cmount, const char *name, struct ceph_dir_result **dirpp);
+int ceph_opendir(struct ceph_mount_info *cmount, const char *name, struct ceph_dir_result **dirpp);
/**
* Close the open directory.
* @param dirp the directory result pointer (set by ceph_opendir) to close
* @returns 0 on success or negative error code on failure.
*/
-int ceph_closedir(class ceph_mount_info *cmount, struct ceph_dir_result *dirp);
+int ceph_closedir(struct ceph_mount_info *cmount, struct ceph_dir_result *dirp);
/**
* Get the next entry in an open directory.
* is empty. This pointer should not be freed by the caller, and is only safe to
* access between return and the next call to ceph_readdir or ceph_closedir.
*/
-struct dirent * ceph_readdir(class ceph_mount_info *cmount, struct ceph_dir_result *dirp);
+struct dirent * ceph_readdir(struct ceph_mount_info *cmount, struct ceph_dir_result *dirp);
/**
* A safe version of ceph_readdir, where the directory entry struct is allocated by the caller.
* @returns 1 if the next entry was filled in, 0 if the end of the directory stream was reached,
* and a negative error code on failure.
*/
-int ceph_readdir_r(class ceph_mount_info *cmount, struct ceph_dir_result *dirp, struct dirent *de);
+int ceph_readdir_r(struct ceph_mount_info *cmount, struct ceph_dir_result *dirp, struct dirent *de);
/**
* A safe version of ceph_readdir that also returns the file statistics (readdir+stat).
* @returns 1 if the next entry was filled in, 0 if the end of the directory stream was reached,
* and a negative error code on failure.
*/
-int ceph_readdirplus_r(class ceph_mount_info *cmount, struct ceph_dir_result *dirp, struct dirent *de,
+int ceph_readdirplus_r(struct ceph_mount_info *cmount, struct ceph_dir_result *dirp, struct dirent *de,
struct stat *st, int *stmask);
/**
* @returns the length of the buffer that was filled in, will always be multiples of sizeof(struct dirent), or a
* negative error code. If the buffer is not large enough for a single entry, -ERANGE is returned.
*/
-int ceph_getdents(class ceph_mount_info *cmount, struct ceph_dir_result *dirp, char *name, int buflen);
+int ceph_getdents(struct ceph_mount_info *cmount, struct ceph_dir_result *dirp, char *name, int buflen);
/**
* Gets multiple directory names.
* @returns the length of the buffer filled in with entry names, or a negative error code on failure.
* If the buffer isn't large enough for a single entry, -ERANGE is returned.
*/
-int ceph_getdnames(class ceph_mount_info *cmount, struct ceph_dir_result *dirp, char *name, int buflen);
+int ceph_getdnames(struct ceph_mount_info *cmount, struct ceph_dir_result *dirp, char *name, int buflen);
/**
* Rewind the directory stream to the beginning of the directory.
* @param cmount the ceph mount handle to use for performing the rewinddir.
* @param dirp the directory stream pointer to rewind.
*/
-void ceph_rewinddir(class ceph_mount_info *cmount, struct ceph_dir_result *dirp);
+void ceph_rewinddir(struct ceph_mount_info *cmount, struct ceph_dir_result *dirp);
/**
* Get the current position of a directory stream.
* by ceph_telldir do not have a particular order (cannot be compared with
* inequality).
*/
-loff_t ceph_telldir(class ceph_mount_info *cmount, struct ceph_dir_result *dirp);
+loff_t ceph_telldir(struct ceph_mount_info *cmount, struct ceph_dir_result *dirp);
/**
* Move the directory stream to a position specified by the given offset.
* a value returned by seekdir. Note that this value does not refer to the nth
* entry in a directory, and can not be manipulated with plus or minus.
*/
-void ceph_seekdir(class ceph_mount_info *cmount, struct ceph_dir_result *dirp, loff_t offset);
+void ceph_seekdir(struct ceph_mount_info *cmount, struct ceph_dir_result *dirp, loff_t offset);
/**
* Create a directory.
* @param mode the permissions the directory should have once created.
* @returns 0 on success or a negative return code on error.
*/
-int ceph_mkdir(class ceph_mount_info *cmount, const char *path, mode_t mode);
+int ceph_mkdir(struct ceph_mount_info *cmount, const char *path, mode_t mode);
/**
* Create multiple directories at once.
* @param mode the permissions the directory should have once created.
* @returns 0 on success or a negative return code on error.
*/
-int ceph_mkdirs(class ceph_mount_info *cmount, const char *path, mode_t mode);
+int ceph_mkdirs(struct ceph_mount_info *cmount, const char *path, mode_t mode);
/**
* Remove a directory.
* @param path the path of the directory to remove.
* @returns 0 on success or a negative return code on error.
*/
-int ceph_rmdir(class ceph_mount_info *cmount, const char *path);
+int ceph_rmdir(struct ceph_mount_info *cmount, const char *path);
/** @} dir */
* @param newname the path to the new file/directory to link from.
* @returns 0 on success or a negative return code on error.
*/
-int ceph_link(class ceph_mount_info *cmount, const char *existing, const char *newname);
+int ceph_link(struct ceph_mount_info *cmount, const char *existing, const char *newname);
/**
* Read a symbolic link.
* @param size the length of the buffer
* @returns 0 on success or negative error code on failure
*/
-int ceph_readlink(class ceph_mount_info *cmount, const char *path, char *buf, loff_t size);
+int ceph_readlink(struct ceph_mount_info *cmount, const char *path, char *buf, loff_t size);
/**
* Creates a symbolic link.
* @param newname the path to the new file/directory to link from.
* @returns 0 on success or a negative return code on failure.
*/
-int ceph_symlink(class ceph_mount_info *cmount, const char *existing, const char *newname);
+int ceph_symlink(struct ceph_mount_info *cmount, const char *existing, const char *newname);
/** @} links */
* @param path the path of the file or link to unlink.
* @returns 0 on success or negative error code on failure.
*/
-int ceph_unlink(class ceph_mount_info *cmount, const char *path);
+int ceph_unlink(struct ceph_mount_info *cmount, const char *path);
/**
* Rename a file or directory.
* @param to the new name of the file or directory
* @returns 0 on success or negative error code on failure.
*/
-int ceph_rename(class ceph_mount_info *cmount, const char *from, const char *to);
+int ceph_rename(struct ceph_mount_info *cmount, const char *from, const char *to);
/**
* Get a file's statistics and attributes.
* @param stbuf the stat struct that will be filled in with the file's statistics.
* @returns 0 on success or negative error code on failure.
*/
-int ceph_stat(class ceph_mount_info *cmount, const char *path, struct stat *stbuf);
+int ceph_stat(struct ceph_mount_info *cmount, const char *path, struct stat *stbuf);
/**
* Get a file's statistics and attributes, without following symlinks.
* @param stbuf the stat struct that will be filled in with the file's statistics.
* @returns 0 on success or negative error code on failure.
*/
-int ceph_lstat(class ceph_mount_info *cmount, const char *path, struct stat *stbuf);
+int ceph_lstat(struct ceph_mount_info *cmount, const char *path, struct stat *stbuf);
/**
* Set a file's attributes.
* @param mask a mask of all the stat values that have been set on the stat struct.
* @returns 0 on success or negative error code on failure.
*/
-int ceph_setattr(class ceph_mount_info *cmount, const char *relpath, struct stat *attr, int mask);
+int ceph_setattr(struct ceph_mount_info *cmount, const char *relpath, struct stat *attr, int mask);
/**
* Change the mode bits (permissions) of a file/directory.
* @param mode the new permissions to set.
* @returns 0 on success or a negative error code on failure.
*/
-int ceph_chmod(class ceph_mount_info *cmount, const char *path, mode_t mode);
+int ceph_chmod(struct ceph_mount_info *cmount, const char *path, mode_t mode);
/**
* Change the mode bits (permissions) of an open file.
* @param mode the new permissions to set.
* @returns 0 on success or a negative error code on failure.
*/
-int ceph_fchmod(class ceph_mount_info *cmount, int fd, mode_t mode);
+int ceph_fchmod(struct ceph_mount_info *cmount, int fd, mode_t mode);
/**
* Change the ownership of a file/directory.
* @param gid the group id to set on the file/directory.
* @returns 0 on success or negative error code on failure.
*/
-int ceph_chown(class ceph_mount_info *cmount, const char *path, int uid, int gid);
+int ceph_chown(struct ceph_mount_info *cmount, const char *path, int uid, int gid);
/**
* Change the ownership of a file from an open file descriptor.
* @param gid the group id to set on the file/directory.
* @returns 0 on success or negative error code on failure.
*/
-int ceph_fchown(class ceph_mount_info *cmount, int fd, int uid, int gid);
+int ceph_fchown(struct ceph_mount_info *cmount, int fd, int uid, int gid);
/**
* Change the ownership of a file/directory, don't follow symlinks.
* @param gid the group id to set on the file/directory.
* @returns 0 on success or negative error code on failure.
*/
-int ceph_lchown(class ceph_mount_info *cmount, const char *path, int uid, int gid);
+int ceph_lchown(struct ceph_mount_info *cmount, const char *path, int uid, int gid);
/**
* Change file/directory last access and modification times.
* @param buf holding the access and modification times to set on the file.
* @returns 0 on success or negative error code on failure.
*/
-int ceph_utime(class ceph_mount_info *cmount, const char *path, struct utimbuf *buf);
+int ceph_utime(struct ceph_mount_info *cmount, const char *path, struct utimbuf *buf);
/**
* Truncate the file to the given size. If this operation causes the
* @param size the new size of the file.
* @returns 0 on success or a negative error code on failure.
*/
-int ceph_truncate(class ceph_mount_info *cmount, const char *path, loff_t size);
+int ceph_truncate(struct ceph_mount_info *cmount, const char *path, loff_t size);
/**
* Make a block or character special file.
* it is ignored.
* @returns 0 on success or negative error code on failure.
*/
-int ceph_mknod(class ceph_mount_info *cmount, const char *path, mode_t mode, dev_t rdev);
+int ceph_mknod(struct ceph_mount_info *cmount, const char *path, mode_t mode, dev_t rdev);
/**
* Create and/or open a file.
*
* is specified in the flags.
* @returns a non-negative file descriptor number on success or a negative error code on failure.
*/
-int ceph_open(class ceph_mount_info *cmount, const char *path, int flags, mode_t mode);
+int ceph_open(struct ceph_mount_info *cmount, const char *path, int flags, mode_t mode);
/**
* Create and/or open a file with a specific file layout.
* @param data_pool name of target data pool name (optional, NULL or empty string for default)
* @returns a non-negative file descriptor number on success or a negative error code on failure.
*/
-int ceph_open_layout(class ceph_mount_info *cmount, const char *path, int flags,
+int ceph_open_layout(struct ceph_mount_info *cmount, const char *path, int flags,
mode_t mode, int stripe_unit, int stripe_count, int object_size,
const char *data_pool);
* @param fd the file descriptor referring to the open file.
* @returns 0 on success or a negative error code on failure.
*/
-int ceph_close(class ceph_mount_info *cmount, int fd);
+int ceph_close(struct ceph_mount_info *cmount, int fd);
/**
* Reposition the open file stream based on the given offset.
* SEEK_END: the offset is set to the end of the file plus @ref offset bytes.
* @returns 0 on success or a negative error code on failure.
*/
-loff_t ceph_lseek(class ceph_mount_info *cmount, int fd, loff_t offset, int whence);
+loff_t ceph_lseek(struct ceph_mount_info *cmount, int fd, loff_t offset, int whence);
/**
* Read data from the file.
*
* function reads from the current offset of the file descriptor.
* @returns the number of bytes read into buf, or a negative error code on failure.
*/
-int ceph_read(class ceph_mount_info *cmount, int fd, char *buf, loff_t size, loff_t offset);
+int ceph_read(struct ceph_mount_info *cmount, int fd, char *buf, loff_t size, loff_t offset);
/**
* Write data to a file.
* function writes to the current offset of the file descriptor.
* @returns the number of bytes written, or a negative error code
*/
-int ceph_write(class ceph_mount_info *cmount, int fd, const char *buf, loff_t size,
+int ceph_write(struct ceph_mount_info *cmount, int fd, const char *buf, loff_t size,
loff_t offset);
/**
* @param size the new size of the file
* @returns 0 on success or a negative error code on failure.
*/
-int ceph_ftruncate(class ceph_mount_info *cmount, int fd, loff_t size);
+int ceph_ftruncate(struct ceph_mount_info *cmount, int fd, loff_t size);
/**
* Synchronize an open file to persistent media.
* or just data (1).
* @return 0 on success or a negative error code on failure.
*/
-int ceph_fsync(class ceph_mount_info *cmount, int fd, int syncdataonly);
+int ceph_fsync(struct ceph_mount_info *cmount, int fd, int syncdataonly);
/**
* Preallocate or release disk space for the file for the byte range.
* function.
* @returns 0 on success or a negative error code on failure
*/
-int ceph_fstat(class ceph_mount_info *cmount, int fd, struct stat *stbuf);
+int ceph_fstat(struct ceph_mount_info *cmount, int fd, struct stat *stbuf);
/** @} file */
* @param size the size of the pre-allocated buffer
* @returns the size of the value or a negative error code on failure.
*/
-int ceph_getxattr(class ceph_mount_info *cmount, const char *path, const char *name,
+int ceph_getxattr(struct ceph_mount_info *cmount, const char *path, const char *name,
void *value, size_t size);
/**
* @param size the size of the pre-allocated buffer
* @returns the size of the value or a negative error code on failure.
*/
-int ceph_lgetxattr(class ceph_mount_info *cmount, const char *path, const char *name,
+int ceph_lgetxattr(struct ceph_mount_info *cmount, const char *path, const char *name,
void *value, size_t size);
/**
* @param size the size of the list buffer.
* @returns the size of the resulting list filled in.
*/
-int ceph_listxattr(class ceph_mount_info *cmount, const char *path, char *list, size_t size);
+int ceph_listxattr(struct ceph_mount_info *cmount, const char *path, char *list, size_t size);
/**
* Get the list of extended attribute keys on a file, but do not follow symbolic links.
* @param size the size of the list buffer.
* @returns the size of the resulting list filled in.
*/
-int ceph_llistxattr(class ceph_mount_info *cmount, const char *path, char *list, size_t size);
+int ceph_llistxattr(struct ceph_mount_info *cmount, const char *path, char *list, size_t size);
/**
* Remove an extended attribute from a file.
* @param name the name of the extended attribute to remove.
* @returns 0 on success or a negative error code on failure.
*/
-int ceph_removexattr(class ceph_mount_info *cmount, const char *path, const char *name);
+int ceph_removexattr(struct ceph_mount_info *cmount, const char *path, const char *name);
/**
* Remove the extended attribute from a file, do not follow symbolic links.
* @param name the name of the extended attribute to remove.
* @returns 0 on success or a negative error code on failure.
*/
-int ceph_lremovexattr(class ceph_mount_info *cmount, const char *path, const char *name);
+int ceph_lremovexattr(struct ceph_mount_info *cmount, const char *path, const char *name);
/**
* Set an extended attribute on a file.
* CEPH_XATTR_REPLACE: replace the extended attribute, Must already exist.
* @returns 0 on success or a negative error code on failure.
*/
-int ceph_setxattr(class ceph_mount_info *cmount, const char *path, const char *name,
+int ceph_setxattr(struct ceph_mount_info *cmount, const char *path, const char *name,
const void *value, size_t size, int flags);
/**
* CEPH_XATTR_REPLACE: replace the extended attribute, Must already exist.
* @returns 0 on success or a negative error code on failure.
*/
-int ceph_lsetxattr(class ceph_mount_info *cmount, const char *path, const char *name,
+int ceph_lsetxattr(struct ceph_mount_info *cmount, const char *path, const char *name,
const void *value, size_t size, int flags);
/** @} xattr */
* @param fh the open file descriptor referring to the file to get the striping unit of.
* @returns the striping unit of the file or a negative error code on failure.
*/
-int ceph_get_file_stripe_unit(class ceph_mount_info *cmount, int fh);
+int ceph_get_file_stripe_unit(struct ceph_mount_info *cmount, int fh);
/**
* Get the file striping unit.
* @param path the path of the file/directory get the striping unit of.
* @returns the striping unit of the file or a negative error code on failure.
*/
-int ceph_get_path_stripe_unit(class ceph_mount_info *cmount, const char *path);
+int ceph_get_path_stripe_unit(struct ceph_mount_info *cmount, const char *path);
/**
* Get the file striping count from an open file descriptor.
* @param fh the open file descriptor referring to the file to get the striping count of.
* @returns the striping count of the file or a negative error code on failure.
*/
-int ceph_get_file_stripe_count(class ceph_mount_info *cmount, int fh);
+int ceph_get_file_stripe_count(struct ceph_mount_info *cmount, int fh);
/**
* Get the file striping count.
* @param path the path of the file/directory get the striping count of.
* @returns the striping count of the file or a negative error code on failure.
*/
-int ceph_get_path_stripe_count(class ceph_mount_info *cmount, const char *path);
+int ceph_get_path_stripe_count(struct ceph_mount_info *cmount, const char *path);
/**
* Get the file object size from an open file descriptor.
* @param fh the open file descriptor referring to the file to get the object size of.
* @returns the object size of the file or a negative error code on failure.
*/
-int ceph_get_file_object_size(class ceph_mount_info *cmount, int fh);
+int ceph_get_file_object_size(struct ceph_mount_info *cmount, int fh);
/**
* Get the file object size.
* @param path the path of the file/directory get the object size of.
* @returns the object size of the file or a negative error code on failure.
*/
-int ceph_get_path_object_size(class ceph_mount_info *cmount, const char *path);
+int ceph_get_path_object_size(struct ceph_mount_info *cmount, const char *path);
/**
* Get the file pool information from an open file descriptor.
* @param fh the open file descriptor referring to the file to get the pool information of.
* @returns the ceph pool id that the file is in
*/
-int ceph_get_file_pool(class ceph_mount_info *cmount, int fh);
+int ceph_get_file_pool(struct ceph_mount_info *cmount, int fh);
/**
* Get the file pool information.
* @param path the path of the file/directory get the pool information of.
* @returns the ceph pool id that the file is in
*/
-int ceph_get_path_pool(class ceph_mount_info *cmount, const char *path);
+int ceph_get_path_pool(struct ceph_mount_info *cmount, const char *path);
/**
* Get the name of the pool a opened file is stored in,
* @param buflen size of the buffer
* @returns length in bytes of the pool name, or -ERANGE if the buffer is not large enough.
*/
-int ceph_get_file_pool_name(class ceph_mount_info *cmount, int fh, char *buf, size_t buflen);
+int ceph_get_file_pool_name(struct ceph_mount_info *cmount, int fh, char *buf, size_t buflen);
/**
* get the name of a pool by id
* @param buflen size of the buffer
* @returns length in bytes of the pool name, or -ERANGE if the buffer is not large enough
*/
-int ceph_get_pool_name(class ceph_mount_info *cmount, int pool, char *buf, size_t buflen);
+int ceph_get_pool_name(struct ceph_mount_info *cmount, int pool, char *buf, size_t buflen);
/**
* Get the name of the pool a file is stored in
* @param buflen size of the buffer
* @returns length in bytes of the pool name, or -ERANGE if the buffer is not large enough.
*/
-int ceph_get_path_pool_name(class ceph_mount_info *cmount, const char *path, char *buf, size_t buflen);
+int ceph_get_path_pool_name(struct ceph_mount_info *cmount, const char *path, char *buf, size_t buflen);
/**
* Get the file layout from an open file descriptor.
* @param pg_pool where to store the ceph pool id that the file is in
* @returns 0 on success or a negative error code on failure.
*/
-int ceph_get_file_layout(class ceph_mount_info *cmount, int fh, int *stripe_unit, int *stripe_count, int *object_size, int *pg_pool);
+int ceph_get_file_layout(struct ceph_mount_info *cmount, int fh, int *stripe_unit, int *stripe_count, int *object_size, int *pg_pool);
/**
* Get the file layout.
* @param pg_pool where to store the ceph pool id that the file is in
* @returns 0 on success or a negative error code on failure.
*/
-int ceph_get_path_layout(class ceph_mount_info *cmount, const char *path, int *stripe_unit, int *stripe_count, int *object_size, int *pg_pool);
+int ceph_get_path_layout(struct ceph_mount_info *cmount, const char *path, int *stripe_unit, int *stripe_count, int *object_size, int *pg_pool);
/**
* Get the file replication information from an open file descriptor.
* @param fh the open file descriptor referring to the file to get the replication information of.
* @returns the replication factor of the file.
*/
-int ceph_get_file_replication(class ceph_mount_info *cmount, int fh);
+int ceph_get_file_replication(struct ceph_mount_info *cmount, int fh);
/**
* Get the file replication information.
* @param path the path of the file/directory get the replication information of.
* @returns the replication factor of the file.
*/
-int ceph_get_path_replication(class ceph_mount_info *cmount, const char *path);
+int ceph_get_path_replication(struct ceph_mount_info *cmount, const char *path);
/**
* Get the id of the named pool.
* @param pool_name the name of the pool.
* @returns the pool id, or a negative error code on failure.
*/
-int ceph_get_pool_id(class ceph_mount_info *cmount, const char *pool_name);
+int ceph_get_pool_id(struct ceph_mount_info *cmount, const char *pool_name);
/**
* Get the pool replication factor.
* @param pool_id the pool id to look up
* @returns the replication factor, or a negative error code on failure.
*/
-int ceph_get_pool_replication(class ceph_mount_info *cmount, int pool_id);
+int ceph_get_pool_replication(struct ceph_mount_info *cmount, int pool_id);
/**
* Get the OSD address where the primary copy of a file stripe is located.
* @returns the size of the addressed filled into the @ref addr parameter, or a negative
* error code on failure.
*/
-int ceph_get_file_stripe_address(class ceph_mount_info *cmount, int fd, loff_t offset,
+int ceph_get_file_stripe_address(struct ceph_mount_info *cmount, int fd, loff_t offset,
struct sockaddr_storage *addr, int naddr);
/**
* @returns the number of items stored in the output array, or -ERANGE if the
* array is not large enough.
*/
-int ceph_get_file_extent_osds(class ceph_mount_info *cmount, int fh,
+int ceph_get_file_extent_osds(struct ceph_mount_info *cmount, int fh,
loff_t offset, loff_t *length, int *osds, int nosds);
/**
* @returns the amount of bytes written into the buffer, or -ERANGE if the
* array is not large enough.
*/
-int ceph_get_osd_crush_location(class ceph_mount_info *cmount,
+int ceph_get_osd_crush_location(struct ceph_mount_info *cmount,
int osd, char *path, size_t len);
/**
* @param addr the OSD network address.
* @returns zero on success, other returns a negative error code.
*/
-int ceph_get_osd_addr(class ceph_mount_info *cmount, int osd,
+int ceph_get_osd_addr(struct ceph_mount_info *cmount, int osd,
struct sockaddr_storage *addr);
/**
* @param cmount the ceph mount handle.
* @returns the stripe unit granularity or a negative error code on failure.
*/
-int ceph_get_stripe_unit_granularity(class ceph_mount_info *cmount);
+int ceph_get_stripe_unit_granularity(struct ceph_mount_info *cmount);
/** @} filelayout */
* No longer available. Do not use.
* These functions will return -EOPNOTSUPP.
*/
-int ceph_set_default_file_stripe_unit(class ceph_mount_info *cmount, int stripe);
-int ceph_set_default_file_stripe_count(class ceph_mount_info *cmount, int count);
-int ceph_set_default_object_size(class ceph_mount_info *cmount, int size);
-int ceph_set_default_preferred_pg(class ceph_mount_info *cmount, int osd);
-int ceph_set_default_file_replication(class ceph_mount_info *cmount, int replication);
+int ceph_set_default_file_stripe_unit(struct ceph_mount_info *cmount, int stripe);
+int ceph_set_default_file_stripe_count(struct ceph_mount_info *cmount, int count);
+int ceph_set_default_object_size(struct ceph_mount_info *cmount, int size);
+int ceph_set_default_preferred_pg(struct ceph_mount_info *cmount, int osd);
+int ceph_set_default_file_replication(struct ceph_mount_info *cmount, int replication);
/**
* Read from local replicas when possible.
* for reads.
* @returns 0
*/
-int ceph_localize_reads(class ceph_mount_info *cmount, int val);
+int ceph_localize_reads(struct ceph_mount_info *cmount, int val);
/**
* Get the osd id of the local osd (if any)
* @returns the osd (if any) local to the node where this call is made, otherwise
* -1 is returned.
*/
-int ceph_get_local_osd(class ceph_mount_info *cmount);
+int ceph_get_local_osd(struct ceph_mount_info *cmount);
/** @} default_filelayout */
* @returns the current capabilities issued to this client
* for the open file
*/
-int ceph_debug_get_fd_caps(class ceph_mount_info *cmount, int fd);
+int ceph_debug_get_fd_caps(struct ceph_mount_info *cmount, int fd);
/**
* Get the capabilities currently issued to the client.
* @returns the current capabilities issued to this client
* for the file
*/
-int ceph_debug_get_file_caps(class ceph_mount_info *cmount, const char *path);
+int ceph_debug_get_file_caps(struct ceph_mount_info *cmount, const char *path);
#ifdef __cplusplus
}
#include "msg/Messenger.h"
#include "include/assert.h"
-class ceph_mount_info
+struct ceph_mount_info
{
public:
ceph_mount_info(uint64_t msgr_nonce_, CephContext *cct_)
return VERSION;
}
-extern "C" int ceph_create_with_context(class ceph_mount_info **cmount, CephContext *cct)
+extern "C" int ceph_create_with_context(struct ceph_mount_info **cmount, CephContext *cct)
{
uint64_t nonce = 0;
nonce &= ~0xffff;
nonce |= (uint64_t)getpid();
- *cmount = new class ceph_mount_info(nonce, cct);
+ *cmount = new struct ceph_mount_info(nonce, cct);
return 0;
}
-extern "C" int ceph_create(class ceph_mount_info **cmount, const char * const id)
+extern "C" int ceph_create(struct ceph_mount_info **cmount, const char * const id)
{
CephInitParameters iparams(CEPH_ENTITY_TYPE_CLIENT);
if (id) {
return ceph_create_with_context(cmount, cct);
}
-extern "C" int ceph_unmount(class ceph_mount_info *cmount)
+extern "C" int ceph_unmount(struct ceph_mount_info *cmount)
{
return cmount->unmount();
}
-extern "C" int ceph_release(class ceph_mount_info *cmount)
+extern "C" int ceph_release(struct ceph_mount_info *cmount)
{
if (cmount->is_mounted())
return -EISCONN;
return 0;
}
-extern "C" void ceph_shutdown(class ceph_mount_info *cmount)
+extern "C" void ceph_shutdown(struct ceph_mount_info *cmount)
{
cmount->shutdown();
delete cmount;
}
-extern "C" int ceph_conf_read_file(class ceph_mount_info *cmount, const char *path)
+extern "C" int ceph_conf_read_file(struct ceph_mount_info *cmount, const char *path)
{
return cmount->conf_read_file(path);
}
-extern "C" int ceph_conf_parse_argv(class ceph_mount_info *cmount, int argc,
+extern "C" int ceph_conf_parse_argv(struct ceph_mount_info *cmount, int argc,
const char **argv)
{
return cmount->conf_parse_argv(argc, argv);
}
-extern "C" int ceph_conf_parse_env(class ceph_mount_info *cmount, const char *name)
+extern "C" int ceph_conf_parse_env(struct ceph_mount_info *cmount, const char *name)
{
return cmount->conf_parse_env(name);
}
-extern "C" int ceph_conf_set(class ceph_mount_info *cmount, const char *option,
+extern "C" int ceph_conf_set(struct ceph_mount_info *cmount, const char *option,
const char *value)
{
return cmount->conf_set(option, value);
}
-extern "C" int ceph_conf_get(class ceph_mount_info *cmount, const char *option,
+extern "C" int ceph_conf_get(struct ceph_mount_info *cmount, const char *option,
char *buf, size_t len)
{
if (buf == NULL) {
return cmount->conf_get(option, buf, len);
}
-extern "C" int ceph_mount(class ceph_mount_info *cmount, const char *root)
+extern "C" int ceph_mount(struct ceph_mount_info *cmount, const char *root)
{
std::string mount_root;
if (root)
return cmount->mount(mount_root);
}
-extern "C" int ceph_is_mounted(class ceph_mount_info *cmount)
+extern "C" int ceph_is_mounted(struct ceph_mount_info *cmount)
{
return cmount->is_mounted() ? 1 : 0;
}
-extern "C" int ceph_statfs(class ceph_mount_info *cmount, const char *path,
+extern "C" int ceph_statfs(struct ceph_mount_info *cmount, const char *path,
struct statvfs *stbuf)
{
if (!cmount->is_mounted())
return cmount->get_client()->statfs(path, stbuf);
}
-extern "C" int ceph_get_local_osd(class ceph_mount_info *cmount)
+extern "C" int ceph_get_local_osd(struct ceph_mount_info *cmount)
{
if (!cmount->is_mounted())
return -ENOTCONN;
return cmount->get_client()->get_local_osd();
}
-extern "C" const char* ceph_getcwd(class ceph_mount_info *cmount)
+extern "C" const char* ceph_getcwd(struct ceph_mount_info *cmount)
{
return cmount->get_cwd();
}
-extern "C" int ceph_chdir (class ceph_mount_info *cmount, const char *s)
+extern "C" int ceph_chdir (struct ceph_mount_info *cmount, const char *s)
{
if (!cmount->is_mounted())
return -ENOTCONN;
return cmount->get_client()->chdir(s);
}
-extern "C" int ceph_opendir(class ceph_mount_info *cmount,
+extern "C" int ceph_opendir(struct ceph_mount_info *cmount,
const char *name, struct ceph_dir_result **dirpp)
{
if (!cmount->is_mounted())
return cmount->get_client()->opendir(name, (dir_result_t **)dirpp);
}
-extern "C" int ceph_closedir(class ceph_mount_info *cmount, struct ceph_dir_result *dirp)
+extern "C" int ceph_closedir(struct ceph_mount_info *cmount, struct ceph_dir_result *dirp)
{
if (!cmount->is_mounted())
return -ENOTCONN;
return cmount->get_client()->closedir((dir_result_t*)dirp);
}
-extern "C" struct dirent * ceph_readdir(class ceph_mount_info *cmount, struct ceph_dir_result *dirp)
+extern "C" struct dirent * ceph_readdir(struct ceph_mount_info *cmount, struct ceph_dir_result *dirp)
{
if (!cmount->is_mounted()) {
/* Client::readdir also sets errno to signal errors. */
return cmount->get_client()->readdir((dir_result_t*)dirp);
}
-extern "C" int ceph_readdir_r(class ceph_mount_info *cmount, struct ceph_dir_result *dirp, struct dirent *de)
+extern "C" int ceph_readdir_r(struct ceph_mount_info *cmount, struct ceph_dir_result *dirp, struct dirent *de)
{
if (!cmount->is_mounted())
return -ENOTCONN;
return cmount->get_client()->readdir_r((dir_result_t*)dirp, de);
}
-extern "C" int ceph_readdirplus_r(class ceph_mount_info *cmount, struct ceph_dir_result *dirp,
+extern "C" int ceph_readdirplus_r(struct ceph_mount_info *cmount, struct ceph_dir_result *dirp,
struct dirent *de, struct stat *st, int *stmask)
{
if (!cmount->is_mounted())
return cmount->get_client()->readdirplus_r((dir_result_t*)dirp, de, st, stmask);
}
-extern "C" int ceph_getdents(class ceph_mount_info *cmount, struct ceph_dir_result *dirp,
+extern "C" int ceph_getdents(struct ceph_mount_info *cmount, struct ceph_dir_result *dirp,
char *buf, int buflen)
{
if (!cmount->is_mounted())
return cmount->get_client()->getdents((dir_result_t*)dirp, buf, buflen);
}
-extern "C" int ceph_getdnames(class ceph_mount_info *cmount, struct ceph_dir_result *dirp,
+extern "C" int ceph_getdnames(struct ceph_mount_info *cmount, struct ceph_dir_result *dirp,
char *buf, int buflen)
{
if (!cmount->is_mounted())
return cmount->get_client()->getdnames((dir_result_t*)dirp, buf, buflen);
}
-extern "C" void ceph_rewinddir(class ceph_mount_info *cmount, struct ceph_dir_result *dirp)
+extern "C" void ceph_rewinddir(struct ceph_mount_info *cmount, struct ceph_dir_result *dirp)
{
if (!cmount->is_mounted())
return;
cmount->get_client()->rewinddir((dir_result_t*)dirp);
}
-extern "C" loff_t ceph_telldir(class ceph_mount_info *cmount, struct ceph_dir_result *dirp)
+extern "C" loff_t ceph_telldir(struct ceph_mount_info *cmount, struct ceph_dir_result *dirp)
{
if (!cmount->is_mounted())
return -ENOTCONN;
return cmount->get_client()->telldir((dir_result_t*)dirp);
}
-extern "C" void ceph_seekdir(class ceph_mount_info *cmount, struct ceph_dir_result *dirp, loff_t offset)
+extern "C" void ceph_seekdir(struct ceph_mount_info *cmount, struct ceph_dir_result *dirp, loff_t offset)
{
if (!cmount->is_mounted())
return;
cmount->get_client()->seekdir((dir_result_t*)dirp, offset);
}
-extern "C" int ceph_link (class ceph_mount_info *cmount, const char *existing,
+extern "C" int ceph_link (struct ceph_mount_info *cmount, const char *existing,
const char *newname)
{
if (!cmount->is_mounted())
return cmount->get_client()->link(existing, newname);
}
-extern "C" int ceph_unlink(class ceph_mount_info *cmount, const char *path)
+extern "C" int ceph_unlink(struct ceph_mount_info *cmount, const char *path)
{
if (!cmount->is_mounted())
return -ENOTCONN;
return cmount->get_client()->unlink(path);
}
-extern "C" int ceph_rename(class ceph_mount_info *cmount, const char *from,
+extern "C" int ceph_rename(struct ceph_mount_info *cmount, const char *from,
const char *to)
{
if (!cmount->is_mounted())
}
// dirs
-extern "C" int ceph_mkdir(class ceph_mount_info *cmount, const char *path, mode_t mode)
+extern "C" int ceph_mkdir(struct ceph_mount_info *cmount, const char *path, mode_t mode)
{
if (!cmount->is_mounted())
return -ENOTCONN;
return cmount->get_client()->mkdir(path, mode);
}
-extern "C" int ceph_mkdirs(class ceph_mount_info *cmount, const char *path, mode_t mode)
+extern "C" int ceph_mkdirs(struct ceph_mount_info *cmount, const char *path, mode_t mode)
{
if (!cmount->is_mounted())
return -ENOTCONN;
return cmount->get_client()->mkdirs(path, mode);
}
-extern "C" int ceph_rmdir(class ceph_mount_info *cmount, const char *path)
+extern "C" int ceph_rmdir(struct ceph_mount_info *cmount, const char *path)
{
if (!cmount->is_mounted())
return -ENOTCONN;
}
// symlinks
-extern "C" int ceph_readlink(class ceph_mount_info *cmount, const char *path,
+extern "C" int ceph_readlink(struct ceph_mount_info *cmount, const char *path,
char *buf, loff_t size)
{
if (!cmount->is_mounted())
return cmount->get_client()->readlink(path, buf, size);
}
-extern "C" int ceph_symlink(class ceph_mount_info *cmount, const char *existing,
+extern "C" int ceph_symlink(struct ceph_mount_info *cmount, const char *existing,
const char *newname)
{
if (!cmount->is_mounted())
}
// inode stuff
-extern "C" int ceph_stat(class ceph_mount_info *cmount, const char *path,
+extern "C" int ceph_stat(struct ceph_mount_info *cmount, const char *path,
struct stat *stbuf)
{
if (!cmount->is_mounted())
return cmount->get_client()->stat(path, stbuf);
}
-extern "C" int ceph_lstat(class ceph_mount_info *cmount, const char *path,
+extern "C" int ceph_lstat(struct ceph_mount_info *cmount, const char *path,
struct stat *stbuf)
{
if (!cmount->is_mounted())
return cmount->get_client()->lstat(path, stbuf);
}
-extern "C" int ceph_setattr(class ceph_mount_info *cmount, const char *relpath,
+extern "C" int ceph_setattr(struct ceph_mount_info *cmount, const char *relpath,
struct stat *attr, int mask)
{
if (!cmount->is_mounted())
}
// *xattr() calls supporting samba/vfs
-extern "C" int ceph_getxattr(class ceph_mount_info *cmount, const char *path, const char *name, void *value, size_t size)
+extern "C" int ceph_getxattr(struct ceph_mount_info *cmount, const char *path, const char *name, void *value, size_t size)
{
if (!cmount->is_mounted())
return -ENOTCONN;
return cmount->get_client()->getxattr(path, name, value, size);
}
-extern "C" int ceph_lgetxattr(class ceph_mount_info *cmount, const char *path, const char *name, void *value, size_t size)
+extern "C" int ceph_lgetxattr(struct ceph_mount_info *cmount, const char *path, const char *name, void *value, size_t size)
{
if (!cmount->is_mounted())
return -ENOTCONN;
return cmount->get_client()->lgetxattr(path, name, value, size);
}
-extern "C" int ceph_listxattr(class ceph_mount_info *cmount, const char *path, char *list, size_t size)
+extern "C" int ceph_listxattr(struct ceph_mount_info *cmount, const char *path, char *list, size_t size)
{
if (!cmount->is_mounted())
return -ENOTCONN;
return cmount->get_client()->listxattr(path, list, size);
}
-extern "C" int ceph_llistxattr(class ceph_mount_info *cmount, const char *path, char *list, size_t size)
+extern "C" int ceph_llistxattr(struct ceph_mount_info *cmount, const char *path, char *list, size_t size)
{
if (!cmount->is_mounted())
return -ENOTCONN;
return cmount->get_client()->llistxattr(path, list, size);
}
-extern "C" int ceph_removexattr(class ceph_mount_info *cmount, const char *path, const char *name)
+extern "C" int ceph_removexattr(struct ceph_mount_info *cmount, const char *path, const char *name)
{
if (!cmount->is_mounted())
return -ENOTCONN;
return cmount->get_client()->removexattr(path, name);
}
-extern "C" int ceph_lremovexattr(class ceph_mount_info *cmount, const char *path, const char *name)
+extern "C" int ceph_lremovexattr(struct ceph_mount_info *cmount, const char *path, const char *name)
{
if (!cmount->is_mounted())
return -ENOTCONN;
return cmount->get_client()->lremovexattr(path, name);
}
-extern "C" int ceph_setxattr(class ceph_mount_info *cmount, const char *path, const char *name, const void *value, size_t size, int flags)
+extern "C" int ceph_setxattr(struct ceph_mount_info *cmount, const char *path, const char *name, const void *value, size_t size, int flags)
{
if (!cmount->is_mounted())
return -ENOTCONN;
return cmount->get_client()->setxattr(path, name, value, size, flags);
}
-extern "C" int ceph_lsetxattr(class ceph_mount_info *cmount, const char *path, const char *name, const void *value, size_t size, int flags)
+extern "C" int ceph_lsetxattr(struct ceph_mount_info *cmount, const char *path, const char *name, const void *value, size_t size, int flags)
{
if (!cmount->is_mounted())
return -ENOTCONN;
}
/* end xattr support */
-extern "C" int ceph_chmod(class ceph_mount_info *cmount, const char *path, mode_t mode)
+extern "C" int ceph_chmod(struct ceph_mount_info *cmount, const char *path, mode_t mode)
{
if (!cmount->is_mounted())
return -ENOTCONN;
return cmount->get_client()->chmod(path, mode);
}
-extern "C" int ceph_fchmod(class ceph_mount_info *cmount, int fd, mode_t mode)
+extern "C" int ceph_fchmod(struct ceph_mount_info *cmount, int fd, mode_t mode)
{
if (!cmount->is_mounted())
return -ENOTCONN;
return cmount->get_client()->fchmod(fd, mode);
}
-extern "C" int ceph_chown(class ceph_mount_info *cmount, const char *path,
+extern "C" int ceph_chown(struct ceph_mount_info *cmount, const char *path,
int uid, int gid)
{
if (!cmount->is_mounted())
return -ENOTCONN;
return cmount->get_client()->chown(path, uid, gid);
}
-extern "C" int ceph_fchown(class ceph_mount_info *cmount, int fd,
+extern "C" int ceph_fchown(struct ceph_mount_info *cmount, int fd,
int uid, int gid)
{
if (!cmount->is_mounted())
return -ENOTCONN;
return cmount->get_client()->fchown(fd, uid, gid);
}
-extern "C" int ceph_lchown(class ceph_mount_info *cmount, const char *path,
+extern "C" int ceph_lchown(struct ceph_mount_info *cmount, const char *path,
int uid, int gid)
{
if (!cmount->is_mounted())
}
-extern "C" int ceph_utime(class ceph_mount_info *cmount, const char *path,
+extern "C" int ceph_utime(struct ceph_mount_info *cmount, const char *path,
struct utimbuf *buf)
{
if (!cmount->is_mounted())
return cmount->get_client()->utime(path, buf);
}
-extern "C" int ceph_truncate(class ceph_mount_info *cmount, const char *path,
+extern "C" int ceph_truncate(struct ceph_mount_info *cmount, const char *path,
loff_t size)
{
if (!cmount->is_mounted())
}
// file ops
-extern "C" int ceph_mknod(class ceph_mount_info *cmount, const char *path,
+extern "C" int ceph_mknod(struct ceph_mount_info *cmount, const char *path,
mode_t mode, dev_t rdev)
{
if (!cmount->is_mounted())
return cmount->get_client()->mknod(path, mode, rdev);
}
-extern "C" int ceph_open(class ceph_mount_info *cmount, const char *path,
+extern "C" int ceph_open(struct ceph_mount_info *cmount, const char *path,
int flags, mode_t mode)
{
if (!cmount->is_mounted())
return cmount->get_client()->open(path, flags, mode);
}
-extern "C" int ceph_open_layout(class ceph_mount_info *cmount, const char *path, int flags,
+extern "C" int ceph_open_layout(struct ceph_mount_info *cmount, const char *path, int flags,
mode_t mode, int stripe_unit, int stripe_count, int object_size, const char *data_pool)
{
if (!cmount->is_mounted())
stripe_count, object_size, data_pool);
}
-extern "C" int ceph_close(class ceph_mount_info *cmount, int fd)
+extern "C" int ceph_close(struct ceph_mount_info *cmount, int fd)
{
if (!cmount->is_mounted())
return -ENOTCONN;
return cmount->get_client()->close(fd);
}
-extern "C" loff_t ceph_lseek(class ceph_mount_info *cmount, int fd,
+extern "C" loff_t ceph_lseek(struct ceph_mount_info *cmount, int fd,
loff_t offset, int whence)
{
if (!cmount->is_mounted())
return cmount->get_client()->lseek(fd, offset, whence);
}
-extern "C" int ceph_read(class ceph_mount_info *cmount, int fd, char *buf,
+extern "C" int ceph_read(struct ceph_mount_info *cmount, int fd, char *buf,
loff_t size, loff_t offset)
{
if (!cmount->is_mounted())
return cmount->get_client()->read(fd, buf, size, offset);
}
-extern "C" int ceph_write(class ceph_mount_info *cmount, int fd, const char *buf,
+extern "C" int ceph_write(struct ceph_mount_info *cmount, int fd, const char *buf,
loff_t size, loff_t offset)
{
if (!cmount->is_mounted())
return cmount->get_client()->write(fd, buf, size, offset);
}
-extern "C" int ceph_ftruncate(class ceph_mount_info *cmount, int fd, loff_t size)
+extern "C" int ceph_ftruncate(struct ceph_mount_info *cmount, int fd, loff_t size)
{
if (!cmount->is_mounted())
return -ENOTCONN;
return cmount->get_client()->ftruncate(fd, size);
}
-extern "C" int ceph_fsync(class ceph_mount_info *cmount, int fd, int syncdataonly)
+extern "C" int ceph_fsync(struct ceph_mount_info *cmount, int fd, int syncdataonly)
{
if (!cmount->is_mounted())
return -ENOTCONN;
return cmount->get_client()->fsync(fd, syncdataonly);
}
-extern "C" int ceph_fallocate(class ceph_mount_info *cmount, int fd, int mode,
+extern "C" int ceph_fallocate(struct ceph_mount_info *cmount, int fd, int mode,
loff_t offset, loff_t length)
{
if (!cmount->is_mounted())
return cmount->get_client()->fallocate(fd, mode, offset, length);
}
-extern "C" int ceph_fstat(class ceph_mount_info *cmount, int fd, struct stat *stbuf)
+extern "C" int ceph_fstat(struct ceph_mount_info *cmount, int fd, struct stat *stbuf)
{
if (!cmount->is_mounted())
return -ENOTCONN;
return cmount->get_client()->fstat(fd, stbuf);
}
-extern "C" int ceph_sync_fs(class ceph_mount_info *cmount)
+extern "C" int ceph_sync_fs(struct ceph_mount_info *cmount)
{
if (!cmount->is_mounted())
return -ENOTCONN;
}
-extern "C" int ceph_get_file_stripe_unit(class ceph_mount_info *cmount, int fh)
+extern "C" int ceph_get_file_stripe_unit(struct ceph_mount_info *cmount, int fh)
{
struct ceph_file_layout l;
int r;
return l.fl_stripe_unit;
}
-extern "C" int ceph_get_path_stripe_unit(class ceph_mount_info *cmount, const char *path)
+extern "C" int ceph_get_path_stripe_unit(struct ceph_mount_info *cmount, const char *path)
{
struct ceph_file_layout l;
int r;
return l.fl_stripe_unit;
}
-extern "C" int ceph_get_file_stripe_count(class ceph_mount_info *cmount, int fh)
+extern "C" int ceph_get_file_stripe_count(struct ceph_mount_info *cmount, int fh)
{
struct ceph_file_layout l;
int r;
return l.fl_stripe_count;
}
-extern "C" int ceph_get_path_stripe_count(class ceph_mount_info *cmount, const char *path)
+extern "C" int ceph_get_path_stripe_count(struct ceph_mount_info *cmount, const char *path)
{
struct ceph_file_layout l;
int r;
return l.fl_stripe_count;
}
-extern "C" int ceph_get_file_object_size(class ceph_mount_info *cmount, int fh)
+extern "C" int ceph_get_file_object_size(struct ceph_mount_info *cmount, int fh)
{
struct ceph_file_layout l;
int r;
return l.fl_object_size;
}
-extern "C" int ceph_get_path_object_size(class ceph_mount_info *cmount, const char *path)
+extern "C" int ceph_get_path_object_size(struct ceph_mount_info *cmount, const char *path)
{
struct ceph_file_layout l;
int r;
return l.fl_object_size;
}
-extern "C" int ceph_get_file_pool(class ceph_mount_info *cmount, int fh)
+extern "C" int ceph_get_file_pool(struct ceph_mount_info *cmount, int fh)
{
struct ceph_file_layout l;
int r;
return l.fl_pg_pool;
}
-extern "C" int ceph_get_path_pool(class ceph_mount_info *cmount, const char *path)
+extern "C" int ceph_get_path_pool(struct ceph_mount_info *cmount, const char *path)
{
struct ceph_file_layout l;
int r;
return l.fl_pg_pool;
}
-extern "C" int ceph_get_file_pool_name(class ceph_mount_info *cmount, int fh, char *buf, size_t len)
+extern "C" int ceph_get_file_pool_name(struct ceph_mount_info *cmount, int fh, char *buf, size_t len)
{
struct ceph_file_layout l;
int r;
return name.length();
}
-extern "C" int ceph_get_pool_name(class ceph_mount_info *cmount, int pool, char *buf, size_t len)
+extern "C" int ceph_get_pool_name(struct ceph_mount_info *cmount, int pool, char *buf, size_t len)
{
if (!cmount->is_mounted())
return -ENOTCONN;
return name.length();
}
-extern "C" int ceph_get_path_pool_name(class ceph_mount_info *cmount, const char *path, char *buf, size_t len)
+extern "C" int ceph_get_path_pool_name(struct ceph_mount_info *cmount, const char *path, char *buf, size_t len)
{
struct ceph_file_layout l;
int r;
return name.length();
}
-extern "C" int ceph_get_file_layout(class ceph_mount_info *cmount, int fh, int *stripe_unit, int *stripe_count, int *object_size, int *pg_pool)
+extern "C" int ceph_get_file_layout(struct ceph_mount_info *cmount, int fh, int *stripe_unit, int *stripe_count, int *object_size, int *pg_pool)
{
struct ceph_file_layout l;
int r;
return 0;
}
-extern "C" int ceph_get_path_layout(class ceph_mount_info *cmount, const char *path, int *stripe_unit, int *stripe_count, int *object_size, int *pg_pool)
+extern "C" int ceph_get_path_layout(struct ceph_mount_info *cmount, const char *path, int *stripe_unit, int *stripe_count, int *object_size, int *pg_pool)
{
struct ceph_file_layout l;
int r;
return 0;
}
-extern "C" int ceph_get_file_replication(class ceph_mount_info *cmount, int fh)
+extern "C" int ceph_get_file_replication(struct ceph_mount_info *cmount, int fh)
{
struct ceph_file_layout l;
int r;
return rep;
}
-extern "C" int ceph_get_path_replication(class ceph_mount_info *cmount, const char *path)
+extern "C" int ceph_get_path_replication(struct ceph_mount_info *cmount, const char *path)
{
struct ceph_file_layout l;
int r;
return rep;
}
-extern "C" int ceph_set_default_file_stripe_unit(class ceph_mount_info *cmount,
+extern "C" int ceph_set_default_file_stripe_unit(struct ceph_mount_info *cmount,
int stripe)
{
// this option no longer exists
return -EOPNOTSUPP;
}
-extern "C" int ceph_set_default_file_stripe_count(class ceph_mount_info *cmount,
+extern "C" int ceph_set_default_file_stripe_count(struct ceph_mount_info *cmount,
int count)
{
// this option no longer exists
return -EOPNOTSUPP;
}
-extern "C" int ceph_set_default_object_size(class ceph_mount_info *cmount, int size)
+extern "C" int ceph_set_default_object_size(struct ceph_mount_info *cmount, int size)
{
// this option no longer exists
return -EOPNOTSUPP;
}
-extern "C" int ceph_set_default_file_replication(class ceph_mount_info *cmount,
+extern "C" int ceph_set_default_file_replication(struct ceph_mount_info *cmount,
int replication)
{
// this option no longer exists
return -EOPNOTSUPP;
}
-extern "C" int ceph_set_default_preferred_pg(class ceph_mount_info *cmount, int osd)
+extern "C" int ceph_set_default_preferred_pg(struct ceph_mount_info *cmount, int osd)
{
// this option no longer exists
return -EOPNOTSUPP;
}
-extern "C" int ceph_get_file_extent_osds(class ceph_mount_info *cmount, int fh,
+extern "C" int ceph_get_file_extent_osds(struct ceph_mount_info *cmount, int fh,
loff_t offset, loff_t *length, int *osds, int nosds)
{
if (nosds < 0)
return vosds.size();
}
-extern "C" int ceph_get_osd_crush_location(class ceph_mount_info *cmount,
+extern "C" int ceph_get_osd_crush_location(struct ceph_mount_info *cmount,
int osd, char *path, size_t len)
{
if (!cmount->is_mounted())
return needed;
}
-extern "C" int ceph_get_osd_addr(class ceph_mount_info *cmount, int osd,
+extern "C" int ceph_get_osd_addr(struct ceph_mount_info *cmount, int osd,
struct sockaddr_storage *addr)
{
if (!cmount->is_mounted())
return 0;
}
-extern "C" int ceph_get_file_stripe_address(class ceph_mount_info *cmount, int fh,
+extern "C" int ceph_get_file_stripe_address(struct ceph_mount_info *cmount, int fh,
loff_t offset, struct sockaddr_storage *addr, int naddr)
{
vector<entity_addr_t> address;
return address.size();
}
-extern "C" int ceph_localize_reads(class ceph_mount_info *cmount, int val)
+extern "C" int ceph_localize_reads(struct ceph_mount_info *cmount, int val)
{
if (!cmount->is_mounted())
return -ENOTCONN;
return 0;
}
-extern "C" CephContext *ceph_get_mount_context(class ceph_mount_info *cmount)
+extern "C" CephContext *ceph_get_mount_context(struct ceph_mount_info *cmount)
{
return cmount->get_ceph_context();
}
-extern "C" int ceph_debug_get_fd_caps(class ceph_mount_info *cmount, int fd)
+extern "C" int ceph_debug_get_fd_caps(struct ceph_mount_info *cmount, int fd)
{
if (!cmount->is_mounted())
return -ENOTCONN;
return cmount->get_client()->get_caps_issued(fd);
}
-extern "C" int ceph_debug_get_file_caps(class ceph_mount_info *cmount, const char *path)
+extern "C" int ceph_debug_get_file_caps(struct ceph_mount_info *cmount, const char *path)
{
if (!cmount->is_mounted())
return -ENOTCONN;
return cmount->get_client()->get_caps_issued(path);
}
-extern "C" int ceph_get_stripe_unit_granularity(class ceph_mount_info *cmount)
+extern "C" int ceph_get_stripe_unit_granularity(struct ceph_mount_info *cmount)
{
if (!cmount->is_mounted())
return -ENOTCONN;
return CEPH_MIN_STRIPE_UNIT;
}
-extern "C" int ceph_get_pool_id(class ceph_mount_info *cmount, const char *pool_name)
+extern "C" int ceph_get_pool_id(struct ceph_mount_info *cmount, const char *pool_name)
{
if (!cmount->is_mounted())
return -ENOTCONN;
return (int)pool_id;
}
-extern "C" int ceph_get_pool_replication(class ceph_mount_info *cmount, int pool_id)
+extern "C" int ceph_get_pool_replication(struct ceph_mount_info *cmount, int pool_id)
{
if (!cmount->is_mounted())
return -ENOTCONN;