nfs-ganesha 1.4
|
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <sys/select.h>
#include "fsal.h"
#include "cache_inode.h"
Go to the source code of this file.
Classes | |
struct | _9p_str |
struct | _9p_qid |
struct | _9p_param__ |
struct | _9p_fid__ |
struct | _9p_conn__ |
struct | _9p_request_data__ |
struct | _9p_function_desc__ |
Defines | |
#define | NB_PREALLOC_HASH_9P 100 |
#define | NB_PREALLOC_FID_9P 100 |
#define | PRIME_9P 17 |
#define | _9P_PORT 564 |
#define | _9P_SEND_BUFFER_SIZE 131072 |
#define | _9P_RECV_BUFFER_SIZE 131072 |
#define | _9p_READ_BUFFER_SIZE _9P_SEND_BUFFER_SIZE |
#define | _9P_MAXDIRCOUNT 2000 |
#define | _9P_LOCK_CLIENT_LEN 64 |
#define | CONF_LABEL_9P "_9P" |
#define | _9P_MSG_SIZE 70000 |
#define | _9P_HDR_SIZE 4 |
#define | _9P_TYPE_SIZE 1 |
#define | _9P_TAG_SIZE 2 |
#define | _9p_BLK_SIZE 4096 |
#define | _9P_NOTAG (u16)(~0) |
#define | _9P_NOFID (u32)(~0) |
#define | _9P_NONUNAME (u32)(~0) |
#define | _9P_MAXWELEM 16 |
#define | _9P_IOHDRSZ 24 |
#define | _9P_READDIRHDRSZ 24 |
#define | _9P_FID_PER_CONN 32 |
#define | _9p_getptr(__cursor, __pvar, __type) |
#define | _9p_getstr(__cursor, __len, __str) |
#define | _9p_setptr(__cursor, __pvar, __type) |
#define | _9p_setvalue(__cursor, __var, __type) |
#define | _9p_savepos(__cursor, __savedpos, __type) |
#define | _9p_setqid(__cursor, __qid) |
#define | _9p_setstr(__cursor, __len, __str) |
#define | _9p_setbuffer(__cursor, __len, __buffer) |
#define | _9p_setinitptr(__cursor, __start, __reqtype) |
#define | _9p_setendptr(__cursor, __start) |
#define | _9p_checkbound(__cursor, __start, __maxlen) |
#define | _9P_GETATTR_MODE 0x00000001ULL |
#define | _9P_GETATTR_NLINK 0x00000002ULL |
#define | _9P_GETATTR_UID 0x00000004ULL |
#define | _9P_GETATTR_GID 0x00000008ULL |
#define | _9P_GETATTR_RDEV 0x00000010ULL |
#define | _9P_GETATTR_ATIME 0x00000020ULL |
#define | _9P_GETATTR_MTIME 0x00000040ULL |
#define | _9P_GETATTR_CTIME 0x00000080ULL |
#define | _9P_GETATTR_INO 0x00000100ULL |
#define | _9P_GETATTR_SIZE 0x00000200ULL |
#define | _9P_GETATTR_BLOCKS 0x00000400ULL |
#define | _9P_GETATTR_BTIME 0x00000800ULL |
#define | _9P_GETATTR_GEN 0x00001000ULL |
#define | _9P_GETATTR_DATA_VERSION 0x00002000ULL |
#define | _9P_GETATTR_BASIC 0x000007ffULL |
#define | _9P_GETATTR_ALL 0x00003fffULL |
#define | _9P_SETATTR_MODE 0x00000001UL |
#define | _9P_SETATTR_UID 0x00000002UL |
#define | _9P_SETATTR_GID 0x00000004UL |
#define | _9P_SETATTR_SIZE 0x00000008UL |
#define | _9P_SETATTR_ATIME 0x00000010UL |
#define | _9P_SETATTR_MTIME 0x00000020UL |
#define | _9P_SETATTR_CTIME 0x00000040UL |
#define | _9P_SETATTR_ATIME_SET 0x00000080UL |
#define | _9P_SETATTR_MTIME_SET 0x00000100UL |
#define | _9P_LOCK_TYPE_RDLCK 0 |
#define | _9P_LOCK_TYPE_WRLCK 1 |
#define | _9P_LOCK_TYPE_UNLCK 2 |
#define | _9P_LOCK_SUCCESS 0 |
#define | _9P_LOCK_BLOCKED 1 |
#define | _9P_LOCK_ERROR 2 |
#define | _9P_LOCK_GRACE 3 |
#define | _9P_LOCK_FLAGS_BLOCK 1 |
#define | _9P_LOCK_FLAGS_RECLAIM 2 |
Typedefs | |
typedef uint8_t | u8 |
typedef uint16_t | u16 |
typedef uint32_t | u32 |
typedef uint64_t | u64 |
typedef struct _9p_qid | _9p_qid_t |
typedef struct _9p_param__ | _9p_parameter_t |
typedef struct _9p_fid__ | _9p_fid_t |
typedef struct _9p_conn__ | _9p_conn_t |
typedef struct _9p_request_data__ | _9p_request_data_t |
typedef int(* | _9p_function_t )(_9p_request_data_t *preq9p, void *pworker_data, u32 *plenout, char *preply) |
typedef struct _9p_function_desc__ | _9p_function_desc_t |
Enumerations | |
enum | _9p_msg_t { _9P_TLERROR = 6, _9P_RLERROR, _9P_TSTATFS = 8, _9P_RSTATFS, _9P_TLOPEN = 12, _9P_RLOPEN, _9P_TLCREATE = 14, _9P_RLCREATE, _9P_TSYMLINK = 16, _9P_RSYMLINK, _9P_TMKNOD = 18, _9P_RMKNOD, _9P_TRENAME = 20, _9P_RRENAME, _9P_TREADLINK = 22, _9P_RREADLINK, _9P_TGETATTR = 24, _9P_RGETATTR, _9P_TSETATTR = 26, _9P_RSETATTR, _9P_TXATTRWALK = 30, _9P_RXATTRWALK, _9P_TXATTRCREATE = 32, _9P_RXATTRCREATE, _9P_TREADDIR = 40, _9P_RREADDIR, _9P_TFSYNC = 50, _9P_RFSYNC, _9P_TLOCK = 52, _9P_RLOCK, _9P_TGETLOCK = 54, _9P_RGETLOCK, _9P_TLINK = 70, _9P_RLINK, _9P_TMKDIR = 72, _9P_RMKDIR, _9P_TRENAMEAT = 74, _9P_RRENAMEAT, _9P_TUNLINKAT = 76, _9P_RUNLINKAT, _9P_TVERSION = 100, _9P_RVERSION, _9P_TAUTH = 102, _9P_RAUTH, _9P_TATTACH = 104, _9P_RATTACH, _9P_TERROR = 106, _9P_RERROR, _9P_TFLUSH = 108, _9P_RFLUSH, _9P_TWALK = 110, _9P_RWALK, _9P_TOPEN = 112, _9P_ROPEN, _9P_TCREATE = 114, _9P_RCREATE, _9P_TREAD = 116, _9P_RREAD, _9P_TWRITE = 118, _9P_RWRITE, _9P_TCLUNK = 120, _9P_RCLUNK, _9P_TREMOVE = 122, _9P_RREMOVE, _9P_TSTAT = 124, _9P_RSTAT, _9P_TWSTAT = 126, _9P_RWSTAT } |
enum | _9p_qid_t { _9P_QTDIR = 0x80, _9P_QTAPPEND = 0x40, _9P_QTEXCL = 0x20, _9P_QTMOUNT = 0x10, _9P_QTAUTH = 0x08, _9P_QTTMP = 0x04, _9P_QTSYMLINK = 0x02, _9P_QTLINK = 0x01, _9P_QTFILE = 0x00 } |
Functions | |
int | _9p_read_conf (config_file_t in_config, _9p_parameter_t *pparam) |
int | _9p_init (_9p_parameter_t *pparam) |
int | _9p_tools_get_fsal_op_context_by_uid (u32 uid, _9p_fid_t *pfid) |
int | _9p_tools_get_fsal_op_context_by_name (int uname_len, char *uname_str, _9p_fid_t *pfid) |
int | _9p_tools_errno (cache_inode_status_t cache_status) |
void | _9p_tools_fsal_attr2stat (fsal_attrib_list_t *pfsalattr, struct stat *pstat) |
void | _9p_tools_acess2fsal (u32 *paccessin, fsal_accessflags_t *pfsalaccess) |
void | _9p_openflags2FSAL (u32 *inflags, fsal_openflags_t *outflags) |
void | _9p_chomp_attr_value (char *str, size_t size) |
int | _9p_not_2000L (_9p_request_data_t *preq9p, void *pworker_data, u32 *plenout, char *preply) |
int | _9p_clunk (_9p_request_data_t *preq9p, void *pworker_data, u32 *plenout, char *preply) |
int | _9p_attach (_9p_request_data_t *preq9p, void *pworker_data, u32 *plenout, char *preply) |
int | _9p_auth (_9p_request_data_t *preq9p, void *pworker_data, u32 *plenout, char *preply) |
int | _9p_lcreate (_9p_request_data_t *preq9p, void *pworker_data, u32 *plenout, char *preply) |
int | _9p_flush (_9p_request_data_t *preq9p, void *pworker_data, u32 *plenout, char *preply) |
int | _9p_getattr (_9p_request_data_t *preq9p, void *pworker_data, u32 *plenout, char *preply) |
int | _9p_getlock (_9p_request_data_t *preq9p, void *pworker_data, u32 *plenout, char *preply) |
int | _9p_link (_9p_request_data_t *preq9p, void *pworker_data, u32 *plenout, char *preply) |
int | _9p_lock (_9p_request_data_t *preq9p, void *pworker_data, u32 *plenout, char *preply) |
int | _9p_lopen (_9p_request_data_t *preq9p, void *pworker_data, u32 *plenout, char *preply) |
int | _9p_mkdir (_9p_request_data_t *preq9p, void *pworker_data, u32 *plenout, char *preply) |
int | _9p_mknod (_9p_request_data_t *preq9p, void *pworker_data, u32 *plenout, char *preply) |
int | _9p_read (_9p_request_data_t *preq9p, void *pworker_data, u32 *plenout, char *preply) |
int | _9p_readdir (_9p_request_data_t *preq9p, void *pworker_data, u32 *plenout, char *preply) |
int | _9p_readlink (_9p_request_data_t *preq9p, void *pworker_data, u32 *plenout, char *preply) |
int | _9p_setattr (_9p_request_data_t *preq9p, void *pworker_data, u32 *plenout, char *preply) |
int | _9p_symlink (_9p_request_data_t *preq9p, void *pworker_data, u32 *plenout, char *preply) |
int | _9p_remove (_9p_request_data_t *preq9p, void *pworker_data, u32 *plenout, char *preply) |
int | _9p_rename (_9p_request_data_t *preq9p, void *pworker_data, u32 *plenout, char *preply) |
int | _9p_renameat (_9p_request_data_t *preq9p, void *pworker_data, u32 *plenout, char *preply) |
int | _9p_statfs (_9p_request_data_t *preq9p, void *pworker_data, u32 *plenout, char *preply) |
int | _9p_fsync (_9p_request_data_t *preq9p, void *pworker_data, u32 *plenout, char *preply) |
int | _9p_unlinkat (_9p_request_data_t *preq9p, void *pworker_data, u32 *plenout, char *preply) |
int | _9p_version (_9p_request_data_t *preq9p, void *pworker_data, u32 *plenout, char *preply) |
int | _9p_walk (_9p_request_data_t *preq9p, void *pworker_data, u32 *plenout, char *preply) |
int | _9p_write (_9p_request_data_t *preq9p, void *pworker_data, u32 *plenout, char *preply) |
int | _9p_xattrcreate (_9p_request_data_t *preq9p, void *pworker_data, u32 *plenout, char *preply) |
int | _9p_xattrwalk (_9p_request_data_t *preq9p, void *pworker_data, u32 *plenout, char *preply) |
int | _9p_rerror (_9p_request_data_t *preq9p, u16 *msgtag, u32 err, u32 *plenout, char *preply) |
#define _9p_checkbound | ( | __cursor, | |
__start, | |||
__maxlen | |||
) |
#define _9p_getptr | ( | __cursor, | |
__pvar, | |||
__type | |||
) |
#define _9p_getstr | ( | __cursor, | |
__len, | |||
__str | |||
) |
#define _9p_savepos | ( | __cursor, | |
__savedpos, | |||
__type | |||
) |
#define _9p_setbuffer | ( | __cursor, | |
__len, | |||
__buffer | |||
) |
#define _9p_setendptr | ( | __cursor, | |
__start | |||
) |
#define _9p_setinitptr | ( | __cursor, | |
__start, | |||
__reqtype | |||
) |
do \ { \ __cursor = __start + _9P_HDR_SIZE; \ *((u8 *)__cursor) = __reqtype ; \ __cursor += sizeof( u8 ) ; \ } while( 0 )
#define _9p_setptr | ( | __cursor, | |
__pvar, | |||
__type | |||
) |
#define _9p_setqid | ( | __cursor, | |
__qid | |||
) |
#define _9p_setstr | ( | __cursor, | |
__len, | |||
__str | |||
) |
#define _9p_setvalue | ( | __cursor, | |
__var, | |||
__type | |||
) |
typedef struct _9p_conn__ _9p_conn_t |
typedef struct _9p_function_desc__ _9p_function_desc_t |
typedef int(* _9p_function_t)(_9p_request_data_t *preq9p, void *pworker_data, u32 *plenout, char *preply) |
typedef struct _9p_param__ _9p_parameter_t |
struct _9p_qid - file system entity information : 8-bit type &_9p_qid_t
qids are identifiers used by 9P servers to track file system entities. The type is used to differentiate semantics for operations on the entity (ie. read means something different on a directory than on a file). The path provides a server unique index for an entity (roughly analogous to an inode number), while the version is updated every time a file is modified and can be used to maintain cache coherency between clients and serves. Servers will often differentiate purely synthetic entities by setting their version to 0, signaling that they should never be cached and should be accessed synchronously.
See Also://plan9.bell-labs.com/magic/man2html/2/stat
typedef struct _9p_request_data__ _9p_request_data_t |
enum _9p_msg_t |
enum _9p_msg_t - 9P message types : not used : response for any failed request for 9P2000.L : file system status request : file system status response : make symlink request : make symlink response : create a special file object request : create a special file object response : prepare a handle for I/O on an new file for 9P2000.L : response with file access information for 9P2000.L : rename request : rename response : create a directory request : create a directory response : version handshake request : version handshake response : request to establish authentication channel : response with authentication information : establish user access to file service : response with top level handle to file hierarchy : not used : response for any failed request : request to abort a previous request : response when previous request has been cancelled : descend a directory hierarchy : response with new handle for position within hierarchy : prepare a handle for I/O on an existing file : response with file access information : prepare a handle for I/O on a new file : response with file access information : request to transfer data from a file or directory : response with data requested : reuqest to transfer data to a file : response with out much data was transfered to file : forget about a handle to an entity within the file system : response when server has forgotten about the handle : request to remove an entity from the hierarchy : response when server has removed the entity : request file entity attributes : response with file entity attributes : request to update file entity attributes : response when file entity attributes are updated
There are 14 basic operations in 9P2000, paired as requests and responses. The one special case is ERROR as there is no request for clients to transmit to the server, but the server may respond to any other request with an .
See Also: http://plan9.bell-labs.com/sys/man/5/INDEX.html
enum _9p_qid_t |
enum _9p_qid_t - QID types : directory : append-only : excluse use (only one open handle allowed) : mount points : authentication file : non-backed-up files : symbolic links (9P2000.u) : hard-link (9P2000.u) : normal files
QID types are a subset of permissions - they are primarily used to differentiate semantics for a file system entity via a jump-table. Their value is also the most signifigant 16 bits of the permission_t
int _9p_attach | ( | _9p_request_data_t * | preq9p, |
void * | pworker_data, | ||
u32 * | plenout, | ||
char * | preply | ||
) |
Definition at line 53 of file 9p_attach.c.
int _9p_auth | ( | _9p_request_data_t * | preq9p, |
void * | pworker_data, | ||
u32 * | plenout, | ||
char * | preply | ||
) |
void _9p_chomp_attr_value | ( | char * | str, |
size_t | size | ||
) |
Definition at line 244 of file 9p_proto_tools.c.
int _9p_clunk | ( | _9p_request_data_t * | preq9p, |
void * | pworker_data, | ||
u32 * | plenout, | ||
char * | preply | ||
) |
Definition at line 53 of file 9p_clunk.c.
int _9p_flush | ( | _9p_request_data_t * | preq9p, |
void * | pworker_data, | ||
u32 * | plenout, | ||
char * | preply | ||
) |
Definition at line 53 of file 9p_flush.c.
int _9p_fsync | ( | _9p_request_data_t * | preq9p, |
void * | pworker_data, | ||
u32 * | plenout, | ||
char * | preply | ||
) |
Definition at line 52 of file 9p_fsync.c.
int _9p_getattr | ( | _9p_request_data_t * | preq9p, |
void * | pworker_data, | ||
u32 * | plenout, | ||
char * | preply | ||
) |
Definition at line 56 of file 9p_getattr.c.
int _9p_getlock | ( | _9p_request_data_t * | preq9p, |
void * | pworker_data, | ||
u32 * | plenout, | ||
char * | preply | ||
) |
Definition at line 55 of file 9p_getlock.c.
int _9p_init | ( | _9p_parameter_t * | pparam | ) |
Definition at line 53 of file 9p_proto_tools.c.
int _9p_lcreate | ( | _9p_request_data_t * | preq9p, |
void * | pworker_data, | ||
u32 * | plenout, | ||
char * | preply | ||
) |
Definition at line 53 of file 9p_lcreate.c.
int _9p_link | ( | _9p_request_data_t * | preq9p, |
void * | pworker_data, | ||
u32 * | plenout, | ||
char * | preply | ||
) |
int _9p_lock | ( | _9p_request_data_t * | preq9p, |
void * | pworker_data, | ||
u32 * | plenout, | ||
char * | preply | ||
) |
int _9p_lopen | ( | _9p_request_data_t * | preq9p, |
void * | pworker_data, | ||
u32 * | plenout, | ||
char * | preply | ||
) |
Definition at line 54 of file 9p_lopen.c.
int _9p_mkdir | ( | _9p_request_data_t * | preq9p, |
void * | pworker_data, | ||
u32 * | plenout, | ||
char * | preply | ||
) |
Definition at line 53 of file 9p_mkdir.c.
int _9p_mknod | ( | _9p_request_data_t * | preq9p, |
void * | pworker_data, | ||
u32 * | plenout, | ||
char * | preply | ||
) |
Definition at line 53 of file 9p_mknod.c.
int _9p_not_2000L | ( | _9p_request_data_t * | preq9p, |
void * | pworker_data, | ||
u32 * | plenout, | ||
char * | preply | ||
) |
Definition at line 121 of file 9p_interpreter.c.
void _9p_openflags2FSAL | ( | u32 * | inflags, |
fsal_openflags_t * | outflags | ||
) |
Definition at line 259 of file 9p_proto_tools.c.
int _9p_read | ( | _9p_request_data_t * | preq9p, |
void * | pworker_data, | ||
u32 * | plenout, | ||
char * | preply | ||
) |
int _9p_read_conf | ( | config_file_t | in_config, |
_9p_parameter_t * | pparam | ||
) |
Definition at line 50 of file 9p_read_conf.c.
int _9p_readdir | ( | _9p_request_data_t * | preq9p, |
void * | pworker_data, | ||
u32 * | plenout, | ||
char * | preply | ||
) |
Definition at line 121 of file 9p_readdir.c.
int _9p_readlink | ( | _9p_request_data_t * | preq9p, |
void * | pworker_data, | ||
u32 * | plenout, | ||
char * | preply | ||
) |
Definition at line 53 of file 9p_readlink.c.
int _9p_remove | ( | _9p_request_data_t * | preq9p, |
void * | pworker_data, | ||
u32 * | plenout, | ||
char * | preply | ||
) |
Definition at line 53 of file 9p_remove.c.
int _9p_rename | ( | _9p_request_data_t * | preq9p, |
void * | pworker_data, | ||
u32 * | plenout, | ||
char * | preply | ||
) |
Definition at line 53 of file 9p_rename.c.
int _9p_renameat | ( | _9p_request_data_t * | preq9p, |
void * | pworker_data, | ||
u32 * | plenout, | ||
char * | preply | ||
) |
Definition at line 52 of file 9p_renameat.c.
int _9p_rerror | ( | _9p_request_data_t * | preq9p, |
u16 * | msgtag, | ||
u32 | err, | ||
u32 * | plenout, | ||
char * | preply | ||
) |
Definition at line 51 of file 9p_rerror.c.
int _9p_setattr | ( | _9p_request_data_t * | preq9p, |
void * | pworker_data, | ||
u32 * | plenout, | ||
char * | preply | ||
) |
Definition at line 53 of file 9p_setattr.c.
int _9p_statfs | ( | _9p_request_data_t * | preq9p, |
void * | pworker_data, | ||
u32 * | plenout, | ||
char * | preply | ||
) |
Definition at line 55 of file 9p_statfs.c.
int _9p_symlink | ( | _9p_request_data_t * | preq9p, |
void * | pworker_data, | ||
u32 * | plenout, | ||
char * | preply | ||
) |
Definition at line 53 of file 9p_symlink.c.
void _9p_tools_acess2fsal | ( | u32 * | paccessin, |
fsal_accessflags_t * | pfsalaccess | ||
) |
Definition at line 235 of file 9p_proto_tools.c.
int _9p_tools_errno | ( | cache_inode_status_t | cache_status | ) |
Definition at line 103 of file 9p_proto_tools.c.
void _9p_tools_fsal_attr2stat | ( | fsal_attrib_list_t * | pfsalattr, |
struct stat * | pstat | ||
) |
Definition at line 205 of file 9p_proto_tools.c.
int _9p_tools_get_fsal_op_context_by_name | ( | int | uname_len, |
char * | uname_str, | ||
_9p_fid_t * | pfid | ||
) |
Definition at line 84 of file 9p_proto_tools.c.
Definition at line 58 of file 9p_proto_tools.c.
int _9p_unlinkat | ( | _9p_request_data_t * | preq9p, |
void * | pworker_data, | ||
u32 * | plenout, | ||
char * | preply | ||
) |
Definition at line 52 of file 9p_unlinkat.c.
int _9p_version | ( | _9p_request_data_t * | preq9p, |
void * | pworker_data, | ||
u32 * | plenout, | ||
char * | preply | ||
) |
Definition at line 54 of file 9p_version.c.
int _9p_walk | ( | _9p_request_data_t * | preq9p, |
void * | pworker_data, | ||
u32 * | plenout, | ||
char * | preply | ||
) |
int _9p_write | ( | _9p_request_data_t * | preq9p, |
void * | pworker_data, | ||
u32 * | plenout, | ||
char * | preply | ||
) |
Definition at line 53 of file 9p_write.c.
int _9p_xattrcreate | ( | _9p_request_data_t * | preq9p, |
void * | pworker_data, | ||
u32 * | plenout, | ||
char * | preply | ||
) |
Definition at line 56 of file 9p_xattrcreate.c.
int _9p_xattrwalk | ( | _9p_request_data_t * | preq9p, |
void * | pworker_data, | ||
u32 * | plenout, | ||
char * | preply | ||
) |
Definition at line 54 of file 9p_xattrwalk.c.