postgresql/src/backend/storage
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
..
buffer Include RelFileLocator fields individually in BufferTag. 2022-08-24 15:50:48 -04:00
file Expand the use of get_dirent_type(), shaving a few calls to stat()/lstat() 2022-09-02 16:58:06 +09:00
freespace Change internal RelFileNode references to RelFileNumber or RelFileLocator. 2022-07-06 11:39:09 -04:00
ipc Remove configure probes for sys/ipc.h, sys/sem.h, sys/shm.h. 2022-08-14 00:09:47 +12:00
large_object Update copyright for 2022 2022-01-07 19:04:57 -05:00
lmgr Avoid using list_length() to test for empty list. 2022-08-17 11:12:35 -04:00
page Convert macros to static inline functions (bufpage.h) 2022-07-11 07:21:52 +02:00
smgr Use TRUNCATE to preserve relfilenode for pg_largeobject + index. 2022-07-28 16:03:42 -04:00
sync Avoid shadowing a variable in sync.c. 2022-07-15 00:06:32 +12:00
Makefile Refactor the fsync queue for wider use. 2019-04-04 23:38:38 +13:00