Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 100 lines (64 sloc) 1.5 KB
TRFS - trivial remote file system, quick and dirty product of dz@dz.ru :)
Port is 2052, near NFS, but unused.
Simplest thing to page across network. Runs on UDP or TCP. Any packet
is retransmitted if no reply received. Newer request replaces older
even if no reply is received.
SessionId - 64 bit net order, generated by server on startup,
verified on each rq/reply, used to find out that server was restarted
and disk ids are, possiblly, invalid - client has to renegotiate by
doing FindRQ
FileId - 32 bit net order, just like unix file descriptor.
IoId - 32 bit net order, io request id to distinguish two subsequent
io operations on the same block(s).
NSectors - 32 bit net order, number of 512 bype sectors to transfer
StartSector - 64 bit net order, number of 512 bype sector to start io from
NOP
------
SessionId
Error
------
SessionId
ErrorId - int32
ErrorTextLen - int32, bytes in ErrorText
ErrorText -
FindRQ
------
SessionId - ignored!
fileNameLen - int32
file name
FindReply
------
SessionId
FileId
ReadRQ
------
SessionId
NRequests - following 4 fields are repeated this number of times
FileId
IoId
NSectors
StartSector
....
ReadReply
------
SessionId
FileId
IoId
NSectors
StartSector
data (512*n_pages bytes)
WriteRQ
------
SessionId
FileId
IoId
NSectors
StartSector
data (512*n_pages bytes)
WriteAck
------
SessionId
FileId
IoId - same as in RQ we replying to
NSectors
StartSector