postgresql/src/backend/access
Michael Paquier bfb9dfd937 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
2022-09-02 16:58:06 +09:00
..
brin Further reduce warnings with -Wshadow=compatible-local 2022-08-24 12:27:12 +12:00
common Overload index_form_tuple to allow the memory context to be supplied 2022-07-07 08:14:00 +12:00
gin Change internal RelFileNode references to RelFileNumber or RelFileLocator. 2022-07-06 11:39:09 -04:00
gist Small refactor to get rid of -Wshadow=compatible-local warning 2022-08-26 02:46:56 +12:00
hash More -Wshadow=compatible-local warning fixes 2022-08-26 02:35:40 +12:00
heap Expand the use of get_dirent_type(), shaving a few calls to stat()/lstat() 2022-09-02 16:58:06 +09:00
index Update copyright for 2022 2022-01-07 19:04:57 -05:00
nbtree Fix comments about deduplication updating page. 2022-08-05 14:25:49 -07:00
rmgrdesc Fix assert in logicalmsg_desc 2022-08-16 23:52:10 +02:00
spgist Further -Wshadow=compatible-local warning fixes 2022-08-24 22:04:28 +12:00
table Eliminate duplicate code in table.c. 2022-07-26 08:22:53 +05:30
tablesample Update copyright for 2022 2022-01-07 19:04:57 -05:00
transam Expand the use of get_dirent_type(), shaving a few calls to stat()/lstat() 2022-09-02 16:58:06 +09:00
Makefile Introduce access/{table.h, relation.h}, for generic functions from heapam.h. 2019-01-21 10:51:36 -08:00