home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Amiga 13 / MA_Cover_13.bin / source / c / nfsd / todo / readcache.h
Encoding:
C/C++ Source or Header  |  1999-04-08  |  1.9 KB  |  52 lines

  1. /* a possible solution for faster file reading performance
  2.    of nfsd
  3.   
  4.    - the current routines for authentication would be used on
  5.      the first read request, then the cache structure will
  6.      be created and some data read, for files smaller than
  7.      request just don`t create a cache entry
  8.    - on each nfsproc_read_2_svc call first check the read cache
  9.      (maybe put the accessed file to the top of the list for
  10.      scanning speed improvement) and if the cache entry is
  11.      valid, read from the supplied handle
  12.    - on checking the read cache remove entries where the timestamp
  13.      expired
  14.    - maybe adding some fields to the localfile structure would
  15.      do the job as well
  16.    
  17.    written in 1999 by Henryk Richter
  18. */
  19. #ifndef NFS_READCACHE_H
  20. #define NFS_READCACHE_H
  21.  
  22. #include <rpc/rpc.h>
  23. #include "nfs.h"
  24.  
  25. struct filereadcache
  26. {
  27.  struct MinNode    fc_Node;
  28.  /* the next 4 entries should be enough for verifying authentication */
  29.  nfs_fh            fc_NFSHandle;        /* The NFS handle of this file */
  30.  ULONG            fc_r_uid;            /* uid of remote user who opened the file */
  31.  ULONG            fc_r_ip;            /* remote ip from where the file was opened */
  32.  STRPTR            fc_name;            /* name of file */
  33.  
  34.  /* the 2 entries below control expiration of file/disk attributes and cache validity */
  35.  ULONG            fc_opentime;        /* time when the file was opened (from timeval.tv_secs should do !?)
  36.                                         could e.g. be used to update the "infodata"
  37.                                         and "fib" structures every 10 seconds instead
  38.                                         on each access */
  39.  ULONG            fc_lastreadtime;    /* time when the last read access to
  40.                                          file was done
  41.                                          could be used for expiration of cache entry 
  42.                                          after, let`s say, 5 seconds */
  43.                                         
  44.  BPTR            fc_handle;            /* filehandle for this file, maybe 
  45.                                        use Asyncio "struct AsyncFile *" instead
  46.                                        for better performance */
  47.  
  48.  /* cached entries for reply attributes */
  49.  struct fattr    fc_fattr;
  50. }
  51.  
  52. #endif