#include <string.h>
#include <rpc/rpc.h>
#include <rpc/xdr.h>
#include "nfs4.h"
#include "fsal_internal.h"
#include "fsal_convert.h"
#include "fsal_common.h"
#include "nfs_proto_functions.h"
#include "fsal_nfsv4_macros.h"
#include "abstract_mem.h"
Go to the source code of this file.
Defines |
#define | FSAL_OPEN_NB_OP_ALLOC 4 |
#define | FSAL_OPEN_VAL_BUFFER 1024 |
#define | FSAL_OPEN_IDX_OP_PUTFH 0 |
#define | FSAL_OPEN_IDX_OP_OPEN_NOCREATE 1 |
#define | FSAL_OPEN_IDX_OP_GETFH 2 |
#define | FSAL_OPEN_IDX_OP_GETATTR 3 |
#define | FSAL_OPEN_STATELESS_NB_OP_ALLOC 2 |
#define | FSAL_OPEN_STATELESS_VAL_BUFFER 1024 |
#define | FSAL_OPEN_STATELESS_IDX_OP_PUTFH 0 |
#define | FSAL_OPEN_STATELESS_IDX_OP_GETATTR 1 |
#define | FSAL_READ_NB_OP_ALLOC 2 |
#define | FSAL_READ_IDX_OP_PUTFH 0 |
#define | FSAL_READ_IDX_OP_READ 1 |
#define | FSAL_WRITE_NB_OP_ALLOC 2 |
#define | FSAL_READ_IDX_OP_PUTFH 0 |
#define | FSAL_READ_IDX_OP_WRITE 1 |
#define | FSAL_CLOSE_NB_OP_ALLOC 2 |
#define | FSAL_CLOSE_IDX_OP_PUTFH 0 |
#define | FSAL_CLOSE_IDX_OP_CLOSE 1 |
Functions |
fsal_status_t | PROXYFSAL_open_by_name (fsal_handle_t *dirhandle, fsal_name_t *filename, fsal_op_context_t *context, fsal_openflags_t openflags, fsal_file_t *file_desc, fsal_attrib_list_t *file_attributes) |
fsal_status_t | PROXYFSAL_open (fsal_handle_t *filehandle, fsal_op_context_t *context, fsal_openflags_t openflags, fsal_file_t *file_desc, fsal_attrib_list_t *file_attributes) |
fsal_status_t | PROXYFSAL_read (fsal_file_t *file_desc, fsal_seek_t *seek_descriptor, fsal_size_t buffer_size, caddr_t buffer, fsal_size_t *read_amount, fsal_boolean_t *end_of_file) |
fsal_status_t | PROXYFSAL_write (fsal_file_t *file_desc, fsal_op_context_t *p_context, fsal_seek_t *seek_descriptor, fsal_size_t buffer_size, caddr_t buffer, fsal_size_t *write_amount) |
fsal_status_t | PROXYFSAL_close (fsal_file_t *file_desc) |
fsal_status_t | PROXYFSAL_close_by_fileid (fsal_file_t *file_desc, fsal_u64_t fileid) |
fsal_status_t | PROXYFSAL_open_by_fileid (fsal_handle_t *filehandle, fsal_u64_t fileid, fsal_op_context_t *context, fsal_openflags_t openflags, fsal_file_t *file_desc, fsal_attrib_list_t *file_attributes) |
unsigned int | PROXYFSAL_GetFileno (fsal_file_t *pfile) |
fsal_status_t | PROXYFSAL_commit (fsal_file_t *p_file_descriptor, fsal_off_t offset, fsal_size_t length) |
Define Documentation
#define FSAL_CLOSE_IDX_OP_CLOSE 1 |
#define FSAL_CLOSE_IDX_OP_PUTFH 0 |
#define FSAL_CLOSE_NB_OP_ALLOC 2 |
#define FSAL_OPEN_IDX_OP_GETATTR 3 |
#define FSAL_OPEN_IDX_OP_GETFH 2 |
#define FSAL_OPEN_IDX_OP_OPEN_NOCREATE 1 |
#define FSAL_OPEN_IDX_OP_PUTFH 0 |
#define FSAL_OPEN_NB_OP_ALLOC 4 |
#define FSAL_OPEN_STATELESS_IDX_OP_GETATTR 1 |
#define FSAL_OPEN_STATELESS_IDX_OP_PUTFH 0 |
#define FSAL_OPEN_STATELESS_NB_OP_ALLOC 2 |
#define FSAL_OPEN_STATELESS_VAL_BUFFER 1024 |
#define FSAL_OPEN_VAL_BUFFER 1024 |
#define FSAL_READ_IDX_OP_PUTFH 0 |
#define FSAL_READ_IDX_OP_PUTFH 0 |
#define FSAL_READ_IDX_OP_READ 1 |
#define FSAL_READ_IDX_OP_WRITE 1 |
#define FSAL_READ_NB_OP_ALLOC 2 |
#define FSAL_WRITE_NB_OP_ALLOC 2 |
Function Documentation
FSAL_close: Free the resources allocated by the FSAL_open call.
- Parameters:
-
file_descriptor | (input): The file descriptor returned by FSAL_open. |
- Returns:
- Major error codes:
- ERR_FSAL_NO_ERROR (no error)
- ERR_FSAL_FAULT (a NULL pointer was passed as mandatory argument)
- Other error codes can be returned : ERR_FSAL_IO, ...
Definition at line 702 of file FSAL_PROXY/fsal_fileop.c.
FSAL_close_by_fileid: Free the resources allocated by the FSAL_open_by_fileid call.
- Parameters:
-
file_descriptor | (input): The file descriptor returned by FSAL_open. |
- Returns:
- Major error codes:
- ERR_FSAL_NO_ERROR (no error)
- ERR_FSAL_FAULT (a NULL pointer was passed as mandatory argument)
- Other error codes can be returned : ERR_FSAL_IO, ...
Definition at line 781 of file FSAL_PROXY/fsal_fileop.c.
FSAL_commit: This function is used for processing stable writes and COMMIT requests. Calling this function makes sure the changes to a specific file are written to disk rather than kept in memory.
- Parameters:
-
file_descriptor | (input): The file descriptor returned by FSAL_open. |
offset,: | The starting offset for the portion of file to be synced |
length,: | The length for the portion of file to be synced. |
- Returns:
- Major error codes:
- ERR_FSAL_NO_ERROR: no error.
- Another error code if an error occured during this call.
Definition at line 1137 of file FSAL_PROXY/fsal_fileop.c.
unsigned int PROXYFSAL_GetFileno |
( |
fsal_file_t * |
pfile | ) |
|
FSAL_open: Open a regular file for reading/writing its data content.
- Parameters:
-
filehandle | (input): Handle of the file to be read/modified. |
cred | (input): Authentication context for the operation (user,...). |
openflags | (input): Flags that indicates behavior for file opening and access. This is an inclusive OR of the following values ( such of them are not compatible) :
- FSAL_O_RDONLY: opening file for reading only.
- FSAL_O_RDWR: opening file for reading and writing.
- FSAL_O_WRONLY: opening file for writting only.
- FSAL_O_APPEND: always write at the end of the file.
- FSAL_O_TRUNC: truncate the file to 0 on opening.
|
file_descriptor | (output): The file descriptor to be used for FSAL_read/write operations. |
file_attributes | (optionnal input/output): Post operation attributes. As input, it defines the attributes that the caller wants to retrieve (by positioning flags into this structure) and the output is built considering this input (it fills the structure according to the flags it contains). |
- Returns:
- Major error codes:
- ERR_FSAL_NO_ERROR (no error)
- ERR_FSAL_ACCESS (user doesn't have the permissions for opening the file)
- ERR_FSAL_STALE (filehandle does not address an existing object)
- ERR_FSAL_INVAL (filehandle does not address a regular file, or open flags are conflicting)
- ERR_FSAL_FAULT (a NULL pointer was passed as mandatory argument)
- Other error codes can be returned : ERR_FSAL_IO, ...
Definition at line 309 of file FSAL_PROXY/fsal_fileop.c.
FSAL_open_by_fileid: Open a regular file for reading/writing its data content.
- Parameters:
-
dirhandle | (input): Handle of the file to be opened |
fileid | (input): file id for the file to be opened |
cred | (input): Authentication context for the operation (user,...). |
openflags | (input): Flags that indicates behavior for file opening and access. This is an inclusive OR of the following values ( such of them are not compatible) :
- FSAL_O_RDONLY: opening file for reading only.
- FSAL_O_RDWR: opening file for reading and writing.
- FSAL_O_WRONLY: opening file for writting only.
- FSAL_O_APPEND: always write at the end of the file.
- FSAL_O_TRUNC: truncate the file to 0 on opening.
|
file_descriptor | (output): The file descriptor to be used for FSAL_read/write operations. |
file_attributes | (optionnal input/output): Post operation attributes. As input, it defines the attributes that the caller wants to retrieve (by positioning flags into this structure) and the output is built considering this input (it fills the structure according to the flags it contains). |
- Returns:
- Major error codes:
- ERR_FSAL_NO_ERROR (no error)
- ERR_FSAL_ACCESS (user doesn't have the permissions for opening the file)
- ERR_FSAL_STALE (filehandle does not address an existing object)
- ERR_FSAL_INVAL (filehandle does not address a regular file, or open flags are conflicting)
- ERR_FSAL_FAULT (a NULL pointer was passed as mandatory argument)
- Other error codes can be returned : ERR_FSAL_IO, ...
Definition at line 893 of file FSAL_PROXY/fsal_fileop.c.
FSAL_open_by_name: Open a regular file for reading/writing its data content.
- Parameters:
-
dirhandle | (input): Handle of the directory that contain the file to be read/modified. |
filename | (input): Name of the file to be read/modified |
cred | (input): Authentication context for the operation (user,...). |
openflags | (input): Flags that indicates behavior for file opening and access. This is an inclusive OR of the following values ( such of them are not compatible) :
- FSAL_O_RDONLY: opening file for reading only.
- FSAL_O_RDWR: opening file for reading and writing.
- FSAL_O_WRONLY: opening file for writting only.
- FSAL_O_APPEND: always write at the end of the file.
- FSAL_O_TRUNC: truncate the file to 0 on opening.
|
file_descriptor | (output): The file descriptor to be used for FSAL_read/write operations. |
file_attributes | (optionnal input/output): Post operation attributes. As input, it defines the attributes that the caller wants to retrieve (by positioning flags into this structure) and the output is built considering this input (it fills the structure according to the flags it contains). |
- Returns:
- Major error codes:
- ERR_FSAL_NO_ERROR (no error)
- ERR_FSAL_ACCESS (user doesn't have the permissions for opening the file)
- ERR_FSAL_STALE (filehandle does not address an existing object)
- ERR_FSAL_INVAL (filehandle does not address a regular file, or open flags are conflicting)
- ERR_FSAL_FAULT (a NULL pointer was passed as mandatory argument)
- Other error codes can be returned : ERR_FSAL_IO, ...
Definition at line 81 of file FSAL_PROXY/fsal_fileop.c.
FSAL_read: Perform a read operation on an opened file.
- Parameters:
-
file_descriptor | (input): The file descriptor returned by FSAL_open. |
seek_descriptor | (optional input): Specifies the position where data is to be read. If not specified, data will be read at the current position. |
buffer_size | (input): Amount (in bytes) of data to be read. |
buffer | (output): Address where the read data is to be stored in memory. |
read_amount | (output): Pointer to the amount of data (in bytes) that have been read during this call. |
end_of_file | (output): Pointer to a boolean that indicates whether the end of file has been reached during this call. |
- Returns:
- Major error codes:
- ERR_FSAL_NO_ERROR (no error)
- ERR_FSAL_INVAL (invalid parameter)
- ERR_FSAL_NOT_OPENED (tried to read in a non-opened proxyfsal_file_t)
- ERR_FSAL_FAULT (a NULL pointer was passed as mandatory argument)
- Other error codes can be returned : ERR_FSAL_IO, ...
Definition at line 460 of file FSAL_PROXY/fsal_fileop.c.
FSAL_write: Perform a write operation on an opened file.
- Parameters:
-
file_descriptor | (input): The file descriptor returned by FSAL_open. |
p_context | (input): Authentication context for the operation (user,...). |
seek_descriptor | (optional input): Specifies the position where data is to be written. If not specified, data will be written at the current position. |
buffer_size | (input): Amount (in bytes) of data to be written. |
buffer | (input): Address in memory of the data to write to file. |
write_amount | (output): Pointer to the amount of data (in bytes) that have been written during this call. |
- Returns:
- Major error codes:
- ERR_FSAL_NO_ERROR (no error)
- ERR_FSAL_INVAL (invalid parameter)
- ERR_FSAL_NOT_OPENED (tried to write in a non-opened proxyfsal_file_t)
- ERR_FSAL_FAULT (a NULL pointer was passed as mandatory argument)
- Other error codes can be returned : ERR_FSAL_IO, ERR_FSAL_NOSPC, ERR_FSAL_DQUOT...
Definition at line 590 of file FSAL_PROXY/fsal_fileop.c.