From 09e196e4539a70c51e828abcfe48dee3efd312d8 Mon Sep 17 00:00:00 2001 From: Alvaro Herrera Date: Wed, 28 Sep 2011 11:32:38 -0300 Subject: 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. --- src/backend/access/transam/clog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/backend/access/transam/clog.c') diff --git a/src/backend/access/transam/clog.c b/src/backend/access/transam/clog.c index 3a6c39164ce..ee645f7bd47 100644 --- a/src/backend/access/transam/clog.c +++ b/src/backend/access/transam/clog.c @@ -606,7 +606,7 @@ TruncateCLOG(TransactionId oldestXact) cutoffPage = TransactionIdToPage(oldestXact); /* Check to see if there's any files that could be removed */ - if (!SlruScanDirectory(ClogCtl, cutoffPage, false)) + if (!SlruScanDirectory(ClogCtl, SlruScanDirCbReportPresence, &cutoffPage)) return; /* nothing to remove */ /* Write XLOG record and flush XLOG to disk */ -- cgit v1.2.3