mirror of
https://github.com/Zygo/bees.git
synced 2025-08-04 06:43:29 +02:00
Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
299509ce32 | ||
|
d5a99c2f5e |
@@ -500,7 +500,8 @@ BeesRoots::transid_max_nocache()
|
|||||||
|
|
||||||
// We look for the root of the extent tree and read its transid.
|
// We look for the root of the extent tree and read its transid.
|
||||||
// Should run in O(1) time and be fairly reliable.
|
// Should run in O(1) time and be fairly reliable.
|
||||||
const auto bti = m_root_fetcher.root(BTRFS_EXTENT_TREE_OBJECTID);
|
BtrfsRootFetcher root_fetcher(m_ctx->root_fd());
|
||||||
|
const auto bti = root_fetcher.root(BTRFS_EXTENT_TREE_OBJECTID);
|
||||||
BEESTRACE("extracting transid from " << bti);
|
BEESTRACE("extracting transid from " << bti);
|
||||||
const auto rv = bti.transid();
|
const auto rv = bti.transid();
|
||||||
|
|
||||||
@@ -927,7 +928,6 @@ BeesRoots::state_load()
|
|||||||
|
|
||||||
BeesRoots::BeesRoots(shared_ptr<BeesContext> ctx) :
|
BeesRoots::BeesRoots(shared_ptr<BeesContext> ctx) :
|
||||||
m_ctx(ctx),
|
m_ctx(ctx),
|
||||||
m_root_fetcher(ctx->root_fd()),
|
|
||||||
m_crawl_state_file(ctx->home_fd(), crawl_state_filename()),
|
m_crawl_state_file(ctx->home_fd(), crawl_state_filename()),
|
||||||
m_crawl_thread("crawl_transid"),
|
m_crawl_thread("crawl_transid"),
|
||||||
m_writeback_thread("crawl_writeback")
|
m_writeback_thread("crawl_writeback")
|
||||||
@@ -1101,7 +1101,8 @@ BeesRoots::is_root_ro(uint64_t root)
|
|||||||
|
|
||||||
BEESTRACE("checking subvol flags on root " << root);
|
BEESTRACE("checking subvol flags on root " << root);
|
||||||
|
|
||||||
const auto item = m_root_fetcher.root(root);
|
BtrfsRootFetcher root_fetcher(m_ctx->root_fd());
|
||||||
|
const auto item = root_fetcher.root(root);
|
||||||
// If we can't access the subvol's root item...guess it's ro?
|
// If we can't access the subvol's root item...guess it's ro?
|
||||||
if (!item || item.root_flags() & BTRFS_ROOT_SUBVOL_RDONLY) {
|
if (!item || item.root_flags() & BTRFS_ROOT_SUBVOL_RDONLY) {
|
||||||
return true;
|
return true;
|
||||||
|
@@ -534,7 +534,6 @@ class BeesScanMode;
|
|||||||
class BeesRoots : public enable_shared_from_this<BeesRoots> {
|
class BeesRoots : public enable_shared_from_this<BeesRoots> {
|
||||||
shared_ptr<BeesContext> m_ctx;
|
shared_ptr<BeesContext> m_ctx;
|
||||||
|
|
||||||
BtrfsRootFetcher m_root_fetcher;
|
|
||||||
BeesStringFile m_crawl_state_file;
|
BeesStringFile m_crawl_state_file;
|
||||||
map<uint64_t, shared_ptr<BeesCrawl>> m_root_crawl_map;
|
map<uint64_t, shared_ptr<BeesCrawl>> m_root_crawl_map;
|
||||||
mutex m_mutex;
|
mutex m_mutex;
|
||||||
|
@@ -28,7 +28,7 @@ static bool test_fails = false;
|
|||||||
|
|
||||||
static
|
static
|
||||||
void
|
void
|
||||||
seeker_test(const vector<uint64_t> &vec, size_t target)
|
seeker_test(const vector<uint64_t> &vec, uint64_t const target)
|
||||||
{
|
{
|
||||||
cerr << "Find " << target << " in {";
|
cerr << "Find " << target << " in {";
|
||||||
for (auto i : vec) {
|
for (auto i : vec) {
|
||||||
@@ -42,7 +42,7 @@ seeker_test(const vector<uint64_t> &vec, size_t target)
|
|||||||
return seeker_finder(vec, lower, upper);
|
return seeker_finder(vec, lower, upper);
|
||||||
});
|
});
|
||||||
cerr << found;
|
cerr << found;
|
||||||
size_t my_found = 0;
|
uint64_t my_found = 0;
|
||||||
for (auto i : vec) {
|
for (auto i : vec) {
|
||||||
if (i <= target) {
|
if (i <= target) {
|
||||||
my_found = i;
|
my_found = i;
|
||||||
|
Reference in New Issue
Block a user