1.1 --- a/libfsserver/include/fsserver/pages.h Sat May 28 00:59:04 2022 +0200
1.2 +++ b/libfsserver/include/fsserver/pages.h Sat May 28 23:52:48 2022 +0200
1.3 @@ -1,7 +1,7 @@
1.4 /*
1.5 * A page collection abstraction providing pages from a queue to users.
1.6 *
1.7 - * Copyright (C) 2021 Paul Boddie <paul@boddie.org.uk>
1.8 + * Copyright (C) 2021, 2022 Paul Boddie <paul@boddie.org.uk>
1.9 *
1.10 * This program is free software; you can redistribute it and/or
1.11 * modify it under the terms of the GNU General Public License as
1.12 @@ -36,13 +36,13 @@
1.13 Memory *_memory;
1.14 PageQueue *_queue;
1.15
1.16 + virtual Flexpage *remove();
1.17 +
1.18 public:
1.19 explicit Pages(Memory *memory, PageQueue *queue);
1.20
1.21 virtual ~Pages();
1.22
1.23 - virtual Flexpage *remove();
1.24 -
1.25 virtual bool reserve(PageOwner *owner, Flexpage *flexpage);
1.26
1.27 virtual Flexpage *flexpage();
2.1 --- a/libfsserver/lib/mapping/page_mapper.cc Sat May 28 00:59:04 2022 +0200
2.2 +++ b/libfsserver/lib/mapping/page_mapper.cc Sat May 28 23:52:48 2022 +0200
2.3 @@ -130,11 +130,6 @@
2.4 {
2.5 Flexpage *flexpage = _pages->flexpage();
2.6
2.7 - /* Obtain an existing flexpage and reuse it. */
2.8 -
2.9 - if (flexpage == NULL)
2.10 - flexpage = _pages->remove();
2.11 -
2.12 flexpage->reset(offset);
2.13
2.14 fill(flexpage);
3.1 --- a/libfsserver/lib/pages/pages.cc Sat May 28 00:59:04 2022 +0200
3.2 +++ b/libfsserver/lib/pages/pages.cc Sat May 28 23:52:48 2022 +0200
3.3 @@ -1,7 +1,7 @@
3.4 /*
3.5 * A page collection abstraction providing pages from a queue to users.
3.6 *
3.7 - * Copyright (C) 2021 Paul Boddie <paul@boddie.org.uk>
3.8 + * Copyright (C) 2021, 2022 Paul Boddie <paul@boddie.org.uk>
3.9 *
3.10 * This program is free software; you can redistribute it and/or
3.11 * modify it under the terms of the GNU General Public License as
3.12 @@ -19,8 +19,6 @@
3.13 * Boston, MA 02110-1301, USA
3.14 */
3.15
3.16 -#include <mem/memory_incremental.h>
3.17 -
3.18 #include "pages.h"
3.19
3.20
3.21 @@ -68,7 +66,7 @@
3.22 if (region != NULL)
3.23 return new Flexpage(region);
3.24 else
3.25 - return NULL;
3.26 + return remove();
3.27 }
3.28
3.29 /* Queue an entry associating the given 'owner' and 'flexpage'. */