summaryrefslogtreecommitdiffstats
path: root/xlators/features/cloudsync/src/cloudsync-common.h
diff options
context:
space:
mode:
authorAnuradha Talur <atalur@commvault.com>2018-11-29 12:54:21 -0800
committerAnuradha Talur <atalur@commvault.com>2019-04-10 10:50:31 -0700
commitd82640511f51a79db6dabea8599c805028fefafb (patch)
tree75b45c9973c0d11d384577a1801c0835967b51a4 /xlators/features/cloudsync/src/cloudsync-common.h
parent734e6a7e389ea309d5528133ed5bd19064799f13 (diff)
features/cloudsync : Added some new functions
This patch contains the following changes: 1) Store ID info will now be stored in the inode ctx 2) Added new readv type where read is made directly from the remote store. This choice is made by volume set operation. 3) cs_forget() was missing. Added it. Change-Id: Ie3232b3d7ffb5313a03f011b0553b19793eedfa2 fixes: bz#1642168 Signed-off-by: Anuradha Talur <atalur@commvault.com>
Diffstat (limited to 'xlators/features/cloudsync/src/cloudsync-common.h')
-rw-r--r--xlators/features/cloudsync/src/cloudsync-common.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/xlators/features/cloudsync/src/cloudsync-common.h b/xlators/features/cloudsync/src/cloudsync-common.h
index 7b3520ce9be..11d233460a4 100644
--- a/xlators/features/cloudsync/src/cloudsync-common.h
+++ b/xlators/features/cloudsync/src/cloudsync-common.h
@@ -14,9 +14,23 @@
#include <glusterfs/call-stub.h>
#include <glusterfs/xlator.h>
#include <glusterfs/syncop.h>
+#include <glusterfs/compat-errno.h>
#include "cloudsync-mem-types.h"
#include "cloudsync-messages.h"
+typedef struct cs_loc_xattr {
+ char *file_path;
+ uuid_t uuid;
+ uuid_t gfid;
+ char *volname;
+} cs_loc_xattr_t;
+
+typedef struct cs_size_xattr {
+ uint64_t size;
+ uint64_t blksize;
+ uint64_t blocks;
+} cs_size_xattr_t;
+
typedef struct cs_local {
loc_t loc;
fd_t *fd;
@@ -34,10 +48,25 @@ typedef struct cs_local {
int call_cnt;
inode_t *inode;
char *remotepath;
+
+ struct {
+ /* offset, flags and size are the information needed
+ * by read fop for remote read operation. These will be
+ * populated in cloudsync read fop, before being passed
+ * on to the plugin performing remote read.
+ */
+ off_t offset;
+ uint32_t flags;
+ size_t size;
+ cs_loc_xattr_t *lxattr;
+ } xattrinfo;
+
} cs_local_t;
typedef int (*fop_download_t)(call_frame_t *frame, void *config);
+typedef int (*fop_remote_read_t)(call_frame_t *, void *);
+
typedef void *(*store_init)(xlator_t *this);
typedef int (*store_reconfigure)(xlator_t *this, dict_t *options);
@@ -48,6 +77,7 @@ struct cs_remote_stores {
char *name; /* store name */
void *config; /* store related information */
fop_download_t dlfop; /* store specific download function */
+ fop_remote_read_t rdfop; /* store specific read function */
store_init init; /* store init to initialize store config */
store_reconfigure reconfigure; /* reconfigure store config */
store_fini fini;
@@ -59,11 +89,15 @@ typedef struct cs_private {
struct cs_remote_stores *stores;
gf_boolean_t abortdl;
pthread_spinlock_t lock;
+ gf_boolean_t remote_read;
} cs_private_t;
void
cs_local_wipe(xlator_t *this, cs_local_t *local);
+void
+cs_xattrinfo_wipe(cs_local_t *local);
+
#define CS_STACK_UNWIND(fop, frame, params...) \
do { \
cs_local_t *__local = NULL; \
@@ -90,6 +124,7 @@ cs_local_wipe(xlator_t *this, cs_local_t *local);
typedef struct store_methods {
int (*fop_download)(call_frame_t *frame, void *config);
+ int (*fop_remote_read)(call_frame_t *, void *);
/* return type should be the store config */
void *(*fop_init)(xlator_t *this);
int (*fop_reconfigure)(xlator_t *this, dict_t *options);