nfs-ganesha 1.4
|
Get and eventually cache an entry. More...
#include "LRU_List.h"
#include "log.h"
#include "HashData.h"
#include "HashTable.h"
#include "fsal.h"
#include "cache_inode.h"
#include "cache_inode_lru.h"
#include <unistd.h>
#include <sys/types.h>
#include <sys/param.h>
#include <time.h>
#include <pthread.h>
#include <assert.h>
Go to the source code of this file.
Functions | |
cache_entry_t * | cache_inode_get (cache_inode_fsal_data_t *fsdata, fsal_attrib_list_t *attr, fsal_op_context_t *context, cache_entry_t *associated, cache_inode_status_t *status) |
Gets an entry by using its fsdata as a key and caches it if needed. | |
void | cache_inode_put (cache_entry_t *entry) |
Get and eventually cache an entry.
cache_inode_get.c : Get and eventually cache an entry.
Definition in file cache_inode_get.c.
cache_entry_t* cache_inode_get | ( | cache_inode_fsal_data_t * | fsdata, |
fsal_attrib_list_t * | attr, | ||
fsal_op_context_t * | context, | ||
cache_entry_t * | associated, | ||
cache_inode_status_t * | status | ||
) |
Gets an entry by using its fsdata as a key and caches it if needed.
Gets an entry by using its fsdata as a key and caches it if needed.
If a cache entry is returned, its refcount is incremented by one.
It turns out we do need cache_inode_get_located functionality for cases like lookupp on an entry returning itself when it isn't a root. Therefore, if the 'associated' parameter is equal to the got cache entry, a reference count is incremented but the structure pointed to by attr is NOT filled in.
[in] | fsdata | File system data |
[out] | attr | The attributes of the got entry |
[in] | context | FSAL credentials |
[in] | associated | Entry that may be equal to the got entry |
[out] | status | Returned status |
Definition at line 84 of file cache_inode_get.c.
void cache_inode_put | ( | cache_entry_t * | entry | ) |
cache_inode_put: release logical reference to a cache entry conferred by a previous call to cache_inode_get (cache_inode_get_located).
The result is typically to decrement the reference count on entry, but additional side effects include LRU adjustment, movement to/from the protected LRU partition, or recyling if the caller has raced an operation which made entry unreachable (and this current caller has the last reference). Caller MUST NOT make further accesses to the memory pointed to by entry.
[in] | entry | Cache entry being returned |
Definition at line 269 of file cache_inode_get.c.