Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/windirstat/llfio.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com>2019-11-18 14:14:56 +0300
committerNiall Douglas (s [underscore] sourceforge {at} nedprod [dot] com) <spamtrap@nedprod.com>2019-11-18 14:14:56 +0300
commite66a774d599804a31ebbb701874ca2dde5e36e10 (patch)
tree6630d2fbbf2b9634190deea9c3f9a51e401d4023 /include/llfio/v2.0/algorithm/shared_fs_mutex/byte_ranges.hpp
parentb6c21fdf2dcf0f7c72e117cfc8396fdbb9d5973c (diff)
As per WG21 guidance, moved byte range locking API out of io_handle, and into an extension to file_handle. This makes space to make a future lockable_io_handle to model SharedMutex, which locks an inode like a std::shared_mutex. Note that the new .lock_range() API no longer does special semantics if you pass in zero length to lock the whole file.develop
Diffstat (limited to 'include/llfio/v2.0/algorithm/shared_fs_mutex/byte_ranges.hpp')
-rw-r--r--include/llfio/v2.0/algorithm/shared_fs_mutex/byte_ranges.hpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/llfio/v2.0/algorithm/shared_fs_mutex/byte_ranges.hpp b/include/llfio/v2.0/algorithm/shared_fs_mutex/byte_ranges.hpp
index cb42ce05..7e952bac 100644
--- a/include/llfio/v2.0/algorithm/shared_fs_mutex/byte_ranges.hpp
+++ b/include/llfio/v2.0/algorithm/shared_fs_mutex/byte_ranges.hpp
@@ -143,9 +143,9 @@ namespace algorithm
// Now 0 to n needs to be closed
for(; n > 0; n--)
{
- _h.unlock(out.entities[n].value, 1);
+ _h.unlock_range(out.entities[n].value, 1);
}
- _h.unlock(out.entities[0].value, 1);
+ _h.unlock_range(out.entities[0].value, 1);
}
});
for(n = 0; n < out.entities.size(); n++)
@@ -179,7 +179,7 @@ namespace algorithm
}
}
}
- auto outcome = _h.lock(out.entities[n].value, 1, out.entities[n].exclusive != 0u, nd);
+ auto outcome = _h.lock_range(out.entities[n].value, 1, (out.entities[n].exclusive != 0u) ? file_handle::lock_kind::exclusive : file_handle::lock_kind::shared, nd);
if(!outcome)
{
was_contended = n;
@@ -229,7 +229,7 @@ namespace algorithm
LLFIO_LOG_FUNCTION_CALL(this);
for(const auto &i : entities)
{
- _h.unlock(i.value, 1);
+ _h.unlock_range(i.value, 1);
}
}
};