pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Revise pg_pwrite_zeros()
Date: Mon, 06 Mar 2023 04:21:53 +0000
Message-ID: <E1pZ2MD-0028J0-2W@gemulon.postgresql.org> (raw)

Revise pg_pwrite_zeros()

The following changes are made to pg_write_zeros(), the API able to
write series of zeros using vectored I/O:
- Add of an "offset" parameter, to write the size from this position
(the 'p' of "pwrite" seems to mean position, though POSIX does not
outline ythat directly), hence the name of the routine is incorrect if
it is not able to handle offsets.
- Avoid memset() of "zbuffer" on every call.
- Avoid initialization of the whole IOV array if not needed.
- Group the trailing write() call with the main write() call,
simplifying the function logic.

Author: Andres Freund
Reviewed-by: Michael Paquier, Bharath Rupireddy
Discussion: https://postgr.es/m/20230215005525.mrrlmqrxzjzhaipl@awork3.anarazel.de

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/ce340e530d1f76367379a8d230ad5f411e5f25d2

Modified Files
--------------
src/backend/access/transam/xlog.c  |  2 +-
src/bin/pg_basebackup/walmethods.c |  2 +-
src/common/file_utils.c            | 62 +++++++++++++-------------------------
src/include/common/file_utils.h    |  2 +-
4 files changed, 24 insertions(+), 44 deletions(-)



Message-ID: <E1pZ2MD-0028J0-2W@gemulon.postgresql.org>
Permalink:  ../E1pZ2MD-0028J0-2W@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1pZ2MD-0028J0-2W@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz
  Subject: Re: pgsql: Revise pg_pwrite_zeros()
  In-Reply-To: <E1pZ2MD-0028J0-2W@gemulon.postgresql.org>
  References: <E1pZ2MD-0028J0-2W@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox