QPID-8326: Remove unused code/data in Linearstore
diff --git a/src/qpid/linearstore/journal/pmgr.cpp b/src/qpid/linearstore/journal/pmgr.cpp
index 269c8c5..c507b54 100644
--- a/src/qpid/linearstore/journal/pmgr.cpp
+++ b/src/qpid/linearstore/journal/pmgr.cpp
@@ -25,7 +25,6 @@
namespace linearstore {
namespace journal {
-// TODO: almost identical to pmgr::page_state_str() below - resolve
const char*
pmgr::page_cb::state_str() const
{
@@ -112,11 +111,8 @@
for (uint16_t i=0; i<_cache_num_pages; i++)
{
_page_ptr_arr[i] = (void*)((char*)_page_base_ptr + _cache_pgsize_sblks * _sblkSizeBytes * i);
- _page_cb_arr[i]._index = i;
_page_cb_arr[i]._state = UNUSED;
- _page_cb_arr[i]._pbuff = _page_ptr_arr[i];
_page_cb_arr[i]._pdtokl = new std::deque<data_tok*>;
- _page_cb_arr[i]._pdtokl->clear();
_aio_cb_arr[i].data = (void*)&_page_cb_arr[i];
}
@@ -163,20 +159,4 @@
_aio_event_arr = 0;
}
-// TODO: almost identical to pmgr::page_cb::state_str() above - resolve
-const char*
-pmgr::page_state_str(page_state ps)
-{
- switch (ps)
- {
- case UNUSED:
- return "UNUSED";
- case IN_USE:
- return "IN_USE";
- case AIO_PENDING:
- return "AIO_PENDING";
- }
- return "<page_state unknown>";
-}
-
}}}
diff --git a/src/qpid/linearstore/journal/pmgr.h b/src/qpid/linearstore/journal/pmgr.h
index 05127ae..e482f46 100644
--- a/src/qpid/linearstore/journal/pmgr.h
+++ b/src/qpid/linearstore/journal/pmgr.h
@@ -62,13 +62,10 @@
*/
struct page_cb
{
- uint16_t _index; ///< Index of this page
- page_state _state; ///< Status of page
- uint64_t _frid; ///< First rid in page (used for fhdr init)
- uint32_t _wdblks; ///< Total number of dblks in page so far
std::deque<data_tok*>* _pdtokl; ///< Page message tokens list
JournalFile* _jfp; ///< Journal file for incrementing compl counts
- void* _pbuff; ///< Page buffer
+ uint32_t _wdblks; ///< Total number of dblks in page so far
+ page_state _state; ///< Status of page
const char* state_str() const; ///< Return state as string for this pcb
};
@@ -102,7 +99,6 @@
virtual int32_t get_events(timespec* const timeout, bool flush) = 0;
inline uint32_t get_aio_evt_rem() const { return _aio_evt_rem; }
- static const char* page_state_str(page_state ps);
inline uint32_t cache_pgsize_sblks() const { return _cache_pgsize_sblks; }
inline uint16_t cache_num_pages() const { return _cache_num_pages; }
diff --git a/src/qpid/linearstore/journal/wmgr.cpp b/src/qpid/linearstore/journal/wmgr.cpp
index 1ff18da..961e650 100644
--- a/src/qpid/linearstore/journal/wmgr.cpp
+++ b/src/qpid/linearstore/journal/wmgr.cpp
@@ -773,12 +773,11 @@
oss << " iocb->u.c.resfd=" << aiocbp->u.c.resfd << std::endl;
if (pcbp) {
oss << " Page Control Block: (iocb->data):" << std::endl;
- oss << " pcb.index=" << pcbp->_index << std::endl;
- oss << " pcb.state=" << pcbp->_state << " (" << pmgr::page_state_str(pcbp->_state) << ")" << std::endl;
- oss << " pcb.frid=0x" << std::hex << pcbp->_frid << std::dec << std::endl;
+ oss << " pcb index=" << pcbp-_page_cb_arr << std::endl;
+ oss << " pcb.state=" << pcbp->_state << " (" << pcbp->state_str() << ")" << std::endl;
oss << " pcb.wdblks=0x" << std::hex << pcbp->_wdblks << std::dec << std::endl;
oss << " pcb.pdtokl.size=" << pcbp->_pdtokl->size() << std::endl;
- oss << " pcb.pbuff=" << pcbp->_pbuff << std::endl;
+ oss << " pcb pbuff=" << &_page_ptr_arr[pcbp-_page_cb_arr] << std::endl;
oss << " JournalFile (pcb.jfp):" << std::endl;
oss << pcbp->_jfp->status_str(6) << std::endl;
} else {