@ -5445,7 +5445,7 @@ WritebackContextInit(WritebackContext *context, int *max_pending)
* Add buffer to list of pending writeback requests .
*/
void
ScheduleBufferTagForWriteback ( WritebackContext * context , BufferTag * tag )
ScheduleBufferTagForWriteback ( WritebackContext * wb_ context, BufferTag * tag )
{
PendingWriteback * pending ;
@ -5456,11 +5456,11 @@ ScheduleBufferTagForWriteback(WritebackContext *context, BufferTag *tag)
* Add buffer to the pending writeback array , unless writeback control is
* disabled .
*/
if ( * context - > max_pending > 0 )
if ( * wb_ context- > max_pending > 0 )
{
Assert ( * context - > max_pending < = WRITEBACK_MAX_PENDING_FLUSHES ) ;
Assert ( * wb_ context- > max_pending < = WRITEBACK_MAX_PENDING_FLUSHES ) ;
pending = & context - > pending_writebacks [ context - > nr_pending + + ] ;
pending = & wb_ context- > pending_writebacks [ wb_ context- > nr_pending + + ] ;
pending - > tag = * tag ;
}
@ -5470,8 +5470,8 @@ ScheduleBufferTagForWriteback(WritebackContext *context, BufferTag *tag)
* includes the case where previously an item has been added , but control
* is now disabled .
*/
if ( context - > nr_pending > = * context - > max_pending )
IssuePendingWritebacks ( context ) ;
if ( wb_ context- > nr_pending > = * wb_ context- > max_pending )
IssuePendingWritebacks ( wb_ context) ;
}
# define ST_SORT sort_pending_writebacks
@ -5489,25 +5489,26 @@ ScheduleBufferTagForWriteback(WritebackContext *context, BufferTag *tag)
* error out - it ' s just a hint .
*/
void
IssuePendingWritebacks ( WritebackContext * context )
IssuePendingWritebacks ( WritebackContext * wb_ context)
{
int i ;
if ( context - > nr_pending = = 0 )
if ( wb_ context- > nr_pending = = 0 )
return ;
/*
* Executing the writes in - order can make them a lot faster , and allows to
* merge writeback requests to consecutive blocks into larger writebacks .
*/
sort_pending_writebacks ( context - > pending_writebacks , context - > nr_pending ) ;
sort_pending_writebacks ( wb_context - > pending_writebacks ,
wb_context - > nr_pending ) ;
/*
* Coalesce neighbouring writes , but nothing else . For that we iterate
* through the , now sorted , array of pending flushes , and look forward to
* find all neighbouring ( or identical ) writes .
*/
for ( i = 0 ; i < context - > nr_pending ; i + + )
for ( i = 0 ; i < wb_ context- > nr_pending ; i + + )
{
PendingWriteback * cur ;
PendingWriteback * next ;
@ -5517,7 +5518,7 @@ IssuePendingWritebacks(WritebackContext *context)
RelFileLocator currlocator ;
Size nblocks = 1 ;
cur = & context - > pending_writebacks [ i ] ;
cur = & wb_ context- > pending_writebacks [ i ] ;
tag = cur - > tag ;
currlocator = BufTagGetRelFileLocator ( & tag ) ;
@ -5525,10 +5526,10 @@ IssuePendingWritebacks(WritebackContext *context)
* Peek ahead , into following writeback requests , to see if they can
* be combined with the current one .
*/
for ( ahead = 0 ; i + ahead + 1 < context - > nr_pending ; ahead + + )
for ( ahead = 0 ; i + ahead + 1 < wb_ context- > nr_pending ; ahead + + )
{
next = & context - > pending_writebacks [ i + ahead + 1 ] ;
next = & wb_ context- > pending_writebacks [ i + ahead + 1 ] ;
/* different file, stop */
if ( ! RelFileLocatorEquals ( currlocator ,
@ -5555,7 +5556,7 @@ IssuePendingWritebacks(WritebackContext *context)
smgrwriteback ( reln , BufTagGetForkNum ( & tag ) , tag . blockNum , nblocks ) ;
}
context - > nr_pending = 0 ;
wb_ context- > nr_pending = 0 ;
}