"Fossies" - the Fresh Open Source Software Archive

Member "glusterfs-8.2/libglusterfs/src/glusterfs/glusterfs-fops.h" (16 Sep 2020, 6397 Bytes) of package /linux/misc/glusterfs-8.2.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "glusterfs-fops.h" see the Fossies "Dox" file reference documentation.

    1 /*
    2   Copyright (c) 2008-2019 Red Hat, Inc. <http://www.redhat.com>
    3   This file is part of GlusterFS.
    4 
    5   This file is licensed to you under your choice of the GNU Lesser
    6   General Public License, version 3 or any later version (LGPLv3 or
    7   later), or the GNU General Public License, version 2 (GPLv2), in all
    8   cases as published by the Free Software Foundation.
    9 */
   10 
   11 #ifndef _GLUSTERFS_FOPS_H_
   12 #define _GLUSTERFS_FOPS_H_
   13 
   14 #include <glusterfs/compat.h>
   15 
   16 enum glusterfs_fop_t {
   17     GF_FOP_NULL = 0,
   18     GF_FOP_STAT = 0 + 1,
   19     GF_FOP_READLINK = 0 + 2,
   20     GF_FOP_MKNOD = 0 + 3,
   21     GF_FOP_MKDIR = 0 + 4,
   22     GF_FOP_UNLINK = 0 + 5,
   23     GF_FOP_RMDIR = 0 + 6,
   24     GF_FOP_SYMLINK = 0 + 7,
   25     GF_FOP_RENAME = 0 + 8,
   26     GF_FOP_LINK = 0 + 9,
   27     GF_FOP_TRUNCATE = 0 + 10,
   28     GF_FOP_OPEN = 0 + 11,
   29     GF_FOP_READ = 0 + 12,
   30     GF_FOP_WRITE = 0 + 13,
   31     GF_FOP_STATFS = 0 + 14,
   32     GF_FOP_FLUSH = 0 + 15,
   33     GF_FOP_FSYNC = 0 + 16,
   34     GF_FOP_SETXATTR = 0 + 17,
   35     GF_FOP_GETXATTR = 0 + 18,
   36     GF_FOP_REMOVEXATTR = 0 + 19,
   37     GF_FOP_OPENDIR = 0 + 20,
   38     GF_FOP_FSYNCDIR = 0 + 21,
   39     GF_FOP_ACCESS = 0 + 22,
   40     GF_FOP_CREATE = 0 + 23,
   41     GF_FOP_FTRUNCATE = 0 + 24,
   42     GF_FOP_FSTAT = 0 + 25,
   43     GF_FOP_LK = 0 + 26,
   44     GF_FOP_LOOKUP = 0 + 27,
   45     GF_FOP_READDIR = 0 + 28,
   46     GF_FOP_INODELK = 0 + 29,
   47     GF_FOP_FINODELK = 0 + 30,
   48     GF_FOP_ENTRYLK = 0 + 31,
   49     GF_FOP_FENTRYLK = 0 + 32,
   50     GF_FOP_XATTROP = 0 + 33,
   51     GF_FOP_FXATTROP = 0 + 34,
   52     GF_FOP_FGETXATTR = 0 + 35,
   53     GF_FOP_FSETXATTR = 0 + 36,
   54     GF_FOP_RCHECKSUM = 0 + 37,
   55     GF_FOP_SETATTR = 0 + 38,
   56     GF_FOP_FSETATTR = 0 + 39,
   57     GF_FOP_READDIRP = 0 + 40,
   58     GF_FOP_FORGET = 0 + 41,
   59     GF_FOP_RELEASE = 0 + 42,
   60     GF_FOP_RELEASEDIR = 0 + 43,
   61     GF_FOP_GETSPEC = 0 + 44,
   62     GF_FOP_FREMOVEXATTR = 0 + 45,
   63     GF_FOP_FALLOCATE = 0 + 46,
   64     GF_FOP_DISCARD = 0 + 47,
   65     GF_FOP_ZEROFILL = 0 + 48,
   66     GF_FOP_IPC = 0 + 49,
   67     GF_FOP_SEEK = 0 + 50,
   68     GF_FOP_LEASE = 0 + 51,
   69     GF_FOP_COMPOUND = 0 + 52,
   70     GF_FOP_GETACTIVELK = 0 + 53,
   71     GF_FOP_SETACTIVELK = 0 + 54,
   72     GF_FOP_PUT = 0 + 55,
   73     GF_FOP_ICREATE = 0 + 56,
   74     GF_FOP_NAMELINK = 0 + 57,
   75     GF_FOP_COPY_FILE_RANGE = 0 + 58,
   76     GF_FOP_MAXVALUE = 0 + 59,
   77 };
   78 typedef enum glusterfs_fop_t glusterfs_fop_t;
   79 
   80 enum glusterfs_event_t {
   81     GF_EVENT_PARENT_UP = 1,
   82     GF_EVENT_POLLIN = 1 + 1,
   83     GF_EVENT_POLLOUT = 1 + 2,
   84     GF_EVENT_POLLERR = 1 + 3,
   85     GF_EVENT_CHILD_UP = 1 + 4,
   86     GF_EVENT_CHILD_DOWN = 1 + 5,
   87     GF_EVENT_CHILD_CONNECTING = 1 + 6,
   88     GF_EVENT_CLEANUP = 9,
   89     GF_EVENT_TRANSPORT_CONNECTED = 9 + 1,
   90     GF_EVENT_VOLFILE_MODIFIED = 9 + 2,
   91     GF_EVENT_GRAPH_NEW = 9 + 3,
   92     GF_EVENT_TRANSLATOR_INFO = 9 + 4,
   93     GF_EVENT_TRANSLATOR_OP = 9 + 5,
   94     GF_EVENT_AUTH_FAILED = 9 + 6,
   95     GF_EVENT_VOLUME_DEFRAG = 9 + 7,
   96     GF_EVENT_PARENT_DOWN = 9 + 8,
   97     GF_EVENT_VOLUME_BARRIER_OP = 9 + 9,
   98     GF_EVENT_UPCALL = 9 + 10,
   99     GF_EVENT_SCRUB_STATUS = 9 + 11,
  100     GF_EVENT_SOME_DESCENDENT_DOWN = 9 + 12,
  101     GF_EVENT_SCRUB_ONDEMAND = 9 + 13,
  102     GF_EVENT_SOME_DESCENDENT_UP = 9 + 14,
  103     GF_EVENT_CHILD_PING = 9 + 15,
  104     GF_EVENT_MAXVAL = 9 + 16,
  105 };
  106 typedef enum glusterfs_event_t glusterfs_event_t;
  107 
  108 enum gf_op_type_t {
  109     GF_OP_TYPE_NULL = 0,
  110     GF_OP_TYPE_FOP = 0 + 1,
  111     GF_OP_TYPE_MGMT = 0 + 2,
  112     GF_OP_TYPE_MAX = 0 + 3,
  113 };
  114 typedef enum gf_op_type_t gf_op_type_t;
  115 
  116 enum glusterfs_lk_cmds_t {
  117     GF_LK_GETLK = 0,
  118     GF_LK_SETLK = 0 + 1,
  119     GF_LK_SETLKW = 0 + 2,
  120     GF_LK_RESLK_LCK = 0 + 3,
  121     GF_LK_RESLK_LCKW = 0 + 4,
  122     GF_LK_RESLK_UNLCK = 0 + 5,
  123     GF_LK_GETLK_FD = 0 + 6,
  124 };
  125 typedef enum glusterfs_lk_cmds_t glusterfs_lk_cmds_t;
  126 
  127 enum glusterfs_lk_types_t {
  128     GF_LK_F_RDLCK = 0,
  129     GF_LK_F_WRLCK = 0 + 1,
  130     GF_LK_F_UNLCK = 0 + 2,
  131     GF_LK_EOL = 0 + 3,
  132 };
  133 typedef enum glusterfs_lk_types_t glusterfs_lk_types_t;
  134 
  135 enum gf_lease_types_t {
  136     NONE = 0,
  137     GF_RD_LEASE = 1,
  138     GF_RW_LEASE = 2,
  139     GF_LEASE_MAX_TYPE = 2 + 1,
  140 };
  141 typedef enum gf_lease_types_t gf_lease_types_t;
  142 
  143 enum gf_lease_cmds_t {
  144     GF_GET_LEASE = 1,
  145     GF_SET_LEASE = 2,
  146     GF_UNLK_LEASE = 3,
  147 };
  148 typedef enum gf_lease_cmds_t gf_lease_cmds_t;
  149 
  150 #define LEASE_ID_SIZE 16 /* 128bits */
  151 
  152 struct gf_lease {
  153     gf_lease_cmds_t cmd;
  154     gf_lease_types_t lease_type;
  155     char lease_id[LEASE_ID_SIZE];
  156     u_int lease_flags;
  157 };
  158 typedef struct gf_lease gf_lease;
  159 
  160 enum glusterfs_lk_recovery_cmds_t {
  161     F_RESLK_LCK = 200,
  162     F_RESLK_LCKW = 200 + 1,
  163     F_RESLK_UNLCK = 200 + 2,
  164     F_GETLK_FD = 200 + 3,
  165 };
  166 typedef enum glusterfs_lk_recovery_cmds_t glusterfs_lk_recovery_cmds_t;
  167 
  168 enum gf_lk_domain_t {
  169     GF_LOCK_POSIX = 0,
  170     GF_LOCK_INTERNAL = 1,
  171 };
  172 typedef enum gf_lk_domain_t gf_lk_domain_t;
  173 
  174 enum entrylk_cmd {
  175     ENTRYLK_LOCK = 0,
  176     ENTRYLK_UNLOCK = 1,
  177     ENTRYLK_LOCK_NB = 2,
  178 };
  179 typedef enum entrylk_cmd entrylk_cmd;
  180 
  181 enum entrylk_type {
  182     ENTRYLK_RDLCK = 0,
  183     ENTRYLK_WRLCK = 1,
  184 };
  185 typedef enum entrylk_type entrylk_type;
  186 #define GF_MAX_LOCK_OWNER_LEN 1024 /* 1kB as per NLM */
  187 #define GF_LKOWNER_BUF_SIZE                                                    \
  188     ((GF_MAX_LOCK_OWNER_LEN * 2) + (GF_MAX_LOCK_OWNER_LEN / 8))
  189 
  190 struct gf_lkowner_t {
  191     int len;
  192     char data[GF_MAX_LOCK_OWNER_LEN];
  193 };
  194 typedef struct gf_lkowner_t gf_lkowner_t;
  195 
  196 enum gf_xattrop_flags_t {
  197     GF_XATTROP_ADD_ARRAY = 0,
  198     GF_XATTROP_ADD_ARRAY64 = 1,
  199     GF_XATTROP_OR_ARRAY = 2,
  200     GF_XATTROP_AND_ARRAY = 3,
  201     GF_XATTROP_GET_AND_SET = 4,
  202     GF_XATTROP_ADD_ARRAY_WITH_DEFAULT = 5,
  203     GF_XATTROP_ADD_ARRAY64_WITH_DEFAULT = 6,
  204 };
  205 typedef enum gf_xattrop_flags_t gf_xattrop_flags_t;
  206 
  207 enum gf_seek_what_t {
  208     GF_SEEK_DATA = 0,
  209     GF_SEEK_HOLE = 1,
  210 };
  211 typedef enum gf_seek_what_t gf_seek_what_t;
  212 
  213 enum gf_upcall_flags_t {
  214     GF_UPCALL_NULL = 0,
  215     GF_UPCALL = 1,
  216     GF_UPCALL_CI_STAT = 2,
  217     GF_UPCALL_CI_XATTR = 3,
  218     GF_UPCALL_CI_RENAME = 4,
  219     GF_UPCALL_CI_NLINK = 5,
  220     GF_UPCALL_CI_FORGET = 6,
  221     GF_UPCALL_LEASE_RECALL = 7,
  222     GF_UPCALL_FLAGS_MAXVALUE = 8,
  223 };
  224 typedef enum gf_upcall_flags_t gf_upcall_flags_t;
  225 
  226 enum gf_dict_data_type_t {
  227     GF_DATA_TYPE_UNKNOWN = 0,
  228     GF_DATA_TYPE_STR_OLD = 1,
  229     GF_DATA_TYPE_INT = 2,
  230     GF_DATA_TYPE_UINT = 3,
  231     GF_DATA_TYPE_DOUBLE = 4,
  232     GF_DATA_TYPE_STR = 5,
  233     GF_DATA_TYPE_PTR = 6,
  234     GF_DATA_TYPE_GFUUID = 7,
  235     GF_DATA_TYPE_IATT = 8,
  236     GF_DATA_TYPE_MDATA = 9,
  237     GF_DATA_TYPE_MAX = 10,
  238 };
  239 typedef enum gf_dict_data_type_t gf_dict_data_type_t;
  240 
  241 #endif /* !_GLUSTERFS_FOPS_H */