summaryrefslogtreecommitdiffstats
path: root/xlators/features/cloudsync
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/cloudsync
parentbe77dbbda692792335a8e9e7c02e0c281f003c40 (diff)
Land clang-format changes
Change-Id: I6f5d8140a06f3c1b2d196849299f8d483028d33b
Diffstat (limited to 'xlators/features/cloudsync')
-rw-r--r--xlators/features/cloudsync/src/cloudsync-common.h116
-rw-r--r--xlators/features/cloudsync/src/cloudsync-mem-types.h10
-rw-r--r--xlators/features/cloudsync/src/cloudsync-messages.h3
-rw-r--r--xlators/features/cloudsync/src/cloudsync-plugins/src/cloudsyncs3/src/libcloudsyncs3-mem-types.h6
-rw-r--r--xlators/features/cloudsync/src/cloudsync-plugins/src/cloudsyncs3/src/libcloudsyncs3.h21
-rw-r--r--xlators/features/cloudsync/src/cloudsync.h77
6 files changed, 112 insertions, 121 deletions
diff --git a/xlators/features/cloudsync/src/cloudsync-common.h b/xlators/features/cloudsync/src/cloudsync-common.h
index 3298ab0a6f2..0be6a446456 100644
--- a/xlators/features/cloudsync/src/cloudsync-common.h
+++ b/xlators/features/cloudsync/src/cloudsync-common.h
@@ -18,80 +18,82 @@
#include "cloudsync-messages.h"
typedef struct cs_local {
- loc_t loc;
- fd_t *fd;
- call_stub_t *stub;
- call_frame_t *main_frame;
- int op_errno;
- int op_ret;
- fd_t *dlfd;
- off_t dloffset;
- struct iatt stbuf;
- dict_t *xattr_rsp;
- dict_t *xattr_req;
- glusterfs_fop_t fop;
- gf_boolean_t locked;
- int call_cnt;
- inode_t *inode;
- char *remotepath;
+ loc_t loc;
+ fd_t *fd;
+ call_stub_t *stub;
+ call_frame_t *main_frame;
+ int op_errno;
+ int op_ret;
+ fd_t *dlfd;
+ off_t dloffset;
+ struct iatt stbuf;
+ dict_t *xattr_rsp;
+ dict_t *xattr_req;
+ glusterfs_fop_t fop;
+ gf_boolean_t locked;
+ int call_cnt;
+ inode_t *inode;
+ char *remotepath;
} cs_local_t;
-typedef int (*fop_download_t) (call_frame_t *frame, void *config);
+typedef int (*fop_download_t)(call_frame_t *frame, void *config);
-typedef void *(*store_init) (xlator_t *this);
+typedef void *(*store_init)(xlator_t *this);
-typedef int (*store_reconfigure) (xlator_t *this, dict_t *options);
+typedef int (*store_reconfigure)(xlator_t *this, dict_t *options);
-typedef void (*store_fini) (void *config);
+typedef void (*store_fini)(void *config);
struct cs_remote_stores {
- char *name; /* store name */
- void *config; /* store related information */
- fop_download_t dlfop; /* store specific download function */
- store_init init; /* store init to initialize store config */
- store_reconfigure reconfigure; /* reconfigure store config */
- store_fini fini;
- void *handle; /* shared library handle*/
+ char *name; /* store name */
+ void *config; /* store related information */
+ fop_download_t dlfop; /* store specific download function */
+ store_init init; /* store init to initialize store config */
+ store_reconfigure reconfigure; /* reconfigure store config */
+ store_fini fini;
+ void *handle; /* shared library handle*/
};
typedef struct cs_private {
- xlator_t *this;
- struct cs_remote_stores *stores;
- gf_boolean_t abortdl;
- pthread_spinlock_t lock;
+ xlator_t *this;
+ struct cs_remote_stores *stores;
+ gf_boolean_t abortdl;
+ pthread_spinlock_t lock;
} cs_private_t;
void
-cs_local_wipe (xlator_t *this, cs_local_t *local);
+cs_local_wipe(xlator_t *this, cs_local_t *local);
-#define CS_STACK_UNWIND(fop, frame, params ...) do { \
- cs_local_t *__local = NULL; \
- xlator_t *__xl = NULL; \
- if (frame) { \
- __xl = frame->this; \
- __local = frame->local; \
- frame->local = NULL; \
- } \
- STACK_UNWIND_STRICT (fop, frame, params); \
- cs_local_wipe (__xl, __local); \
-} while (0)
+#define CS_STACK_UNWIND(fop, frame, params...) \
+ do { \
+ cs_local_t *__local = NULL; \
+ xlator_t *__xl = NULL; \
+ if (frame) { \
+ __xl = frame->this; \
+ __local = frame->local; \
+ frame->local = NULL; \
+ } \
+ STACK_UNWIND_STRICT(fop, frame, params); \
+ cs_local_wipe(__xl, __local); \
+ } while (0)
-#define CS_STACK_DESTROY(frame) do { \
- cs_local_t *__local = NULL; \
- xlator_t *__xl = NULL; \
- __xl = frame->this; \
- __local = frame->local; \
- frame->local = NULL; \
- STACK_DESTROY (frame->root); \
- cs_local_wipe (__xl, __local); \
-} while (0)
+#define CS_STACK_DESTROY(frame) \
+ do { \
+ cs_local_t *__local = NULL; \
+ xlator_t *__xl = NULL; \
+ __xl = frame->this; \
+ __local = frame->local; \
+ frame->local = NULL; \
+ STACK_DESTROY(frame->root); \
+ cs_local_wipe(__xl, __local); \
+ } while (0)
typedef struct store_methods {
- int (*fop_download) (call_frame_t *frame, void *config);
- /* return type should be the store config */
- void *(*fop_init) (xlator_t *this);
- int (*fop_reconfigure) (xlator_t *this, dict_t *options);
- void (*fop_fini) (void *config);
+ int (*fop_download)(call_frame_t *frame, void *config);
+ /* return type should be the store config */
+ void *(*fop_init)(xlator_t *this);
+ int (*fop_reconfigure)(xlator_t *this, dict_t *options);
+ void (*fop_fini)(void *config);
} store_methods_t;
#endif /* _CLOUDSYNC_COMMON_H */
diff --git a/xlators/features/cloudsync/src/cloudsync-mem-types.h b/xlators/features/cloudsync/src/cloudsync-mem-types.h
index 6ebcb16552b..46d4f3aa2a1 100644
--- a/xlators/features/cloudsync/src/cloudsync-mem-types.h
+++ b/xlators/features/cloudsync/src/cloudsync-mem-types.h
@@ -8,16 +8,14 @@
* cases as published by the Free Software Foundation.
*/
-
#ifndef __CLOUDSYNC_MEM_TYPES_H__
#define __CLOUDSYNC_MEM_TYPES_H__
#include "mem-types.h"
enum cs_mem_types_ {
- gf_cs_mt_cs_private_t = gf_common_mt_end + 1,
- gf_cs_mt_cs_remote_stores_t,
- gf_cs_mt_cs_inode_ctx_t,
- gf_cs_mt_end
+ gf_cs_mt_cs_private_t = gf_common_mt_end + 1,
+ gf_cs_mt_cs_remote_stores_t,
+ gf_cs_mt_cs_inode_ctx_t,
+ gf_cs_mt_end
};
#endif /* __CLOUDSYNC_MEM_TYPES_H__ */
-
diff --git a/xlators/features/cloudsync/src/cloudsync-messages.h b/xlators/features/cloudsync/src/cloudsync-messages.h
index ad4b7d2e0b8..fb08f72de7f 100644
--- a/xlators/features/cloudsync/src/cloudsync-messages.h
+++ b/xlators/features/cloudsync/src/cloudsync-messages.h
@@ -8,12 +8,9 @@
* cases as published by the Free Software Foundation.
*/
-
#ifndef __CLOUDSYNC_MESSAGES_H__
#define __CLOUDSYNC_MESSAGES_H__
/*TODO: define relevant message ids */
-
#endif /* __CLOUDSYNC_MESSAGES_H__ */
-
diff --git a/xlators/features/cloudsync/src/cloudsync-plugins/src/cloudsyncs3/src/libcloudsyncs3-mem-types.h b/xlators/features/cloudsync/src/cloudsync-plugins/src/cloudsyncs3/src/libcloudsyncs3-mem-types.h
index dd9314ec8d8..0aaab1fe955 100644
--- a/xlators/features/cloudsync/src/cloudsync-plugins/src/cloudsyncs3/src/libcloudsyncs3-mem-types.h
+++ b/xlators/features/cloudsync/src/cloudsync-plugins/src/cloudsyncs3/src/libcloudsyncs3-mem-types.h
@@ -8,14 +8,12 @@
* cases as published by the Free Software Foundation.
*/
-
#ifndef __LIBAWS_MEM_TYPES_H__
#define __LIBAWS_MEM_TYPES_H__
#include "mem-types.h"
enum libaws_mem_types_ {
- gf_libaws_mt_aws_private_t = gf_common_mt_end + 1,
- gf_libaws_mt_end
+ gf_libaws_mt_aws_private_t = gf_common_mt_end + 1,
+ gf_libaws_mt_end
};
#endif /* __CLOUDSYNC_MEM_TYPES_H__ */
-
diff --git a/xlators/features/cloudsync/src/cloudsync-plugins/src/cloudsyncs3/src/libcloudsyncs3.h b/xlators/features/cloudsync/src/cloudsync-plugins/src/cloudsyncs3/src/libcloudsyncs3.h
index c233e1c96f7..b1a95f8cbf9 100644
--- a/xlators/features/cloudsync/src/cloudsync-plugins/src/cloudsyncs3/src/libcloudsyncs3.h
+++ b/xlators/features/cloudsync/src/cloudsync-plugins/src/cloudsyncs3/src/libcloudsyncs3.h
@@ -18,34 +18,33 @@
#include "cloudsync-common.h"
#include "libcloudsyncs3-mem-types.h"
-
-char*
+char *
aws_b64_encode(const unsigned char *input, int length);
size_t
aws_write_callback(void *dlbuf, size_t size, size_t nitems, void *mainframe);
int
-aws_download_s3 (call_frame_t *frame, void *config);
+aws_download_s3(call_frame_t *frame, void *config);
int
-aws_dlwritev_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int op_ret, int op_errno, struct iatt *prebuf,
- struct iatt *postbuf, dict_t *xdata);
+aws_dlwritev_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret,
+ int op_errno, struct iatt *prebuf, struct iatt *postbuf,
+ dict_t *xdata);
void *
-aws_init (xlator_t *this);
+aws_init(xlator_t *this);
int
-aws_reconfigure (xlator_t *this, dict_t *options);
+aws_reconfigure(xlator_t *this, dict_t *options);
char *
-aws_form_request (char *resource, char **date, char *reqtype, char *bucketid,
- char *filepath);
+aws_form_request(char *resource, char **date, char *reqtype, char *bucketid,
+ char *filepath);
char *
aws_sign_request(char *const str, char *awssekey);
void
-aws_fini (void *config);
+aws_fini(void *config);
#endif
diff --git a/xlators/features/cloudsync/src/cloudsync.h b/xlators/features/cloudsync/src/cloudsync.h
index 18840a6523d..7c70c744d2b 100644
--- a/xlators/features/cloudsync/src/cloudsync.h
+++ b/xlators/features/cloudsync/src/cloudsync.h
@@ -8,7 +8,6 @@
* cases as published by the Free Software Foundation.
*/
-
#ifndef __CLOUDSYNC_H__
#define __CLOUDSYNC_H__
@@ -20,87 +19,85 @@
#include "cloudsync-common.h"
#include "cloudsync-autogen-fops.h"
-
#define CS_LOCK_DOMAIN "cs.protect.file.stat"
typedef struct cs_dlstore {
- off_t off;
- struct iovec *vector;
- int32_t count;
- struct iobref *iobref;
- uint32_t flags;
+ off_t off;
+ struct iovec *vector;
+ int32_t count;
+ struct iobref *iobref;
+ uint32_t flags;
} cs_dlstore;
typedef struct cs_inode_ctx {
- gf_cs_obj_state state;
+ gf_cs_obj_state state;
} cs_inode_ctx_t;
struct cs_plugin {
- char *name; /* store name */
- char *library; /* library to load for the given store */
- char *description; /* description about the store */
+ char *name; /* store name */
+ char *library; /* library to load for the given store */
+ char *description; /* description about the store */
};
cs_local_t *
-cs_local_init (xlator_t *this, call_frame_t *frame, loc_t *loc, fd_t *fd,
- glusterfs_fop_t fop);
+cs_local_init(xlator_t *this, call_frame_t *frame, loc_t *loc, fd_t *fd,
+ glusterfs_fop_t fop);
int
-locate_and_execute (call_frame_t *frame);
-
+locate_and_execute(call_frame_t *frame);
int32_t
-cs_resume_setxattr (call_frame_t *frame, xlator_t *this, loc_t *loc,
- dict_t *dict, int32_t flags, dict_t *xdata);
+cs_resume_setxattr(call_frame_t *frame, xlator_t *this, loc_t *loc,
+ dict_t *dict, int32_t flags, dict_t *xdata);
int32_t
-cs_inodelk_unlock_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret,
- int32_t op_errno, dict_t *xdata);
+cs_inodelk_unlock_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, dict_t *xdata);
size_t
-cs_write_callback (void *lcurlbuf, size_t size, size_t nitems, void *frame);
+cs_write_callback(void *lcurlbuf, size_t size, size_t nitems, void *frame);
void
-cs_common_cbk (call_frame_t *frame);
+cs_common_cbk(call_frame_t *frame);
gf_boolean_t
-cs_is_file_remote (struct iatt *stbuf, dict_t *xattr);
+cs_is_file_remote(struct iatt *stbuf, dict_t *xattr);
int32_t
-cs_setxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, dict_t *xdata);
+cs_setxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, dict_t *xdata);
int
-cs_build_loc (loc_t *loc, call_frame_t *frame);
+cs_build_loc(loc_t *loc, call_frame_t *frame);
int
-cs_blocking_inodelk_cbk (call_frame_t *lock_frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, dict_t *xdata);
+cs_blocking_inodelk_cbk(call_frame_t *lock_frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, dict_t *xdata);
-int cs_read_authinfo(xlator_t *this);
+int
+cs_read_authinfo(xlator_t *this);
int
-__cs_inode_ctx_update (xlator_t *this, inode_t *inode, uint64_t val);
+__cs_inode_ctx_update(xlator_t *this, inode_t *inode, uint64_t val);
int
-cs_inode_ctx_reset (xlator_t *this, inode_t *inode);
+cs_inode_ctx_reset(xlator_t *this, inode_t *inode);
void
-__cs_inode_ctx_get (xlator_t *this, inode_t *inode, cs_inode_ctx_t **ctx);
+__cs_inode_ctx_get(xlator_t *this, inode_t *inode, cs_inode_ctx_t **ctx);
gf_cs_obj_state
-__cs_get_file_state (xlator_t *this, inode_t *inode, cs_inode_ctx_t *ctx);
+__cs_get_file_state(xlator_t *this, inode_t *inode, cs_inode_ctx_t *ctx);
int
-cs_inodelk_unlock (call_frame_t *main_frame);
+cs_inodelk_unlock(call_frame_t *main_frame);
int
-cs_resume_postprocess (xlator_t *this, call_frame_t *frame, inode_t *inode);
+cs_resume_postprocess(xlator_t *this, call_frame_t *frame, inode_t *inode);
int32_t
-cs_truncate_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
- int32_t op_ret, int32_t op_errno, struct iatt *prebuf,
- struct iatt *postbuf, dict_t *xdata);
+cs_truncate_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
+ int32_t op_ret, int32_t op_errno, struct iatt *prebuf,
+ struct iatt *postbuf, dict_t *xdata);
int32_t
-cs_resume_truncate (call_frame_t *frame, xlator_t *this, loc_t *loc,
- off_t offset, dict_t *xattr_req);
+cs_resume_truncate(call_frame_t *frame, xlator_t *this, loc_t *loc,
+ off_t offset, dict_t *xattr_req);
#endif /* __CLOUDSYNC_H__ */
-