Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations
9p.h File Reference

Go to the source code of this file.

Data Structures

struct  p9_qid
 
struct  p9_wstat
 
struct  p9_stat_dotl
 
struct  p9_iattr_dotl
 
struct  p9_flock
 
struct  p9_getlock
 
struct  p9_rstatfs
 
struct  p9_fcall
 

Macros

#define p9_debug(level, fmt,...)   no_printk(fmt, ##__VA_ARGS__)
 
#define P9_DOTL_RDONLY   00000000
 
#define P9_DOTL_WRONLY   00000001
 
#define P9_DOTL_RDWR   00000002
 
#define P9_DOTL_NOACCESS   00000003
 
#define P9_DOTL_CREATE   00000100
 
#define P9_DOTL_EXCL   00000200
 
#define P9_DOTL_NOCTTY   00000400
 
#define P9_DOTL_TRUNC   00001000
 
#define P9_DOTL_APPEND   00002000
 
#define P9_DOTL_NONBLOCK   00004000
 
#define P9_DOTL_DSYNC   00010000
 
#define P9_DOTL_FASYNC   00020000
 
#define P9_DOTL_DIRECT   00040000
 
#define P9_DOTL_LARGEFILE   00100000
 
#define P9_DOTL_DIRECTORY   00200000
 
#define P9_DOTL_NOFOLLOW   00400000
 
#define P9_DOTL_NOATIME   01000000
 
#define P9_DOTL_CLOEXEC   02000000
 
#define P9_DOTL_SYNC   04000000
 
#define P9_DOTL_AT_REMOVEDIR   0x200
 
#define P9_LOCK_TYPE_RDLCK   0
 
#define P9_LOCK_TYPE_WRLCK   1
 
#define P9_LOCK_TYPE_UNLCK   2
 
#define P9_NOTAG   (u16)(~0)
 
#define P9_NOFID   (u32)(~0)
 
#define P9_MAXWELEM   16
 
#define P9_IOHDRSZ   24
 
#define P9_READDIRHDRSZ   24
 
#define P9_ZC_HDR_SZ   4096
 

Enumerations

enum  p9_debug_flags {
  P9_DEBUG_ERROR = (1<<0), P9_DEBUG_9P = (1<<2), P9_DEBUG_VFS = (1<<3), P9_DEBUG_CONV = (1<<4),
  P9_DEBUG_MUX = (1<<5), P9_DEBUG_TRANS = (1<<6), P9_DEBUG_SLABS = (1<<7), P9_DEBUG_FCALL = (1<<8),
  P9_DEBUG_FID = (1<<9), P9_DEBUG_PKT = (1<<10), P9_DEBUG_FSC = (1<<11), P9_DEBUG_VPKT = (1<<12)
}
 
enum  p9_msg_t {
  P9_TLERROR = 6, P9_RLERROR, P9_TSTATFS = 8, P9_RSTATFS,
  P9_TLOPEN = 12, P9_RLOPEN, P9_TLCREATE = 14, P9_RLCREATE,
  P9_TSYMLINK = 16, P9_RSYMLINK, P9_TMKNOD = 18, P9_RMKNOD,
  P9_TRENAME = 20, P9_RRENAME, P9_TREADLINK = 22, P9_RREADLINK,
  P9_TGETATTR = 24, P9_RGETATTR, P9_TSETATTR = 26, P9_RSETATTR,
  P9_TXATTRWALK = 30, P9_RXATTRWALK, P9_TXATTRCREATE = 32, P9_RXATTRCREATE,
  P9_TREADDIR = 40, P9_RREADDIR, P9_TFSYNC = 50, P9_RFSYNC,
  P9_TLOCK = 52, P9_RLOCK, P9_TGETLOCK = 54, P9_RGETLOCK,
  P9_TLINK = 70, P9_RLINK, P9_TMKDIR = 72, P9_RMKDIR,
  P9_TRENAMEAT = 74, P9_RRENAMEAT, P9_TUNLINKAT = 76, P9_RUNLINKAT,
  P9_TVERSION = 100, P9_RVERSION, P9_TAUTH = 102, P9_RAUTH,
  P9_TATTACH = 104, P9_RATTACH, P9_TERROR = 106, P9_RERROR,
  P9_TFLUSH = 108, P9_RFLUSH, P9_TWALK = 110, P9_RWALK,
  P9_TOPEN = 112, P9_ROPEN, P9_TCREATE = 114, P9_RCREATE,
  P9_TREAD = 116, P9_RREAD, P9_TWRITE = 118, P9_RWRITE,
  P9_TCLUNK = 120, P9_RCLUNK, P9_TREMOVE = 122, P9_RREMOVE,
  P9_TSTAT = 124, P9_RSTAT, P9_TWSTAT = 126, P9_RWSTAT
}
 
enum  p9_open_mode_t {
  P9_OREAD = 0x00, P9_OWRITE = 0x01, P9_ORDWR = 0x02, P9_OEXEC = 0x03,
  P9_OTRUNC = 0x10, P9_OREXEC = 0x20, P9_ORCLOSE = 0x40, P9_OAPPEND = 0x80,
  P9_OEXCL = 0x1000
}
 
enum  p9_perm_t {
  P9_DMDIR = 0x80000000, P9_DMAPPEND = 0x40000000, P9_DMEXCL = 0x20000000, P9_DMMOUNT = 0x10000000,
  P9_DMAUTH = 0x08000000, P9_DMTMP = 0x04000000, P9_DMSYMLINK = 0x02000000, P9_DMLINK = 0x01000000,
  P9_DMDEVICE = 0x00800000, P9_DMNAMEDPIPE = 0x00200000, P9_DMSOCKET = 0x00100000, P9_DMSETUID = 0x00080000,
  P9_DMSETGID = 0x00040000, P9_DMSETVTX = 0x00010000
}
 
enum  p9_qid_t {
  P9_QTDIR = 0x80, P9_QTAPPEND = 0x40, P9_QTEXCL = 0x20, P9_QTMOUNT = 0x10,
  P9_QTAUTH = 0x08, P9_QTTMP = 0x04, P9_QTSYMLINK = 0x02, P9_QTLINK = 0x01,
  P9_QTFILE = 0x00
}
 

: last element of path (aka filename)

struct p9_wstat - file system metadata information : length prefix for this stat structure instance : the type of the server (equivalent to a major number) : the sub-type of the server (equivalent to a minor number) : unique id from the server of type &p9_qid : Plan 9 format permissions of type &p9_perm_t : Last access/read time : Last modify/write time : file length

: owner name : group owner : last modifier : area used to encode extended UNIX support : numeric user id of owner (part of 9p2000.u extension) : numeric group id (part of 9p2000.u extension) : numeric user id of laster modifier (part of 9p2000.u extension)

See Also: http://plan9.bell-labs.com/magic/man2html/2/stat

#define P9_STATS_MODE   0x00000001ULL
 
#define P9_STATS_NLINK   0x00000002ULL
 
#define P9_STATS_UID   0x00000004ULL
 
#define P9_STATS_GID   0x00000008ULL
 
#define P9_STATS_RDEV   0x00000010ULL
 
#define P9_STATS_ATIME   0x00000020ULL
 
#define P9_STATS_MTIME   0x00000040ULL
 
#define P9_STATS_CTIME   0x00000080ULL
 
#define P9_STATS_INO   0x00000100ULL
 
#define P9_STATS_SIZE   0x00000200ULL
 
#define P9_STATS_BLOCKS   0x00000400ULL
 
#define P9_STATS_BTIME   0x00000800ULL
 
#define P9_STATS_GEN   0x00001000ULL
 
#define P9_STATS_DATA_VERSION   0x00002000ULL
 
#define P9_STATS_BASIC   0x000007ffULL /* Mask for fields up to BLOCKS */
 
#define P9_STATS_ALL   0x00003fffULL /* Mask for All fields above */
 
#define P9_LOCK_SUCCESS   0
 
#define P9_LOCK_BLOCKED   1
 
#define P9_LOCK_ERROR   2
 
#define P9_LOCK_GRACE   3
 
#define P9_LOCK_FLAGS_BLOCK   1
 
#define P9_LOCK_FLAGS_RECLAIM   2
 
int p9_errstr2errno (char *errstr, int len)
 
struct p9_idpoolp9_idpool_create (void)
 
void p9_idpool_destroy (struct p9_idpool *)
 
int p9_idpool_get (struct p9_idpool *p)
 
void p9_idpool_put (int id, struct p9_idpool *p)
 
int p9_idpool_check (int id, struct p9_idpool *p)
 
int p9_error_init (void)
 
int p9_trans_fd_init (void)
 
void p9_trans_fd_exit (void)
 

Macro Definition Documentation

#define p9_debug (   level,
  fmt,
  ... 
)    no_printk(fmt, ##__VA_ARGS__)

Definition at line 72 of file 9p.h.

#define P9_DOTL_APPEND   00002000

Definition at line 283 of file 9p.h.

#define P9_DOTL_AT_REMOVEDIR   0x200

Definition at line 296 of file 9p.h.

#define P9_DOTL_CLOEXEC   02000000

Definition at line 292 of file 9p.h.

#define P9_DOTL_CREATE   00000100

Definition at line 279 of file 9p.h.

#define P9_DOTL_DIRECT   00040000

Definition at line 287 of file 9p.h.

#define P9_DOTL_DIRECTORY   00200000

Definition at line 289 of file 9p.h.

#define P9_DOTL_DSYNC   00010000

Definition at line 285 of file 9p.h.

#define P9_DOTL_EXCL   00000200

Definition at line 280 of file 9p.h.

#define P9_DOTL_FASYNC   00020000

Definition at line 286 of file 9p.h.

#define P9_DOTL_LARGEFILE   00100000

Definition at line 288 of file 9p.h.

#define P9_DOTL_NOACCESS   00000003

Definition at line 278 of file 9p.h.

#define P9_DOTL_NOATIME   01000000

Definition at line 291 of file 9p.h.

#define P9_DOTL_NOCTTY   00000400

Definition at line 281 of file 9p.h.

#define P9_DOTL_NOFOLLOW   00400000

Definition at line 290 of file 9p.h.

#define P9_DOTL_NONBLOCK   00004000

Definition at line 284 of file 9p.h.

#define P9_DOTL_RDONLY   00000000

Definition at line 275 of file 9p.h.

#define P9_DOTL_RDWR   00000002

Definition at line 277 of file 9p.h.

#define P9_DOTL_SYNC   04000000

Definition at line 293 of file 9p.h.

#define P9_DOTL_TRUNC   00001000

Definition at line 282 of file 9p.h.

#define P9_DOTL_WRONLY   00000001

Definition at line 276 of file 9p.h.

#define P9_IOHDRSZ   24

Definition at line 340 of file 9p.h.

#define P9_LOCK_BLOCKED   1

Definition at line 484 of file 9p.h.

#define P9_LOCK_ERROR   2

Definition at line 485 of file 9p.h.

#define P9_LOCK_FLAGS_BLOCK   1

Definition at line 488 of file 9p.h.

#define P9_LOCK_FLAGS_RECLAIM   2

Definition at line 489 of file 9p.h.

#define P9_LOCK_GRACE   3

Definition at line 486 of file 9p.h.

#define P9_LOCK_SUCCESS   0

Definition at line 483 of file 9p.h.

#define P9_LOCK_TYPE_RDLCK   0

Definition at line 299 of file 9p.h.

#define P9_LOCK_TYPE_UNLCK   2

Definition at line 301 of file 9p.h.

#define P9_LOCK_TYPE_WRLCK   1

Definition at line 300 of file 9p.h.

#define P9_MAXWELEM   16

Definition at line 337 of file 9p.h.

#define P9_NOFID   (u32)(~0)

Definition at line 336 of file 9p.h.

#define P9_NOTAG   (u16)(~0)

Definition at line 335 of file 9p.h.

#define P9_READDIRHDRSZ   24

Definition at line 343 of file 9p.h.

#define P9_STATS_ALL   0x00003fffULL /* Mask for All fields above */

Definition at line 455 of file 9p.h.

#define P9_STATS_ATIME   0x00000020ULL

Definition at line 443 of file 9p.h.

#define P9_STATS_BASIC   0x000007ffULL /* Mask for fields up to BLOCKS */

Definition at line 454 of file 9p.h.

#define P9_STATS_BLOCKS   0x00000400ULL

Definition at line 448 of file 9p.h.

#define P9_STATS_BTIME   0x00000800ULL

Definition at line 450 of file 9p.h.

#define P9_STATS_CTIME   0x00000080ULL

Definition at line 445 of file 9p.h.

#define P9_STATS_DATA_VERSION   0x00002000ULL

Definition at line 452 of file 9p.h.

#define P9_STATS_GEN   0x00001000ULL

Definition at line 451 of file 9p.h.

#define P9_STATS_GID   0x00000008ULL

Definition at line 441 of file 9p.h.

#define P9_STATS_INO   0x00000100ULL

Definition at line 446 of file 9p.h.

#define P9_STATS_MODE   0x00000001ULL

Definition at line 438 of file 9p.h.

#define P9_STATS_MTIME   0x00000040ULL

Definition at line 444 of file 9p.h.

#define P9_STATS_NLINK   0x00000002ULL

Definition at line 439 of file 9p.h.

#define P9_STATS_RDEV   0x00000010ULL

Definition at line 442 of file 9p.h.

#define P9_STATS_SIZE   0x00000200ULL

Definition at line 447 of file 9p.h.

#define P9_STATS_UID   0x00000004ULL

Definition at line 440 of file 9p.h.

#define P9_ZC_HDR_SZ   4096

Definition at line 346 of file 9p.h.

Enumeration Type Documentation

enum p9_debug_flags - bits for mount time debug parameter : more verbose error messages including original error string : 9P protocol tracing : VFS API tracing : protocol conversion tracing : trace management of concurrent transactions : transport tracing : memory management tracing : verbose dump of protocol messages : fid allocation/deallocation tracking : packet marshalling/unmarshalling : FS-cache tracing : Verbose packet debugging (full packet dump)

These flags are passed at mount time to turn on various levels of verbosity and tracing which will be output to the system logs.

Enumerator:
P9_DEBUG_ERROR 
P9_DEBUG_9P 
P9_DEBUG_VFS 
P9_DEBUG_CONV 
P9_DEBUG_MUX 
P9_DEBUG_TRANS 
P9_DEBUG_SLABS 
P9_DEBUG_FCALL 
P9_DEBUG_FID 
P9_DEBUG_PKT 
P9_DEBUG_FSC 
P9_DEBUG_VPKT 

Definition at line 49 of file 9p.h.

enum p9_msg_t

enum p9_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 transferred 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

Enumerator:
P9_TLERROR 
P9_RLERROR 
P9_TSTATFS 
P9_RSTATFS 
P9_TLOPEN 
P9_RLOPEN 
P9_TLCREATE 
P9_RLCREATE 
P9_TSYMLINK 
P9_RSYMLINK 
P9_TMKNOD 
P9_RMKNOD 
P9_TRENAME 
P9_RRENAME 
P9_TREADLINK 
P9_RREADLINK 
P9_TGETATTR 
P9_RGETATTR 
P9_TSETATTR 
P9_RSETATTR 
P9_TXATTRWALK 
P9_RXATTRWALK 
P9_TXATTRCREATE 
P9_RXATTRCREATE 
P9_TREADDIR 
P9_RREADDIR 
P9_TFSYNC 
P9_RFSYNC 
P9_TLOCK 
P9_RLOCK 
P9_TGETLOCK 
P9_RGETLOCK 
P9_TLINK 
P9_RLINK 
P9_TMKDIR 
P9_RMKDIR 
P9_TRENAMEAT 
P9_RRENAMEAT 
P9_TUNLINKAT 
P9_RUNLINKAT 
P9_TVERSION 
P9_RVERSION 
P9_TAUTH 
P9_RAUTH 
P9_TATTACH 
P9_RATTACH 
P9_TERROR 
P9_RERROR 
P9_TFLUSH 
P9_RFLUSH 
P9_TWALK 
P9_RWALK 
P9_TOPEN 
P9_ROPEN 
P9_TCREATE 
P9_RCREATE 
P9_TREAD 
P9_RREAD 
P9_TWRITE 
P9_RWRITE 
P9_TCLUNK 
P9_RCLUNK 
P9_TREMOVE 
P9_RREMOVE 
P9_TSTAT 
P9_RSTAT 
P9_TWSTAT 
P9_RWSTAT 

Definition at line 130 of file 9p.h.

enum p9_open_mode_t - 9P open modes : open file for reading only : open file for writing only : open file for reading or writing : open file for execution : truncate file to zero-length before opening it : close the file when an exec(2) system call is made : remove the file when the file is closed : open the file and seek to the end : only create a file, do not open it

9P open modes differ slightly from Posix standard modes. In particular, there are extra modes which specify different semantic behaviors than may be available on standard Posix systems. For example, and are modes that most likely will not be issued from the Linux VFS client, but may be supported by servers.

See Also: http://plan9.bell-labs.com/magic/man2html/2/open

Enumerator:
P9_OREAD 
P9_OWRITE 
P9_ORDWR 
P9_OEXEC 
P9_OTRUNC 
P9_OREXEC 
P9_ORCLOSE 
P9_OAPPEND 
P9_OEXCL 

Definition at line 223 of file 9p.h.

enum p9_perm_t

enum p9_perm_t - 9P permissions : mode bit for directories : mode bit for is append-only : mode bit for excluse use (only one open handle allowed) : mode bit for mount points : mode bit for authentication file : mode bit for non-backed-up files : mode bit for symbolic links (9P2000.u) : mode bit for hard-link (9P2000.u) : mode bit for device files (9P2000.u) : mode bit for named pipe (9P2000.u) : mode bit for socket (9P2000.u) : mode bit for setuid (9P2000.u) : mode bit for setgid (9P2000.u) : mode bit for sticky bit (9P2000.u)

9P permissions differ slightly from Posix standard modes.

See Also: http://plan9.bell-labs.com/magic/man2html/2/stat

Enumerator:
P9_DMDIR 
P9_DMAPPEND 
P9_DMEXCL 
P9_DMMOUNT 
P9_DMAUTH 
P9_DMTMP 
P9_DMSYMLINK 
P9_DMLINK 
P9_DMDEVICE 
P9_DMNAMEDPIPE 
P9_DMSOCKET 
P9_DMSETUID 
P9_DMSETGID 
P9_DMSETVTX 

Definition at line 256 of file 9p.h.

enum p9_qid_t

enum p9_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 significant 16 bits of the permission_t

See Also: http://plan9.bell-labs.com/magic/man2html/2/stat

Enumerator:
P9_QTDIR 
P9_QTAPPEND 
P9_QTEXCL 
P9_QTMOUNT 
P9_QTAUTH 
P9_QTTMP 
P9_QTSYMLINK 
P9_QTLINK 
P9_QTFILE 

Definition at line 322 of file 9p.h.

Function Documentation

int p9_error_init ( void  )

p9_error_init - preload mappings into hash list

Definition at line 193 of file error.c.

int p9_errstr2errno ( char errstr,
int  len 
)

errstr2errno - convert error string to error number : error string : length of error string

Definition at line 221 of file error.c.

int p9_idpool_check ( int  id,
struct p9_idpool p 
)

p9_idpool_check - check if the specified id is available : id to check : pool to check

Definition at line 141 of file util.c.

struct p9_idpool* p9_idpool_create ( void  )
read

p9_idpool_create - create a new per-connection id pool

Definition at line 53 of file util.c.

void p9_idpool_destroy ( struct p9_idpool p)

p9_idpool_destroy - create a new per-connection id pool : idpool to destroy

Definition at line 73 of file util.c.

int p9_idpool_get ( struct p9_idpool p)

p9_idpool_get - allocate numeric id from pool : pool to allocate from

Bugs: This seems to be an awful generic function, should it be in idr.c with the lock included in struct idr?

Definition at line 88 of file util.c.

void p9_idpool_put ( int  id,
struct p9_idpool p 
)

p9_idpool_put - release numeric id from pool : numeric id which is being released : pool to release id into

Bugs: This seems to be an awful generic function, should it be in idr.c with the lock included in struct idr?

Definition at line 123 of file util.c.

void p9_trans_fd_exit ( void  )

Definition at line 1084 of file trans_fd.c.

int p9_trans_fd_init ( void  )

Definition at line 1075 of file trans_fd.c.