📄 2.t
字号:
readdirlookres NQNFSPROC_READDIRLOOK(readdirlookargs) = 18;.)lReads entries in a directory in a manner analogous to the NFSPROC_READDIR RPCin NFS, but returns the file handle and attributes of each entry as well.This allows the attribute and lookup caches to be primed..ip \(buGet Lease RPC.(l struct getleaseargs { fhandle file; cachetype readwrite; unsigned duration; }; union getleaseres switch (stat status) { case NFS_OK: bool cachable; unsigned duration; modifyrev rev; nqnfs_fattr attributes; default: void; }; getleaseres NQNFSPROC_GETLEASE(getleaseargs) = 19;.)lGets a lease for "file" valid for "duration" seconds from when the leasewas issued on the server\**..(f\** To be safe, the client may only assume that the lease is validfor ``duration'' seconds from when the RPC request was sent to the server..)fThe lease permits client caching if "cachable" is true.The modify revision level and attributes for the file are also returned..ip \(buEviction Message.(l void NQNFSPROC_EVICTED (fhandle) = 21;.)lThis message is sent from the server to the client. When the client receivesthe message, it should flush data associated with the file represented by"fhandle" from its caches and then send the \fBVacated Message\fR back tothe server. Flushing includes pushing any dirty writes via. write RPCs..ip \(buVacated Message.(l void NQNFSPROC_VACATED (fhandle) = 20;.)lThis message is sent from the client to the server in response to the\fBEviction Message\fR. See above..ip \(buAccess RPC.(l struct accessargs { fhandle file; bool read_access; bool write_access; bool exec_access; }; stat NQNFSPROC_ACCESS(accessargs) = 22;.)lThe access RPC does permission checking on the server for the given typeof access required by the client for the file.Use of this RPC avoids accessibility problems caused by client->server uidmapping..ip \(buPiggybacked Get Lease Request.ppThe piggybacked get lease request is functionally equivalent to the Get LeaseRPC except that is attached to one of the other NQNFS RPC requests as follows.A getleaserequest is prepended to all of the request arguments for NQNFSand a getleaserequestres is inserted in all NFS result structures just afterthe "stat" field only if "stat == NFS_OK"..(l union getleaserequest switch (cachetype type) { case NQLREAD: case NQLWRITE: unsigned duration; default: void; }; union getleaserequestres switch (cachetype type) { case NQLREAD: case NQLWRITE: bool cachable; unsigned duration; modifyrev rev; default: void; };.)lThe get lease request applies to the file that the attached RPC operates onand the file attributes remain in the same location as for the NFS RPC replystructure..ip \(buThree additional "stat" values.ppThree additional values have been added to the enumerated type "stat"..(l NQNFS_EXPIRED=500 NQNFS_TRYLATER=501 NQNFS_AUTHERR=502.)lThe "expired" value indicates that a lease has expired.The "try later"value is returned by the server when it wishes the client to retry theRPC request after a short delay. It is used during crash recovery (Section 2)and may also be useful for server congestion control.The "authetication error" value is returned for kerberized mount points toindicate that there is no cached authentication mapping and a Kerberos ticketfor the principal is required..sh 2 "Data Types".ip \(bucachetype.(l enum cachetype { NQLNONE = 0, NQLREAD = 1, NQLWRITE = 2 };.)lType of lease requested. NQLNONE is used to indicate no piggybacked leaserequest..ip \(bumodifyrev.(l typedef unsigned hyper modifyrev;.)lThe "modifyrev" is a unsigned quadword integer value that is never zeroand increases every time the corresponding file is modified on the server..ip \(bunqnfs_time.(l struct nqnfs_time { unsigned seconds; unsigned nano_seconds; };.)lFor NQNFS times are handled at nano second resolution instead of micro secondresolution for NFS..ip \(bunqnfs_fattr.(l struct nqnfs_fattr { ftype type; unsigned mode; unsigned nlink; unsigned uid; unsigned gid; unsigned hyper size; unsigned blocksize; unsigned rdev; unsigned hyper bytes; unsigned fsid; unsigned fileid; nqnfs_time atime; nqnfs_time mtime; nqnfs_time ctime; unsigned flags; unsigned generation; modifyrev rev; };.)lThe nqnfs_fattr structure is modified from the NFS fattr so that it storesthe file size as a 64bit quantity and the storage occupied as a 64bit numberof bytes. It also has fields added for the 4.4BSD va_flags and va_gen fieldsas well as the file's modify rev level..ip \(bunqnfs_sattr.(l struct nqnfs_sattr { unsigned mode; unsigned uid; unsigned gid; unsigned hyper size; nqnfs_time atime; nqnfs_time mtime; unsigned flags; unsigned rdev; };.)lThe nqnfs_sattr structure is modified from the NFS sattr structure in thesame manner as fattr..lpThe arguments to several of the NFS RPCs have been modified as well. Mostly,these are minor changes to use 64bit file offsets or similar. The modifiedargument structures follow..ip \(buLookup RPC.(l struct lookup_diropargs { unsigned duration; fhandle dir; filename name; }; union lookup_diropres switch (stat status) { case NFS_OK: struct { union getleaserequestres lookup_lease; fhandle file; nqnfs_fattr attributes; } lookup_diropok; default: void; };.)lThe additional "duration" argument tells the server to get a lease for thename being looked up if it is non-zero and the lease is specifiedin "lookup_lease"..ip \(buRead RPC.(l struct nqnfs_readargs { fhandle file; unsigned hyper offset; unsigned count; };.)l.ip \(buWrite RPC.(l struct nqnfs_writeargs { fhandle file; unsigned hyper offset; bool append; nfsdata data; };.)lThe "append" argument is true for apeend only write operations..ip \(buGet Filesystem Attributes RPC.(l union nqnfs_statfsres (stat status) { case NFS_OK: struct { unsigned tsize; unsigned bsize; unsigned blocks; unsigned bfree; unsigned bavail; unsigned files; unsigned files_free; } info; default: void; };.)lThe "files" field is the number of files in the file system and the "files_free"is the number of additional files that can be created..sh 1 "Summary".ppThe configuration and tuning of an NFS environment tends to be a bit of amystic art, but hopefully this paper along with the man pages and otherreading will be helpful. Good Luck.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -