nfs-ganesha 1.4
Functions

cache_inode_get.c File Reference

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_tcache_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)

Detailed Description

Get and eventually cache an entry.

Author:
Author:
deniel
Date:
Date:
2005/11/28 17:02:26
Version:
Revision:
1.26

cache_inode_get.c : Get and eventually cache an entry.

Definition in file cache_inode_get.c.


Function Documentation

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.

Parameters:
[in]fsdataFile system data
[out]attrThe attributes of the got entry
[in]contextFSAL credentials
[in]associatedEntry that may be equal to the got entry
[out]statusReturned status
Returns:
If successful, the pointer to the entry; NULL otherwise

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.

Parameters:
[in]entryCache entry being returned
Returns:
CACHE_INDOE_STATUS or error codes

Definition at line 269 of file cache_inode_get.c.