1.1 --- a/include/fsserver/accessor.h Sun Aug 16 17:39:09 2020 +0200
1.2 +++ b/include/fsserver/accessor.h Sun Aug 16 19:22:29 2020 +0200
1.3 @@ -194,8 +194,7 @@
1.4
1.5 virtual ~AccessMap();
1.6
1.7 - Flexpage *find(unsigned long data_position, unsigned long offset,
1.8 - unsigned long flags);
1.9 + Flexpage *find(unsigned long data_position);
1.10
1.11 void flush_all(unsigned long start, unsigned long end, bool keep,
1.12 PagingAccessor *accessor);
2.1 --- a/include/fsserver/flexpage.h Sun Aug 16 17:39:09 2020 +0200
2.2 +++ b/include/fsserver/flexpage.h Sun Aug 16 19:22:29 2020 +0200
2.3 @@ -126,7 +126,7 @@
2.4
2.5 /* Comparisons. */
2.6
2.7 - bool supports(unsigned long data_position, unsigned long offset);
2.8 + bool supports(unsigned long data_position);
2.9
2.10 bool supports_flags(unsigned long flags);
2.11
3.1 --- a/lib/src/accessor.cc Sun Aug 16 17:39:09 2020 +0200
3.2 +++ b/lib/src/accessor.cc Sun Aug 16 19:22:29 2020 +0200
3.3 @@ -81,8 +81,7 @@
3.4
3.5 /* Find a flexpage for the given details. */
3.6
3.7 -Flexpage *AccessMap::find(unsigned long data_position,
3.8 - unsigned long offset, unsigned long flags)
3.9 +Flexpage *AccessMap::find(unsigned long data_position)
3.10 {
3.11 lock_map();
3.12
3.13 @@ -94,7 +93,7 @@
3.14
3.15 /* Seek to the first flexpage beyond the given position. */
3.16
3.17 - it = _map.upper_bound(data_position + offset);
3.18 + it = _map.upper_bound(data_position);
3.19
3.20 /* Obtain any previous flexpage. */
3.21
3.22 @@ -106,7 +105,7 @@
3.23
3.24 /* Test the flexpage for suitability. */
3.25
3.26 - if (test->valid() && test->supports(data_position, offset))
3.27 + if (test->valid() && test->supports(data_position))
3.28 flexpage = test;
3.29 }
3.30
3.31 @@ -267,6 +266,7 @@
3.32 else
3.33 flexpage = new_flexpage(data_start, data_size, offset, hot_spot, flags);
3.34
3.35 + printf("return flexpage %p\n", flexpage);
3.36 return flexpage;
3.37 }
3.38
3.39 @@ -308,7 +308,8 @@
3.40 Flexpage *PagingAccessor::find_flexpage(unsigned long data_position,
3.41 unsigned long offset, unsigned long flags)
3.42 {
3.43 - Flexpage *flexpage = _map.find(data_position, offset, flags);
3.44 + printf("find_flexpage(%ld, %ld, %lx)\n", data_position, offset, flags);
3.45 + Flexpage *flexpage = _map.find(data_position + offset);
3.46
3.47 /* Attempt to make the flexpage unavailable for others. If the flexpage is
3.48 not available, disregard it. */
4.1 --- a/lib/src/flexpage.cc Sun Aug 16 17:39:09 2020 +0200
4.2 +++ b/lib/src/flexpage.cc Sun Aug 16 19:22:29 2020 +0200
4.3 @@ -143,10 +143,10 @@
4.4
4.5 /* Return whether this flexpage supports the indicated position. */
4.6
4.7 -bool Flexpage::supports(unsigned long data_position, unsigned long offset)
4.8 +bool Flexpage::supports(unsigned long data_position)
4.9 {
4.10 unsigned long end = _data_start + get_size();
4.11 - unsigned long target = data_position + offset;
4.12 + unsigned long target = data_position;
4.13
4.14 return (_data_start <= target) && (target < end);
4.15 }