summaryrefslogtreecommitdiff
path: root/README
diff options
context:
space:
mode:
authorMichael Paquier2022-09-02 07:58:06 +0000
committerMichael Paquier2022-09-02 07:58:06 +0000
commitbfb9dfd93720098cf8f3e7d802df9b02ebe3dc20 (patch)
treeda8365df67d59ce2cc7271ffef54f53665bc0870 /README
parent11e5f99d39ef58ce34c41f4163c1a3df2c639069 (diff)
Expand the use of get_dirent_type(), shaving a few calls to stat()/lstat()
Several backend-side loops scanning one or more directories with ReadDir() (WAL segment recycle/removal in xlog.c, backend-side directory copy, temporary file removal, configuration file parsing, some logical decoding logic and some pgtz stuff) already know the type of the entry being scanned thanks to the dirent structure associated to the entry, on platforms where we know about DT_REG, DT_DIR and DT_LNK to make the difference between a regular file, a directory and a symbolic link. Relying on the direct structure of an entry saves a few system calls to stat() and lstat() in the loops updated here, shaving some code while on it. The logic of the code remains the same, calling stat() or lstat() depending on if it is necessary to look through symlinks. Authors: Nathan Bossart, Bharath Rupireddy Reviewed-by: Andres Freund, Thomas Munro, Michael Paquier Discussion: https://postgr.es/m/CALj2ACV8n-J-f=yiLUOx2=HrQGPSOZM3nWzyQQvLPcccPXxEdg@mail.gmail.com
Diffstat (limited to 'README')
0 files changed, 0 insertions, 0 deletions