nfs-ganesha 1.4
|
Manage opening and closing files and caching file descriptors. More...
#include "fsal.h"
#include "abstract_atomic.h"
#include "log.h"
#include "HashData.h"
#include "HashTable.h"
#include "cache_inode.h"
#include "cache_inode_lru.h"
#include <unistd.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/param.h>
#include <time.h>
#include <pthread.h>
#include <strings.h>
#include <assert.h>
Go to the source code of this file.
Functions | |
fsal_file_t * | cache_inode_fd (cache_entry_t *entry) |
Returns a file descriptor, if open. | |
bool_t | is_open_for_write (cache_entry_t *entry) |
Check if a file is available to write. | |
bool_t | is_open_for_read (cache_entry_t *entry) |
Check if a file is available to read. | |
cache_inode_status_t | cache_inode_open (cache_entry_t *entry, fsal_openflags_t openflags, fsal_op_context_t *context, uint32_t flags, cache_inode_status_t *status) |
Opens a file descriptor. | |
cache_inode_status_t | cache_inode_close (cache_entry_t *entry, uint32_t flags, cache_inode_status_t *status) |
Close a file. |
Manage opening and closing files and caching file descriptors.
vim:expandtab:shiftwidth=8:tabstop=8:
Copyright CEA/DAM/DIF (2008) contributeur : Philippe DENIEL philippe.deniel@cea.fr Thomas LEIBOVICI thomas.leibovici@cea.fr
This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
---------------------------------------
This file manages the opening and closing files and the file descriptor cache, in conjunction with the lru_thread in cache_inode_lru.
Definition in file cache_inode_open_close.c.
cache_inode_status_t cache_inode_close | ( | cache_entry_t * | entry, |
uint32_t | flags, | ||
cache_inode_status_t * | status | ||
) |
Close a file.
This function calls down to the FSAL to close the file.
[in] | entry | Cache entry to close |
[in] | flags | Flags for lock management |
[out] | status | Operation status |
Definition at line 261 of file cache_inode_open_close.c.
fsal_file_t* cache_inode_fd | ( | cache_entry_t * | entry | ) |
Returns a file descriptor, if open.
This function returns the file descriptor stored in a cache entry, if the cached file is open.
[in] | entry | Entry for the file on which to operate |
Definition at line 73 of file cache_inode_open_close.c.
cache_inode_status_t cache_inode_open | ( | cache_entry_t * | entry, |
fsal_openflags_t | openflags, | ||
fsal_op_context_t * | context, | ||
uint32_t | flags, | ||
cache_inode_status_t * | status | ||
) |
Opens a file descriptor.
This function opens a file descriptor on a given cache entry.
[in] | entry | Cache entry representing the file to open |
[in] | openflags | The type of access for which to open |
[in] | context | FSAL operation context |
[in] | flags | Flags indicating lock status |
[out] | status | Operation status |
Definition at line 148 of file cache_inode_open_close.c.
bool_t is_open_for_read | ( | cache_entry_t * | entry | ) |
Check if a file is available to read.
This function checks whether the given file is currently open in a mode supporting read operations.
[in] | entry | Entry for the file to check |
Definition at line 123 of file cache_inode_open_close.c.
bool_t is_open_for_write | ( | cache_entry_t * | entry | ) |
Check if a file is available to write.
This function checks whether the given file is currently open in a mode supporting write operations.
[in] | entry | Entry for the file to check |
Definition at line 102 of file cache_inode_open_close.c.