diff options
author | Gluster Ant <bugzilla-bot@gluster.org> | 2018-09-12 17:22:48 +0530 |
---|---|---|
committer | Nigel Babu <nigelb@redhat.com> | 2018-09-12 17:22:48 +0530 |
commit | 45a71c0548b6fd2c757aa2e7b7671a1411948894 (patch) | |
tree | 2a5a9b73bae47ab53a41166fd041a06612587f48 /api | |
parent | be77dbbda692792335a8e9e7c02e0c281f003c40 (diff) |
Land clang-format changes
Change-Id: I6f5d8140a06f3c1b2d196849299f8d483028d33b
Diffstat (limited to 'api')
-rw-r--r-- | api/src/gfapi-messages.h | 83 | ||||
-rw-r--r-- | api/src/glfs-handles.h | 290 | ||||
-rw-r--r-- | api/src/glfs-internal.h | 772 | ||||
-rw-r--r-- | api/src/glfs-mem-types.h | 30 | ||||
-rw-r--r-- | api/src/glfs.h | 567 |
5 files changed, 848 insertions, 894 deletions
diff --git a/api/src/gfapi-messages.h b/api/src/gfapi-messages.h index 15f9945c5ed..20418627690 100644 --- a/api/src/gfapi-messages.h +++ b/api/src/gfapi-messages.h @@ -23,61 +23,32 @@ * glfs-message-id.h. */ -GLFS_MSGID(API, - API_MSG_MEM_ACCT_INIT_FAILED, - API_MSG_MASTER_XLATOR_INIT_FAILED, - API_MSG_GFAPI_XLATOR_INIT_FAILED, - API_MSG_VOLFILE_OPEN_FAILED, - API_MSG_VOL_SPEC_FILE_ERROR, - API_MSG_GLFS_FSOBJ_NULL, - API_MSG_INVALID_ENTRY, - API_MSG_FSMUTEX_LOCK_FAILED, - API_MSG_COND_WAIT_FAILED, - API_MSG_FSMUTEX_UNLOCK_FAILED, - API_MSG_INODE_REFRESH_FAILED, - API_MSG_GRAPH_CONSTRUCT_FAILED, - API_MSG_API_XLATOR_ERROR, - API_MSG_XDR_PAYLOAD_FAILED, - API_MSG_GET_VOLINFO_CBK_FAILED, - API_MSG_FETCH_VOLUUID_FAILED, - API_MSG_INSUFF_SIZE, - API_MSG_FRAME_CREAT_FAILED, - API_MSG_DICT_SET_FAILED, - API_MSG_XDR_DECODE_FAILED, - API_MSG_GET_VOLFILE_FAILED, - API_MSG_WRONG_OPVERSION, - API_MSG_DICT_SERIALIZE_FAILED, - API_MSG_REMOTE_HOST_CONN_FAILED, - API_MSG_VOLFILE_SERVER_EXHAUST, - API_MSG_CREATE_RPC_CLIENT_FAILED, - API_MSG_REG_NOTIFY_FUNC_FAILED, - API_MSG_REG_CBK_FUNC_FAILED, - API_MSG_GET_CWD_FAILED, - API_MSG_FGETXATTR_FAILED, - API_MSG_LOCKINFO_KEY_MISSING, - API_MSG_FSETXATTR_FAILED, - API_MSG_FSYNC_FAILED, - API_MSG_FDCREATE_FAILED, - API_MSG_INODE_PATH_FAILED, - API_MSG_SYNCOP_OPEN_FAILED, - API_MSG_LOCK_MIGRATE_FAILED, - API_MSG_OPENFD_SKIPPED, - API_MSG_FIRST_LOOKUP_GRAPH_FAILED, - API_MSG_CWD_GRAPH_REF_FAILED, - API_MSG_SWITCHED_GRAPH, - API_MSG_XDR_RESPONSE_DECODE_FAILED, - API_MSG_VOLFILE_INFO, - API_MSG_VOLFILE_CONNECTING, - API_MSG_NEW_GRAPH, - API_MSG_ALLOC_FAILED, - API_MSG_CREATE_HANDLE_FAILED, - API_MSG_INODE_LINK_FAILED, - API_MSG_STATEDUMP_FAILED, - API_MSG_XREADDIRP_R_FAILED, - API_MSG_LOCK_INSERT_MERGE_FAILED, - API_MSG_SETTING_LOCK_TYPE_FAILED, - API_MSG_INODE_FIND_FAILED, - API_MSG_FDCTX_SET_FAILED -); +GLFS_MSGID(API, API_MSG_MEM_ACCT_INIT_FAILED, API_MSG_MASTER_XLATOR_INIT_FAILED, + API_MSG_GFAPI_XLATOR_INIT_FAILED, API_MSG_VOLFILE_OPEN_FAILED, + API_MSG_VOL_SPEC_FILE_ERROR, API_MSG_GLFS_FSOBJ_NULL, + API_MSG_INVALID_ENTRY, API_MSG_FSMUTEX_LOCK_FAILED, + API_MSG_COND_WAIT_FAILED, API_MSG_FSMUTEX_UNLOCK_FAILED, + API_MSG_INODE_REFRESH_FAILED, API_MSG_GRAPH_CONSTRUCT_FAILED, + API_MSG_API_XLATOR_ERROR, API_MSG_XDR_PAYLOAD_FAILED, + API_MSG_GET_VOLINFO_CBK_FAILED, API_MSG_FETCH_VOLUUID_FAILED, + API_MSG_INSUFF_SIZE, API_MSG_FRAME_CREAT_FAILED, + API_MSG_DICT_SET_FAILED, API_MSG_XDR_DECODE_FAILED, + API_MSG_GET_VOLFILE_FAILED, API_MSG_WRONG_OPVERSION, + API_MSG_DICT_SERIALIZE_FAILED, API_MSG_REMOTE_HOST_CONN_FAILED, + API_MSG_VOLFILE_SERVER_EXHAUST, API_MSG_CREATE_RPC_CLIENT_FAILED, + API_MSG_REG_NOTIFY_FUNC_FAILED, API_MSG_REG_CBK_FUNC_FAILED, + API_MSG_GET_CWD_FAILED, API_MSG_FGETXATTR_FAILED, + API_MSG_LOCKINFO_KEY_MISSING, API_MSG_FSETXATTR_FAILED, + API_MSG_FSYNC_FAILED, API_MSG_FDCREATE_FAILED, + API_MSG_INODE_PATH_FAILED, API_MSG_SYNCOP_OPEN_FAILED, + API_MSG_LOCK_MIGRATE_FAILED, API_MSG_OPENFD_SKIPPED, + API_MSG_FIRST_LOOKUP_GRAPH_FAILED, API_MSG_CWD_GRAPH_REF_FAILED, + API_MSG_SWITCHED_GRAPH, API_MSG_XDR_RESPONSE_DECODE_FAILED, + API_MSG_VOLFILE_INFO, API_MSG_VOLFILE_CONNECTING, API_MSG_NEW_GRAPH, + API_MSG_ALLOC_FAILED, API_MSG_CREATE_HANDLE_FAILED, + API_MSG_INODE_LINK_FAILED, API_MSG_STATEDUMP_FAILED, + API_MSG_XREADDIRP_R_FAILED, API_MSG_LOCK_INSERT_MERGE_FAILED, + API_MSG_SETTING_LOCK_TYPE_FAILED, API_MSG_INODE_FIND_FAILED, + API_MSG_FDCTX_SET_FAILED); #endif /* !_GFAPI_MESSAGES_H__ */ diff --git a/api/src/glfs-handles.h b/api/src/glfs-handles.h index 4b336909b57..97d90a138ac 100644 --- a/api/src/glfs-handles.h +++ b/api/src/glfs-handles.h @@ -50,10 +50,10 @@ /* Values for valid flags to be used when using XXXsetattr, to set multiple attribute values passed via the related stat structure. */ -#define GFAPI_SET_ATTR_MODE 0x1 -#define GFAPI_SET_ATTR_UID 0x2 -#define GFAPI_SET_ATTR_GID 0x4 -#define GFAPI_SET_ATTR_SIZE 0x8 +#define GFAPI_SET_ATTR_MODE 0x1 +#define GFAPI_SET_ATTR_UID 0x2 +#define GFAPI_SET_ATTR_GID 0x4 +#define GFAPI_SET_ATTR_SIZE 0x8 #define GFAPI_SET_ATTR_ATIME 0x10 #define GFAPI_SET_ATTR_MTIME 0x20 @@ -62,31 +62,34 @@ #define GFAPI_HANDLE_LENGTH 16 /* These flags should be in sync to the ones defined in upcall.h */ -#define GFAPI_UP_NLINK 0x00000001 /* update nlink */ -#define GFAPI_UP_MODE 0x00000002 /* update mode and ctime */ -#define GFAPI_UP_OWN 0x00000004 /* update mode,uid,gid and ctime */ -#define GFAPI_UP_SIZE 0x00000008 /* update fsize */ -#define GFAPI_UP_TIMES 0x00000010 /* update all times */ -#define GFAPI_UP_ATIME 0x00000020 /* update atime only */ -#define GFAPI_UP_PERM 0x00000040 /* update fields needed for - permission checking */ -#define GFAPI_UP_RENAME 0x00000080 /* this is a rename op - - delete the cache entry */ -#define GFAPI_UP_FORGET 0x00000100 /* inode_forget on server side - - invalidate the cache entry */ -#define GFAPI_UP_PARENT_TIMES 0x00000200 /* update parent dir times */ - -#define GFAPI_INODE_UPDATE_FLAGS (GFAPI_UP_NLINK | GFAPI_UP_MODE | \ - GFAPI_UP_OWN | GFAPI_UP_SIZE | \ - GFAPI_UP_TIMES | GFAPI_UP_ATIME) +#define GFAPI_UP_NLINK 0x00000001 /* update nlink */ +#define GFAPI_UP_MODE 0x00000002 /* update mode and ctime */ +#define GFAPI_UP_OWN 0x00000004 /* update mode,uid,gid and ctime */ +#define GFAPI_UP_SIZE 0x00000008 /* update fsize */ +#define GFAPI_UP_TIMES 0x00000010 /* update all times */ +#define GFAPI_UP_ATIME 0x00000020 /* update atime only */ +#define GFAPI_UP_PERM \ + 0x00000040 /* update fields needed for \ + permission checking */ +#define GFAPI_UP_RENAME \ + 0x00000080 /* this is a rename op - \ + delete the cache entry */ +#define GFAPI_UP_FORGET \ + 0x00000100 /* inode_forget on server side - \ + invalidate the cache entry */ +#define GFAPI_UP_PARENT_TIMES 0x00000200 /* update parent dir times */ + +#define GFAPI_INODE_UPDATE_FLAGS \ + (GFAPI_UP_NLINK | GFAPI_UP_MODE | GFAPI_UP_OWN | GFAPI_UP_SIZE | \ + GFAPI_UP_TIMES | GFAPI_UP_ATIME) /* Portability non glibc c++ build systems */ #ifndef __THROW -# if defined __cplusplus -# define __THROW throw () -# else -# define __THROW -# endif +#if defined __cplusplus +#define __THROW throw() +#else +#define __THROW +#endif #endif __BEGIN_DECLS @@ -113,158 +116,150 @@ typedef struct glfs_object glfs_object_t; struct glfs_upcall_inode; typedef struct glfs_upcall_inode glfs_upcall_inode_t; -glfs_object_t* -glfs_upcall_inode_get_object (glfs_upcall_inode_t *arg) __THROW - GFAPI_PUBLIC(glfs_upcall_inode_get_object, 3.7.16); +glfs_object_t * +glfs_upcall_inode_get_object(glfs_upcall_inode_t *arg) __THROW + GFAPI_PUBLIC(glfs_upcall_inode_get_object, 3.7.16); uint64_t -glfs_upcall_inode_get_flags (glfs_upcall_inode_t *arg) __THROW - GFAPI_PUBLIC(glfs_upcall_inode_get_flags, 3.7.16); +glfs_upcall_inode_get_flags(glfs_upcall_inode_t *arg) __THROW + GFAPI_PUBLIC(glfs_upcall_inode_get_flags, 3.7.16); -struct stat* -glfs_upcall_inode_get_stat (glfs_upcall_inode_t *arg) __THROW - GFAPI_PUBLIC(glfs_upcall_inode_get_stat, 3.7.16); +struct stat * +glfs_upcall_inode_get_stat(glfs_upcall_inode_t *arg) __THROW + GFAPI_PUBLIC(glfs_upcall_inode_get_stat, 3.7.16); uint64_t -glfs_upcall_inode_get_expire (glfs_upcall_inode_t *arg) __THROW - GFAPI_PUBLIC(glfs_upcall_inode_get_expire, 3.7.16); - -glfs_object_t* -glfs_upcall_inode_get_pobject (glfs_upcall_inode_t *arg) __THROW - GFAPI_PUBLIC(glfs_upcall_inode_get_pobject, 3.7.16); +glfs_upcall_inode_get_expire(glfs_upcall_inode_t *arg) __THROW + GFAPI_PUBLIC(glfs_upcall_inode_get_expire, 3.7.16); -struct stat* -glfs_upcall_inode_get_pstat (glfs_upcall_inode_t *arg) __THROW - GFAPI_PUBLIC(glfs_upcall_inode_get_pstat, 3.7.16); +glfs_object_t * +glfs_upcall_inode_get_pobject(glfs_upcall_inode_t *arg) __THROW + GFAPI_PUBLIC(glfs_upcall_inode_get_pobject, 3.7.16); -glfs_object_t* -glfs_upcall_inode_get_oldpobject (glfs_upcall_inode_t *arg) __THROW - GFAPI_PUBLIC(glfs_upcall_inode_get_oldpobject, 3.7.16); +struct stat * +glfs_upcall_inode_get_pstat(glfs_upcall_inode_t *arg) __THROW + GFAPI_PUBLIC(glfs_upcall_inode_get_pstat, 3.7.16); -struct stat* -glfs_upcall_inode_get_oldpstat (glfs_upcall_inode_t *arg) __THROW - GFAPI_PUBLIC(glfs_upcall_inode_get_oldpstat, 3.7.16); +glfs_object_t * +glfs_upcall_inode_get_oldpobject(glfs_upcall_inode_t *arg) __THROW + GFAPI_PUBLIC(glfs_upcall_inode_get_oldpobject, 3.7.16); +struct stat * +glfs_upcall_inode_get_oldpstat(glfs_upcall_inode_t *arg) __THROW + GFAPI_PUBLIC(glfs_upcall_inode_get_oldpstat, 3.7.16); /* Handle based operations */ /* Operations that generate handles */ -glfs_object_t* -glfs_h_lookupat (glfs_t *fs, glfs_object_t *parent, const char *path, - struct stat *stat, int follow) __THROW - GFAPI_PUBLIC(glfs_h_lookupat, 3.7.4); - -glfs_object_t* -glfs_h_creat (glfs_t *fs, glfs_object_t *parent, const char *path, - int flags, mode_t mode, struct stat *sb) __THROW - GFAPI_PUBLIC(glfs_h_creat, 3.4.2); - -glfs_object_t* -glfs_h_mkdir (glfs_t *fs, glfs_object_t *parent, const char *path, - mode_t flags, struct stat *sb) __THROW - GFAPI_PUBLIC(glfs_h_mkdir, 3.4.2); - -glfs_object_t* -glfs_h_mknod (glfs_t *fs, glfs_object_t *parent, const char *path, - mode_t mode, dev_t dev, struct stat *sb) __THROW - GFAPI_PUBLIC(glfs_h_mknod, 3.4.2); - -glfs_object_t* -glfs_h_symlink (glfs_t *fs, glfs_object_t *parent, const char *name, - const char *data, struct stat *stat) __THROW - GFAPI_PUBLIC(glfs_h_symlink, 3.4.2); +glfs_object_t * +glfs_h_lookupat(glfs_t *fs, glfs_object_t *parent, const char *path, + struct stat *stat, int follow) __THROW + GFAPI_PUBLIC(glfs_h_lookupat, 3.7.4); + +glfs_object_t * +glfs_h_creat(glfs_t *fs, glfs_object_t *parent, const char *path, int flags, + mode_t mode, struct stat *sb) __THROW + GFAPI_PUBLIC(glfs_h_creat, 3.4.2); + +glfs_object_t * +glfs_h_mkdir(glfs_t *fs, glfs_object_t *parent, const char *path, mode_t flags, + struct stat *sb) __THROW GFAPI_PUBLIC(glfs_h_mkdir, 3.4.2); + +glfs_object_t * +glfs_h_mknod(glfs_t *fs, glfs_object_t *parent, const char *path, mode_t mode, + dev_t dev, struct stat *sb) __THROW + GFAPI_PUBLIC(glfs_h_mknod, 3.4.2); + +glfs_object_t * +glfs_h_symlink(glfs_t *fs, glfs_object_t *parent, const char *name, + const char *data, struct stat *stat) __THROW + GFAPI_PUBLIC(glfs_h_symlink, 3.4.2); /* Operations on the actual objects */ int -glfs_h_unlink (glfs_t *fs, glfs_object_t *parent, const char *path) __THROW - GFAPI_PUBLIC(glfs_h_unlink, 3.4.2); +glfs_h_unlink(glfs_t *fs, glfs_object_t *parent, const char *path) __THROW + GFAPI_PUBLIC(glfs_h_unlink, 3.4.2); int -glfs_h_close (glfs_object_t *object) __THROW - GFAPI_PUBLIC(glfs_h_close, 3.4.2); +glfs_h_close(glfs_object_t *object) __THROW GFAPI_PUBLIC(glfs_h_close, 3.4.2); int -glfs_caller_specific_init (void *uid_caller_key, void *gid_caller_key, - void *future) __THROW - GFAPI_PUBLIC(glfs_caller_specific_init, 3.5.0); +glfs_caller_specific_init(void *uid_caller_key, void *gid_caller_key, + void *future) __THROW + GFAPI_PUBLIC(glfs_caller_specific_init, 3.5.0); int -glfs_h_truncate (glfs_t *fs, glfs_object_t *object, - off_t offset) __THROW - GFAPI_PUBLIC(glfs_h_truncate, 3.4.2); +glfs_h_truncate(glfs_t *fs, glfs_object_t *object, off_t offset) __THROW + GFAPI_PUBLIC(glfs_h_truncate, 3.4.2); int glfs_h_stat(glfs_t *fs, glfs_object_t *object, struct stat *stat) __THROW - GFAPI_PUBLIC(glfs_h_stat, 3.4.2); + GFAPI_PUBLIC(glfs_h_stat, 3.4.2); int glfs_h_statfs(glfs_t *fs, glfs_object_t *object, struct statvfs *stat) __THROW - GFAPI_PUBLIC(glfs_h_statfs, 3.7.0); + GFAPI_PUBLIC(glfs_h_statfs, 3.7.0); int -glfs_h_getattrs (glfs_t *fs, glfs_object_t *object, struct stat *stat) __THROW - GFAPI_PUBLIC(glfs_h_getattrs, 3.4.2); +glfs_h_getattrs(glfs_t *fs, glfs_object_t *object, struct stat *stat) __THROW + GFAPI_PUBLIC(glfs_h_getattrs, 3.4.2); int -glfs_h_getxattrs (glfs_t *fs, glfs_object_t *object, const char *name, - void *value, size_t size) __THROW - GFAPI_PUBLIC(glfs_h_getxattrs, 3.5.1); +glfs_h_getxattrs(glfs_t *fs, glfs_object_t *object, const char *name, + void *value, size_t size) __THROW + GFAPI_PUBLIC(glfs_h_getxattrs, 3.5.1); int -glfs_h_setattrs (glfs_t *fs, glfs_object_t *object, struct stat *sb, - int valid) __THROW - GFAPI_PUBLIC(glfs_h_setattrs, 3.4.2); +glfs_h_setattrs(glfs_t *fs, glfs_object_t *object, struct stat *sb, + int valid) __THROW GFAPI_PUBLIC(glfs_h_setattrs, 3.4.2); int -glfs_h_setxattrs (glfs_t *fs, glfs_object_t *object, const char *name, - const void *value, size_t size, int flags) __THROW - GFAPI_PUBLIC(glfs_h_setxattrs, 3.5.0); +glfs_h_setxattrs(glfs_t *fs, glfs_object_t *object, const char *name, + const void *value, size_t size, int flags) __THROW + GFAPI_PUBLIC(glfs_h_setxattrs, 3.5.0); int -glfs_h_readlink (glfs_t *fs, glfs_object_t *object, char *buf, - size_t bufsiz) __THROW - GFAPI_PUBLIC(glfs_h_readlink, 3.4.2); +glfs_h_readlink(glfs_t *fs, glfs_object_t *object, char *buf, + size_t bufsiz) __THROW GFAPI_PUBLIC(glfs_h_readlink, 3.4.2); int -glfs_h_link (glfs_t *fs, glfs_object_t *linktgt, glfs_object_t *parent, - const char *name) __THROW - GFAPI_PUBLIC(glfs_h_link, 3.4.2); +glfs_h_link(glfs_t *fs, glfs_object_t *linktgt, glfs_object_t *parent, + const char *name) __THROW GFAPI_PUBLIC(glfs_h_link, 3.4.2); int -glfs_h_rename (glfs_t *fs, glfs_object_t *olddir, const char *oldname, - glfs_object_t *newdir, const char *newname) __THROW - GFAPI_PUBLIC(glfs_h_rename, 3.4.2); +glfs_h_rename(glfs_t *fs, glfs_object_t *olddir, const char *oldname, + glfs_object_t *newdir, const char *newname) __THROW + GFAPI_PUBLIC(glfs_h_rename, 3.4.2); int -glfs_h_removexattrs (glfs_t *fs, glfs_object_t *object, - const char *name) __THROW - GFAPI_PUBLIC(glfs_h_removexattrs, 3.5.1); +glfs_h_removexattrs(glfs_t *fs, glfs_object_t *object, const char *name) __THROW + GFAPI_PUBLIC(glfs_h_removexattrs, 3.5.1); /* Operations enabling opaque invariant handle to object transitions */ ssize_t -glfs_h_extract_handle (glfs_object_t *object, unsigned char *handle, - int len) __THROW - GFAPI_PUBLIC(glfs_h_extract_handle, 3.4.2); +glfs_h_extract_handle(glfs_object_t *object, unsigned char *handle, + int len) __THROW + GFAPI_PUBLIC(glfs_h_extract_handle, 3.4.2); /* Given a handle, looks up the inode and creates glfs_object. * In addition, if provided 'stat', copies the inode attributes */ -glfs_object_t* -glfs_h_create_from_handle (glfs_t *fs, unsigned char *handle, int len, - struct stat *stat) __THROW - GFAPI_PUBLIC(glfs_h_create_from_handle, 3.4.2); +glfs_object_t * +glfs_h_create_from_handle(glfs_t *fs, unsigned char *handle, int len, + struct stat *stat) __THROW + GFAPI_PUBLIC(glfs_h_create_from_handle, 3.4.2); /* Operations enabling object handles to fd transitions */ -glfs_fd_t* -glfs_h_opendir (glfs_t *fs, glfs_object_t *object) __THROW - GFAPI_PUBLIC(glfs_h_opendir, 3.4.2); +glfs_fd_t * +glfs_h_opendir(glfs_t *fs, glfs_object_t *object) __THROW + GFAPI_PUBLIC(glfs_h_opendir, 3.4.2); -glfs_fd_t* -glfs_h_open (glfs_t *fs, glfs_object_t *object, int flags) __THROW - GFAPI_PUBLIC(glfs_h_open, 3.4.2); +glfs_fd_t * +glfs_h_open(glfs_t *fs, glfs_object_t *object, int flags) __THROW + GFAPI_PUBLIC(glfs_h_open, 3.4.2); int -glfs_h_access (glfs_t *fs, glfs_object_t *object, int mask) __THROW - GFAPI_PUBLIC(glfs_h_access, 3.6.0); +glfs_h_access(glfs_t *fs, glfs_object_t *object, int mask) __THROW + GFAPI_PUBLIC(glfs_h_access, 3.6.0); /* SYNOPSIS @@ -297,53 +292,50 @@ glfs_h_access (glfs_t *fs, glfs_object_t *object, int mask) __THROW */ int -glfs_h_poll_upcall (glfs_t *fs, glfs_upcall_t **cbk) __THROW - GFAPI_PUBLIC(glfs_h_poll_upcall, 3.7.16); +glfs_h_poll_upcall(glfs_t *fs, glfs_upcall_t **cbk) __THROW + GFAPI_PUBLIC(glfs_h_poll_upcall, 3.7.16); int -glfs_h_acl_set (glfs_t *fs, glfs_object_t *object, const acl_type_t type, - const acl_t acl) __THROW - GFAPI_PUBLIC(glfs_h_acl_set, 3.7.0); +glfs_h_acl_set(glfs_t *fs, glfs_object_t *object, const acl_type_t type, + const acl_t acl) __THROW GFAPI_PUBLIC(glfs_h_acl_set, 3.7.0); acl_t -glfs_h_acl_get (glfs_t *fs, glfs_object_t *object, - const acl_type_t type) __THROW - GFAPI_PUBLIC(glfs_h_acl_get, 3.7.0); +glfs_h_acl_get(glfs_t *fs, glfs_object_t *object, const acl_type_t type) __THROW + GFAPI_PUBLIC(glfs_h_acl_get, 3.7.0); size_t -glfs_h_anonymous_write (glfs_t *fs, glfs_object_t *object, const void *buf, - size_t count, off_t offset) __THROW - GFAPI_PUBLIC(glfs_h_anonymous_write, 3.7.0); +glfs_h_anonymous_write(glfs_t *fs, glfs_object_t *object, const void *buf, + size_t count, off_t offset) __THROW + GFAPI_PUBLIC(glfs_h_anonymous_write, 3.7.0); ssize_t -glfs_h_anonymous_read (glfs_t *fs, glfs_object_t *object, - const void *buf, size_t count, off_t offset) __THROW - GFAPI_PUBLIC(glfs_h_anonymous_read, 3.7.0); +glfs_h_anonymous_read(glfs_t *fs, glfs_object_t *object, const void *buf, + size_t count, off_t offset) __THROW + GFAPI_PUBLIC(glfs_h_anonymous_read, 3.7.0); /* * Caution: The object returned by this object gets freed as part * of 'glfs_free(xstat)'. Make sure to have a copy using 'glfs_object_copy()' * to use post that. */ -glfs_object_t* -glfs_xreaddirplus_get_object (struct glfs_xreaddirp_stat *xstat) __THROW - GFAPI_PUBLIC(glfs_xreaddirplus_get_object, 3.11.0); +glfs_object_t * +glfs_xreaddirplus_get_object(struct glfs_xreaddirp_stat *xstat) __THROW + GFAPI_PUBLIC(glfs_xreaddirplus_get_object, 3.11.0); /* Applications should close the object returned by this routine * explicitly using 'glfs_h_close()' */ -glfs_object_t* -glfs_object_copy (glfs_object_t *src) __THROW - GFAPI_PUBLIC(glfs_object_copy, 3.11.0); +glfs_object_t * +glfs_object_copy(glfs_object_t *src) __THROW + GFAPI_PUBLIC(glfs_object_copy, 3.11.0); int -glfs_h_lease (glfs_t *fs, glfs_object_t *object, glfs_lease_t *lease) __THROW - GFAPI_PUBLIC(glfs_h_lease, 4.0.0); +glfs_h_lease(glfs_t *fs, glfs_object_t *object, glfs_lease_t *lease) __THROW + GFAPI_PUBLIC(glfs_h_lease, 4.0.0); -glfs_object_t* -glfs_h_find_handle (glfs_t *fs, unsigned char *handle, - int len) __THROW - GFAPI_PUBLIC(glfs_h_lease, 4.0.0); +glfs_object_t * +glfs_h_find_handle(glfs_t *fs, unsigned char *handle, int len) __THROW + GFAPI_PUBLIC(glfs_h_lease, 4.0.0); __END_DECLS #endif /* !_GLFS_HANDLES_H */ diff --git a/api/src/glfs-internal.h b/api/src/glfs-internal.h index 52048f4592d..200148e3774 100644 --- a/api/src/glfs-internal.h +++ b/api/src/glfs-internal.h @@ -8,7 +8,6 @@ cases as published by the Free Software Foundation. */ - #ifndef _GLFS_INTERNAL_H #define _GLFS_INTERNAL_H @@ -23,10 +22,10 @@ #define DEFAULT_REVAL_COUNT 1 /* - * According to pthread mutex and conditional variable ( cond, child_down_count, - * upcall mutex and mutex) initialization of struct glfs members, - * below GLFS_INIT_* flags are set in 'pthread_flags' member of struct glfs. - * The flags are set from glfs_init() and glfs_new_from_ctx() functions + * According to pthread mutex and conditional variable ( cond, + * child_down_count, upcall mutex and mutex) initialization of struct glfs + * members, below GLFS_INIT_* flags are set in 'pthread_flags' member of struct + * glfs. The flags are set from glfs_init() and glfs_new_from_ctx() functions * as part of fs inititialization. * * These flag bits are validated in glfs_fini() to destroy all or partially @@ -37,39 +36,42 @@ * */ -#define PTHREAD_MUTEX_INIT(mutex, attr, flags, mask, label) do { \ - int __ret = -1; \ - __ret = pthread_mutex_init (mutex, attr); \ - if (__ret == 0) \ - flags |= mask; \ - else \ - goto label; \ -} while (0) - -#define PTHREAD_MUTEX_DESTROY(mutex, flags, mask) do { \ - if (flags & mask) \ - (void) pthread_mutex_destroy (mutex); \ -} while (0) - -#define PTHREAD_COND_INIT(cond, attr, flags, mask, label) do { \ - int __ret = -1; \ - __ret = pthread_cond_init (cond, attr); \ - if (__ret == 0) \ - flags |= mask; \ - else \ - goto label; \ -} while (0) - -#define PTHREAD_COND_DESTROY(cond, flags, mask) do { \ - if (flags & mask) \ - (void) pthread_cond_destroy (cond); \ -} while (0) - -#define GLFS_INIT_MUTEX 0x00000001 /* pthread_mutex_flag */ -#define GLFS_INIT_COND 0x00000002 /* pthread_cond_flag */ -#define GLFS_INIT_COND_CHILD 0x00000004 /* pthread_cond_child_down_flag */ -#define GLFS_INIT_MUTEX_UPCALL 0x00000008 /* pthread_mutex_upcall_flag */ - +#define PTHREAD_MUTEX_INIT(mutex, attr, flags, mask, label) \ + do { \ + int __ret = -1; \ + __ret = pthread_mutex_init(mutex, attr); \ + if (__ret == 0) \ + flags |= mask; \ + else \ + goto label; \ + } while (0) + +#define PTHREAD_MUTEX_DESTROY(mutex, flags, mask) \ + do { \ + if (flags & mask) \ + (void)pthread_mutex_destroy(mutex); \ + } while (0) + +#define PTHREAD_COND_INIT(cond, attr, flags, mask, label) \ + do { \ + int __ret = -1; \ + __ret = pthread_cond_init(cond, attr); \ + if (__ret == 0) \ + flags |= mask; \ + else \ + goto label; \ + } while (0) + +#define PTHREAD_COND_DESTROY(cond, flags, mask) \ + do { \ + if (flags & mask) \ + (void)pthread_cond_destroy(cond); \ + } while (0) + +#define GLFS_INIT_MUTEX 0x00000001 /* pthread_mutex_flag */ +#define GLFS_INIT_COND 0x00000002 /* pthread_cond_flag */ +#define GLFS_INIT_COND_CHILD 0x00000004 /* pthread_cond_child_down_flag */ +#define GLFS_INIT_MUTEX_UPCALL 0x00000008 /* pthread_mutex_upcall_flag */ #ifndef GF_DARWIN_HOST_OS #ifndef GFAPI_PUBLIC @@ -78,362 +80,367 @@ #ifndef GFAPI_PRIVATE #define GFAPI_PRIVATE(sym, ver) /**/ #endif -#define GFAPI_SYMVER_PUBLIC_DEFAULT(fn, ver) \ - asm(".symver pub_"STR(fn)", "STR(fn)"@@GFAPI_"STR(ver)) +#define GFAPI_SYMVER_PUBLIC_DEFAULT(fn, ver) \ + asm(".symver pub_" STR(fn) ", " STR(fn) "@@GFAPI_" STR(ver)) -#define GFAPI_SYMVER_PRIVATE_DEFAULT(fn, ver) \ - asm(".symver priv_"STR(fn)", "STR(fn)"@@GFAPI_PRIVATE_"STR(ver)) +#define GFAPI_SYMVER_PRIVATE_DEFAULT(fn, ver) \ + asm(".symver priv_" STR(fn) ", " STR(fn) "@@GFAPI_PRIVATE_" STR(ver)) -#define GFAPI_SYMVER_PUBLIC(fn1, fn2, ver) \ - asm(".symver pub_"STR(fn1)", "STR(fn2)"@GFAPI_"STR(ver)) +#define GFAPI_SYMVER_PUBLIC(fn1, fn2, ver) \ + asm(".symver pub_" STR(fn1) ", " STR(fn2) "@GFAPI_" STR(ver)) -#define GFAPI_SYMVER_PRIVATE(fn1, fn2, ver) \ - asm(".symver priv_"STR(fn1)", "STR(fn2)"@GFAPI_PRIVATE_"STR(ver)) +#define GFAPI_SYMVER_PRIVATE(fn1, fn2, ver) \ + asm(".symver priv_" STR(fn1) ", " STR(fn2) "@GFAPI_PRIVATE_" STR(ver)) #define STR(str) #str #else #ifndef GFAPI_PUBLIC #define GFAPI_PUBLIC(sym, ver) __asm("_" __STRING(sym) "$GFAPI_" __STRING(ver)) #endif #ifndef GFAPI_PRIVATE -#define GFAPI_PRIVATE(sym, ver) __asm("_" __STRING(sym) "$GFAPI_PRIVATE_" __STRING(ver)) +#define GFAPI_PRIVATE(sym, ver) \ + __asm("_" __STRING(sym) "$GFAPI_PRIVATE_" __STRING(ver)) #endif -#define GFAPI_SYMVER_PUBLIC_DEFAULT(fn, dotver) /**/ +#define GFAPI_SYMVER_PUBLIC_DEFAULT(fn, dotver) /**/ #define GFAPI_SYMVER_PRIVATE_DEFAULT(fn, dotver) /**/ -#define GFAPI_SYMVER_PUBLIC(fn1, fn2, dotver) /**/ -#define GFAPI_SYMVER_PRIVATE(fn1, fn2, dotver) /**/ +#define GFAPI_SYMVER_PUBLIC(fn1, fn2, dotver) /**/ +#define GFAPI_SYMVER_PRIVATE(fn1, fn2, dotver) /**/ #endif -#define ESTALE_RETRY(ret,errno,reval,loc,label) do { \ - if (ret == -1 && errno == ESTALE) { \ - if (reval < DEFAULT_REVAL_COUNT) { \ - reval++; \ - loc_wipe (loc); \ - goto label; \ - } \ - } \ - } while (0) - -#define GLFS_LOC_FILL_INODE(oinode, loc, label) do { \ - loc.inode = inode_ref (oinode); \ - gf_uuid_copy (loc.gfid, oinode->gfid); \ - ret = glfs_loc_touchup (&loc); \ - if (ret != 0) { \ - errno = EINVAL; \ - goto label; \ - } \ - } while (0) - -#define GLFS_LOC_FILL_PINODE(pinode, loc, ret, errno, label, path) do { \ - loc.inode = inode_new (pinode->table); \ - if (!loc.inode) { \ - ret = -1; \ - errno = ENOMEM; \ - goto label; \ - } \ - loc.parent = inode_ref (pinode); \ - loc.name = path; \ - ret = glfs_loc_touchup (&loc); \ - if (ret != 0) { \ - errno = EINVAL; \ - goto label; \ - } \ - } while (0) +#define ESTALE_RETRY(ret, errno, reval, loc, label) \ + do { \ + if (ret == -1 && errno == ESTALE) { \ + if (reval < DEFAULT_REVAL_COUNT) { \ + reval++; \ + loc_wipe(loc); \ + goto label; \ + } \ + } \ + } while (0) + +#define GLFS_LOC_FILL_INODE(oinode, loc, label) \ + do { \ + loc.inode = inode_ref(oinode); \ + gf_uuid_copy(loc.gfid, oinode->gfid); \ + ret = glfs_loc_touchup(&loc); \ + if (ret != 0) { \ + errno = EINVAL; \ + goto label; \ + } \ + } while (0) + +#define GLFS_LOC_FILL_PINODE(pinode, loc, ret, errno, label, path) \ + do { \ + loc.inode = inode_new(pinode->table); \ + if (!loc.inode) { \ + ret = -1; \ + errno = ENOMEM; \ + goto label; \ + } \ + loc.parent = inode_ref(pinode); \ + loc.name = path; \ + ret = glfs_loc_touchup(&loc); \ + if (ret != 0) { \ + errno = EINVAL; \ + goto label; \ + } \ + } while (0) struct glfs; struct _upcall_entry { - struct list_head upcall_list; - struct gf_upcall upcall_data; + struct list_head upcall_list; + struct gf_upcall upcall_data; }; typedef struct _upcall_entry upcall_entry; -typedef int (*glfs_init_cbk) (struct glfs *fs, int ret); +typedef int (*glfs_init_cbk)(struct glfs *fs, int ret); struct glfs { - char *volname; - uuid_t vol_uuid; + char *volname; + uuid_t vol_uuid; - glusterfs_ctx_t *ctx; + glusterfs_ctx_t *ctx; - pthread_t poller; + pthread_t poller; - glfs_init_cbk init_cbk; - pthread_mutex_t mutex; - pthread_cond_t cond; - pthread_cond_t child_down_cond; /* for broadcasting CHILD_DOWN */ - int init; - int ret; - int err; + glfs_init_cbk init_cbk; + pthread_mutex_t mutex; + pthread_cond_t cond; + pthread_cond_t child_down_cond; /* for broadcasting CHILD_DOWN */ + int init; + int ret; + int err; - xlator_t *active_subvol; /* active graph */ - xlator_t *mip_subvol; /* graph for which migration is in - * progress */ - xlator_t *next_subvol; /* Any new graph is put to - * next_subvol, the graph in - * next_subvol can either be moved - * to mip_subvol (if any IO picks it - * up for migration), or be - * destroyed (if there is a new - * graph, and this was never picked - * for migration) */ - xlator_t *old_subvol; + xlator_t *active_subvol; /* active graph */ + xlator_t *mip_subvol; /* graph for which migration is in + * progress */ + xlator_t *next_subvol; /* Any new graph is put to + * next_subvol, the graph in + * next_subvol can either be moved + * to mip_subvol (if any IO picks it + * up for migration), or be + * destroyed (if there is a new + * graph, and this was never picked + * for migration) */ + xlator_t *old_subvol; - char *oldvolfile; - ssize_t oldvollen; + char *oldvolfile; + ssize_t oldvollen; - inode_t *cwd; + inode_t *cwd; - uint32_t dev_id; /* Used to fill st_dev in struct stat */ + uint32_t dev_id; /* Used to fill st_dev in struct stat */ - struct list_head openfds; + struct list_head openfds; - gf_boolean_t migration_in_progress; + gf_boolean_t migration_in_progress; - gf_boolean_t cache_upcalls; /* add upcalls to the upcall_list? */ - struct list_head upcall_list; - pthread_mutex_t upcall_list_mutex; /* mutex for upcall entry list */ + gf_boolean_t cache_upcalls; /* add upcalls to the upcall_list? */ + struct list_head upcall_list; + pthread_mutex_t upcall_list_mutex; /* mutex for upcall entry list */ - uint32_t pin_refcnt; - uint32_t pthread_flags; /* GLFS_INIT_* # defines set this flag */ + uint32_t pin_refcnt; + uint32_t pthread_flags; /* GLFS_INIT_* # defines set this flag */ - uint32_t upcall_events; /* Mask of upcall events application - * is interested in */ - glfs_upcall_cbk up_cbk; /* upcall cbk function to be registered */ - void *up_data; /* Opaque data provided by application - * during upcall registration */ + uint32_t upcall_events; /* Mask of upcall events application + * is interested in */ + glfs_upcall_cbk up_cbk; /* upcall cbk function to be registered */ + void *up_data; /* Opaque data provided by application + * during upcall registration */ }; /* This enum is used to maintain the state of glfd. In case of async fops * fd might be closed before the actual fop is complete. Therefore we need * to track whether the fd is closed or not, instead actually closing it.*/ -enum glfs_fd_state { - GLFD_INIT, - GLFD_OPEN, - GLFD_CLOSE -}; +enum glfs_fd_state { GLFD_INIT, GLFD_OPEN, GLFD_CLOSE }; struct glfs_fd { - struct list_head openfds; - struct list_head list; - GF_REF_DECL; - struct glfs *fs; - enum glfs_fd_state state; - off_t offset; - fd_t *fd; /* Currently guared by @fs->mutex. TODO: per-glfd lock */ - struct list_head entries; - gf_dirent_t *next; - struct dirent *readdirbuf; - gf_lkowner_t lk_owner; - glfs_leaseid_t lease_id; /* Stores lease_id of client in glfd */ - gf_lock_t lock; /* lock taken before updating fd state */ - glfs_recall_cbk cbk; - void *cookie; + struct list_head openfds; + struct list_head list; + GF_REF_DECL; + struct glfs *fs; + enum glfs_fd_state state; + off_t offset; + fd_t *fd; /* Currently guared by @fs->mutex. TODO: per-glfd lock */ + struct list_head entries; + gf_dirent_t *next; + struct dirent *readdirbuf; + gf_lkowner_t lk_owner; + glfs_leaseid_t lease_id; /* Stores lease_id of client in glfd */ + gf_lock_t lock; /* lock taken before updating fd state */ + glfs_recall_cbk cbk; + void *cookie; }; /* glfs object handle introduced for the alternate gfapi implementation based on glfs handles/gfid/inode */ struct glfs_object { - inode_t *inode; - uuid_t gfid; + inode_t *inode; + uuid_t gfid; }; struct glfs_upcall { - struct glfs *fs; /* glfs object */ - enum glfs_upcall_reason reason; /* Upcall event type */ - void *event; /* changes based in the event type */ - void (*free_event)(void *); /* free event after the usage */ + struct glfs *fs; /* glfs object */ + enum glfs_upcall_reason reason; /* Upcall event type */ + void *event; /* changes based in the event type */ + void (*free_event)(void *); /* free event after the usage */ }; struct glfs_upcall_inode { - struct glfs_object *object; /* Object which need to be acted upon */ - int flags; /* Cache UPDATE/INVALIDATE flags */ - struct stat buf; /* Latest stat of this entry */ - unsigned int expire_time_attr; /* the amount of time for which - * the application need to cache - * this entry */ - struct glfs_object *p_object; /* parent Object to be updated */ - struct stat p_buf; /* Latest stat of parent dir handle */ - struct glfs_object *oldp_object; /* Old parent Object to be updated */ - struct stat oldp_buf; /* Latest stat of old parent dir handle */ + struct glfs_object *object; /* Object which need to be acted upon */ + int flags; /* Cache UPDATE/INVALIDATE flags */ + struct stat buf; /* Latest stat of this entry */ + unsigned int expire_time_attr; /* the amount of time for which + * the application need to cache + * this entry */ + struct glfs_object *p_object; /* parent Object to be updated */ + struct stat p_buf; /* Latest stat of parent dir handle */ + struct glfs_object *oldp_object; /* Old parent Object to be updated */ + struct stat oldp_buf; /* Latest stat of old parent dir handle */ }; struct glfs_upcall_lease { - struct glfs_object *object; /* Object which need to be acted upon */ - uint32_t lease_type; /* Lease type to which client can downgrade to*/ + struct glfs_object *object; /* Object which need to be acted upon */ + uint32_t lease_type; /* Lease type to which client can downgrade to*/ }; struct glfs_upcall_lease_fd { - uint32_t lease_type; /* Lease type to which client can downgrade to*/ - void *fd_cookie; /* Object which need to be acted upon */ + uint32_t lease_type; /* Lease type to which client can downgrade to*/ + void *fd_cookie; /* Object which need to be acted upon */ }; struct glfs_xreaddirp_stat { - struct stat st; /* Stat for that dirent - corresponds to GFAPI_XREADDIRP_STAT */ - struct glfs_object *object; /* handled for GFAPI_XREADDIRP_HANDLE */ - uint32_t flags_handled; /* final set of flags successfulyy handled */ + struct stat + st; /* Stat for that dirent - corresponds to GFAPI_XREADDIRP_STAT */ + struct glfs_object *object; /* handled for GFAPI_XREADDIRP_HANDLE */ + uint32_t flags_handled; /* final set of flags successfulyy handled */ }; -#define DEFAULT_EVENT_POOL_SIZE 16384 -#define GF_MEMPOOL_COUNT_OF_DICT_T 4096 -#define GF_MEMPOOL_COUNT_OF_DATA_T (GF_MEMPOOL_COUNT_OF_DICT_T * 4) -#define GF_MEMPOOL_COUNT_OF_DATA_PAIR_T (GF_MEMPOOL_COUNT_OF_DICT_T * 4) +#define DEFAULT_EVENT_POOL_SIZE 16384 +#define GF_MEMPOOL_COUNT_OF_DICT_T 4096 +#define GF_MEMPOOL_COUNT_OF_DATA_T (GF_MEMPOOL_COUNT_OF_DICT_T * 4) +#define GF_MEMPOOL_COUNT_OF_DATA_PAIR_T (GF_MEMPOOL_COUNT_OF_DICT_T * 4) -#define GF_MEMPOOL_COUNT_OF_LRU_BUF_T 256 +#define GF_MEMPOOL_COUNT_OF_LRU_BUF_T 256 -typedef void (glfs_mem_release_t) (void *ptr); +typedef void(glfs_mem_release_t)(void *ptr); struct glfs_mem_header { - uint32_t magic; - size_t nmemb; - size_t size; - glfs_mem_release_t *release; + uint32_t magic; + size_t nmemb; + size_t size; + glfs_mem_release_t *release; }; -#define GLFS_MEM_HEADER_SIZE (sizeof (struct glfs_mem_header)) +#define GLFS_MEM_HEADER_SIZE (sizeof(struct glfs_mem_header)) #define GLFS_MEM_HEADER_MAGIC 0x20170830 static inline void * -__glfs_calloc (size_t nmemb, size_t size, glfs_mem_release_t release, - uint32_t type, const char *typestr) +__glfs_calloc(size_t nmemb, size_t size, glfs_mem_release_t release, + uint32_t type, const char *typestr) { - struct glfs_mem_header *header = NULL; + struct glfs_mem_header *header = NULL; - header = __gf_calloc(nmemb, (size + GLFS_MEM_HEADER_SIZE), - type, typestr); - if (!header) - return NULL; + header = __gf_calloc(nmemb, (size + GLFS_MEM_HEADER_SIZE), type, typestr); + if (!header) + return NULL; - header->magic = GLFS_MEM_HEADER_MAGIC; - header->nmemb = nmemb; - header->size = size; - header->release = release; + header->magic = GLFS_MEM_HEADER_MAGIC; + header->nmemb = nmemb; + header->size = size; + header->release = release; - return header + 1; + return header + 1; } static inline void * -__glfs_malloc (size_t size, glfs_mem_release_t release, - uint32_t type, const char *typestr) +__glfs_malloc(size_t size, glfs_mem_release_t release, uint32_t type, + const char *typestr) { - struct glfs_mem_header *header = NULL; + struct glfs_mem_header *header = NULL; - header = __gf_malloc((size + GLFS_MEM_HEADER_SIZE), type, typestr); - if (!header) - return NULL; + header = __gf_malloc((size + GLFS_MEM_HEADER_SIZE), type, typestr); + if (!header) + return NULL; - header->magic = GLFS_MEM_HEADER_MAGIC; - header->nmemb = 1; - header->size = size; - header->release = release; + header->magic = GLFS_MEM_HEADER_MAGIC; + header->nmemb = 1; + header->size = size; + header->release = release; - return header + 1; + return header + 1; } static inline void * -__glfs_realloc (void *ptr, size_t size) +__glfs_realloc(void *ptr, size_t size) { - struct glfs_mem_header *old_header = NULL; - struct glfs_mem_header *new_header = NULL; - struct glfs_mem_header tmp_header; - void *new_ptr = NULL; + struct glfs_mem_header *old_header = NULL; + struct glfs_mem_header *new_header = NULL; + struct glfs_mem_header tmp_header; + void *new_ptr = NULL; - GF_ASSERT (NULL != ptr); + GF_ASSERT(NULL != ptr); - old_header = (struct glfs_mem_header *) (ptr - GLFS_MEM_HEADER_SIZE); - GF_ASSERT (old_header->magic == GLFS_MEM_HEADER_MAGIC); - tmp_header = *old_header; + old_header = (struct glfs_mem_header *)(ptr - GLFS_MEM_HEADER_SIZE); + GF_ASSERT(old_header->magic == GLFS_MEM_HEADER_MAGIC); + tmp_header = *old_header; - new_ptr = __gf_realloc (old_header, (size + GLFS_MEM_HEADER_SIZE)); - if (!new_ptr) - return NULL; + new_ptr = __gf_realloc(old_header, (size + GLFS_MEM_HEADER_SIZE)); + if (!new_ptr) + return NULL; - new_header = (struct glfs_mem_header *) new_ptr; - *new_header = tmp_header; - new_header->size = size; + new_header = (struct glfs_mem_header *)new_ptr; + *new_header = tmp_header; + new_header->size = size; - return new_header + 1; + return new_header + 1; } static inline void -__glfs_free (void *free_ptr) +__glfs_free(void *free_ptr) { - struct glfs_mem_header *header = NULL; - void *release_ptr = NULL; - int i = 0; - - if (!free_ptr) - return; - - header = (struct glfs_mem_header *) (free_ptr - GLFS_MEM_HEADER_SIZE); - GF_ASSERT (header->magic == GLFS_MEM_HEADER_MAGIC); - - if (header->release) { - release_ptr = free_ptr; - for (i = 0; i < header->nmemb; i++) { - header->release (release_ptr); - release_ptr += header->size; - } + struct glfs_mem_header *header = NULL; + void *release_ptr = NULL; + int i = 0; + + if (!free_ptr) + return; + + header = (struct glfs_mem_header *)(free_ptr - GLFS_MEM_HEADER_SIZE); + GF_ASSERT(header->magic == GLFS_MEM_HEADER_MAGIC); + + if (header->release) { + release_ptr = free_ptr; + for (i = 0; i < header->nmemb; i++) { + header->release(release_ptr); + release_ptr += header->size; } + } - __gf_free (header); + __gf_free(header); } -#define GLFS_CALLOC(nmemb, size, release, type) \ - __glfs_calloc (nmemb, size, release, type, #type) +#define GLFS_CALLOC(nmemb, size, release, type) \ + __glfs_calloc(nmemb, size, release, type, #type) -#define GLFS_MALLOC(size, release, type) \ - __glfs_malloc (size, release, type, #type) +#define GLFS_MALLOC(size, release, type) \ + __glfs_malloc(size, release, type, #type) #define GLFS_REALLOC(ptr, size) __glfs_realloc(ptr, size) #define GLFS_FREE(free_ptr) __glfs_free(free_ptr) -int glfs_mgmt_init (struct glfs *fs); -void glfs_init_done (struct glfs *fs, int ret) - GFAPI_PRIVATE(glfs_init_done, 3.4.0); -int glfs_process_volfp (struct glfs *fs, FILE *fp); -int glfs_resolve (struct glfs *fs, xlator_t *subvol, const char *path, - loc_t *loc, struct iatt *iatt, int reval) - GFAPI_PRIVATE(glfs_resolve, 3.7.0); -int glfs_lresolve (struct glfs *fs, xlator_t *subvol, const char *path, loc_t *loc, - struct iatt *iatt, int reval); -fd_t *glfs_resolve_fd (struct glfs *fs, xlator_t *subvol, struct glfs_fd *glfd); - -fd_t *__glfs_migrate_fd (struct glfs *fs, xlator_t *subvol, struct glfs_fd *glfd); - -int glfs_first_lookup (xlator_t *subvol); - -void glfs_process_upcall_event (struct glfs *fs, void *data) - GFAPI_PRIVATE(glfs_process_upcall_event, 3.7.0); - - -#define __GLFS_ENTRY_VALIDATE_FS(fs, label) \ -do { \ - if (!fs) { \ - errno = EINVAL; \ - goto label; \ - } \ - old_THIS = THIS; \ - THIS = fs->ctx->master; \ -} while (0) - -#define __GLFS_EXIT_FS \ -do { \ - THIS = old_THIS; \ -} while (0) - -#define __GLFS_ENTRY_VALIDATE_FD(glfd, label) \ -do { \ - if (!glfd || !glfd->fd || !glfd->fd->inode || \ - glfd->state != GLFD_OPEN) { \ - errno = EBADF; \ - goto label; \ - } \ - old_THIS = THIS; \ - THIS = glfd->fd->inode->table->xl->ctx->master; \ -} while (0) +int +glfs_mgmt_init(struct glfs *fs); +void +glfs_init_done(struct glfs *fs, int ret) GFAPI_PRIVATE(glfs_init_done, 3.4.0); +int +glfs_process_volfp(struct glfs *fs, FILE *fp); +int +glfs_resolve(struct glfs *fs, xlator_t *subvol, const char *path, loc_t *loc, + struct iatt *iatt, int reval) GFAPI_PRIVATE(glfs_resolve, 3.7.0); +int +glfs_lresolve(struct glfs *fs, xlator_t *subvol, const char *path, loc_t *loc, + struct iatt *iatt, int reval); +fd_t * +glfs_resolve_fd(struct glfs *fs, xlator_t *subvol, struct glfs_fd *glfd); + +fd_t * +__glfs_migrate_fd(struct glfs *fs, xlator_t *subvol, struct glfs_fd *glfd); +int +glfs_first_lookup(xlator_t *subvol); + +void +glfs_process_upcall_event(struct glfs *fs, void *data) + GFAPI_PRIVATE(glfs_process_upcall_event, 3.7.0); + +#define __GLFS_ENTRY_VALIDATE_FS(fs, label) \ + do { \ + if (!fs) { \ + errno = EINVAL; \ + goto label; \ + } \ + old_THIS = THIS; \ + THIS = fs->ctx->master; \ + } while (0) + +#define __GLFS_EXIT_FS \ + do { \ + THIS = old_THIS; \ + } while (0) + +#define __GLFS_ENTRY_VALIDATE_FD(glfd, label) \ + do { \ + if (!glfd || !glfd->fd || !glfd->fd->inode || \ + glfd->state != GLFD_OPEN) { \ + errno = EBADF; \ + goto label; \ + } \ + old_THIS = THIS; \ + THIS = glfd->fd->inode->table->xl->ctx->master; \ + } while (0) /* By default all lock attempts from user context must @@ -454,62 +461,78 @@ do { \ rpc replies. */ static inline int -glfs_lock (struct glfs *fs, gf_boolean_t wait_for_migration) +glfs_lock(struct glfs *fs, gf_boolean_t wait_for_migration) { - pthread_mutex_lock (&fs->mutex); + pthread_mutex_lock(&fs->mutex); - while (!fs->init) - pthread_cond_wait (&fs->cond, &fs->mutex); + while (!fs->init) + pthread_cond_wait(&fs->cond, &fs->mutex); - while (wait_for_migration && fs->migration_in_progress) - pthread_cond_wait (&fs->cond, &fs->mutex); + while (wait_for_migration && fs->migration_in_progress) + pthread_cond_wait(&fs->cond, &fs->mutex); - return 0; + return 0; } - static inline void -glfs_unlock (struct glfs *fs) +glfs_unlock(struct glfs *fs) { - pthread_mutex_unlock (&fs->mutex); + pthread_mutex_unlock(&fs->mutex); } -struct glfs_fd *glfs_fd_new (struct glfs *fs); -void glfs_fd_bind (struct glfs_fd *glfd); -void glfd_set_state_bind (struct glfs_fd *glfd); - -xlator_t *glfs_active_subvol (struct glfs *fs) - GFAPI_PRIVATE(glfs_active_subvol, 3.4.0); -xlator_t *__glfs_active_subvol (struct glfs *fs); -void glfs_subvol_done (struct glfs *fs, xlator_t *subvol) - GFAPI_PRIVATE(glfs_subvol_done, 3.4.0); - -inode_t *glfs_refresh_inode (xlator_t *subvol, inode_t *inode); - -inode_t *glfs_cwd_get (struct glfs *fs); -int glfs_cwd_set (struct glfs *fs, inode_t *inode); -inode_t *glfs_resolve_inode (struct glfs *fs, xlator_t *subvol, - struct glfs_object *object); -int glfs_create_object (loc_t *loc, struct glfs_object **retobject); -int __glfs_cwd_set (struct glfs *fs, inode_t *inode); - -int glfs_resolve_base (struct glfs *fs, xlator_t *subvol, inode_t *inode, - struct iatt *iatt); - -int glfs_resolve_at (struct glfs *fs, xlator_t *subvol, inode_t *at, - const char *origpath, loc_t *loc, struct iatt *iatt, - int follow, int reval) - GFAPI_PRIVATE(glfs_resolve_at, 3.4.0); -int glfs_loc_touchup (loc_t *loc) - GFAPI_PRIVATE(glfs_loc_touchup, 3.4.0); -void glfs_iatt_to_stat (struct glfs *fs, struct iatt *iatt, struct stat *stat); -int glfs_loc_link (loc_t *loc, struct iatt *iatt); -int glfs_loc_unlink (loc_t *loc); -int glfs_getxattr_process (void *value, size_t size, dict_t *xattr, - const char *name); +struct glfs_fd * +glfs_fd_new(struct glfs *fs); +void +glfs_fd_bind(struct glfs_fd *glfd); +void +glfd_set_state_bind(struct glfs_fd *glfd); + +xlator_t * +glfs_active_subvol(struct glfs *fs) GFAPI_PRIVATE(glfs_active_subvol, 3.4.0); +xlator_t * +__glfs_active_subvol(struct glfs *fs); +void +glfs_subvol_done(struct glfs *fs, xlator_t *subvol) + GFAPI_PRIVATE(glfs_subvol_done, 3.4.0); + +inode_t * +glfs_refresh_inode(xlator_t *subvol, inode_t *inode); + +inode_t * +glfs_cwd_get(struct glfs *fs); +int +glfs_cwd_set(struct glfs *fs, inode_t *inode); +inode_t * +glfs_resolve_inode(struct glfs *fs, xlator_t *subvol, + struct glfs_object *object); +int +glfs_create_object(loc_t *loc, struct glfs_object **retobject); +int +__glfs_cwd_set(struct glfs *fs, inode_t *inode); + +int +glfs_resolve_base(struct glfs *fs, xlator_t *subvol, inode_t *inode, + struct iatt *iatt); + +int +glfs_resolve_at(struct glfs *fs, xlator_t *subvol, inode_t *at, + const char *origpath, loc_t *loc, struct iatt *iatt, int follow, + int reval) GFAPI_PRIVATE(glfs_resolve_at, 3.4.0); +int +glfs_loc_touchup(loc_t *loc) GFAPI_PRIVATE(glfs_loc_touchup, 3.4.0); +void +glfs_iatt_to_stat(struct glfs *fs, struct iatt *iatt, struct stat *stat); +int +glfs_loc_link(loc_t *loc, struct iatt *iatt); +int +glfs_loc_unlink(loc_t *loc); +int +glfs_getxattr_process(void *value, size_t size, dict_t *xattr, + const char *name); /* Sends RPC call to glusterd to fetch required volume info */ -int glfs_get_volume_info (struct glfs *fs); +int +glfs_get_volume_info(struct glfs *fs); /* SYNOPSIS @@ -535,8 +558,8 @@ int glfs_get_volume_info (struct glfs *fs); NULL : Otherwise. */ -struct glfs *glfs_new_from_ctx (glusterfs_ctx_t *ctx) - GFAPI_PRIVATE(glfs_new_from_ctx, 3.7.0); +struct glfs * +glfs_new_from_ctx(glusterfs_ctx_t *ctx) GFAPI_PRIVATE(glfs_new_from_ctx, 3.7.0); /* SYNOPSIS @@ -562,35 +585,33 @@ struct glfs *glfs_new_from_ctx (glusterfs_ctx_t *ctx) */ void -glfs_free_from_ctx (struct glfs *fs) - GFAPI_PRIVATE(glfs_free_from_ctx, 3.7.0); +glfs_free_from_ctx(struct glfs *fs) GFAPI_PRIVATE(glfs_free_from_ctx, 3.7.0); int -glfs_recall_lease_fd (struct glfs *fs, struct gf_upcall *up_data); +glfs_recall_lease_fd(struct glfs *fs, struct gf_upcall *up_data); int -glfs_recall_lease_upcall (struct glfs *fs, struct glfs_upcall *up_arg, - struct gf_upcall *up_data); +glfs_recall_lease_upcall(struct glfs *fs, struct glfs_upcall *up_arg, + struct gf_upcall *up_data); int -glfs_get_upcall_cache_invalidation (struct gf_upcall *to_up_data, - struct gf_upcall *from_up_data); +glfs_get_upcall_cache_invalidation(struct gf_upcall *to_up_data, + struct gf_upcall *from_up_data); int -glfs_h_poll_cache_invalidation (struct glfs *fs, - struct glfs_upcall *up_arg, - struct gf_upcall *upcall_data); +glfs_h_poll_cache_invalidation(struct glfs *fs, struct glfs_upcall *up_arg, + struct gf_upcall *upcall_data); ssize_t -glfs_anonymous_preadv (struct glfs *fs, struct glfs_object *object, - const struct iovec *iovec, int iovcnt, - off_t offset, int flags); +glfs_anonymous_preadv(struct glfs *fs, struct glfs_object *object, + const struct iovec *iovec, int iovcnt, off_t offset, + int flags); ssize_t -glfs_anonymous_pwritev (struct glfs *fs, struct glfs_object *object, - const struct iovec *iovec, int iovcnt, - off_t offset, int flags); +glfs_anonymous_pwritev(struct glfs *fs, struct glfs_object *object, + const struct iovec *iovec, int iovcnt, off_t offset, + int flags); struct glfs_object * -glfs_h_resolve_symlink (struct glfs *fs, struct glfs_object *object); +glfs_h_resolve_symlink(struct glfs *fs, struct glfs_object *object); /* Deprecated structures that were passed to client applications, replaced by * accessor functions. Do not use these in new applications, and update older @@ -601,52 +622,53 @@ glfs_h_resolve_symlink (struct glfs *fs, struct glfs_object *object); * WARNING: These structures will be removed in the future. */ struct glfs_callback_arg { - struct glfs *fs; - enum glfs_upcall_reason reason; - void *event_arg; + struct glfs *fs; + enum glfs_upcall_reason reason; + void *event_arg; }; struct glfs_callback_inode_arg { - struct glfs_object *object; /* Object which need to be acted upon */ - int flags; /* Cache UPDATE/INVALIDATE flags */ - struct stat buf; /* Latest stat of this entry */ - unsigned int expire_time_attr; /* the amount of time for which - * the application need to cache - * this entry - */ - struct glfs_object *p_object; /* parent Object to be updated */ - struct stat p_buf; /* Latest stat of parent dir handle */ - struct glfs_object *oldp_object; /* Old parent Object - * to be updated */ - struct stat oldp_buf; /* Latest stat of old parent - * dir handle */ + struct glfs_object *object; /* Object which need to be acted upon */ + int flags; /* Cache UPDATE/INVALIDATE flags */ + struct stat buf; /* Latest stat of this entry */ + unsigned int expire_time_attr; /* the amount of time for which + * the application need to cache + * this entry + */ + struct glfs_object *p_object; /* parent Object to be updated */ + struct stat p_buf; /* Latest stat of parent dir handle */ + struct glfs_object *oldp_object; /* Old parent Object + * to be updated */ + struct stat oldp_buf; /* Latest stat of old parent + * dir handle */ }; struct dirent * -glfs_readdirbuf_get (struct glfs_fd *glfd); +glfs_readdirbuf_get(struct glfs_fd *glfd); gf_dirent_t * -glfd_entry_next (struct glfs_fd *glfd, int plus); +glfd_entry_next(struct glfs_fd *glfd, int plus); void -gf_dirent_to_dirent (gf_dirent_t *gf_dirent, struct dirent *dirent); +gf_dirent_to_dirent(gf_dirent_t *gf_dirent, struct dirent *dirent); void -gf_lease_to_glfs_lease (struct gf_lease *gf_lease, struct glfs_lease *lease); +gf_lease_to_glfs_lease(struct gf_lease *gf_lease, struct glfs_lease *lease); void -glfs_lease_to_gf_lease (struct glfs_lease *lease, struct gf_lease *gf_lease); +glfs_lease_to_gf_lease(struct glfs_lease *lease, struct gf_lease *gf_lease); -void glfs_release_upcall (void *ptr); +void +glfs_release_upcall(void *ptr); int -get_fop_attr_glfd (dict_t **fop_attr, struct glfs_fd *glfd); +get_fop_attr_glfd(dict_t **fop_attr, struct glfs_fd *glfd); int -set_fop_attr_glfd (struct glfs_fd *glfd); +set_fop_attr_glfd(struct glfs_fd *glfd); int -get_fop_attr_thrd_key (dict_t **fop_attr); +get_fop_attr_thrd_key(dict_t **fop_attr); void -unset_fop_attr (dict_t **fop_attr); +unset_fop_attr(dict_t **fop_attr); #endif /* !_GLFS_INTERNAL_H */ diff --git a/api/src/glfs-mem-types.h b/api/src/glfs-mem-types.h index 7bfa8c98c0f..e1316d128af 100644 --- a/api/src/glfs-mem-types.h +++ b/api/src/glfs-mem-types.h @@ -16,20 +16,20 @@ #define GF_MEM_TYPE_START (gf_common_mt_end + 1) enum glfs_mem_types_ { - glfs_mt_call_pool_t = GF_MEM_TYPE_START, - glfs_mt_xlator_t, - glfs_mt_glfs_fd_t, - glfs_mt_glfs_io_t, - glfs_mt_volfile_t, - glfs_mt_xlator_cmdline_option_t, - glfs_mt_server_cmdline_t, - glfs_mt_glfs_object_t, - glfs_mt_readdirbuf_t, - glfs_mt_upcall_entry_t, - glfs_mt_acl_t, - glfs_mt_upcall_inode_t, - glfs_mt_realpath_t, - glfs_mt_xreaddirp_stat_t, - glfs_mt_end + glfs_mt_call_pool_t = GF_MEM_TYPE_START, + glfs_mt_xlator_t, + glfs_mt_glfs_fd_t, + glfs_mt_glfs_io_t, + glfs_mt_volfile_t, + glfs_mt_xlator_cmdline_option_t, + glfs_mt_server_cmdline_t, + glfs_mt_glfs_object_t, + glfs_mt_readdirbuf_t, + glfs_mt_upcall_entry_t, + glfs_mt_acl_t, + glfs_mt_upcall_inode_t, + glfs_mt_realpath_t, + glfs_mt_xreaddirp_stat_t, + glfs_mt_end }; #endif diff --git a/api/src/glfs.h b/api/src/glfs.h index 3681cd11450..a007602fc8d 100644 --- a/api/src/glfs.h +++ b/api/src/glfs.h @@ -8,7 +8,6 @@ cases as published by the Free Software Foundation. */ - #ifndef _GLFS_H #define _GLFS_H @@ -52,19 +51,20 @@ typedef int acl_type_t; /* Portability non glibc c++ build systems */ #ifndef __THROW -# if defined __cplusplus -# define __THROW throw () -# else -# define __THROW -# endif +#if defined __cplusplus +#define __THROW throw() +#else +#define __THROW +#endif #endif #ifndef GF_DARWIN_HOST_OS -#define GFAPI_PUBLIC(sym, ver) /**/ +#define GFAPI_PUBLIC(sym, ver) /**/ #define GFAPI_PRIVATE(sym, ver) /**/ #else #define GFAPI_PUBLIC(sym, ver) __asm("_" __STRING(sym) "$GFAPI_" __STRING(ver)) -#define GFAPI_PRIVATE(sym, ver) __asm("_" __STRING(sym) "$GFAPI_PRIVATE_" __STRING(ver)) +#define GFAPI_PRIVATE(sym, ver) \ + __asm("_" __STRING(sym) "$GFAPI_PRIVATE_" __STRING(ver)) #endif __BEGIN_DECLS @@ -103,9 +103,8 @@ typedef struct glfs glfs_t; */ -glfs_t *glfs_new (const char *volname) __THROW - GFAPI_PUBLIC(glfs_new, 3.4.0); - +glfs_t * +glfs_new(const char *volname) __THROW GFAPI_PUBLIC(glfs_new, 3.4.0); /* SYNOPSIS @@ -134,9 +133,9 @@ glfs_t *glfs_new (const char *volname) __THROW */ -int glfs_set_volfile (glfs_t *fs, const char *volfile) __THROW - GFAPI_PUBLIC(glfs_set_volfile, 3.4.0); - +int +glfs_set_volfile(glfs_t *fs, const char *volfile) __THROW + GFAPI_PUBLIC(glfs_set_volfile, 3.4.0); /* SYNOPSIS @@ -188,14 +187,14 @@ int glfs_set_volfile (glfs_t *fs, const char *volfile) __THROW */ int -glfs_set_volfile_server (glfs_t *fs, const char *transport, - const char *host, int port) __THROW - GFAPI_PUBLIC(glfs_set_volfile_server, 3.4.0); +glfs_set_volfile_server(glfs_t *fs, const char *transport, const char *host, + int port) __THROW + GFAPI_PUBLIC(glfs_set_volfile_server, 3.4.0); int -glfs_unset_volfile_server (glfs_t *fs, const char *transport, - const char *host, int port) __THROW - GFAPI_PUBLIC(glfs_unset_volfile_server, 3.5.1); +glfs_unset_volfile_server(glfs_t *fs, const char *transport, const char *host, + int port) __THROW + GFAPI_PUBLIC(glfs_unset_volfile_server, 3.5.1); /* SYNOPSIS @@ -226,8 +225,8 @@ glfs_unset_volfile_server (glfs_t *fs, const char *transport, */ int -glfs_set_logging (glfs_t *fs, const char *logfile, int loglevel) __THROW - GFAPI_PUBLIC(glfs_set_logging, 3.4.0); +glfs_set_logging(glfs_t *fs, const char *logfile, int loglevel) __THROW + GFAPI_PUBLIC(glfs_set_logging, 3.4.0); /* SYNOPSIS @@ -254,9 +253,7 @@ glfs_set_logging (glfs_t *fs, const char *logfile, int loglevel) __THROW */ int -glfs_init (glfs_t *fs) __THROW - GFAPI_PUBLIC(glfs_init, 3.4.0); - +glfs_init(glfs_t *fs) __THROW GFAPI_PUBLIC(glfs_init, 3.4.0); /* SYNOPSIS @@ -289,8 +286,7 @@ glfs_init (glfs_t *fs) __THROW */ int -glfs_fini (glfs_t *fs) __THROW - GFAPI_PUBLIC(glfs_fini, 3.4.0); +glfs_fini(glfs_t *fs) __THROW GFAPI_PUBLIC(glfs_fini, 3.4.0); /* SYNOPSIS @@ -321,9 +317,8 @@ glfs_fini (glfs_t *fs) __THROW */ ssize_t -glfs_get_volfile (glfs_t *fs, void *buf, size_t len) __THROW - GFAPI_PUBLIC(glfs_get_volfile, 3.6.0); - +glfs_get_volfile(glfs_t *fs, void *buf, size_t len) __THROW + GFAPI_PUBLIC(glfs_get_volfile, 3.6.0); /* SYNOPSIS @@ -337,8 +332,8 @@ glfs_get_volfile (glfs_t *fs, void *buf, size_t len) __THROW in the glusterfs_context linked to the glfs object fs which can be used in the subsequent calls. Later it parses that UUID to convert it from canonical string format into an opaque byte array and copy it into - the volid array. In case if either of the input parameters, volid or size, - is NULL, number of bytes required to copy the volume UUID is returned. + the volid array. In case if either of the input parameters, volid or + size, is NULL, number of bytes required to copy the volume UUID is returned. PARAMETERS @@ -354,9 +349,8 @@ glfs_get_volfile (glfs_t *fs, void *buf, size_t len) __THROW */ int -glfs_get_volumeid (glfs_t *fs, char *volid, size_t size) __THROW - GFAPI_PUBLIC(glfs_get_volumeid, 3.5.0); - +glfs_get_volumeid(glfs_t *fs, char *volid, size_t size) __THROW + GFAPI_PUBLIC(glfs_get_volumeid, 3.5.0); /* * FILE OPERATION @@ -406,20 +400,18 @@ typedef char glfs_leaseid_t[GLFS_LEASE_ID_SIZE]; * */ int -glfs_setfsuid (uid_t fsuid) __THROW - GFAPI_PUBLIC(glfs_setfsuid, 3.4.2); +glfs_setfsuid(uid_t fsuid) __THROW GFAPI_PUBLIC(glfs_setfsuid, 3.4.2); int -glfs_setfsgid (gid_t fsgid) __THROW - GFAPI_PUBLIC(glfs_setfsgid, 3.4.2); +glfs_setfsgid(gid_t fsgid) __THROW GFAPI_PUBLIC(glfs_setfsgid, 3.4.2); int -glfs_setfsgroups (size_t size, const gid_t *list) __THROW - GFAPI_PUBLIC(glfs_setfsgroups, 3.4.2); +glfs_setfsgroups(size_t size, const gid_t *list) __THROW + GFAPI_PUBLIC(glfs_setfsgroups, 3.4.2); int -glfs_setfsleaseid (glfs_leaseid_t leaseid) __THROW - GFAPI_PUBLIC(glfs_setfsleaseid, 4.0.0); +glfs_setfsleaseid(glfs_leaseid_t leaseid) __THROW + GFAPI_PUBLIC(glfs_setfsleaseid, 4.0.0); /* SYNOPSIS @@ -446,9 +438,9 @@ glfs_setfsleaseid (glfs_leaseid_t leaseid) __THROW */ -glfs_fd_t* -glfs_open (glfs_t *fs, const char *path, int flags) __THROW - GFAPI_PUBLIC(glfs_open, 3.4.0); +glfs_fd_t * +glfs_open(glfs_t *fs, const char *path, int flags) __THROW + GFAPI_PUBLIC(glfs_open, 3.4.0); /* SYNOPSIS @@ -476,22 +468,20 @@ glfs_open (glfs_t *fs, const char *path, int flags) __THROW */ -glfs_fd_t* -glfs_creat (glfs_t *fs, const char *path, int flags, mode_t mode) __THROW - GFAPI_PUBLIC(glfs_creat, 3.4.0); +glfs_fd_t * +glfs_creat(glfs_t *fs, const char *path, int flags, mode_t mode) __THROW + GFAPI_PUBLIC(glfs_creat, 3.4.0); int -glfs_close (glfs_fd_t *fd) __THROW - GFAPI_PUBLIC(glfs_close, 3.4.0); +glfs_close(glfs_fd_t *fd) __THROW GFAPI_PUBLIC(glfs_close, 3.4.0); -glfs_t* -glfs_from_glfd (glfs_fd_t *fd) __THROW - GFAPI_PUBLIC(glfs_from_glfd, 3.4.0); +glfs_t * +glfs_from_glfd(glfs_fd_t *fd) __THROW GFAPI_PUBLIC(glfs_from_glfd, 3.4.0); int -glfs_set_xlator_option (glfs_t *fs, const char *xlator, const char *key, - const char *value) __THROW - GFAPI_PUBLIC(glfs_set_xlator_option, 3.4.0); +glfs_set_xlator_option(glfs_t *fs, const char *xlator, const char *key, + const char *value) __THROW + GFAPI_PUBLIC(glfs_set_xlator_option, 3.4.0); /* @@ -516,181 +506,176 @@ glfs_set_xlator_option (glfs_t *fs, const char *xlator, const char *key, in a common callback function. */ -typedef void (*glfs_io_cbk) (glfs_fd_t *fd, ssize_t ret, struct stat *prestat, - struct stat *poststat, void *data); +typedef void (*glfs_io_cbk)(glfs_fd_t *fd, ssize_t ret, struct stat *prestat, + struct stat *poststat, void *data); // glfs_{read,write}[_async] ssize_t -glfs_read (glfs_fd_t *fd, void *buf, size_t count, int flags) __THROW - GFAPI_PUBLIC(glfs_read, 3.4.0); +glfs_read(glfs_fd_t *fd, void *buf, size_t count, int flags) __THROW + GFAPI_PUBLIC(glfs_read, 3.4.0); ssize_t -glfs_write (glfs_fd_t *fd, const void *buf, size_t count, int flags) __THROW - GFAPI_PUBLIC(glfs_write, 3.4.0); +glfs_write(glfs_fd_t *fd, const void *buf, size_t count, int flags) __THROW + GFAPI_PUBLIC(glfs_write, 3.4.0); int -glfs_read_async (glfs_fd_t *fd, void *buf, size_t count, int flags, - glfs_io_cbk fn, void *data) __THROW - GFAPI_PUBLIC(glfs_read_async, future); +glfs_read_async(glfs_fd_t *fd, void *buf, size_t count, int flags, + glfs_io_cbk fn, void *data) __THROW + GFAPI_PUBLIC(glfs_read_async, future); int -glfs_write_async (glfs_fd_t *fd, const void *buf, size_t count, int flags, - glfs_io_cbk fn, void *data) __THROW - GFAPI_PUBLIC(glfs_write_async, future); +glfs_write_async(glfs_fd_t *fd, const void *buf, size_t count, int flags, + glfs_io_cbk fn, void *data) __THROW + GFAPI_PUBLIC(glfs_write_async, future); // glfs_{read,write}v[_async] ssize_t -glfs_readv (glfs_fd_t *fd, const struct iovec *iov, int iovcnt, - int flags) __THROW - GFAPI_PUBLIC(glfs_readv, 3.4.0); +glfs_readv(glfs_fd_t *fd, const struct iovec *iov, int iovcnt, + int flags) __THROW GFAPI_PUBLIC(glfs_readv, 3.4.0); ssize_t -glfs_writev (glfs_fd_t *fd, const struct iovec *iov, int iovcnt, - int flags) __THROW - GFAPI_PUBLIC(glfs_writev, 3.4.0); +glfs_writev(glfs_fd_t *fd, const struct iovec *iov, int iovcnt, + int flags) __THROW GFAPI_PUBLIC(glfs_writev, 3.4.0); int -glfs_readv_async (glfs_fd_t *fd, const struct iovec *iov, int count, - int flags, glfs_io_cbk fn, void *data) __THROW - GFAPI_PUBLIC(glfs_readv_async, future); +glfs_readv_async(glfs_fd_t *fd, const struct iovec *iov, int count, int flags, + glfs_io_cbk fn, void *data) __THROW + GFAPI_PUBLIC(glfs_readv_async, future); int -glfs_writev_async (glfs_fd_t *fd, const struct iovec *iov, int count, - int flags, glfs_io_cbk fn, void *data) __THROW - GFAPI_PUBLIC(glfs_writev_async, future); +glfs_writev_async(glfs_fd_t *fd, const struct iovec *iov, int count, int flags, + glfs_io_cbk fn, void *data) __THROW + GFAPI_PUBLIC(glfs_writev_async, future); // glfs_p{read,write}[_async] ssize_t -glfs_pread (glfs_fd_t *fd, void *buf, size_t count, off_t offset, int flags, - struct stat *poststat) __THROW - GFAPI_PUBLIC(glfs_pread, future); +glfs_pread(glfs_fd_t *fd, void *buf, size_t count, off_t offset, int flags, + struct stat *poststat) __THROW GFAPI_PUBLIC(glfs_pread, future); ssize_t -glfs_pwrite (glfs_fd_t *fd, const void *buf, size_t count, off_t offset, - int flags, struct stat *prestat, struct stat *poststat) __THROW - GFAPI_PUBLIC(glfs_pwrite, future); +glfs_pwrite(glfs_fd_t *fd, const void *buf, size_t count, off_t offset, + int flags, struct stat *prestat, struct stat *poststat) __THROW + GFAPI_PUBLIC(glfs_pwrite, future); int -glfs_pread_async (glfs_fd_t *fd, void *buf, size_t count, off_t offset, - int flags, glfs_io_cbk fn, void *data) __THROW - GFAPI_PUBLIC(glfs_pread_async, future); +glfs_pread_async(glfs_fd_t *fd, void *buf, size_t count, off_t offset, + int flags, glfs_io_cbk fn, void *data) __THROW + GFAPI_PUBLIC(glfs_pread_async, future); int -glfs_pwrite_async (glfs_fd_t *fd, const void *buf, int count, off_t offset, - int flags, glfs_io_cbk fn, void *data) __THROW - GFAPI_PUBLIC(glfs_pwrite_async, future); +glfs_pwrite_async(glfs_fd_t *fd, const void *buf, int count, off_t offset, + int flags, glfs_io_cbk fn, void *data) __THROW + GFAPI_PUBLIC(glfs_pwrite_async, future); // glfs_p{read,write}v[_async] ssize_t -glfs_preadv (glfs_fd_t *fd, const struct iovec *iov, int iovcnt, - off_t offset, int flags) __THROW - GFAPI_PUBLIC(glfs_preadv, 3.4.0); +glfs_preadv(glfs_fd_t *fd, const struct iovec *iov, int iovcnt, off_t offset, + int flags) __THROW GFAPI_PUBLIC(glfs_preadv, 3.4.0); ssize_t -glfs_pwritev (glfs_fd_t *fd, const struct iovec *iov, int iovcnt, - off_t offset, int flags) __THROW - GFAPI_PUBLIC(glfs_pwritev, 3.4.0); +glfs_pwritev(glfs_fd_t *fd, const struct iovec *iov, int iovcnt, off_t offset, + int flags) __THROW GFAPI_PUBLIC(glfs_pwritev, 3.4.0); int -glfs_preadv_async (glfs_fd_t *fd, const struct iovec *iov, int count, - off_t offset, int flags, glfs_io_cbk fn, void *data) __THROW - GFAPI_PUBLIC(glfs_preadv_async, future); +glfs_preadv_async(glfs_fd_t *fd, const struct iovec *iov, int count, + off_t offset, int flags, glfs_io_cbk fn, void *data) __THROW + GFAPI_PUBLIC(glfs_preadv_async, future); int -glfs_pwritev_async (glfs_fd_t *fd, const struct iovec *iov, int count, - off_t offset, int flags, glfs_io_cbk fn, void *data) __THROW - GFAPI_PUBLIC(glfs_pwritev_async, future); +glfs_pwritev_async(glfs_fd_t *fd, const struct iovec *iov, int count, + off_t offset, int flags, glfs_io_cbk fn, void *data) __THROW + GFAPI_PUBLIC(glfs_pwritev_async, future); off_t -glfs_lseek (glfs_fd_t *fd, off_t offset, int whence) __THROW - GFAPI_PUBLIC(glfs_lseek, 3.4.0); +glfs_lseek(glfs_fd_t *fd, off_t offset, int whence) __THROW + GFAPI_PUBLIC(glfs_lseek, 3.4.0); int -glfs_truncate (glfs_t *fs, const char *path, off_t length) __THROW - GFAPI_PUBLIC(glfs_truncate, 3.7.15); +glfs_truncate(glfs_t *fs, const char *path, off_t length) __THROW + GFAPI_PUBLIC(glfs_truncate, 3.7.15); int -glfs_ftruncate (glfs_fd_t *fd, off_t length, struct stat *prestat, - struct stat *poststat) __THROW - GFAPI_PUBLIC(glfs_ftruncate, future); +glfs_ftruncate(glfs_fd_t *fd, off_t length, struct stat *prestat, + struct stat *poststat) __THROW + GFAPI_PUBLIC(glfs_ftruncate, future); int -glfs_ftruncate_async (glfs_fd_t *fd, off_t length, glfs_io_cbk fn, - void *data) __THROW - GFAPI_PUBLIC(glfs_ftruncate_async, future); +glfs_ftruncate_async(glfs_fd_t *fd, off_t length, glfs_io_cbk fn, + void *data) __THROW + GFAPI_PUBLIC(glfs_ftruncate_async, future); int -glfs_lstat (glfs_t *fs, const char *path, struct stat *buf) __THROW - GFAPI_PUBLIC(glfs_lstat, 3.4.0); +glfs_lstat(glfs_t *fs, const char *path, struct stat *buf) __THROW + GFAPI_PUBLIC(glfs_lstat, 3.4.0); int -glfs_stat (glfs_t *fs, const char *path, struct stat *buf) __THROW - GFAPI_PUBLIC(glfs_stat, 3.4.0); +glfs_stat(glfs_t *fs, const char *path, struct stat *buf) __THROW + GFAPI_PUBLIC(glfs_stat, 3.4.0); int -glfs_fstat (glfs_fd_t *fd, struct stat *buf) __THROW - GFAPI_PUBLIC(glfs_fstat, 3.4.0); +glfs_fstat(glfs_fd_t *fd, struct stat *buf) __THROW + GFAPI_PUBLIC(glfs_fstat, 3.4.0); int -glfs_fsync (glfs_fd_t *fd, struct stat *prestat, struct stat *poststat) __THROW - GFAPI_PUBLIC(glfs_fsync, future); +glfs_fsync(glfs_fd_t *fd, struct stat *prestat, struct stat *poststat) __THROW + GFAPI_PUBLIC(glfs_fsync, future); int -glfs_fsync_async (glfs_fd_t *fd, glfs_io_cbk fn, void *data) __THROW - GFAPI_PUBLIC(glfs_fsync_async, future); +glfs_fsync_async(glfs_fd_t *fd, glfs_io_cbk fn, void *data) __THROW + GFAPI_PUBLIC(glfs_fsync_async, future); int -glfs_fdatasync (glfs_fd_t *fd, struct stat *prestat, - struct stat *poststat) __THROW - GFAPI_PUBLIC(glfs_fdatasync, future); +glfs_fdatasync(glfs_fd_t *fd, struct stat *prestat, + struct stat *poststat) __THROW + GFAPI_PUBLIC(glfs_fdatasync, future); int -glfs_fdatasync_async (glfs_fd_t *fd, glfs_io_cbk fn, void *data) __THROW - GFAPI_PUBLIC(glfs_fdatasync_async, future); +glfs_fdatasync_async(glfs_fd_t *fd, glfs_io_cbk fn, void *data) __THROW + GFAPI_PUBLIC(glfs_fdatasync_async, future); int -glfs_access (glfs_t *fs, const char *path, int mode) __THROW - GFAPI_PUBLIC(glfs_access, 3.4.0); +glfs_access(glfs_t *fs, const char *path, int mode) __THROW + GFAPI_PUBLIC(glfs_access, 3.4.0); int -glfs_symlink (glfs_t *fs, const char *oldpath, const char *newpath) __THROW - GFAPI_PUBLIC(glfs_symlink, 3.4.0); +glfs_symlink(glfs_t *fs, const char *oldpath, const char *newpath) __THROW + GFAPI_PUBLIC(glfs_symlink, 3.4.0); int -glfs_readlink (glfs_t *fs, const char *path, char *buf, size_t bufsiz) __THROW - GFAPI_PUBLIC(glfs_readlink, 3.4.0); +glfs_readlink(glfs_t *fs, const char *path, char *buf, size_t bufsiz) __THROW + GFAPI_PUBLIC(glfs_readlink, 3.4.0); int -glfs_mknod (glfs_t *fs, const char *path, mode_t mode, dev_t dev) __THROW - GFAPI_PUBLIC(glfs_mknod, 3.4.0); +glfs_mknod(glfs_t *fs, const char *path, mode_t mode, dev_t dev) __THROW + GFAPI_PUBLIC(glfs_mknod, 3.4.0); int -glfs_mkdir (glfs_t *fs, const char *path, mode_t mode) __THROW - GFAPI_PUBLIC(glfs_mkdir, 3.4.0); +glfs_mkdir(glfs_t *fs, const char *path, mode_t mode) __THROW + GFAPI_PUBLIC(glfs_mkdir, 3.4.0); int -glfs_unlink (glfs_t *fs, const char *path) __THROW - GFAPI_PUBLIC(glfs_unlink, 3.4.0); +glfs_unlink(glfs_t *fs, const char *path) __THROW + GFAPI_PUBLIC(glfs_unlink, 3.4.0); int -glfs_rmdir (glfs_t *fs, const char *path) __THROW - GFAPI_PUBLIC(glfs_rmdir, 3.4.0); +glfs_rmdir(glfs_t *fs, const char *path) __THROW + GFAPI_PUBLIC(glfs_rmdir, 3.4.0); int -glfs_rename (glfs_t *fs, const char *oldpath, const char *newpath) __THROW - GFAPI_PUBLIC(glfs_rename, 3.4.0); +glfs_rename(glfs_t *fs, const char *oldpath, const char *newpath) __THROW + GFAPI_PUBLIC(glfs_rename, 3.4.0); int -glfs_link (glfs_t *fs, const char *oldpath, const char *newpath) __THROW - GFAPI_PUBLIC(glfs_link, 3.4.0); +glfs_link(glfs_t *fs, const char *oldpath, const char *newpath) __THROW + GFAPI_PUBLIC(glfs_link, 3.4.0); -glfs_fd_t* -glfs_opendir (glfs_t *fs, const char *path) __THROW - GFAPI_PUBLIC(glfs_opendir, 3.4.0); +glfs_fd_t * +glfs_opendir(glfs_t *fs, const char *path) __THROW + GFAPI_PUBLIC(glfs_opendir, 3.4.0); /* * @glfs_readdir_r and @glfs_readdirplus_r ARE thread safe AND re-entrant, @@ -701,14 +686,14 @@ glfs_opendir (glfs_t *fs, const char *path) __THROW */ int -glfs_readdir_r (glfs_fd_t *fd, struct dirent *dirent, - struct dirent **result) __THROW - GFAPI_PUBLIC(glfs_readdir_r, 3.4.0); +glfs_readdir_r(glfs_fd_t *fd, struct dirent *dirent, + struct dirent **result) __THROW + GFAPI_PUBLIC(glfs_readdir_r, 3.4.0); int -glfs_readdirplus_r (glfs_fd_t *fd, struct stat *stat, struct dirent *dirent, - struct dirent **result) __THROW - GFAPI_PUBLIC(glfs_readdirplus_r, 3.4.0); +glfs_readdirplus_r(glfs_fd_t *fd, struct stat *stat, struct dirent *dirent, + struct dirent **result) __THROW + GFAPI_PUBLIC(glfs_readdirplus_r, 3.4.0); /* * @glfs_readdir and @glfs_readdirplus are NEITHER thread safe NOR re-entrant @@ -717,162 +702,153 @@ glfs_readdirplus_r (glfs_fd_t *fd, struct stat *stat, struct dirent *dirent, * referring to the same directory too.) */ -struct dirent* -glfs_readdir (glfs_fd_t *fd) __THROW - GFAPI_PUBLIC(glfs_readdir, 3.5.0); +struct dirent * +glfs_readdir(glfs_fd_t *fd) __THROW GFAPI_PUBLIC(glfs_readdir, 3.5.0); -struct dirent* -glfs_readdirplus (glfs_fd_t *fd, struct stat *stat) __THROW - GFAPI_PUBLIC(glfs_readdirplus, 3.5.0); +struct dirent * +glfs_readdirplus(glfs_fd_t *fd, struct stat *stat) __THROW + GFAPI_PUBLIC(glfs_readdirplus, 3.5.0); long -glfs_telldir (glfs_fd_t *fd) __THROW - GFAPI_PUBLIC(glfs_telldir, 3.4.0); +glfs_telldir(glfs_fd_t *fd) __THROW GFAPI_PUBLIC(glfs_telldir, 3.4.0); void -glfs_seekdir (glfs_fd_t *fd, long offset) __THROW - GFAPI_PUBLIC(glfs_seekdir, 3.4.0); +glfs_seekdir(glfs_fd_t *fd, long offset) __THROW + GFAPI_PUBLIC(glfs_seekdir, 3.4.0); int -glfs_closedir (glfs_fd_t *fd) __THROW - GFAPI_PUBLIC(glfs_closedir, 3.4.0); +glfs_closedir(glfs_fd_t *fd) __THROW GFAPI_PUBLIC(glfs_closedir, 3.4.0); int -glfs_statvfs (glfs_t *fs, const char *path, struct statvfs *buf) __THROW - GFAPI_PUBLIC(glfs_statvfs, 3.4.0); +glfs_statvfs(glfs_t *fs, const char *path, struct statvfs *buf) __THROW + GFAPI_PUBLIC(glfs_statvfs, 3.4.0); int -glfs_chmod (glfs_t *fs, const char *path, mode_t mode) __THROW - GFAPI_PUBLIC(glfs_chmod, 3.4.0); +glfs_chmod(glfs_t *fs, const char *path, mode_t mode) __THROW + GFAPI_PUBLIC(glfs_chmod, 3.4.0); int -glfs_fchmod (glfs_fd_t *fd, mode_t mode) __THROW - GFAPI_PUBLIC(glfs_fchmod, 3.4.0); +glfs_fchmod(glfs_fd_t *fd, mode_t mode) __THROW + GFAPI_PUBLIC(glfs_fchmod, 3.4.0); int -glfs_chown (glfs_t *fs, const char *path, uid_t uid, gid_t gid) __THROW - GFAPI_PUBLIC(glfs_chown, 3.4.0); +glfs_chown(glfs_t *fs, const char *path, uid_t uid, gid_t gid) __THROW + GFAPI_PUBLIC(glfs_chown, 3.4.0); int -glfs_lchown (glfs_t *fs, const char *path, uid_t uid, gid_t gid) __THROW - GFAPI_PUBLIC(glfs_lchown, 3.4.0); +glfs_lchown(glfs_t *fs, const char *path, uid_t uid, gid_t gid) __THROW + GFAPI_PUBLIC(glfs_lchown, 3.4.0); int -glfs_fchown (glfs_fd_t *fd, uid_t uid, gid_t gid) __THROW - GFAPI_PUBLIC(glfs_fchown, 3.4.0); +glfs_fchown(glfs_fd_t *fd, uid_t uid, gid_t gid) __THROW + GFAPI_PUBLIC(glfs_fchown, 3.4.0); int -glfs_utimens (glfs_t *fs, const char *path, - const struct timespec times[2]) __THROW - GFAPI_PUBLIC(glfs_utimens, 3.4.0); +glfs_utimens(glfs_t *fs, const char *path, + const struct timespec times[2]) __THROW + GFAPI_PUBLIC(glfs_utimens, 3.4.0); int -glfs_lutimens (glfs_t *fs, const char *path, - const struct timespec times[2]) __THROW - GFAPI_PUBLIC(glfs_lutimens, 3.4.0); +glfs_lutimens(glfs_t *fs, const char *path, + const struct timespec times[2]) __THROW + GFAPI_PUBLIC(glfs_lutimens, 3.4.0); int -glfs_futimens (glfs_fd_t *fd, const struct timespec times[2]) __THROW - GFAPI_PUBLIC(glfs_futimens, 3.4.0); +glfs_futimens(glfs_fd_t *fd, const struct timespec times[2]) __THROW + GFAPI_PUBLIC(glfs_futimens, 3.4.0); ssize_t -glfs_getxattr (glfs_t *fs, const char *path, const char *name, void *value, - size_t size) __THROW - GFAPI_PUBLIC(glfs_getxattr, 3.4.0); +glfs_getxattr(glfs_t *fs, const char *path, const char *name, void *value, + size_t size) __THROW GFAPI_PUBLIC(glfs_getxattr, 3.4.0); ssize_t -glfs_lgetxattr (glfs_t *fs, const char *path, const char *name, void *value, - size_t size) __THROW - GFAPI_PUBLIC(glfs_lgetxattr, 3.4.0); +glfs_lgetxattr(glfs_t *fs, const char *path, const char *name, void *value, + size_t size) __THROW GFAPI_PUBLIC(glfs_lgetxattr, 3.4.0); ssize_t -glfs_fgetxattr (glfs_fd_t *fd, const char *name, void *value, - size_t size) __THROW - GFAPI_PUBLIC(glfs_fgetxattr, 3.4.0); +glfs_fgetxattr(glfs_fd_t *fd, const char *name, void *value, + size_t size) __THROW GFAPI_PUBLIC(glfs_fgetxattr, 3.4.0); ssize_t -glfs_listxattr (glfs_t *fs, const char *path, void *value, size_t size) __THROW - GFAPI_PUBLIC(glfs_listxattr, 3.4.0); +glfs_listxattr(glfs_t *fs, const char *path, void *value, size_t size) __THROW + GFAPI_PUBLIC(glfs_listxattr, 3.4.0); ssize_t -glfs_llistxattr (glfs_t *fs, const char *path, void *value, size_t size) __THROW - GFAPI_PUBLIC(glfs_llistxattr, 3.4.0); +glfs_llistxattr(glfs_t *fs, const char *path, void *value, size_t size) __THROW + GFAPI_PUBLIC(glfs_llistxattr, 3.4.0); ssize_t -glfs_flistxattr (glfs_fd_t *fd, void *value, size_t size) __THROW - GFAPI_PUBLIC(glfs_flistxattr, 3.4.0); +glfs_flistxattr(glfs_fd_t *fd, void *value, size_t size) __THROW + GFAPI_PUBLIC(glfs_flistxattr, 3.4.0); int -glfs_setxattr (glfs_t *fs, const char *path, const char *name, - const void *value, size_t size, int flags) __THROW - GFAPI_PUBLIC(glfs_setxattr, 3.4.0); +glfs_setxattr(glfs_t *fs, const char *path, const char *name, const void *value, + size_t size, int flags) __THROW + GFAPI_PUBLIC(glfs_setxattr, 3.4.0); int -glfs_lsetxattr (glfs_t *fs, const char *path, const char *name, - const void *value, size_t size, int flags) __THROW - GFAPI_PUBLIC(glfs_lsetxattr, 3.4.0); +glfs_lsetxattr(glfs_t *fs, const char *path, const char *name, + const void *value, size_t size, int flags) __THROW + GFAPI_PUBLIC(glfs_lsetxattr, 3.4.0); int -glfs_fsetxattr (glfs_fd_t *fd, const char *name, const void *value, - size_t size, int flags) __THROW - GFAPI_PUBLIC(glfs_fsetxattr, 3.4.0); +glfs_fsetxattr(glfs_fd_t *fd, const char *name, const void *value, size_t size, + int flags) __THROW GFAPI_PUBLIC(glfs_fsetxattr, 3.4.0); int -glfs_removexattr (glfs_t *fs, const char *path, const char *name) __THROW - GFAPI_PUBLIC(glfs_removexattr, 3.4.0); +glfs_removexattr(glfs_t *fs, const char *path, const char *name) __THROW + GFAPI_PUBLIC(glfs_removexattr, 3.4.0); int -glfs_lremovexattr (glfs_t *fs, const char *path, const char *name) __THROW - GFAPI_PUBLIC(glfs_lremovexattr, 3.4.0); +glfs_lremovexattr(glfs_t *fs, const char *path, const char *name) __THROW + GFAPI_PUBLIC(glfs_lremovexattr, 3.4.0); int -glfs_fremovexattr (glfs_fd_t *fd, const char *name) __THROW - GFAPI_PUBLIC(glfs_fremovexattr, 3.4.0); +glfs_fremovexattr(glfs_fd_t *fd, const char *name) __THROW + GFAPI_PUBLIC(glfs_fremovexattr, 3.4.0); int glfs_fallocate(glfs_fd_t *fd, int keep_size, off_t offset, size_t len) __THROW - GFAPI_PUBLIC(glfs_fallocate, 3.5.0); + GFAPI_PUBLIC(glfs_fallocate, 3.5.0); int glfs_discard(glfs_fd_t *fd, off_t offset, size_t len) __THROW - GFAPI_PUBLIC(glfs_discard, 3.5.0); + GFAPI_PUBLIC(glfs_discard, 3.5.0); int -glfs_discard_async (glfs_fd_t *fd, off_t length, size_t lent, glfs_io_cbk fn, - void *data) __THROW - GFAPI_PUBLIC(glfs_discard_async, future); +glfs_discard_async(glfs_fd_t *fd, off_t length, size_t lent, glfs_io_cbk fn, + void *data) __THROW GFAPI_PUBLIC(glfs_discard_async, future); int glfs_zerofill(glfs_fd_t *fd, off_t offset, off_t len) __THROW - GFAPI_PUBLIC(glfs_zerofill, 3.5.0); + GFAPI_PUBLIC(glfs_zerofill, 3.5.0); int -glfs_zerofill_async (glfs_fd_t *fd, off_t length, off_t len, glfs_io_cbk fn, - void *data) __THROW - GFAPI_PUBLIC(glfs_zerofill_async, future); +glfs_zerofill_async(glfs_fd_t *fd, off_t length, off_t len, glfs_io_cbk fn, + void *data) __THROW + GFAPI_PUBLIC(glfs_zerofill_async, future); -char* -glfs_getcwd (glfs_t *fs, char *buf, size_t size) __THROW - GFAPI_PUBLIC(glfs_getcwd, 3.4.0); +char * +glfs_getcwd(glfs_t *fs, char *buf, size_t size) __THROW + GFAPI_PUBLIC(glfs_getcwd, 3.4.0); int -glfs_chdir (glfs_t *fs, const char *path) __THROW - GFAPI_PUBLIC(glfs_chdir, 3.4.0); +glfs_chdir(glfs_t *fs, const char *path) __THROW + GFAPI_PUBLIC(glfs_chdir, 3.4.0); int -glfs_fchdir (glfs_fd_t *fd) __THROW - GFAPI_PUBLIC(glfs_fchdir, 3.4.0); +glfs_fchdir(glfs_fd_t *fd) __THROW GFAPI_PUBLIC(glfs_fchdir, 3.4.0); -char* -glfs_realpath (glfs_t *fs, const char *path, char *resolved_path) __THROW - GFAPI_PUBLIC(glfs_realpath, 3.7.17); +char * +glfs_realpath(glfs_t *fs, const char *path, char *resolved_path) __THROW + GFAPI_PUBLIC(glfs_realpath, 3.7.17); /* * @cmd and @flock are as specified in man fcntl(2). */ int -glfs_posix_lock (glfs_fd_t *fd, int cmd, struct flock *flock) __THROW - GFAPI_PUBLIC(glfs_posix_lock, 3.4.0); +glfs_posix_lock(glfs_fd_t *fd, int cmd, struct flock *flock) __THROW + GFAPI_PUBLIC(glfs_posix_lock, 3.4.0); /* SYNOPSIS @@ -909,24 +885,19 @@ glfs_posix_lock (glfs_fd_t *fd, int cmd, struct flock *flock) __THROW */ /* Lock modes used by glfs_file_lock() */ -enum glfs_lock_mode { - GLFS_LK_ADVISORY = 0, - GLFS_LK_MANDATORY -}; +enum glfs_lock_mode { GLFS_LK_ADVISORY = 0, GLFS_LK_MANDATORY }; typedef enum glfs_lock_mode glfs_lock_mode_t; int -glfs_file_lock (glfs_fd_t *fd, int cmd, struct flock *flock, - glfs_lock_mode_t lk_mode) __THROW - GFAPI_PUBLIC(glfs_file_lock, 3.13.0); +glfs_file_lock(glfs_fd_t *fd, int cmd, struct flock *flock, + glfs_lock_mode_t lk_mode) __THROW + GFAPI_PUBLIC(glfs_file_lock, 3.13.0); -glfs_fd_t* -glfs_dup (glfs_fd_t *fd) __THROW - GFAPI_PUBLIC(glfs_dup, 3.4.0); +glfs_fd_t * +glfs_dup(glfs_fd_t *fd) __THROW GFAPI_PUBLIC(glfs_dup, 3.4.0); void -glfs_free (void *ptr) __THROW - GFAPI_PUBLIC(glfs_free, 3.7.16); +glfs_free(void *ptr) __THROW GFAPI_PUBLIC(glfs_free, 3.7.16); /* * glfs_sysrq: send a system request to the @fs instance @@ -939,13 +910,11 @@ glfs_free (void *ptr) __THROW * @sysrq command will be able to return a success/failure status. */ int -glfs_sysrq (glfs_t *fs, char sysrq) __THROW - GFAPI_PUBLIC(glfs_sysrq, 3.10.0); +glfs_sysrq(glfs_t *fs, char sysrq) __THROW GFAPI_PUBLIC(glfs_sysrq, 3.10.0); #define GLFS_SYSRQ_HELP 'h' /* log a message with supported sysrq commands */ #define GLFS_SYSRQ_STATEDUMP 's' /* create a statedump */ - /* * Structure returned as part of xreaddirplus */ @@ -953,16 +922,17 @@ struct glfs_xreaddirp_stat; typedef struct glfs_xreaddirp_stat glfs_xreaddirp_stat_t; /* Request flags to be used in XREADDIRP operation */ -#define GFAPI_XREADDIRP_NULL 0x00000000 /* by default, no stat will be fetched */ -#define GFAPI_XREADDIRP_STAT 0x00000001 /* Get stat */ -#define GFAPI_XREADDIRP_HANDLE 0x00000002 /* Get object handle */ +#define GFAPI_XREADDIRP_NULL \ + 0x00000000 /* by default, no stat will be fetched */ +#define GFAPI_XREADDIRP_STAT 0x00000001 /* Get stat */ +#define GFAPI_XREADDIRP_HANDLE 0x00000002 /* Get object handle */ /* * This stat structure returned gets freed as part of glfs_free(xstat) */ -struct stat* -glfs_xreaddirplus_get_stat (glfs_xreaddirp_stat_t *xstat) __THROW - GFAPI_PUBLIC(glfs_xreaddirplus_get_stat, 3.11.0); +struct stat * +glfs_xreaddirplus_get_stat(glfs_xreaddirp_stat_t *xstat) __THROW + GFAPI_PUBLIC(glfs_xreaddirplus_get_stat, 3.11.0); /* * SYNOPSIS @@ -1007,10 +977,10 @@ glfs_xreaddirplus_get_stat (glfs_xreaddirp_stat_t *xstat) __THROW * -1: FAILURE */ int -glfs_xreaddirplus_r (glfs_fd_t *glfd, uint32_t flags, - glfs_xreaddirp_stat_t **xstat_p, struct dirent *ext, - struct dirent **res) __THROW - GFAPI_PUBLIC(glfs_xreaddirplus_r, 3.11.0); +glfs_xreaddirplus_r(glfs_fd_t *glfd, uint32_t flags, + glfs_xreaddirp_stat_t **xstat_p, struct dirent *ext, + struct dirent **res) __THROW + GFAPI_PUBLIC(glfs_xreaddirplus_r, 3.11.0); #define GFAPI_MAX_LOCK_OWNER_LEN 255 @@ -1039,8 +1009,8 @@ glfs_xreaddirplus_r (glfs_fd_t *glfd, uint32_t flags, * -1: FAILURE */ int -glfs_fd_set_lkowner (glfs_fd_t *glfd, void *data, int len) __THROW - GFAPI_PUBLIC(glfs_fd_set_lkowner, 3.10.7); +glfs_fd_set_lkowner(glfs_fd_t *glfd, void *data, int len) __THROW + GFAPI_PUBLIC(glfs_fd_set_lkowner, 3.10.7); /* * Applications (currently NFS-Ganesha) can make use of this @@ -1065,20 +1035,19 @@ glfs_fd_set_lkowner (glfs_fd_t *glfd, void *data, int len) __THROW struct glfs_upcall; typedef struct glfs_upcall glfs_upcall_t; -glfs_t* -glfs_upcall_get_fs (glfs_upcall_t *arg) __THROW - GFAPI_PUBLIC(glfs_upcall_get_fs, 3.7.16); +glfs_t * +glfs_upcall_get_fs(glfs_upcall_t *arg) __THROW + GFAPI_PUBLIC(glfs_upcall_get_fs, 3.7.16); enum glfs_upcall_reason { - GLFS_UPCALL_EVENT_NULL = 0, - GLFS_UPCALL_INODE_INVALIDATE, /* invalidate cache entry */ + GLFS_UPCALL_EVENT_NULL = 0, + GLFS_UPCALL_INODE_INVALIDATE, /* invalidate cache entry */ }; typedef enum glfs_upcall_reason glfs_upcall_reason_t; glfs_upcall_reason_t -glfs_upcall_get_reason (glfs_upcall_t *arg) __THROW - GFAPI_PUBLIC(glfs_upcall_get_reason, 3.7.16); - +glfs_upcall_get_reason(glfs_upcall_t *arg) __THROW + GFAPI_PUBLIC(glfs_upcall_get_reason, 3.7.16); /* * Applications first need to make use of above API i.e, @@ -1096,9 +1065,9 @@ glfs_upcall_get_reason (glfs_upcall_t *arg) __THROW * After processing upcall event, glfs_free() should be called on the * glfs_upcall. */ -void* -glfs_upcall_get_event (glfs_upcall_t *arg) __THROW - GFAPI_PUBLIC(glfs_upcall_get_event, 3.7.16); +void * +glfs_upcall_get_event(glfs_upcall_t *arg) __THROW + GFAPI_PUBLIC(glfs_upcall_get_event, 3.7.16); /* * SYNOPSIS @@ -1119,13 +1088,13 @@ glfs_upcall_get_event (glfs_upcall_t *arg) __THROW * registering of upcall events. This may be used by the caller for any * of its internal use while processing upcalls. */ -typedef void (*glfs_upcall_cbk) (glfs_upcall_t *up_arg, void *data); +typedef void (*glfs_upcall_cbk)(glfs_upcall_t *up_arg, void *data); /* * List of upcall events supported by gluster/gfapi */ -#define GLFS_EVENT_INODE_INVALIDATE 0x00000001 /* invalidate cache entry */ -#define GLFS_EVENT_ANY 0xffffffff /* for all the above events */ +#define GLFS_EVENT_INODE_INVALIDATE 0x00000001 /* invalidate cache entry */ +#define GLFS_EVENT_ANY 0xffffffff /* for all the above events */ /* * SYNOPSIS @@ -1161,9 +1130,9 @@ typedef void (*glfs_upcall_cbk) (glfs_upcall_t *up_arg, void *data); * -1: FAILURE */ int -glfs_upcall_register (glfs_t *fs, uint32_t event_list, glfs_upcall_cbk cbk, - void *data) __THROW - GFAPI_PUBLIC(glfs_upcall_register, 3.13.0); +glfs_upcall_register(glfs_t *fs, uint32_t event_list, glfs_upcall_cbk cbk, + void *data) __THROW + GFAPI_PUBLIC(glfs_upcall_register, 3.13.0); /* * SYNOPSIS @@ -1189,33 +1158,33 @@ glfs_upcall_register (glfs_t *fs, uint32_t event_list, glfs_upcall_cbk cbk, * -1: FAILURE */ int -glfs_upcall_unregister (glfs_t *fs, uint32_t event_list) __THROW - GFAPI_PUBLIC(glfs_upcall_unregister, 3.13.0); +glfs_upcall_unregister(glfs_t *fs, uint32_t event_list) __THROW + GFAPI_PUBLIC(glfs_upcall_unregister, 3.13.0); /* Lease Types */ enum glfs_lease_types { - GLFS_RD_LEASE = 1, - GLFS_RW_LEASE = 2, + GLFS_RD_LEASE = 1, + GLFS_RW_LEASE = 2, }; typedef enum glfs_lease_types glfs_lease_types_t; /* Lease cmds */ enum glfs_lease_cmds { - GLFS_GET_LEASE = 1, - GLFS_SET_LEASE = 2, - GLFS_UNLK_LEASE = 3, + GLFS_GET_LEASE = 1, + GLFS_SET_LEASE = 2, + GLFS_UNLK_LEASE = 3, }; typedef enum glfs_lease_cmds glfs_lease_cmds_t; struct glfs_lease { - glfs_lease_cmds_t cmd; - glfs_lease_types_t lease_type; - glfs_leaseid_t lease_id; - unsigned int lease_flags; + glfs_lease_cmds_t cmd; + glfs_lease_types_t lease_type; + glfs_leaseid_t lease_id; + unsigned int lease_flags; }; typedef struct glfs_lease glfs_lease_t; -typedef void (*glfs_recall_cbk) (glfs_lease_t lease, void *data); +typedef void (*glfs_recall_cbk)(glfs_lease_t lease, void *data); /* SYNOPSIS @@ -1260,9 +1229,9 @@ typedef void (*glfs_recall_cbk) (glfs_lease_t lease, void *data); <0: Failure. @errno will be set with the type of failure */ -int glfs_lease (glfs_fd_t *glfd, glfs_lease_t *lease, glfs_recall_cbk fn, - void *data) __THROW - GFAPI_PUBLIC(glfs_lease, 4.0.0); +int +glfs_lease(glfs_fd_t *glfd, glfs_lease_t *lease, glfs_recall_cbk fn, + void *data) __THROW GFAPI_PUBLIC(glfs_lease, 4.0.0); __END_DECLS #endif /* !_GLFS_H */ |