pgsql: Provide vectored variants of FileRead() and FileWrite(). - Mailing list pgsql-committers

From Thomas Munro
Subject pgsql: Provide vectored variants of FileRead() and FileWrite().
Date
Msg-id E1rCqRH-009l2q-8U@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Provide vectored variants of FileRead() and FileWrite().

FileReadV() and FileWriteV() adapt pg_preadv() and pg_pwritev() for
fd.c's virtual file descriptors.  The simple FileRead() and FileWrite()
functions are now implemented in terms of the vectored functions, to
avoid code duplication, and they are converted back to the corresponding
simple system calls further down (commit 15c9ac36).  Later work will
make more interesting multi-iovec calls.

The traditional behavior of reporting a "fake" ENOSPC error is
simplified.  It's now always set for non-failing writes, for the benefit
of callers that expect to log a meaningful "%m" if they determine that
the write was short.  (Perhaps we should consider getting rid of that
expectation one day.)

Reviewed-by: Heikki Linnakangas <hlinnaka@iki.fi>
Discussion: https://postgr.es/m/CA+hUKGJkOiOCa+mag4BF+zHo7qo=o9CFheB8=g6uT5TUm2gkvA@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/871fe4917e1e92304bdcc2ab779de7416492c6de

Modified Files
--------------
src/backend/storage/file/fd.c | 43 +++++++++++++++++++++++++------------------
src/include/storage/fd.h      | 32 +++++++++++++++++++++++++++++---
2 files changed, 54 insertions(+), 21 deletions(-)


pgsql-committers by date:

Previous
From: Thomas Munro
Date:
Subject: pgsql: Provide helper for retrying partial vectored I/O.
Next
From: Daniel Gustafsson
Date:
Subject: pgsql: Fix typo in comment