PostgreSQL Source Code: src/include/common/file_utils.h Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

13#ifndef FILE_UTILS_H

14#define FILE_UTILS_H

15

17

19{

26

28{

32

33struct iovec;

34

35#ifdef FRONTEND

36extern int pre_sync_fname(const char *fname, bool isdir);

37extern int fsync_fname(const char *fname, bool isdir);

38extern void sync_pgdata(const char *pg_data, int serverVersion,

41extern int durable_rename(const char *oldfile, const char *newfile);

43#endif

44

46 const struct dirent *de,

47 bool look_through_symlinks,

48 int elevel);

49

51 const struct iovec *source,

52 int iovcnt,

53 size_t transferred);

54

56 const struct iovec *iov,

57 int iovcnt,

58 off_t offset);

59

61

62

63#define PG_TEMP_FILES_DIR "pgsql_tmp"

64#define PG_TEMP_FILE_PREFIX "pgsql_tmp"

65

66#endif

int durable_rename(const char *oldfile, const char *newfile, int elevel)

void fsync_fname(const char *fname, bool isdir)

static int fsync_parent_path(const char *fname, int elevel)

int compute_remaining_iovec(struct iovec *destination, const struct iovec *source, int iovcnt, size_t transferred)

ssize_t pg_pwrite_zeros(int fd, size_t size, off_t offset)

@ DATA_DIR_SYNC_METHOD_SYNCFS

@ DATA_DIR_SYNC_METHOD_FSYNC

ssize_t pg_pwritev_with_retry(int fd, const struct iovec *iov, int iovcnt, off_t offset)

PGFileType get_dirent_type(const char *path, const struct dirent *de, bool look_through_symlinks, int elevel)

static bool sync_data_files

static DataDirSyncMethod sync_method

static rewind_source * source

static int fd(const char *x, int i)