1.1 --- a/libfsserver/lib/mapping/page_mapper.cc Sat Sep 11 19:44:57 2021 +0200
1.2 +++ b/libfsserver/lib/mapping/page_mapper.cc Sun Sep 12 01:14:30 2021 +0200
1.3 @@ -24,27 +24,19 @@
1.4
1.5
1.6
1.7 +/* Provide mapped pages populated with the given 'accessor', with pages obtained
1.8 + from the given 'pages' collection. */
1.9 +
1.10 PageMapper::PageMapper(Accessor *accessor, Pages *pages)
1.11 : _accessor(accessor), _pages(pages)
1.12 {
1.13 }
1.14
1.15 -/* Accounting methods. */
1.16 +/* Upon deallocation, purge active pages. */
1.17
1.18 -/* Detach a pager, purging active pages and closing the accessor if no more
1.19 - pagers are attached. Return whether any pagers are still attached. */
1.20 -
1.21 -unsigned int PageMapper::detach()
1.22 +PageMapper::~PageMapper()
1.23 {
1.24 - unsigned int attached = Accountable::detach();
1.25 -
1.26 - if (!attached)
1.27 - {
1.28 - _map.purge(this, _pages);
1.29 - _accessor->close();
1.30 - }
1.31 -
1.32 - return attached;
1.33 + _map.purge(this, _pages);
1.34 }
1.35
1.36 /* Interface for the pager. */