PostgreSQL Source Code
git master
|
#include "postgres.h"
#include <dirent.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <unistd.h>
#include "common/file_utils.h"
#include "common/relpath.h"
#include "port/pg_iovec.h"
Go to the source code of this file.
Functions | |
PGFileType | get_dirent_type (const char *path, const struct dirent *de, bool look_through_symlinks, int elevel) |
int | compute_remaining_iovec (struct iovec *destination, const struct iovec *source, int iovcnt, size_t transferred) |
ssize_t | pg_pwritev_with_retry (int fd, const struct iovec *iov, int iovcnt, off_t offset) |
ssize_t | pg_pwrite_zeros (int fd, size_t size, off_t offset) |
int compute_remaining_iovec | ( | struct iovec * | destination, |
const struct iovec * | source, | ||
int | iovcnt, | ||
size_t | transferred | ||
) |
Definition at line 593 of file file_utils.c.
References Assert, and source.
Referenced by mdreadv(), mdwritev(), and pg_pwritev_with_retry().
PGFileType get_dirent_type | ( | const char * | path, |
const struct dirent * | de, | ||
bool | look_through_symlinks, | ||
int | elevel | ||
) |
Definition at line 526 of file file_utils.c.
References dirent::d_type, DT_DIR, DT_LNK, DT_REG, ereport, errcode_for_file_access(), errmsg(), lstat, pg_log_generic(), PG_LOG_PRIMARY, PGFILETYPE_DIR, PGFILETYPE_ERROR, PGFILETYPE_LNK, PGFILETYPE_REG, PGFILETYPE_UNKNOWN, S_ISDIR, S_ISLNK, S_ISREG, stat::st_mode, and stat.
Referenced by CheckPointLogicalRewriteHeap(), CheckPointSnapBuild(), CheckTablespaceDirectory(), copydir(), do_pg_backup_start(), GetConfFilesInDir(), pg_tzenumerate_next(), process_directory_recursively(), RemovePgTempFilesInDir(), RemoveXlogFile(), rmtree(), scan_for_existing_tablespaces(), StartupReplicationSlots(), and walkdir().
ssize_t pg_pwrite_zeros | ( | int | fd, |
size_t | size, | ||
off_t | offset | ||
) |
Definition at line 688 of file file_utils.c.
References Assert, fd(), PG_IOV_MAX, pg_pwritev_with_retry(), size, and unconstify.
Referenced by dir_open_for_write(), FileZero(), and XLogFileInitInternal().
ssize_t pg_pwritev_with_retry | ( | int | fd, |
const struct iovec * | iov, | ||
int | iovcnt, | ||
off_t | offset | ||
) |
Definition at line 638 of file file_utils.c.
References compute_remaining_iovec(), fd(), Min, PG_IOV_MAX, and pg_pwritev().
Referenced by pg_pwrite_zeros().