home *** CD-ROM | disk | FTP | other *** search
- /* a possible solution for faster file reading performance
- of nfsd
-
- - the current routines for authentication would be used on
- the first read request, then the cache structure will
- be created and some data read, for files smaller than
- request just don`t create a cache entry
- - on each nfsproc_read_2_svc call first check the read cache
- (maybe put the accessed file to the top of the list for
- scanning speed improvement) and if the cache entry is
- valid, read from the supplied handle
- - on checking the read cache remove entries where the timestamp
- expired
- - maybe adding some fields to the localfile structure would
- do the job as well
-
- written in 1999 by Henryk Richter
- */
- #ifndef NFS_READCACHE_H
- #define NFS_READCACHE_H
-
- #include <rpc/rpc.h>
- #include "nfs.h"
-
- struct filereadcache
- {
- struct MinNode fc_Node;
- /* the next 4 entries should be enough for verifying authentication */
- nfs_fh fc_NFSHandle; /* The NFS handle of this file */
- ULONG fc_r_uid; /* uid of remote user who opened the file */
- ULONG fc_r_ip; /* remote ip from where the file was opened */
- STRPTR fc_name; /* name of file */
-
- /* the 2 entries below control expiration of file/disk attributes and cache validity */
- ULONG fc_opentime; /* time when the file was opened (from timeval.tv_secs should do !?)
- could e.g. be used to update the "infodata"
- and "fib" structures every 10 seconds instead
- on each access */
- ULONG fc_lastreadtime; /* time when the last read access to
- file was done
- could be used for expiration of cache entry
- after, let`s say, 5 seconds */
-
- BPTR fc_handle; /* filehandle for this file, maybe
- use Asyncio "struct AsyncFile *" instead
- for better performance */
-
- /* cached entries for reply attributes */
- struct fattr fc_fattr;
- }
-
- #endif