Keep consistency in the code to not generate warnings of this type.
Signed-off-by: Christophe Courtaut <christophe.courtaut@gmail.com>
#include "common/Timer.h"
class CephContext;
-class MAuthReply;
+struct MAuthReply;
class AuthClientHandler;
class RotatingKeyRing;
class MClientSession;
class MClientRequest;
class MClientRequestForward;
-class MClientLease;
+struct MClientLease;
class MClientCaps;
class MClientCapRelease;
-class DirStat;
-class LeaseStat;
-class InodeStat;
+struct DirStat;
+struct LeaseStat;
+struct InodeStat;
class Filer;
class Objecter;
struct Cap;
class Dir;
class Dentry;
-class SnapRealm;
-class Fh;
-class CapSnap;
+struct SnapRealm;
+struct Fh;
+struct CapSnap;
-class MetaSession;
-class MetaRequest;
+struct MetaSession;
+struct MetaRequest;
typedef void (*client_ino_callback_t)(void *handle, vinodeno_t ino, int64_t off, int64_t len);
void maybe_update_snaprealm(SnapRealm *realm, snapid_t snap_created, snapid_t snap_highwater,
vector<snapid_t>& snaps);
- void handle_snap(class MClientSnap *m);
+ void handle_snap(struct MClientSnap *m);
void handle_caps(class MClientCaps *m);
void handle_cap_import(MetaSession *session, Inode *in, class MClientCaps *m);
void handle_cap_export(MetaSession *session, Inode *in, class MClientCaps *m);
#include "osdc/ObjectCacher.h"
#include "include/assert.h"
-class MetaSession;
+struct MetaSession;
class Dentry;
class Dir;
-class SnapRealm;
+struct SnapRealm;
class Inode;
struct Cap {
#include "messages/MClientCapRelease.h"
-class Cap;
+struct Cap;
class Inode;
-class CapSnap;
-class MetaRequest;
+struct CapSnap;
+struct MetaRequest;
class MClientCapRelease;
struct MetaSession {
class Messenger;
class MonMap;
class Message;
-class Connection;
+struct Connection;
class LogClientTemp
{
# include "acconfig.h"
#endif
-struct CephContext;
+class CephContext;
#ifdef __cplusplus
namespace ceph {
-class BackTrace;
+struct BackTrace;
struct FailedAssertion {
BackTrace *backtrace;
# error libceph: must define __USE_FILE_OFFSET64 or readdir results will be corrupted
#endif
-struct ceph_mount_info;
+class ceph_mount_info;
struct ceph_dir_result;
-struct CephContext;
+class CephContext;
/* setattr mask bits */
#ifndef CEPH_SETATTR_MODE
* 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(struct ceph_mount_info **cmount, const char * const id);
+int ceph_create(class 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(struct ceph_mount_info **cmount, struct CephContext *conf);
+int ceph_create_with_context(class 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(struct ceph_mount_info *cmount, const char *root);
+int ceph_mount(class 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(struct ceph_mount_info *cmount);
+int ceph_unmount(class 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(struct ceph_mount_info *cmount);
+int ceph_release(class 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(struct ceph_mount_info *cmount);
+void ceph_shutdown(class 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.
*/
-struct CephContext *ceph_get_mount_context(struct ceph_mount_info *cmount);
+class CephContext *ceph_get_mount_context(class ceph_mount_info *cmount);
/*
* Check mount status.
*
* Return non-zero value if mounted. Otherwise, zero.
*/
-int ceph_is_mounted(struct ceph_mount_info *cmount);
+int ceph_is_mounted(class 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(struct ceph_mount_info *cmount, const char *path_list);
+int ceph_conf_read_file(class 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(struct ceph_mount_info *cmount, int argc, const char **argv);
+int ceph_conf_parse_argv(class 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(struct ceph_mount_info *cmount, const char *var);
+int ceph_conf_parse_env(class 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(struct ceph_mount_info *cmount, const char *option, const char *value);
+int ceph_conf_set(class 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(struct ceph_mount_info *cmount, const char *option, char *buf, size_t len);
+int ceph_conf_get(class 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(struct ceph_mount_info *cmount, const char *path, struct statvfs *stbuf);
+int ceph_statfs(class 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(struct ceph_mount_info *cmount);
+int ceph_sync_fs(class 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(struct ceph_mount_info *cmount);
+const char* ceph_getcwd(class 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(struct ceph_mount_info *cmount, const char *s);
+int ceph_chdir(class 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(struct ceph_mount_info *cmount, const char *name, struct ceph_dir_result **dirpp);
+int ceph_opendir(class 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(struct ceph_mount_info *cmount, struct ceph_dir_result *dirp);
+int ceph_closedir(class 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(struct ceph_mount_info *cmount, struct ceph_dir_result *dirp);
+struct dirent * ceph_readdir(class 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(struct ceph_mount_info *cmount, struct ceph_dir_result *dirp, struct dirent *de);
+int ceph_readdir_r(class 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(struct ceph_mount_info *cmount, struct ceph_dir_result *dirp, struct dirent *de,
+int ceph_readdirplus_r(class 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(struct ceph_mount_info *cmount, struct ceph_dir_result *dirp, char *name, int buflen);
+int ceph_getdents(class 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(struct ceph_mount_info *cmount, struct ceph_dir_result *dirp, char *name, int buflen);
+int ceph_getdnames(class 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(struct ceph_mount_info *cmount, struct ceph_dir_result *dirp);
+void ceph_rewinddir(class 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(struct ceph_mount_info *cmount, struct ceph_dir_result *dirp);
+loff_t ceph_telldir(class 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(struct ceph_mount_info *cmount, struct ceph_dir_result *dirp, loff_t offset);
+void ceph_seekdir(class 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(struct ceph_mount_info *cmount, const char *path, mode_t mode);
+int ceph_mkdir(class 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(struct ceph_mount_info *cmount, const char *path, mode_t mode);
+int ceph_mkdirs(class 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(struct ceph_mount_info *cmount, const char *path);
+int ceph_rmdir(class 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(struct ceph_mount_info *cmount, const char *existing, const char *newname);
+int ceph_link(class 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(struct ceph_mount_info *cmount, const char *path, char *buf, loff_t size);
+int ceph_readlink(class 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(struct ceph_mount_info *cmount, const char *existing, const char *newname);
+int ceph_symlink(class 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(struct ceph_mount_info *cmount, const char *path);
+int ceph_unlink(class 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(struct ceph_mount_info *cmount, const char *from, const char *to);
+int ceph_rename(class 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(struct ceph_mount_info *cmount, const char *path, struct stat *stbuf);
+int ceph_stat(class 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(struct ceph_mount_info *cmount, const char *path, struct stat *stbuf);
+int ceph_lstat(class 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(struct ceph_mount_info *cmount, const char *relpath, struct stat *attr, int mask);
+int ceph_setattr(class 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(struct ceph_mount_info *cmount, const char *path, mode_t mode);
+int ceph_chmod(class 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(struct ceph_mount_info *cmount, int fd, mode_t mode);
+int ceph_fchmod(class 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(struct ceph_mount_info *cmount, const char *path, int uid, int gid);
+int ceph_chown(class 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(struct ceph_mount_info *cmount, int fd, int uid, int gid);
+int ceph_fchown(class 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(struct ceph_mount_info *cmount, const char *path, int uid, int gid);
+int ceph_lchown(class 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(struct ceph_mount_info *cmount, const char *path, struct utimbuf *buf);
+int ceph_utime(class 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(struct ceph_mount_info *cmount, const char *path, loff_t size);
+int ceph_truncate(class 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(struct ceph_mount_info *cmount, const char *path, mode_t mode, dev_t rdev);
+int ceph_mknod(class 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(struct ceph_mount_info *cmount, const char *path, int flags, mode_t mode);
+int ceph_open(class 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(struct ceph_mount_info *cmount, const char *path, int flags,
+int ceph_open_layout(class 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(struct ceph_mount_info *cmount, int fd);
+int ceph_close(class 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(struct ceph_mount_info *cmount, int fd, loff_t offset, int whence);
+loff_t ceph_lseek(class 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(struct ceph_mount_info *cmount, int fd, char *buf, loff_t size, loff_t offset);
+int ceph_read(class 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(struct ceph_mount_info *cmount, int fd, const char *buf, loff_t size,
+int ceph_write(class 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(struct ceph_mount_info *cmount, int fd, loff_t size);
+int ceph_ftruncate(class 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(struct ceph_mount_info *cmount, int fd, int syncdataonly);
+int ceph_fsync(class ceph_mount_info *cmount, int fd, int syncdataonly);
/**
* Get the open file's statistics.
* function.
* @returns 0 on success or a negative error code on failure
*/
-int ceph_fstat(struct ceph_mount_info *cmount, int fd, struct stat *stbuf);
+int ceph_fstat(class 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(struct ceph_mount_info *cmount, const char *path, const char *name,
+int ceph_getxattr(class 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(struct ceph_mount_info *cmount, const char *path, const char *name,
+int ceph_lgetxattr(class 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(struct ceph_mount_info *cmount, const char *path, char *list, size_t size);
+int ceph_listxattr(class 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(struct ceph_mount_info *cmount, const char *path, char *list, size_t size);
+int ceph_llistxattr(class 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(struct ceph_mount_info *cmount, const char *path, const char *name);
+int ceph_removexattr(class 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(struct ceph_mount_info *cmount, const char *path, const char *name);
+int ceph_lremovexattr(class 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(struct ceph_mount_info *cmount, const char *path, const char *name,
+int ceph_setxattr(class 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(struct ceph_mount_info *cmount, const char *path, const char *name,
+int ceph_lsetxattr(class 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(struct ceph_mount_info *cmount, int fh);
+int ceph_get_file_stripe_unit(class 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(struct ceph_mount_info *cmount, const char *path);
+int ceph_get_path_stripe_unit(class 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(struct ceph_mount_info *cmount, int fh);
+int ceph_get_file_stripe_count(class 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(struct ceph_mount_info *cmount, const char *path);
+int ceph_get_path_stripe_count(class 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(struct ceph_mount_info *cmount, int fh);
+int ceph_get_file_object_size(class 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(struct ceph_mount_info *cmount, const char *path);
+int ceph_get_path_object_size(class 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(struct ceph_mount_info *cmount, int fh);
+int ceph_get_file_pool(class 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(struct ceph_mount_info *cmount, const char *path);
+int ceph_get_path_pool(class 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(struct ceph_mount_info *cmount, int fh, char *buf, size_t buflen);
+int ceph_get_file_pool_name(class 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(struct ceph_mount_info *cmount, int pool, char *buf, size_t buflen);
+int ceph_get_pool_name(class 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(struct ceph_mount_info *cmount, const char *path, char *buf, size_t buflen);
+int ceph_get_path_pool_name(class 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(struct ceph_mount_info *cmount, int fh, int *stripe_unit, int *stripe_count, int *object_size, int *pg_pool);
+int ceph_get_file_layout(class 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(struct ceph_mount_info *cmount, const char *path, int *stripe_unit, int *stripe_count, int *object_size, int *pg_pool);
+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);
/**
* 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(struct ceph_mount_info *cmount, int fh);
+int ceph_get_file_replication(class 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(struct ceph_mount_info *cmount, const char *path);
+int ceph_get_path_replication(class 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(struct ceph_mount_info *cmount, const char *pool_name);
+int ceph_get_pool_id(class 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(struct ceph_mount_info *cmount, int pool_id);
+int ceph_get_pool_replication(class 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(struct ceph_mount_info *cmount, int fd, loff_t offset,
+int ceph_get_file_stripe_address(class 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(struct ceph_mount_info *cmount, int fh,
+int ceph_get_file_extent_osds(class 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(struct ceph_mount_info *cmount,
+int ceph_get_osd_crush_location(class 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(struct ceph_mount_info *cmount, int osd,
+int ceph_get_osd_addr(class 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(struct ceph_mount_info *cmount);
+int ceph_get_stripe_unit_granularity(class ceph_mount_info *cmount);
/** @} filelayout */
* No longer available. Do not use.
* These functions will return -EOPNOTSUPP.
*/
-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);
+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);
/**
* Read from local replicas when possible.
* for reads.
* @returns 0
*/
-int ceph_localize_reads(struct ceph_mount_info *cmount, int val);
+int ceph_localize_reads(class 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(struct ceph_mount_info *cmount);
+int ceph_get_local_osd(class ceph_mount_info *cmount);
/** @} default_filelayout */
* @returns the current capabilities issued to this client
* for the open file
*/
-int ceph_debug_get_fd_caps(struct ceph_mount_info *cmount, int fd);
+int ceph_debug_get_fd_caps(class 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(struct ceph_mount_info *cmount, const char *path);
+int ceph_debug_get_file_caps(class ceph_mount_info *cmount, const char *path);
#ifdef __cplusplus
}
{
using ceph::bufferlist;
- class AioCompletionImpl;
+ struct AioCompletionImpl;
class IoCtx;
- class IoCtxImpl;
+ struct IoCtxImpl;
class ObjectOperationImpl;
- class ObjListCtx;
- class PoolAsyncCompletionImpl;
+ struct ObjListCtx;
+ struct PoolAsyncCompletionImpl;
class RadosClient;
typedef void *list_ctx_t;
return VERSION;
}
-extern "C" int ceph_create_with_context(struct ceph_mount_info **cmount, CephContext *cct)
+extern "C" int ceph_create_with_context(class ceph_mount_info **cmount, CephContext *cct)
{
uint64_t nonce = 0;
nonce &= ~0xffff;
nonce |= (uint64_t)getpid();
- *cmount = new struct ceph_mount_info(nonce, cct);
+ *cmount = new class ceph_mount_info(nonce, cct);
return 0;
}
-extern "C" int ceph_create(struct ceph_mount_info **cmount, const char * const id)
+extern "C" int ceph_create(class 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(struct ceph_mount_info *cmount)
+extern "C" int ceph_unmount(class ceph_mount_info *cmount)
{
return cmount->unmount();
}
-extern "C" int ceph_release(struct ceph_mount_info *cmount)
+extern "C" int ceph_release(class ceph_mount_info *cmount)
{
if (cmount->is_mounted())
return -EISCONN;
return 0;
}
-extern "C" void ceph_shutdown(struct ceph_mount_info *cmount)
+extern "C" void ceph_shutdown(class ceph_mount_info *cmount)
{
cmount->shutdown();
delete cmount;
}
-extern "C" int ceph_conf_read_file(struct ceph_mount_info *cmount, const char *path)
+extern "C" int ceph_conf_read_file(class ceph_mount_info *cmount, const char *path)
{
return cmount->conf_read_file(path);
}
-extern "C" int ceph_conf_parse_argv(struct ceph_mount_info *cmount, int argc,
+extern "C" int ceph_conf_parse_argv(class ceph_mount_info *cmount, int argc,
const char **argv)
{
return cmount->conf_parse_argv(argc, argv);
}
-extern "C" int ceph_conf_parse_env(struct ceph_mount_info *cmount, const char *name)
+extern "C" int ceph_conf_parse_env(class ceph_mount_info *cmount, const char *name)
{
return cmount->conf_parse_env(name);
}
-extern "C" int ceph_conf_set(struct ceph_mount_info *cmount, const char *option,
+extern "C" int ceph_conf_set(class ceph_mount_info *cmount, const char *option,
const char *value)
{
return cmount->conf_set(option, value);
}
-extern "C" int ceph_conf_get(struct ceph_mount_info *cmount, const char *option,
+extern "C" int ceph_conf_get(class 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(struct ceph_mount_info *cmount, const char *root)
+extern "C" int ceph_mount(class ceph_mount_info *cmount, const char *root)
{
std::string mount_root;
if (root)
return cmount->mount(mount_root);
}
-extern "C" int ceph_is_mounted(struct ceph_mount_info *cmount)
+extern "C" int ceph_is_mounted(class ceph_mount_info *cmount)
{
return cmount->is_mounted() ? 1 : 0;
}
-extern "C" int ceph_statfs(struct ceph_mount_info *cmount, const char *path,
+extern "C" int ceph_statfs(class 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(struct ceph_mount_info *cmount)
+extern "C" int ceph_get_local_osd(class ceph_mount_info *cmount)
{
if (!cmount->is_mounted())
return -ENOTCONN;
return cmount->get_client()->get_local_osd();
}
-extern "C" const char* ceph_getcwd(struct ceph_mount_info *cmount)
+extern "C" const char* ceph_getcwd(class ceph_mount_info *cmount)
{
return cmount->get_cwd();
}
-extern "C" int ceph_chdir (struct ceph_mount_info *cmount, const char *s)
+extern "C" int ceph_chdir (class ceph_mount_info *cmount, const char *s)
{
if (!cmount->is_mounted())
return -ENOTCONN;
return cmount->get_client()->chdir(s);
}
-extern "C" int ceph_opendir(struct ceph_mount_info *cmount,
+extern "C" int ceph_opendir(class 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(struct ceph_mount_info *cmount, struct ceph_dir_result *dirp)
+extern "C" int ceph_closedir(class 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(struct ceph_mount_info *cmount, struct ceph_dir_result *dirp)
+extern "C" struct dirent * ceph_readdir(class 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(struct ceph_mount_info *cmount, struct ceph_dir_result *dirp, struct dirent *de)
+extern "C" int ceph_readdir_r(class 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(struct ceph_mount_info *cmount, struct ceph_dir_result *dirp,
+extern "C" int ceph_readdirplus_r(class 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(struct ceph_mount_info *cmount, struct ceph_dir_result *dirp,
+extern "C" int ceph_getdents(class 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(struct ceph_mount_info *cmount, struct ceph_dir_result *dirp,
+extern "C" int ceph_getdnames(class 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(struct ceph_mount_info *cmount, struct ceph_dir_result *dirp)
+extern "C" void ceph_rewinddir(class 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(struct ceph_mount_info *cmount, struct ceph_dir_result *dirp)
+extern "C" loff_t ceph_telldir(class 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(struct ceph_mount_info *cmount, struct ceph_dir_result *dirp, loff_t offset)
+extern "C" void ceph_seekdir(class 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 (struct ceph_mount_info *cmount, const char *existing,
+extern "C" int ceph_link (class 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(struct ceph_mount_info *cmount, const char *path)
+extern "C" int ceph_unlink(class ceph_mount_info *cmount, const char *path)
{
if (!cmount->is_mounted())
return -ENOTCONN;
return cmount->get_client()->unlink(path);
}
-extern "C" int ceph_rename(struct ceph_mount_info *cmount, const char *from,
+extern "C" int ceph_rename(class ceph_mount_info *cmount, const char *from,
const char *to)
{
if (!cmount->is_mounted())
}
// dirs
-extern "C" int ceph_mkdir(struct ceph_mount_info *cmount, const char *path, mode_t mode)
+extern "C" int ceph_mkdir(class 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(struct ceph_mount_info *cmount, const char *path, mode_t mode)
+extern "C" int ceph_mkdirs(class 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(struct ceph_mount_info *cmount, const char *path)
+extern "C" int ceph_rmdir(class ceph_mount_info *cmount, const char *path)
{
if (!cmount->is_mounted())
return -ENOTCONN;
}
// symlinks
-extern "C" int ceph_readlink(struct ceph_mount_info *cmount, const char *path,
+extern "C" int ceph_readlink(class 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(struct ceph_mount_info *cmount, const char *existing,
+extern "C" int ceph_symlink(class ceph_mount_info *cmount, const char *existing,
const char *newname)
{
if (!cmount->is_mounted())
}
// inode stuff
-extern "C" int ceph_stat(struct ceph_mount_info *cmount, const char *path,
+extern "C" int ceph_stat(class 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(struct ceph_mount_info *cmount, const char *path,
+extern "C" int ceph_lstat(class 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(struct ceph_mount_info *cmount, const char *relpath,
+extern "C" int ceph_setattr(class 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(struct ceph_mount_info *cmount, const char *path, const char *name, void *value, size_t size)
+extern "C" int ceph_getxattr(class 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(struct ceph_mount_info *cmount, const char *path, const char *name, void *value, size_t size)
+extern "C" int ceph_lgetxattr(class 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(struct ceph_mount_info *cmount, const char *path, char *list, size_t size)
+extern "C" int ceph_listxattr(class 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(struct ceph_mount_info *cmount, const char *path, char *list, size_t size)
+extern "C" int ceph_llistxattr(class 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(struct ceph_mount_info *cmount, const char *path, const char *name)
+extern "C" int ceph_removexattr(class 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(struct ceph_mount_info *cmount, const char *path, const char *name)
+extern "C" int ceph_lremovexattr(class 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(struct ceph_mount_info *cmount, const char *path, const char *name, const void *value, size_t size, int flags)
+extern "C" int ceph_setxattr(class 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(struct ceph_mount_info *cmount, const char *path, const char *name, const void *value, size_t size, int 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)
{
if (!cmount->is_mounted())
return -ENOTCONN;
}
/* end xattr support */
-extern "C" int ceph_chmod(struct ceph_mount_info *cmount, const char *path, mode_t mode)
+extern "C" int ceph_chmod(class 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(struct ceph_mount_info *cmount, int fd, mode_t mode)
+extern "C" int ceph_fchmod(class 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(struct ceph_mount_info *cmount, const char *path,
+extern "C" int ceph_chown(class 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(struct ceph_mount_info *cmount, int fd,
+extern "C" int ceph_fchown(class 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(struct ceph_mount_info *cmount, const char *path,
+extern "C" int ceph_lchown(class ceph_mount_info *cmount, const char *path,
int uid, int gid)
{
if (!cmount->is_mounted())
}
-extern "C" int ceph_utime(struct ceph_mount_info *cmount, const char *path,
+extern "C" int ceph_utime(class 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(struct ceph_mount_info *cmount, const char *path,
+extern "C" int ceph_truncate(class ceph_mount_info *cmount, const char *path,
loff_t size)
{
if (!cmount->is_mounted())
}
// file ops
-extern "C" int ceph_mknod(struct ceph_mount_info *cmount, const char *path,
+extern "C" int ceph_mknod(class 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(struct ceph_mount_info *cmount, const char *path,
+extern "C" int ceph_open(class 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(struct ceph_mount_info *cmount, const char *path, int flags,
+extern "C" int ceph_open_layout(class 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(struct ceph_mount_info *cmount, int fd)
+extern "C" int ceph_close(class ceph_mount_info *cmount, int fd)
{
if (!cmount->is_mounted())
return -ENOTCONN;
return cmount->get_client()->close(fd);
}
-extern "C" loff_t ceph_lseek(struct ceph_mount_info *cmount, int fd,
+extern "C" loff_t ceph_lseek(class 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(struct ceph_mount_info *cmount, int fd, char *buf,
+extern "C" int ceph_read(class 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(struct ceph_mount_info *cmount, int fd, const char *buf,
+extern "C" int ceph_write(class 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(struct ceph_mount_info *cmount, int fd, loff_t size)
+extern "C" int ceph_ftruncate(class 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(struct ceph_mount_info *cmount, int fd, int syncdataonly)
+extern "C" int ceph_fsync(class 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_fstat(struct ceph_mount_info *cmount, int fd, struct stat *stbuf)
+extern "C" int ceph_fstat(class 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(struct ceph_mount_info *cmount)
+extern "C" int ceph_sync_fs(class ceph_mount_info *cmount)
{
if (!cmount->is_mounted())
return -ENOTCONN;
}
-extern "C" int ceph_get_file_stripe_unit(struct ceph_mount_info *cmount, int fh)
+extern "C" int ceph_get_file_stripe_unit(class 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(struct ceph_mount_info *cmount, const char *path)
+extern "C" int ceph_get_path_stripe_unit(class 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(struct ceph_mount_info *cmount, int fh)
+extern "C" int ceph_get_file_stripe_count(class 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(struct ceph_mount_info *cmount, const char *path)
+extern "C" int ceph_get_path_stripe_count(class 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(struct ceph_mount_info *cmount, int fh)
+extern "C" int ceph_get_file_object_size(class 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(struct ceph_mount_info *cmount, const char *path)
+extern "C" int ceph_get_path_object_size(class 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(struct ceph_mount_info *cmount, int fh)
+extern "C" int ceph_get_file_pool(class 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(struct ceph_mount_info *cmount, const char *path)
+extern "C" int ceph_get_path_pool(class 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(struct ceph_mount_info *cmount, int fh, char *buf, size_t len)
+extern "C" int ceph_get_file_pool_name(class 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(struct ceph_mount_info *cmount, int pool, char *buf, size_t len)
+extern "C" int ceph_get_pool_name(class 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(struct ceph_mount_info *cmount, const char *path, char *buf, size_t len)
+extern "C" int ceph_get_path_pool_name(class 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(struct 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(class 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(struct 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(class 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(struct ceph_mount_info *cmount, int fh)
+extern "C" int ceph_get_file_replication(class ceph_mount_info *cmount, int fh)
{
struct ceph_file_layout l;
int r;
return rep;
}
-extern "C" int ceph_get_path_replication(struct ceph_mount_info *cmount, const char *path)
+extern "C" int ceph_get_path_replication(class 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(struct ceph_mount_info *cmount,
+extern "C" int ceph_set_default_file_stripe_unit(class ceph_mount_info *cmount,
int stripe)
{
// this option no longer exists
return -EOPNOTSUPP;
}
-extern "C" int ceph_set_default_file_stripe_count(struct ceph_mount_info *cmount,
+extern "C" int ceph_set_default_file_stripe_count(class ceph_mount_info *cmount,
int count)
{
// this option no longer exists
return -EOPNOTSUPP;
}
-extern "C" int ceph_set_default_object_size(struct ceph_mount_info *cmount, int size)
+extern "C" int ceph_set_default_object_size(class ceph_mount_info *cmount, int size)
{
// this option no longer exists
return -EOPNOTSUPP;
}
-extern "C" int ceph_set_default_file_replication(struct ceph_mount_info *cmount,
+extern "C" int ceph_set_default_file_replication(class ceph_mount_info *cmount,
int replication)
{
// this option no longer exists
return -EOPNOTSUPP;
}
-extern "C" int ceph_set_default_preferred_pg(struct ceph_mount_info *cmount, int osd)
+extern "C" int ceph_set_default_preferred_pg(class ceph_mount_info *cmount, int osd)
{
// this option no longer exists
return -EOPNOTSUPP;
}
-extern "C" int ceph_get_file_extent_osds(struct ceph_mount_info *cmount, int fh,
+extern "C" int ceph_get_file_extent_osds(class 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(struct ceph_mount_info *cmount,
+extern "C" int ceph_get_osd_crush_location(class ceph_mount_info *cmount,
int osd, char *path, size_t len)
{
if (!cmount->is_mounted())
return needed;
}
-extern "C" int ceph_get_osd_addr(struct ceph_mount_info *cmount, int osd,
+extern "C" int ceph_get_osd_addr(class ceph_mount_info *cmount, int osd,
struct sockaddr_storage *addr)
{
if (!cmount->is_mounted())
return 0;
}
-extern "C" int ceph_get_file_stripe_address(struct ceph_mount_info *cmount, int fh,
+extern "C" int ceph_get_file_stripe_address(class 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(struct ceph_mount_info *cmount, int val)
+extern "C" int ceph_localize_reads(class ceph_mount_info *cmount, int val)
{
if (!cmount->is_mounted())
return -ENOTCONN;
return 0;
}
-extern "C" CephContext *ceph_get_mount_context(struct ceph_mount_info *cmount)
+extern "C" CephContext *ceph_get_mount_context(class ceph_mount_info *cmount)
{
return cmount->get_ceph_context();
}
-extern "C" int ceph_debug_get_fd_caps(struct ceph_mount_info *cmount, int fd)
+extern "C" int ceph_debug_get_fd_caps(class 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(struct ceph_mount_info *cmount, const char *path)
+extern "C" int ceph_debug_get_file_caps(class 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(struct ceph_mount_info *cmount)
+extern "C" int ceph_get_stripe_unit_granularity(class ceph_mount_info *cmount)
{
if (!cmount->is_mounted())
return -ENOTCONN;
return CEPH_MIN_STRIPE_UNIT;
}
-extern "C" int ceph_get_pool_id(struct ceph_mount_info *cmount, const char *pool_name)
+extern "C" int ceph_get_pool_id(class 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(struct ceph_mount_info *cmount, int pool_id)
+extern "C" int ceph_get_pool_replication(class ceph_mount_info *cmount, int pool_id)
{
if (!cmount->is_mounted())
return -ENOTCONN;
#include "IoCtxImpl.h"
-class AuthAuthorizer;
+struct AuthAuthorizer;
class CephContext;
-class Connection;
+struct Connection;
struct md_config_t;
class Message;
class MWatchNotify;
namespace librbd {
- class AioCompletion;
- class ImageCtx;
+ struct AioCompletion;
+ struct ImageCtx;
/**
* This class represents an I/O operation to a single RBD data object.
namespace librbd {
- class ImageCtx;
+ struct ImageCtx;
class LibrbdWriteback : public WritebackHandler {
public:
class CInode;
class CDir;
-class MDRequest;
+struct MDRequest;
class Message;
class Anchor;
class Context;
class bloom_filter;
-class ObjectOperation;
+struct ObjectOperation;
ostream& operator<<(ostream& out, class CDir& dir);
class CDir : public MDSCacheObject {
class CInode;
class MDCache;
class LogSegment;
-class SnapRealm;
+struct SnapRealm;
class Session;
class MClientCaps;
-class ObjectOperation;
+struct ObjectOperation;
class EMetaBlob;
ostream& operator<<(ostream& out, CInode& in);
class CDir;
class CInode;
class CDentry;
-class Mutation;
-class MDRequest;
+struct Mutation;
+struct MDRequest;
class EMetaBlob;
-class SnapRealm;
+struct SnapRealm;
class Message;
private:
friend class C_MDL_CheckMaxSize;
friend class C_MDL_RequestInodeFileCaps;
- friend class C_Locker_FileUpdate_finish;
+ friend struct C_Locker_FileUpdate_finish;
friend class C_Locker_RetryCapRelease;
// -- client leases --
public:
- void handle_client_lease(class MClientLease *m);
+ void handle_client_lease(struct MClientLease *m);
void issue_client_lease(CDentry *dn, client_t client, bufferlist &bl, utime_t now, Session *session);
void revoke_client_leases(SimpleLock *lock);
class CInode;
class CDentry;
class MDS;
-class MDSlaveUpdate;
+struct MDSlaveUpdate;
class LogSegment {
public:
class MDentryLink;
class MDentryUnlink;
class MLock;
-class MMDSFindIno;
-class MMDSFindInoReply;
-class MMDSOpenIno;
-class MMDSOpenInoReply;
+struct MMDSFindIno;
+struct MMDSFindInoReply;
+struct MMDSOpenIno;
+struct MMDSOpenInoReply;
class Message;
class MClientRequest;
class MMDSSlaveRequest;
-class MClientSnap;
+struct MClientSnap;
class MMDSFragmentNotify;
class ESubtreeMap;
-class Mutation;
-class MDRequest;
-class MDSlaveUpdate;
+struct Mutation;
+struct MDRequest;
+struct MDSlaveUpdate;
// flags for predirty_journal_parents()
void handle_open_ino(MMDSOpenIno *m);
void handle_open_ino_reply(MMDSOpenInoReply *m);
friend class C_MDC_OpenInoBacktraceFetched;
- friend class C_MDC_OpenInoTraverseDir;
- friend class C_MDC_OpenInoParentOpened;
+ friend struct C_MDC_OpenInoTraverseDir;
+ friend struct C_MDC_OpenInoParentOpened;
public:
void kick_open_ino_peers(int who);
class PerfCounters;
class LogEvent;
-class MDRequest;
-class Mutation;
+struct MDRequest;
+struct Mutation;
class EMetaBlob;
class EUpdate;
class MMDSSlaveRequest;
#include "mdstypes.h"
class CInode;
-class MDRequest;
+struct MDRequest;
#include "CInode.h"
#include "Capability.h"
}
}
-class Mutation;
+struct Mutation;
extern "C" {
#include "locks.h"
class MDS;
class MDLog;
class LogSegment;
-class MDSlaveUpdate;
+struct MDSlaveUpdate;
/*
* a bunch of metadata in the journal
struct CapabilityGroup;
class CInode;
class MDCache;
-class MDRequest;
+struct MDRequest;
#include "mon/MonitorDBStore.h"
class MMonCommand;
-class MAuth;
+struct MAuth;
class MAuthMon;
-class MMonGlobalID;
+struct MMonGlobalID;
class KeyRing;
#define MIN_GLOBAL_ID 0x1000
#include "common/config.h"
#include "global/signal_handler.h"
-class MMonHealth;
+struct MMonHealth;
class DataHealthService :
public HealthService
class MMonMap;
class MMonGetVersion;
class MMonGetVersionReply;
-class MMonSubscribeAck;
+struct MMonSubscribeAck;
class MMonCommandAck;
class MCommandReply;
-class MAuthReply;
+struct MAuthReply;
class MAuthRotating;
class LogClient;
class AuthSupported;
class MMonSync;
class MMonScrub;
class MMonProbe;
-class MMonSubscribe;
+struct MMonSubscribe;
class MAuthRotating;
-class MRoute;
-class MForward;
-class MTimeCheck;
-class MMonHealth;
+struct MRoute;
+struct MForward;
+struct MTimeCheck;
+struct MMonHealth;
#define COMPAT_SET_LOC "feature_set"
}
};
- bool preprocess_remove_snaps(class MRemoveSnaps *m);
- bool prepare_remove_snaps(class MRemoveSnaps *m);
+ bool preprocess_remove_snaps(struct MRemoveSnaps *m);
+ bool prepare_remove_snaps(struct MRemoveSnaps *m);
public:
OSDMonitor(Monitor *mn, Paxos *p, string service_name)
class Pipe;
class SimpleMessenger;
class Message;
-class Connection;
+struct Connection;
/**
* The DispatchQueue contains all the Pipes which have Messages
void op_queue_reserve_throttle(Op *o);
void op_queue_release_throttle(Op *o);
void _journaled_ahead(OpSequencer *osr, Op *o, Context *ondisk);
- friend class C_JournaledAhead;
+ friend struct C_JournaledAhead;
int open_journal();
class ClassHandler
{
public:
- class ClassData;
+ struct ClassData;
struct ClassMethod {
struct ClassHandler::ClassData *cls;
void test_ops(std::string command, std::string args, ostream& ss);
friend class TestOpsSocketHook;
TestOpsSocketHook *test_ops_hook;
- friend class C_CompleteSplits;
+ friend struct C_CompleteSplits;
// -- op queue --
void start_waiting_for_healthy();
bool _is_healthy();
- friend class C_OSD_GetVersion;
+ friend struct C_OSD_GetVersion;
// -- alive --
epoch_t up_thru_wanted;
void handle_signal(int signum);
void handle_rep_scrub(MOSDRepScrub *m);
- void handle_scrub(class MOSDScrub *m);
+ void handle_scrub(struct MOSDScrub *m);
void handle_osd_ping(class MOSDPing *m);
void handle_op(OpRequestRef op);
#include "common/TrackedOp.h"
#include "osd/osd_types.h"
-class OpRequest;
+struct OpRequest;
typedef std::tr1::shared_ptr<OpRequest> OpRequestRef;
class OpHistory {
set<pair<utime_t, OpRequestRef> > arrived;
void unreg_next_scrub();
void replica_scrub(
- class MOSDRepScrub *op,
+ struct MOSDRepScrub *op,
ThreadPool::TPHandle &handle);
void sub_op_scrub_map(OpRequestRef op);
void sub_op_scrub_reserve(OpRequestRef op);
friend class C_OSD_OpCommit;
friend class C_OSD_OpApplied;
- friend class C_OnPushCommit;
+ friend struct C_OnPushCommit;
// projected object info
map<hobject_t, ObjectContext*> object_contexts;
pg->unlock();
}
};
- friend class C_OSD_CompletedPull;
+ friend struct C_OSD_CompletedPull;
struct C_OSD_AppliedRecoveredObjectReplica : public Context {
ReplicatedPGRef pg;
C_OSD_AppliedRecoveredObjectReplica(ReplicatedPG *p) :
class ReplicatedPG;
void intrusive_ptr_add_ref(ReplicatedPG *pg);
void intrusive_ptr_release(ReplicatedPG *pg);
-class ObjectContext;
+struct ObjectContext;
class MWatchNotify;
class Watch;
typedef std::tr1::shared_ptr<Notify> NotifyRef;
typedef std::tr1::weak_ptr<Notify> WNotifyRef;
-class CancelableContext;
+struct CancelableContext;
/**
* Notify tracks the progress of a particular notify
utime_t mtime,
int flags,
Context *oncommit);
- void _do_purge_range(class PurgeRange *pr, int fin);
+ void _do_purge_range(struct PurgeRange *pr, int fin);
/*
* probe
void _issue_prezero();
void _prezeroed(int r, uint64_t from, uint64_t len);
- friend class C_Journaler_Prezero;
+ friend struct C_Journaler_Prezero;
// only init_headers when following or first reading off-disk
void init_headers(Header& h) {
public:
CephContext *cct;
class Object;
- class ObjectSet;
+ struct ObjectSet;
class C_ReadFinish;
typedef void (*flush_set_callback_t) (void *p, ObjectSet *oset);
int ref;
ObjectCacher *oc;
sobject_t oid;
- friend class ObjectSet;
+ friend struct ObjectSet;
public:
ObjectSet *oset;
// read
public:
- class OSDSession;
+ struct OSDSession;
struct Op {
OSDSession *session;
free(data);
}
-bool Xattr::operator==(const struct Xattr &rhs) const {
+bool Xattr::operator==(const class Xattr &rhs) const {
if (len != rhs.len)
return false;
return (memcmp(data, rhs.data, len) == 0);
}
-bool Xattr::operator!=(const struct Xattr &rhs) const {
+bool Xattr::operator!=(const class Xattr &rhs) const {
return !((*this) == rhs);
}
public:
Xattr(char *data_, ssize_t len_);
~Xattr();
- bool operator==(const struct Xattr &rhs) const;
- bool operator!=(const struct Xattr &rhs) const;
+ bool operator==(const class Xattr &rhs) const;
+ bool operator!=(const class Xattr &rhs) const;
char *data;
ssize_t len;
}
-req_info::req_info(CephContext *cct, struct RGWEnv *e) : env(e) {
+req_info::req_info(CephContext *cct, class RGWEnv *e) : env(e) {
method = env->get("REQUEST_METHOD");
script_uri = env->get("SCRIPT_URI", cct->_conf->rgw_script_uri.c_str());
request_uri = env->get("REQUEST_URI", cct->_conf->rgw_request_uri.c_str());
}
-req_state::req_state(CephContext *_cct, struct RGWEnv *e) : cct(_cct), cio(NULL), op(OP_UNKNOWN),
+req_state::req_state(CephContext *_cct, class RGWEnv *e) : cct(_cct), cio(NULL), op(OP_UNKNOWN),
bucket_cors(NULL), has_acl_header(false),
os_auth_token(NULL), info(_cct, e)
{
struct req_state;
-struct RGWEnv;
+class RGWEnv;
class RGWClientIO;
req_info info;
- req_state(CephContext *_cct, struct RGWEnv *e);
+ req_state(CephContext *_cct, class RGWEnv *e);
~req_state();
};
class RGWRados;
class JSONObj;
-class RGWObjVersionTracker;
+struct RGWObjVersionTracker;
struct obj_version;
int unlock(int shard_id, string& zone_id, string& owner_id);
};
-class RGWMetadataLogData;
+struct RGWMetadataLogData;
class RGWMetadataManager {
map<string, RGWMetadataHandler *> handlers;
RGWRESTMgr_SWIFT_Auth() {}
virtual ~RGWRESTMgr_SWIFT_Auth() {}
- virtual RGWRESTMgr *get_resource_mgr(struct req_state *s, const string& uri) {
+ virtual RGWRESTMgr *get_resource_mgr(struct req_state *s, const string& uri, string *out_uri) {
return this;
}
virtual RGWHandler *get_handler(struct req_state *s) {
#include "rgw_common.h"
class RGWRados;
-class RGWObjVersionTracker;
+struct RGWObjVersionTracker;
struct obj_version;