home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Amiga 13 / MA_Cover_13.bin / source / c / nfsd / src / handle_list.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-11-30  |  2.1 KB  |  67 lines

  1. /*  Header for file handle management routines
  2.  
  3.     ©1998,1999 Joseph Walton
  4.  
  5.     This software is distributed under the terms of the GNU General Public
  6.     License; either version 2 of the License, or (at your option) any
  7.     later version.
  8. */
  9.  
  10. /*
  11.     25-Sep-1998 Added a few more fields to LocalFile
  12.     30-Sep-1999 Using a timeval instead of a DateStamp
  13. */
  14.  
  15. #ifndef NFSD_HANDLE_LIST_H
  16. #define NFSD_HANDLE_LIST_H
  17.  
  18. #include "nfs.h"
  19. #include "dirlist.h"
  20.  
  21. #include <dos/dos.h>
  22. #include <exec/lists.h>
  23. #include <devices/timer.h>
  24.  
  25. /* Every FLUSH_HANDLES_EVERY seconds, release anything that hasn't been used
  26.     for FLUSH_HANDLES_AFTER seconds */
  27. #define FLUSH_HANDLES_EVERY (300)
  28. #define FLUSH_HANDLES_AFTER (600)
  29.  
  30. struct LocalFile {
  31.     struct MinNode lf_Node;
  32.     STRPTR lf_Name;                 /* The local name of the file */
  33.     nfs_fh lf_NFSHandle;            /* The NFS handle of this file */
  34.     u_int lf_FileID;                /* Unique inode */
  35.     BOOL lf_IsMount;                /* Is this a mount point? If so, do not flush. */
  36.     ftype lf_Type;                  /* The type we think it has */
  37.     struct timeval lf_LastUsed;     /* When we last used all this data */
  38.     BPTR lf_Lock;                   /* Possibly a DOS lock on this resource */
  39.     struct DEList *lf_DEList;       /* Possibly a list of entries in this directory */
  40.  
  41.     LONG lf_ForcedUID;              /* These override the real values */
  42.     LONG lf_ForcedGID;
  43.     LONG lf_ForcedProtection;
  44.  
  45. };
  46.  
  47. /* It might be smart to hold an open lock or file handle here as well,
  48.     but that raises problems with files being renamed during access,
  49.     amongst other things */
  50.  
  51. BOOL init_handle_list(void);
  52. void persistent_inode_fetch(void);
  53. BOOL persistent_inode_store(void);
  54. struct LocalFile *find_handle(nfs_fh *fh);
  55. struct LocalFile *get_by_handle(nfs_fh *fh, nfsstat *stat, ULONG mode);
  56. void release_lf(struct LocalFile *lf);
  57. BOOL flush_handles(void);
  58. int32 *fh_copy(struct LocalFile *lf, int32 *dest);
  59. void fh_print(nfs_fh *fh);
  60. void correct_struct(struct LocalFile *lf);
  61. struct LocalFile *get_namedlocalfile(STRPTR name);
  62. struct LocalFile *find_namedlocalfile(STRPTR name);
  63. void lose_localfile(STRPTR full_name);
  64.  
  65. #endif
  66.  
  67.