"Fossies" - the Fresh Open Source Software Archive

Member "glusterfs-8.2/xlators/storage/posix/src/posix.h" (16 Sep 2020, 22832 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 "posix.h" see the Fossies "Dox" file reference documentation and the last Fossies "Diffs" side-by-side code changes report: 8.0_vs_8.1.

    1 /*
    2    Copyright (c) 2006-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 #ifndef _POSIX_H
   11 #define _POSIX_H
   12 
   13 #include <stdio.h>
   14 #include <unistd.h>
   15 #include <sys/types.h>
   16 #include <dirent.h>
   17 #include <time.h>
   18 
   19 #ifdef HAVE_SET_FSID
   20 #include <sys/fsuid.h>
   21 #endif
   22 
   23 #ifdef HAVE_SYS_XATTR_H
   24 #include <sys/xattr.h>
   25 #endif
   26 
   27 #ifdef HAVE_SYS_EXTATTR_H
   28 #include <sys/extattr.h>
   29 #endif
   30 
   31 #include <glusterfs/compat.h>
   32 #include <glusterfs/timer.h>
   33 #include "posix-mem-types.h"
   34 #include <glusterfs/call-stub.h>
   35 
   36 #ifdef HAVE_LIBAIO
   37 #include <libaio.h>
   38 #include "posix-aio.h"
   39 #endif
   40 
   41 #define VECTOR_SIZE 64 * 1024 /* vector size 64KB*/
   42 #define MAX_NO_VECT 1024
   43 
   44 #define XATTR_KEY_BUF_SIZE 4096
   45 #define XATTR_VAL_BUF_SIZE 8192
   46 
   47 #define ACL_BUFFER_MAX 4096 /* size of character buffer */
   48 
   49 #define DHT_LINKTO "trusted.glusterfs.dht.linkto"
   50 
   51 #define POSIX_GFID_HANDLE_SIZE(base_path_len)                                  \
   52     (base_path_len + SLEN("/") + SLEN(GF_HIDDEN_PATH) + SLEN("/") +            \
   53      SLEN("00/") + SLEN("00/") + SLEN(UUID0_STR) + 1) /* '\0' */;
   54 
   55 #define POSIX_GFID_HANDLE_RELSIZE                                              \
   56     SLEN("../") + SLEN("../") + SLEN("00/") + SLEN("00/") + SLEN(UUID0_STR) + 1;
   57 
   58 #define GF_UNLINK_TRUE 0x0000000000000001
   59 #define GF_UNLINK_FALSE 0x0000000000000000
   60 
   61 #define DISK_SPACE_CHECK_AND_GOTO(frame, priv, xdata, op_ret, op_errno, out)   \
   62     do {                                                                       \
   63         if (frame->root->pid >= 0 && priv->disk_space_full &&                  \
   64             !dict_get_sizen(xdata, GLUSTERFS_INTERNAL_FOP_KEY)) {              \
   65             op_ret = -1;                                                       \
   66             op_errno = ENOSPC;                                                 \
   67             gf_msg_debug("posix", ENOSPC,                                      \
   68                          "disk space utilization reached limits"               \
   69                          " for path %s ",                                      \
   70                          priv->base_path);                                     \
   71             goto out;                                                          \
   72         }                                                                      \
   73     } while (0)
   74 
   75 /* Setting microseconds or nanoseconds depending on what's supported:
   76    The passed in `tv` can be
   77        struct timespec
   78    if supported (better, because it supports nanosecond resolution) or
   79        struct timeval
   80    otherwise. */
   81 #if HAVE_UTIMENSAT
   82 #define SET_TIMESPEC_NSEC_OR_TIMEVAL_USEC(tv, nanosecs) tv.tv_nsec = nanosecs
   83 #define PATH_SET_TIMESPEC_OR_TIMEVAL(path, tv)                                 \
   84     (sys_utimensat(AT_FDCWD, path, tv, AT_SYMLINK_NOFOLLOW))
   85 #else
   86 #define SET_TIMESPEC_NSEC_OR_TIMEVAL_USEC(tv, nanosecs)                        \
   87     tv.tv_usec = nanosecs / 1000
   88 #define PATH_SET_TIMESPEC_OR_TIMEVAL(path, tv) (lutimes(path, tv))
   89 #endif
   90 
   91 #define GFID_NULL_CHECK_AND_GOTO(frame, this, loc, xattr_req, op_ret,          \
   92                                  op_errno, _uuid_req, out)                     \
   93     do {                                                                       \
   94         int _ret = 0;                                                          \
   95         /* TODO: Remove pid check once trash implements client side            \
   96          * logic to assign gfid for entry creations inside .trashcan           \
   97          */                                                                    \
   98         if (frame->root->pid == GF_SERVER_PID_TRASH)                           \
   99             break;                                                             \
  100         _ret = dict_get_gfuuid(xattr_req, "gfid-req", &_uuid_req);             \
  101         if (_ret) {                                                            \
  102             gf_msg(this->name, GF_LOG_ERROR, EINVAL, P_MSG_NULL_GFID,          \
  103                    "failed to get the gfid from dict for %s", loc->path);      \
  104             op_ret = -1;                                                       \
  105             op_errno = EINVAL;                                                 \
  106             goto out;                                                          \
  107         }                                                                      \
  108         if (gf_uuid_is_null(_uuid_req)) {                                      \
  109             gf_msg(this->name, GF_LOG_ERROR, EINVAL, P_MSG_NULL_GFID,          \
  110                    "gfid is null for %s", loc->path);                          \
  111             op_ret = -1;                                                       \
  112             op_errno = EINVAL;                                                 \
  113             goto out;                                                          \
  114         }                                                                      \
  115     } while (0)
  116 
  117 /**
  118  * posix_fd - internal structure common to file and directory fd's
  119  */
  120 
  121 struct posix_fd {
  122     int fd;                /* fd returned by the kernel */
  123     int32_t flags;         /* flags for open/creat      */
  124     DIR *dir;              /* handle returned by the kernel */
  125     off_t dir_eof;         /* offset at dir EOF */
  126     struct list_head list; /* to add to the janitor list */
  127     int odirect;
  128     xlator_t *xl;
  129     char _pad[4]; /* manual padding */
  130 };
  131 
  132 struct posix_private {
  133     char *base_path;
  134     int32_t base_path_length;
  135     int32_t path_max;
  136 
  137     gf_lock_t lock;
  138 
  139     char *hostname;
  140     /* Statistics, provides activity of the server */
  141 
  142     struct timeval prev_fetch_time;
  143     struct timeval init_time;
  144 
  145     time_t last_landfill_check;
  146 
  147     gf_atomic_t read_value;  /* Total read, from init */
  148     gf_atomic_t write_value; /* Total write, from init */
  149 
  150     /* janitor task which cleans up /.trash (created by replicate) */
  151     struct gf_tw_timer_list *janitor;
  152 
  153     char *trash_path;
  154     /* lock for brick dir */
  155     int mount_lock;
  156 
  157     struct stat handledir;
  158 
  159     /* uuid of glusterd that swapned the brick process */
  160     uuid_t glusterd_uuid;
  161 
  162 #ifdef HAVE_LIBAIO
  163     io_context_t ctxp;
  164     pthread_t aiothread;
  165 #endif
  166 
  167     pthread_t fsyncer;
  168     struct list_head fsyncs;
  169     pthread_mutex_t fsync_mutex;
  170     pthread_cond_t fsync_cond;
  171     pthread_mutex_t janitor_mutex;
  172     pthread_cond_t janitor_cond;
  173     pthread_cond_t fd_cond;
  174     int fsync_queue_count;
  175     int32_t janitor_sleep_duration;
  176 
  177     enum {
  178         BATCH_NONE = 0,
  179         BATCH_SYNCFS,
  180         BATCH_SYNCFS_SINGLE_FSYNC,
  181         BATCH_REVERSE_FSYNC,
  182         BATCH_SYNCFS_REVERSE_FSYNC
  183     } batch_fsync_mode;
  184 
  185     uint32_t batch_fsync_delay_usec;
  186     char gfid2path_sep[8];
  187 
  188     /* seconds to sleep between health checks */
  189     uint32_t health_check_interval;
  190     /* seconds to sleep to wait for aio write finish for health checks */
  191     uint32_t health_check_timeout;
  192     pthread_t health_check;
  193 
  194     double disk_reserve;
  195     pthread_t disk_space_check;
  196     uint32_t disk_space_full;
  197 
  198 #ifdef GF_DARWIN_HOST_OS
  199     enum {
  200         XATTR_NONE = 0,
  201         XATTR_STRIP,
  202         XATTR_APPEND,
  203         XATTR_BOTH,
  204     } xattr_user_namespace;
  205 #endif
  206 
  207     /* Option to handle the cases of multiple bricks exported from
  208        same backend. Very much usable in brick-splitting feature. */
  209     int32_t shared_brick_count;
  210 
  211     /*Option to set mode bit permission that will always be set on
  212       file/directory. */
  213     mode_t force_create_mode;
  214     mode_t force_directory_mode;
  215     mode_t create_mask;
  216     mode_t create_directory_mask;
  217     uint32_t max_hardlinks;
  218     int32_t arrdfd[256];
  219     int dirfd;
  220 
  221     /* This option is used for either to call a landfill_purge or not */
  222     gf_boolean_t disable_landfill_purge;
  223 
  224     gf_boolean_t fips_mode_rchecksum;
  225     gf_boolean_t ctime;
  226     gf_boolean_t janitor_task_stop;
  227 
  228     gf_boolean_t disk_space_check_active;
  229     char disk_unit;
  230     gf_boolean_t health_check_active;
  231     gf_boolean_t update_pgfid_nlinks;
  232     gf_boolean_t gfid2path;
  233     /* node-uuid in pathinfo xattr */
  234     gf_boolean_t node_uuid_pathinfo;
  235     /*
  236        In some cases, two exported volumes may reside on the same
  237        partition on the server. Sending statvfs info for both
  238        the volumes will lead to erroneous df output at the client,
  239        since free space on the partition will be counted twice.
  240 
  241        In such cases, user can disable exporting statvfs info
  242        on one of the volumes by setting this option.
  243     */
  244     gf_boolean_t export_statfs;
  245 
  246     gf_boolean_t o_direct; /* always open files in O_DIRECT mode */
  247 
  248     /*
  249        decide whether posix_unlink does open (file), unlink (file), close (fd)
  250        instead of just unlink (file). with the former approach there is no
  251        lockout of access to parent directory during removal of very large files
  252        for the entire duration of freeing of data blocks.
  253     */
  254     gf_boolean_t background_unlink;
  255     gf_boolean_t aio_configured;
  256     gf_boolean_t aio_init_done;
  257     gf_boolean_t aio_capable;
  258     uint32_t rel_fdcount;
  259 };
  260 
  261 typedef struct {
  262     call_frame_t *frame;
  263     xlator_t *this;
  264     const char *real_path;
  265     dict_t *xattr;
  266     struct iatt *stbuf;
  267     loc_t *loc;
  268     inode_t *inode; /* for all do_xattrop() key handling */
  269     fd_t *fd;
  270     int fdnum;
  271     int flags;
  272     char *list;
  273     size_t list_size;
  274     int32_t op_errno;
  275 
  276     char _pad[4]; /* manual padding */
  277 } posix_xattr_filler_t;
  278 
  279 typedef struct {
  280     uint64_t unlink_flag;
  281     pthread_mutex_t xattrop_lock;
  282     pthread_mutex_t write_atomic_lock;
  283     pthread_mutex_t pgfid_lock;
  284 } posix_inode_ctx_t;
  285 
  286 #define POSIX_BASE_PATH(this)                                                  \
  287     (((struct posix_private *)this->private)->base_path)
  288 
  289 #define POSIX_BASE_PATH_LEN(this)                                              \
  290     (((struct posix_private *)this->private)->base_path_length)
  291 
  292 #define POSIX_PATH_MAX(this) (((struct posix_private *)this->private)->path_max)
  293 
  294 #define POSIX_GET_FILE_UNLINK_PATH(base_path, gfid, unlink_path)               \
  295     do {                                                                       \
  296         int path_len = 0;                                                      \
  297         char gfid_str[64] = {0};                                               \
  298         uuid_utoa_r(gfid, gfid_str);                                           \
  299         path_len = strlen(base_path) + 1 + SLEN(GF_UNLINK_PATH) + 1 +          \
  300                    UUID_CANONICAL_FORM_LEN + 1;                                \
  301         unlink_path = alloca(path_len);                                        \
  302         if (!unlink_path) {                                                    \
  303             gf_msg("posix", GF_LOG_ERROR, ENOMEM, P_MSG_UNLINK_FAILED,         \
  304                    "Failed to get unlink_path");                               \
  305             break;                                                             \
  306         }                                                                      \
  307         sprintf(unlink_path, "%s/%s/%s", base_path, GF_UNLINK_PATH, gfid_str); \
  308     } while (0)
  309 
  310 /* Helper functions */
  311 int
  312 posix_inode_ctx_set_unlink_flag(inode_t *inode, xlator_t *this, uint64_t ctx);
  313 
  314 int
  315 posix_inode_ctx_get_all(inode_t *inode, xlator_t *this,
  316                         posix_inode_ctx_t **ctx);
  317 
  318 int
  319 __posix_inode_ctx_set_unlink_flag(inode_t *inode, xlator_t *this, uint64_t ctx);
  320 
  321 int
  322 __posix_inode_ctx_get_all(inode_t *inode, xlator_t *this,
  323                           posix_inode_ctx_t **ctx);
  324 
  325 int
  326 posix_gfid_set(xlator_t *this, const char *path, loc_t *loc, dict_t *xattr_req,
  327                pid_t pid, int *op_errno);
  328 int
  329 posix_fdstat(xlator_t *this, inode_t *inode, int fd, struct iatt *stbuf_p);
  330 int
  331 posix_istat(xlator_t *this, inode_t *inode, uuid_t gfid, const char *basename,
  332             struct iatt *iatt);
  333 int
  334 posix_pstat(xlator_t *this, inode_t *inode, uuid_t gfid, const char *real_path,
  335             struct iatt *iatt, gf_boolean_t inode_locked);
  336 
  337 dict_t *
  338 posix_xattr_fill(xlator_t *this, const char *path, loc_t *loc, fd_t *fd,
  339                  int fdnum, dict_t *xattr, struct iatt *buf);
  340 int
  341 posix_handle_pair(xlator_t *this, loc_t *loc, const char *real_path, char *key,
  342                   data_t *value, int flags, struct iatt *stbuf);
  343 int
  344 posix_fhandle_pair(call_frame_t *frame, xlator_t *this, int fd, char *key,
  345                    data_t *value, int flags, struct iatt *stbuf, fd_t *_fd);
  346 void
  347 posix_janitor_timer_start(xlator_t *this);
  348 int
  349 posix_acl_xattr_set(xlator_t *this, const char *path, dict_t *xattr_req);
  350 int
  351 posix_gfid_heal(xlator_t *this, const char *path, loc_t *loc,
  352                 dict_t *xattr_req);
  353 int
  354 posix_entry_create_xattr_set(xlator_t *this, loc_t *loc, const char *path,
  355                              dict_t *dict);
  356 
  357 int
  358 posix_fd_ctx_get(fd_t *fd, xlator_t *this, struct posix_fd **pfd,
  359                  int *op_errno);
  360 void
  361 posix_fill_ino_from_gfid(xlator_t *this, struct iatt *buf);
  362 
  363 gf_boolean_t
  364 posix_special_xattr(char **pattern, char *key);
  365 
  366 void
  367 __posix_fd_set_odirect(fd_t *fd, struct posix_fd *pfd, int opflags,
  368                        off_t offset, size_t size);
  369 int
  370 posix_spawn_health_check_thread(xlator_t *this);
  371 
  372 int
  373 posix_spawn_disk_space_check_thread(xlator_t *this);
  374 
  375 void *
  376 posix_fsyncer(void *);
  377 int
  378 posix_get_ancestry(xlator_t *this, inode_t *leaf_inode, gf_dirent_t *head,
  379                    char **path, int type, int32_t *op_errno, dict_t *xdata);
  380 int
  381 posix_handle_mdata_xattr(call_frame_t *frame, const char *name, int *op_errno);
  382 int
  383 posix_handle_georep_xattrs(call_frame_t *, const char *, int *, gf_boolean_t);
  384 int32_t
  385 posix_resolve_dirgfid_to_path(const uuid_t dirgfid, const char *brick_path,
  386                               const char *bname, char **path);
  387 void
  388 posix_gfid_unset(xlator_t *this, dict_t *xdata);
  389 
  390 int
  391 posix_pacl_get(const char *path, int fdnum, const char *key, char **acl_s);
  392 
  393 int32_t
  394 posix_get_objectsignature(char *, dict_t *);
  395 
  396 int32_t
  397 posix_fdget_objectsignature(int, dict_t *);
  398 
  399 gf_boolean_t
  400 posix_is_bulk_removexattr(char *name, dict_t *dict);
  401 
  402 int32_t
  403 posix_set_iatt_in_dict(dict_t *, struct iatt *, struct iatt *);
  404 
  405 mode_t posix_override_umask(mode_t, mode_t);
  406 
  407 int32_t
  408 posix_priv(xlator_t *this);
  409 
  410 int32_t
  411 posix_inode(xlator_t *this);
  412 
  413 void
  414 posix_fini(xlator_t *this);
  415 
  416 int
  417 posix_init(xlator_t *this);
  418 
  419 int
  420 posix_reconfigure(xlator_t *this, dict_t *options);
  421 
  422 int32_t
  423 posix_notify(xlator_t *this, int32_t event, void *data, ...);
  424 
  425 /* posix-entry-ops.c FOP signatures */
  426 int32_t
  427 posix_lookup(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata);
  428 
  429 int
  430 posix_create(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags,
  431              mode_t mode, mode_t umask, fd_t *fd, dict_t *xdata);
  432 
  433 int
  434 posix_symlink(call_frame_t *frame, xlator_t *this, const char *linkname,
  435               loc_t *loc, mode_t umask, dict_t *xdata);
  436 
  437 int
  438 posix_rename(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc,
  439              dict_t *xdata);
  440 
  441 int
  442 posix_link(call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc,
  443            dict_t *xdata);
  444 
  445 int
  446 posix_mknod(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode,
  447             dev_t dev, mode_t umask, dict_t *xdata);
  448 
  449 int
  450 posix_mkdir(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode,
  451             mode_t umask, dict_t *xdata);
  452 
  453 int32_t
  454 posix_unlink(call_frame_t *frame, xlator_t *this, loc_t *loc, int xflag,
  455              dict_t *xdata);
  456 
  457 int
  458 posix_rmdir(call_frame_t *frame, xlator_t *this, loc_t *loc, int flags,
  459             dict_t *xdata);
  460 
  461 /* posix-inode-fs-ops.c FOP signatures */
  462 int
  463 posix_forget(xlator_t *this, inode_t *inode);
  464 
  465 int32_t
  466 posix_discover(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata);
  467 
  468 int32_t
  469 posix_stat(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata);
  470 
  471 int
  472 posix_setattr(call_frame_t *frame, xlator_t *this, loc_t *loc,
  473               struct iatt *stbuf, int32_t valid, dict_t *xdata);
  474 
  475 int
  476 posix_fsetattr(call_frame_t *frame, xlator_t *this, fd_t *fd,
  477                struct iatt *stbuf, int32_t valid, dict_t *xdata);
  478 
  479 int32_t
  480 posix_discard(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset,
  481               size_t len, dict_t *xdata);
  482 
  483 int32_t
  484 posix_zerofill(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset,
  485                off_t len, dict_t *xdata);
  486 
  487 int32_t
  488 posix_glfallocate(call_frame_t *frame, xlator_t *this, fd_t *fd,
  489                   int32_t keep_size, off_t offset, size_t len, dict_t *xdata);
  490 
  491 int32_t
  492 posix_ipc(call_frame_t *frame, xlator_t *this, int32_t op, dict_t *xdata);
  493 
  494 int32_t
  495 posix_seek(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset,
  496            gf_seek_what_t what, dict_t *xdata);
  497 
  498 int32_t
  499 posix_opendir(call_frame_t *frame, xlator_t *this, loc_t *loc, fd_t *fd,
  500               dict_t *xdata);
  501 
  502 int32_t
  503 posix_releasedir(xlator_t *this, fd_t *fd);
  504 
  505 int32_t
  506 posix_readlink(call_frame_t *frame, xlator_t *this, loc_t *loc, size_t size,
  507                dict_t *xdata);
  508 
  509 int32_t
  510 posix_truncate(call_frame_t *frame, xlator_t *this, loc_t *loc, off_t offset,
  511                dict_t *xdata);
  512 
  513 int32_t
  514 posix_open(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags,
  515            fd_t *fd, dict_t *xdata);
  516 
  517 int
  518 posix_readv(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size,
  519             off_t offset, uint32_t flags, dict_t *xdata);
  520 
  521 int32_t
  522 posix_writev(call_frame_t *frame, xlator_t *this, fd_t *fd,
  523              struct iovec *vector, int32_t count, off_t offset, uint32_t flags,
  524              struct iobref *iobref, dict_t *xdata);
  525 
  526 int32_t
  527 posix_statfs(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xdata);
  528 
  529 int32_t
  530 posix_flush(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata);
  531 
  532 int32_t
  533 posix_release(xlator_t *this, fd_t *fd);
  534 
  535 int32_t
  536 posix_fsync(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t datasync,
  537             dict_t *xdata);
  538 
  539 int32_t
  540 posix_setxattr(call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *dict,
  541                int flags, dict_t *xdata);
  542 
  543 int
  544 posix_get_ancestry_non_directory(xlator_t *this, inode_t *leaf_inode,
  545                                  gf_dirent_t *head, char **path, int type,
  546                                  int32_t *op_errno, dict_t *xdata);
  547 
  548 int
  549 posix_get_ancestry(xlator_t *this, inode_t *leaf_inode, gf_dirent_t *head,
  550                    char **path, int type, int32_t *op_errno, dict_t *xdata);
  551 
  552 int32_t
  553 posix_getxattr(call_frame_t *frame, xlator_t *this, loc_t *loc,
  554                const char *name, dict_t *xdata);
  555 
  556 int32_t
  557 posix_fgetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, const char *name,
  558                 dict_t *xdata);
  559 
  560 int32_t
  561 posix_fsetxattr(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *dict,
  562                 int flags, dict_t *xdata);
  563 
  564 int32_t
  565 posix_removexattr(call_frame_t *frame, xlator_t *this, loc_t *loc,
  566                   const char *name, dict_t *xdata);
  567 
  568 int32_t
  569 posix_fremovexattr(call_frame_t *frame, xlator_t *this, fd_t *fd,
  570                    const char *name, dict_t *xdata);
  571 
  572 int32_t
  573 posix_fsyncdir(call_frame_t *frame, xlator_t *this, fd_t *fd, int datasync,
  574                dict_t *xdata);
  575 
  576 int
  577 posix_xattrop(call_frame_t *frame, xlator_t *this, loc_t *loc,
  578               gf_xattrop_flags_t optype, dict_t *xattr, dict_t *xdata);
  579 
  580 int
  581 posix_fxattrop(call_frame_t *frame, xlator_t *this, fd_t *fd,
  582                gf_xattrop_flags_t optype, dict_t *xattr, dict_t *xdata);
  583 
  584 int
  585 posix_access(call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t mask,
  586              dict_t *xdata);
  587 
  588 int32_t
  589 posix_ftruncate(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset,
  590                 dict_t *xdata);
  591 
  592 int32_t
  593 posix_fstat(call_frame_t *frame, xlator_t *this, fd_t *fd, dict_t *xdata);
  594 
  595 int32_t
  596 posix_lease(call_frame_t *frame, xlator_t *this, loc_t *loc,
  597             struct gf_lease *lease, dict_t *xdata);
  598 
  599 int32_t
  600 posix_lk(call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t cmd,
  601          struct gf_flock *lock, dict_t *xdata);
  602 
  603 int32_t
  604 posix_inodelk(call_frame_t *frame, xlator_t *this, const char *volume,
  605               loc_t *loc, int32_t cmd, struct gf_flock *lock, dict_t *xdata);
  606 
  607 int32_t
  608 posix_finodelk(call_frame_t *frame, xlator_t *this, const char *volume,
  609                fd_t *fd, int32_t cmd, struct gf_flock *lock, dict_t *xdata);
  610 
  611 int32_t
  612 posix_entrylk(call_frame_t *frame, xlator_t *this, const char *volume,
  613               loc_t *loc, const char *basename, entrylk_cmd cmd,
  614               entrylk_type type, dict_t *xdata);
  615 
  616 int32_t
  617 posix_fentrylk(call_frame_t *frame, xlator_t *this, const char *volume,
  618                fd_t *fd, const char *basename, entrylk_cmd cmd,
  619                entrylk_type type, dict_t *xdata);
  620 
  621 int32_t
  622 posix_readdir(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size,
  623               off_t off, dict_t *xdata);
  624 
  625 int32_t
  626 posix_readdirp(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size,
  627                off_t off, dict_t *dict);
  628 
  629 int32_t
  630 posix_rchecksum(call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset,
  631                 int32_t len, dict_t *xdata);
  632 
  633 int32_t
  634 posix_put(call_frame_t *frame, xlator_t *this, loc_t *loc, mode_t mode,
  635           mode_t umask, uint32_t flags, struct iovec *vector, int32_t count,
  636           off_t offset, struct iobref *iobref, dict_t *xattr, dict_t *xdata);
  637 
  638 int32_t
  639 posix_copy_file_range(call_frame_t *frame, xlator_t *this, fd_t *fd_in,
  640                       off64_t off_in, fd_t *fd_out, off64_t off_out, size_t len,
  641                       uint32_t flags, dict_t *xdata);
  642 
  643 int32_t
  644 posix_set_mode_in_dict(dict_t *in_dict, dict_t *out_dict,
  645                        struct iatt *in_stbuf);
  646 
  647 gf_cs_obj_state
  648 posix_cs_check_status(xlator_t *this, const char *realpath, int *fd,
  649                       struct iatt *buf);
  650 
  651 int
  652 posix_cs_set_state(xlator_t *this, dict_t **rsp, gf_cs_obj_state state,
  653                    char const *path, int *fd);
  654 
  655 gf_cs_obj_state
  656 posix_cs_heal_state(xlator_t *this, const char *path, int *fd,
  657                     struct iatt *stbuf);
  658 int
  659 posix_cs_maintenance(xlator_t *this, fd_t *fd, loc_t *loc, int *pfd,
  660                      struct iatt *buf, const char *realpath, dict_t *xattr_req,
  661                      dict_t **xattr_rsp, gf_boolean_t ignore_failure);
  662 int
  663 posix_check_dev_file(xlator_t *this, inode_t *inode, char *fop, int *op_errno);
  664 
  665 int
  666 posix_spawn_ctx_janitor_thread(xlator_t *this);
  667 
  668 void
  669 posix_update_iatt_buf(struct iatt *buf, int fd, char *loc, dict_t *xdata);
  670 
  671 gf_boolean_t
  672 posix_is_layout_stale(dict_t *xdata, char *par_path, xlator_t *this);
  673 
  674 #endif /* _POSIX_H */