diff options
Diffstat (limited to 'rpc/xdr/src')
| -rw-r--r-- | rpc/xdr/src/.gitignore | 2 | ||||
| -rw-r--r-- | rpc/xdr/src/Makefile.am | 70 | ||||
| -rw-r--r-- | rpc/xdr/src/cli1-xdr.x | 1 | ||||
| -rw-r--r-- | rpc/xdr/src/glusterd1-xdr.x | 15 | ||||
| -rw-r--r-- | rpc/xdr/src/glusterfs-fops.x | 250 | ||||
| -rw-r--r-- | rpc/xdr/src/glusterfs3-xdr.x | 3 | ||||
| -rw-r--r-- | rpc/xdr/src/glusterfs4-xdr.x | 6 | ||||
| -rw-r--r-- | rpc/xdr/src/libgfxdr.sym | 2 | ||||
| -rw-r--r-- | rpc/xdr/src/rpc-common-xdr.x | 3 |
9 files changed, 82 insertions, 270 deletions
diff --git a/rpc/xdr/src/.gitignore b/rpc/xdr/src/.gitignore index 6728940f546..a0c8b7ca2b6 100644 --- a/rpc/xdr/src/.gitignore +++ b/rpc/xdr/src/.gitignore @@ -10,8 +10,6 @@ glusterfs3-xdr.c glusterfs3-xdr.h glusterfs4-xdr.c glusterfs4-xdr.h -glusterfs-fops.h -glusterfs-fops.c mount3udp.c mount3udp.h nlm4-xdr.c diff --git a/rpc/xdr/src/Makefile.am b/rpc/xdr/src/Makefile.am index 495b9999236..0e9c377ec93 100644 --- a/rpc/xdr/src/Makefile.am +++ b/rpc/xdr/src/Makefile.am @@ -1,10 +1,19 @@ -XDRGENFILES = glusterfs3-xdr.x glusterfs4-xdr.x cli1-xdr.x nlm4-xdr.x nsm-xdr.x \ - rpc-common-xdr.x glusterd1-xdr.x acl3-xdr.x portmap-xdr.x \ - mount3udp.x changelog-xdr.x glusterfs-fops.x +if BUILD_GNFS + NFS_XDRS = nlm4-xdr.x nsm-xdr.x acl3-xdr.x mount3udp.x + NFS_SRCS = xdr-nfs3.c msg-nfs3.c + NFS_HDRS = xdr-nfs3.h msg-nfs3.h +else + NFS_EXTRA_XDRS = nlm4-xdr.x nsm-xdr.x acl3-xdr.x mount3udp.x +endif + +XDRGENFILES = glusterfs3-xdr.x glusterfs4-xdr.x cli1-xdr.x \ + rpc-common-xdr.x glusterd1-xdr.x changelog-xdr.x \ + portmap-xdr.x ${NFS_XDRS} + XDRHEADERS = $(XDRGENFILES:.x=.h) XDRSOURCES = $(XDRGENFILES:.x=.c) -EXTRA_DIST = $(XDRGENFILES) libgfxdr.sym +EXTRA_DIST = $(XDRGENFILES) libgfxdr.sym ${NFS_EXTRA_XDRS} lib_LTLIBRARIES = libgfxdr.la @@ -19,17 +28,58 @@ libgfxdr_la_LIBADD = $(top_builddir)/libglusterfs/src/libglusterfs.la libgfxdr_la_LDFLAGS = -version-info $(LIBGFXDR_LT_VERSION) $(GF_LDFLAGS) \ -export-symbols $(top_srcdir)/rpc/xdr/src/libgfxdr.sym -libgfxdr_la_SOURCES = xdr-generic.c xdr-nfs3.c msg-nfs3.c +libgfxdr_la_SOURCES = xdr-generic.c ${NFS_SRCS} nodist_libgfxdr_la_SOURCES = $(XDRSOURCES) -libgfxdr_la_HEADERS = xdr-generic.h xdr-nfs3.h msg-nfs3.h glusterfs3.h \ - rpc-pragmas.h +libgfxdr_la_HEADERS = xdr-generic.h glusterfs3.h rpc-pragmas.h ${NFS_HDRS} nodist_libgfxdr_la_HEADERS = $(XDRHEADERS) libgfxdr_ladir = $(includedir)/glusterfs/rpc CLEANFILES = $(XDRSOURCES) $(XDRHEADERS) -# Generate the .c and .h symlinks from the ../gen/*.x files -$(XDRSOURCES) $(XDRHEADERS): - $(MAKE) -C ../gen $^ +# trick automake into doing BUILT_SOURCES magic +BUILT_SOURCES = $(XDRHEADERS) $(XDRSOURCES) + +xdrsrc=$(top_srcdir)/rpc/xdr/src +xdrdst=$(top_builddir)/rpc/xdr/src + +# make's dependency resolution may mean that it decides to run +# rpcgen again (unnecessarily), but as the .c file already exists, +# rpcgen will exit with an error, resulting in a build error. We +# could use a '-' (i.e. -@rpcgen ...) and suffer with noisy warnings +# in the build. Or we do this crufty thing instead. +$(XDRSOURCES): $(XDRGENFILES) + @if [ ! -e $(xdrdst)/$@ -o $(@:.c=.x) -nt $(xdrdst)/$@ ]; then \ + rpcgen -c -o $(xdrdst)/$@ $(@:.c=.x) ;\ + fi + +# d*mn sed in netbsd6 doesn't do -i (inline) +# (why are we still running smoke on netbsd6 and not netbsd7?) +$(XDRHEADERS): $(XDRGENFILES) + @if [ ! -e $(xdrdst)/$@ -o $(@:.h=.x) -nt $(xdrdst)/$@ ]; then \ + rpcgen -h -o $(@:.h=.tmp) $(@:.h=.x) && \ + sed -e '/#ifndef/ s/-/_/g' -e '/#define/ s/-/_/g' \ + -e '/#endif/ s/-/_/' -e 's/TMP_/H_/g' \ + $(@:.h=.tmp) > $(xdrdst)/$@ && \ + rm -f $(@:.h=.tmp) ; \ + fi + + +# link .x files when doing out-of-tree builds +# have to use .PHONY here to force it; all versions of make +# will think the file already exists "here" by virtue of the +# VPATH. And we have to have the .x file in $cwd in order to +# have rpcgen generate "nice" #include directives +# i.e. (nice): +# #include "acl3-xdr.h" +# versus (not nice): +# #include "../../../../foo/src/rpc/xdr/src/acl3-xdr.h" +.PHONY : $(XDRGENFILES) +$(XDRGENFILES): + @if [ ! -e $@ ]; then ln -s $(xdrsrc)/$@ . ; fi; + +clean-local: + @if [ $(top_builddir) != $(top_srcdir) ]; then \ + rm -f $(xdrdst)/*.x; \ + fi diff --git a/rpc/xdr/src/cli1-xdr.x b/rpc/xdr/src/cli1-xdr.x index a32c8645708..777cb0046a2 100644 --- a/rpc/xdr/src/cli1-xdr.x +++ b/rpc/xdr/src/cli1-xdr.x @@ -68,6 +68,7 @@ enum gf_bitrot_type { GF_BITROT_OPTION_TYPE_EXPIRY_TIME, GF_BITROT_CMD_SCRUB_STATUS, GF_BITROT_CMD_SCRUB_ONDEMAND, + GF_BITROT_OPTION_TYPE_SIGNER_THREADS, GF_BITROT_OPTION_TYPE_MAX }; diff --git a/rpc/xdr/src/glusterd1-xdr.x b/rpc/xdr/src/glusterd1-xdr.x index 02ebec26c01..b631dea3502 100644 --- a/rpc/xdr/src/glusterd1-xdr.x +++ b/rpc/xdr/src/glusterd1-xdr.x @@ -202,6 +202,21 @@ struct gd1_mgmt_v3_commit_rsp { string op_errstr<>; } ; +struct gd1_mgmt_v3_post_commit_req { + unsigned char uuid[16]; + int op; + opaque dict<>; +} ; + +struct gd1_mgmt_v3_post_commit_rsp { + unsigned char uuid[16]; + int op; + int op_ret; + int op_errno; + opaque dict<>; + string op_errstr<>; +} ; + struct gd1_mgmt_v3_post_val_req { unsigned char uuid[16]; int op; diff --git a/rpc/xdr/src/glusterfs-fops.x b/rpc/xdr/src/glusterfs-fops.x deleted file mode 100644 index 651f8def0ba..00000000000 --- a/rpc/xdr/src/glusterfs-fops.x +++ /dev/null @@ -1,250 +0,0 @@ -/* - * Copyright (c) 2016 Red Hat, Inc. <http://www.redhat.com> - * This file is part of GlusterFS. - * - * This file is licensed to you under your choice of the GNU Lesser - * General Public License, version 3 or any later version (LGPLv3 or - * later), or the GNU General Public License, version 2 (GPLv2), in all - * cases as published by the Free Software Foundation. - */ - -#ifdef RPC_XDR -%#include "rpc-pragmas.h" -#endif -%#include <glusterfs/compat.h> - -/* NOTE: add members ONLY at the end (just before _MAXVALUE) */ -/* - * OTHER NOTE: fop_enum_to_str and fop_enum_to_pri_str (in common-utils.h) also - * contain lists of fops, so if you update this list UPDATE THOSE TOO. - */ -enum glusterfs_fop_t { - GF_FOP_NULL = 0, - GF_FOP_STAT, - GF_FOP_READLINK, - GF_FOP_MKNOD, - GF_FOP_MKDIR, - GF_FOP_UNLINK, - GF_FOP_RMDIR, - GF_FOP_SYMLINK, - GF_FOP_RENAME, - GF_FOP_LINK, - GF_FOP_TRUNCATE, - GF_FOP_OPEN, - GF_FOP_READ, - GF_FOP_WRITE, - GF_FOP_STATFS, - GF_FOP_FLUSH, - GF_FOP_FSYNC, /* 16 */ - GF_FOP_SETXATTR, - GF_FOP_GETXATTR, - GF_FOP_REMOVEXATTR, - GF_FOP_OPENDIR, - GF_FOP_FSYNCDIR, - GF_FOP_ACCESS, - GF_FOP_CREATE, - GF_FOP_FTRUNCATE, - GF_FOP_FSTAT, /* 25 */ - GF_FOP_LK, - GF_FOP_LOOKUP, - GF_FOP_READDIR, - GF_FOP_INODELK, - GF_FOP_FINODELK, - GF_FOP_ENTRYLK, - GF_FOP_FENTRYLK, - GF_FOP_XATTROP, - GF_FOP_FXATTROP, - GF_FOP_FGETXATTR, - 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_FREMOVEXATTR, - GF_FOP_FALLOCATE, - GF_FOP_DISCARD, - GF_FOP_ZEROFILL, - GF_FOP_IPC, - GF_FOP_SEEK, - GF_FOP_LEASE, - GF_FOP_COMPOUND, - GF_FOP_GETACTIVELK, - GF_FOP_SETACTIVELK, - GF_FOP_PUT, - GF_FOP_ICREATE, - GF_FOP_NAMELINK, - GF_FOP_COPY_FILE_RANGE, - GF_FOP_MAXVALUE -}; - -/* Note: Removed event GF_EVENT_CHILD_MODIFIED=8, hence - *to preserve backward compatibiliy, GF_EVENT_CLEANUP = 9 - */ -enum glusterfs_event_t { - GF_EVENT_PARENT_UP = 1, - GF_EVENT_POLLIN, - GF_EVENT_POLLOUT, - GF_EVENT_POLLERR, - GF_EVENT_CHILD_UP, - GF_EVENT_CHILD_DOWN, - GF_EVENT_CHILD_CONNECTING, - GF_EVENT_CLEANUP = 9, - GF_EVENT_TRANSPORT_CONNECTED, - GF_EVENT_VOLFILE_MODIFIED, - GF_EVENT_GRAPH_NEW, - GF_EVENT_TRANSLATOR_INFO, - GF_EVENT_TRANSLATOR_OP, - GF_EVENT_AUTH_FAILED, - GF_EVENT_VOLUME_DEFRAG, - GF_EVENT_PARENT_DOWN, - GF_EVENT_VOLUME_BARRIER_OP, - GF_EVENT_UPCALL, - GF_EVENT_SCRUB_STATUS, - GF_EVENT_SOME_DESCENDENT_DOWN, - GF_EVENT_SCRUB_ONDEMAND, - GF_EVENT_SOME_DESCENDENT_UP, - GF_EVENT_CHILD_PING, - GF_EVENT_MAXVAL -}; - -/* List of compound fops. Add fops at the end. */ -enum glusterfs_compound_fop_t { - GF_CFOP_NON_PREDEFINED = 0, /* needs single FOP inspection */ - GF_CFOP_XATTROP_WRITEV, - GF_CFOP_XATTROP_UNLOCK, - GF_CFOP_PUT, /* create+write+setxattr+fsync+close+rename */ - GF_CFOP_MAXVALUE -}; - -enum glusterfs_mgmt_t { - GF_MGMT_NULL = 0, - GF_MGMT_MAXVALUE -}; - -enum gf_op_type_t { - GF_OP_TYPE_NULL = 0, - GF_OP_TYPE_FOP, - GF_OP_TYPE_MGMT, - GF_OP_TYPE_MAX -}; - -/* NOTE: all the miscellaneous flags used by GlusterFS should be listed here */ -enum glusterfs_lk_cmds_t { - GF_LK_GETLK = 0, - GF_LK_SETLK, - GF_LK_SETLKW, - GF_LK_RESLK_LCK, - GF_LK_RESLK_LCKW, - GF_LK_RESLK_UNLCK, - GF_LK_GETLK_FD -}; - -enum glusterfs_lk_types_t { - GF_LK_F_RDLCK = 0, - GF_LK_F_WRLCK, - GF_LK_F_UNLCK, - GF_LK_EOL -}; - -/* Lease Types */ -enum gf_lease_types_t { - NONE = 0, - GF_RD_LEASE = 1, - GF_RW_LEASE = 2, - GF_LEASE_MAX_TYPE -}; - -/* Lease cmds */ -enum gf_lease_cmds_t { - GF_GET_LEASE = 1, - GF_SET_LEASE = 2, - GF_UNLK_LEASE = 3 -}; - -%#define LEASE_ID_SIZE 16 /* 128bits */ -struct gf_lease { - gf_lease_cmds_t cmd; - gf_lease_types_t lease_type; - char lease_id[LEASE_ID_SIZE]; - unsigned int lease_flags; -}; - -enum glusterfs_lk_recovery_cmds_t { - F_RESLK_LCK = 200, - F_RESLK_LCKW, - F_RESLK_UNLCK, - F_GETLK_FD -}; - -enum gf_lk_domain_t { - GF_LOCK_POSIX, - GF_LOCK_INTERNAL -}; - -enum entrylk_cmd { - ENTRYLK_LOCK, - ENTRYLK_UNLOCK, - ENTRYLK_LOCK_NB -}; - -enum entrylk_type { - ENTRYLK_RDLCK, - ENTRYLK_WRLCK -}; - -%#define GF_MAX_LOCK_OWNER_LEN 1024 /* 1kB as per NLM */ - -/* 16strings-16strings-... */ -%#define GF_LKOWNER_BUF_SIZE ((GF_MAX_LOCK_OWNER_LEN * 2) + (GF_MAX_LOCK_OWNER_LEN / 8)) - -struct gf_lkowner_t { - int len; - char data[GF_MAX_LOCK_OWNER_LEN]; -}; - -enum gf_xattrop_flags_t { - GF_XATTROP_ADD_ARRAY, - GF_XATTROP_ADD_ARRAY64, - GF_XATTROP_OR_ARRAY, - GF_XATTROP_AND_ARRAY, - GF_XATTROP_GET_AND_SET, - GF_XATTROP_ADD_ARRAY_WITH_DEFAULT, - GF_XATTROP_ADD_ARRAY64_WITH_DEFAULT -}; - -enum gf_seek_what_t { - GF_SEEK_DATA, - GF_SEEK_HOLE -}; - -enum gf_upcall_flags_t { - GF_UPCALL_NULL, - GF_UPCALL, - GF_UPCALL_CI_STAT, - GF_UPCALL_CI_XATTR, - GF_UPCALL_CI_RENAME, - GF_UPCALL_CI_NLINK, - GF_UPCALL_CI_FORGET, - GF_UPCALL_LEASE_RECALL, - GF_UPCALL_FLAGS_MAXVALUE -}; - -enum gf_dict_data_type_t { - GF_DATA_TYPE_UNKNOWN, - GF_DATA_TYPE_STR_OLD, /* Will be set by volgen and dict-serialize - and unserialize. Used to reduce warnings - if one is using old protocol */ - GF_DATA_TYPE_INT, - GF_DATA_TYPE_UINT, - GF_DATA_TYPE_DOUBLE, - GF_DATA_TYPE_STR, - GF_DATA_TYPE_PTR, - GF_DATA_TYPE_GFUUID, - GF_DATA_TYPE_IATT, - GF_DATA_TYPE_MDATA, - GF_DATA_TYPE_MAX -}; diff --git a/rpc/xdr/src/glusterfs3-xdr.x b/rpc/xdr/src/glusterfs3-xdr.x index 9db0a311159..1c99099a721 100644 --- a/rpc/xdr/src/glusterfs3-xdr.x +++ b/rpc/xdr/src/glusterfs3-xdr.x @@ -11,9 +11,8 @@ #ifdef RPC_XDR %#include "rpc-pragmas.h" #endif -%#include <glusterfs/compat.h> +%#include <glusterfs/glusterfs-fops.h> %#include "rpc-common-xdr.h" -%#include "glusterfs-fops.h" #define GF_REQUEST_MAXGROUPS 16 struct gf_statfs { diff --git a/rpc/xdr/src/glusterfs4-xdr.x b/rpc/xdr/src/glusterfs4-xdr.x index 30597850e23..d3b1d0dfaf0 100644 --- a/rpc/xdr/src/glusterfs4-xdr.x +++ b/rpc/xdr/src/glusterfs4-xdr.x @@ -11,11 +11,9 @@ #ifdef RPC_XDR %#include "rpc-pragmas.h" #endif -%#include <glusterfs/compat.h> -%#include "glusterfs-fops.h" +%#include <glusterfs/glusterfs-fops.h> %#include "glusterfs3-xdr.h" - /* Need to consume iattx and new dict in all the fops */ struct gfx_iattx { opaque ia_gfid[16]; @@ -56,7 +54,7 @@ struct gfx_mdata_iatt { unsigned int ia_ctime_nsec; }; -union gfx_value switch (gf_dict_data_type_t type) { +union gfx_value switch (int type) { case GF_DATA_TYPE_INT: hyper value_int; case GF_DATA_TYPE_UINT: diff --git a/rpc/xdr/src/libgfxdr.sym b/rpc/xdr/src/libgfxdr.sym index dd4ac8562bc..8fa0e0ddd8a 100644 --- a/rpc/xdr/src/libgfxdr.sym +++ b/rpc/xdr/src/libgfxdr.sym @@ -28,6 +28,8 @@ xdr_gd1_mgmt_v3_brick_op_req xdr_gd1_mgmt_v3_brick_op_rsp xdr_gd1_mgmt_v3_commit_req xdr_gd1_mgmt_v3_commit_rsp +xdr_gd1_mgmt_v3_post_commit_req +xdr_gd1_mgmt_v3_post_commit_rsp xdr_gd1_mgmt_v3_lock_req xdr_gd1_mgmt_v3_lock_rsp xdr_gd1_mgmt_v3_post_val_req diff --git a/rpc/xdr/src/rpc-common-xdr.x b/rpc/xdr/src/rpc-common-xdr.x index 760d1e0aedc..baf8b4313c8 100644 --- a/rpc/xdr/src/rpc-common-xdr.x +++ b/rpc/xdr/src/rpc-common-xdr.x @@ -11,13 +11,12 @@ #ifdef RPC_XDR %#include "rpc-pragmas.h" #endif -%#include <glusterfs/compat.h> +%#include <glusterfs/glusterfs-fops.h> /* This file has definition of few XDR structures which are * not captured in any section specific file */ %#include "xdr-common.h" -%#include "glusterfs-fops.h" struct auth_glusterfs_parms_v2 { int pid; |
