diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | libglusterfs/src/Makefile.am | 2 | ||||
-rw-r--r-- | libglusterfs/src/glusterfs/glusterfs-fops.h | 240 | ||||
-rw-r--r-- | libglusterfs/src/glusterfs/glusterfs.h | 16 | ||||
-rw-r--r-- | libglusterfs/src/glusterfs/lkowner.h | 2 | ||||
-rw-r--r-- | libglusterfs/src/glusterfs/xlator.h | 12 | ||||
-rw-r--r-- | libglusterfs/src/graph.c | 2 | ||||
-rw-r--r-- | rpc/xdr/gen/Makefile.am | 2 | ||||
-rw-r--r-- | rpc/xdr/src/.gitignore | 2 | ||||
-rw-r--r-- | rpc/xdr/src/Makefile.am | 2 | ||||
-rw-r--r-- | rpc/xdr/src/glusterfs-fops.x | 249 | ||||
-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/rpc-common-xdr.x | 3 | ||||
-rw-r--r-- | xlators/features/utime/src/utime-helpers.h | 1 |
15 files changed, 256 insertions, 287 deletions
diff --git a/.gitignore b/.gitignore index 8e05080c947..e9e35b6809e 100644 --- a/.gitignore +++ b/.gitignore @@ -91,7 +91,6 @@ libglusterfs/src/graph.lex.c libglusterfs/src/y.tab.c libglusterfs/src/y.tab.h libglusterfs/src/defaults.c -libglusterfs/src/glusterfs-fops.h libglusterfs/src/cli1-xdr.h libglusterfs/src/protocol-common.h libtool diff --git a/libglusterfs/src/Makefile.am b/libglusterfs/src/Makefile.am index 79ab7ee93f2..12fdc8e64b0 100644 --- a/libglusterfs/src/Makefile.am +++ b/libglusterfs/src/Makefile.am @@ -69,7 +69,7 @@ libglusterfs_la_HEADERS = glusterfs/common-utils.h glusterfs/defaults.h \ glusterfs/quota-common-utils.h glusterfs/rot-buffs.h \ glusterfs/compat-uuid.h glusterfs/upcall-utils.h glusterfs/throttle-tbf.h \ glusterfs/events.h glusterfs/atomic.h glusterfs/monitoring.h \ - glusterfs/async.h + glusterfs/async.h glusterfs/glusterfs-fops.h libglusterfs_ladir = $(includedir)/glusterfs diff --git a/libglusterfs/src/glusterfs/glusterfs-fops.h b/libglusterfs/src/glusterfs/glusterfs-fops.h new file mode 100644 index 00000000000..d295a67f850 --- /dev/null +++ b/libglusterfs/src/glusterfs/glusterfs-fops.h @@ -0,0 +1,240 @@ +/* + Copyright (c) 2008-2019 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. +*/ + +#ifndef _GLUSTERFS_FOPS_H_ +#define _GLUSTERFS_FOPS_H_ + +#include <glusterfs/compat.h> + +enum glusterfs_fop_t { + GF_FOP_NULL = 0, + GF_FOP_STAT = 0 + 1, + GF_FOP_READLINK = 0 + 2, + GF_FOP_MKNOD = 0 + 3, + GF_FOP_MKDIR = 0 + 4, + GF_FOP_UNLINK = 0 + 5, + GF_FOP_RMDIR = 0 + 6, + GF_FOP_SYMLINK = 0 + 7, + GF_FOP_RENAME = 0 + 8, + GF_FOP_LINK = 0 + 9, + GF_FOP_TRUNCATE = 0 + 10, + GF_FOP_OPEN = 0 + 11, + GF_FOP_READ = 0 + 12, + GF_FOP_WRITE = 0 + 13, + GF_FOP_STATFS = 0 + 14, + GF_FOP_FLUSH = 0 + 15, + GF_FOP_FSYNC = 0 + 16, + GF_FOP_SETXATTR = 0 + 17, + GF_FOP_GETXATTR = 0 + 18, + GF_FOP_REMOVEXATTR = 0 + 19, + GF_FOP_OPENDIR = 0 + 20, + GF_FOP_FSYNCDIR = 0 + 21, + GF_FOP_ACCESS = 0 + 22, + GF_FOP_CREATE = 0 + 23, + GF_FOP_FTRUNCATE = 0 + 24, + GF_FOP_FSTAT = 0 + 25, + GF_FOP_LK = 0 + 26, + GF_FOP_LOOKUP = 0 + 27, + GF_FOP_READDIR = 0 + 28, + GF_FOP_INODELK = 0 + 29, + GF_FOP_FINODELK = 0 + 30, + GF_FOP_ENTRYLK = 0 + 31, + GF_FOP_FENTRYLK = 0 + 32, + GF_FOP_XATTROP = 0 + 33, + GF_FOP_FXATTROP = 0 + 34, + GF_FOP_FGETXATTR = 0 + 35, + GF_FOP_FSETXATTR = 0 + 36, + GF_FOP_RCHECKSUM = 0 + 37, + GF_FOP_SETATTR = 0 + 38, + GF_FOP_FSETATTR = 0 + 39, + GF_FOP_READDIRP = 0 + 40, + GF_FOP_FORGET = 0 + 41, + GF_FOP_RELEASE = 0 + 42, + GF_FOP_RELEASEDIR = 0 + 43, + GF_FOP_GETSPEC = 0 + 44, + GF_FOP_FREMOVEXATTR = 0 + 45, + GF_FOP_FALLOCATE = 0 + 46, + GF_FOP_DISCARD = 0 + 47, + GF_FOP_ZEROFILL = 0 + 48, + GF_FOP_IPC = 0 + 49, + GF_FOP_SEEK = 0 + 50, + GF_FOP_LEASE = 0 + 51, + GF_FOP_COMPOUND = 0 + 52, + GF_FOP_GETACTIVELK = 0 + 53, + GF_FOP_SETACTIVELK = 0 + 54, + GF_FOP_PUT = 0 + 55, + GF_FOP_ICREATE = 0 + 56, + GF_FOP_NAMELINK = 0 + 57, + GF_FOP_COPY_FILE_RANGE = 0 + 58, + GF_FOP_MAXVALUE = 0 + 59, +}; +typedef enum glusterfs_fop_t glusterfs_fop_t; + +enum glusterfs_event_t { + GF_EVENT_PARENT_UP = 1, + GF_EVENT_POLLIN = 1 + 1, + GF_EVENT_POLLOUT = 1 + 2, + GF_EVENT_POLLERR = 1 + 3, + GF_EVENT_CHILD_UP = 1 + 4, + GF_EVENT_CHILD_DOWN = 1 + 5, + GF_EVENT_CHILD_CONNECTING = 1 + 6, + GF_EVENT_CLEANUP = 9, + GF_EVENT_TRANSPORT_CONNECTED = 9 + 1, + GF_EVENT_VOLFILE_MODIFIED = 9 + 2, + GF_EVENT_GRAPH_NEW = 9 + 3, + GF_EVENT_TRANSLATOR_INFO = 9 + 4, + GF_EVENT_TRANSLATOR_OP = 9 + 5, + GF_EVENT_AUTH_FAILED = 9 + 6, + GF_EVENT_VOLUME_DEFRAG = 9 + 7, + GF_EVENT_PARENT_DOWN = 9 + 8, + GF_EVENT_VOLUME_BARRIER_OP = 9 + 9, + GF_EVENT_UPCALL = 9 + 10, + GF_EVENT_SCRUB_STATUS = 9 + 11, + GF_EVENT_SOME_DESCENDENT_DOWN = 9 + 12, + GF_EVENT_SCRUB_ONDEMAND = 9 + 13, + GF_EVENT_SOME_DESCENDENT_UP = 9 + 14, + GF_EVENT_CHILD_PING = 9 + 15, + GF_EVENT_MAXVAL = 9 + 16, +}; +typedef enum glusterfs_event_t glusterfs_event_t; + +enum gf_op_type_t { + GF_OP_TYPE_NULL = 0, + GF_OP_TYPE_FOP = 0 + 1, + GF_OP_TYPE_MGMT = 0 + 2, + GF_OP_TYPE_MAX = 0 + 3, +}; +typedef enum gf_op_type_t gf_op_type_t; + +enum glusterfs_lk_cmds_t { + GF_LK_GETLK = 0, + GF_LK_SETLK = 0 + 1, + GF_LK_SETLKW = 0 + 2, + GF_LK_RESLK_LCK = 0 + 3, + GF_LK_RESLK_LCKW = 0 + 4, + GF_LK_RESLK_UNLCK = 0 + 5, + GF_LK_GETLK_FD = 0 + 6, +}; +typedef enum glusterfs_lk_cmds_t glusterfs_lk_cmds_t; + +enum glusterfs_lk_types_t { + GF_LK_F_RDLCK = 0, + GF_LK_F_WRLCK = 0 + 1, + GF_LK_F_UNLCK = 0 + 2, + GF_LK_EOL = 0 + 3, +}; +typedef enum glusterfs_lk_types_t glusterfs_lk_types_t; + +enum gf_lease_types_t { + NONE = 0, + GF_RD_LEASE = 1, + GF_RW_LEASE = 2, + GF_LEASE_MAX_TYPE = 2 + 1, +}; +typedef enum gf_lease_types_t gf_lease_types_t; + +enum gf_lease_cmds_t { + GF_GET_LEASE = 1, + GF_SET_LEASE = 2, + GF_UNLK_LEASE = 3, +}; +typedef enum gf_lease_cmds_t gf_lease_cmds_t; + +#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]; + u_int lease_flags; +}; +typedef struct gf_lease gf_lease; + +enum glusterfs_lk_recovery_cmds_t { + F_RESLK_LCK = 200, + F_RESLK_LCKW = 200 + 1, + F_RESLK_UNLCK = 200 + 2, + F_GETLK_FD = 200 + 3, +}; +typedef enum glusterfs_lk_recovery_cmds_t glusterfs_lk_recovery_cmds_t; + +enum gf_lk_domain_t { + GF_LOCK_POSIX = 0, + GF_LOCK_INTERNAL = 1, +}; +typedef enum gf_lk_domain_t gf_lk_domain_t; + +enum entrylk_cmd { + ENTRYLK_LOCK = 0, + ENTRYLK_UNLOCK = 1, + ENTRYLK_LOCK_NB = 2, +}; +typedef enum entrylk_cmd entrylk_cmd; + +enum entrylk_type { + ENTRYLK_RDLCK = 0, + ENTRYLK_WRLCK = 1, +}; +typedef enum entrylk_type entrylk_type; +#define GF_MAX_LOCK_OWNER_LEN 1024 /* 1kB as per NLM */ +#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]; +}; +typedef struct gf_lkowner_t gf_lkowner_t; + +enum gf_xattrop_flags_t { + GF_XATTROP_ADD_ARRAY = 0, + GF_XATTROP_ADD_ARRAY64 = 1, + GF_XATTROP_OR_ARRAY = 2, + GF_XATTROP_AND_ARRAY = 3, + GF_XATTROP_GET_AND_SET = 4, + GF_XATTROP_ADD_ARRAY_WITH_DEFAULT = 5, + GF_XATTROP_ADD_ARRAY64_WITH_DEFAULT = 6, +}; +typedef enum gf_xattrop_flags_t gf_xattrop_flags_t; + +enum gf_seek_what_t { + GF_SEEK_DATA = 0, + GF_SEEK_HOLE = 1, +}; +typedef enum gf_seek_what_t gf_seek_what_t; + +enum gf_upcall_flags_t { + GF_UPCALL_NULL = 0, + GF_UPCALL = 1, + GF_UPCALL_CI_STAT = 2, + GF_UPCALL_CI_XATTR = 3, + GF_UPCALL_CI_RENAME = 4, + GF_UPCALL_CI_NLINK = 5, + GF_UPCALL_CI_FORGET = 6, + GF_UPCALL_LEASE_RECALL = 7, + GF_UPCALL_FLAGS_MAXVALUE = 8, +}; +typedef enum gf_upcall_flags_t gf_upcall_flags_t; + +enum gf_dict_data_type_t { + GF_DATA_TYPE_UNKNOWN = 0, + GF_DATA_TYPE_STR_OLD = 1, + GF_DATA_TYPE_INT = 2, + GF_DATA_TYPE_UINT = 3, + GF_DATA_TYPE_DOUBLE = 4, + GF_DATA_TYPE_STR = 5, + GF_DATA_TYPE_PTR = 6, + GF_DATA_TYPE_GFUUID = 7, + GF_DATA_TYPE_IATT = 8, + GF_DATA_TYPE_MAX = 9, +}; +typedef enum gf_dict_data_type_t gf_dict_data_type_t; + +#endif /* !_GLUSTERFS_FOPS_H */ diff --git a/libglusterfs/src/glusterfs/glusterfs.h b/libglusterfs/src/glusterfs/glusterfs.h index 930d83cdfe6..a7da473781b 100644 --- a/libglusterfs/src/glusterfs/glusterfs.h +++ b/libglusterfs/src/glusterfs/glusterfs.h @@ -31,21 +31,7 @@ #include <limits.h> /* For PATH_MAX */ #include <openssl/sha.h> -#include "glusterfs-fops.h" /* generated XDR values for FOPs */ - -#ifndef IXDR_GET_LONG -#define IXDR_GET_LONG(buf) ((long)IXDR_GET_U_INT32(buf)) -#endif -#ifndef IXDR_PUT_LONG -#define IXDR_PUT_LONG(buf, v) ((long)IXDR_PUT_INT32(buf, (long)(v))) -#endif -#ifndef IXDR_GET_U_LONG -#define IXDR_GET_U_LONG(buf) ((u_long)IXDR_GET_LONG(buf)) -#endif -#ifndef IXDR_PUT_U_LONG -#define IXDR_PUT_U_LONG(buf, v) IXDR_PUT_LONG(buf, (long)(v)) -#endif - +#include "glusterfs/glusterfs-fops.h" #include "glusterfs/list.h" #include "glusterfs/locking.h" #include "glusterfs/logging.h" diff --git a/libglusterfs/src/glusterfs/lkowner.h b/libglusterfs/src/glusterfs/lkowner.h index b49e9af6bcb..692de34bc7a 100644 --- a/libglusterfs/src/glusterfs/lkowner.h +++ b/libglusterfs/src/glusterfs/lkowner.h @@ -11,7 +11,7 @@ #ifndef _LK_OWNER_H #define _LK_OWNER_H -#include "glusterfs-fops.h" +#include "glusterfs/glusterfs-fops.h" /* LKOWNER to string functions */ static inline void diff --git a/libglusterfs/src/glusterfs/xlator.h b/libglusterfs/src/glusterfs/xlator.h index 42cbdc1ac93..cdf9d4e8a5d 100644 --- a/libglusterfs/src/glusterfs/xlator.h +++ b/libglusterfs/src/glusterfs/xlator.h @@ -11,12 +11,12 @@ #ifndef _XLATOR_H #define _XLATOR_H -#include <stdint.h> // for int32_t -#include <sys/types.h> // for off_t, mode_t, off64_t, dev_t -#include "glusterfs-fops.h" // for GF_FOP_MAXVALUE, entrylk_cmd -#include "glusterfs/atomic.h" // for gf_atomic_t -#include "glusterfs/glusterfs.h" // for gf_boolean_t, glusterfs_ctx_t -#include "glusterfs/compat-uuid.h" // for uuid_t +#include <stdint.h> // for int32_t +#include <sys/types.h> // for off_t, mode_t, off64_t, dev_t +#include "glusterfs/glusterfs-fops.h" // for GF_FOP_MAXVALUE, entrylk_cmd +#include "glusterfs/atomic.h" // for gf_atomic_t +#include "glusterfs/glusterfs.h" // for gf_boolean_t, glusterfs_ctx_t +#include "glusterfs/compat-uuid.h" // for uuid_t #include "glusterfs/compat.h" #include "glusterfs/event-history.h" #include "glusterfs/dict.h" diff --git a/libglusterfs/src/graph.c b/libglusterfs/src/graph.c index 0b99e618191..42ffb7a8c9b 100644 --- a/libglusterfs/src/graph.c +++ b/libglusterfs/src/graph.c @@ -21,12 +21,12 @@ #include <sys/stat.h> // for stat #include <sys/time.h> // for gettimeofday #include <unistd.h> // for gethostname, getpid -#include "glusterfs-fops.h" // for GF_EVENT_GRAPH_NEW, GF_... #include "glusterfs/common-utils.h" // for gf_strncpy, gf_time_fmt #include "glusterfs/defaults.h" #include "glusterfs/dict.h" // for dict_foreach, dict_set_... #include "glusterfs/globals.h" // for xlator_t, xlator_list_t #include "glusterfs/glusterfs.h" // for glusterfs_graph_t, glus... +#include "glusterfs/glusterfs-fops.h" // for GF_EVENT_GRAPH_NEW, GF_... #include "glusterfs/libglusterfs-messages.h" // for LG_MSG_GRAPH_ERROR, LG_... #include "glusterfs/list.h" // for list_add, list_del_init #include "glusterfs/logging.h" // for gf_msg, GF_LOG_ERROR diff --git a/rpc/xdr/gen/Makefile.am b/rpc/xdr/gen/Makefile.am index df379b80130..194718f9bba 100644 --- a/rpc/xdr/gen/Makefile.am +++ b/rpc/xdr/gen/Makefile.am @@ -1,6 +1,6 @@ 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 + mount3udp.x changelog-xdr.x XDRHEADERS = $(XDRGENFILES:.x=.h) XDRSOURCES = $(XDRGENFILES:.x=.c) 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..fe6b0181cd5 100644 --- a/rpc/xdr/src/Makefile.am +++ b/rpc/xdr/src/Makefile.am @@ -1,6 +1,6 @@ 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 + mount3udp.x changelog-xdr.x XDRHEADERS = $(XDRGENFILES:.x=.h) XDRSOURCES = $(XDRGENFILES:.x=.c) diff --git a/rpc/xdr/src/glusterfs-fops.x b/rpc/xdr/src/glusterfs-fops.x deleted file mode 100644 index bacf07735f4..00000000000 --- a/rpc/xdr/src/glusterfs-fops.x +++ /dev/null @@ -1,249 +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_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 6d13aafc9eb..8aca1f64763 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]; @@ -46,7 +44,7 @@ struct gfx_iattx { unsigned int mode; /* type of file and rwx mode */ }; -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/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; diff --git a/xlators/features/utime/src/utime-helpers.h b/xlators/features/utime/src/utime-helpers.h index f2dfeed3a41..2e32d4bece6 100644 --- a/xlators/features/utime/src/utime-helpers.h +++ b/xlators/features/utime/src/utime-helpers.h @@ -11,7 +11,6 @@ #ifndef _UTIME_HELPERS_H #define _UTIME_HELPERS_H -#include "glusterfs-fops.h" #include <glusterfs/stack.h> #include <glusterfs/xlator.h> #include <glusterfs/timespec.h> |