mirror of
https://github.com/Zygo/bees.git
synced 2025-05-18 05:45:45 +02:00
Merge branch 'master' into subvol-threads
This commit is contained in:
commit
b004b22e47
2
Makefile
2
Makefile
@ -30,7 +30,7 @@ install: lib src test
|
|||||||
install_scripts: ## Install scipts
|
install_scripts: ## Install scipts
|
||||||
install -Dm755 scripts/beesd $(PREFIX)/usr/bin/beesd
|
install -Dm755 scripts/beesd $(PREFIX)/usr/bin/beesd
|
||||||
install -Dm644 scripts/beesd.conf.sample $(PREFIX)/etc/bees/beesd.conf.sample
|
install -Dm644 scripts/beesd.conf.sample $(PREFIX)/etc/bees/beesd.conf.sample
|
||||||
install -Dm644 scripts/beesd@.service $(PREFIX)/usr/lib/systemd/system/beesd@.service
|
install -Dm644 scripts/beesd@.service $(PREFIX)/lib/systemd/system/beesd@.service
|
||||||
|
|
||||||
help: ## Show help
|
help: ## Show help
|
||||||
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##/\t/'
|
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##/\t/'
|
||||||
|
@ -531,6 +531,7 @@ namespace crucible {
|
|||||||
break;
|
break;
|
||||||
case BTRFS_FILE_EXTENT_PREALLOC:
|
case BTRFS_FILE_EXTENT_PREALLOC:
|
||||||
e.m_flags |= Extent::PREALLOC;
|
e.m_flags |= Extent::PREALLOC;
|
||||||
|
// fallthrough
|
||||||
case BTRFS_FILE_EXTENT_REG: {
|
case BTRFS_FILE_EXTENT_REG: {
|
||||||
e.m_physical = call_btrfs_get(btrfs_stack_file_extent_disk_bytenr, i.m_data);
|
e.m_physical = call_btrfs_get(btrfs_stack_file_extent_disk_bytenr, i.m_data);
|
||||||
|
|
||||||
|
@ -52,16 +52,18 @@ DB_SIZE="${DB_SIZE:-$((64*AL16M))}"
|
|||||||
LOG_SHORT_PATH="${LOG_SHORT_PATH:-N}"
|
LOG_SHORT_PATH="${LOG_SHORT_PATH:-N}"
|
||||||
LOG_FILTER_TIME="${LOG_FILTER_TIME:-N}"
|
LOG_FILTER_TIME="${LOG_FILTER_TIME:-N}"
|
||||||
|
|
||||||
INFO "Check: BTRFS UUID exists"
|
|
||||||
if [ ! -d "/sys/fs/btrfs/$UUID" ]; then
|
|
||||||
ERRO "Can't find BTRFS UUID: $UUID"
|
|
||||||
fi
|
|
||||||
|
|
||||||
INFO "Check: Disk exists"
|
INFO "Check: Disk exists"
|
||||||
if [ ! -b "/dev/disk/by-uuid/$UUID" ]; then
|
if [ ! -b "/dev/disk/by-uuid/$UUID" ]; then
|
||||||
ERRO "Missing disk: /dev/disk/by-uuid/$UUID"
|
ERRO "Missing disk: /dev/disk/by-uuid/$UUID"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
it_btrfs(){ [ "$(blkid -s TYPE -o value "$1")" == "btrfs" ]; }
|
||||||
|
|
||||||
|
INFO "Check: Disk with btrfs"
|
||||||
|
if ! it_btrfs "/dev/disk/by-uuid/$UUID"; then
|
||||||
|
ERRO "Disk not contain btrfs: /dev/disk/by-uuid/$UUID"
|
||||||
|
fi
|
||||||
|
|
||||||
INFO "WORK DIR: $WORK_DIR"
|
INFO "WORK DIR: $WORK_DIR"
|
||||||
mkdir -p "$WORK_DIR" || exit 1
|
mkdir -p "$WORK_DIR" || exit 1
|
||||||
|
|
||||||
|
@ -56,6 +56,12 @@ BeesFdCache::open_root(shared_ptr<BeesContext> ctx, uint64_t root)
|
|||||||
Fd
|
Fd
|
||||||
BeesFdCache::open_root_ino(shared_ptr<BeesContext> ctx, uint64_t root, uint64_t ino)
|
BeesFdCache::open_root_ino(shared_ptr<BeesContext> ctx, uint64_t root, uint64_t ino)
|
||||||
{
|
{
|
||||||
|
if (m_file_cache_timer.age() > BEES_COMMIT_INTERVAL) {
|
||||||
|
BEESINFO("Clearing open FD cache to enable file delete");
|
||||||
|
m_file_cache.clear();
|
||||||
|
m_file_cache_timer.reset();
|
||||||
|
BEESCOUNT(open_clear);
|
||||||
|
}
|
||||||
return m_file_cache(ctx, root, ino);
|
return m_file_cache(ctx, root, ino);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -735,6 +735,7 @@ BeesCrawl::fetch_extents()
|
|||||||
break;
|
break;
|
||||||
case BTRFS_FILE_EXTENT_PREALLOC:
|
case BTRFS_FILE_EXTENT_PREALLOC:
|
||||||
BEESCOUNT(crawl_prealloc);
|
BEESCOUNT(crawl_prealloc);
|
||||||
|
// fallthrough
|
||||||
case BTRFS_FILE_EXTENT_REG: {
|
case BTRFS_FILE_EXTENT_REG: {
|
||||||
auto physical = call_btrfs_get(btrfs_stack_file_extent_disk_bytenr, i.m_data);
|
auto physical = call_btrfs_get(btrfs_stack_file_extent_disk_bytenr, i.m_data);
|
||||||
auto ram = call_btrfs_get(btrfs_stack_file_extent_ram_bytes, i.m_data);
|
auto ram = call_btrfs_get(btrfs_stack_file_extent_ram_bytes, i.m_data);
|
||||||
|
@ -664,6 +664,7 @@ class BeesFdCache {
|
|||||||
LRUCache<Fd, shared_ptr<BeesContext>, uint64_t> m_root_cache;
|
LRUCache<Fd, shared_ptr<BeesContext>, uint64_t> m_root_cache;
|
||||||
LRUCache<Fd, shared_ptr<BeesContext>, uint64_t, uint64_t> m_file_cache;
|
LRUCache<Fd, shared_ptr<BeesContext>, uint64_t, uint64_t> m_file_cache;
|
||||||
Timer m_root_cache_timer;
|
Timer m_root_cache_timer;
|
||||||
|
Timer m_file_cache_timer;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
BeesFdCache();
|
BeesFdCache();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user