Use callbacks in SlruScanDirectory for the actual action

Alvaro Herrera <alvherre@alvh.no-ip.org>

Commit: 09e196e4539a70c51e828abcfe48dee3efd312d8
Author: Alvaro Herrera <alvherre@alvh.no-ip.org>
Date: 2011-10-04T17:03:23Z
Releases: 9.2.0
Use callbacks in SlruScanDirectory for the actual action

Previously, the code assumed that the only possible action to take was
to delete files behind a certain cutoff point.  The async notify code
was already a crock: it used a different "pagePrecedes" function for
truncation than for regular operation.  By allowing it to pass a
callback to SlruScanDirectory it can do cleanly exactly what it needs to
do.

The clog.c code also had its own use for SlruScanDirectory, which is
made a bit simpler with this.

Files

PathChange+/−
src/backend/access/transam/clog.c modified +1 −1
src/backend/access/transam/slru.c modified +76 −28
src/backend/commands/async.c modified +7 −29
src/include/access/slru.h modified +10 −1