gooderp18绿色标准版
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

46 行
1.5KB

  1. /*-------------------------------------------------------------------------
  2. *
  3. * sharedfileset.h
  4. * Shared temporary file management.
  5. *
  6. *
  7. * Portions Copyright (c) 1996-2019, 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/spin.h"
  19. /*
  20. * A set of temporary files that can be shared by multiple backends.
  21. */
  22. typedef struct SharedFileSet
  23. {
  24. pid_t creator_pid; /* PID of the creating process */
  25. uint32 number; /* per-PID identifier */
  26. slock_t mutex; /* mutex protecting the reference count */
  27. int refcnt; /* number of attached backends */
  28. int ntablespaces; /* number of tablespaces to use */
  29. Oid tablespaces[8]; /* OIDs of tablespaces to use. Assumes that
  30. * it's rare that there more than temp
  31. * tablespaces. */
  32. } SharedFileSet;
  33. extern void SharedFileSetInit(SharedFileSet *fileset, dsm_segment *seg);
  34. extern void SharedFileSetAttach(SharedFileSet *fileset, dsm_segment *seg);
  35. extern File SharedFileSetCreate(SharedFileSet *fileset, const char *name);
  36. extern File SharedFileSetOpen(SharedFileSet *fileset, const char *name);
  37. extern bool SharedFileSetDelete(SharedFileSet *fileset, const char *name,
  38. bool error_on_failure);
  39. extern void SharedFileSetDeleteAll(SharedFileSet *fileset);
  40. #endif
上海开阖软件有限公司 沪ICP备12045867号-1