From 7840d9de272ef2f24c4c755a857ad8ae06703b55 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Tue, 4 May 2010 00:37:01 +0000 Subject: frame's 'op', 'type' restructured Signed-off-by: Amar Tumballi Signed-off-by: Anand V. Avati BUG: 875 (Implement a new protocol to provide proper backward/forward compatibility) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=875 --- doc/hacker-guide/hacker-guide.tex | 2 - glusterfsd/src/fetch-spec.c | 2 +- glusterfsd/src/glusterfsd.c | 11 - libglusterfs/src/Makefile.am | 4 +- libglusterfs/src/common-utils.c | 71 +++--- libglusterfs/src/common-utils.h | 3 +- libglusterfs/src/defaults.c | 28 +-- libglusterfs/src/defaults.h | 5 - libglusterfs/src/glusterfs.h | 66 ++--- libglusterfs/src/latency.c | 16 +- libglusterfs/src/logging.c | 276 +-------------------- libglusterfs/src/spec.y | 2 +- libglusterfs/src/stack.c | 14 +- libglusterfs/src/stack.h | 7 +- libglusterfs/src/xlator.c | 13 +- libglusterfs/src/xlator.h | 28 +-- libglusterfsclient/src/libglusterfsclient.c | 3 - xlators/bindings/python/src/python.c | 3 - xlators/cluster/afr/src/afr.c | 3 - xlators/cluster/afr/src/afr.h | 1 - xlators/cluster/dht/src/dht.c | 4 - xlators/cluster/dht/src/nufa.c | 4 - xlators/cluster/dht/src/switch.c | 4 - xlators/cluster/ha/src/ha.c | 5 - xlators/cluster/map/src/map.c | 3 - xlators/cluster/stripe/src/stripe.c | 3 - xlators/cluster/unify/src/unify.c | 2 - xlators/debug/error-gen/src/error-gen.c | 7 +- xlators/debug/io-stats/src/io-stats.c | 32 +-- xlators/debug/trace/src/trace.c | 2 - xlators/encryption/rot-13/src/rot-13.c | 3 - .../features/access-control/src/access-control.c | 3 - xlators/features/filter/src/filter.c | 3 - xlators/features/locks/src/posix.c | 4 - xlators/features/path-convertor/src/path.c | 5 - xlators/features/quota/src/quota.c | 3 - xlators/features/read-only/src/read-only.c | 3 - xlators/features/trash/src/trash.c | 3 - xlators/meta/src/meta.c | 3 - xlators/mount/fuse/src/fuse-bridge.c | 6 +- xlators/nfs/server/src/nfs.c | 1 - xlators/performance/io-cache/src/io-cache.c | 3 - xlators/performance/io-threads/src/io-threads.c | 3 - xlators/performance/quick-read/src/quick-read.c | 3 - xlators/performance/read-ahead/src/read-ahead.c | 3 - .../performance/stat-prefetch/src/stat-prefetch.c | 3 - .../performance/symlink-cache/src/symlink-cache.c | 2 - .../performance/write-behind/src/write-behind.c | 2 - xlators/protocol/client/src/client-protocol.c | 245 +++++++----------- xlators/protocol/lib/src/Makefile.am | 4 +- xlators/protocol/lib/src/protocol.c | 108 ++++++++ xlators/protocol/lib/src/protocol.h | 171 ++++++------- xlators/protocol/server/src/server-protocol.c | 185 +++++++------- xlators/storage/bdb/src/bdb.c | 3 - xlators/storage/posix/src/posix.c | 3 - 55 files changed, 473 insertions(+), 926 deletions(-) create mode 100644 xlators/protocol/lib/src/protocol.c diff --git a/doc/hacker-guide/hacker-guide.tex b/doc/hacker-guide/hacker-guide.tex index ea3760ced83..1330536f35c 100644 --- a/doc/hacker-guide/hacker-guide.tex +++ b/doc/hacker-guide/hacker-guide.tex @@ -302,8 +302,6 @@ struct xlator_fops fops = { .writev = rot13_writev }; -struct xlator_mops mops = { -}; \end{verbatim} diff --git a/glusterfsd/src/fetch-spec.c b/glusterfsd/src/fetch-spec.c index 6bf980dccc5..239b3c90227 100644 --- a/glusterfsd/src/fetch-spec.c +++ b/glusterfsd/src/fetch-spec.c @@ -82,7 +82,7 @@ fetch_notify (xlator_t *this_xl, int event, void *data, ...) STACK_WIND (frame, fetch_cbk, this_xl->children->xlator, - this_xl->children->xlator->mops->getspec, + this_xl->children->xlator->fops->getspec, this_xl->ctx->cmd_args.volfile_id, 0); break; diff --git a/glusterfsd/src/glusterfsd.c b/glusterfsd/src/glusterfsd.c index f7140ad3b34..12d6be445c6 100644 --- a/glusterfsd/src/glusterfsd.c +++ b/glusterfsd/src/glusterfsd.c @@ -73,11 +73,6 @@ #include -extern int -gf_log_central_init (glusterfs_ctx_t *ctx, const char *remote_host, - const char *transport, uint32_t remote_port); - - /* using argp for command line parsing */ static char gf_doc[] = ""; static char argp_doc[] = "--volfile-server=SERVER [MOUNT-POINT]\n" \ @@ -1500,12 +1495,6 @@ main (int argc, char *argv[]) return -1; } - - if (cmd_args->log_server) { - gf_log_central_init (ctx, cmd_args->log_server, - "socket", cmd_args->log_server_port); - } - event_dispatch (ctx->event_pool); return 0; diff --git a/libglusterfs/src/Makefile.am b/libglusterfs/src/Makefile.am index 7cd1876e2eb..acca3f04a01 100644 --- a/libglusterfs/src/Makefile.am +++ b/libglusterfs/src/Makefile.am @@ -6,9 +6,9 @@ libglusterfs_la_LIBADD = @LEXLIB@ lib_LTLIBRARIES = libglusterfs.la -libglusterfs_la_SOURCES = dict.c spec.lex.c y.tab.c xlator.c logging.c hashfn.c defaults.c scheduler.c common-utils.c timer.c inode.c call-stub.c compat.c fd.c compat-errno.c event.c mem-pool.c gf-dirent.c syscall.c iobuf.c globals.c statedump.c stack.c checksum.c md5.c $(CONTRIBDIR)/rbtree/rb.c rbthash.c latency.c +libglusterfs_la_SOURCES = dict.c spec.lex.c y.tab.c xlator.c logging.c hashfn.c defaults.c common-utils.c timer.c inode.c call-stub.c compat.c fd.c compat-errno.c event.c mem-pool.c gf-dirent.c syscall.c iobuf.c globals.c statedump.c stack.c checksum.c md5.c $(CONTRIBDIR)/rbtree/rb.c rbthash.c latency.c -noinst_HEADERS = common-utils.h defaults.h dict.h glusterfs.h hashfn.h logging.h scheduler.h xlator.h stack.h timer.h list.h inode.h call-stub.h compat.h fd.h revision.h compat-errno.h event.h mem-pool.h byte-order.h gf-dirent.h locking.h syscall.h iobuf.h globals.h statedump.h checksum.h md5.h $(CONTRIBDIR)/rbtree/rb.h rbthash.h iatt.h latency.h +noinst_HEADERS = common-utils.h defaults.h dict.h glusterfs.h hashfn.h logging.h xlator.h stack.h timer.h list.h inode.h call-stub.h compat.h fd.h revision.h compat-errno.h event.h mem-pool.h byte-order.h gf-dirent.h locking.h syscall.h iobuf.h globals.h statedump.h checksum.h md5.h $(CONTRIBDIR)/rbtree/rb.h rbthash.h iatt.h latency.h EXTRA_DIST = spec.l spec.y diff --git a/libglusterfs/src/common-utils.c b/libglusterfs/src/common-utils.c index 7851ad2f815..c93dcc41d15 100644 --- a/libglusterfs/src/common-utils.c +++ b/libglusterfs/src/common-utils.c @@ -180,28 +180,28 @@ err: } char *gf_fop_list[GF_FOP_MAXVALUE]; -char *gf_mop_list[GF_MOP_MAXVALUE]; -char *gf_cbk_list[GF_CBK_MAXVALUE]; +char *gf_mgmt_list[GF_MGMT_MAXVALUE]; void gf_global_variable_init() { - gf_fop_list[GF_FOP_STAT] = "STAT"; /* 0 */ - gf_fop_list[GF_FOP_READLINK] = "READLINK"; /* 1 */ - gf_fop_list[GF_FOP_MKNOD] = "MKNOD"; /* 2 */ + gf_fop_list[GF_FOP_NULL] = "NULL"; + gf_fop_list[GF_FOP_STAT] = "STAT"; + gf_fop_list[GF_FOP_READLINK] = "READLINK"; + gf_fop_list[GF_FOP_MKNOD] = "MKNOD"; gf_fop_list[GF_FOP_MKDIR] = "MKDIR"; gf_fop_list[GF_FOP_UNLINK] = "UNLINK"; - gf_fop_list[GF_FOP_RMDIR] = "RMDIR"; /* 5 */ + gf_fop_list[GF_FOP_RMDIR] = "RMDIR"; gf_fop_list[GF_FOP_SYMLINK] = "SYMLINK"; gf_fop_list[GF_FOP_RENAME] = "RENAME"; gf_fop_list[GF_FOP_LINK] = "LINK"; gf_fop_list[GF_FOP_TRUNCATE] = "TRUNCATE"; - gf_fop_list[GF_FOP_OPEN] = "OPEN"; /* 10 */ + gf_fop_list[GF_FOP_OPEN] = "OPEN"; gf_fop_list[GF_FOP_READ] = "READ"; gf_fop_list[GF_FOP_WRITE] = "WRITE"; gf_fop_list[GF_FOP_STATFS] = "STATFS"; gf_fop_list[GF_FOP_FLUSH] = "FLUSH"; - gf_fop_list[GF_FOP_FSYNC] = "FSYNC"; /* 15 */ + gf_fop_list[GF_FOP_FSYNC] = "FSYNC"; gf_fop_list[GF_FOP_SETXATTR] = "SETXATTR"; gf_fop_list[GF_FOP_GETXATTR] = "GETXATTR"; gf_fop_list[GF_FOP_REMOVEXATTR] = "REMOVEXATTR"; @@ -210,15 +210,15 @@ gf_global_variable_init() gf_fop_list[GF_FOP_ACCESS] = "ACCESS"; gf_fop_list[GF_FOP_CREATE] = "CREATE"; gf_fop_list[GF_FOP_FTRUNCATE] = "FTRUNCATE"; - gf_fop_list[GF_FOP_FSTAT] = "FSTAT"; /* 25 */ + gf_fop_list[GF_FOP_FSTAT] = "FSTAT"; gf_fop_list[GF_FOP_LK] = "LK"; gf_fop_list[GF_FOP_LOOKUP] = "LOOKUP"; gf_fop_list[GF_FOP_READDIR] = "READDIR"; - gf_fop_list[GF_FOP_INODELK] = "INODELK"; /* 30 */ + gf_fop_list[GF_FOP_INODELK] = "INODELK"; gf_fop_list[GF_FOP_FINODELK] = "FINODELK"; gf_fop_list[GF_FOP_ENTRYLK] = "ENTRYLK"; - gf_fop_list[GF_FOP_FENTRYLK] = "FENTRYLK"; /* 35 */ - gf_fop_list[GF_FOP_CHECKSUM] = "CHECKSUM"; /* 36 */ + gf_fop_list[GF_FOP_FENTRYLK] = "FENTRYLK"; + gf_fop_list[GF_FOP_CHECKSUM] = "CHECKSUM"; gf_fop_list[GF_FOP_XATTROP] = "XATTROP"; gf_fop_list[GF_FOP_FXATTROP] = "FXATTROP"; gf_fop_list[GF_FOP_FSETXATTR] = "FSETXATTR"; @@ -227,17 +227,13 @@ gf_global_variable_init() gf_fop_list[GF_FOP_SETATTR] = "SETATTR"; gf_fop_list[GF_FOP_FSETATTR] = "FSETATTR"; gf_fop_list[GF_FOP_READDIRP] = "READDIRP"; + gf_fop_list[GF_FOP_GETSPEC] = "GETSPEC"; + gf_fop_list[GF_FOP_FORGET] = "FORGET"; + gf_fop_list[GF_FOP_RELEASE] = "RELEASE"; + gf_fop_list[GF_FOP_RELEASEDIR] = "RELEASEDIR"; - gf_mop_list[GF_MOP_SETVOLUME] = "SETVOLUME"; /* 0 */ - gf_mop_list[GF_MOP_GETVOLUME] = "GETVOLUME"; /* 1 */ - gf_mop_list[GF_MOP_SETSPEC] = "SETSPEC"; - gf_mop_list[GF_MOP_GETSPEC] = "GETSPEC"; - gf_mop_list[GF_MOP_LOG] = "LOG"; - gf_mop_list[GF_MOP_PING] = "PING"; + gf_fop_list[GF_MGMT_NULL] = "NULL"; - gf_cbk_list[GF_CBK_FORGET] = "FORGET"; - gf_cbk_list[GF_CBK_RELEASE] = "RELEASE"; - gf_cbk_list[GF_CBK_RELEASEDIR] = "RELEASEDIR"; /* Are there any more variables to be included? All global variables initialization should go here */ @@ -250,7 +246,7 @@ set_global_ctx_ptr (glusterfs_ctx_t *ctx) gf_global_ctx = ctx; } -/* +/* * Don't use this function other than in glusterfsd.c. libglusterfsclient does * not set gf_global_ctx since there can be multiple glusterfs-contexts * initialized in a single process. Instead access the context from ctx member @@ -263,7 +259,7 @@ get_global_ctx_ptr (void) return gf_global_ctx; } -void +void gf_log_volume_file (FILE *specfp) { extern FILE *gf_log_logfile; @@ -406,40 +402,33 @@ gf_print_trace (int32_t signum) struct list_head *trav = ((call_pool_t *)ctx->pool)->all_frames.next; while (trav != (&((call_pool_t *)ctx->pool)->all_frames)) { call_frame_t *tmp = (call_frame_t *)(&((call_stack_t *)trav)->frames); - if ((tmp->root->type == GF_OP_TYPE_FOP_REQUEST) || - (tmp->root->type == GF_OP_TYPE_FOP_REPLY)) + if (tmp->root->type == GF_OP_TYPE_FOP) sprintf (msg,"frame : type(%d) op(%s)\n", - tmp->root->type, + tmp->root->type, gf_fop_list[tmp->root->op]); - if ((tmp->root->type == GF_OP_TYPE_MOP_REQUEST) || - (tmp->root->type == GF_OP_TYPE_MOP_REPLY)) - sprintf (msg,"frame : type(%d) op(%s)\n", - tmp->root->type, - gf_mop_list[tmp->root->op]); - if ((tmp->root->type == GF_OP_TYPE_CBK_REQUEST) || - (tmp->root->type == GF_OP_TYPE_CBK_REPLY)) + if (tmp->root->type == GF_OP_TYPE_MGMT) sprintf (msg,"frame : type(%d) op(%s)\n", - tmp->root->type, - gf_cbk_list[tmp->root->op]); - + tmp->root->type, + gf_mgmt_list[tmp->root->op]); + ret = write (fd, msg, strlen (msg)); trav = trav->next; } ret = write (fd, "\n", 1); } - sprintf (msg, "patchset: %s\n", GLUSTERFS_REPOSITORY_REVISION); + sprintf (msg, "patchset: %s\n", GLUSTERFS_REPOSITORY_REVISION); ret = write (fd, msg, strlen (msg)); - sprintf (msg, "signal received: %d\n", signum); + sprintf (msg, "signal received: %d\n", signum); ret = write (fd, msg, strlen (msg)); { - /* Dump the timestamp of the crash too, so the previous logs + /* Dump the timestamp of the crash too, so the previous logs can be related */ utime = time (NULL); tm = localtime (&utime); - strftime (timestr, 256, "%Y-%m-%d %H:%M:%S\n", tm); + strftime (timestr, 256, "%Y-%m-%d %H:%M:%S\n", tm); ret = write (fd, "time of crash: ", 15); ret = write (fd, timestr, strlen (timestr)); } @@ -450,7 +439,7 @@ gf_print_trace (int32_t signum) { void *array[200]; size_t size; - + size = backtrace (array, 200); backtrace_symbols_fd (&array[1], size-1, fd); sprintf (msg, "---------\n"); diff --git a/libglusterfs/src/common-utils.h b/libglusterfs/src/common-utils.h index 3bf4ba9b180..06933d7c45a 100644 --- a/libglusterfs/src/common-utils.h +++ b/libglusterfs/src/common-utils.h @@ -91,8 +91,7 @@ void gf_log_volume_file (FILE *specfp); void gf_print_trace (int32_t signal); extern char *gf_fop_list[GF_FOP_MAXVALUE]; -extern char *gf_mop_list[GF_MOP_MAXVALUE]; -extern char *gf_cbk_list[GF_CBK_MAXVALUE]; +extern char *gf_mgmt_list[GF_MGMT_MAXVALUE]; #define VECTORSIZE(count) (count * (sizeof (struct iovec))) diff --git a/libglusterfs/src/defaults.c b/libglusterfs/src/defaults.c index 7ec877551bf..7da589d60fa 100644 --- a/libglusterfs/src/defaults.c +++ b/libglusterfs/src/defaults.c @@ -1124,38 +1124,12 @@ default_getspec (call_frame_t *frame, STACK_WIND (frame, default_getspec_cbk, FIRST_CHILD(this), - FIRST_CHILD(this)->mops->getspec, + FIRST_CHILD(this)->fops->getspec, key, flags); return 0; } -static int32_t -default_log_cbk (call_frame_t *frame, - void *cookie, - xlator_t *this, - int32_t op_ret, - int32_t op_errno) -{ - STACK_UNWIND (frame, op_ret, op_errno); - return 0; -} - - -int32_t -default_log (call_frame_t *frame, - xlator_t *this, - const char *msg) -{ - STACK_WIND (frame, - default_log_cbk, - FIRST_CHILD(this), - FIRST_CHILD(this)->mops->log, - msg); - return 0; -} - - static int32_t default_checksum_cbk (call_frame_t *frame, void *cookie, diff --git a/libglusterfs/src/defaults.h b/libglusterfs/src/defaults.h index 30e0f9e371a..2955bd8eb78 100644 --- a/libglusterfs/src/defaults.h +++ b/libglusterfs/src/defaults.h @@ -38,11 +38,6 @@ int32_t default_getspec (call_frame_t *frame, const char *key, int32_t flag); -int32_t -default_log (call_frame_t *frame, - xlator_t *this, - const char *msg); - int32_t default_checksum (call_frame_t *frame, xlator_t *this, loc_t *loc, diff --git a/libglusterfs/src/glusterfs.h b/libglusterfs/src/glusterfs.h index 5906b71edbe..226c358e50c 100644 --- a/libglusterfs/src/glusterfs.h +++ b/libglusterfs/src/glusterfs.h @@ -75,87 +75,71 @@ ZR_FILE_CONTENT_STRLEN)) /* TODO: Should we use PATH-MAX? On some systems it may save space */ -#define ZR_PATH_MAX 4096 - +#define ZR_PATH_MAX 4096 /* NOTE: add members ONLY at the end (just before _MAXVALUE) */ typedef enum { - GF_FOP_STAT, /* 0 */ - GF_FOP_READLINK, /* 1 */ - GF_FOP_MKNOD, /* 2 */ + GF_FOP_NULL = 0, + GF_FOP_STAT, + GF_FOP_READLINK, + GF_FOP_MKNOD, GF_FOP_MKDIR, GF_FOP_UNLINK, - GF_FOP_RMDIR, /* 5 */ + GF_FOP_RMDIR, GF_FOP_SYMLINK, GF_FOP_RENAME, GF_FOP_LINK, GF_FOP_TRUNCATE, - GF_FOP_OPEN, /* 10 */ + GF_FOP_OPEN, GF_FOP_READ, GF_FOP_WRITE, - GF_FOP_STATFS, /* 15 */ + GF_FOP_STATFS, GF_FOP_FLUSH, GF_FOP_FSYNC, GF_FOP_SETXATTR, GF_FOP_GETXATTR, - GF_FOP_REMOVEXATTR,/* 20 */ + GF_FOP_REMOVEXATTR, GF_FOP_OPENDIR, - GF_FOP_GETDENTS, GF_FOP_FSYNCDIR, GF_FOP_ACCESS, - GF_FOP_CREATE, /* 25 */ + GF_FOP_CREATE, GF_FOP_FTRUNCATE, GF_FOP_FSTAT, GF_FOP_LK, GF_FOP_LOOKUP, - GF_FOP_SETDENTS, GF_FOP_READDIR, - GF_FOP_INODELK, /* 35 */ + GF_FOP_INODELK, GF_FOP_FINODELK, GF_FOP_ENTRYLK, GF_FOP_FENTRYLK, GF_FOP_CHECKSUM, - GF_FOP_XATTROP, /* 40 */ + GF_FOP_XATTROP, GF_FOP_FXATTROP, - GF_FOP_LOCK_NOTIFY, - GF_FOP_LOCK_FNOTIFY, GF_FOP_FGETXATTR, - GF_FOP_FSETXATTR, /* 45 */ + GF_FOP_FSETXATTR, GF_FOP_RCHECKSUM, GF_FOP_SETATTR, GF_FOP_FSETATTR, GF_FOP_READDIRP, + GF_FOP_FORGET, + GF_FOP_RELEASE, + GF_FOP_RELEASEDIR, + GF_FOP_GETSPEC, GF_FOP_MAXVALUE, } glusterfs_fop_t; -/* NOTE: add members ONLY at the end (just before _MAXVALUE) */ -typedef enum { - GF_MOP_SETVOLUME, /* 0 */ - GF_MOP_GETVOLUME, /* 1 */ - GF_MOP_STATS, - GF_MOP_SETSPEC, - GF_MOP_GETSPEC, - GF_MOP_PING, /* 5 */ - GF_MOP_LOG, - GF_MOP_NOTIFY, - GF_MOP_MAXVALUE /* 8 */ -} glusterfs_mop_t; typedef enum { - GF_CBK_FORGET, /* 0 */ - GF_CBK_RELEASE, /* 1 */ - GF_CBK_RELEASEDIR, /* 2 */ - GF_CBK_MAXVALUE /* 3 */ -} glusterfs_cbk_t; + GF_MGMT_NULL = 0, + GF_MGMT_MAXVALUE, +} glusterfs_mgmt_t; typedef enum { - GF_OP_TYPE_FOP_REQUEST = 1, - GF_OP_TYPE_MOP_REQUEST, - GF_OP_TYPE_CBK_REQUEST, - GF_OP_TYPE_FOP_REPLY, - GF_OP_TYPE_MOP_REPLY, - GF_OP_TYPE_CBK_REPLY -} glusterfs_op_type_t; + GF_OP_TYPE_NULL = 0, + GF_OP_TYPE_FOP, + GF_OP_TYPE_MGMT, + GF_OP_TYPE_MAX, +} gf_op_type_t; /* NOTE: all the miscellaneous flags used by GlusterFS should be listed here */ typedef enum { diff --git a/libglusterfs/src/latency.c b/libglusterfs/src/latency.c index bccc780a26f..5156e8e2551 100644 --- a/libglusterfs/src/latency.c +++ b/libglusterfs/src/latency.c @@ -31,8 +31,7 @@ void -gf_set_fop_from_fn_pointer (call_frame_t *frame, struct xlator_fops *fops, - struct xlator_mops *mops, void *fn) +gf_set_fop_from_fn_pointer (call_frame_t *frame, struct xlator_fops *fops, void *fn) { glusterfs_fop_t fop = -1; @@ -118,15 +117,10 @@ gf_set_fop_from_fn_pointer (call_frame_t *frame, struct xlator_fops *fops, fop = GF_FOP_FSETATTR; else if (fops->readdirp == fn) fop = GF_FOP_READDIRP; - else { - if (mops->getspec == fn) - fop = GF_MOP_GETSPEC; - else if (mops->log == fn) - fop = GF_MOP_LOG; - else { - fop = -1; - } - } + else if (fops->getspec == fn) + fop = GF_FOP_GETSPEC; + else + fop = -1; frame->op = fop; } diff --git a/libglusterfs/src/logging.c b/libglusterfs/src/logging.c index a8a7d4dc933..7fbcacb4e44 100644 --- a/libglusterfs/src/logging.c +++ b/libglusterfs/src/logging.c @@ -105,298 +105,24 @@ gf_log_init (const char *file) } -static int -dummy_init (xlator_t *xl) -{ - return 0; -} - - -static int -gf_log_notify (xlator_t *this_xl, int event, void *data, ...) -{ - int ret = 0; - - switch (event) { - case GF_EVENT_CHILD_UP: - break; - - case GF_EVENT_CHILD_DOWN: - break; - - default: - ret = default_notify (this_xl, event, data); - break; - } - - return ret; -} - - -/* - * Get a dummy xlator for the purpose of central logging. - * An xlator is needed because a transport cannot exist without - * an xlator. - */ - -static xlator_t * -__get_dummy_xlator (glusterfs_ctx_t *ctx, const char *remote_host, - const char *transport, uint32_t remote_port) -{ - volume_opt_list_t *vol_opt = NULL; - xlator_t * trav = NULL; - - int ret = 0; - - xlator_t * top = NULL; - xlator_t * trans = NULL; - xlator_list_t * parent = NULL; - xlator_list_t * tmp = NULL; - - top = GF_CALLOC (1, sizeof (*top), gf_common_mt_xlator_t); - if (!top) - goto out; - - trans = GF_CALLOC (1, sizeof (*trans), gf_common_mt_xlator_t); - if (!trans) - goto out; - - INIT_LIST_HEAD (&top->volume_options); - INIT_LIST_HEAD (&trans->volume_options); - - top->name = "log-dummy"; - top->ctx = ctx; - top->next = trans; - top->init = dummy_init; - top->notify = gf_log_notify; - top->children = (void *) GF_CALLOC (1, sizeof (*top->children), - gf_common_mt_xlator_list_t); - - if (!top->children) - goto out; - - top->children->xlator = trans; - - trans->name = "log-transport"; - trans->ctx = ctx; - trans->prev = top; - trans->init = dummy_init; - trans->notify = default_notify; - trans->options = get_new_dict (); - - parent = GF_CALLOC (1, sizeof(*parent), gf_common_mt_xlator_list_t); - - if (!parent) - goto out; - - parent->xlator = top; - - if (trans->parents == NULL) - trans->parents = parent; - else { - tmp = trans->parents; - while (tmp->next) - tmp = tmp->next; - tmp->next = parent; - } - - /* TODO: log on failure to set dict */ - if (remote_host) { - ret = dict_set (trans->options, "remote-host", - str_to_data ((char *)remote_host)); - } - - if (remote_port) - ret = dict_set_uint32 (trans->options, "remote-port", - remote_port); - - /* - * 'option remote-subvolume ' is needed here even though - * its not used - */ - ret = dict_set_static_ptr (trans->options, "remote-subvolume", - "brick"); - ret = dict_set_static_ptr (trans->options, "disable-handshake", "on"); - ret = dict_set_static_ptr (trans->options, "non-blocking-io", "off"); - - if (transport) { - char *transport_type = GF_CALLOC (1, strlen (transport) + 10, - gf_common_mt_char); - ERR_ABORT (transport_type); - strcpy(transport_type, transport); - - if (strchr (transport_type, ':')) - *(strchr (transport_type, ':')) = '\0'; - - ret = dict_set_dynstr (trans->options, "transport-type", - transport_type); - } - - xlator_set_type (trans, "protocol/client"); - - trav = top; - while (trav) { - /* Get the first volume_option */ - if (!list_empty (&trav->volume_options)) { - list_for_each_entry (vol_opt, - &trav->volume_options, list) - break; - if ((ret = - validate_xlator_volume_options (trav, - vol_opt->given_opt)) < 0) { - gf_log (trav->name, GF_LOG_ERROR, - "validating translator failed"); - return NULL; - } - } - trav = trav->next; - } - - if (xlator_tree_init (top) != 0) - return NULL; - -out: - return top; -} - - /* * Initialize logging to a central server. * If successful, log messages will be written both to * the local file and to the remote server. */ -static xlator_t * logging_xl = NULL; static int __central_log_enabled = 0; -static pthread_t logging_thread; - struct _msg_queue { struct list_head msgs; }; -static struct _msg_queue msg_queue; - -static pthread_cond_t msg_cond; -static pthread_mutex_t msg_cond_mutex; -static pthread_mutex_t msg_queue_mutex; - struct _log_msg { const char *msg; struct list_head queue; }; -int32_t -gf_log_central_cbk (call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno) -{ - struct _log_msg *msg = NULL; - - msg = (struct _log_msg *) cookie; - - GF_FREE ((char *)(msg->msg)); - - STACK_DESTROY (frame->root); - - return 0; -} - - -void * -logging_thread_loop (void *arg) -{ - struct _log_msg *msg; - - call_frame_t *frame = NULL; - - while (1) { - pthread_mutex_lock (&msg_cond_mutex); - { - pthread_cond_wait (&msg_cond, &msg_cond_mutex); - - while (!list_empty (&msg_queue.msgs)) { - pthread_mutex_lock (&msg_queue_mutex); - { - msg = list_entry (msg_queue.msgs.next, - struct _log_msg, - queue); - - list_del_init (&msg->queue); - } - pthread_mutex_unlock (&msg_queue_mutex); - - frame = create_frame (logging_xl, - logging_xl->ctx->pool); - - frame->local = logging_xl->private; - - STACK_WIND_COOKIE (frame, (void *) msg, - gf_log_central_cbk, - logging_xl->children->xlator, - logging_xl->children->xlator->mops->log, - msg->msg); - } - - } - pthread_mutex_unlock (&msg_cond_mutex); - } - - return NULL; -} - - -int -gf_log_central_init (glusterfs_ctx_t *ctx, const char *remote_host, - const char *transport, uint32_t remote_port) -{ - logging_xl = __get_dummy_xlator (ctx, remote_host, transport, - remote_port); - - if (!logging_xl) { - goto out; - } - - __central_log_enabled = 1; - - INIT_LIST_HEAD (&msg_queue.msgs); - - pthread_cond_init (&msg_cond, NULL); - pthread_mutex_init (&msg_cond_mutex, NULL); - pthread_mutex_init (&msg_queue_mutex, NULL); - - pthread_create (&logging_thread, NULL, logging_thread_loop, NULL); - -out: - return 0; -} - - -int -gf_log_central (const char *msg) -{ - struct _log_msg *lm = NULL; - - lm = GF_CALLOC (1, sizeof (*lm), gf_common_mt_log_msg); - - if (!lm) - goto out; - - INIT_LIST_HEAD (&lm->queue); - - lm->msg = gf_strdup (msg); - - pthread_mutex_lock (&msg_queue_mutex); - { - list_add_tail (&lm->queue, &msg_queue.msgs); - } - pthread_mutex_unlock (&msg_queue_mutex); - - pthread_cond_signal (&msg_cond); - -out: - return 0; -} void @@ -526,7 +252,7 @@ unlock: glusterfs_central_log_flag_set (); { - gf_log_central (msg); + //gf_log_central (msg); } glusterfs_central_log_flag_unset (); } diff --git a/libglusterfs/src/spec.y b/libglusterfs/src/spec.y index 84ab4df855a..805e1e1fbae 100644 --- a/libglusterfs/src/spec.y +++ b/libglusterfs/src/spec.y @@ -330,7 +330,7 @@ section_sub (char *sub) static int section_end (void) { - if (!tree->fops || !tree->mops) { + if (!tree->fops) { fprintf (stderr, "\"type\" not specified for volume %s\n", tree->name); gf_log ("parser", GF_LOG_ERROR, diff --git a/libglusterfs/src/stack.c b/libglusterfs/src/stack.c index 4b0f936d0f3..0723557b36d 100644 --- a/libglusterfs/src/stack.c +++ b/libglusterfs/src/stack.c @@ -110,17 +110,11 @@ gf_proc_dump_call_stack (call_stack_t *call_stack, const char *key_buf,...) gf_proc_dump_write(key, "%Ld", call_stack->unique); gf_proc_dump_build_key(key, prefix,"op"); - if ((call_stack->type == GF_OP_TYPE_FOP_REQUEST) || - (call_stack->type == GF_OP_TYPE_FOP_REPLY)) { + if (call_stack->type == GF_OP_TYPE_FOP) gf_proc_dump_write(key, "%s", gf_fop_list[call_stack->op]); - } else if ((call_stack->type == GF_OP_TYPE_MOP_REQUEST) || - (call_stack->type == GF_OP_TYPE_MOP_REPLY)) { - gf_proc_dump_write(key, "%s", gf_mop_list[call_stack->op]); - } else if ((call_stack->type == GF_OP_TYPE_CBK_REQUEST) || - (call_stack->type == GF_OP_TYPE_CBK_REPLY)) { - gf_proc_dump_write(key, "%s", gf_cbk_list[call_stack->op]); - } - + else if (call_stack->type == GF_OP_TYPE_MGMT) + gf_proc_dump_write(key, "%s", gf_mgmt_list[call_stack->op]); + gf_proc_dump_build_key(key, prefix,"type"); gf_proc_dump_write(key, "%d", call_stack->type); gf_proc_dump_build_key(key, prefix,"cnt"); diff --git a/libglusterfs/src/stack.h b/libglusterfs/src/stack.h index c80ab9e9d32..48b5587ac4f 100644 --- a/libglusterfs/src/stack.h +++ b/libglusterfs/src/stack.h @@ -118,11 +118,10 @@ struct _call_stack_t { } while (0); \ struct xlator_fops; -struct xlator_mops; void gf_set_fop_from_fn_pointer (call_frame_t *frame, struct xlator_fops *fops, - struct xlator_mops *mops, void *fn); + void *fn); void gf_update_latency (call_frame_t *frame); @@ -202,7 +201,7 @@ STACK_DESTROY (call_stack_t *stack) \ if (((xlator_t *) obj)->ctx->measure_latency) { \ gettimeofday (&_new->begin, NULL); \ - gf_set_fop_from_fn_pointer (_new, ((xlator_t *)obj)->fops, ((xlator_t *)obj)->mops, fn); \ + gf_set_fop_from_fn_pointer (_new, ((xlator_t *)obj)->fops, fn); \ } \ \ old_THIS = THIS; \ @@ -238,7 +237,7 @@ STACK_DESTROY (call_stack_t *stack) \ if (((xlator_t *) obj)->ctx->measure_latency) { \ gettimeofday (&_new->begin, NULL); \ - gf_set_fop_from_fn_pointer (_new, ((xlator_t *)obj)->fops, ((xlator_t *)obj)->mops, fn); \ + gf_set_fop_from_fn_pointer (_new, ((xlator_t *)obj)->fops, fn); \ } \ \ old_THIS = THIS; \ diff --git a/libglusterfs/src/xlator.c b/libglusterfs/src/xlator.c index 6d27a01405d..2168beb91ae 100644 --- a/libglusterfs/src/xlator.c +++ b/libglusterfs/src/xlator.c @@ -34,11 +34,6 @@ xl->fops->fn = default_##fn; \ } while (0) -#define SET_DEFAULT_MOP(fn) do { \ - if (!xl->mops->fn) \ - xl->mops->fn = default_##fn; \ - } while (0) - #define SET_DEFAULT_CBK(fn) do { \ if (!xl->cbks->fn) \ xl->cbks->fn = default_##fn; \ @@ -97,7 +92,7 @@ fill_defaults (xlator_t *xl) SET_DEFAULT_FOP (setattr); SET_DEFAULT_FOP (fsetattr); - SET_DEFAULT_MOP (log); + SET_DEFAULT_FOP (getspec); SET_DEFAULT_CBK (release); SET_DEFAULT_CBK (releasedir); @@ -710,12 +705,6 @@ xlator_set_type (xlator_t *xl, return -1; } - if (!(xl->mops = dlsym (handle, "mops"))) { - gf_log ("xlator", GF_LOG_DEBUG, "dlsym(mops) on %s", - dlerror ()); - return -1; - } - if (!(xl->cbks = dlsym (handle, "cbks"))) { gf_log ("xlator", GF_LOG_DEBUG, "dlsym(cbks) on %s", dlerror ()); diff --git a/libglusterfs/src/xlator.h b/libglusterfs/src/xlator.h index 3bee959f890..8217101e2ab 100644 --- a/libglusterfs/src/xlator.h +++ b/libglusterfs/src/xlator.h @@ -85,17 +85,13 @@ struct _loc { inode_t *parent; }; -typedef int32_t (*mop_getspec_cbk_t) (call_frame_t *frame, +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); -typedef int32_t (*mop_log_cbk_t) (call_frame_t *frame, - void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno); - typedef int32_t (*fop_checksum_cbk_t) (call_frame_t *frame, void *cookie, xlator_t *this, @@ -112,20 +108,11 @@ typedef int32_t (*fop_rchecksum_cbk_t) (call_frame_t *frame, uint32_t weak_checksum, uint8_t *strong_checksum); -typedef int32_t (*mop_setvolume_t) (call_frame_t *frame, - xlator_t *this, - const char *volume); - -typedef int32_t (*mop_getspec_t) (call_frame_t *frame, +typedef int32_t (*fop_getspec_t) (call_frame_t *frame, xlator_t *this, const char *key, int32_t flag); - -typedef int32_t (*mop_log_t) (call_frame_t *frame, - xlator_t *this, - const char *msg); - typedef int32_t (*fop_checksum_t) (call_frame_t *frame, xlator_t *this, loc_t *loc, @@ -136,14 +123,6 @@ typedef int32_t (*fop_rchecksum_t) (call_frame_t *frame, fd_t *fd, off_t offset, int32_t len); -struct xlator_mops { - mop_getspec_t getspec; - mop_log_t log; - - mop_log_cbk_t log_cbk; - mop_getspec_cbk_t getspec_cbk; -}; - typedef int32_t (*fop_lookup_cbk_t) (call_frame_t *frame, void *cookie, @@ -709,6 +688,7 @@ struct xlator_fops { 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; @@ -752,6 +732,7 @@ struct xlator_fops { 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, @@ -839,7 +820,6 @@ struct _xlator { /* Set after doing dlopen() */ struct xlator_fops *fops; - struct xlator_mops *mops; struct xlator_cbks *cbks; struct xlator_dumpops *dumpops; struct list_head volume_options; /* list of volume_option_t */ diff --git a/libglusterfsclient/src/libglusterfsclient.c b/libglusterfsclient/src/libglusterfsclient.c index bb587bee36c..daf05ec95fb 100755 --- a/libglusterfsclient/src/libglusterfsclient.c +++ b/libglusterfsclient/src/libglusterfsclient.c @@ -8122,9 +8122,6 @@ out: static struct xlator_fops libgf_client_fops = { }; -static struct xlator_mops libgf_client_mops = { -}; - static struct xlator_cbks libgf_client_cbks = { .forget = libgf_client_forget, .release = libgf_client_release, diff --git a/xlators/bindings/python/src/python.c b/xlators/bindings/python/src/python.c index 7f32d7f2997..c11323cda4f 100644 --- a/xlators/bindings/python/src/python.c +++ b/xlators/bindings/python/src/python.c @@ -77,9 +77,6 @@ struct xlator_fops fops = { .writev = python_writev }; -struct xlator_mops mops = { -}; - static PyObject * AnonModule_FromFile (const char* fname) { diff --git a/xlators/cluster/afr/src/afr.c b/xlators/cluster/afr/src/afr.c index 5072869448e..41eff8ed036 100644 --- a/xlators/cluster/afr/src/afr.c +++ b/xlators/cluster/afr/src/afr.c @@ -3086,9 +3086,6 @@ struct xlator_fops fops = { }; -struct xlator_mops mops = { -}; - struct xlator_dumpops dumpops = { .priv = afr_priv_dump, }; diff --git a/xlators/cluster/afr/src/afr.h b/xlators/cluster/afr/src/afr.h index 0f7d8bbae13..662f94c8356 100644 --- a/xlators/cluster/afr/src/afr.h +++ b/xlators/cluster/afr/src/afr.h @@ -26,7 +26,6 @@ #include "config.h" #endif -#include "scheduler.h" #include "call-stub.h" #include "compat-errno.h" #include "afr-mem-types.h" diff --git a/xlators/cluster/dht/src/dht.c b/xlators/cluster/dht/src/dht.c index ca5601510bf..0fc5d45a317 100644 --- a/xlators/cluster/dht/src/dht.c +++ b/xlators/cluster/dht/src/dht.c @@ -413,10 +413,6 @@ struct xlator_fops fops = { #endif }; - -struct xlator_mops mops = { -}; - struct xlator_dumpops dumpops = { .priv = dht_priv_dump, .inodectx = dht_inodectx_dump, diff --git a/xlators/cluster/dht/src/nufa.c b/xlators/cluster/dht/src/nufa.c index 0d8241f41a5..8d181fa507a 100644 --- a/xlators/cluster/dht/src/nufa.c +++ b/xlators/cluster/dht/src/nufa.c @@ -729,10 +729,6 @@ struct xlator_fops fops = { }; -struct xlator_mops mops = { -}; - - struct xlator_cbks cbks = { .forget = dht_forget }; diff --git a/xlators/cluster/dht/src/switch.c b/xlators/cluster/dht/src/switch.c index f6fb6b652b3..22289b3a1bf 100644 --- a/xlators/cluster/dht/src/switch.c +++ b/xlators/cluster/dht/src/switch.c @@ -1040,10 +1040,6 @@ struct xlator_fops fops = { }; -struct xlator_mops mops = { -}; - - struct xlator_cbks cbks = { .forget = dht_forget }; diff --git a/xlators/cluster/ha/src/ha.c b/xlators/cluster/ha/src/ha.c index 10e64e56252..54b41858eee 100644 --- a/xlators/cluster/ha/src/ha.c +++ b/xlators/cluster/ha/src/ha.c @@ -4016,11 +4016,6 @@ struct xlator_fops fops = { .fsetattr = ha_fsetattr, }; -struct xlator_mops mops = { - .stats = ha_stats, - .getspec = ha_getspec, -}; - struct xlator_cbks cbks = { .release = ha_close, .releasedir = ha_closedir, diff --git a/xlators/cluster/map/src/map.c b/xlators/cluster/map/src/map.c index 1383d83c1c9..dd89d0ebee9 100644 --- a/xlators/cluster/map/src/map.c +++ b/xlators/cluster/map/src/map.c @@ -2562,9 +2562,6 @@ struct xlator_fops fops = { .fsetattr = map_fsetattr, }; -struct xlator_mops mops = { -}; - struct xlator_cbks cbks = { }; diff --git a/xlators/cluster/stripe/src/stripe.c b/xlators/cluster/stripe/src/stripe.c index f2186ee6a26..fae9f755533 100644 --- a/xlators/cluster/stripe/src/stripe.c +++ b/xlators/cluster/stripe/src/stripe.c @@ -3610,9 +3610,6 @@ struct xlator_fops fops = { .mknod = stripe_mknod, }; -struct xlator_mops mops = { -}; - struct xlator_cbks cbks = { .release = stripe_release, }; diff --git a/xlators/cluster/unify/src/unify.c b/xlators/cluster/unify/src/unify.c index 3f0910df4fa..d1fe847bc9b 100644 --- a/xlators/cluster/unify/src/unify.c +++ b/xlators/cluster/unify/src/unify.c @@ -4561,8 +4561,6 @@ struct xlator_fops fops = { .fsetattr = unify_fsetattr, }; -struct xlator_mops mops = { -}; struct xlator_cbks cbks = { .forget = unify_forget, diff --git a/xlators/debug/error-gen/src/error-gen.c b/xlators/debug/error-gen/src/error-gen.c index 434965b5c1a..3ac2e22d3a5 100644 --- a/xlators/debug/error-gen/src/error-gen.c +++ b/xlators/debug/error-gen/src/error-gen.c @@ -1756,7 +1756,7 @@ error_gen_getspec (call_frame_t *frame, xlator_t *this, const char *key, STACK_WIND (frame, error_gen_getspec_cbk, FIRST_CHILD(this), - FIRST_CHILD(this)->mops->getspec, + FIRST_CHILD(this)->fops->getspec, key, flags); return 0; } @@ -2041,10 +2041,7 @@ struct xlator_fops fops = { .fentrylk = error_gen_fentrylk, .setattr = error_gen_setattr, .fsetattr = error_gen_fsetattr, -}; - -struct xlator_mops mops = { - .getspec = error_gen_getspec, + .getspec = error_gen_getspec, }; struct xlator_cbks cbks = { diff --git a/xlators/debug/io-stats/src/io-stats.c b/xlators/debug/io-stats/src/io-stats.c index 09ee86751f2..d7024447202 100644 --- a/xlators/debug/io-stats/src/io-stats.c +++ b/xlators/debug/io-stats/src/io-stats.c @@ -50,7 +50,6 @@ struct ios_global_stats { uint64_t block_count_write[32]; uint64_t block_count_read[32]; uint64_t fop_hits[GF_FOP_MAXVALUE]; - uint64_t cbk_hits[GF_CBK_MAXVALUE]; struct timeval started_at; }; @@ -94,20 +93,6 @@ struct ios_local { } while (0) -#define BUMP_CBK(op) \ - do { \ - struct ios_conf *conf = NULL; \ - \ - conf = this->private; \ - LOCK (&conf->lock); \ - { \ - conf->cumulative.cbk_hits[GF_CBK_##op]++; \ - conf->incremental.cbk_hits[GF_CBK_##op]++; \ - } \ - UNLOCK (&conf->lock); \ - } while (0) - - #define BUMP_READ(fd, len) \ do { \ struct ios_conf *conf = NULL; \ @@ -235,10 +220,7 @@ io_stats_dump_global (xlator_t *this, struct ios_global_stats *stats, ios_log (this, logfp, "%14s : %"PRId64, gf_fop_list[i], stats->fop_hits[i]); - for (i = 0; i < GF_CBK_MAXVALUE; i++) - if (stats->cbk_hits[i]) - ios_log (this, logfp, "%14s : %"PRId64, - gf_fop_list[i], stats->cbk_hits[i]); + return 0; } @@ -1376,7 +1358,7 @@ io_stats_release (xlator_t *this, fd_t *fd) { struct ios_fd *iosfd = NULL; - BUMP_CBK (RELEASE); + BUMP_FOP (RELEASE); ios_fd_ctx_get (fd, this, &iosfd); if (iosfd) { @@ -1394,16 +1376,16 @@ io_stats_release (xlator_t *this, fd_t *fd) int io_stats_releasedir (xlator_t *this, fd_t *fd) { - BUMP_CBK (RELEASEDIR); + BUMP_FOP (RELEASEDIR); return 0; } int -io_stats_forget (xlator_t *this, fd_t *fd) +io_stats_forget (xlator_t *this, inode_t *inode) { - BUMP_CBK (FORGET); + BUMP_FOP (FORGET); return 0; } @@ -1535,12 +1517,10 @@ struct xlator_fops fops = { .fsetattr = io_stats_fsetattr, }; -struct xlator_mops mops = { -}; - struct xlator_cbks cbks = { .release = io_stats_release, .releasedir = io_stats_releasedir, + .forget = io_stats_forget, }; struct volume_options options[] = { diff --git a/xlators/debug/trace/src/trace.c b/xlators/debug/trace/src/trace.c index 7d619aadbc4..aa9d33f3ea2 100644 --- a/xlators/debug/trace/src/trace.c +++ b/xlators/debug/trace/src/trace.c @@ -2096,8 +2096,6 @@ struct xlator_fops fops = { .fsetattr = trace_fsetattr, }; -struct xlator_mops mops = { -}; struct xlator_cbks cbks = { }; diff --git a/xlators/encryption/rot-13/src/rot-13.c b/xlators/encryption/rot-13/src/rot-13.c index dc938781cab..a19ef5deadf 100644 --- a/xlators/encryption/rot-13/src/rot-13.c +++ b/xlators/encryption/rot-13/src/rot-13.c @@ -189,9 +189,6 @@ struct xlator_fops fops = { .writev = rot13_writev }; -struct xlator_mops mops = { -}; - struct xlator_cbks cbks = { }; diff --git a/xlators/features/access-control/src/access-control.c b/xlators/features/access-control/src/access-control.c index c13648d3c47..3735992435c 100644 --- a/xlators/features/access-control/src/access-control.c +++ b/xlators/features/access-control/src/access-control.c @@ -1837,8 +1837,5 @@ fini (xlator_t *this) return; } -struct xlator_mops mops = { -}; - struct xlator_cbks cbks = { }; diff --git a/xlators/features/filter/src/filter.c b/xlators/features/filter/src/filter.c index a0469bf6ecc..beede16e80c 100644 --- a/xlators/features/filter/src/filter.c +++ b/xlators/features/filter/src/filter.c @@ -1712,9 +1712,6 @@ struct xlator_fops fops = { .fsetattr = filter_fsetattr, }; -struct xlator_mops mops = { -}; - struct xlator_cbks cbks = { }; diff --git a/xlators/features/locks/src/posix.c b/xlators/features/locks/src/posix.c index 6e5ea94f87b..54cf89ca42d 100644 --- a/xlators/features/locks/src/posix.c +++ b/xlators/features/locks/src/posix.c @@ -1560,10 +1560,6 @@ struct xlator_fops fops = { .opendir = pl_opendir, }; - -struct xlator_mops mops = { -}; - struct xlator_dumpops dumpops = { .inodectx = pl_dump_inode_priv, }; diff --git a/xlators/features/path-convertor/src/path.c b/xlators/features/path-convertor/src/path.c index eda1633834e..0a86baa8785 100644 --- a/xlators/features/path-convertor/src/path.c +++ b/xlators/features/path-convertor/src/path.c @@ -1218,11 +1218,6 @@ struct xlator_fops fops = { .setattr = path_setattr, }; - -struct xlator_mops mops = { -}; - - struct xlator_cbks cbks = { }; diff --git a/xlators/features/quota/src/quota.c b/xlators/features/quota/src/quota.c index 3b4690bf0ae..a4266a32a85 100644 --- a/xlators/features/quota/src/quota.c +++ b/xlators/features/quota/src/quota.c @@ -1137,9 +1137,6 @@ struct xlator_fops fops = { .statfs = quota_statfs, }; -struct xlator_mops mops = { -}; - struct xlator_cbks cbks = { .release = quota_release }; diff --git a/xlators/features/read-only/src/read-only.c b/xlators/features/read-only/src/read-only.c index 08412bf047d..b8ba9218415 100644 --- a/xlators/features/read-only/src/read-only.c +++ b/xlators/features/read-only/src/read-only.c @@ -295,9 +295,6 @@ struct xlator_fops fops = { .lk = ro_lk, }; -struct xlator_mops mops = { -}; - struct xlator_cbks cbks = { }; diff --git a/xlators/features/trash/src/trash.c b/xlators/features/trash/src/trash.c index ff060cc5c0d..c51d55a02fe 100644 --- a/xlators/features/trash/src/trash.c +++ b/xlators/features/trash/src/trash.c @@ -1538,9 +1538,6 @@ struct xlator_fops fops = { .ftruncate = trash_ftruncate, }; -struct xlator_mops mops = { -}; - struct xlator_cbks cbks = { }; diff --git a/xlators/meta/src/meta.c b/xlators/meta/src/meta.c index 2babe32f911..face2fe70f1 100644 --- a/xlators/meta/src/meta.c +++ b/xlators/meta/src/meta.c @@ -1305,6 +1305,3 @@ struct xlator_fops fops = { .create = meta_create, .lk = meta_lk, }; - -struct xlator_mops mops = { -}; diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c index a6ff46a2659..faf7c481558 100644 --- a/xlators/mount/fuse/src/fuse-bridge.c +++ b/xlators/mount/fuse/src/fuse-bridge.c @@ -252,7 +252,7 @@ get_call_frame_for_req (fuse_state_t *state) frame->root->unique = finh->unique; } - frame->root->type = GF_OP_TYPE_FOP_REQUEST; + frame->root->type = GF_OP_TYPE_FOP; return frame; } @@ -3027,7 +3027,7 @@ fuse_first_lookup (xlator_t *this) dict = dict_new (); frame = create_frame (this, this->ctx->pool); - frame->root->type = GF_OP_TYPE_FOP_REQUEST; + frame->root->type = GF_OP_TYPE_FOP; xl = this->children->xlator; STACK_WIND (frame, fuse_first_lookup_cbk, xl, xl->fops->lookup, @@ -3566,8 +3566,6 @@ struct xlator_fops fops = { struct xlator_cbks cbks = { }; -struct xlator_mops mops = { -}; struct xlator_dumpops dumpops = { .priv = fuse_priv_dump, diff --git a/xlators/nfs/server/src/nfs.c b/xlators/nfs/server/src/nfs.c index b67567f7810..65ff55c76c1 100644 --- a/xlators/nfs/server/src/nfs.c +++ b/xlators/nfs/server/src/nfs.c @@ -576,7 +576,6 @@ fini (xlator_t *this) } struct xlator_cbks cbks = { }; -struct xlator_mops mops = { }; struct xlator_fops fops = { }; struct volume_options options[] = { diff --git a/xlators/performance/io-cache/src/io-cache.c b/xlators/performance/io-cache/src/io-cache.c index f49185ad6e4..2f26b076b12 100644 --- a/xlators/performance/io-cache/src/io-cache.c +++ b/xlators/performance/io-cache/src/io-cache.c @@ -1592,9 +1592,6 @@ struct xlator_fops fops = { .setattr = ioc_setattr }; -struct xlator_mops mops = { -}; - struct xlator_dumpops dumpops = { .priv = ioc_priv_dump, diff --git a/xlators/performance/io-threads/src/io-threads.c b/xlators/performance/io-threads/src/io-threads.c index c2cca788855..74a20a4dee3 100644 --- a/xlators/performance/io-threads/src/io-threads.c +++ b/xlators/performance/io-threads/src/io-threads.c @@ -2256,9 +2256,6 @@ struct xlator_fops fops = { .fxattrop = iot_fxattrop, /* O */ }; -struct xlator_mops mops = { -}; - struct xlator_cbks cbks = { }; diff --git a/xlators/performance/quick-read/src/quick-read.c b/xlators/performance/quick-read/src/quick-read.c index 6be668a7a66..5580b529ba9 100644 --- a/xlators/performance/quick-read/src/quick-read.c +++ b/xlators/performance/quick-read/src/quick-read.c @@ -2315,9 +2315,6 @@ struct xlator_fops fops = { }; -struct xlator_mops mops = { -}; - struct xlator_cbks cbks = { .forget = qr_forget, diff --git a/xlators/performance/read-ahead/src/read-ahead.c b/xlators/performance/read-ahead/src/read-ahead.c index 9f97c72e933..4f38229025f 100644 --- a/xlators/performance/read-ahead/src/read-ahead.c +++ b/xlators/performance/read-ahead/src/read-ahead.c @@ -952,9 +952,6 @@ struct xlator_fops fops = { .fstat = ra_fstat, }; -struct xlator_mops mops = { -}; - struct xlator_cbks cbks = { .release = ra_release, }; diff --git a/xlators/performance/stat-prefetch/src/stat-prefetch.c b/xlators/performance/stat-prefetch/src/stat-prefetch.c index 87cc6ddc3e9..9205fedc299 100644 --- a/xlators/performance/stat-prefetch/src/stat-prefetch.c +++ b/xlators/performance/stat-prefetch/src/stat-prefetch.c @@ -3771,9 +3771,6 @@ struct xlator_fops fops = { .entrylk = sp_entrylk, }; -struct xlator_mops mops = { -}; - struct xlator_cbks cbks = { .forget = sp_forget, .release = sp_release, diff --git a/xlators/performance/symlink-cache/src/symlink-cache.c b/xlators/performance/symlink-cache/src/symlink-cache.c index a8c89b8640d..5aaa0a8a7d6 100644 --- a/xlators/performance/symlink-cache/src/symlink-cache.c +++ b/xlators/performance/symlink-cache/src/symlink-cache.c @@ -397,8 +397,6 @@ struct xlator_fops fops = { .readlink = sc_readlink, }; -struct xlator_mops mops = { -}; struct xlator_cbks cbks = { .forget = sc_forget, diff --git a/xlators/performance/write-behind/src/write-behind.c b/xlators/performance/write-behind/src/write-behind.c index bd046500657..90a889c05b4 100644 --- a/xlators/performance/write-behind/src/write-behind.c +++ b/xlators/performance/write-behind/src/write-behind.c @@ -2638,8 +2638,6 @@ struct xlator_fops fops = { .setattr = wb_setattr, }; -struct xlator_mops mops = { -}; struct xlator_cbks cbks = { .release = wb_release diff --git a/xlators/protocol/client/src/client-protocol.c b/xlators/protocol/client/src/client-protocol.c index df890cc3ca6..c5554ac98a2 100644 --- a/xlators/protocol/client/src/client-protocol.c +++ b/xlators/protocol/client/src/client-protocol.c @@ -61,7 +61,7 @@ protocol_client_xfer (call_frame_t *frame, xlator_t *this, transport_t *trans, int protocol_client_post_handshake (call_frame_t *frame, xlator_t *this); -static gf_op_t gf_fops[GF_FOP_MAXVALUE]; +static gf_op_t gf_fops[GF_PROTO_FOP_MAXVALUE]; static gf_op_t gf_mops[GF_MOP_MAXVALUE]; static gf_op_t gf_cbks[GF_CBK_MAXVALUE]; @@ -731,7 +731,7 @@ client_create (call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, ret = protocol_client_xfer (frame, this, CLIENT_CHANNEL (this, CHANNEL_LOWLAT), - GF_OP_TYPE_FOP_REQUEST, GF_FOP_CREATE, + GF_OP_TYPE_FOP_REQUEST, GF_PROTO_FOP_CREATE, hdr, hdrlen, NULL, 0, NULL); return ret; unwind: @@ -800,7 +800,7 @@ client_open (call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, ret = protocol_client_xfer (frame, this, CLIENT_CHANNEL (this, CHANNEL_LOWLAT), - GF_OP_TYPE_FOP_REQUEST, GF_FOP_OPEN, + GF_OP_TYPE_FOP_REQUEST, GF_PROTO_FOP_OPEN, hdr, hdrlen, NULL, 0, NULL); return ret; @@ -855,7 +855,7 @@ client_stat (call_frame_t *frame, xlator_t *this, loc_t *loc) ret = protocol_client_xfer (frame, this, CLIENT_CHANNEL (this, CHANNEL_LOWLAT), - GF_OP_TYPE_FOP_REQUEST, GF_FOP_STAT, + GF_OP_TYPE_FOP_REQUEST, GF_PROTO_FOP_STAT, hdr, hdrlen, NULL, 0, NULL); return ret; @@ -911,7 +911,7 @@ client_readlink (call_frame_t *frame, xlator_t *this, loc_t *loc, size_t size) ret = protocol_client_xfer (frame, this, CLIENT_CHANNEL (this, CHANNEL_LOWLAT), - GF_OP_TYPE_FOP_REQUEST, GF_FOP_READLINK, + GF_OP_TYPE_FOP_REQUEST, GF_PROTO_FOP_READLINK, hdr, hdrlen, NULL, 0, NULL); return ret; @@ -980,7 +980,7 @@ client_mknod (call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode, ret = protocol_client_xfer (frame, this, CLIENT_CHANNEL (this, CHANNEL_LOWLAT), - GF_OP_TYPE_FOP_REQUEST, GF_FOP_MKNOD, + GF_OP_TYPE_FOP_REQUEST, GF_PROTO_FOP_MKNOD, hdr, hdrlen, NULL, 0, NULL); return ret; @@ -1046,7 +1046,7 @@ client_mkdir (call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode) ret = protocol_client_xfer (frame, this, CLIENT_CHANNEL (this, CHANNEL_LOWLAT), - GF_OP_TYPE_FOP_REQUEST, GF_FOP_MKDIR, + GF_OP_TYPE_FOP_REQUEST, GF_PROTO_FOP_MKDIR, hdr, hdrlen, NULL, 0, NULL); return ret; @@ -1102,7 +1102,7 @@ client_unlink (call_frame_t *frame, xlator_t *this, loc_t *loc) ret = protocol_client_xfer (frame, this, CLIENT_CHANNEL (this, CHANNEL_BULK), - GF_OP_TYPE_FOP_REQUEST, GF_FOP_UNLINK, + GF_OP_TYPE_FOP_REQUEST, GF_PROTO_FOP_UNLINK, hdr, hdrlen, NULL, 0, NULL); return ret; @@ -1158,7 +1158,7 @@ client_rmdir (call_frame_t *frame, xlator_t *this, loc_t *loc) ret = protocol_client_xfer (frame, this, CLIENT_CHANNEL (this, CHANNEL_BULK), - GF_OP_TYPE_FOP_REQUEST, GF_FOP_RMDIR, + GF_OP_TYPE_FOP_REQUEST, GF_PROTO_FOP_RMDIR, hdr, hdrlen, NULL, 0, NULL); return ret; @@ -1228,7 +1228,7 @@ client_symlink (call_frame_t *frame, xlator_t *this, const char *linkname, ret = protocol_client_xfer (frame, this, CLIENT_CHANNEL (this, CHANNEL_LOWLAT), - GF_OP_TYPE_FOP_REQUEST, GF_FOP_SYMLINK, + GF_OP_TYPE_FOP_REQUEST, GF_PROTO_FOP_SYMLINK, hdr, hdrlen, NULL, 0, NULL); return ret; unwind: @@ -1308,7 +1308,7 @@ client_rename (call_frame_t *frame, xlator_t *this, loc_t *oldloc, ret = protocol_client_xfer (frame, this, CLIENT_CHANNEL (this, CHANNEL_LOWLAT), - GF_OP_TYPE_FOP_REQUEST, GF_FOP_RENAME, + GF_OP_TYPE_FOP_REQUEST, GF_PROTO_FOP_RENAME, hdr, hdrlen, NULL, 0, NULL); return ret; unwind: @@ -1391,7 +1391,7 @@ client_link (call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc) ret = protocol_client_xfer (frame, this, CLIENT_CHANNEL (this, CHANNEL_LOWLAT), - GF_OP_TYPE_FOP_REQUEST, GF_FOP_LINK, + GF_OP_TYPE_FOP_REQUEST, GF_PROTO_FOP_LINK, hdr, hdrlen, NULL, 0, NULL); return ret; unwind: @@ -1445,7 +1445,7 @@ client_truncate (call_frame_t *frame, xlator_t *this, loc_t *loc, off_t offset) ret = protocol_client_xfer (frame, this, CLIENT_CHANNEL (this, CHANNEL_BULK), - GF_OP_TYPE_FOP_REQUEST, GF_FOP_TRUNCATE, + GF_OP_TYPE_FOP_REQUEST, GF_PROTO_FOP_TRUNCATE, hdr, hdrlen, NULL, 0, NULL); return ret; @@ -1518,7 +1518,7 @@ client_readv (call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, ret = protocol_client_xfer (frame, this, CLIENT_CHANNEL (this, CHANNEL_BULK), - GF_OP_TYPE_FOP_REQUEST, GF_FOP_READ, + GF_OP_TYPE_FOP_REQUEST, GF_PROTO_FOP_READ, hdr, hdrlen, NULL, 0, NULL); return 0; @@ -1592,7 +1592,7 @@ client_writev (call_frame_t *frame, xlator_t *this, fd_t *fd, ret = protocol_client_xfer (frame, this, CLIENT_CHANNEL (this, CHANNEL_BULK), - GF_OP_TYPE_FOP_REQUEST, GF_FOP_WRITE, + GF_OP_TYPE_FOP_REQUEST, GF_PROTO_FOP_WRITE, hdr, hdrlen, vector, count, iobref); return ret; unwind: @@ -1648,7 +1648,7 @@ client_statfs (call_frame_t *frame, xlator_t *this, loc_t *loc) ret = protocol_client_xfer (frame, this, CLIENT_CHANNEL (this, CHANNEL_LOWLAT), - GF_OP_TYPE_FOP_REQUEST, GF_FOP_STATFS, + GF_OP_TYPE_FOP_REQUEST, GF_PROTO_FOP_STATFS, hdr, hdrlen, NULL, 0, NULL); return ret; @@ -1716,7 +1716,7 @@ client_flush (call_frame_t *frame, xlator_t *this, fd_t *fd) ret = protocol_client_xfer (frame, this, CLIENT_CHANNEL (this, CHANNEL_BULK), - GF_OP_TYPE_FOP_REQUEST, GF_FOP_FLUSH, + GF_OP_TYPE_FOP_REQUEST, GF_PROTO_FOP_FLUSH, hdr, hdrlen, NULL, 0, NULL); return 0; @@ -1785,7 +1785,7 @@ client_fsync (call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t flags) ret = protocol_client_xfer (frame, this, CLIENT_CHANNEL (this, CHANNEL_BULK), - GF_OP_TYPE_FOP_REQUEST, GF_FOP_FSYNC, + GF_OP_TYPE_FOP_REQUEST, GF_PROTO_FOP_FSYNC, hdr, hdrlen, NULL, 0, NULL); return ret; @@ -1854,7 +1854,7 @@ client_xattrop (call_frame_t *frame, xlator_t *this, loc_t *loc, ret = protocol_client_xfer (frame, this, CLIENT_CHANNEL (this, CHANNEL_BULK), - GF_OP_TYPE_FOP_REQUEST, GF_FOP_XATTROP, + GF_OP_TYPE_FOP_REQUEST, GF_PROTO_FOP_XATTROP, hdr, hdrlen, NULL, 0, NULL); return ret; unwind: @@ -1938,7 +1938,7 @@ client_fxattrop (call_frame_t *frame, xlator_t *this, fd_t *fd, ret = protocol_client_xfer (frame, this, CLIENT_CHANNEL (this, CHANNEL_BULK), - GF_OP_TYPE_FOP_REQUEST, GF_FOP_FXATTROP, + GF_OP_TYPE_FOP_REQUEST, GF_PROTO_FOP_FXATTROP, hdr, hdrlen, NULL, 0, NULL); return ret; unwind: @@ -2015,7 +2015,7 @@ client_setxattr (call_frame_t *frame, xlator_t *this, loc_t *loc, ret = protocol_client_xfer (frame, this, CLIENT_CHANNEL (this, CHANNEL_BULK), - GF_OP_TYPE_FOP_REQUEST, GF_FOP_SETXATTR, + GF_OP_TYPE_FOP_REQUEST, GF_PROTO_FOP_SETXATTR, hdr, hdrlen, NULL, 0, NULL); return ret; unwind: @@ -2106,7 +2106,7 @@ client_fsetxattr (call_frame_t *frame, xlator_t *this, fd_t *fd, ret = protocol_client_xfer (frame, this, CLIENT_CHANNEL (this, CHANNEL_BULK), - GF_OP_TYPE_FOP_REQUEST, GF_FOP_FSETXATTR, + GF_OP_TYPE_FOP_REQUEST, GF_PROTO_FOP_FSETXATTR, hdr, hdrlen, NULL, 0, NULL); return ret; unwind: @@ -2166,7 +2166,7 @@ client_getxattr (call_frame_t *frame, xlator_t *this, loc_t *loc, ret = protocol_client_xfer (frame, this, CLIENT_CHANNEL (this, CHANNEL_LOWLAT), - GF_OP_TYPE_FOP_REQUEST, GF_FOP_GETXATTR, + GF_OP_TYPE_FOP_REQUEST, GF_PROTO_FOP_GETXATTR, hdr, hdrlen, NULL, 0, NULL); return ret; unwind: @@ -2245,7 +2245,7 @@ client_fgetxattr (call_frame_t *frame, xlator_t *this, fd_t *fd, ret = protocol_client_xfer (frame, this, CLIENT_CHANNEL (this, CHANNEL_LOWLAT), - GF_OP_TYPE_FOP_REQUEST, GF_FOP_FGETXATTR, + GF_OP_TYPE_FOP_REQUEST, GF_PROTO_FOP_FGETXATTR, hdr, hdrlen, NULL, 0, NULL); return ret; unwind: @@ -2304,7 +2304,7 @@ client_removexattr (call_frame_t *frame, xlator_t *this, loc_t *loc, ret = protocol_client_xfer (frame, this, CLIENT_CHANNEL (this, CHANNEL_LOWLAT), - GF_OP_TYPE_FOP_REQUEST, GF_FOP_REMOVEXATTR, + GF_OP_TYPE_FOP_REQUEST, GF_PROTO_FOP_REMOVEXATTR, hdr, hdrlen, NULL, 0, NULL); return ret; unwind: @@ -2366,7 +2366,7 @@ client_opendir (call_frame_t *frame, xlator_t *this, loc_t *loc, ret = protocol_client_xfer (frame, this, CLIENT_CHANNEL (this, CHANNEL_LOWLAT), - GF_OP_TYPE_FOP_REQUEST, GF_FOP_OPENDIR, + GF_OP_TYPE_FOP_REQUEST, GF_PROTO_FOP_OPENDIR, hdr, hdrlen, NULL, 0, NULL); return ret; @@ -2432,7 +2432,7 @@ client_readdirp (call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, ret = protocol_client_xfer (frame, this, CLIENT_CHANNEL (this, CHANNEL_LOWLAT), - GF_OP_TYPE_FOP_REQUEST, GF_FOP_READDIRP, + GF_OP_TYPE_FOP_REQUEST, GF_PROTO_FOP_READDIRP, hdr, hdrlen, NULL, 0, NULL); return 0; @@ -2500,7 +2500,7 @@ client_readdir (call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, ret = protocol_client_xfer (frame, this, CLIENT_CHANNEL (this, CHANNEL_LOWLAT), - GF_OP_TYPE_FOP_REQUEST, GF_FOP_READDIR, + GF_OP_TYPE_FOP_REQUEST, GF_PROTO_FOP_READDIR, hdr, hdrlen, NULL, 0, NULL); return 0; @@ -2566,7 +2566,7 @@ client_fsyncdir (call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t flags) ret = protocol_client_xfer (frame, this, CLIENT_CHANNEL (this, CHANNEL_BULK), - GF_OP_TYPE_FOP_REQUEST, GF_FOP_FSYNCDIR, + GF_OP_TYPE_FOP_REQUEST, GF_PROTO_FOP_FSYNCDIR, hdr, hdrlen, NULL, 0, NULL); return ret; @@ -2619,7 +2619,7 @@ client_access (call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t mask) ret = protocol_client_xfer (frame, this, CLIENT_CHANNEL (this, CHANNEL_LOWLAT), - GF_OP_TYPE_FOP_REQUEST, GF_FOP_ACCESS, + GF_OP_TYPE_FOP_REQUEST, GF_PROTO_FOP_ACCESS, hdr, hdrlen, NULL, 0, NULL); return ret; @@ -2688,7 +2688,7 @@ client_ftruncate (call_frame_t *frame, xlator_t *this, fd_t *fd, ret = protocol_client_xfer (frame, this, CLIENT_CHANNEL (this, CHANNEL_BULK), - GF_OP_TYPE_FOP_REQUEST, GF_FOP_FTRUNCATE, + GF_OP_TYPE_FOP_REQUEST, GF_PROTO_FOP_FTRUNCATE, hdr, hdrlen, NULL, 0, NULL); return ret; @@ -2754,7 +2754,7 @@ client_fstat (call_frame_t *frame, xlator_t *this, fd_t *fd) ret = protocol_client_xfer (frame, this, CLIENT_CHANNEL (this, CHANNEL_BULK), - GF_OP_TYPE_FOP_REQUEST, GF_FOP_FSTAT, + GF_OP_TYPE_FOP_REQUEST, GF_PROTO_FOP_FSTAT, hdr, hdrlen, NULL, 0, NULL); return ret; @@ -2853,7 +2853,7 @@ client_lk (call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t cmd, ret = protocol_client_xfer (frame, this, CLIENT_CHANNEL (this, CHANNEL_BULK), - GF_OP_TYPE_FOP_REQUEST, GF_FOP_LK, + GF_OP_TYPE_FOP_REQUEST, GF_PROTO_FOP_LK, hdr, hdrlen, NULL, 0, NULL); return ret; unwind: @@ -2945,7 +2945,7 @@ client_inodelk (call_frame_t *frame, xlator_t *this, const char *volume, ret = protocol_client_xfer (frame, this, CLIENT_CHANNEL (this, CHANNEL_BULK), GF_OP_TYPE_FOP_REQUEST, - GF_FOP_INODELK, + GF_PROTO_FOP_INODELK, hdr, hdrlen, NULL, 0, NULL); return ret; unwind: @@ -3052,7 +3052,7 @@ client_finodelk (call_frame_t *frame, xlator_t *this, const char *volume, ret = protocol_client_xfer (frame, this, CLIENT_CHANNEL (this, CHANNEL_BULK), GF_OP_TYPE_FOP_REQUEST, - GF_FOP_FINODELK, + GF_PROTO_FOP_FINODELK, hdr, hdrlen, NULL, 0, NULL); return ret; unwind: @@ -3113,7 +3113,7 @@ client_entrylk (call_frame_t *frame, xlator_t *this, const char *volume, ret = protocol_client_xfer (frame, this, CLIENT_CHANNEL (this, CHANNEL_LOWLAT), - GF_OP_TYPE_FOP_REQUEST, GF_FOP_ENTRYLK, + GF_OP_TYPE_FOP_REQUEST, GF_PROTO_FOP_ENTRYLK, hdr, hdrlen, NULL, 0, NULL); return ret; @@ -3191,7 +3191,7 @@ client_fentrylk (call_frame_t *frame, xlator_t *this, const char *volume, ret = protocol_client_xfer (frame, this, CLIENT_CHANNEL (this, CHANNEL_LOWLAT), - GF_OP_TYPE_FOP_REQUEST, GF_FOP_FENTRYLK, + GF_OP_TYPE_FOP_REQUEST, GF_PROTO_FOP_FENTRYLK, hdr, hdrlen, NULL, 0, NULL); return ret; @@ -3289,7 +3289,7 @@ client_lookup (call_frame_t *frame, xlator_t *this, loc_t *loc, ret = protocol_client_xfer (frame, this, CLIENT_CHANNEL (this, CHANNEL_LOWLAT), - GF_OP_TYPE_FOP_REQUEST, GF_FOP_LOOKUP, + GF_OP_TYPE_FOP_REQUEST, GF_PROTO_FOP_LOOKUP, hdr, hdrlen, NULL, 0, NULL); return ret; @@ -3339,7 +3339,7 @@ client_setattr (call_frame_t *frame, xlator_t *this, loc_t *loc, ret = protocol_client_xfer (frame, this, CLIENT_CHANNEL (this, CHANNEL_BULK), - GF_OP_TYPE_FOP_REQUEST, GF_FOP_SETATTR, + GF_OP_TYPE_FOP_REQUEST, GF_PROTO_FOP_SETATTR, hdr, hdrlen, NULL, 0, NULL); return ret; @@ -3402,7 +3402,7 @@ client_fsetattr (call_frame_t *frame, xlator_t *this, fd_t *fd, ret = protocol_client_xfer (frame, this, CLIENT_CHANNEL (this, CHANNEL_BULK), - GF_OP_TYPE_FOP_REQUEST, GF_FOP_FSETATTR, + GF_OP_TYPE_FOP_REQUEST, GF_PROTO_FOP_FSETATTR, hdr, hdrlen, NULL, 0, NULL); return ret; @@ -5174,68 +5174,6 @@ client_getspec_cbk (call_frame_t *frame, gf_hdr_common_t *hdr, size_t hdrlen, return 0; } - -int -client_log (call_frame_t *frame, xlator_t *this, const char *msg) -{ - gf_hdr_common_t * hdr = NULL; - gf_mop_log_req_t * req = NULL; - size_t hdrlen = -1; - int msglen = 0; - int ret = -1; - - if (msg) - msglen = STRLEN_0 (msg); - - hdrlen = gf_hdr_len (req, msglen); - hdr = gf_hdr_new (req, msglen); - - GF_VALIDATE_OR_GOTO (this->name, hdr, unwind); - - req = gf_param (hdr); - req->msglen = hton32 (msglen); - - if (msglen) - strcpy (req->msg, msg); - - ret = protocol_client_xfer (frame, this, - CLIENT_CHANNEL (this, CHANNEL_BULK), - GF_OP_TYPE_MOP_REQUEST, GF_MOP_LOG, - hdr, hdrlen, NULL, 0, NULL); - - return ret; - -unwind: - if (hdr) - GF_FREE (hdr); - - STACK_UNWIND (frame, -1, EINVAL, NULL); - return 0; -} - - -int -client_log_cbk (call_frame_t *frame, gf_hdr_common_t *hdr, size_t hdrlen, - struct iobuf *iobuf) -{ - gf_mop_log_rsp_t * rsp = NULL; - - int32_t op_ret = 0; - int32_t op_errno = 0; - int32_t gf_errno = 0; - - op_ret = ntoh32 (hdr->rsp.op_ret); - gf_errno = ntoh32 (hdr->rsp.op_errno); - op_errno = gf_error_to_errno (gf_errno); - - rsp = gf_param (hdr); - - STACK_UNWIND (frame, op_ret, op_errno); - - return 0; -} - - int client_checksum (call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flag) { @@ -5265,7 +5203,7 @@ client_checksum (call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flag) ret = protocol_client_xfer (frame, this, CLIENT_CHANNEL (this, CHANNEL_BULK), - GF_OP_TYPE_FOP_REQUEST, GF_FOP_CHECKSUM, + GF_OP_TYPE_FOP_REQUEST, GF_PROTO_FOP_CHECKSUM, hdr, hdrlen, NULL, 0, NULL); return ret; @@ -5348,7 +5286,7 @@ client_rchecksum (call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset, ret = protocol_client_xfer (frame, this, CLIENT_CHANNEL (this, CHANNEL_BULK), - GF_OP_TYPE_FOP_REQUEST, GF_FOP_RCHECKSUM, + GF_OP_TYPE_FOP_REQUEST, GF_PROTO_FOP_RCHECKSUM, hdr, hdrlen, NULL, 0, NULL); return ret; @@ -5514,7 +5452,7 @@ protocol_client_reopendir (xlator_t *this, client_fd_ctx_t *fdctx) ret = protocol_client_xfer (frame, this, CLIENT_CHANNEL (this, CHANNEL_LOWLAT), - GF_OP_TYPE_FOP_REQUEST, GF_FOP_OPENDIR, + GF_OP_TYPE_FOP_REQUEST, GF_PROTO_FOP_OPENDIR, hdr, hdrlen, NULL, 0, NULL); return ret; @@ -5638,7 +5576,7 @@ protocol_client_reopen (xlator_t *this, client_fd_ctx_t *fdctx) ret = protocol_client_xfer (frame, this, CLIENT_CHANNEL (this, CHANNEL_LOWLAT), - GF_OP_TYPE_FOP_REQUEST, GF_FOP_OPEN, + GF_OP_TYPE_FOP_REQUEST, GF_PROTO_FOP_OPEN, hdr, hdrlen, NULL, 0, NULL); return ret; @@ -5996,46 +5934,55 @@ client_forget_cbk (call_frame_t *frame, gf_hdr_common_t *hdr, size_t hdrlen, } +int +client_log_cbk (call_frame_t *frame, gf_hdr_common_t *hdr, size_t hdrlen, + struct iobuf *iobuf) +{ + gf_log ("", GF_LOG_CRITICAL, "fop not implemented"); + return 0; +} + + static gf_op_t gf_fops[] = { - [GF_FOP_STAT] = client_stat_cbk, - [GF_FOP_READLINK] = client_readlink_cbk, - [GF_FOP_MKNOD] = client_mknod_cbk, - [GF_FOP_MKDIR] = client_mkdir_cbk, - [GF_FOP_UNLINK] = client_unlink_cbk, - [GF_FOP_RMDIR] = client_rmdir_cbk, - [GF_FOP_SYMLINK] = client_symlink_cbk, - [GF_FOP_RENAME] = client_rename_cbk, - [GF_FOP_LINK] = client_link_cbk, - [GF_FOP_TRUNCATE] = client_truncate_cbk, - [GF_FOP_OPEN] = client_open_cbk, - [GF_FOP_READ] = client_readv_cbk, - [GF_FOP_WRITE] = client_write_cbk, - [GF_FOP_STATFS] = client_statfs_cbk, - [GF_FOP_FLUSH] = client_flush_cbk, - [GF_FOP_FSYNC] = client_fsync_cbk, - [GF_FOP_SETXATTR] = client_setxattr_cbk, - [GF_FOP_GETXATTR] = client_getxattr_cbk, - [GF_FOP_REMOVEXATTR] = client_removexattr_cbk, - [GF_FOP_OPENDIR] = client_opendir_cbk, - [GF_FOP_FSYNCDIR] = client_fsyncdir_cbk, - [GF_FOP_ACCESS] = client_access_cbk, - [GF_FOP_CREATE] = client_create_cbk, - [GF_FOP_FTRUNCATE] = client_ftruncate_cbk, - [GF_FOP_FSTAT] = client_fstat_cbk, - [GF_FOP_LK] = client_lk_common_cbk, - [GF_FOP_LOOKUP] = client_lookup_cbk, - [GF_FOP_READDIR] = client_readdir_cbk, - [GF_FOP_READDIRP] = client_readdirp_cbk, - [GF_FOP_INODELK] = client_inodelk_cbk, - [GF_FOP_FINODELK] = client_finodelk_cbk, - [GF_FOP_ENTRYLK] = client_entrylk_cbk, - [GF_FOP_FENTRYLK] = client_fentrylk_cbk, - [GF_FOP_CHECKSUM] = client_checksum_cbk, - [GF_FOP_RCHECKSUM] = client_rchecksum_cbk, - [GF_FOP_XATTROP] = client_xattrop_cbk, - [GF_FOP_FXATTROP] = client_fxattrop_cbk, - [GF_FOP_SETATTR] = client_setattr_cbk, - [GF_FOP_FSETATTR] = client_fsetattr_cbk + [GF_PROTO_FOP_STAT] = client_stat_cbk, + [GF_PROTO_FOP_READLINK] = client_readlink_cbk, + [GF_PROTO_FOP_MKNOD] = client_mknod_cbk, + [GF_PROTO_FOP_MKDIR] = client_mkdir_cbk, + [GF_PROTO_FOP_UNLINK] = client_unlink_cbk, + [GF_PROTO_FOP_RMDIR] = client_rmdir_cbk, + [GF_PROTO_FOP_SYMLINK] = client_symlink_cbk, + [GF_PROTO_FOP_RENAME] = client_rename_cbk, + [GF_PROTO_FOP_LINK] = client_link_cbk, + [GF_PROTO_FOP_TRUNCATE] = client_truncate_cbk, + [GF_PROTO_FOP_OPEN] = client_open_cbk, + [GF_PROTO_FOP_READ] = client_readv_cbk, + [GF_PROTO_FOP_WRITE] = client_write_cbk, + [GF_PROTO_FOP_STATFS] = client_statfs_cbk, + [GF_PROTO_FOP_FLUSH] = client_flush_cbk, + [GF_PROTO_FOP_FSYNC] = client_fsync_cbk, + [GF_PROTO_FOP_SETXATTR] = client_setxattr_cbk, + [GF_PROTO_FOP_GETXATTR] = client_getxattr_cbk, + [GF_PROTO_FOP_REMOVEXATTR] = client_removexattr_cbk, + [GF_PROTO_FOP_OPENDIR] = client_opendir_cbk, + [GF_PROTO_FOP_FSYNCDIR] = client_fsyncdir_cbk, + [GF_PROTO_FOP_ACCESS] = client_access_cbk, + [GF_PROTO_FOP_CREATE] = client_create_cbk, + [GF_PROTO_FOP_FTRUNCATE] = client_ftruncate_cbk, + [GF_PROTO_FOP_FSTAT] = client_fstat_cbk, + [GF_PROTO_FOP_LK] = client_lk_common_cbk, + [GF_PROTO_FOP_LOOKUP] = client_lookup_cbk, + [GF_PROTO_FOP_READDIR] = client_readdir_cbk, + [GF_PROTO_FOP_READDIRP] = client_readdirp_cbk, + [GF_PROTO_FOP_INODELK] = client_inodelk_cbk, + [GF_PROTO_FOP_FINODELK] = client_finodelk_cbk, + [GF_PROTO_FOP_ENTRYLK] = client_entrylk_cbk, + [GF_PROTO_FOP_FENTRYLK] = client_fentrylk_cbk, + [GF_PROTO_FOP_CHECKSUM] = client_checksum_cbk, + [GF_PROTO_FOP_RCHECKSUM] = client_rchecksum_cbk, + [GF_PROTO_FOP_XATTROP] = client_xattrop_cbk, + [GF_PROTO_FOP_FXATTROP] = client_fxattrop_cbk, + [GF_PROTO_FOP_SETATTR] = client_setattr_cbk, + [GF_PROTO_FOP_FSETATTR] = client_fsetattr_cbk }; static gf_op_t gf_mops[] = { @@ -6089,7 +6036,7 @@ protocol_client_interpret (xlator_t *this, transport_t *trans, switch (type) { case GF_OP_TYPE_FOP_REPLY: - if ((op > GF_FOP_MAXVALUE) || + if ((op > GF_PROTO_FOP_MAXVALUE) || (op < 0)) { gf_log (trans->xl->name, GF_LOG_WARNING, "invalid fop '%d'", op); @@ -6206,6 +6153,8 @@ init (xlator_t *this) conf = GF_CALLOC (1, sizeof (client_conf_t), gf_client_mt_client_conf_t); + protocol_common_init (); + pthread_mutex_init (&conf->mutex, NULL); INIT_LIST_HEAD (&conf->saved_fds); @@ -6698,11 +6647,7 @@ struct xlator_fops fops = { .fxattrop = client_fxattrop, .setattr = client_setattr, .fsetattr = client_fsetattr, -}; - -struct xlator_mops mops = { .getspec = client_getspec, - .log = client_log, }; struct xlator_cbks cbks = { diff --git a/xlators/protocol/lib/src/Makefile.am b/xlators/protocol/lib/src/Makefile.am index d3d1aafe172..53131f6d041 100644 --- a/xlators/protocol/lib/src/Makefile.am +++ b/xlators/protocol/lib/src/Makefile.am @@ -7,9 +7,9 @@ libgfproto_la_CPPFLAGS = -D_FILE_OFFSET_BITS=64 -D__USE_FILE_OFFSET64 -D_GNU_SOU libgfproto_la_LIBADD = $(top_builddir)/libglusterfs/src/libglusterfs.la -lib_LTLIBRARIES = libgfproto.la +lib_LTLIBRARIES = libgfproto.la -libgfproto_la_SOURCES = transport.c authenticate.c +libgfproto_la_SOURCES = transport.c authenticate.c protocol.c noinst_HEADERS = transport.h protocol.h authenticate.h diff --git a/xlators/protocol/lib/src/protocol.c b/xlators/protocol/lib/src/protocol.c new file mode 100644 index 00000000000..63950f43dec --- /dev/null +++ b/xlators/protocol/lib/src/protocol.c @@ -0,0 +1,108 @@ + +#include "globals.h" +#include "compat.h" +#include "protocol.h" + +char *gf_mop_list[GF_MOP_MAXVALUE]; +char *gf_cbk_list[GF_CBK_MAXVALUE]; + +static int +gf_dirent_nb_size (gf_dirent_t *entries) +{ + return (sizeof (struct gf_dirent_nb) + strlen (entries->d_name) + 1); +} + +int +gf_dirent_serialize (gf_dirent_t *entries, char *buf, size_t buf_size) +{ + struct gf_dirent_nb *entry_nb = NULL; + gf_dirent_t *entry = NULL; + int size = 0; + int entry_size = 0; + + + list_for_each_entry (entry, &entries->list, list) { + entry_size = gf_dirent_nb_size (entry); + + if (buf && (size + entry_size <= buf_size)) { + entry_nb = (void *) (buf + size); + + entry_nb->d_ino = hton64 (entry->d_ino); + entry_nb->d_off = hton64 (entry->d_off); + entry_nb->d_len = hton32 (entry->d_len); + entry_nb->d_type = hton32 (entry->d_type); + + gf_stat_from_iatt (&entry_nb->d_stat, &entry->d_stat); + + strcpy (entry_nb->d_name, entry->d_name); + } + size += entry_size; + } + + return size; +} + + +int +gf_dirent_unserialize (gf_dirent_t *entries, const char *buf, size_t buf_size) +{ + struct gf_dirent_nb *entry_nb = NULL; + int remaining_size = 0; + int least_dirent_size = 0; + int count = 0; + gf_dirent_t *entry = NULL; + int entry_strlen = 0; + int entry_len = 0; + + + remaining_size = buf_size; + least_dirent_size = (sizeof (struct gf_dirent_nb) + 2); + + while (remaining_size >= least_dirent_size) { + entry_nb = (void *)(buf + (buf_size - remaining_size)); + + entry_strlen = strnlen (entry_nb->d_name, remaining_size); + if (entry_strlen == remaining_size) { + break; + } + + entry_len = sizeof (gf_dirent_t) + entry_strlen + 1; + entry = GF_CALLOC (1, entry_len, gf_common_mt_gf_dirent_t); + if (!entry) { + break; + } + + entry->d_ino = ntoh64 (entry_nb->d_ino); + entry->d_off = ntoh64 (entry_nb->d_off); + entry->d_len = ntoh32 (entry_nb->d_len); + entry->d_type = ntoh32 (entry_nb->d_type); + + gf_stat_to_iatt (&entry_nb->d_stat, &entry->d_stat); + + strcpy (entry->d_name, entry_nb->d_name); + + list_add_tail (&entry->list, &entries->list); + + remaining_size -= (sizeof (*entry_nb) + entry_strlen + 1); + count++; + } + + return count; +} + +int +protocol_common_init (void) +{ + gf_mop_list[GF_MOP_SETVOLUME] = "SETVOLUME"; + gf_mop_list[GF_MOP_GETVOLUME] = "GETVOLUME"; + gf_mop_list[GF_MOP_SETSPEC] = "SETSPEC"; + gf_mop_list[GF_MOP_GETSPEC] = "GETSPEC"; + gf_mop_list[GF_MOP_LOG] = "LOG"; + gf_mop_list[GF_MOP_PING] = "PING"; + + gf_cbk_list[GF_CBK_FORGET] = "FORGET"; + gf_cbk_list[GF_CBK_RELEASE] = "RELEASE"; + gf_cbk_list[GF_CBK_RELEASEDIR] = "RELEASEDIR"; + + return 0; +} diff --git a/xlators/protocol/lib/src/protocol.h b/xlators/protocol/lib/src/protocol.h index 6fd291bbebe..254e36e661b 100644 --- a/xlators/protocol/lib/src/protocol.h +++ b/xlators/protocol/lib/src/protocol.h @@ -42,6 +42,89 @@ #define GF_PROTOCOL_VERSION "3.0" +extern char *gf_mop_list[]; +extern char *gf_cbk_list[]; + +/* NOTE: add members ONLY at the end (just before _MAXVALUE) */ +typedef enum { + GF_PROTO_FOP_STAT, /* 0 */ + GF_PROTO_FOP_READLINK, /* 1 */ + GF_PROTO_FOP_MKNOD, /* 2 */ + GF_PROTO_FOP_MKDIR, + GF_PROTO_FOP_UNLINK, + GF_PROTO_FOP_RMDIR, /* 5 */ + GF_PROTO_FOP_SYMLINK, + GF_PROTO_FOP_RENAME, + GF_PROTO_FOP_LINK, + GF_PROTO_FOP_TRUNCATE, + GF_PROTO_FOP_OPEN, /* 10 */ + GF_PROTO_FOP_READ, + GF_PROTO_FOP_WRITE, + GF_PROTO_FOP_STATFS, /* 15 */ + GF_PROTO_FOP_FLUSH, + GF_PROTO_FOP_FSYNC, + GF_PROTO_FOP_SETXATTR, + GF_PROTO_FOP_GETXATTR, + GF_PROTO_FOP_REMOVEXATTR,/* 20 */ + GF_PROTO_FOP_OPENDIR, + GF_PROTO_FOP_GETDENTS, + GF_PROTO_FOP_FSYNCDIR, + GF_PROTO_FOP_ACCESS, + GF_PROTO_FOP_CREATE, /* 25 */ + GF_PROTO_FOP_FTRUNCATE, + GF_PROTO_FOP_FSTAT, + GF_PROTO_FOP_LK, + GF_PROTO_FOP_LOOKUP, + GF_PROTO_FOP_SETDENTS, + GF_PROTO_FOP_READDIR, + GF_PROTO_FOP_INODELK, /* 35 */ + GF_PROTO_FOP_FINODELK, + GF_PROTO_FOP_ENTRYLK, + GF_PROTO_FOP_FENTRYLK, + GF_PROTO_FOP_CHECKSUM, + GF_PROTO_FOP_XATTROP, /* 40 */ + GF_PROTO_FOP_FXATTROP, + GF_PROTO_FOP_LOCK_NOTIFY, + GF_PROTO_FOP_LOCK_FNOTIFY, + GF_PROTO_FOP_FGETXATTR, + GF_PROTO_FOP_FSETXATTR, /* 45 */ + GF_PROTO_FOP_RCHECKSUM, + GF_PROTO_FOP_SETATTR, + GF_PROTO_FOP_FSETATTR, + GF_PROTO_FOP_READDIRP, + GF_PROTO_FOP_MAXVALUE, +} glusterfs_proto_fop_t; + +/* NOTE: add members ONLY at the end (just before _MAXVALUE) */ +typedef enum { + GF_MOP_SETVOLUME, /* 0 */ + GF_MOP_GETVOLUME, /* 1 */ + GF_MOP_STATS, + GF_MOP_SETSPEC, + GF_MOP_GETSPEC, + GF_MOP_PING, /* 5 */ + GF_MOP_LOG, + GF_MOP_NOTIFY, + GF_MOP_MAXVALUE, /* 8 */ +} glusterfs_mop_t; + +typedef enum { + GF_CBK_FORGET, /* 0 */ + GF_CBK_RELEASE, /* 1 */ + GF_CBK_RELEASEDIR, /* 2 */ + GF_CBK_MAXVALUE /* 3 */ +} glusterfs_cbk_t; + +typedef enum { + GF_OP_TYPE_FOP_REQUEST = 1, + GF_OP_TYPE_MOP_REQUEST, + GF_OP_TYPE_CBK_REQUEST, + GF_OP_TYPE_FOP_REPLY, + GF_OP_TYPE_MOP_REPLY, + GF_OP_TYPE_CBK_REPLY +} glusterfs_op_type_t; + + struct gf_stat { uint64_t ino; uint64_t size; @@ -1026,89 +1109,11 @@ struct gf_dirent_nb { char d_name[0]; } __attribute__((packed)); +int +gf_dirent_unserialize (gf_dirent_t *entries, const char *buf, size_t buf_size); +int +gf_dirent_serialize (gf_dirent_t *entries, char *buf, size_t buf_size); -static inline int -gf_dirent_nb_size (gf_dirent_t *entries) -{ - return (sizeof (struct gf_dirent_nb) + strlen (entries->d_name) + 1); -} - -static inline int -gf_dirent_serialize (gf_dirent_t *entries, char *buf, size_t buf_size) -{ - struct gf_dirent_nb *entry_nb = NULL; - gf_dirent_t *entry = NULL; - int size = 0; - int entry_size = 0; - - - list_for_each_entry (entry, &entries->list, list) { - entry_size = gf_dirent_nb_size (entry); - - if (buf && (size + entry_size <= buf_size)) { - entry_nb = (void *) (buf + size); - - entry_nb->d_ino = hton64 (entry->d_ino); - entry_nb->d_off = hton64 (entry->d_off); - entry_nb->d_len = hton32 (entry->d_len); - entry_nb->d_type = hton32 (entry->d_type); - - gf_stat_from_iatt (&entry_nb->d_stat, &entry->d_stat); - - strcpy (entry_nb->d_name, entry->d_name); - } - size += entry_size; - } - - return size; -} - - -static inline int -gf_dirent_unserialize (gf_dirent_t *entries, const char *buf, size_t buf_size) -{ - struct gf_dirent_nb *entry_nb = NULL; - int remaining_size = 0; - int least_dirent_size = 0; - int count = 0; - gf_dirent_t *entry = NULL; - int entry_strlen = 0; - int entry_len = 0; - - - remaining_size = buf_size; - least_dirent_size = (sizeof (struct gf_dirent_nb) + 2); - - while (remaining_size >= least_dirent_size) { - entry_nb = (void *)(buf + (buf_size - remaining_size)); - - entry_strlen = strnlen (entry_nb->d_name, remaining_size); - if (entry_strlen == remaining_size) { - break; - } - - entry_len = sizeof (gf_dirent_t) + entry_strlen + 1; - entry = GF_CALLOC (1, entry_len, gf_common_mt_gf_dirent_t); - if (!entry) { - break; - } - - entry->d_ino = ntoh64 (entry_nb->d_ino); - entry->d_off = ntoh64 (entry_nb->d_off); - entry->d_len = ntoh32 (entry_nb->d_len); - entry->d_type = ntoh32 (entry_nb->d_type); - - gf_stat_to_iatt (&entry_nb->d_stat, &entry->d_stat); - - strcpy (entry->d_name, entry_nb->d_name); - - list_add_tail (&entry->list, &entries->list); - - remaining_size -= (sizeof (*entry_nb) + entry_strlen + 1); - count++; - } - - return count; -} +int protocol_common_init (void); #endif diff --git a/xlators/protocol/server/src/server-protocol.c b/xlators/protocol/server/src/server-protocol.c index 079b3f2e4c3..b5f90c3a5dc 100644 --- a/xlators/protocol/server/src/server-protocol.c +++ b/xlators/protocol/server/src/server-protocol.c @@ -388,7 +388,7 @@ server_lk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, strerror (op_errno)); } - protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_FOP_LK, + protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_PROTO_FOP_LK, hdr, hdrlen, NULL, 0, NULL); return 0; @@ -433,7 +433,7 @@ server_inodelk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, strerror (op_errno)); } - protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_FOP_INODELK, + protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_PROTO_FOP_INODELK, hdr, hdrlen, NULL, 0, NULL); return 0; @@ -480,7 +480,7 @@ server_finodelk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, strerror (op_errno)); } - protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_FOP_FINODELK, + protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_PROTO_FOP_FINODELK, hdr, hdrlen, NULL, 0, NULL); return 0; @@ -536,7 +536,7 @@ server_entrylk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, strerror (op_errno)); } - protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_FOP_ENTRYLK, + protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_PROTO_FOP_ENTRYLK, hdr, hdrlen, NULL, 0, NULL); return 0; @@ -580,7 +580,7 @@ server_fentrylk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, strerror (op_errno)); } - protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_FOP_FENTRYLK, + protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_PROTO_FOP_FENTRYLK, hdr, hdrlen, NULL, 0, NULL); return 0; @@ -617,7 +617,7 @@ server_access_cbk (call_frame_t *frame, void *cookie, xlator_t *this, gf_errno = gf_errno_to_error (op_errno); hdr->rsp.op_errno = hton32 (gf_errno); - protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_FOP_ACCESS, + protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_PROTO_FOP_ACCESS, hdr, hdrlen, NULL, 0, NULL); return 0; @@ -676,7 +676,7 @@ server_rmdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this, gf_stat_from_iatt (&rsp->postparent, postparent); } - protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_FOP_RMDIR, + protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_PROTO_FOP_RMDIR, hdr, hdrlen, NULL, 0, NULL); return 0; @@ -732,7 +732,7 @@ server_mkdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this, op_ret, strerror (op_errno)); } - protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_FOP_MKDIR, + protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_PROTO_FOP_MKDIR, hdr, hdrlen, NULL, 0, NULL); return 0; @@ -788,7 +788,7 @@ server_mknod_cbk (call_frame_t *frame, void *cookie, xlator_t *this, op_ret, strerror (op_errno)); } - protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_FOP_MKNOD, + protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_PROTO_FOP_MKNOD, hdr, hdrlen, NULL, 0, NULL); return 0; @@ -832,7 +832,7 @@ server_fsyncdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this, gf_errno = gf_errno_to_error (op_errno); hdr->rsp.op_errno = hton32 (gf_errno); - protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_FOP_FSYNCDIR, + protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_PROTO_FOP_FSYNCDIR, hdr, hdrlen, NULL, 0, NULL); return 0; @@ -885,7 +885,7 @@ server_readdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this, strerror (op_errno)); } - protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_FOP_READDIR, + protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_PROTO_FOP_READDIR, hdr, hdrlen, NULL, 0, NULL); return 0; @@ -975,7 +975,7 @@ server_opendir_cbk (call_frame_t *frame, void *cookie, xlator_t *this, hdr->rsp.op_errno = hton32 (gf_errno); rsp->fd = hton64 (fd_no); - protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_FOP_OPENDIR, + protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_PROTO_FOP_OPENDIR, hdr, hdrlen, NULL, 0, NULL); return 0; @@ -1016,7 +1016,7 @@ server_statfs_cbk (call_frame_t *frame, void *cookie, xlator_t *this, gf_statfs_from_statfs (&rsp->statfs, buf); } - protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_FOP_STATFS, + protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_PROTO_FOP_STATFS, hdr, hdrlen, NULL, 0, NULL); return 0; @@ -1052,7 +1052,7 @@ server_removexattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, gf_errno = gf_errno_to_error (op_errno); hdr->rsp.op_errno = hton32 (gf_errno); - protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_FOP_REMOVEXATTR, + protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_PROTO_FOP_REMOVEXATTR, hdr, hdrlen, NULL, 0, NULL); return 0; @@ -1116,7 +1116,7 @@ server_getxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, gf_errno = gf_errno_to_error (op_errno); hdr->rsp.op_errno = hton32 (gf_errno); - protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_FOP_GETXATTR, + protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_PROTO_FOP_GETXATTR, hdr, hdrlen, NULL, 0, NULL); return 0; @@ -1170,7 +1170,7 @@ server_fgetxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, gf_errno = gf_errno_to_error (op_errno); hdr->rsp.op_errno = hton32 (gf_errno); - protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_FOP_FGETXATTR, + protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_PROTO_FOP_FGETXATTR, hdr, hdrlen, NULL, 0, NULL); return 0; @@ -1207,7 +1207,7 @@ server_setxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, gf_errno = gf_errno_to_error (op_errno); hdr->rsp.op_errno = hton32 (gf_errno); - protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_FOP_SETXATTR, + protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_PROTO_FOP_SETXATTR, hdr, hdrlen, NULL, 0, NULL); return 0; @@ -1234,7 +1234,7 @@ server_fsetxattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, gf_errno = gf_errno_to_error (op_errno); hdr->rsp.op_errno = hton32 (gf_errno); - protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_FOP_FSETXATTR, + protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_PROTO_FOP_FSETXATTR, hdr, hdrlen, NULL, 0, NULL); return 0; @@ -1297,7 +1297,7 @@ server_rename_cbk (call_frame_t *frame, void *cookie, xlator_t *this, gf_stat_from_iatt (&rsp->postnewparent, postnewparent); } - protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_FOP_RENAME, + protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_PROTO_FOP_RENAME, hdr, hdrlen, NULL, 0, NULL); return 0; @@ -1363,7 +1363,7 @@ server_unlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this, gf_stat_from_iatt (&rsp->postparent, postparent); } - protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_FOP_UNLINK, + protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_PROTO_FOP_UNLINK, hdr, hdrlen, NULL, 0, NULL); return 0; @@ -1419,7 +1419,7 @@ server_symlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this, op_ret, strerror (op_errno)); } - protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_FOP_SYMLINK, + protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_PROTO_FOP_SYMLINK, hdr, hdrlen, NULL, 0, NULL); return 0; @@ -1487,7 +1487,7 @@ server_link_cbk (call_frame_t *frame, void *cookie, xlator_t *this, op_ret, strerror (op_errno)); } - protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_FOP_LINK, + protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_PROTO_FOP_LINK, hdr, hdrlen, NULL, 0, NULL); return 0; @@ -1537,7 +1537,7 @@ server_truncate_cbk (call_frame_t *frame, void *cookie, xlator_t *this, op_ret, strerror (op_errno)); } - protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_FOP_TRUNCATE, + protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_PROTO_FOP_TRUNCATE, hdr, hdrlen, NULL, 0, NULL); return 0; @@ -1584,7 +1584,7 @@ server_fstat_cbk (call_frame_t *frame, void *cookie, xlator_t *this, strerror (op_errno)); } - protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_FOP_FSTAT, + protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_PROTO_FOP_FSTAT, hdr, hdrlen, NULL, 0, NULL); return 0; @@ -1633,7 +1633,7 @@ server_ftruncate_cbk (call_frame_t *frame, void *cookie, xlator_t *this, strerror (op_errno)); } - protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_FOP_FTRUNCATE, + protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_PROTO_FOP_FTRUNCATE, hdr, hdrlen, NULL, 0, NULL); return 0; @@ -1677,7 +1677,7 @@ server_flush_cbk (call_frame_t *frame, void *cookie, xlator_t *this, gf_errno = gf_errno_to_error (op_errno); hdr->rsp.op_errno = hton32 (gf_errno); - protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_FOP_FLUSH, + protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_PROTO_FOP_FLUSH, hdr, hdrlen, NULL, 0, NULL); return 0; @@ -1727,7 +1727,7 @@ server_fsync_cbk (call_frame_t *frame, void *cookie, xlator_t *this, gf_stat_from_iatt (&(rsp->poststat), postbuf); } - protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_FOP_FSYNC, + protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_PROTO_FOP_FSYNC, hdr, hdrlen, NULL, 0, NULL); return 0; @@ -1809,7 +1809,7 @@ server_writev_cbk (call_frame_t *frame, void *cookie, xlator_t *this, strerror (op_errno)); } - protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_FOP_WRITE, + protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_PROTO_FOP_WRITE, hdr, hdrlen, NULL, 0, NULL); return 0; @@ -1860,7 +1860,7 @@ server_readv_cbk (call_frame_t *frame, void *cookie, xlator_t *this, strerror (op_errno)); } - protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_FOP_READ, + protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_PROTO_FOP_READ, hdr, hdrlen, vector, count, iobref); return 0; @@ -1916,7 +1916,7 @@ server_open_cbk (call_frame_t *frame, void *cookie, xlator_t *this, hdr->rsp.op_errno = hton32 (gf_errno); rsp->fd = hton64 (fd_no); - protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_FOP_OPEN, + protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_PROTO_FOP_OPEN, hdr, hdrlen, NULL, 0, NULL); return 0; @@ -2017,7 +2017,7 @@ server_create_cbk (call_frame_t *frame, void *cookie, xlator_t *this, gf_stat_from_iatt (&rsp->postparent, postparent); } - protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_FOP_CREATE, + protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_PROTO_FOP_CREATE, hdr, hdrlen, NULL, 0, NULL); return 0; @@ -2071,7 +2071,7 @@ server_readlink_cbk (call_frame_t *frame, void *cookie, xlator_t *this, strcpy (rsp->path, buf); } - protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_FOP_READLINK, + protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_PROTO_FOP_READLINK, hdr, hdrlen, NULL, 0, NULL); return 0; @@ -2118,7 +2118,7 @@ server_stat_cbk (call_frame_t *frame, void *cookie, xlator_t *this, op_ret, strerror (op_errno)); } - protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_FOP_STAT, + protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_PROTO_FOP_STAT, hdr, hdrlen, NULL, 0, NULL); return 0; @@ -2168,7 +2168,7 @@ server_setattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, op_ret, strerror (op_errno)); } - protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_FOP_SETATTR, + protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_PROTO_FOP_SETATTR, hdr, hdrlen, NULL, 0, NULL); return 0; @@ -2218,7 +2218,7 @@ server_fsetattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this, op_ret, strerror (op_errno)); } - protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_FOP_FSETATTR, + protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_PROTO_FOP_FSETATTR, hdr, hdrlen, NULL, 0, NULL); return 0; @@ -2341,7 +2341,7 @@ server_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this, op_ret, strerror (op_errno)); } - protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_FOP_LOOKUP, + protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_PROTO_FOP_LOOKUP, hdr, hdrlen, NULL, 0, NULL); return 0; @@ -2404,7 +2404,7 @@ server_xattrop_cbk (call_frame_t *frame, void *cookie, xlator_t *this, gf_errno = gf_errno_to_error (op_errno); hdr->rsp.op_errno = hton32 (gf_errno); - protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_FOP_XATTROP, + protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_PROTO_FOP_XATTROP, hdr, hdrlen, NULL, 0, NULL); return 0; @@ -2469,7 +2469,7 @@ server_fxattrop_cbk (call_frame_t *frame, void *cookie, xlator_t *this, hdr->rsp.op_errno = hton32 (gf_errno); - protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_FOP_FXATTROP, + protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_PROTO_FOP_FXATTROP, hdr, hdrlen, NULL, 0, NULL); return 0; @@ -3879,7 +3879,7 @@ server_readdirp_cbk (call_frame_t *frame, void *cookie, xlator_t *this, strerror (op_errno)); } - protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_FOP_READDIRP, + protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_PROTO_FOP_READDIRP, hdr, hdrlen, NULL, 0, NULL); return 0; @@ -5116,7 +5116,7 @@ server_checksum_cbk (call_frame_t *frame, void *cookie, xlator_t *this, rsp->dchecksum[NAME_MAX + NAME_MAX] = '\0'; } - protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_FOP_CHECKSUM, + protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_PROTO_FOP_CHECKSUM, hdr, hdrlen, NULL, 0, NULL); return 0; @@ -5200,7 +5200,7 @@ server_rchecksum_cbk (call_frame_t *frame, void *cookie, xlator_t *this, rsp->strong_checksum[MD5_DIGEST_LEN] = '\0'; } - protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_FOP_RCHECKSUM, + protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_PROTO_FOP_RCHECKSUM, hdr, hdrlen, NULL, 0, NULL); return 0; @@ -5650,7 +5650,7 @@ server_setdents (call_frame_t *frame, xlator_t *bound_xl, hdr->rsp.op_errno = hton32 (gf_errno); hdr->rsp.op_ret = -1; - protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_FOP_SETDENTS, + protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_PROTO_FOP_SETDENTS, rsp_hdr, rsp_hdrlen, NULL, 0, NULL); return 0; @@ -5674,7 +5674,7 @@ server_getdents (call_frame_t *frame, xlator_t *bound_xl, hdr->rsp.op_errno = hton32 (gf_errno); hdr->rsp.op_ret = -1; - protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_FOP_GETDENTS, + protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_PROTO_FOP_GETDENTS, rsp_hdr, rsp_hdrlen, NULL, 0, NULL); return 0; @@ -5698,7 +5698,7 @@ server_lock_notify (call_frame_t *frame, xlator_t *bound_xl, hdr->rsp.op_errno = hton32 (gf_errno); hdr->rsp.op_ret = -1; - protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_FOP_LOCK_NOTIFY, + protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_PROTO_FOP_LOCK_NOTIFY, rsp_hdr, rsp_hdrlen, NULL, 0, NULL); return 0; @@ -5722,7 +5722,7 @@ server_lock_fnotify (call_frame_t *frame, xlator_t *bound_xl, hdr->rsp.op_errno = hton32 (gf_errno); hdr->rsp.op_ret = -1; - protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_FOP_LOCK_FNOTIFY, + protocol_server_reply (frame, GF_OP_TYPE_FOP_REPLY, GF_PROTO_FOP_LOCK_FNOTIFY, rsp_hdr, rsp_hdrlen, NULL, 0, NULL); return 0; @@ -5901,51 +5901,51 @@ typedef int32_t (*gf_op_t) (call_frame_t *frame, xlator_t *bould_xl, static gf_op_t gf_fops[] = { - [GF_FOP_STAT] = server_stat, - [GF_FOP_READLINK] = server_readlink, - [GF_FOP_MKNOD] = server_mknod, - [GF_FOP_MKDIR] = server_mkdir, - [GF_FOP_UNLINK] = server_unlink, - [GF_FOP_RMDIR] = server_rmdir, - [GF_FOP_SYMLINK] = server_symlink, - [GF_FOP_RENAME] = server_rename, - [GF_FOP_LINK] = server_link, - [GF_FOP_TRUNCATE] = server_truncate, - [GF_FOP_OPEN] = server_open, - [GF_FOP_READ] = server_readv, - [GF_FOP_WRITE] = server_writev, - [GF_FOP_STATFS] = server_statfs, - [GF_FOP_FLUSH] = server_flush, - [GF_FOP_FSYNC] = server_fsync, - [GF_FOP_SETXATTR] = server_setxattr, - [GF_FOP_GETXATTR] = server_getxattr, - [GF_FOP_FGETXATTR] = server_fgetxattr, - [GF_FOP_FSETXATTR] = server_fsetxattr, - [GF_FOP_REMOVEXATTR] = server_removexattr, - [GF_FOP_OPENDIR] = server_opendir, - [GF_FOP_FSYNCDIR] = server_fsyncdir, - [GF_FOP_ACCESS] = server_access, - [GF_FOP_CREATE] = server_create, - [GF_FOP_FTRUNCATE] = server_ftruncate, - [GF_FOP_FSTAT] = server_fstat, - [GF_FOP_LK] = server_lk, - [GF_FOP_LOOKUP] = server_lookup, - [GF_FOP_READDIR] = server_readdir, - [GF_FOP_READDIRP] = server_readdirp, - [GF_FOP_INODELK] = server_inodelk, - [GF_FOP_FINODELK] = server_finodelk, - [GF_FOP_ENTRYLK] = server_entrylk, - [GF_FOP_FENTRYLK] = server_fentrylk, - [GF_FOP_CHECKSUM] = server_checksum, - [GF_FOP_RCHECKSUM] = server_rchecksum, - [GF_FOP_XATTROP] = server_xattrop, - [GF_FOP_FXATTROP] = server_fxattrop, - [GF_FOP_SETATTR] = server_setattr, - [GF_FOP_FSETATTR] = server_fsetattr, - [GF_FOP_SETDENTS] = server_setdents, - [GF_FOP_GETDENTS] = server_getdents, - [GF_FOP_LOCK_NOTIFY] = server_lock_notify, - [GF_FOP_LOCK_FNOTIFY] = server_lock_fnotify, + [GF_PROTO_FOP_STAT] = server_stat, + [GF_PROTO_FOP_READLINK] = server_readlink, + [GF_PROTO_FOP_MKNOD] = server_mknod, + [GF_PROTO_FOP_MKDIR] = server_mkdir, + [GF_PROTO_FOP_UNLINK] = server_unlink, + [GF_PROTO_FOP_RMDIR] = server_rmdir, + [GF_PROTO_FOP_SYMLINK] = server_symlink, + [GF_PROTO_FOP_RENAME] = server_rename, + [GF_PROTO_FOP_LINK] = server_link, + [GF_PROTO_FOP_TRUNCATE] = server_truncate, + [GF_PROTO_FOP_OPEN] = server_open, + [GF_PROTO_FOP_READ] = server_readv, + [GF_PROTO_FOP_WRITE] = server_writev, + [GF_PROTO_FOP_STATFS] = server_statfs, + [GF_PROTO_FOP_FLUSH] = server_flush, + [GF_PROTO_FOP_FSYNC] = server_fsync, + [GF_PROTO_FOP_SETXATTR] = server_setxattr, + [GF_PROTO_FOP_GETXATTR] = server_getxattr, + [GF_PROTO_FOP_FGETXATTR] = server_fgetxattr, + [GF_PROTO_FOP_FSETXATTR] = server_fsetxattr, + [GF_PROTO_FOP_REMOVEXATTR] = server_removexattr, + [GF_PROTO_FOP_OPENDIR] = server_opendir, + [GF_PROTO_FOP_FSYNCDIR] = server_fsyncdir, + [GF_PROTO_FOP_ACCESS] = server_access, + [GF_PROTO_FOP_CREATE] = server_create, + [GF_PROTO_FOP_FTRUNCATE] = server_ftruncate, + [GF_PROTO_FOP_FSTAT] = server_fstat, + [GF_PROTO_FOP_LK] = server_lk, + [GF_PROTO_FOP_LOOKUP] = server_lookup, + [GF_PROTO_FOP_READDIR] = server_readdir, + [GF_PROTO_FOP_READDIRP] = server_readdirp, + [GF_PROTO_FOP_INODELK] = server_inodelk, + [GF_PROTO_FOP_FINODELK] = server_finodelk, + [GF_PROTO_FOP_ENTRYLK] = server_entrylk, + [GF_PROTO_FOP_FENTRYLK] = server_fentrylk, + [GF_PROTO_FOP_CHECKSUM] = server_checksum, + [GF_PROTO_FOP_RCHECKSUM] = server_rchecksum, + [GF_PROTO_FOP_XATTROP] = server_xattrop, + [GF_PROTO_FOP_FXATTROP] = server_fxattrop, + [GF_PROTO_FOP_SETATTR] = server_setattr, + [GF_PROTO_FOP_FSETATTR] = server_fsetattr, + [GF_PROTO_FOP_SETDENTS] = server_setdents, + [GF_PROTO_FOP_GETDENTS] = server_getdents, + [GF_PROTO_FOP_LOCK_NOTIFY] = server_lock_notify, + [GF_PROTO_FOP_LOCK_FNOTIFY] = server_lock_fnotify, }; @@ -5989,7 +5989,7 @@ protocol_server_interpret (xlator_t *this, transport_t *trans, peerinfo = &trans->peerinfo; switch (type) { case GF_OP_TYPE_FOP_REQUEST: - if ((op < 0) || (op >= GF_FOP_MAXVALUE)) { + if ((op < 0) || (op >= GF_PROTO_FOP_MAXVALUE)) { gf_log (this->name, GF_LOG_ERROR, "invalid fop %"PRId32" from client %s", op, peerinfo->identifier); @@ -6529,9 +6529,6 @@ notify (xlator_t *this, int32_t event, void *data, ...) } -struct xlator_mops mops = { -}; - struct xlator_fops fops = { }; diff --git a/xlators/storage/bdb/src/bdb.c b/xlators/storage/bdb/src/bdb.c index fba34ee0450..6104728e3db 100644 --- a/xlators/storage/bdb/src/bdb.c +++ b/xlators/storage/bdb/src/bdb.c @@ -3471,9 +3471,6 @@ fini (xlator_t *this) return; } -struct xlator_mops mops = { - .stats = bdb_stats, -}; struct xlator_fops fops = { .lookup = bdb_lookup, diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c index c22517f9ecd..4f47ed02758 100644 --- a/xlators/storage/posix/src/posix.c +++ b/xlators/storage/posix/src/posix.c @@ -4582,9 +4582,6 @@ struct xlator_dumpops dumpops = { .inode = posix_inode, }; -struct xlator_mops mops = { -}; - struct xlator_fops fops = { .lookup = posix_lookup, .stat = posix_stat, -- cgit