sharedfileset.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. /*-------------------------------------------------------------------------
  2. *
  3. * sharedfileset.h
  4. * Shared temporary file management.
  5. *
  6. *
  7. * Portions Copyright (c) 1996-2022, PostgreSQL Global Development Group
  8. * Portions Copyright (c) 1994, Regents of the University of California
  9. *
  10. * src/include/storage/sharedfileset.h
  11. *
  12. *-------------------------------------------------------------------------
  13. */
  14. #ifndef SHAREDFILESET_H
  15. #define SHAREDFILESET_H
  16. #include "storage/dsm.h"
  17. #include "storage/fd.h"
  18. #include "storage/fileset.h"
  19. #include "storage/spin.h"
  20. /*
  21. * A set of temporary files that can be shared by multiple backends.
  22. */
  23. typedef struct SharedFileSet
  24. {
  25. FileSet fs;
  26. slock_t mutex; /* mutex protecting the reference count */
  27. int refcnt; /* number of attached backends */
  28. } SharedFileSet;
  29. extern void SharedFileSetInit(SharedFileSet *fileset, dsm_segment *seg);
  30. extern void SharedFileSetAttach(SharedFileSet *fileset, dsm_segment *seg);
  31. extern void SharedFileSetDeleteAll(SharedFileSet *fileset);
  32. #endif