"Fossies" - the Fresh Open Source Software Archive

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

    1 /*
    2   Copyright 2014-present Facebook. All Rights Reserved
    3 
    4   This file is part of GlusterFS.
    5 
    6    Author :
    7    Shreyas Siravara <shreyas.siravara@gmail.com>
    8 
    9   This file is licensed to you under your choice of the GNU Lesser
   10   General Public License, version 3 or any later version (LGPLv3 or
   11   later), or the GNU General Public License, version 2 (GPLv2), in all
   12   cases as published by the Free Software Foundation.
   13 */
   14 
   15 #ifndef _AUTH_CACHE_H_
   16 #define _AUTH_CACHE_H_
   17 
   18 #include "nfs-mem-types.h"
   19 #include "exports.h"
   20 #include <glusterfs/dict.h>
   21 #include "nfs3.h"
   22 
   23 struct auth_cache {
   24     gf_lock_t lock;     /* locking for the dict (and entries) */
   25     dict_t *cache_dict; /* Dict holding fh -> authcache_entry */
   26     time_t ttl_sec;     /* TTL of the auth cache in seconds */
   27 };
   28 
   29 /* Initializes the cache */
   30 struct auth_cache *
   31 auth_cache_init(time_t ttl_sec);
   32 
   33 /* Inserts FH into cache */
   34 int
   35 cache_nfs_fh(struct auth_cache *cache, struct nfs3_fh *fh,
   36              const char *host_addr, struct export_item *export_item);
   37 
   38 /* Checks if the filehandle cached & writable */
   39 gf_boolean_t
   40 is_nfs_fh_cached_and_writeable(struct auth_cache *cache, struct nfs3_fh *fh,
   41                                const char *host_addr);
   42 
   43 /* Checks if the filehandle is cached */
   44 gf_boolean_t
   45 is_nfs_fh_cached(struct auth_cache *cache, struct nfs3_fh *fh,
   46                  const char *host_addr);
   47 
   48 /* Purge the cache */
   49 void
   50 auth_cache_purge(struct auth_cache *cache);
   51 
   52 #endif /* _AUTH_CACHE_H_ */