"Fossies" - the Fresh Open Source Software Archive

Member "glusterfs-8.2/libglusterfs/src/glusterfs/xlator.h" (16 Sep 2020, 44914 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 "xlator.h" see the Fossies "Dox" file reference documentation and the last Fossies "Diffs" side-by-side code changes report: 7.6_vs_7.7.

    1 /*
    2   Copyright (c) 2008-2012 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 _XLATOR_H
   12 #define _XLATOR_H
   13 
   14 #include <stdint.h>                    // for int32_t
   15 #include <sys/types.h>                 // for off_t, mode_t, off64_t, dev_t
   16 #include "glusterfs/glusterfs-fops.h"  // for GF_FOP_MAXVALUE, entrylk_cmd
   17 #include "glusterfs/atomic.h"          // for gf_atomic_t
   18 #include "glusterfs/glusterfs.h"       // for gf_boolean_t, glusterfs_ctx_t
   19 #include "glusterfs/compat-uuid.h"     // for uuid_t
   20 #include "glusterfs/compat.h"
   21 #include "glusterfs/event-history.h"
   22 #include "glusterfs/dict.h"
   23 #include "glusterfs/latency.h"
   24 
   25 #define FIRST_CHILD(xl) (xl->children->xlator)
   26 #define SECOND_CHILD(xl) (xl->children->next->xlator)
   27 
   28 #define GF_SET_ATTR_MODE 0x1
   29 #define GF_SET_ATTR_UID 0x2
   30 #define GF_SET_ATTR_GID 0x4
   31 #define GF_SET_ATTR_SIZE 0x8
   32 #define GF_SET_ATTR_ATIME 0x10
   33 #define GF_SET_ATTR_MTIME 0x20
   34 #define GF_SET_ATTR_CTIME 0x40
   35 #define GF_ATTR_ATIME_NOW 0x80
   36 #define GF_ATTR_MTIME_NOW 0x100
   37 
   38 #define gf_attr_mode_set(mode) ((mode)&GF_SET_ATTR_MODE)
   39 #define gf_attr_uid_set(mode) ((mode)&GF_SET_ATTR_UID)
   40 #define gf_attr_gid_set(mode) ((mode)&GF_SET_ATTR_GID)
   41 #define gf_attr_size_set(mode) ((mode)&GF_SET_ATTR_SIZE)
   42 #define gf_attr_atime_set(mode) ((mode)&GF_SET_ATTR_ATIME)
   43 #define gf_attr_mtime_set(mode) ((mode)&GF_SET_ATTR_MTIME)
   44 
   45 struct _xlator;
   46 typedef struct _xlator xlator_t;
   47 struct _dir_entry;
   48 typedef struct _dir_entry dir_entry_t;
   49 struct _gf_dirent;
   50 typedef struct _gf_dirent gf_dirent_t;
   51 struct _loc;
   52 typedef struct _loc loc_t;
   53 
   54 typedef int32_t (*event_notify_fn_t)(xlator_t *this, int32_t event, void *data,
   55                                      ...);
   56 
   57 #include "glusterfs/list.h"
   58 #include "glusterfs/gf-dirent.h"
   59 #include "glusterfs/stack.h"
   60 #include "glusterfs/iobuf.h"
   61 #include "glusterfs/globals.h"
   62 #include "glusterfs/iatt.h"
   63 #include "glusterfs/options.h"
   64 #include "glusterfs/client_t.h"
   65 
   66 struct _loc {
   67     const char *path;
   68     const char *name;
   69     inode_t *inode;
   70     inode_t *parent;
   71     /* Currently all location based operations are through 'gfid' of inode.
   72      * But the 'inode->gfid' only gets set in higher most layer (as in,
   73      * 'fuse', 'protocol/server', or 'nfs/server'). So if translators want
   74      * to send fops on a inode before the 'inode->gfid' is set, they have to
   75      * make use of below 'gfid' fields
   76      */
   77     uuid_t gfid;
   78     uuid_t pargfid;
   79 };
   80 
   81 typedef int32_t (*fop_getspec_cbk_t)(call_frame_t *frame, void *cookie,
   82                                      xlator_t *this, int32_t op_ret,
   83                                      int32_t op_errno, char *spec_data);
   84 
   85 typedef int32_t (*fop_rchecksum_cbk_t)(call_frame_t *frame, void *cookie,
   86                                        xlator_t *this, int32_t op_ret,
   87                                        int32_t op_errno, uint32_t weak_checksum,
   88                                        uint8_t *strong_checksum, dict_t *xdata);
   89 
   90 typedef int32_t (*fop_getspec_t)(call_frame_t *frame, xlator_t *this,
   91                                  const char *key, int32_t flag);
   92 
   93 typedef int32_t (*fop_rchecksum_t)(call_frame_t *frame, xlator_t *this,
   94                                    fd_t *fd, off_t offset, int32_t len,
   95                                    dict_t *xdata);
   96 
   97 typedef int32_t (*fop_lookup_cbk_t)(call_frame_t *frame, void *cookie,
   98                                     xlator_t *this, int32_t op_ret,
   99                                     int32_t op_errno, inode_t *inode,
  100                                     struct iatt *buf, dict_t *xdata,
  101                                     struct iatt *postparent);
  102 
  103 typedef int32_t (*fop_stat_cbk_t)(call_frame_t *frame, void *cookie,
  104                                   xlator_t *this, int32_t op_ret,
  105                                   int32_t op_errno, struct iatt *buf,
  106                                   dict_t *xdata);
  107 
  108 typedef int32_t (*fop_fstat_cbk_t)(call_frame_t *frame, void *cookie,
  109                                    xlator_t *this, int32_t op_ret,
  110                                    int32_t op_errno, struct iatt *buf,
  111                                    dict_t *xdata);
  112 
  113 typedef int32_t (*fop_truncate_cbk_t)(call_frame_t *frame, void *cookie,
  114                                       xlator_t *this, int32_t op_ret,
  115                                       int32_t op_errno, struct iatt *prebuf,
  116                                       struct iatt *postbuf, dict_t *xdata);
  117 
  118 typedef int32_t (*fop_ftruncate_cbk_t)(call_frame_t *frame, void *cookie,
  119                                        xlator_t *this, int32_t op_ret,
  120                                        int32_t op_errno, struct iatt *prebuf,
  121                                        struct iatt *postbuf, dict_t *xdata);
  122 
  123 typedef int32_t (*fop_access_cbk_t)(call_frame_t *frame, void *cookie,
  124                                     xlator_t *this, int32_t op_ret,
  125                                     int32_t op_errno, dict_t *xdata);
  126 
  127 typedef int32_t (*fop_readlink_cbk_t)(call_frame_t *frame, void *cookie,
  128                                       xlator_t *this, int32_t op_ret,
  129                                       int32_t op_errno, const char *path,
  130                                       struct iatt *buf, dict_t *xdata);
  131 
  132 typedef int32_t (*fop_mknod_cbk_t)(call_frame_t *frame, void *cookie,
  133                                    xlator_t *this, int32_t op_ret,
  134                                    int32_t op_errno, inode_t *inode,
  135                                    struct iatt *buf, struct iatt *preparent,
  136                                    struct iatt *postparent, dict_t *xdata);
  137 
  138 typedef int32_t (*fop_mkdir_cbk_t)(call_frame_t *frame, void *cookie,
  139                                    xlator_t *this, int32_t op_ret,
  140                                    int32_t op_errno, inode_t *inode,
  141                                    struct iatt *buf, struct iatt *preparent,
  142                                    struct iatt *postparent, dict_t *xdata);
  143 
  144 typedef int32_t (*fop_unlink_cbk_t)(call_frame_t *frame, void *cookie,
  145                                     xlator_t *this, int32_t op_ret,
  146                                     int32_t op_errno, struct iatt *preparent,
  147                                     struct iatt *postparent, dict_t *xdata);
  148 
  149 typedef int32_t (*fop_rmdir_cbk_t)(call_frame_t *frame, void *cookie,
  150                                    xlator_t *this, int32_t op_ret,
  151                                    int32_t op_errno, struct iatt *preparent,
  152                                    struct iatt *postparent, dict_t *xdata);
  153 
  154 typedef int32_t (*fop_symlink_cbk_t)(call_frame_t *frame, void *cookie,
  155                                      xlator_t *this, int32_t op_ret,
  156                                      int32_t op_errno, inode_t *inode,
  157                                      struct iatt *buf, struct iatt *preparent,
  158                                      struct iatt *postparent, dict_t *xdata);
  159 
  160 typedef int32_t (*fop_rename_cbk_t)(call_frame_t *frame, void *cookie,
  161                                     xlator_t *this, int32_t op_ret,
  162                                     int32_t op_errno, struct iatt *buf,
  163                                     struct iatt *preoldparent,
  164                                     struct iatt *postoldparent,
  165                                     struct iatt *prenewparent,
  166                                     struct iatt *postnewparent, dict_t *xdata);
  167 
  168 typedef int32_t (*fop_link_cbk_t)(call_frame_t *frame, void *cookie,
  169                                   xlator_t *this, int32_t op_ret,
  170                                   int32_t op_errno, inode_t *inode,
  171                                   struct iatt *buf, struct iatt *preparent,
  172                                   struct iatt *postparent, dict_t *xdata);
  173 
  174 typedef int32_t (*fop_create_cbk_t)(call_frame_t *frame, void *cookie,
  175                                     xlator_t *this, int32_t op_ret,
  176                                     int32_t op_errno, fd_t *fd, inode_t *inode,
  177                                     struct iatt *buf, struct iatt *preparent,
  178                                     struct iatt *postparent, dict_t *xdata);
  179 
  180 typedef int32_t (*fop_open_cbk_t)(call_frame_t *frame, void *cookie,
  181                                   xlator_t *this, int32_t op_ret,
  182                                   int32_t op_errno, fd_t *fd, dict_t *xdata);
  183 
  184 typedef int32_t (*fop_readv_cbk_t)(call_frame_t *frame, void *cookie,
  185                                    xlator_t *this, int32_t op_ret,
  186                                    int32_t op_errno, struct iovec *vector,
  187                                    int32_t count, struct iatt *stbuf,
  188                                    struct iobref *iobref, dict_t *xdata);
  189 
  190 typedef int32_t (*fop_writev_cbk_t)(call_frame_t *frame, void *cookie,
  191                                     xlator_t *this, int32_t op_ret,
  192                                     int32_t op_errno, struct iatt *prebuf,
  193                                     struct iatt *postbuf, dict_t *xdata);
  194 
  195 typedef int32_t (*fop_flush_cbk_t)(call_frame_t *frame, void *cookie,
  196                                    xlator_t *this, int32_t op_ret,
  197                                    int32_t op_errno, dict_t *xdata);
  198 
  199 typedef int32_t (*fop_fsync_cbk_t)(call_frame_t *frame, void *cookie,
  200                                    xlator_t *this, int32_t op_ret,
  201                                    int32_t op_errno, struct iatt *prebuf,
  202                                    struct iatt *postbuf, dict_t *xdata);
  203 
  204 typedef int32_t (*fop_opendir_cbk_t)(call_frame_t *frame, void *cookie,
  205                                      xlator_t *this, int32_t op_ret,
  206                                      int32_t op_errno, fd_t *fd, dict_t *xdata);
  207 
  208 typedef int32_t (*fop_fsyncdir_cbk_t)(call_frame_t *frame, void *cookie,
  209                                       xlator_t *this, int32_t op_ret,
  210                                       int32_t op_errno, dict_t *xdata);
  211 
  212 typedef int32_t (*fop_statfs_cbk_t)(call_frame_t *frame, void *cookie,
  213                                     xlator_t *this, int32_t op_ret,
  214                                     int32_t op_errno, struct statvfs *buf,
  215                                     dict_t *xdata);
  216 
  217 typedef int32_t (*fop_setxattr_cbk_t)(call_frame_t *frame, void *cookie,
  218                                       xlator_t *this, int32_t op_ret,
  219                                       int32_t op_errno, dict_t *xdata);
  220 
  221 typedef int32_t (*fop_getxattr_cbk_t)(call_frame_t *frame, void *cookie,
  222                                       xlator_t *this, int32_t op_ret,
  223                                       int32_t op_errno, dict_t *dict,
  224                                       dict_t *xdata);
  225 
  226 typedef int32_t (*fop_fsetxattr_cbk_t)(call_frame_t *frame, void *cookie,
  227                                        xlator_t *this, int32_t op_ret,
  228                                        int32_t op_errno, dict_t *xdata);
  229 
  230 typedef int32_t (*fop_fgetxattr_cbk_t)(call_frame_t *frame, void *cookie,
  231                                        xlator_t *this, int32_t op_ret,
  232                                        int32_t op_errno, dict_t *dict,
  233                                        dict_t *xdata);
  234 
  235 typedef int32_t (*fop_removexattr_cbk_t)(call_frame_t *frame, void *cookie,
  236                                          xlator_t *this, int32_t op_ret,
  237                                          int32_t op_errno, dict_t *xdata);
  238 
  239 typedef int32_t (*fop_fremovexattr_cbk_t)(call_frame_t *frame, void *cookie,
  240                                           xlator_t *this, int32_t op_ret,
  241                                           int32_t op_errno, dict_t *xdata);
  242 
  243 typedef int32_t (*fop_lk_cbk_t)(call_frame_t *frame, void *cookie,
  244                                 xlator_t *this, int32_t op_ret,
  245                                 int32_t op_errno, struct gf_flock *flock,
  246                                 dict_t *xdata);
  247 
  248 typedef int32_t (*fop_inodelk_cbk_t)(call_frame_t *frame, void *cookie,
  249                                      xlator_t *this, int32_t op_ret,
  250                                      int32_t op_errno, dict_t *xdata);
  251 
  252 typedef int32_t (*fop_finodelk_cbk_t)(call_frame_t *frame, void *cookie,
  253                                       xlator_t *this, int32_t op_ret,
  254                                       int32_t op_errno, dict_t *xdata);
  255 
  256 typedef int32_t (*fop_entrylk_cbk_t)(call_frame_t *frame, void *cookie,
  257                                      xlator_t *this, int32_t op_ret,
  258                                      int32_t op_errno, dict_t *xdata);
  259 
  260 typedef int32_t (*fop_fentrylk_cbk_t)(call_frame_t *frame, void *cookie,
  261                                       xlator_t *this, int32_t op_ret,
  262                                       int32_t op_errno, dict_t *xdata);
  263 
  264 typedef int32_t (*fop_readdir_cbk_t)(call_frame_t *frame, void *cookie,
  265                                      xlator_t *this, int32_t op_ret,
  266                                      int32_t op_errno, gf_dirent_t *entries,
  267                                      dict_t *xdata);
  268 
  269 typedef int32_t (*fop_readdirp_cbk_t)(call_frame_t *frame, void *cookie,
  270                                       xlator_t *this, int32_t op_ret,
  271                                       int32_t op_errno, gf_dirent_t *entries,
  272                                       dict_t *xdata);
  273 
  274 typedef int32_t (*fop_xattrop_cbk_t)(call_frame_t *frame, void *cookie,
  275                                      xlator_t *this, int32_t op_ret,
  276                                      int32_t op_errno, dict_t *xattr,
  277                                      dict_t *xdata);
  278 
  279 typedef int32_t (*fop_fxattrop_cbk_t)(call_frame_t *frame, void *cookie,
  280                                       xlator_t *this, int32_t op_ret,
  281                                       int32_t op_errno, dict_t *xattr,
  282                                       dict_t *xdata);
  283 
  284 typedef int32_t (*fop_setattr_cbk_t)(call_frame_t *frame, void *cookie,
  285                                      xlator_t *this, int32_t op_ret,
  286                                      int32_t op_errno, struct iatt *preop_stbuf,
  287                                      struct iatt *postop_stbuf, dict_t *xdata);
  288 
  289 typedef int32_t (*fop_fsetattr_cbk_t)(call_frame_t *frame, void *cookie,
  290                                       xlator_t *this, int32_t op_ret,
  291                                       int32_t op_errno,
  292                                       struct iatt *preop_stbuf,
  293                                       struct iatt *postop_stbuf, dict_t *xdata);
  294 
  295 typedef int32_t (*fop_fallocate_cbk_t)(call_frame_t *frame, void *cookie,
  296                                        xlator_t *this, int32_t op_ret,
  297                                        int32_t op_errno,
  298                                        struct iatt *preop_stbuf,
  299                                        struct iatt *postop_stbuf,
  300                                        dict_t *xdata);
  301 
  302 typedef int32_t (*fop_discard_cbk_t)(call_frame_t *frame, void *cookie,
  303                                      xlator_t *this, int32_t op_ret,
  304                                      int32_t op_errno, struct iatt *preop_stbuf,
  305                                      struct iatt *postop_stbuf, dict_t *xdata);
  306 
  307 typedef int32_t (*fop_zerofill_cbk_t)(call_frame_t *frame, void *cookie,
  308                                       xlator_t *this, int32_t op_ret,
  309                                       int32_t op_errno,
  310                                       struct iatt *preop_stbuf,
  311                                       struct iatt *postop_stbuf, dict_t *xdata);
  312 
  313 typedef int32_t (*fop_ipc_cbk_t)(call_frame_t *frame, void *cookie,
  314                                  xlator_t *this, int32_t op_ret,
  315                                  int32_t op_errno, dict_t *xdata);
  316 
  317 typedef int32_t (*fop_seek_cbk_t)(call_frame_t *frame, void *cookie,
  318                                   xlator_t *this, int32_t op_ret,
  319                                   int32_t op_errno, off_t offset,
  320                                   dict_t *xdata);
  321 
  322 typedef int32_t (*fop_lease_cbk_t)(call_frame_t *frame, void *cookie,
  323                                    xlator_t *this, int32_t op_ret,
  324                                    int32_t op_errno, struct gf_lease *lease,
  325                                    dict_t *xdata);
  326 typedef int32_t (*fop_compound_cbk_t)(call_frame_t *frame, void *cookie,
  327                                       xlator_t *this, int32_t op_ret,
  328                                       int32_t op_errno, void *data,
  329                                       dict_t *xdata);
  330 
  331 typedef int32_t (*fop_getactivelk_cbk_t)(call_frame_t *frame, void *cookie,
  332                                          xlator_t *this, int32_t op_ret,
  333                                          int32_t op_errno,
  334                                          lock_migration_info_t *locklist,
  335                                          dict_t *xdata);
  336 
  337 typedef int32_t (*fop_setactivelk_cbk_t)(call_frame_t *frame, void *cookie,
  338                                          xlator_t *this, int32_t op_ret,
  339                                          int32_t op_errno, dict_t *xdata);
  340 
  341 typedef int32_t (*fop_put_cbk_t)(call_frame_t *frame, void *cookie,
  342                                  xlator_t *this, int32_t op_ret,
  343                                  int32_t op_errno, inode_t *inode,
  344                                  struct iatt *buf, struct iatt *preparent,
  345                                  struct iatt *postparent, dict_t *xdata);
  346 
  347 typedef int32_t (*fop_icreate_cbk_t)(call_frame_t *frame, void *cookie,
  348                                      xlator_t *this, int32_t op_ret,
  349                                      int32_t op_errno, inode_t *inode,
  350                                      struct iatt *buf, dict_t *xdata);
  351 
  352 typedef int32_t (*fop_namelink_cbk_t)(call_frame_t *frame, void *cookie,
  353                                       xlator_t *this, int32_t op_ret,
  354                                       int32_t op_errno, struct iatt *prebuf,
  355                                       struct iatt *postbuf, dict_t *xdata);
  356 
  357 typedef int32_t (*fop_copy_file_range_cbk_t)(
  358     call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret,
  359     int32_t op_errno, struct iatt *stbuf, struct iatt *prebuf_dst,
  360     struct iatt *postbuf_dst, dict_t *xdata);
  361 
  362 typedef int32_t (*fop_lookup_t)(call_frame_t *frame, xlator_t *this, loc_t *loc,
  363                                 dict_t *xdata);
  364 
  365 typedef int32_t (*fop_stat_t)(call_frame_t *frame, xlator_t *this, loc_t *loc,
  366                               dict_t *xdata);
  367 
  368 typedef int32_t (*fop_fstat_t)(call_frame_t *frame, xlator_t *this, fd_t *fd,
  369                                dict_t *xdata);
  370 
  371 typedef int32_t (*fop_truncate_t)(call_frame_t *frame, xlator_t *this,
  372                                   loc_t *loc, off_t offset, dict_t *xdata);
  373 
  374 typedef int32_t (*fop_ftruncate_t)(call_frame_t *frame, xlator_t *this,
  375                                    fd_t *fd, off_t offset, dict_t *xdata);
  376 
  377 typedef int32_t (*fop_access_t)(call_frame_t *frame, xlator_t *this, loc_t *loc,
  378                                 int32_t mask, dict_t *xdata);
  379 
  380 typedef int32_t (*fop_readlink_t)(call_frame_t *frame, xlator_t *this,
  381                                   loc_t *loc, size_t size, dict_t *xdata);
  382 
  383 typedef int32_t (*fop_mknod_t)(call_frame_t *frame, xlator_t *this, loc_t *loc,
  384                                mode_t mode, dev_t rdev, mode_t umask,
  385                                dict_t *xdata);
  386 
  387 typedef int32_t (*fop_mkdir_t)(call_frame_t *frame, xlator_t *this, loc_t *loc,
  388                                mode_t mode, mode_t umask, dict_t *xdata);
  389 
  390 typedef int32_t (*fop_unlink_t)(call_frame_t *frame, xlator_t *this, loc_t *loc,
  391                                 int xflags, dict_t *xdata);
  392 
  393 typedef int32_t (*fop_rmdir_t)(call_frame_t *frame, xlator_t *this, loc_t *loc,
  394                                int xflags, dict_t *xdata);
  395 
  396 typedef int32_t (*fop_symlink_t)(call_frame_t *frame, xlator_t *this,
  397                                  const char *linkname, loc_t *loc, mode_t umask,
  398                                  dict_t *xdata);
  399 
  400 typedef int32_t (*fop_rename_t)(call_frame_t *frame, xlator_t *this,
  401                                 loc_t *oldloc, loc_t *newloc, dict_t *xdata);
  402 
  403 typedef int32_t (*fop_link_t)(call_frame_t *frame, xlator_t *this,
  404                               loc_t *oldloc, loc_t *newloc, dict_t *xdata);
  405 
  406 typedef int32_t (*fop_create_t)(call_frame_t *frame, xlator_t *this, loc_t *loc,
  407                                 int32_t flags, mode_t mode, mode_t umask,
  408                                 fd_t *fd, dict_t *xdata);
  409 
  410 /* Tell subsequent writes on the fd_t to fsync after every writev fop without
  411  * requiring a fsync fop.
  412  */
  413 #define GF_OPEN_FSYNC 0x01
  414 
  415 /* Tell write-behind to disable writing behind despite O_SYNC not being set.
  416  */
  417 #define GF_OPEN_NOWB 0x02
  418 
  419 typedef int32_t (*fop_open_t)(call_frame_t *frame, xlator_t *this, loc_t *loc,
  420                               int32_t flags, fd_t *fd, dict_t *xdata);
  421 
  422 typedef int32_t (*fop_readv_t)(call_frame_t *frame, xlator_t *this, fd_t *fd,
  423                                size_t size, off_t offset, uint32_t flags,
  424                                dict_t *xdata);
  425 
  426 typedef int32_t (*fop_writev_t)(call_frame_t *frame, xlator_t *this, fd_t *fd,
  427                                 struct iovec *vector, int32_t count,
  428                                 off_t offset, uint32_t flags,
  429                                 struct iobref *iobref, dict_t *xdata);
  430 
  431 typedef int32_t (*fop_flush_t)(call_frame_t *frame, xlator_t *this, fd_t *fd,
  432                                dict_t *xdata);
  433 
  434 typedef int32_t (*fop_fsync_t)(call_frame_t *frame, xlator_t *this, fd_t *fd,
  435                                int32_t datasync, dict_t *xdata);
  436 
  437 typedef int32_t (*fop_opendir_t)(call_frame_t *frame, xlator_t *this,
  438                                  loc_t *loc, fd_t *fd, dict_t *xdata);
  439 
  440 typedef int32_t (*fop_fsyncdir_t)(call_frame_t *frame, xlator_t *this, fd_t *fd,
  441                                   int32_t datasync, dict_t *xdata);
  442 
  443 typedef int32_t (*fop_statfs_t)(call_frame_t *frame, xlator_t *this, loc_t *loc,
  444                                 dict_t *xdata);
  445 
  446 typedef int32_t (*fop_setxattr_t)(call_frame_t *frame, xlator_t *this,
  447                                   loc_t *loc, dict_t *dict, int32_t flags,
  448                                   dict_t *xdata);
  449 
  450 typedef int32_t (*fop_getxattr_t)(call_frame_t *frame, xlator_t *this,
  451                                   loc_t *loc, const char *name, dict_t *xdata);
  452 
  453 typedef int32_t (*fop_fsetxattr_t)(call_frame_t *frame, xlator_t *this,
  454                                    fd_t *fd, dict_t *dict, int32_t flags,
  455                                    dict_t *xdata);
  456 
  457 typedef int32_t (*fop_fgetxattr_t)(call_frame_t *frame, xlator_t *this,
  458                                    fd_t *fd, const char *name, dict_t *xdata);
  459 
  460 typedef int32_t (*fop_removexattr_t)(call_frame_t *frame, xlator_t *this,
  461                                      loc_t *loc, const char *name,
  462                                      dict_t *xdata);
  463 
  464 typedef int32_t (*fop_fremovexattr_t)(call_frame_t *frame, xlator_t *this,
  465                                       fd_t *fd, const char *name,
  466                                       dict_t *xdata);
  467 
  468 typedef int32_t (*fop_lk_t)(call_frame_t *frame, xlator_t *this, fd_t *fd,
  469                             int32_t cmd, struct gf_flock *flock, dict_t *xdata);
  470 
  471 typedef int32_t (*fop_inodelk_t)(call_frame_t *frame, xlator_t *this,
  472                                  const char *volume, loc_t *loc, int32_t cmd,
  473                                  struct gf_flock *flock, dict_t *xdata);
  474 
  475 typedef int32_t (*fop_finodelk_t)(call_frame_t *frame, xlator_t *this,
  476                                   const char *volume, fd_t *fd, int32_t cmd,
  477                                   struct gf_flock *flock, dict_t *xdata);
  478 
  479 typedef int32_t (*fop_entrylk_t)(call_frame_t *frame, xlator_t *this,
  480                                  const char *volume, loc_t *loc,
  481                                  const char *basename, entrylk_cmd cmd,
  482                                  entrylk_type type, dict_t *xdata);
  483 
  484 typedef int32_t (*fop_fentrylk_t)(call_frame_t *frame, xlator_t *this,
  485                                   const char *volume, fd_t *fd,
  486                                   const char *basename, entrylk_cmd cmd,
  487                                   entrylk_type type, dict_t *xdata);
  488 
  489 typedef int32_t (*fop_readdir_t)(call_frame_t *frame, xlator_t *this, fd_t *fd,
  490                                  size_t size, off_t offset, dict_t *xdata);
  491 
  492 typedef int32_t (*fop_readdirp_t)(call_frame_t *frame, xlator_t *this, fd_t *fd,
  493                                   size_t size, off_t offset, dict_t *xdata);
  494 
  495 typedef int32_t (*fop_xattrop_t)(call_frame_t *frame, xlator_t *this,
  496                                  loc_t *loc, gf_xattrop_flags_t optype,
  497                                  dict_t *xattr, dict_t *xdata);
  498 
  499 typedef int32_t (*fop_fxattrop_t)(call_frame_t *frame, xlator_t *this, fd_t *fd,
  500                                   gf_xattrop_flags_t optype, dict_t *xattr,
  501                                   dict_t *xdata);
  502 
  503 typedef int32_t (*fop_setattr_t)(call_frame_t *frame, xlator_t *this,
  504                                  loc_t *loc, struct iatt *stbuf, int32_t valid,
  505                                  dict_t *xdata);
  506 
  507 typedef int32_t (*fop_fsetattr_t)(call_frame_t *frame, xlator_t *this, fd_t *fd,
  508                                   struct iatt *stbuf, int32_t valid,
  509                                   dict_t *xdata);
  510 
  511 typedef int32_t (*fop_fallocate_t)(call_frame_t *frame, xlator_t *this,
  512                                    fd_t *fd, int32_t keep_size, off_t offset,
  513                                    size_t len, dict_t *xdata);
  514 
  515 typedef int32_t (*fop_discard_t)(call_frame_t *frame, xlator_t *this, fd_t *fd,
  516                                  off_t offset, size_t len, dict_t *xdata);
  517 
  518 typedef int32_t (*fop_zerofill_t)(call_frame_t *frame, xlator_t *this, fd_t *fd,
  519                                   off_t offset, off_t len, dict_t *xdata);
  520 
  521 typedef int32_t (*fop_ipc_t)(call_frame_t *frame, xlator_t *this, int32_t op,
  522                              dict_t *xdata);
  523 
  524 typedef int32_t (*fop_seek_t)(call_frame_t *frame, xlator_t *this, fd_t *fd,
  525                               off_t offset, gf_seek_what_t what, dict_t *xdata);
  526 
  527 typedef int32_t (*fop_lease_t)(call_frame_t *frame, xlator_t *this, loc_t *loc,
  528                                struct gf_lease *lease, dict_t *xdata);
  529 
  530 typedef int32_t (*fop_compound_t)(call_frame_t *frame, xlator_t *this,
  531                                   void *args, dict_t *xdata);
  532 
  533 typedef int32_t (*fop_getactivelk_t)(call_frame_t *frame, xlator_t *this,
  534                                      loc_t *loc, dict_t *xdata);
  535 
  536 typedef int32_t (*fop_setactivelk_t)(call_frame_t *frame, xlator_t *this,
  537                                      loc_t *loc,
  538                                      lock_migration_info_t *locklist,
  539                                      dict_t *xdata);
  540 
  541 typedef int32_t (*fop_put_t)(call_frame_t *frame, xlator_t *this, loc_t *loc,
  542                              mode_t mode, mode_t umask, uint32_t flags,
  543                              struct iovec *vector, int32_t count, off_t offset,
  544                              struct iobref *iobref, dict_t *xattr,
  545                              dict_t *xdata);
  546 
  547 typedef int32_t (*fop_icreate_t)(call_frame_t *frame, xlator_t *this,
  548                                  loc_t *loc, mode_t mode, dict_t *xdata);
  549 
  550 typedef int32_t (*fop_namelink_t)(call_frame_t *frame, xlator_t *this,
  551                                   loc_t *loc, dict_t *xdata);
  552 typedef int32_t (*fop_copy_file_range_t)(call_frame_t *frame, xlator_t *this,
  553                                          fd_t *fd_in, off64_t off_in,
  554                                          fd_t *fd_out, off64_t off_out,
  555                                          size_t len, uint32_t flags,
  556                                          dict_t *xdata);
  557 
  558 /* WARNING: make sure the list is in order with FOP definition in
  559    `rpc/xdr/src/glusterfs-fops.x`.
  560    If it is not in order, mainly the metrics related feature would be broken */
  561 struct xlator_fops {
  562     fop_stat_t stat;
  563     fop_readlink_t readlink;
  564     fop_mknod_t mknod;
  565     fop_mkdir_t mkdir;
  566     fop_unlink_t unlink;
  567     fop_rmdir_t rmdir;
  568     fop_symlink_t symlink;
  569     fop_rename_t rename;
  570     fop_link_t link;
  571     fop_truncate_t truncate;
  572     fop_open_t open;
  573     fop_readv_t readv;
  574     fop_writev_t writev;
  575     fop_statfs_t statfs;
  576     fop_flush_t flush;
  577     fop_fsync_t fsync;
  578     fop_setxattr_t setxattr;
  579     fop_getxattr_t getxattr;
  580     fop_removexattr_t removexattr;
  581     fop_opendir_t opendir;
  582     fop_fsyncdir_t fsyncdir;
  583     fop_access_t access;
  584     fop_create_t create;
  585     fop_ftruncate_t ftruncate;
  586     fop_fstat_t fstat;
  587     fop_lk_t lk;
  588     fop_lookup_t lookup;
  589     fop_readdir_t readdir;
  590     fop_inodelk_t inodelk;
  591     fop_finodelk_t finodelk;
  592     fop_entrylk_t entrylk;
  593     fop_fentrylk_t fentrylk;
  594     fop_xattrop_t xattrop;
  595     fop_fxattrop_t fxattrop;
  596     fop_fgetxattr_t fgetxattr;
  597     fop_fsetxattr_t fsetxattr;
  598     fop_rchecksum_t rchecksum;
  599     fop_setattr_t setattr;
  600     fop_fsetattr_t fsetattr;
  601     fop_readdirp_t readdirp;
  602 
  603     /* These 3 are required to keep the index same as GF_FOP_##FOP */
  604     void *forget_placeholder;
  605     void *release_placeholder;
  606     void *releasedir_placeholder;
  607 
  608     fop_getspec_t getspec;
  609     fop_fremovexattr_t fremovexattr;
  610     fop_fallocate_t fallocate;
  611     fop_discard_t discard;
  612     fop_zerofill_t zerofill;
  613     fop_ipc_t ipc;
  614     fop_seek_t seek;
  615     fop_lease_t lease;
  616     fop_compound_t compound;
  617     fop_getactivelk_t getactivelk;
  618     fop_setactivelk_t setactivelk;
  619     fop_put_t put;
  620     fop_icreate_t icreate;
  621     fop_namelink_t namelink;
  622     fop_copy_file_range_t copy_file_range;
  623 
  624     /* these entries are used for a typechecking hack in STACK_WIND _only_ */
  625     /* make sure to add _cbk variables only after defining regular fops as
  626        its relative position is used to get the index */
  627     fop_stat_cbk_t stat_cbk;
  628     fop_readlink_cbk_t readlink_cbk;
  629     fop_mknod_cbk_t mknod_cbk;
  630     fop_mkdir_cbk_t mkdir_cbk;
  631     fop_unlink_cbk_t unlink_cbk;
  632     fop_rmdir_cbk_t rmdir_cbk;
  633     fop_symlink_cbk_t symlink_cbk;
  634     fop_rename_cbk_t rename_cbk;
  635     fop_link_cbk_t link_cbk;
  636     fop_truncate_cbk_t truncate_cbk;
  637     fop_open_cbk_t open_cbk;
  638     fop_readv_cbk_t readv_cbk;
  639     fop_writev_cbk_t writev_cbk;
  640     fop_statfs_cbk_t statfs_cbk;
  641     fop_flush_cbk_t flush_cbk;
  642     fop_fsync_cbk_t fsync_cbk;
  643     fop_setxattr_cbk_t setxattr_cbk;
  644     fop_getxattr_cbk_t getxattr_cbk;
  645     fop_removexattr_cbk_t removexattr_cbk;
  646     fop_opendir_cbk_t opendir_cbk;
  647     fop_fsyncdir_cbk_t fsyncdir_cbk;
  648     fop_access_cbk_t access_cbk;
  649     fop_create_cbk_t create_cbk;
  650     fop_ftruncate_cbk_t ftruncate_cbk;
  651     fop_fstat_cbk_t fstat_cbk;
  652     fop_lk_cbk_t lk_cbk;
  653     fop_lookup_cbk_t lookup_cbk;
  654     fop_readdir_cbk_t readdir_cbk;
  655     fop_inodelk_cbk_t inodelk_cbk;
  656     fop_finodelk_cbk_t finodelk_cbk;
  657     fop_entrylk_cbk_t entrylk_cbk;
  658     fop_fentrylk_cbk_t fentrylk_cbk;
  659     fop_xattrop_cbk_t xattrop_cbk;
  660     fop_fxattrop_cbk_t fxattrop_cbk;
  661     fop_fgetxattr_cbk_t fgetxattr_cbk;
  662     fop_fsetxattr_cbk_t fsetxattr_cbk;
  663     fop_rchecksum_cbk_t rchecksum_cbk;
  664     fop_setattr_cbk_t setattr_cbk;
  665     fop_fsetattr_cbk_t fsetattr_cbk;
  666     fop_readdirp_cbk_t readdirp_cbk;
  667 
  668     /* These 3 are required to keep the index same as GF_FOP_##FOP */
  669     void *forget_placeholder_cbk;
  670     void *release_placeholder_cbk;
  671     void *releasedir_placeholder_cbk;
  672 
  673     fop_getspec_cbk_t getspec_cbk;
  674     fop_fremovexattr_cbk_t fremovexattr_cbk;
  675     fop_fallocate_cbk_t fallocate_cbk;
  676     fop_discard_cbk_t discard_cbk;
  677     fop_zerofill_cbk_t zerofill_cbk;
  678     fop_ipc_cbk_t ipc_cbk;
  679     fop_seek_cbk_t seek_cbk;
  680     fop_lease_cbk_t lease_cbk;
  681     fop_compound_cbk_t compound_cbk;
  682     fop_getactivelk_cbk_t getactivelk_cbk;
  683     fop_setactivelk_cbk_t setactivelk_cbk;
  684     fop_put_cbk_t put_cbk;
  685     fop_icreate_cbk_t icreate_cbk;
  686     fop_namelink_cbk_t namelink_cbk;
  687     fop_copy_file_range_cbk_t copy_file_range_cbk;
  688 };
  689 
  690 typedef int32_t (*cbk_forget_t)(xlator_t *this, inode_t *inode);
  691 
  692 typedef int32_t (*cbk_release_t)(xlator_t *this, fd_t *fd);
  693 
  694 typedef int32_t (*cbk_invalidate_t)(xlator_t *this, inode_t *inode);
  695 
  696 typedef int32_t (*cbk_client_t)(xlator_t *this, client_t *client);
  697 
  698 typedef void (*cbk_ictxmerge_t)(xlator_t *this, fd_t *fd, inode_t *inode,
  699                                 inode_t *linked_inode);
  700 
  701 typedef size_t (*cbk_inodectx_size_t)(xlator_t *this, inode_t *inode);
  702 
  703 typedef size_t (*cbk_fdctx_size_t)(xlator_t *this, fd_t *fd);
  704 
  705 typedef void (*cbk_fdclose_t)(xlator_t *this, fd_t *fd);
  706 
  707 struct xlator_cbks {
  708     cbk_forget_t forget;
  709     cbk_release_t release;
  710     cbk_release_t releasedir;
  711     cbk_invalidate_t invalidate;
  712     cbk_client_t client_destroy;
  713     cbk_client_t client_disconnect;
  714     cbk_ictxmerge_t ictxmerge;
  715     cbk_inodectx_size_t ictxsize;
  716     cbk_fdctx_size_t fdctxsize;
  717     cbk_fdclose_t fdclose;
  718     cbk_fdclose_t fdclosedir;
  719 };
  720 
  721 typedef int32_t (*dumpop_priv_t)(xlator_t *this);
  722 
  723 typedef int32_t (*dumpop_inode_t)(xlator_t *this);
  724 
  725 typedef int32_t (*dumpop_fd_t)(xlator_t *this);
  726 
  727 typedef int32_t (*dumpop_inodectx_t)(xlator_t *this, inode_t *ino);
  728 
  729 typedef int32_t (*dumpop_fdctx_t)(xlator_t *this, fd_t *fd);
  730 
  731 typedef int32_t (*dumpop_priv_to_dict_t)(xlator_t *this, dict_t *dict,
  732                                          char *brickname);
  733 
  734 typedef int32_t (*dumpop_inode_to_dict_t)(xlator_t *this, dict_t *dict);
  735 
  736 typedef int32_t (*dumpop_fd_to_dict_t)(xlator_t *this, dict_t *dict);
  737 
  738 typedef int32_t (*dumpop_inodectx_to_dict_t)(xlator_t *this, inode_t *ino,
  739                                              dict_t *dict);
  740 
  741 typedef int32_t (*dumpop_fdctx_to_dict_t)(xlator_t *this, fd_t *fd,
  742                                           dict_t *dict);
  743 
  744 typedef int32_t (*dumpop_eh_t)(xlator_t *this);
  745 
  746 struct xlator_dumpops {
  747     dumpop_priv_t priv;
  748     dumpop_inode_t inode;
  749     dumpop_fd_t fd;
  750     dumpop_inodectx_t inodectx;
  751     dumpop_fdctx_t fdctx;
  752     dumpop_priv_to_dict_t priv_to_dict;
  753     dumpop_inode_to_dict_t inode_to_dict;
  754     dumpop_fd_to_dict_t fd_to_dict;
  755     dumpop_inodectx_to_dict_t inodectx_to_dict;
  756     dumpop_fdctx_to_dict_t fdctx_to_dict;
  757     dumpop_eh_t history;
  758 };
  759 
  760 typedef struct xlator_list {
  761     xlator_t *xlator;
  762     struct xlator_list *next;
  763 } xlator_list_t;
  764 
  765 typedef struct fop_metrics {
  766     gf_atomic_t fop;
  767     gf_atomic_t cbk; /* only updaed when there is failure */
  768 } fop_metrics_t;
  769 
  770 struct _xlator {
  771     /* Built during parsing */
  772     char *name;
  773     char *type;
  774     char *instance_name; /* Used for multi NFSd */
  775     xlator_t *next;
  776     xlator_t *prev;
  777     xlator_list_t *parents;
  778     xlator_list_t *children;
  779     dict_t *options;
  780 
  781     /* Set after doing dlopen() */
  782     void *dlhandle;
  783     struct xlator_fops *fops;
  784     struct xlator_cbks *cbks;
  785     struct xlator_dumpops *dumpops;
  786     struct list_head volume_options; /* list of volume_option_t */
  787 
  788     void (*fini)(xlator_t *this);
  789     int32_t (*init)(xlator_t *this);
  790     int32_t (*reconfigure)(xlator_t *this, dict_t *options);
  791     int32_t (*mem_acct_init)(xlator_t *this);
  792     int32_t (*dump_metrics)(xlator_t *this, int fd);
  793 
  794     event_notify_fn_t notify;
  795 
  796     gf_loglevel_t loglevel; /* Log level for translator */
  797 
  798     struct {
  799         struct {
  800             /* for latency measurement */
  801             fop_metrics_t metrics[GF_FOP_MAXVALUE];
  802 
  803             gf_atomic_t count;
  804         } total;
  805 
  806         struct {
  807             /* for latency measurement */
  808             fop_latency_t latencies[GF_FOP_MAXVALUE];
  809             /* for latency measurement */
  810             fop_metrics_t metrics[GF_FOP_MAXVALUE];
  811 
  812             gf_atomic_t count;
  813         } interval;
  814     } stats;
  815 
  816     /* Misc */
  817     eh_t *history; /* event history context */
  818     glusterfs_ctx_t *ctx;
  819     glusterfs_graph_t *graph; /* not set for fuse */
  820     inode_table_t *itable;
  821     char init_succeeded;
  822     void *private;
  823     struct mem_acct *mem_acct;
  824     uint64_t winds;
  825     char switched;
  826 
  827     /* for the memory pool of 'frame->local' */
  828     struct mem_pool *local_pool;
  829     gf_boolean_t is_autoloaded;
  830 
  831     /* Saved volfile ID (used for multiplexing) */
  832     char *volfile_id;
  833 
  834     /* Its used as an index to inode_ctx*/
  835     uint32_t xl_id;
  836 
  837     /* op_version: initialized in xlator code itself */
  838     uint32_t op_version[GF_MAX_RELEASES];
  839 
  840     /* flags: initialized in xlator code itself */
  841     uint32_t flags;
  842 
  843     /* id: unique, initialized in xlator code itself */
  844     uint32_t id;
  845 
  846     /* identifier: a full string which can unique identify the xlator */
  847     char *identifier;
  848 
  849     /* Is this pass_through? */
  850     gf_boolean_t pass_through;
  851     struct xlator_fops *pass_through_fops;
  852 
  853     /* cleanup flag to avoid races during xlator cleanup */
  854     uint32_t cleanup_starting;
  855 
  856     /* flag to avoid recall of xlator_mem_cleanup for xame xlator */
  857     uint32_t call_cleanup;
  858 
  859     /* Flag to understand how this xlator is categorized */
  860     gf_category_t category;
  861 
  862     /* Variable to save xprt associated for detach brick */
  863     gf_atomic_t xprtrefcnt;
  864 
  865     /* Flag to notify got CHILD_DOWN event for detach brick */
  866     uint32_t notify_down;
  867 
  868     /* Flag to avoid throw duplicate PARENT_DOWN event */
  869     uint32_t parent_down;
  870 };
  871 
  872 /* This would be the only structure which needs to be exported by
  873    the translators. For the backward compatibility, in 4.x series
  874    even the old exported fields will be supported */
  875 /* XXX: This struct is in use by GD2, and hence SHOULD NOT be modified.
  876  * If the struct must be modified, see instructions at the comment with
  877  * GD2MARKER below.
  878  */
  879 typedef struct {
  880     /* op_version: will be used by volume generation logic to figure
  881        out whether to insert it in graph or no, based on cluster's
  882        operating version.
  883        default value: 0, which means good to insert always */
  884     uint32_t op_version[GF_MAX_RELEASES];
  885 
  886     /* flags: will be used by volume generation logic to optimize the
  887        placements etc.
  888        default value: 0, which means don't treat it specially */
  889     uint32_t flags;
  890 
  891     /* xlator_id: unique per xlator. make sure to have no collission
  892        in this ID */
  893     uint32_t xlator_id;
  894 
  895     /* identifier: a string constant */
  896     char *identifier;
  897 
  898     /* struct options: if the translator takes any 'options' from the
  899        volume file, then that should be defined here. optional. */
  900     volume_option_t *options;
  901 
  902     /* Flag to understand how this xlator is categorized */
  903     gf_category_t category;
  904 
  905     /* XXX: GD2MARKER
  906      * If a new member that needs to be visible to GD2 is introduced,
  907      * add it above this comment.
  908      * Any other new members need to be added below this comment, or at the
  909      * end of the struct
  910      */
  911 
  912     /* init(): mandatory method, will be called during the
  913        graph initialization */
  914     int32_t (*init)(xlator_t *this);
  915 
  916     /* fini(): optional method, will be initialized to default
  917        method which would just free the 'xlator->private' variable.
  918        This method is called when the graph is no more in use, and
  919        is being destroyed. Also when SIGTERM is received */
  920     void (*fini)(xlator_t *this);
  921 
  922     /* reconfigure(): optional method, will be initialized to default
  923        method in case not provided by xlator. This method is called
  924        when there are only option changes in xlator, and no graph change.
  925        eg., a 'gluster volume set' command */
  926     int32_t (*reconfigure)(xlator_t *this, dict_t *options);
  927 
  928     /* mem_acct_init(): used for memory accounting inside of the xlator.
  929        optional. called during translator initialization */
  930     int32_t (*mem_acct_init)(xlator_t *this);
  931 
  932     /* dump_metrics(): used for providing internal metrics. optional */
  933     int32_t (*dump_metrics)(xlator_t *this, int fd);
  934 
  935     /* notify(): used for handling the notification of events from either
  936        the parent or child in the graph. optional. */
  937     event_notify_fn_t notify;
  938 
  939     /* struct fops: mandatory. provides all the filesystem operations
  940        methods of the xlator */
  941     struct xlator_fops *fops;
  942     /* struct cbks: optional. provides methods to handle
  943        inode forgets, and fd releases */
  944     struct xlator_cbks *cbks;
  945 
  946     /* dumpops: a structure again, with methods to dump the details.
  947        optional. */
  948     struct xlator_dumpops *dumpops;
  949 
  950     /* struct pass_through_fops: optional. provides all the filesystem
  951        operations which should be used if the xlator is marked as pass_through
  952      */
  953     /* by default, the default_fops would be used */
  954     struct xlator_fops *pass_through_fops;
  955 } xlator_api_t;
  956 
  957 #define xlator_has_parent(xl) (xl->parents != NULL)
  958 
  959 #define XLATOR_NOTIFY(ret, _xl, params...)                                     \
  960     do {                                                                       \
  961         xlator_t *_old_THIS = NULL;                                            \
  962                                                                                \
  963         _old_THIS = THIS;                                                      \
  964         THIS = _xl;                                                            \
  965                                                                                \
  966         ret = _xl->notify(_xl, params);                                        \
  967                                                                                \
  968         THIS = _old_THIS;                                                      \
  969     } while (0);
  970 
  971 int32_t
  972 xlator_set_type_virtual(xlator_t *xl, const char *type);
  973 
  974 int32_t
  975 xlator_set_type(xlator_t *xl, const char *type);
  976 
  977 int32_t
  978 xlator_dynload(xlator_t *xl);
  979 
  980 xlator_t *
  981 file_to_xlator_tree(glusterfs_ctx_t *ctx, FILE *fp);
  982 
  983 int
  984 xlator_notify(xlator_t *this, int32_t event, void *data, ...);
  985 int
  986 xlator_init(xlator_t *this);
  987 int
  988 xlator_destroy(xlator_t *xl);
  989 
  990 int32_t
  991 xlator_tree_init(xlator_t *xl);
  992 int32_t
  993 xlator_tree_free_members(xlator_t *xl);
  994 int32_t
  995 xlator_tree_free_memacct(xlator_t *xl);
  996 
  997 void
  998 xlator_tree_fini(xlator_t *xl);
  999 
 1000 void
 1001 xlator_foreach(xlator_t *this, void (*fn)(xlator_t *each, void *data),
 1002                void *data);
 1003 
 1004 void
 1005 xlator_foreach_depth_first(xlator_t *this,
 1006                            void (*fn)(xlator_t *each, void *data), void *data);
 1007 
 1008 xlator_t *
 1009 xlator_search_by_name(xlator_t *any, const char *name);
 1010 xlator_t *
 1011 get_xlator_by_name(xlator_t *this, char *target);
 1012 xlator_t *
 1013 get_xlator_by_type(xlator_t *this, char *target);
 1014 
 1015 void
 1016 xlator_set_inode_lru_limit(xlator_t *this, void *data);
 1017 
 1018 void
 1019 inode_destroy_notify(inode_t *inode, const char *xlname);
 1020 
 1021 int
 1022 loc_copy(loc_t *dst, loc_t *src);
 1023 int
 1024 loc_copy_overload_parent(loc_t *dst, loc_t *src, inode_t *parent);
 1025 #define loc_dup(src, dst) loc_copy(dst, src)
 1026 void
 1027 loc_wipe(loc_t *loc);
 1028 int
 1029 loc_path(loc_t *loc, const char *bname);
 1030 void
 1031 loc_gfid(loc_t *loc, uuid_t gfid);
 1032 void
 1033 loc_pargfid(loc_t *loc, uuid_t pargfid);
 1034 char *
 1035 loc_gfid_utoa(loc_t *loc);
 1036 gf_boolean_t
 1037 loc_is_root(loc_t *loc);
 1038 int32_t
 1039 loc_build_child(loc_t *child, loc_t *parent, char *name);
 1040 gf_boolean_t
 1041 loc_is_nameless(loc_t *loc);
 1042 int
 1043 xlator_mem_acct_init(xlator_t *xl, int num_types);
 1044 void
 1045 xlator_mem_acct_unref(struct mem_acct *mem_acct);
 1046 int
 1047 is_gf_log_command(xlator_t *trans, const char *name, char *value, size_t size);
 1048 int
 1049 glusterd_check_log_level(const char *value);
 1050 int
 1051 xlator_volopt_dynload(char *xlator_type, void **dl_handle,
 1052                       volume_opt_list_t *vol_opt_handle);
 1053 enum gf_hdsk_event_notify_op {
 1054     GF_EN_DEFRAG_STATUS,
 1055     GF_EN_MAX,
 1056 };
 1057 gf_boolean_t
 1058 is_graph_topology_equal(glusterfs_graph_t *graph1, glusterfs_graph_t *graph2);
 1059 int
 1060 glusterfs_volfile_reconfigure(FILE *newvolfile_fp, glusterfs_ctx_t *ctx);
 1061 
 1062 int
 1063 gf_volfile_reconfigure(int oldvollen, FILE *newvolfile_fp, glusterfs_ctx_t *ctx,
 1064                        const char *oldvolfile);
 1065 
 1066 int
 1067 loc_touchup(loc_t *loc, const char *name);
 1068 
 1069 int
 1070 glusterfs_leaf_position(xlator_t *tgt);
 1071 
 1072 int
 1073 glusterfs_reachable_leaves(xlator_t *base, dict_t *leaves);
 1074 
 1075 int
 1076 xlator_subvolume_count(xlator_t *this);
 1077 
 1078 void
 1079 xlator_init_lock(void);
 1080 void
 1081 xlator_init_unlock(void);
 1082 int
 1083 copy_opts_to_child(xlator_t *src, xlator_t *dst, char *glob);
 1084 
 1085 int
 1086 glusterfs_delete_volfile_checksum(glusterfs_ctx_t *ctx, const char *volfile_id);
 1087 int
 1088 xlator_memrec_free(xlator_t *xl);
 1089 
 1090 void
 1091 xlator_mem_cleanup(xlator_t *this);
 1092 
 1093 void
 1094 handle_default_options(xlator_t *xl, dict_t *options);
 1095 
 1096 void
 1097 gluster_graph_take_reference(xlator_t *tree);
 1098 
 1099 gf_boolean_t
 1100 mgmt_is_multiplexed_daemon(char *name);
 1101 
 1102 gf_boolean_t
 1103 xlator_is_cleanup_starting(xlator_t *this);
 1104 int
 1105 graph_total_client_xlator(glusterfs_graph_t *graph);
 1106 #endif /* _XLATOR_H */