nfs-ganesha 1.4
|
Represents a cached inode. More...
#include <cache_inode.h>
Classes | |
union | cache_inode_fsobj__ |
Public Attributes | |
fsal_handle_t | handle |
struct fsal_handle_desc | fh_desc |
gweakref_t | weakref |
cache_inode_file_type_t | type |
uint32_t | flags |
time_t | change_time |
time_t | attr_time |
cache_inode_lru_t | lru |
pthread_rwlock_t | attr_lock |
fsal_attrib_list_t | attributes |
pthread_rwlock_t | state_lock |
struct glist_head | state_list |
pthread_rwlock_t | content_lock |
union cache_entry_t::cache_inode_fsobj__ | object |
Represents a cached inode.
Information representing a cached file (inode) including metadata, and for directories and symlinks, pointers to cached content. This is also the anchor for state held on a file.
Regarding the locking discipline:
(1) The attributes field is protected by attr_lock.
(2) content_lock must be held for WRITE when modifying the AVL tree of a directory or any dirent contained therein. It must be held for READ when accessing any of this information.
(3) content_lock must be held for WRITE when caching or disposing of a file descriptor and when writing data into the Ganesha data cache. It must be held for READ when accessing the cached descriptor or reading data out of the data cache.
(4) content_lock must be held for WRITE when updating the cached content of a symlink or when NULLing the object.symlink pointer preparatory to freeing the link structure. It must be held for READ when dereferencing the object.symlink pointer or reading cached content.
(5) state_lock must be held for WRITE when modifying state_list or lock_list. It must be held for READ when traversing or examining the state_list or lock_list. Operations like LRU pinning must hold the state lock for read through the operation of moving the entry from one queue to another.
The handle, weakref, and type fields are unprotected, as they are considered to be immutable throughout the life of the object.
The flags field is unprotected, however it should be modified only through the functions atomic_set_uint32_t_bits and atomic_clear_uint32_t_bits.
The change_time and attr_time fields are unprotected and must only be used for simple comparisons or servicing requests returning change_info4.
The lru field as its own mutex to protect it.
Definition at line 336 of file cache_inode.h.
pthread_rwlock_t cache_entry_t::attr_lock |
Definition at line 354 of file cache_inode.h.
time_t cache_entry_t::attr_time |
Definition at line 352 of file cache_inode.h.
Definition at line 355 of file cache_inode.h.
time_t cache_entry_t::change_time |
Definition at line 347 of file cache_inode.h.
pthread_rwlock_t cache_entry_t::content_lock |
Definition at line 367 of file cache_inode.h.
Definition at line 339 of file cache_inode.h.
Definition at line 346 of file cache_inode.h.
Definition at line 338 of file cache_inode.h.
Definition at line 353 of file cache_inode.h.
Definition at line 366 of file cache_inode.h.
pthread_rwlock_t cache_entry_t::state_lock |
Definition at line 356 of file cache_inode.h.
Definition at line 345 of file cache_inode.h.
Definition at line 341 of file cache_inode.h.