"Fossies" - the Fresh Open Source Software Archive

Member "glusterfs-8.2/xlators/protocol/server/src/server-helpers.h" (16 Sep 2020, 3028 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 "server-helpers.h" see the Fossies "Dox" file reference documentation.

    1 /*
    2   Copyright (c) 2010-2013 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 _SERVER_HELPERS_H
   12 #define _SERVER_HELPERS_H
   13 
   14 #include "server.h"
   15 #include <glusterfs/defaults.h>
   16 
   17 #define CALL_STATE(frame) ((server_state_t *)frame->root->state)
   18 
   19 #define XPRT_FROM_FRAME(frame) ((rpc_transport_t *)CALL_STATE(frame)->xprt)
   20 
   21 #define SERVER_CONF(frame)                                                     \
   22     ((server_conf_t *)XPRT_FROM_FRAME(frame)->this->private)
   23 
   24 #define XPRT_FROM_XLATOR(this) ((((server_conf_t *)this->private))->listen)
   25 
   26 #define INODE_LRU_LIMIT(this)                                                  \
   27     (((server_conf_t *)(this->private))->config.inode_lru_limit)
   28 
   29 #define IS_ROOT_INODE(inode) (inode == inode->table->root)
   30 
   31 #define IS_NOT_ROOT(pathlen) ((pathlen > 2) ? 1 : 0)
   32 
   33 void
   34 free_state(server_state_t *state);
   35 
   36 void
   37 server_loc_wipe(loc_t *loc);
   38 
   39 void
   40 server_print_request(call_frame_t *frame);
   41 
   42 call_frame_t *
   43 get_frame_from_request(rpcsvc_request_t *req);
   44 
   45 int
   46 server_connection_cleanup(xlator_t *this, struct _client *client, int32_t flags,
   47                           gf_boolean_t *fd_exist);
   48 
   49 int
   50 server_build_config(xlator_t *this, server_conf_t *conf);
   51 
   52 int
   53 serialize_rsp_dirent(gf_dirent_t *entries, gfs3_readdir_rsp *rsp);
   54 int
   55 serialize_rsp_direntp(gf_dirent_t *entries, gfs3_readdirp_rsp *rsp);
   56 int
   57 readdirp_rsp_cleanup(gfs3_readdirp_rsp *rsp);
   58 int
   59 readdir_rsp_cleanup(gfs3_readdir_rsp *rsp);
   60 int
   61 readdirp_rsp_cleanup_v2(gfx_readdirp_rsp *rsp);
   62 int
   63 readdir_rsp_cleanup_v2(gfx_readdir_rsp *rsp);
   64 int
   65 auth_set_username_passwd(dict_t *input_params, dict_t *config_params,
   66                          struct _client *client);
   67 
   68 server_ctx_t *
   69 server_ctx_get(client_t *client, xlator_t *xlator);
   70 int
   71 server_process_event_upcall(xlator_t *this, void *data);
   72 
   73 inode_t *
   74 server_inode_new(inode_table_t *itable, uuid_t gfid);
   75 
   76 int
   77 serialize_rsp_locklist(lock_migration_info_t *locklist,
   78                        gfs3_getactivelk_rsp *rsp);
   79 int
   80 serialize_rsp_locklist_v2(lock_migration_info_t *locklist,
   81                           gfx_getactivelk_rsp *rsp);
   82 
   83 int
   84 getactivelkinfo_rsp_cleanup(gfs3_getactivelk_rsp *rsp);
   85 int
   86 getactivelkinfo_rsp_cleanup_v2(gfx_getactivelk_rsp *rsp);
   87 
   88 int
   89 unserialize_req_locklist(gfs3_setactivelk_req *req, lock_migration_info_t *lmi);
   90 
   91 int
   92 unserialize_req_locklist_v2(gfx_setactivelk_req *req,
   93                             lock_migration_info_t *lmi);
   94 
   95 int
   96 serialize_rsp_dirent(gf_dirent_t *entries, gfs3_readdir_rsp *rsp);
   97 
   98 int
   99 serialize_rsp_direntp(gf_dirent_t *entries, gfs3_readdirp_rsp *rsp);
  100 
  101 int
  102 serialize_rsp_dirent_v2(gf_dirent_t *entries, gfx_readdir_rsp *rsp);
  103 
  104 int
  105 serialize_rsp_direntp_v2(gf_dirent_t *entries, gfx_readdirp_rsp *rsp);
  106 
  107 #endif /* !_SERVER_HELPERS_H */