summaryrefslogtreecommitdiffstats
path: root/xlators/features/index/src
diff options
context:
space:
mode:
authorGluster Ant <bugzilla-bot@gluster.org>2018-09-12 17:22:48 +0530
committerNigel Babu <nigelb@redhat.com>2018-09-12 17:22:48 +0530
commit45a71c0548b6fd2c757aa2e7b7671a1411948894 (patch)
tree2a5a9b73bae47ab53a41166fd041a06612587f48 /xlators/features/index/src
parentbe77dbbda692792335a8e9e7c02e0c281f003c40 (diff)
Land clang-format changes
Change-Id: I6f5d8140a06f3c1b2d196849299f8d483028d33b
Diffstat (limited to 'xlators/features/index/src')
-rw-r--r--xlators/features/index/src/index-mem-types.h10
-rw-r--r--xlators/features/index/src/index-messages.h18
-rw-r--r--xlators/features/index/src/index.h94
3 files changed, 56 insertions, 66 deletions
diff --git a/xlators/features/index/src/index-mem-types.h b/xlators/features/index/src/index-mem-types.h
index ca291cfba7e..f5d456e84be 100644
--- a/xlators/features/index/src/index-mem-types.h
+++ b/xlators/features/index/src/index-mem-types.h
@@ -14,10 +14,10 @@
#include "mem-types.h"
enum gf_index_mem_types_ {
- gf_index_mt_priv_t = gf_common_mt_end + 1,
- gf_index_inode_ctx_t = gf_common_mt_end + 2,
- gf_index_fd_ctx_t = gf_common_mt_end + 3,
- gf_index_mt_local_t = gf_common_mt_end + 4,
- gf_index_mt_end
+ gf_index_mt_priv_t = gf_common_mt_end + 1,
+ gf_index_inode_ctx_t = gf_common_mt_end + 2,
+ gf_index_fd_ctx_t = gf_common_mt_end + 3,
+ gf_index_mt_local_t = gf_common_mt_end + 4,
+ gf_index_mt_end
};
#endif
diff --git a/xlators/features/index/src/index-messages.h b/xlators/features/index/src/index-messages.h
index 7ab2bb0ad4b..3495fb080f0 100644
--- a/xlators/features/index/src/index-messages.h
+++ b/xlators/features/index/src/index-messages.h
@@ -23,17 +23,11 @@
* glfs-message-id.h.
*/
-GLFS_MSGID(INDEX,
- INDEX_MSG_INDEX_DIR_CREATE_FAILED,
- INDEX_MSG_INDEX_READDIR_FAILED,
- INDEX_MSG_INDEX_ADD_FAILED,
- INDEX_MSG_INDEX_DEL_FAILED,
- INDEX_MSG_DICT_SET_FAILED,
- INDEX_MSG_INODE_CTX_GET_SET_FAILED,
- INDEX_MSG_INVALID_ARGS,
- INDEX_MSG_FD_OP_FAILED,
- INDEX_MSG_WORKER_THREAD_CREATE_FAILED,
- INDEX_MSG_INVALID_GRAPH
-);
+GLFS_MSGID(INDEX, INDEX_MSG_INDEX_DIR_CREATE_FAILED,
+ INDEX_MSG_INDEX_READDIR_FAILED, INDEX_MSG_INDEX_ADD_FAILED,
+ INDEX_MSG_INDEX_DEL_FAILED, INDEX_MSG_DICT_SET_FAILED,
+ INDEX_MSG_INODE_CTX_GET_SET_FAILED, INDEX_MSG_INVALID_ARGS,
+ INDEX_MSG_FD_OP_FAILED, INDEX_MSG_WORKER_THREAD_CREATE_FAILED,
+ INDEX_MSG_INVALID_GRAPH);
#endif /* !_INDEX_MESSAGES_H_ */
diff --git a/xlators/features/index/src/index.h b/xlators/features/index/src/index.h
index ae9091d69c9..f1e0293b794 100644
--- a/xlators/features/index/src/index.h
+++ b/xlators/features/index/src/index.h
@@ -18,71 +18,67 @@
#include "common-utils.h"
#include "index-mem-types.h"
-#define INDEX_THREAD_STACK_SIZE ((size_t)(1024*1024))
+#define INDEX_THREAD_STACK_SIZE ((size_t)(1024 * 1024))
-typedef enum {
- UNKNOWN,
- IN,
- NOTIN
-} index_state_t;
+typedef enum { UNKNOWN, IN, NOTIN } index_state_t;
typedef enum {
- XATTROP_TYPE_UNSET = -1,
- XATTROP,
- DIRTY,
- ENTRY_CHANGES,
- XATTROP_TYPE_END
+ XATTROP_TYPE_UNSET = -1,
+ XATTROP,
+ DIRTY,
+ ENTRY_CHANGES,
+ XATTROP_TYPE_END
} index_xattrop_type_t;
typedef struct index_inode_ctx {
- gf_boolean_t processing;
- struct list_head callstubs;
- int state[XATTROP_TYPE_END];
- uuid_t virtual_pargfid; /* virtual gfid of dir under
- .glusterfs/indices/entry-changes. */
+ gf_boolean_t processing;
+ struct list_head callstubs;
+ int state[XATTROP_TYPE_END];
+ uuid_t virtual_pargfid; /* virtual gfid of dir under
+ .glusterfs/indices/entry-changes. */
} index_inode_ctx_t;
typedef struct index_fd_ctx {
- DIR *dir;
- off_t dir_eof;
+ DIR *dir;
+ off_t dir_eof;
} index_fd_ctx_t;
typedef struct index_priv {
- char *index_basepath;
- char *dirty_basepath;
- uuid_t index;
- gf_lock_t lock;
- uuid_t internal_vgfid[XATTROP_TYPE_END];
- struct list_head callstubs;
- pthread_mutex_t mutex;
- pthread_cond_t cond;
- dict_t *dirty_watchlist;
- dict_t *pending_watchlist;
- dict_t *complete_watchlist;
- int64_t pending_count;
- pthread_t thread;
- gf_boolean_t down;
+ char *index_basepath;
+ char *dirty_basepath;
+ uuid_t index;
+ gf_lock_t lock;
+ uuid_t internal_vgfid[XATTROP_TYPE_END];
+ struct list_head callstubs;
+ pthread_mutex_t mutex;
+ pthread_cond_t cond;
+ dict_t *dirty_watchlist;
+ dict_t *pending_watchlist;
+ dict_t *complete_watchlist;
+ int64_t pending_count;
+ pthread_t thread;
+ gf_boolean_t down;
} index_priv_t;
typedef struct index_local {
- inode_t *inode;
- dict_t *xdata;
+ inode_t *inode;
+ dict_t *xdata;
} index_local_t;
-#define INDEX_STACK_UNWIND(fop, frame, params ...) \
-do { \
- index_local_t *__local = NULL; \
- if (frame) { \
- __local = frame->local; \
- frame->local = NULL; \
- } \
- STACK_UNWIND_STRICT (fop, frame, params); \
- if (__local) { \
- inode_unref (__local->inode); \
- if (__local->xdata) \
- dict_unref (__local->xdata); \
- mem_put (__local); \
- } \
-} while (0)
+#define INDEX_STACK_UNWIND(fop, frame, params...) \
+ do { \
+ index_local_t *__local = NULL; \
+ if (frame) { \
+ __local = frame->local; \
+ frame->local = NULL; \
+ } \
+ STACK_UNWIND_STRICT(fop, frame, params); \
+ if (__local) { \
+ inode_unref(__local->inode); \
+ if (__local->xdata) \
+ dict_unref(__local->xdata); \
+ mem_put(__local); \
+ } \
+ } while (0)
#endif