diff options
author | Amar Tumballi <amar@gluster.com> | 2011-03-16 09:38:28 +0000 |
---|---|---|
committer | Vijay Bellur <vijay@dev.gluster.com> | 2011-03-17 11:57:17 -0700 |
commit | 924d2ed32d19a2a0014f803edd3d4511a0af99c2 (patch) | |
tree | 56ac7c904ee454bf9e16c4fd173a6e2906375d25 | |
parent | ebe47d5dae42da18b289e7be44eb67a8157a56b1 (diff) |
libglusterfs: all header files updated
* whitespace cleanup (M-x whitespace-cleanup)
* indentation fixes (M-x indent-region)
* replaced tab with spaces (M-x untabify)
Signed-off-by: Amar Tumballi <amar@gluster.com>
Signed-off-by: Vijay Bellur <vijay@dev.gluster.com>
BUG: 2346 (Log message enhancements in GlusterFS - phase 1)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2346
-rw-r--r-- | libglusterfs/src/call-stub.h | 4 | ||||
-rw-r--r-- | libglusterfs/src/checksum.h | 6 | ||||
-rw-r--r-- | libglusterfs/src/common-utils.h | 2 | ||||
-rw-r--r-- | libglusterfs/src/compat-errno.h | 10 | ||||
-rw-r--r-- | libglusterfs/src/compat.h | 34 | ||||
-rw-r--r-- | libglusterfs/src/defaults.h | 1 | ||||
-rw-r--r-- | libglusterfs/src/dict.h | 57 | ||||
-rw-r--r-- | libglusterfs/src/event.h | 16 | ||||
-rw-r--r-- | libglusterfs/src/glusterfs.h | 3 | ||||
-rw-r--r-- | libglusterfs/src/graph-utils.h | 6 | ||||
-rw-r--r-- | libglusterfs/src/hashfn.h | 3 | ||||
-rw-r--r-- | libglusterfs/src/list.h | 2 | ||||
-rw-r--r-- | libglusterfs/src/locking.h | 32 | ||||
-rw-r--r-- | libglusterfs/src/mem-types.h | 180 | ||||
-rw-r--r-- | libglusterfs/src/stack.h | 365 | ||||
-rw-r--r-- | libglusterfs/src/statedump.h | 42 | ||||
-rw-r--r-- | libglusterfs/src/syncop.h | 123 | ||||
-rw-r--r-- | libglusterfs/src/timer.h | 54 | ||||
-rw-r--r-- | libglusterfs/src/trie-mem-types.h | 26 | ||||
-rw-r--r-- | libglusterfs/src/xlator.h | 824 |
20 files changed, 879 insertions, 911 deletions
diff --git a/libglusterfs/src/call-stub.h b/libglusterfs/src/call-stub.h index 0d34b3d2e07..4e1c3cb33e9 100644 --- a/libglusterfs/src/call-stub.h +++ b/libglusterfs/src/call-stub.h @@ -979,12 +979,12 @@ fop_lk_cbk_stub (call_frame_t *frame, call_stub_t * fop_inodelk_stub (call_frame_t *frame, fop_inodelk_t fn, - const char *volume, loc_t *loc, int32_t cmd, + const char *volume, loc_t *loc, int32_t cmd, struct gf_flock *lock); call_stub_t * fop_finodelk_stub (call_frame_t *frame, fop_finodelk_t fn, - const char *volume, fd_t *fd, int32_t cmd, + const char *volume, fd_t *fd, int32_t cmd, struct gf_flock *lock); call_stub_t * diff --git a/libglusterfs/src/checksum.h b/libglusterfs/src/checksum.h index 592e99fcb69..b2e9ac57f42 100644 --- a/libglusterfs/src/checksum.h +++ b/libglusterfs/src/checksum.h @@ -20,10 +20,8 @@ #ifndef __CHECKSUM_H__ #define __CHECKSUM_H__ -uint32_t -gf_rsync_weak_checksum (char *buf, int32_t len); +uint32_t gf_rsync_weak_checksum (char *buf, int32_t len); -void -gf_rsync_strong_checksum (char *buf, int32_t len, uint8_t *sum); +void gf_rsync_strong_checksum (char *buf, int32_t len, uint8_t *sum); #endif /* __CHECKSUM_H__ */ diff --git a/libglusterfs/src/common-utils.h b/libglusterfs/src/common-utils.h index b6a29b5b993..178eceea2b6 100644 --- a/libglusterfs/src/common-utils.h +++ b/libglusterfs/src/common-utils.h @@ -103,7 +103,7 @@ extern char *gf_mgmt_list[GF_MGMT_MAXVALUE]; #define GF_VALIDATE_OR_GOTO(name,arg,label) do { \ if (!arg) { \ - errno = EINVAL; \ + errno = EINVAL; \ gf_log (name, GF_LOG_ERROR, \ "invalid argument: " #arg); \ goto label; \ diff --git a/libglusterfs/src/compat-errno.h b/libglusterfs/src/compat-errno.h index bdd8becfdda..d6ca42acf32 100644 --- a/libglusterfs/src/compat-errno.h +++ b/libglusterfs/src/compat-errno.h @@ -199,9 +199,9 @@ /* Solaris */ -/* ENOTACTIVE 73 / * Facility is not active */ -#define GF_ERROR_CODE_NOTACTIVE 801 -/* ELOCKUNMAPPED 72 / * locked lock was unmapped */ +/* ENOTACTIVE 73 / * Facility is not active */ +#define GF_ERROR_CODE_NOTACTIVE 801 +/* ELOCKUNMAPPED 72 / * locked lock was unmapped */ #define GF_ERROR_CODE_LOCKUNMAPPED 802 /* BSD system */ @@ -231,8 +231,8 @@ #define EBADFD EBADRPC #endif /* EBADFD */ -/* These functions are defined for all the OS flags, but content will - * be different for each OS flag. +/* These functions are defined for all the OS flags, but content will + * be different for each OS flag. */ int32_t gf_errno_to_error (int32_t op_errno); int32_t gf_error_to_errno (int32_t error); diff --git a/libglusterfs/src/compat.h b/libglusterfs/src/compat.h index cae3342efc6..059f67131c2 100644 --- a/libglusterfs/src/compat.h +++ b/libglusterfs/src/compat.h @@ -45,7 +45,7 @@ #ifndef HAVE_LLISTXATTR -/* This part is valid only incase of old glibc which doesn't support +/* This part is valid only incase of old glibc which doesn't support * 'llistxattr()' system calls. */ @@ -57,7 +57,7 @@ #endif /* HAVE_LLISTXATTR */ #endif /* GF_LINUX_HOST_OS */ -#ifdef GF_BSD_HOST_OS +#ifdef GF_BSD_HOST_OS /* In case of FreeBSD */ #define UNIX_PATH_MAX 104 @@ -88,7 +88,7 @@ enum { #ifndef EUCLEAN #define EUCLEAN 0 -#endif +#endif #include <netinet/in.h> #ifndef s6_addr16 @@ -96,7 +96,7 @@ enum { #endif #ifndef s6_addr32 #define s6_addr32 __u6_addr.__u6_addr32 -#endif +#endif /* Posix dictates NAME_MAX to be used */ # ifndef NAME_MAX @@ -106,7 +106,7 @@ enum { # define NAME_MAX 255 # endif # endif - + #define F_GETLK64 F_GETLK #define F_SETLK64 F_SETLK #define F_SETLKW64 F_SETLKW @@ -146,10 +146,10 @@ enum { #include <netinet/in.h> #ifndef s6_addr16 #define s6_addr16 __u6_addr.__u6_addr16 -#endif +#endif #ifndef s6_addr32 #define s6_addr32 __u6_addr.__u6_addr32 -#endif +#endif /* Posix dictates NAME_MAX to be used */ # ifndef NAME_MAX @@ -177,7 +177,7 @@ int32_t gf_darwin_compat_setxattr (dict_t *dict); #ifdef GF_SOLARIS_HOST_OS #define UNIX_PATH_MAX 108 -#define EUCLEAN 117 +#define EUCLEAN 117 #include <sys/un.h> #include <limits.h> @@ -189,7 +189,7 @@ int32_t gf_darwin_compat_setxattr (dict_t *dict); #ifndef lchmod #define lchmod chmod -#endif +#endif #define lgetxattr(path, key, value, size) solaris_getxattr(path,key,value,size) enum { @@ -208,10 +208,10 @@ enum { # ifndef NAME_MAX # ifdef MAXNAMLEN # define NAME_MAX MAXNAMLEN -# else +# else # define NAME_MAX 255 # endif -# endif +# endif #include <netinet/in.h> #ifndef s6_addr16 @@ -264,19 +264,19 @@ enum { #define FTW_CONTINUE 0 #endif -int asprintf(char **string_ptr, const char *format, ...); +int asprintf(char **string_ptr, const char *format, ...); int vasprintf (char **result, const char *format, va_list args); char* strsep(char** str, const char* delims); int solaris_listxattr(const char *path, char *list, size_t size); int solaris_removexattr(const char *path, const char* key); -int solaris_getxattr(const char *path, const char* key, +int solaris_getxattr(const char *path, const char* key, char *value, size_t size); -int solaris_setxattr(const char *path, const char* key, const char *value, +int solaris_setxattr(const char *path, const char* key, const char *value, size_t size, int flags); int solaris_fgetxattr(int fd, const char* key, char *value, size_t size); -int solaris_fsetxattr(int fd, const char* key, const char *value, +int solaris_fsetxattr(int fd, const char* key, const char *value, size_t size, int flags); int solaris_flistxattr(int fd, char *list, size_t size); @@ -297,7 +297,7 @@ int solaris_xattr_resolve_path (const char *real_path, char **path); #endif /* HAVE_ARGP */ #ifndef HAVE_STRNLEN -size_t strnlen(const char *string, size_t maxlen); +size_t strnlen(const char *string, size_t maxlen); #endif /* STRNLEN */ #ifndef strdupa @@ -309,7 +309,7 @@ size_t strnlen(const char *string, size_t maxlen); char *__new = (char *) __builtin_alloca (__len); \ (char *) memcpy (__new, __old, __len); \ })) -#endif +#endif #define GF_DIR_ALIGN(x) (((x) + sizeof (uint64_t) - 1) & ~(sizeof (uint64_t) - 1)) diff --git a/libglusterfs/src/defaults.h b/libglusterfs/src/defaults.h index 6e451602b68..b9438827f1f 100644 --- a/libglusterfs/src/defaults.h +++ b/libglusterfs/src/defaults.h @@ -676,4 +676,5 @@ default_getspec_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t default_mem_acct_init (xlator_t *this); + #endif /* _DEFAULTS_H */ diff --git a/libglusterfs/src/dict.h b/libglusterfs/src/dict.h index ac587f59acd..4ddea942202 100644 --- a/libglusterfs/src/dict.h +++ b/libglusterfs/src/dict.h @@ -36,34 +36,34 @@ typedef struct _dict dict_t; typedef struct _data_pair data_pair_t; struct _data { - unsigned char is_static:1; - unsigned char is_const:1; - unsigned char is_stdalloc:1; - int32_t len; - struct iovec *vec; - char *data; - int32_t refcount; - gf_lock_t lock; + unsigned char is_static:1; + unsigned char is_const:1; + unsigned char is_stdalloc:1; + int32_t len; + struct iovec *vec; + char *data; + int32_t refcount; + gf_lock_t lock; }; struct _data_pair { - struct _data_pair *hash_next; - struct _data_pair *prev; - struct _data_pair *next; - data_t *value; - char *key; + struct _data_pair *hash_next; + struct _data_pair *prev; + struct _data_pair *next; + data_t *value; + char *key; }; struct _dict { - unsigned char is_static:1; - int32_t hash_size; - int32_t count; - int32_t refcount; - data_pair_t **members; - data_pair_t *members_list; - char *extra_free; - char *extra_stdfree; - gf_lock_t lock; + unsigned char is_static:1; + int32_t hash_size; + int32_t count; + int32_t refcount; + data_pair_t **members; + data_pair_t *members_list; + char *extra_free; + char *extra_stdfree; + gf_lock_t lock; }; @@ -78,19 +78,18 @@ int32_t dict_serialized_length (dict_t *dict); int32_t dict_serialize (dict_t *dict, char *buf); int32_t dict_unserialize (char *buf, int32_t size, dict_t **fill); -int32_t -dict_allocate_and_serialize (dict_t *this, char **buf, size_t *length); +int32_t dict_allocate_and_serialize (dict_t *this, char **buf, size_t *length); int32_t dict_iovec_len (dict_t *dict); int32_t dict_to_iovec (dict_t *dict, struct iovec *vec, int32_t count); - + void dict_destroy (dict_t *dict); void dict_unref (dict_t *dict); dict_t *dict_ref (dict_t *dict); data_t *data_ref (data_t *data); void data_unref (data_t *data); -/* +/* TODO: provide converts for differnt byte sizes, signedness, and void * */ data_t *int_to_data (int64_t value); @@ -140,13 +139,11 @@ void dict_foreach (dict_t *this, void *data), void *data); -dict_t *dict_copy (dict_t *this, - dict_t *new); +dict_t *dict_copy (dict_t *this, dict_t *new); /* CLEANED UP FUNCTIONS DECLARATIONS */ GF_MUST_CHECK dict_t *dict_new (void); -dict_t *dict_copy_with_ref (dict_t *this, - dict_t *new); +dict_t *dict_copy_with_ref (dict_t *this, dict_t *new); GF_MUST_CHECK int dict_get_int8 (dict_t *this, char *key, int8_t *val); GF_MUST_CHECK int dict_set_int8 (dict_t *this, char *key, int8_t val); diff --git a/libglusterfs/src/event.h b/libglusterfs/src/event.h index 25396325c2a..57884d173ce 100644 --- a/libglusterfs/src/event.h +++ b/libglusterfs/src/event.h @@ -64,18 +64,18 @@ struct event_pool { }; struct event_ops { - struct event_pool * (*new) (int count); + struct event_pool * (*new) (int count); - int (*event_register) (struct event_pool *event_pool, int fd, - event_handler_t handler, - void *data, int poll_in, int poll_out); + int (*event_register) (struct event_pool *event_pool, int fd, + event_handler_t handler, + void *data, int poll_in, int poll_out); - int (*event_select_on) (struct event_pool *event_pool, int fd, int idx, - int poll_in, int poll_out); + int (*event_select_on) (struct event_pool *event_pool, int fd, int idx, + int poll_in, int poll_out); - int (*event_unregister) (struct event_pool *event_pool, int fd, int idx); + int (*event_unregister) (struct event_pool *event_pool, int fd, int idx); - int (*event_dispatch) (struct event_pool *event_pool); + int (*event_dispatch) (struct event_pool *event_pool); }; struct event_pool * event_pool_new (int count); diff --git a/libglusterfs/src/glusterfs.h b/libglusterfs/src/glusterfs.h index a3fa58516e4..8c8a3b32e74 100644 --- a/libglusterfs/src/glusterfs.h +++ b/libglusterfs/src/glusterfs.h @@ -350,8 +350,7 @@ typedef enum { GF_EVENT_MAXVAL, } glusterfs_event_t; -extern char * -glusterfs_strevent (glusterfs_event_t ev); +extern char *glusterfs_strevent (glusterfs_event_t ev); #define GF_MUST_CHECK __attribute__((warn_unused_result)) diff --git a/libglusterfs/src/graph-utils.h b/libglusterfs/src/graph-utils.h index a6c1ccd5ac4..66bdd98443f 100644 --- a/libglusterfs/src/graph-utils.h +++ b/libglusterfs/src/graph-utils.h @@ -20,11 +20,9 @@ #ifndef _GRAPH_H_ #define _GRAPH_H_ -int -glusterfs_graph_print_file (FILE *file, glusterfs_graph_t *graph); +int glusterfs_graph_print_file (FILE *file, glusterfs_graph_t *graph); -char * -glusterfs_graph_print_buf (glusterfs_graph_t *graph); +char *glusterfs_graph_print_buf (glusterfs_graph_t *graph); int glusterfs_xlator_link (xlator_t *pxl, xlator_t *cxl); void glusterfs_graph_set_first (glusterfs_graph_t *graph, xlator_t *xl); diff --git a/libglusterfs/src/hashfn.h b/libglusterfs/src/hashfn.h index 8261e4c7895..65b1b447faa 100644 --- a/libglusterfs/src/hashfn.h +++ b/libglusterfs/src/hashfn.h @@ -32,6 +32,5 @@ uint32_t SuperFastHash (const char * data, int32_t len); uint32_t gf_dm_hashfn (const char *msg, int len); -uint32_t -ReallySimpleHash (char *path, int len); +uint32_t ReallySimpleHash (char *path, int len); #endif /* __HASHFN_H__ */ diff --git a/libglusterfs/src/list.h b/libglusterfs/src/list.h index d4851dfecd4..886c4f273a1 100644 --- a/libglusterfs/src/list.h +++ b/libglusterfs/src/list.h @@ -135,7 +135,7 @@ list_splice_init (struct list_head *list, struct list_head *head) ((type *)((char *)(ptr)-(unsigned long)(&((type *)0)->member))) -#define list_for_each(pos, head) \ +#define list_for_each(pos, head) \ for (pos = (head)->next; pos != (head); pos = pos->next) diff --git a/libglusterfs/src/locking.h b/libglusterfs/src/locking.h index c5043aa14e7..207685e146d 100644 --- a/libglusterfs/src/locking.h +++ b/libglusterfs/src/locking.h @@ -1,20 +1,20 @@ /* - Copyright (c) 2008-2010 Gluster, Inc. <http://www.gluster.com> - This file is part of GlusterFS. - - GlusterFS is free software; you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - GlusterFS is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see - <http://www.gnu.org/licenses/>. + Copyright (c) 2008-2010 Gluster, Inc. <http://www.gluster.com> + This file is part of GlusterFS. + + GlusterFS is free software; you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation; either version 3 of the License, + or (at your option) any later version. + + GlusterFS is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see + <http://www.gnu.org/licenses/>. */ #ifndef _LOCKING_H diff --git a/libglusterfs/src/mem-types.h b/libglusterfs/src/mem-types.h index 3a55bdc7c77..9840dac4375 100644 --- a/libglusterfs/src/mem-types.h +++ b/libglusterfs/src/mem-types.h @@ -1,20 +1,20 @@ /* - Copyright (c) 2006-2010 Gluster, Inc. <http://www.gluster.com> - This file is part of GlusterFS. + Copyright (c) 2006-2010 Gluster, Inc. <http://www.gluster.com> + This file is part of GlusterFS. - GlusterFS is free software; you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. + GlusterFS is free software; you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation; either version 3 of the License, + or (at your option) any later version. - GlusterFS is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Affero General Public License for more details. + GlusterFS is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Affero General Public License for more details. - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see - <http://www.gnu.org/licenses/>. + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see + <http://www.gnu.org/licenses/>. */ #ifndef __MEM_TYPES_H__ @@ -22,82 +22,82 @@ enum gf_common_mem_types_ { - gf_common_mt_call_stub_t = 0, - gf_common_mt_dnscache6 = 1, - gf_common_mt_data_pair_t = 2, - gf_common_mt_data_t = 3, - gf_common_mt_dict_t = 4, - gf_common_mt_event_pool = 5, - gf_common_mt_reg = 6, - gf_common_mt_pollfd = 7, - gf_common_mt_epoll_event = 8, - gf_common_mt_fdentry_t = 9, - gf_common_mt_fdtable_t = 10, - gf_common_mt_fd_t = 11, - gf_common_mt_fd_ctx = 12, - gf_common_mt_gf_dirent_t = 13, - gf_common_mt_glusterfs_ctx_t = 14, - gf_common_mt_dentry_t = 15, - gf_common_mt_inode_t = 16, - gf_common_mt_inode_ctx = 17, - gf_common_mt_list_head = 18, - gf_common_mt_inode_table_t = 19, - gf_common_mt_xlator_t = 20, - gf_common_mt_xlator_list_t = 21, - gf_common_mt_log_msg = 22, - gf_common_mt_client_log = 23, - gf_common_mt_volume_opt_list_t = 24, - gf_common_mt_gf_hdr_common_t = 25, - gf_common_mt_call_frame_t = 26, - gf_common_mt_call_stack_t = 27, - gf_common_mt_gf_timer_t = 28, - gf_common_mt_gf_timer_registry_t= 29, - gf_common_mt_transport = 30, - gf_common_mt_transport_msg = 31, - gf_common_mt_auth_handle_t = 32, - gf_common_mt_iobuf = 33, - gf_common_mt_iobuf_arena = 34, - gf_common_mt_iobref = 35, - gf_common_mt_iobuf_pool = 36, - gf_common_mt_iovec = 37, - gf_common_mt_memdup = 38, - gf_common_mt_asprintf = 39, - gf_common_mt_strdup = 40, - gf_common_mt_socket_private_t = 41, - gf_common_mt_ioq = 42, - gf_common_mt_transport_t = 43, - gf_common_mt_socket_local_t = 44, - gf_common_mt_char = 45, - gf_common_mt_rbthash_table_t = 46, - gf_common_mt_rbthash_bucket = 47, - gf_common_mt_mem_pool = 48, - gf_common_mt_long = 49, - gf_common_mt_rpcsvc_auth_list = 50, - gf_common_mt_rpcsvc_t = 51, - gf_common_mt_rpcsvc_conn_t = 52, - gf_common_mt_rpcsvc_program_t = 53, - gf_common_mt_rpcsvc_listener_t = 54, - gf_common_mt_rpcsvc_wrapper_t = 55, - gf_common_mt_rpcsvc_stage_t = 56, - gf_common_mt_rpcclnt_t = 57, - gf_common_mt_rpcclnt_savedframe_t = 58, - gf_common_mt_rpc_trans_t = 59, - gf_common_mt_rpc_trans_pollin_t = 60, - gf_common_mt_rpc_trans_handover_t = 61, - gf_common_mt_rpc_trans_reqinfo_t= 62, - gf_common_mt_rpc_trans_rsp_t = 63, - gf_common_mt_glusterfs_graph_t = 64, - gf_common_mt_rdma_private_t = 65, - gf_common_mt_rdma_ioq_t = 66, - gf_common_mt_rpc_transport_t = 67, - gf_common_mt_rdma_local_t = 68, - gf_common_mt_rdma_post_t = 69, - gf_common_mt_qpent = 70, - gf_common_mt_rdma_device_t = 71, - gf_common_mt_rdma_context_t = 72, - gf_common_mt_sge = 73, - gf_common_mt_rpcclnt_cb_program_t = 74, - gf_common_mt_libxl_marker_local = 75, - gf_common_mt_end = 76 + gf_common_mt_call_stub_t = 0, + gf_common_mt_dnscache6 = 1, + gf_common_mt_data_pair_t = 2, + gf_common_mt_data_t = 3, + gf_common_mt_dict_t = 4, + gf_common_mt_event_pool = 5, + gf_common_mt_reg = 6, + gf_common_mt_pollfd = 7, + gf_common_mt_epoll_event = 8, + gf_common_mt_fdentry_t = 9, + gf_common_mt_fdtable_t = 10, + gf_common_mt_fd_t = 11, + gf_common_mt_fd_ctx = 12, + gf_common_mt_gf_dirent_t = 13, + gf_common_mt_glusterfs_ctx_t = 14, + gf_common_mt_dentry_t = 15, + gf_common_mt_inode_t = 16, + gf_common_mt_inode_ctx = 17, + gf_common_mt_list_head = 18, + gf_common_mt_inode_table_t = 19, + gf_common_mt_xlator_t = 20, + gf_common_mt_xlator_list_t = 21, + gf_common_mt_log_msg = 22, + gf_common_mt_client_log = 23, + gf_common_mt_volume_opt_list_t = 24, + gf_common_mt_gf_hdr_common_t = 25, + gf_common_mt_call_frame_t = 26, + gf_common_mt_call_stack_t = 27, + gf_common_mt_gf_timer_t = 28, + gf_common_mt_gf_timer_registry_t = 29, + gf_common_mt_transport = 30, + gf_common_mt_transport_msg = 31, + gf_common_mt_auth_handle_t = 32, + gf_common_mt_iobuf = 33, + gf_common_mt_iobuf_arena = 34, + gf_common_mt_iobref = 35, + gf_common_mt_iobuf_pool = 36, + gf_common_mt_iovec = 37, + gf_common_mt_memdup = 38, + gf_common_mt_asprintf = 39, + gf_common_mt_strdup = 40, + gf_common_mt_socket_private_t = 41, + gf_common_mt_ioq = 42, + gf_common_mt_transport_t = 43, + gf_common_mt_socket_local_t = 44, + gf_common_mt_char = 45, + gf_common_mt_rbthash_table_t = 46, + gf_common_mt_rbthash_bucket = 47, + gf_common_mt_mem_pool = 48, + gf_common_mt_long = 49, + gf_common_mt_rpcsvc_auth_list = 50, + gf_common_mt_rpcsvc_t = 51, + gf_common_mt_rpcsvc_conn_t = 52, + gf_common_mt_rpcsvc_program_t = 53, + gf_common_mt_rpcsvc_listener_t = 54, + gf_common_mt_rpcsvc_wrapper_t = 55, + gf_common_mt_rpcsvc_stage_t = 56, + gf_common_mt_rpcclnt_t = 57, + gf_common_mt_rpcclnt_savedframe_t = 58, + gf_common_mt_rpc_trans_t = 59, + gf_common_mt_rpc_trans_pollin_t = 60, + gf_common_mt_rpc_trans_handover_t = 61, + gf_common_mt_rpc_trans_reqinfo_t = 62, + gf_common_mt_rpc_trans_rsp_t = 63, + gf_common_mt_glusterfs_graph_t = 64, + gf_common_mt_rdma_private_t = 65, + gf_common_mt_rdma_ioq_t = 66, + gf_common_mt_rpc_transport_t = 67, + gf_common_mt_rdma_local_t = 68, + gf_common_mt_rdma_post_t = 69, + gf_common_mt_qpent = 70, + gf_common_mt_rdma_device_t = 71, + gf_common_mt_rdma_context_t = 72, + gf_common_mt_sge = 73, + gf_common_mt_rpcclnt_cb_program_t = 74, + gf_common_mt_libxl_marker_local = 75, + gf_common_mt_end = 76 }; #endif diff --git a/libglusterfs/src/stack.h b/libglusterfs/src/stack.h index 1c3e3430e12..7165faccaa7 100644 --- a/libglusterfs/src/stack.h +++ b/libglusterfs/src/stack.h @@ -1,4 +1,4 @@ -/* +/* Copyright (c) 2006-2010 Gluster, Inc. <http://www.gluster.com> This file is part of GlusterFS. @@ -47,78 +47,79 @@ typedef struct _call_pool_t call_pool_t; #define NFS_PID 1 typedef int32_t (*ret_fn_t) (call_frame_t *frame, - call_frame_t *prev_frame, - xlator_t *this, - int32_t op_ret, - int32_t op_errno, - ...); + call_frame_t *prev_frame, + xlator_t *this, + int32_t op_ret, + int32_t op_errno, + ...); struct _call_pool_t { - union { - struct list_head all_frames; - struct { - call_stack_t *next_call; - call_stack_t *prev_call; - } all_stacks; - }; - int64_t cnt; - gf_lock_t lock; - struct mem_pool *frame_mem_pool; - struct mem_pool *stack_mem_pool; + union { + struct list_head all_frames; + struct { + call_stack_t *next_call; + call_stack_t *prev_call; + } all_stacks; + }; + int64_t cnt; + gf_lock_t lock; + struct mem_pool *frame_mem_pool; + struct mem_pool *stack_mem_pool; }; struct _call_frame_t { - call_stack_t *root; /* stack root */ - call_frame_t *parent; /* previous BP */ - call_frame_t *next; - call_frame_t *prev; /* maintainence list */ - void *local; /* local variables */ - xlator_t *this; /* implicit object */ - ret_fn_t ret; /* op_return address */ - int32_t ref_count; - gf_lock_t lock; - void *cookie; /* unique cookie */ - gf_boolean_t complete; - - glusterfs_fop_t op; + call_stack_t *root; /* stack root */ + call_frame_t *parent; /* previous BP */ + call_frame_t *next; + call_frame_t *prev; /* maintainence list */ + void *local; /* local variables */ + xlator_t *this; /* implicit object */ + ret_fn_t ret; /* op_return address */ + int32_t ref_count; + gf_lock_t lock; + void *cookie; /* unique cookie */ + gf_boolean_t complete; + + glusterfs_fop_t op; struct timeval begin; /* when this frame was created */ struct timeval end; /* when this frame completed */ }; struct _call_stack_t { - union { - struct list_head all_frames; - struct { - call_stack_t *next_call; - call_stack_t *prev_call; - }; - }; - call_pool_t *pool; - void *trans; - uint64_t unique; - void *state; /* pointer to request state */ - uid_t uid; - gid_t gid; - pid_t pid; + union { + struct list_head all_frames; + struct { + call_stack_t *next_call; + call_stack_t *prev_call; + }; + }; + call_pool_t *pool; + void *trans; + uint64_t unique; + void *state; /* pointer to request state */ + uid_t uid; + gid_t gid; + pid_t pid; uint32_t ngrps; uint32_t groups[GF_REQUEST_MAXGROUPS]; uint64_t lk_owner; - call_frame_t frames; + call_frame_t frames; - int32_t op; - int8_t type; + int32_t op; + int8_t type; }; -#define frame_set_uid_gid(frm, u, g) \ - do { \ - if (frm) { \ - (frm)->root->uid = u; \ - (frm)->root->gid = g; \ - (frm)->root->ngrps = 0; \ - } \ - } while (0); \ +#define frame_set_uid_gid(frm, u, g) \ + do { \ + if (frm) { \ + (frm)->root->uid = u; \ + (frm)->root->gid = g; \ + (frm)->root->ngrps = 0; \ + } \ + } while (0); \ + struct xlator_fops; @@ -132,22 +133,22 @@ gf_update_latency (call_frame_t *frame); static inline void FRAME_DESTROY (call_frame_t *frame) { - void *local = NULL; - if (frame->next) - frame->next->prev = frame->prev; - if (frame->prev) - frame->prev->next = frame->next; - if (frame->local) { - local = frame->local; - frame->local = NULL; - - } - - LOCK_DESTROY (&frame->lock); - mem_put (frame->root->pool->frame_mem_pool, frame); - - if (local) - GF_FREE (local); + void *local = NULL; + if (frame->next) + frame->next->prev = frame->prev; + if (frame->prev) + frame->prev->next = frame->next; + if (frame->local) { + local = frame->local; + frame->local = NULL; + + } + + LOCK_DESTROY (&frame->lock); + mem_put (frame->root->pool->frame_mem_pool, frame); + + if (local) + GF_FREE (local); } @@ -156,27 +157,27 @@ STACK_DESTROY (call_stack_t *stack) { void *local = NULL; - LOCK (&stack->pool->lock); - { - list_del_init (&stack->all_frames); - stack->pool->cnt--; - } - UNLOCK (&stack->pool->lock); + LOCK (&stack->pool->lock); + { + list_del_init (&stack->all_frames); + stack->pool->cnt--; + } + UNLOCK (&stack->pool->lock); - if (stack->frames.local) { - local = stack->frames.local; - stack->frames.local = NULL; - } + if (stack->frames.local) { + local = stack->frames.local; + stack->frames.local = NULL; + } - LOCK_DESTROY (&stack->frames.lock); + LOCK_DESTROY (&stack->frames.lock); - while (stack->frames.next) { - FRAME_DESTROY (stack->frames.next); - } - mem_put (stack->pool->stack_mem_pool, stack); + while (stack->frames.next) { + FRAME_DESTROY (stack->frames.next); + } + mem_put (stack->pool->stack_mem_pool, stack); - if (local) - GF_FREE (local); + if (local) + GF_FREE (local); } @@ -200,73 +201,73 @@ STACK_DESTROY (call_stack_t *stack) /* make a call */ -#define STACK_WIND(frame, rfn, obj, fn, params ...) \ - do { \ - call_frame_t *_new = NULL; \ +#define STACK_WIND(frame, rfn, obj, fn, params ...) \ + do { \ + call_frame_t *_new = NULL; \ xlator_t *old_THIS = NULL; \ \ - _new = mem_get0 (frame->root->pool->frame_mem_pool); \ + _new = mem_get0 (frame->root->pool->frame_mem_pool); \ if (!_new) { \ gf_log ("stack", GF_LOG_ERROR, "alloc failed"); \ break; \ } \ - typeof(fn##_cbk) tmp_cbk = rfn; \ - _new->root = frame->root; \ - _new->next = frame->root->frames.next; \ - _new->prev = &frame->root->frames; \ - if (frame->root->frames.next) \ - frame->root->frames.next->prev = _new; \ - frame->root->frames.next = _new; \ - _new->this = obj; \ - _new->ret = (ret_fn_t) tmp_cbk; \ - _new->parent = frame; \ - _new->cookie = _new; \ - LOCK_INIT (&_new->lock); \ - frame->ref_count++; \ + typeof(fn##_cbk) tmp_cbk = rfn; \ + _new->root = frame->root; \ + _new->next = frame->root->frames.next; \ + _new->prev = &frame->root->frames; \ + if (frame->root->frames.next) \ + frame->root->frames.next->prev = _new; \ + frame->root->frames.next = _new; \ + _new->this = obj; \ + _new->ret = (ret_fn_t) tmp_cbk; \ + _new->parent = frame; \ + _new->cookie = _new; \ + LOCK_INIT (&_new->lock); \ + frame->ref_count++; \ old_THIS = THIS; \ THIS = obj; \ - fn (_new, obj, params); \ + fn (_new, obj, params); \ THIS = old_THIS; \ - } while (0) + } while (0) /* make a call with a cookie */ -#define STACK_WIND_COOKIE(frame, rfn, cky, obj, fn, params ...) \ - do { \ +#define STACK_WIND_COOKIE(frame, rfn, cky, obj, fn, params ...) \ + do { \ call_frame_t *_new = NULL; \ xlator_t *old_THIS = NULL; \ \ - _new = mem_get0 (frame->root->pool->frame_mem_pool); \ + _new = mem_get0 (frame->root->pool->frame_mem_pool); \ if (!_new) { \ gf_log ("stack", GF_LOG_ERROR, "alloc failed"); \ break; \ } \ - typeof(fn##_cbk) tmp_cbk = rfn; \ - _new->root = frame->root; \ - _new->next = frame->root->frames.next; \ - _new->prev = &frame->root->frames; \ - if (frame->root->frames.next) \ - frame->root->frames.next->prev = _new; \ - frame->root->frames.next = _new; \ - _new->this = obj; \ - _new->ret = (ret_fn_t) tmp_cbk; \ - _new->parent = frame; \ - _new->cookie = cky; \ - LOCK_INIT (&_new->lock); \ - frame->ref_count++; \ - fn##_cbk = rfn; \ + typeof(fn##_cbk) tmp_cbk = rfn; \ + _new->root = frame->root; \ + _new->next = frame->root->frames.next; \ + _new->prev = &frame->root->frames; \ + if (frame->root->frames.next) \ + frame->root->frames.next->prev = _new; \ + frame->root->frames.next = _new; \ + _new->this = obj; \ + _new->ret = (ret_fn_t) tmp_cbk; \ + _new->parent = frame; \ + _new->cookie = cky; \ + LOCK_INIT (&_new->lock); \ + frame->ref_count++; \ + fn##_cbk = rfn; \ old_THIS = THIS; \ THIS = obj; \ - fn (_new, obj, params); \ + fn (_new, obj, params); \ THIS = old_THIS; \ - } while (0) + } while (0) /* return from function */ -#define STACK_UNWIND(frame, params ...) \ - do { \ - ret_fn_t fn = NULL; \ - call_frame_t *_parent = NULL; \ +#define STACK_UNWIND(frame, params ...) \ + do { \ + ret_fn_t fn = NULL; \ + call_frame_t *_parent = NULL; \ xlator_t *old_THIS = NULL; \ if (!frame) { \ gf_log ("stack", GF_LOG_CRITICAL, "!frame"); \ @@ -274,20 +275,20 @@ STACK_DESTROY (call_stack_t *stack) } \ fn = frame->ret; \ _parent = frame->parent; \ - _parent->ref_count--; \ + _parent->ref_count--; \ old_THIS = THIS; \ THIS = _parent->this; \ frame->complete = _gf_true; \ - fn (_parent, frame->cookie, _parent->this, params); \ + fn (_parent, frame->cookie, _parent->this, params); \ THIS = old_THIS; \ - } while (0) + } while (0) /* return from function in type-safe way */ #define STACK_UNWIND_STRICT(op, frame, params ...) \ - do { \ - fop_##op##_cbk_t fn = NULL; \ - call_frame_t *_parent = NULL; \ + do { \ + fop_##op##_cbk_t fn = NULL; \ + call_frame_t *_parent = NULL; \ xlator_t *old_THIS = NULL; \ \ if (!frame) { \ @@ -296,90 +297,88 @@ STACK_DESTROY (call_stack_t *stack) } \ fn = (fop_##op##_cbk_t )frame->ret; \ _parent = frame->parent; \ - _parent->ref_count--; \ + _parent->ref_count--; \ old_THIS = THIS; \ THIS = _parent->this; \ frame->complete = _gf_true; \ - fn (_parent, frame->cookie, _parent->this, params); \ + fn (_parent, frame->cookie, _parent->this, params); \ THIS = old_THIS; \ - } while (0) + } while (0) static inline call_frame_t * copy_frame (call_frame_t *frame) { - call_stack_t *newstack = NULL; - call_stack_t *oldstack = NULL; + call_stack_t *newstack = NULL; + call_stack_t *oldstack = NULL; - if (!frame) { - return NULL; - } + if (!frame) { + return NULL; + } - newstack = mem_get0 (frame->root->pool->stack_mem_pool); + newstack = mem_get0 (frame->root->pool->stack_mem_pool); if (newstack == NULL) { return NULL; } - oldstack = frame->root; + oldstack = frame->root; - newstack->uid = oldstack->uid; - newstack->gid = oldstack->gid; - newstack->pid = oldstack->pid; + newstack->uid = oldstack->uid; + newstack->gid = oldstack->gid; + newstack->pid = oldstack->pid; newstack->ngrps = oldstack->ngrps; memcpy (newstack->groups, oldstack->groups, sizeof (uint32_t) * GF_REQUEST_MAXGROUPS); - newstack->unique = oldstack->unique; + newstack->unique = oldstack->unique; - newstack->frames.this = frame->this; - newstack->frames.root = newstack; - newstack->pool = oldstack->pool; + newstack->frames.this = frame->this; + newstack->frames.root = newstack; + newstack->pool = oldstack->pool; newstack->lk_owner = oldstack->lk_owner; - LOCK_INIT (&newstack->frames.lock); + LOCK_INIT (&newstack->frames.lock); - LOCK (&oldstack->pool->lock); - { - list_add (&newstack->all_frames, &oldstack->all_frames); - newstack->pool->cnt++; - } - UNLOCK (&oldstack->pool->lock); + LOCK (&oldstack->pool->lock); + { + list_add (&newstack->all_frames, &oldstack->all_frames); + newstack->pool->cnt++; + } + UNLOCK (&oldstack->pool->lock); - return &newstack->frames; + return &newstack->frames; } static inline call_frame_t * create_frame (xlator_t *xl, call_pool_t *pool) { - call_stack_t *stack = NULL; + call_stack_t *stack = NULL; - if (!xl || !pool) { - return NULL; - } + if (!xl || !pool) { + return NULL; + } - stack = mem_get0 (pool->stack_mem_pool); - if (!stack) - return NULL; + stack = mem_get0 (pool->stack_mem_pool); + if (!stack) + return NULL; - stack->pool = pool; - stack->frames.root = stack; - stack->frames.this = xl; + stack->pool = pool; + stack->frames.root = stack; + stack->frames.this = xl; - LOCK (&pool->lock); - { - list_add (&stack->all_frames, &pool->all_frames); - pool->cnt++; - } - UNLOCK (&pool->lock); + LOCK (&pool->lock); + { + list_add (&stack->all_frames, &pool->all_frames); + pool->cnt++; + } + UNLOCK (&pool->lock); - LOCK_INIT (&stack->frames.lock); + LOCK_INIT (&stack->frames.lock); - return &stack->frames; + return &stack->frames; } -void -gf_proc_dump_pending_frames(call_pool_t *call_pool); +void gf_proc_dump_pending_frames(call_pool_t *call_pool); -gf_boolean_t -__is_fuse_call (call_frame_t *frame); +gf_boolean_t __is_fuse_call (call_frame_t *frame); #endif /* _STACK_H */ diff --git a/libglusterfs/src/statedump.h b/libglusterfs/src/statedump.h index 5e106d89769..bb537c305bf 100644 --- a/libglusterfs/src/statedump.h +++ b/libglusterfs/src/statedump.h @@ -19,7 +19,7 @@ #ifndef STATEDUMP_H -#define STATEDUMP_H +#define STATEDUMP_H #include <stdarg.h> #include "inode.h" @@ -58,43 +58,33 @@ void _gf_proc_dump_build_key (char *key, const char *prefix, char *fmt,...) va_start(ap, fmt); vsnprintf(buf, GF_DUMP_MAX_BUF_LEN, fmt, ap); va_end(ap); - snprintf(key, GF_DUMP_MAX_BUF_LEN, "%s.%s", prefix, buf); + snprintf(key, GF_DUMP_MAX_BUF_LEN, "%s.%s", prefix, buf); } -#define gf_proc_dump_build_key(key, key_prefix, fmt...) \ -{\ - _gf_proc_dump_build_key(key, key_prefix, ##fmt);\ -} +#define gf_proc_dump_build_key(key, key_prefix, fmt...) \ + { \ + _gf_proc_dump_build_key(key, key_prefix, ##fmt); \ + } #define GF_PROC_DUMP_SET_OPTION(opt,val) opt = val -void -gf_proc_dump_init(); +void gf_proc_dump_init(); -void -gf_proc_dump_fini(void); +void gf_proc_dump_fini(void); -void -gf_proc_dump_cleanup(void); +void gf_proc_dump_cleanup(void); -void -gf_proc_dump_info(int signum); +void gf_proc_dump_info(int signum); -void -gf_proc_dump_add_section(char *key,...); +void gf_proc_dump_add_section(char *key,...); -void -gf_proc_dump_write(char *key, char *value,...); +void gf_proc_dump_write(char *key, char *value,...); -void -inode_table_dump(inode_table_t *itable, char *prefix); +void inode_table_dump(inode_table_t *itable, char *prefix); -void -fdtable_dump(fdtable_t *fdtable, char *prefix); +void fdtable_dump(fdtable_t *fdtable, char *prefix); -void -inode_dump(inode_t *inode, char *prefix); +void inode_dump(inode_t *inode, char *prefix); -void -glusterd_init (int sig); +void glusterd_init (int sig); #endif /* STATEDUMP_H */ diff --git a/libglusterfs/src/syncop.h b/libglusterfs/src/syncop.h index 12d97010a96..939f44d6b0d 100644 --- a/libglusterfs/src/syncop.h +++ b/libglusterfs/src/syncop.h @@ -1,20 +1,20 @@ /* - Copyright (c) 2010 Gluster, Inc. <http://www.gluster.com> - This file is part of GlusterFS. - - GlusterFS is free software; you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. - - GlusterFS is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see - <http://www.gnu.org/licenses/>. + Copyright (c) 2010 Gluster, Inc. <http://www.gluster.com> + This file is part of GlusterFS. + + GlusterFS is free software; you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation; either version 3 of the License, + or (at your option) any later version. + + GlusterFS is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see + <http://www.gnu.org/licenses/>. */ #ifndef _SYNCOP_H @@ -88,60 +88,60 @@ struct syncargs { #define __yawn(args) do { \ - struct synctask *task = NULL; \ + struct synctask *task = NULL; \ \ - task = synctask_get (); \ - if (task) { \ - args->task = task; \ - synctask_yawn (task); \ - } else { \ - pthread_mutex_init (&args->mutex, NULL); \ - pthread_cond_init (&args->cond, NULL); \ - } \ -} while (0) + task = synctask_get (); \ + if (task) { \ + args->task = task; \ + synctask_yawn (task); \ + } else { \ + pthread_mutex_init (&args->mutex, NULL); \ + pthread_cond_init (&args->cond, NULL); \ + } \ + } while (0) #define __yield(args) do { \ - if (args->task) { \ - synctask_yield (args->task); \ - } else { \ - pthread_mutex_lock (&args->mutex); \ - { \ - while (!args->complete) \ - pthread_cond_wait (&args->cond, \ - &args->mutex); \ - } \ - pthread_mutex_unlock (&args->mutex); \ + if (args->task) { \ + synctask_yield (args->task); \ + } else { \ + pthread_mutex_lock (&args->mutex); \ + { \ + while (!args->complete) \ + pthread_cond_wait (&args->cond, \ + &args->mutex); \ + } \ + pthread_mutex_unlock (&args->mutex); \ \ - pthread_mutex_destroy (&args->mutex); \ - pthread_cond_destroy (&args->cond); \ - } \ -} while (0) + pthread_mutex_destroy (&args->mutex); \ + pthread_cond_destroy (&args->cond); \ + } \ + } while (0) #define __wake(args) do { \ - if (args->task) { \ - synctask_wake (args->task); \ - } else { \ - pthread_mutex_lock (&args->mutex); \ - { \ - args->complete = 1; \ - pthread_cond_broadcast (&args->cond); \ + if (args->task) { \ + synctask_wake (args->task); \ + } else { \ + pthread_mutex_lock (&args->mutex); \ + { \ + args->complete = 1; \ + pthread_cond_broadcast (&args->cond); \ + } \ + pthread_mutex_unlock (&args->mutex); \ } \ - pthread_mutex_unlock (&args->mutex); \ - } \ -} while (0) + } while (0) #define SYNCOP(subvol, stb, cbk, op, params ...) do { \ - call_frame_t *frame = NULL; \ + call_frame_t *frame = NULL; \ \ - frame = syncop_create_frame (); \ + frame = syncop_create_frame (); \ \ - __yawn (stb); \ - STACK_WIND_COOKIE (frame, cbk, (void *)stb, subvol, op, params);\ - __yield (stb); \ -} while (0) + __yawn (stb); \ + STACK_WIND_COOKIE (frame, cbk, (void *)stb, subvol, op, params); \ + __yield (stb); \ + } while (0) #define SYNCENV_DEFAULT_STACKSIZE (16 * 1024) @@ -163,19 +163,14 @@ int syncop_readdirp (xlator_t *subvol, fd_t *fd, size_t size, off_t off, /* out */ gf_dirent_t *entries); -int -syncop_opendir (xlator_t *subvol, - loc_t *loc, - fd_t *fd); +int syncop_opendir (xlator_t *subvol, loc_t *loc, fd_t *fd); int syncop_setattr (xlator_t *subvol, loc_t *loc, struct iatt *iatt, int valid, /* out */ struct iatt *preop, struct iatt *postop); -int -syncop_statfs (xlator_t *subvol, loc_t *loc, struct statvfs *buf); +int syncop_statfs (xlator_t *subvol, loc_t *loc, struct statvfs *buf); -int -syncop_setxattr (xlator_t *subvol, loc_t *loc, dict_t *dict, int32_t flags); +int syncop_setxattr (xlator_t *subvol, loc_t *loc, dict_t *dict, int32_t flags); #endif /* _SYNCOP_H */ diff --git a/libglusterfs/src/timer.h b/libglusterfs/src/timer.h index 4598029dc62..74abe52a2c0 100644 --- a/libglusterfs/src/timer.h +++ b/libglusterfs/src/timer.h @@ -1,20 +1,20 @@ /* - Copyright (c) 2007-2010 Gluster, Inc. <http://www.gluster.com> - This file is part of GlusterFS. + Copyright (c) 2007-2010 Gluster, Inc. <http://www.gluster.com> + This file is part of GlusterFS. - GlusterFS is free software; you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. + GlusterFS is free software; you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation; either version 3 of the License, + or (at your option) any later version. - GlusterFS is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Affero General Public License for more details. + GlusterFS is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Affero General Public License for more details. - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see - <http://www.gnu.org/licenses/>. + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see + <http://www.gnu.org/licenses/>. */ #ifndef _TIMER_H @@ -33,19 +33,19 @@ typedef void (*gf_timer_cbk_t) (void *); struct _gf_timer { - struct _gf_timer *next, *prev; - struct timeval at; - gf_timer_cbk_t callbk; - void *data; - xlator_t *xl; + struct _gf_timer *next, *prev; + struct timeval at; + gf_timer_cbk_t callbk; + void *data; + xlator_t *xl; }; struct _gf_timer_registry { - pthread_t th; - char fin; - struct _gf_timer stale; - struct _gf_timer active; - pthread_mutex_t lock; + pthread_t th; + char fin; + struct _gf_timer stale; + struct _gf_timer active; + pthread_mutex_t lock; }; typedef struct _gf_timer gf_timer_t; @@ -53,13 +53,13 @@ typedef struct _gf_timer_registry gf_timer_registry_t; gf_timer_t * gf_timer_call_after (glusterfs_ctx_t *ctx, - struct timeval delta, - gf_timer_cbk_t cbk, - void *data); + struct timeval delta, + gf_timer_cbk_t cbk, + void *data); int32_t gf_timer_call_cancel (glusterfs_ctx_t *ctx, - gf_timer_t *event); + gf_timer_t *event); void * gf_timer_proc (void *data); diff --git a/libglusterfs/src/trie-mem-types.h b/libglusterfs/src/trie-mem-types.h index 2b21f67e1a8..98a1766da30 100644 --- a/libglusterfs/src/trie-mem-types.h +++ b/libglusterfs/src/trie-mem-types.h @@ -1,20 +1,20 @@ /* - Copyright (c) 2010 Gluster, Inc. <http://www.gluster.com> - This file is part of GlusterFS. + Copyright (c) 2010 Gluster, Inc. <http://www.gluster.com> + This file is part of GlusterFS. - GlusterFS is free software; you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation; either version 3 of the License, - or (at your option) any later version. + GlusterFS is free software; you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation; either version 3 of the License, + or (at your option) any later version. - GlusterFS is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Affero General Public License for more details. + GlusterFS is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Affero General Public License for more details. - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see - <http://www.gnu.org/licenses/>. + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see + <http://www.gnu.org/licenses/>. */ #ifndef __TRIE_MEM_TYPES_H__ diff --git a/libglusterfs/src/xlator.h b/libglusterfs/src/xlator.h index e583e8c1308..604c8c08f32 100644 --- a/libglusterfs/src/xlator.h +++ b/libglusterfs/src/xlator.h @@ -64,7 +64,7 @@ typedef struct _loc loc_t; typedef int32_t (*event_notify_fn_t) (xlator_t *this, int32_t event, void *data, - ...); + ...); #include "list.h" #include "gf-dirent.h" @@ -76,20 +76,20 @@ typedef int32_t (*event_notify_fn_t) (xlator_t *this, int32_t event, void *data, #include "iatt.h" struct _loc { - const char *path; - const char *name; - ino_t ino; - inode_t *inode; - inode_t *parent; + const char *path; + const char *name; + ino_t ino; + inode_t *inode; + inode_t *parent; }; typedef int32_t (*fop_getspec_cbk_t) (call_frame_t *frame, - void *cookie, - xlator_t *this, - int32_t op_ret, - int32_t op_errno, - char *spec_data); + void *cookie, + xlator_t *this, + int32_t op_ret, + int32_t op_errno, + char *spec_data); typedef int32_t (*fop_rchecksum_cbk_t) (call_frame_t *frame, void *cookie, @@ -101,9 +101,9 @@ typedef int32_t (*fop_rchecksum_cbk_t) (call_frame_t *frame, typedef int32_t (*fop_getspec_t) (call_frame_t *frame, - xlator_t *this, - const char *key, - int32_t flag); + xlator_t *this, + const char *key, + int32_t flag); typedef int32_t (*fop_rchecksum_t) (call_frame_t *frame, xlator_t *this, @@ -112,208 +112,208 @@ typedef int32_t (*fop_rchecksum_t) (call_frame_t *frame, typedef int32_t (*fop_lookup_cbk_t) (call_frame_t *frame, - void *cookie, - xlator_t *this, - int32_t op_ret, - int32_t op_errno, - inode_t *inode, - struct iatt *buf, + void *cookie, + xlator_t *this, + int32_t op_ret, + int32_t op_errno, + inode_t *inode, + struct iatt *buf, dict_t *xattr, struct iatt *postparent); typedef int32_t (*fop_stat_cbk_t) (call_frame_t *frame, - void *cookie, - xlator_t *this, - int32_t op_ret, - int32_t op_errno, - struct iatt *buf); + void *cookie, + xlator_t *this, + int32_t op_ret, + int32_t op_errno, + struct iatt *buf); typedef int32_t (*fop_fstat_cbk_t) (call_frame_t *frame, - void *cookie, - xlator_t *this, - int32_t op_ret, - int32_t op_errno, - struct iatt *buf); + void *cookie, + xlator_t *this, + int32_t op_ret, + int32_t op_errno, + struct iatt *buf); typedef int32_t (*fop_truncate_cbk_t) (call_frame_t *frame, - void *cookie, - xlator_t *this, - int32_t op_ret, - int32_t op_errno, - struct iatt *prebuf, + void *cookie, + xlator_t *this, + int32_t op_ret, + int32_t op_errno, + struct iatt *prebuf, struct iatt *postbuf); typedef int32_t (*fop_ftruncate_cbk_t) (call_frame_t *frame, - void *cookie, - xlator_t *this, - int32_t op_ret, - int32_t op_errno, - struct iatt *prebuf, + void *cookie, + xlator_t *this, + int32_t op_ret, + int32_t op_errno, + struct iatt *prebuf, struct iatt *postbuf); typedef int32_t (*fop_access_cbk_t) (call_frame_t *frame, - void *cookie, - xlator_t *this, - int32_t op_ret, - int32_t op_errno); + void *cookie, + xlator_t *this, + int32_t op_ret, + int32_t op_errno); typedef int32_t (*fop_readlink_cbk_t) (call_frame_t *frame, - void *cookie, - xlator_t *this, - int32_t op_ret, - int32_t op_errno, - const char *path, + void *cookie, + xlator_t *this, + int32_t op_ret, + int32_t op_errno, + const char *path, struct iatt *buf); typedef int32_t (*fop_mknod_cbk_t) (call_frame_t *frame, - void *cookie, - xlator_t *this, - int32_t op_ret, - int32_t op_errno, - inode_t *inode, + void *cookie, + xlator_t *this, + int32_t op_ret, + int32_t op_errno, + inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent); typedef int32_t (*fop_mkdir_cbk_t) (call_frame_t *frame, - void *cookie, - xlator_t *this, - int32_t op_ret, - int32_t op_errno, - inode_t *inode, + void *cookie, + xlator_t *this, + int32_t op_ret, + int32_t op_errno, + inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent); typedef int32_t (*fop_unlink_cbk_t) (call_frame_t *frame, - void *cookie, - xlator_t *this, - int32_t op_ret, - int32_t op_errno, + void *cookie, + xlator_t *this, + int32_t op_ret, + int32_t op_errno, struct iatt *preparent, struct iatt *postparent); typedef int32_t (*fop_rmdir_cbk_t) (call_frame_t *frame, - void *cookie, - xlator_t *this, - int32_t op_ret, - int32_t op_errno, + void *cookie, + xlator_t *this, + int32_t op_ret, + int32_t op_errno, struct iatt *preparent, struct iatt *postparent); typedef int32_t (*fop_symlink_cbk_t) (call_frame_t *frame, - void *cookie, - xlator_t *this, - int32_t op_ret, - int32_t op_errno, - inode_t *inode, + void *cookie, + xlator_t *this, + int32_t op_ret, + int32_t op_errno, + inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent); typedef int32_t (*fop_rename_cbk_t) (call_frame_t *frame, - void *cookie, - xlator_t *this, - int32_t op_ret, - int32_t op_errno, - struct iatt *buf, + void *cookie, + xlator_t *this, + int32_t op_ret, + int32_t op_errno, + struct iatt *buf, struct iatt *preoldparent, struct iatt *postoldparent, struct iatt *prenewparent, struct iatt *postnewparent); typedef int32_t (*fop_link_cbk_t) (call_frame_t *frame, - void *cookie, - xlator_t *this, - int32_t op_ret, - int32_t op_errno, - inode_t *inode, + void *cookie, + xlator_t *this, + int32_t op_ret, + int32_t op_errno, + inode_t *inode, struct iatt *buf, struct iatt *preparent, struct iatt *postparent); typedef int32_t (*fop_create_cbk_t) (call_frame_t *frame, - void *cookie, - xlator_t *this, - int32_t op_ret, - int32_t op_errno, - fd_t *fd, - inode_t *inode, - struct iatt *buf, + void *cookie, + xlator_t *this, + int32_t op_ret, + int32_t op_errno, + fd_t *fd, + inode_t *inode, + struct iatt *buf, struct iatt *preparent, struct iatt *postparent); typedef int32_t (*fop_open_cbk_t) (call_frame_t *frame, - void *cookie, - xlator_t *this, - int32_t op_ret, - int32_t op_errno, - fd_t *fd); + void *cookie, + xlator_t *this, + int32_t op_ret, + int32_t op_errno, + fd_t *fd); typedef int32_t (*fop_readv_cbk_t) (call_frame_t *frame, - void *cookie, - xlator_t *this, - int32_t op_ret, - int32_t op_errno, - struct iovec *vector, - int32_t count, - struct iatt *stbuf, + void *cookie, + xlator_t *this, + int32_t op_ret, + int32_t op_errno, + struct iovec *vector, + int32_t count, + struct iatt *stbuf, struct iobref *iobref); typedef int32_t (*fop_writev_cbk_t) (call_frame_t *frame, - void *cookie, - xlator_t *this, - int32_t op_ret, - int32_t op_errno, - struct iatt *prebuf, + void *cookie, + xlator_t *this, + int32_t op_ret, + int32_t op_errno, + struct iatt *prebuf, struct iatt *postbuf); typedef int32_t (*fop_flush_cbk_t) (call_frame_t *frame, - void *cookie, - xlator_t *this, - int32_t op_ret, - int32_t op_errno); + void *cookie, + xlator_t *this, + int32_t op_ret, + int32_t op_errno); typedef int32_t (*fop_fsync_cbk_t) (call_frame_t *frame, - void *cookie, - xlator_t *this, - int32_t op_ret, - int32_t op_errno, + void *cookie, + xlator_t *this, + int32_t op_ret, + int32_t op_errno, struct iatt *prebuf, struct iatt *postbuf); typedef int32_t (*fop_opendir_cbk_t) (call_frame_t *frame, - void *cookie, - xlator_t *this, - int32_t op_ret, - int32_t op_errno, - fd_t *fd); + void *cookie, + xlator_t *this, + int32_t op_ret, + int32_t op_errno, + fd_t *fd); typedef int32_t (*fop_fsyncdir_cbk_t) (call_frame_t *frame, - void *cookie, - xlator_t *this, - int32_t op_ret, - int32_t op_errno); + void *cookie, + xlator_t *this, + int32_t op_ret, + int32_t op_errno); typedef int32_t (*fop_statfs_cbk_t) (call_frame_t *frame, - void *cookie, - xlator_t *this, - int32_t op_ret, - int32_t op_errno, - struct statvfs *buf); + void *cookie, + xlator_t *this, + int32_t op_ret, + int32_t op_errno, + struct statvfs *buf); typedef int32_t (*fop_setxattr_cbk_t) (call_frame_t *frame, - void *cookie, - xlator_t *this, - int32_t op_ret, - int32_t op_errno); + void *cookie, + xlator_t *this, + int32_t op_ret, + int32_t op_errno); typedef int32_t (*fop_getxattr_cbk_t) (call_frame_t *frame, - void *cookie, - xlator_t *this, - int32_t op_ret, - int32_t op_errno, - dict_t *dict); + void *cookie, + xlator_t *this, + int32_t op_ret, + int32_t op_errno, + dict_t *dict); typedef int32_t (*fop_fsetxattr_cbk_t) (call_frame_t *frame, void *cookie, @@ -329,69 +329,69 @@ typedef int32_t (*fop_fgetxattr_cbk_t) (call_frame_t *frame, dict_t *dict); typedef int32_t (*fop_removexattr_cbk_t) (call_frame_t *frame, - void *cookie, - xlator_t *this, - int32_t op_ret, - int32_t op_errno); + void *cookie, + xlator_t *this, + int32_t op_ret, + int32_t op_errno); typedef int32_t (*fop_lk_cbk_t) (call_frame_t *frame, - void *cookie, - xlator_t *this, - int32_t op_ret, - int32_t op_errno, - struct gf_flock *flock); + void *cookie, + xlator_t *this, + int32_t op_ret, + int32_t op_errno, + struct gf_flock *flock); typedef int32_t (*fop_inodelk_cbk_t) (call_frame_t *frame, - void *cookie, - xlator_t *this, - int32_t op_ret, - int32_t op_errno); + void *cookie, + xlator_t *this, + int32_t op_ret, + int32_t op_errno); typedef int32_t (*fop_finodelk_cbk_t) (call_frame_t *frame, - void *cookie, - xlator_t *this, - int32_t op_ret, - int32_t op_errno); + void *cookie, + xlator_t *this, + int32_t op_ret, + int32_t op_errno); typedef int32_t (*fop_entrylk_cbk_t) (call_frame_t *frame, - void *cookie, - xlator_t *this, - int32_t op_ret, - int32_t op_errno); + void *cookie, + xlator_t *this, + int32_t op_ret, + int32_t op_errno); typedef int32_t (*fop_fentrylk_cbk_t) (call_frame_t *frame, - void *cookie, - xlator_t *this, - int32_t op_ret, - int32_t op_errno); + void *cookie, + xlator_t *this, + int32_t op_ret, + int32_t op_errno); typedef int32_t (*fop_readdir_cbk_t) (call_frame_t *frame, - void *cookie, - xlator_t *this, - int32_t op_ret, - int32_t op_errno, - gf_dirent_t *entries); + void *cookie, + xlator_t *this, + int32_t op_ret, + int32_t op_errno, + gf_dirent_t *entries); typedef int32_t (*fop_readdirp_cbk_t) (call_frame_t *frame, - void *cookie, - xlator_t *this, - int32_t op_ret, - int32_t op_errno, - gf_dirent_t *entries); + void *cookie, + xlator_t *this, + int32_t op_ret, + int32_t op_errno, + gf_dirent_t *entries); typedef int32_t (*fop_xattrop_cbk_t) (call_frame_t *frame, - void *cookie, - xlator_t *this, - int32_t op_ret, - int32_t op_errno, - dict_t *xattr); + void *cookie, + xlator_t *this, + int32_t op_ret, + int32_t op_errno, + dict_t *xattr); typedef int32_t (*fop_fxattrop_cbk_t) (call_frame_t *frame, - void *cookie, - xlator_t *this, - int32_t op_ret, - int32_t op_errno, - dict_t *xattr); + void *cookie, + xlator_t *this, + int32_t op_ret, + int32_t op_errno, + dict_t *xattr); typedef int32_t (*fop_setattr_cbk_t) (call_frame_t *frame, @@ -411,69 +411,69 @@ typedef int32_t (*fop_fsetattr_cbk_t) (call_frame_t *frame, struct iatt *postop_stbuf); typedef int32_t (*fop_lookup_t) (call_frame_t *frame, - xlator_t *this, - loc_t *loc, - dict_t *xattr_req); + xlator_t *this, + loc_t *loc, + dict_t *xattr_req); typedef int32_t (*fop_stat_t) (call_frame_t *frame, - xlator_t *this, - loc_t *loc); + xlator_t *this, + loc_t *loc); typedef int32_t (*fop_fstat_t) (call_frame_t *frame, - xlator_t *this, - fd_t *fd); + xlator_t *this, + fd_t *fd); typedef int32_t (*fop_truncate_t) (call_frame_t *frame, - xlator_t *this, - loc_t *loc, - off_t offset); + xlator_t *this, + loc_t *loc, + off_t offset); typedef int32_t (*fop_ftruncate_t) (call_frame_t *frame, - xlator_t *this, - fd_t *fd, - off_t offset); + xlator_t *this, + fd_t *fd, + off_t offset); typedef int32_t (*fop_access_t) (call_frame_t *frame, - xlator_t *this, - loc_t *loc, - int32_t mask); + xlator_t *this, + loc_t *loc, + int32_t mask); typedef int32_t (*fop_readlink_t) (call_frame_t *frame, - xlator_t *this, - loc_t *loc, - size_t size); + xlator_t *this, + loc_t *loc, + size_t size); typedef int32_t (*fop_mknod_t) (call_frame_t *frame, xlator_t *this, - loc_t *loc, mode_t mode, dev_t rdev, + loc_t *loc, mode_t mode, dev_t rdev, dict_t *params); typedef int32_t (*fop_mkdir_t) (call_frame_t *frame, xlator_t *this, - loc_t *loc, mode_t mode, dict_t *params); + loc_t *loc, mode_t mode, dict_t *params); typedef int32_t (*fop_unlink_t) (call_frame_t *frame, - xlator_t *this, - loc_t *loc); + xlator_t *this, + loc_t *loc); typedef int32_t (*fop_rmdir_t) (call_frame_t *frame, xlator_t *this, - loc_t *loc, int flags); + loc_t *loc, int flags); typedef int32_t (*fop_symlink_t) (call_frame_t *frame, xlator_t *this, - const char *linkname, loc_t *loc, + const char *linkname, loc_t *loc, dict_t *params); typedef int32_t (*fop_rename_t) (call_frame_t *frame, - xlator_t *this, - loc_t *oldloc, - loc_t *newloc); + xlator_t *this, + loc_t *oldloc, + loc_t *newloc); typedef int32_t (*fop_link_t) (call_frame_t *frame, - xlator_t *this, - loc_t *oldloc, - loc_t *newloc); + xlator_t *this, + loc_t *oldloc, + loc_t *newloc); typedef int32_t (*fop_create_t) (call_frame_t *frame, xlator_t *this, - loc_t *loc, int32_t flags, mode_t mode, - fd_t *fd, dict_t *params); + loc_t *loc, int32_t flags, mode_t mode, + fd_t *fd, dict_t *params); /* Tell subsequent writes on the fd_t to fsync after every writev fop without * requiring a fsync fop. @@ -485,59 +485,59 @@ typedef int32_t (*fop_create_t) (call_frame_t *frame, xlator_t *this, #define GF_OPEN_NOWB 0x02 typedef int32_t (*fop_open_t) (call_frame_t *frame, - xlator_t *this, - loc_t *loc, - int32_t flags, - fd_t *fd, + xlator_t *this, + loc_t *loc, + int32_t flags, + fd_t *fd, int32_t wbflags); typedef int32_t (*fop_readv_t) (call_frame_t *frame, - xlator_t *this, - fd_t *fd, - size_t size, - off_t offset); + xlator_t *this, + fd_t *fd, + size_t size, + off_t offset); typedef int32_t (*fop_writev_t) (call_frame_t *frame, - xlator_t *this, - fd_t *fd, - struct iovec *vector, - int32_t count, - off_t offset, + xlator_t *this, + fd_t *fd, + struct iovec *vector, + int32_t count, + off_t offset, struct iobref *iobref); typedef int32_t (*fop_flush_t) (call_frame_t *frame, - xlator_t *this, - fd_t *fd); + xlator_t *this, + fd_t *fd); typedef int32_t (*fop_fsync_t) (call_frame_t *frame, - xlator_t *this, - fd_t *fd, - int32_t datasync); + xlator_t *this, + fd_t *fd, + int32_t datasync); typedef int32_t (*fop_opendir_t) (call_frame_t *frame, - xlator_t *this, - loc_t *loc, - fd_t *fd); + xlator_t *this, + loc_t *loc, + fd_t *fd); typedef int32_t (*fop_fsyncdir_t) (call_frame_t *frame, - xlator_t *this, - fd_t *fd, - int32_t datasync); + xlator_t *this, + fd_t *fd, + int32_t datasync); typedef int32_t (*fop_statfs_t) (call_frame_t *frame, - xlator_t *this, - loc_t *loc); + xlator_t *this, + loc_t *loc); typedef int32_t (*fop_setxattr_t) (call_frame_t *frame, - xlator_t *this, - loc_t *loc, - dict_t *dict, - int32_t flags); + xlator_t *this, + loc_t *loc, + dict_t *dict, + int32_t flags); typedef int32_t (*fop_getxattr_t) (call_frame_t *frame, - xlator_t *this, - loc_t *loc, - const char *name); + xlator_t *this, + loc_t *loc, + const char *name); typedef int32_t (*fop_fsetxattr_t) (call_frame_t *frame, xlator_t *this, @@ -551,65 +551,65 @@ typedef int32_t (*fop_fgetxattr_t) (call_frame_t *frame, const char *name); typedef int32_t (*fop_removexattr_t) (call_frame_t *frame, - xlator_t *this, - loc_t *loc, - const char *name); + xlator_t *this, + loc_t *loc, + const char *name); typedef int32_t (*fop_lk_t) (call_frame_t *frame, - xlator_t *this, - fd_t *fd, - int32_t cmd, - struct gf_flock *flock); + xlator_t *this, + fd_t *fd, + int32_t cmd, + struct gf_flock *flock); typedef int32_t (*fop_inodelk_t) (call_frame_t *frame, - xlator_t *this, + xlator_t *this, const char *volume, - loc_t *loc, - int32_t cmd, - struct gf_flock *flock); + loc_t *loc, + int32_t cmd, + struct gf_flock *flock); typedef int32_t (*fop_finodelk_t) (call_frame_t *frame, - xlator_t *this, + xlator_t *this, const char *volume, - fd_t *fd, - int32_t cmd, - struct gf_flock *flock); + fd_t *fd, + int32_t cmd, + struct gf_flock *flock); typedef int32_t (*fop_entrylk_t) (call_frame_t *frame, - xlator_t *this, + xlator_t *this, const char *volume, loc_t *loc, - const char *basename, entrylk_cmd cmd, - entrylk_type type); + const char *basename, entrylk_cmd cmd, + entrylk_type type); typedef int32_t (*fop_fentrylk_t) (call_frame_t *frame, - xlator_t *this, + xlator_t *this, const char *volume, fd_t *fd, - const char *basename, entrylk_cmd cmd, - entrylk_type type); + const char *basename, entrylk_cmd cmd, + entrylk_type type); typedef int32_t (*fop_readdir_t) (call_frame_t *frame, - xlator_t *this, - fd_t *fd, - size_t size, - off_t offset); + xlator_t *this, + fd_t *fd, + size_t size, + off_t offset); typedef int32_t (*fop_readdirp_t) (call_frame_t *frame, - xlator_t *this, - fd_t *fd, - size_t size, - off_t offset); + xlator_t *this, + fd_t *fd, + size_t size, + off_t offset); typedef int32_t (*fop_xattrop_t) (call_frame_t *frame, - xlator_t *this, - loc_t *loc, - gf_xattrop_flags_t optype, - dict_t *xattr); + xlator_t *this, + loc_t *loc, + gf_xattrop_flags_t optype, + dict_t *xattr); typedef int32_t (*fop_fxattrop_t) (call_frame_t *frame, - xlator_t *this, - fd_t *fd, - gf_xattrop_flags_t optype, - dict_t *xattr); + xlator_t *this, + fd_t *fd, + gf_xattrop_flags_t optype, + dict_t *xattr); typedef int32_t (*fop_setattr_t) (call_frame_t *frame, xlator_t *this, @@ -625,102 +625,102 @@ typedef int32_t (*fop_fsetattr_t) (call_frame_t *frame, struct xlator_fops { - fop_lookup_t lookup; - fop_stat_t stat; - fop_fstat_t fstat; - fop_truncate_t truncate; - fop_ftruncate_t ftruncate; - fop_access_t access; - fop_readlink_t readlink; - fop_mknod_t mknod; - fop_mkdir_t mkdir; - fop_unlink_t unlink; - fop_rmdir_t rmdir; - fop_symlink_t symlink; - fop_rename_t rename; - fop_link_t link; - fop_create_t create; - fop_open_t open; - fop_readv_t readv; - fop_writev_t writev; - fop_flush_t flush; - fop_fsync_t fsync; - fop_opendir_t opendir; - fop_readdir_t readdir; - fop_readdirp_t readdirp; - fop_fsyncdir_t fsyncdir; - fop_statfs_t statfs; - fop_setxattr_t setxattr; - fop_getxattr_t getxattr; - fop_fsetxattr_t fsetxattr; - fop_fgetxattr_t fgetxattr; - fop_removexattr_t removexattr; - fop_lk_t lk; - fop_inodelk_t inodelk; - fop_finodelk_t finodelk; - fop_entrylk_t entrylk; - fop_fentrylk_t fentrylk; - fop_rchecksum_t rchecksum; - fop_xattrop_t xattrop; - fop_fxattrop_t fxattrop; + fop_lookup_t lookup; + fop_stat_t stat; + fop_fstat_t fstat; + fop_truncate_t truncate; + fop_ftruncate_t ftruncate; + fop_access_t access; + fop_readlink_t readlink; + fop_mknod_t mknod; + fop_mkdir_t mkdir; + fop_unlink_t unlink; + fop_rmdir_t rmdir; + fop_symlink_t symlink; + fop_rename_t rename; + fop_link_t link; + fop_create_t create; + fop_open_t open; + fop_readv_t readv; + fop_writev_t writev; + fop_flush_t flush; + fop_fsync_t fsync; + fop_opendir_t opendir; + fop_readdir_t readdir; + fop_readdirp_t readdirp; + fop_fsyncdir_t fsyncdir; + fop_statfs_t statfs; + fop_setxattr_t setxattr; + fop_getxattr_t getxattr; + fop_fsetxattr_t fsetxattr; + fop_fgetxattr_t fgetxattr; + fop_removexattr_t removexattr; + fop_lk_t lk; + fop_inodelk_t inodelk; + fop_finodelk_t finodelk; + fop_entrylk_t entrylk; + fop_fentrylk_t fentrylk; + fop_rchecksum_t rchecksum; + fop_xattrop_t xattrop; + fop_fxattrop_t fxattrop; fop_setattr_t setattr; fop_fsetattr_t fsetattr; fop_getspec_t getspec; - /* these entries are used for a typechecking hack in STACK_WIND _only_ */ - fop_lookup_cbk_t lookup_cbk; - fop_stat_cbk_t stat_cbk; - fop_fstat_cbk_t fstat_cbk; - fop_truncate_cbk_t truncate_cbk; - fop_ftruncate_cbk_t ftruncate_cbk; - fop_access_cbk_t access_cbk; - fop_readlink_cbk_t readlink_cbk; - fop_mknod_cbk_t mknod_cbk; - fop_mkdir_cbk_t mkdir_cbk; - fop_unlink_cbk_t unlink_cbk; - fop_rmdir_cbk_t rmdir_cbk; - fop_symlink_cbk_t symlink_cbk; - fop_rename_cbk_t rename_cbk; - fop_link_cbk_t link_cbk; - fop_create_cbk_t create_cbk; - fop_open_cbk_t open_cbk; - fop_readv_cbk_t readv_cbk; - fop_writev_cbk_t writev_cbk; - fop_flush_cbk_t flush_cbk; - fop_fsync_cbk_t fsync_cbk; - fop_opendir_cbk_t opendir_cbk; - fop_readdir_cbk_t readdir_cbk; - fop_readdirp_cbk_t readdirp_cbk; - fop_fsyncdir_cbk_t fsyncdir_cbk; - fop_statfs_cbk_t statfs_cbk; - fop_setxattr_cbk_t setxattr_cbk; - fop_getxattr_cbk_t getxattr_cbk; - fop_fsetxattr_cbk_t fsetxattr_cbk; - fop_fgetxattr_cbk_t fgetxattr_cbk; - fop_removexattr_cbk_t removexattr_cbk; - fop_lk_cbk_t lk_cbk; - fop_inodelk_cbk_t inodelk_cbk; - fop_finodelk_cbk_t finodelk_cbk; - fop_entrylk_cbk_t entrylk_cbk; - fop_fentrylk_cbk_t fentrylk_cbk; - fop_rchecksum_cbk_t rchecksum_cbk; - fop_xattrop_cbk_t xattrop_cbk; - fop_fxattrop_cbk_t fxattrop_cbk; + /* these entries are used for a typechecking hack in STACK_WIND _only_ */ + fop_lookup_cbk_t lookup_cbk; + fop_stat_cbk_t stat_cbk; + fop_fstat_cbk_t fstat_cbk; + fop_truncate_cbk_t truncate_cbk; + fop_ftruncate_cbk_t ftruncate_cbk; + fop_access_cbk_t access_cbk; + fop_readlink_cbk_t readlink_cbk; + fop_mknod_cbk_t mknod_cbk; + fop_mkdir_cbk_t mkdir_cbk; + fop_unlink_cbk_t unlink_cbk; + fop_rmdir_cbk_t rmdir_cbk; + fop_symlink_cbk_t symlink_cbk; + fop_rename_cbk_t rename_cbk; + fop_link_cbk_t link_cbk; + fop_create_cbk_t create_cbk; + fop_open_cbk_t open_cbk; + fop_readv_cbk_t readv_cbk; + fop_writev_cbk_t writev_cbk; + fop_flush_cbk_t flush_cbk; + fop_fsync_cbk_t fsync_cbk; + fop_opendir_cbk_t opendir_cbk; + fop_readdir_cbk_t readdir_cbk; + fop_readdirp_cbk_t readdirp_cbk; + fop_fsyncdir_cbk_t fsyncdir_cbk; + fop_statfs_cbk_t statfs_cbk; + fop_setxattr_cbk_t setxattr_cbk; + fop_getxattr_cbk_t getxattr_cbk; + fop_fsetxattr_cbk_t fsetxattr_cbk; + fop_fgetxattr_cbk_t fgetxattr_cbk; + fop_removexattr_cbk_t removexattr_cbk; + fop_lk_cbk_t lk_cbk; + fop_inodelk_cbk_t inodelk_cbk; + fop_finodelk_cbk_t finodelk_cbk; + fop_entrylk_cbk_t entrylk_cbk; + fop_fentrylk_cbk_t fentrylk_cbk; + fop_rchecksum_cbk_t rchecksum_cbk; + fop_xattrop_cbk_t xattrop_cbk; + fop_fxattrop_cbk_t fxattrop_cbk; fop_setattr_cbk_t setattr_cbk; fop_fsetattr_cbk_t fsetattr_cbk; fop_getspec_cbk_t getspec_cbk; }; typedef int32_t (*cbk_forget_t) (xlator_t *this, - inode_t *inode); + inode_t *inode); typedef int32_t (*cbk_release_t) (xlator_t *this, - fd_t *fd); + fd_t *fd); struct xlator_cbks { - cbk_forget_t forget; - cbk_release_t release; - cbk_release_t releasedir; + cbk_forget_t forget; + cbk_release_t release; + cbk_release_t releasedir; }; typedef int32_t (*dumpop_priv_t) (xlator_t *this); @@ -734,16 +734,16 @@ typedef int32_t (*dumpop_inodectx_t) (xlator_t *this, inode_t *ino); typedef int32_t (*dumpop_fdctx_t) (xlator_t *this, fd_t *fd); struct xlator_dumpops { - dumpop_priv_t priv; - dumpop_inode_t inode; + dumpop_priv_t priv; + dumpop_inode_t inode; dumpop_fd_t fd; - dumpop_inodectx_t inodectx; + dumpop_inodectx_t inodectx; dumpop_fdctx_t fdctx; }; typedef struct xlator_list { - xlator_t *xlator; - struct xlator_list *next; + xlator_t *xlator; + struct xlator_list *next; } xlator_list_t; /* Add possible new type of option you may need */ @@ -758,7 +758,7 @@ typedef enum { GF_OPTION_TYPE_XLATOR, GF_OPTION_TYPE_PATH, GF_OPTION_TYPE_TIME, - GF_OPTION_TYPE_DOUBLE, + GF_OPTION_TYPE_DOUBLE, GF_OPTION_TYPE_INTERNET_ADDRESS, } volume_option_type_t; @@ -769,59 +769,59 @@ typedef enum { /* Each translator should define this structure */ typedef struct volume_options { char *key[ZR_VOLUME_MAX_NUM_KEY]; - /* different key, same meaning */ + /* different key, same meaning */ volume_option_type_t type; int64_t min; /* -1 means no range */ int64_t max; /* -1 means no range */ char *value[ZR_OPTION_MAX_ARRAY_SIZE]; - /* If specified, will check for one of - the value from this array */ - char *description; /* about the key */ + /* If specified, will check for one of + the value from this array */ + char *description; /* about the key */ } volume_option_t; typedef struct vol_opt_list { - struct list_head list; - volume_option_t *given_opt; + struct list_head list; + volume_option_t *given_opt; } volume_opt_list_t; struct _xlator { - /* Built during parsing */ - char *name; - char *type; - xlator_t *next; - xlator_t *prev; - xlator_list_t *parents; - xlator_list_t *children; - dict_t *options; - - /* Set after doing dlopen() */ + /* Built during parsing */ + char *name; + char *type; + xlator_t *next; + xlator_t *prev; + xlator_list_t *parents; + xlator_list_t *children; + dict_t *options; + + /* Set after doing dlopen() */ void *dlhandle; - struct xlator_fops *fops; - struct xlator_cbks *cbks; - struct xlator_dumpops *dumpops; - struct list_head volume_options; /* list of volume_option_t */ + struct xlator_fops *fops; + struct xlator_cbks *cbks; + struct xlator_dumpops *dumpops; + struct list_head volume_options; /* list of volume_option_t */ - void (*fini) (xlator_t *this); - int32_t (*init) (xlator_t *this); + void (*fini) (xlator_t *this); + int32_t (*init) (xlator_t *this); int32_t (*reconfigure) (xlator_t *this, dict_t *options); - int32_t (*mem_acct_init) (xlator_t *this); - int32_t (*validate_options) (xlator_t *this, dict_t *options, + int32_t (*mem_acct_init) (xlator_t *this); + int32_t (*validate_options) (xlator_t *this, dict_t *options, char **op_errstr); - event_notify_fn_t notify; + event_notify_fn_t notify; gf_loglevel_t loglevel; /* Log level for translator */ /* for latency measurement */ fop_latency_t latencies[GF_FOP_MAXVALUE]; - /* Misc */ - glusterfs_ctx_t *ctx; - glusterfs_graph_t *graph; /* not set for fuse */ - inode_table_t *itable; - char init_succeeded; - void *private; + /* Misc */ + glusterfs_ctx_t *ctx; + glusterfs_graph_t *graph; /* not set for fuse */ + inode_table_t *itable; + char init_succeeded; + void *private; struct mem_acct mem_acct; }; @@ -836,7 +836,7 @@ int32_t xlator_set_type (xlator_t *xl, const char *type); int32_t xlator_dynload (xlator_t *xl); xlator_t *file_to_xlator_tree (glusterfs_ctx_t *ctx, - FILE *fp); + FILE *fp); int xlator_notify (xlator_t *this, int32_t event, void *data, ...); int xlator_init (xlator_t *this); @@ -848,9 +848,9 @@ int32_t xlator_tree_free (xlator_t *xl); void xlator_tree_fini (xlator_t *xl); void xlator_foreach (xlator_t *this, - void (*fn) (xlator_t *each, - void *data), - void *data); + void (*fn) (xlator_t *each, + void *data), + void *data); xlator_t *xlator_search_by_name (xlator_t *any, const char *name); @@ -866,12 +866,4 @@ int xlator_validate_rec (xlator_t *xlator, char **op_errstr); int graph_reconf_validateopt (glusterfs_graph_t *graph, char **op_errstr); int glusterd_check_log_level (const char *value); -#define GF_STAT_PRINT_FMT_STR "%"PRIx64",%"PRIx64",%"PRIx32",%"PRIx32",%"PRIx32",%"PRIx32",%"PRIx64",%"PRIx64",%"PRIx32",%"PRIx64",%"PRIx32",%"PRIx32",%"PRIx32",%"PRIx32",%"PRIx32",%"PRIx32"\n" - -#define GF_STAT_SCAN_FMT_STR "%"SCNx64",%"SCNx64",%"SCNx32",%"SCNx32",%"SCNx32",%"SCNx32",%"SCNx64",%"SCNx64",%"SCNx32",%"SCNx64",%"SCNx32",%"SCNx32",%"SCNx32",%"SCNx32",%"SCNx32",%"SCNx32"\n" - -#define GF_STATFS_PRINT_FMT_STR "%"PRIx32",%"PRIx32",%"PRIx64",%"PRIx64",%"PRIx64",%"PRIx64",%"PRIx64",%"PRIx64",%"PRIx32",%"PRIx32",%"PRIx32"\n" - -#define GF_STATFS_SCAN_FMT_STR "%"SCNx32",%"SCNx32",%"SCNx64",%"SCNx64",%"SCNx64",%"SCNx64",%"SCNx64",%"SCNx64",%"SCNx32",%"SCNx32",%"SCNx32"\n" - #endif /* _XLATOR_H */ |