summaryrefslogtreecommitdiffstats
path: root/xlators/features/snapview-server/src/snapview-server.h
diff options
context:
space:
mode:
authorAnand Subramanian <anands@redhat.com>2014-05-15 08:19:14 +0530
committerVijay Bellur <vbellur@redhat.com>2014-06-15 10:33:23 -0700
commitec845d93e74644bbfe27e0b085a38dbd7c02480f (patch)
treee4e455e9f9d6f75a3426fcad4a6360c885890902 /xlators/features/snapview-server/src/snapview-server.h
parent056b99bfbc181a88579b8139d444f7dd2fa3b19e (diff)
Get snapshot info dynamically via new rpc and infra for snapview-server to refresh snaplist
BUG: 1105439 Change-Id: I4bb312a53d88f6f4955e69a3ef2b4955ec17f26d Signed-off-by: Anand Subramanian <anands@redhat.com> Reviewed-on: http://review.gluster.org/8001 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/features/snapview-server/src/snapview-server.h')
-rw-r--r--xlators/features/snapview-server/src/snapview-server.h62
1 files changed, 53 insertions, 9 deletions
diff --git a/xlators/features/snapview-server/src/snapview-server.h b/xlators/features/snapview-server/src/snapview-server.h
index b0e051e0fc3..510599c3650 100644
--- a/xlators/features/snapview-server/src/snapview-server.h
+++ b/xlators/features/snapview-server/src/snapview-server.h
@@ -35,14 +35,51 @@
#include "glusterfs-acl.h"
#include "syncop.h"
#include "list.h"
-
-/*
- * The max number of snap entries we consider currently
- */
-#define SNAP_VIEW_MAX_NUM_SNAPS 128
+#include "timer.h"
+#include "rpc-clnt.h"
+#include "protocol-common.h"
#define DEFAULT_SVD_LOG_FILE_DIRECTORY DATADIR "/log/glusterfs"
+#define SNAP_VIEW_MAX_GLFS_T 256
+#define SNAP_VIEW_MAX_GLFS_FDS 1024
+#define SNAP_VIEW_MAX_GLFS_OBJ_HANDLES 1024
+
+#define SVS_STACK_DESTROY(_frame) \
+ do { \
+ ((call_frame_t *)_frame)->local = NULL; \
+ STACK_DESTROY (((call_frame_t *)_frame)->root); \
+ } while (0)
+
+int
+svs_mgmt_submit_request (void *req, call_frame_t *frame,
+ glusterfs_ctx_t *ctx,
+ rpc_clnt_prog_t *prog, int procnum,
+ fop_cbk_fn_t cbkfn, xdrproc_t xdrproc);
+
+int
+svs_get_snapshot_list (xlator_t *this);
+
+int
+mgmt_get_snapinfo_cbk (struct rpc_req *req, struct iovec *iov,
+ int count, void *myframe);
+
+char *clnt_handshake_procs[GF_HNDSK_MAXVALUE] = {
+ [GF_HNDSK_NULL] = "NULL",
+ [GF_HNDSK_SETVOLUME] = "SETVOLUME",
+ [GF_HNDSK_GETSPEC] = "GETSPEC",
+ [GF_HNDSK_PING] = "PING",
+ [GF_HNDSK_EVENT_NOTIFY] = "EVENTNOTIFY",
+};
+
+rpc_clnt_prog_t svs_clnt_handshake_prog = {
+ .progname = "GlusterFS Handshake",
+ .prognum = GLUSTER_HNDSK_PROGRAM,
+ .progver = GLUSTER_HNDSK_VERSION,
+ .procnames = clnt_handshake_procs,
+};
+
+
typedef enum {
SNAP_VIEW_ENTRY_POINT_INODE = 0,
SNAP_VIEW_VIRTUAL_INODE
@@ -67,15 +104,22 @@ struct svs_fd {
typedef struct svs_fd svs_fd_t;
struct snap_dirent {
- char name[NAME_MAX];
- char uuid[UUID_CANONICAL_FORM_LEN + 1];
+ char name[NAME_MAX];
+ char uuid[UUID_CANONICAL_FORM_LEN + 1];
+ char snap_volname[NAME_MAX];
glfs_t *fs;
};
typedef struct snap_dirent snap_dirent_t;
struct svs_private {
- snap_dirent_t *dirents;
- int num_snaps;
+ snap_dirent_t *dirents;
+ int num_snaps;
+ char *volname;
+ struct list_head snaplist;
+ pthread_mutex_t snaplist_lock;
+ uint32_t is_snaplist_done;
+ gf_timer_t *snap_timer;
+ pthread_attr_t thr_attr;
};
typedef struct svs_private svs_private_t;