LCOV - code coverage report
Current view: top level - src/bin/pg_upgrade - slru_io.h (source / functions) Coverage Total Hit
Test: PostgreSQL 20devel Lines: 0.0 % 8 0
Test Date: 2026-07-16 11:17:59 Functions: 0.0 % 2 0
Legend: Lines:     hit not hit
Branches: + taken - not taken # not executed
Branches: 0.0 % 8 0

             Branch data     Line data    Source code
       1                 :             : /*
       2                 :             :  * slru_io.h
       3                 :             :  *
       4                 :             :  * Copyright (c) 2025-2026, PostgreSQL Global Development Group
       5                 :             :  * src/bin/pg_upgrade/slru_io.h
       6                 :             :  */
       7                 :             : 
       8                 :             : #ifndef SLRU_IO_H
       9                 :             : #define SLRU_IO_H
      10                 :             : 
      11                 :             : /*
      12                 :             :  * State for reading or writing an SLRU, with a one page buffer.
      13                 :             :  */
      14                 :             : typedef struct SlruSegState
      15                 :             : {
      16                 :             :     bool        writing;
      17                 :             :     bool        long_segment_names;
      18                 :             : 
      19                 :             :     char       *dir;
      20                 :             :     char       *fn;
      21                 :             :     int         fd;
      22                 :             :     int64       segno;
      23                 :             :     uint64      pageno;
      24                 :             : 
      25                 :             :     PGAlignedBlock buf;
      26                 :             : } SlruSegState;
      27                 :             : 
      28                 :             : extern SlruSegState *AllocSlruRead(const char *dir, bool long_segment_names);
      29                 :             : extern char *SlruReadSwitchPageSlow(SlruSegState *state, uint64 pageno);
      30                 :             : extern void FreeSlruRead(SlruSegState *state);
      31                 :             : 
      32                 :             : static inline char *
      33                 :           0 : SlruReadSwitchPage(SlruSegState *state, uint64 pageno)
      34                 :             : {
      35   [ #  #  #  # ]:           0 :     if (state->segno != -1 && pageno == state->pageno)
      36                 :           0 :         return state->buf.data;
      37                 :           0 :     return SlruReadSwitchPageSlow(state, pageno);
      38                 :             : }
      39                 :             : 
      40                 :             : extern SlruSegState *AllocSlruWrite(const char *dir, bool long_segment_names);
      41                 :             : extern char *SlruWriteSwitchPageSlow(SlruSegState *state, uint64 pageno);
      42                 :             : extern void FreeSlruWrite(SlruSegState *state);
      43                 :             : 
      44                 :             : static inline char *
      45                 :           0 : SlruWriteSwitchPage(SlruSegState *state, uint64 pageno)
      46                 :             : {
      47   [ #  #  #  # ]:           0 :     if (state->segno != -1 && pageno == state->pageno)
      48                 :           0 :         return state->buf.data;
      49                 :           0 :     return SlruWriteSwitchPageSlow(state, pageno);
      50                 :             : }
      51                 :             : 
      52                 :             : #endif                          /* SLRU_IO_H */
        

Generated by: LCOV version 2.0-1