Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

93 lines
2.1 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Copyright (C) 1992, Microsoft Corporation.
  4. //
  5. // File: fcbsup.h
  6. //
  7. // Contents: Declarations for DFS_FCB lookup support functions.
  8. //
  9. // History: 20 Feb 1993 Alanw Created
  10. //
  11. //--------------------------------------------------------------------------
  12. #ifndef __FCBSUP_H__
  13. #define __FCBSUP_H__
  14. //
  15. // In order to avoid modifying file objects which are passed
  16. // through the DFS and used by other file systems, DFS_FCB records
  17. // used by DFS are not directly attached to the file object
  18. // through one of the fscontext fields, they are instead
  19. // associated with the file object, and looked up as needed.
  20. //
  21. // A hashing mechanism is used for the lookup. Since the
  22. // file object being looked up is just a pointer, the hash
  23. // function is just a simple combination of a few of the low-
  24. // order bits of the pointer's address.
  25. //
  26. //
  27. // Declaration of the hash table. The hash table can be variably
  28. // sized, with the hash table size being a parameter of the hash
  29. // function.
  30. //
  31. typedef struct _FCB_HASH_TABLE {
  32. //
  33. // The type and size of this record (must be DSFS_NTC_FCB_HASH)
  34. //
  35. NODE_TYPE_CODE NodeTypeCode;
  36. NODE_BYTE_SIZE NodeByteSize;
  37. //
  38. // Mask value for the hash function. The hash table size is
  39. // assumed to be a power of two; the mask is the size - 1.
  40. //
  41. ULONG HashMask;
  42. //
  43. // A spinlock to protect access to the hash bucket lists.
  44. //
  45. KSPIN_LOCK HashListSpinLock;
  46. //
  47. // An array of list heads for the hash table chains. There
  48. // are actually N of these where N is the hash table size.
  49. //
  50. LIST_ENTRY HashBuckets[1];
  51. } FCB_HASH_TABLE, *PFCB_HASH_TABLE;
  52. NTSTATUS
  53. DfsInitFcbs(
  54. IN ULONG n
  55. );
  56. VOID
  57. DfsUninitFcbs(
  58. VOID);
  59. PDFS_FCB
  60. DfsLookupFcb(
  61. IN PFILE_OBJECT pFile
  62. );
  63. VOID
  64. DfsAttachFcb(
  65. IN PFILE_OBJECT pFileObj,
  66. IN PDFS_FCB pFCB
  67. );
  68. VOID
  69. DfsDetachFcb(
  70. IN PFILE_OBJECT pFileObj,
  71. IN PDFS_FCB pFCB
  72. );
  73. #endif // __FCBSUP_H__