mergerfs-2.42.0/0000755000000000000000000000000015177346260012122 5ustar rootrootmergerfs-2.42.0/.github/0000755000000000000000000000000015177346257013470 5ustar rootrootmergerfs-2.42.0/.github/FUNDING.yml0000644000000000000000000000010315177346257015277 0ustar rootrootgithub: [trapexit] custom: ['https://github.com/trapexit/support'] mergerfs-2.42.0/.github/ISSUE_TEMPLATE/0000755000000000000000000000000015177346257015653 5ustar rootrootmergerfs-2.42.0/.github/ISSUE_TEMPLATE/bug_report.md0000644000000000000000000000462315177346257020352 0ustar rootroot--- name: Bug report about: For the reporting of behavior not as described title: '' labels: bug, investigating assignees: '' --- See also https://trapexit.github.io/mergerfs/latest/support **Describe the bug** A clear and concise description of the unexpected behavior. **Please be sure to use latest release of mergerfs to ensure the issue still exists. Not your distro's latest but the latest official release. Support will NOT be provided for old versions.** The `master` branch is **not** to be considered production ready. Feel free to file bug reports but do so indicating clearly that you are testing unreleased code. **To Reproduce** Provide steps to reproduce the behavior. List **all** steps to reproduce. **All** settings. The version of all software involved. Please simplify the reproduction as much as possible. * Unless it is dependenat on multiple branches, use a single branch * Reproduce with standard tooling if possible (touch,truncate,rm,rmdir,ln,etc.) Having to install 3rd party software will make debugging more difficult. **Expected behavior** A clear and concise description of the expected behavior. **Workarounds already tested** Please list all workarounds attempted and why they were ruled out as options. **System information:** * Attach output from [mergerfs.collect-info](https://trapexit.github.io/mergerfs/latest/tooling/#mergerfscollect-info) tool. * Alternatively: * OS: `lsb_release -a` * kernel version: `uname -a` * mergerfs version: `mergerfs --version` * mergerfs settings / arguments: from fstab, systemd unit, command line, OMV plugin, etc. * List of drives, filesystems, & sizes: * `df -h` * `lsblk -o NAME,FSTYPE,FSSIZE,SIZE,MOUNTPOINTS,RM,RO,ROTA` * All information about the relevant paths and files: permissions, ownership, etc. * All information about the application making the requests: version, uid/gid * Is mergerfs running within a container or used with container technologies? * Are the client apps using mergerfs running in a container? * A strace of the application having a problem: * `strace -fvTtt -s 256 -o /tmp/app.strace.txt ` * `strace -fvTtt -s 256 -o /tmp/app.strace.txt -p ` * strace of mergerfs while app tried to do it's thing: * `strace -fvTtt -s 256 -p -o /tmp/mergerfs.strace.txt` **Additional context** Add any other context about the problem here. mergerfs-2.42.0/.github/ISSUE_TEMPLATE/feature_request.md0000644000000000000000000000110215177346257021372 0ustar rootroot--- name: Feature request about: Suggest an idea for this project title: '' labels: feature, investigating assignees: '' --- **Is your feature request related to a problem? Please describe.** A clear and concise description of what the problem is. **Describe the solution you'd like** A clear and concise description of what you want to happen. **Describe alternatives you've considered** A clear and concise description of any alternative solutions or features you've considered. **Additional context** Add any other context or screenshots about the feature request here. mergerfs-2.42.0/.github/ISSUE_TEMPLATE/question.md0000644000000000000000000000045515177346257020050 0ustar rootroot--- name: Question about: When you're looking for information or general support title: '' labels: investigating, question assignees: '' --- For general questions and support please use [GitHub Discussions](https://github.com/trapexit/mergerfs/discussions) or [Discord](https://discord.gg/MpAr69V). mergerfs-2.42.0/.gitignore0000644000000000000000000000057415177346257014126 0ustar rootroot# Compiled Object files *.slo *.lo *.o # Compiled Dynamic libraries *.so *.dylib # Compiled Static libraries *.lai *.la *.a # build artifacts mergerfs build/ src/version.hpp VERSION # Debian files debian/files debian/changelog debian/debhelper-build-stamp debian/mergerfs.debhelper.log debian/mergerfs.substvars # RPM files rpmbuild/ # mkdocs files mkdocs/venv __pycache__/ mergerfs-2.42.0/DEPENDENCIES0000644000000000000000000000114315177346257013700 0ustar rootroot## Libraries ### included in repo * libfuse: https://github.com/libfuse/libfuse (heavily modified fork of v2.x) * rapidhash: https://github.com/Nicoshev/rapidhash * fmt: https://github.com/fmtlib/fmt * concurrentqueue: https://github.com/cameron314/concurrentqueue * scope_guard: https://github.com/Neargye/scope_guard * subprocess: https://github.com/arun11299/cpp-subprocess * CLI11: https://github.com/CLIUtils/CLI11 * string-lite: https://github.com/martinmoene/string-lite * boost * download boost * ./bootstrap.sh * ./b2 tools/bcp * ./dist/bin/bcp unordered/concurrent_flat_map.hpp mergerfs-2.42.0/LICENSE0000644000000000000000000000144315177346257013137 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ mergerfs-2.42.0/Makefile0000644000000000000000000002510615177346257013574 0ustar rootroot# Copyright (c) 2025, Antonio SJ Musumeci # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. $(info mergerfs MAKEFLAGS: $(MAKEFLAGS)) ifeq ($(shell id -u),0) FAKEROOT ?= endif CP ?= cp FAKEROOT ?= fakeroot FIND ?= find GIT ?= git GIT2DEBCL ?= buildtools/git2debcl INSTALL ?= install LN ?= ln MKDIR ?= mkdir MKTEMP ?= mktemp MV ?= mv RM ?= rm SED ?= sed STRIP ?= strip TAR ?= tar TOUCH ?= touch BUILDDIR := build GITHUB_REPO ?= "https://github.com/trapexit/mergerfs" DEFAULT_RELEASE := debian:13.amd64 ifndef GIT_REPO ifneq ($(shell $(GIT) --version 2> /dev/null),) ifeq ($(shell test -e .git; echo $$?),0) GIT_REPO = 1 endif endif endif USE_XATTR ?= 1 UGID_USE_RWLOCK ?= 0 ifdef NDEBUG OPT_FLAGS := -O2 -DNDEBUG else ifdef SANITIZE ifeq ($(SANITIZE),1) override SANITIZE := -fsanitize=address,undefined,leak else ifeq ($(filter -fsanitize=%,$(SANITIZE)),) override SANITIZE := -fsanitize=$(SANITIZE) endif endif OPT_FLAGS := -O0 \ -g \ -fno-omit-frame-pointer \ $(SANITIZE) \ -fstack-protector-strong \ -Wextra \ -Wno-unused-parameter \ -DDEBUG endif ifdef STATIC STATIC_FLAGS := -static else STATIC_FLAGS := endif ifdef LTO LTO_FLAGS := -flto else LTO_FLAGS := endif SRC := $(wildcard src/*.cpp) OBJS := $(SRC:src/%.cpp=build/.objs/%.cpp.o) DEPS := $(SRC:src/%.cpp=build/.objs/%.cpp.d) TESTS := $(wildcard tests/*.cpp) TESTS_OBJS := $(filter-out build/.objs/mergerfs.cpp.o,$(OBJS)) TESTS_OBJS += $(TESTS:tests/%.cpp=build/.test_objs/%.cpp.o) TESTS_DEPS := $(TESTS:tests/%.cpp=build/.test_objs/%.cpp.d) TESTS_DEPS += $(DEPS) MANPAGE := mergerfs.1 CPPFLAGS ?= override CPPFLAGS += \ -D_FILE_OFFSET_BITS=64 \ -DBOOST_UNORDERED_DISABLE_PARALLEL_ALGORITHMS CFLAGS ?= \ $(OPT_FLAGS) \ -Wall \ -Wno-unused-result \ -pipe override CFLAGS += \ -MMD \ -MP CXXFLAGS ?= \ $(OPT_FLAGS) \ $(STATIC_FLAGS) \ $(LTO_FLAGS) \ -Wall \ -Wpessimizing-move \ -Werror=pessimizing-move \ -Wredundant-move \ -Werror=redundant-move \ -Wno-unused-result \ -pipe override CXXFLAGS += \ -std=c++17 \ -MMD \ -MP override INC_FLAGS := \ -Isrc \ -Ivendored \ -Ivendored/libfuse/include override MFS_FLAGS := \ -DUSE_XATTR=$(USE_XATTR) \ -DUGID_USE_RWLOCK=$(UGID_USE_RWLOCK) override TESTS_FLAGS := \ -Isrc \ -Ivendored \ -Ivendored/acutest \ -DTESTS LIBFUSE := vendored/libfuse/$(BUILDDIR)/libfuse.a LDFLAGS ?= LDLIBS := \ -lrt \ -pthread override LDLIBS += \ $(LIBFUSE) ifeq ($(CXX),g++) GCC_VERSION := $(shell $(CXX) -dumpversion | cut -f1 -d.) ifeq ($(shell test $(GCC_VERSION) -lt 9; echo $$?),0) override LDLIBS += -lstdc++fs endif endif # https://www.gnu.org/prep/standards/html_node/Directory-Variables.html DESTDIR ?= PREFIX ?= /usr/local EXEC_PREFIX ?= $(PREFIX) DATAROOTDIR ?= $(PREFIX)/share DATADIR ?= $(DATAROOTDIR) BINDIR ?= $(EXEC_PREFIX)/bin SBINDIR ?= $(EXEC_PREFIX)/sbin LIBDIR ?= $(EXEC_PREFIX)/lib MANDIR ?= $(DATAROOTDIR)/man MAN1DIR ?= $(MANDIR)/man1 INSTALLBINDIR ?= $(DESTDIR)$(BINDIR) INSTALLSBINDIR ?= $(DESTDIR)$(SBINDIR) INSTALLLIBDIR ?= $(DESTDIR)$(LIBDIR)/mergerfs INSTALLMAN1DIR ?= $(DESTDIR)$(MAN1DIR) .PHONY: all all: libfuse $(BUILDDIR)/mergerfs $(BUILDDIR)/fsck.mergerfs $(BUILDDIR)/mergerfs.collect-info .PHONY: help help: @echo "usage: make ARG\n" @echo "USE_XATTR=0 - build program without xattrs functionality" @echo "STATIC=1 - build static binary" @echo "LTO=1 - build with link time optimization" @echo "SANITIZE=1 - build with sanitizers (address,undefined,leak)" @echo "SANITIZE=list - build with custom sanitizers (comma separated)" @echo "CLEANUP=1 - cleanup images between release build process" @echo "PKGDIR=/dir/ - location for release build pkgs" @echo "GITREF=gitref - gitref to use for release builds" $(BUILDDIR)/mergerfs: $(LIBFUSE) src/version.hpp $(OBJS) $(CXX) $(CXXFLAGS) $(INC_FLAGS) $(MFS_FLAGS) $(CPPFLAGS) $(OBJS) -o $@ $(LDFLAGS) $(LDLIBS) $(BUILDDIR)/fsck.mergerfs: $(BUILDDIR)/mergerfs $(LN) -sf "mergerfs" $@ $(BUILDDIR)/mergerfs.collect-info: $(BUILDDIR)/mergerfs $(LN) -sf "mergerfs" $@ $(BUILDDIR)/tests: $(BUILDDIR)/mergerfs $(TESTS_OBJS) $(CXX) $(CXXFLAGS) $(TESTS_FLAGS) $(INC_FLAGS) $(MFS_FLAGS) $(CPPFLAGS) $(TESTS_OBJS) -o $@ $(LDFLAGS) $(LDLIBS) .PHONY: libfuse libfuse: $(LIBFUSE) $(MAKE) -C vendored/libfuse $(LIBFUSE): $(MAKE) -C vendored/libfuse $(BUILDDIR)/libfuse.a tests: $(BUILDDIR)/tests .PHONY: changelog: ifdef GIT_REPO $(GIT2DEBCL) --name mergerfs > ChangeLog else @echo "WARNING: need git repo to generate ChangeLog" endif .PHONY: version version: src/version.hpp src/version.hpp: ./buildtools/update-version $(BUILDDIR)/stamp: $(MKDIR) -p $(BUILDDIR)/.objs $(MKDIR) -p $(BUILDDIR)/.test_objs $(TOUCH) $@ $(BUILDDIR)/.objs/%.cpp.o: src/%.cpp $(BUILDDIR)/stamp $(CXX) $(CXXFLAGS) $(INC_FLAGS) $(MFS_FLAGS) $(CPPFLAGS) -c $< -o $@ $(BUILDDIR)/.test_objs/%.cpp.o: tests/%.cpp | $(BUILDDIR)/stamp $(CXX) $(CXXFLAGS) $(TESTS_FLAGS) $(INC_FLAGS) $(MFS_FLAGS) $(CPPFLAGS) -c $< -o $@ $(BUILDDIR)/preload.so: $(BUILDDIR)/stamp tools/preload.c $(CC) -shared -fPIC $(CFLAGS) -o $@ tools/preload.c preload: $(BUILDDIR)/preload.so .PHONY: clean clean: rpm-clean $(RM) -rf $(BUILDDIR) $(FIND) . -name "*~" -delete $(MAKE) -C vendored/libfuse clean .PHONY: distclean distclean: clean ifdef GIT_REPO $(GIT) clean -xfd endif .PHONY: install install: install-base install-mount-tools install-preload install-man .PHONY: install-base install-base: all $(MKDIR) -p "$(INSTALLBINDIR)" $(INSTALL) -v -m 0755 "$(BUILDDIR)/mergerfs" "$(INSTALLBINDIR)/mergerfs" $(LN) -fs "mergerfs" "${INSTALLBINDIR}/fsck.mergerfs" $(LN) -fs "mergerfs" "${INSTALLBINDIR}/mergerfs.collect-info" .PHONY: install-mount-tools install-mount-tools: install-base $(MKDIR) -p "$(INSTALLBINDIR)" $(MAKE) -C vendored/libfuse install .PHONY: install-man install-man: man/$(MANPAGE) $(MKDIR) -p "$(INSTALLMAN1DIR)" $(INSTALL) -v -m 0644 "man/$(MANPAGE)" "$(INSTALLMAN1DIR)/$(MANPAGE)" .PHONY: install-preload install-preload: preload $(MKDIR) -p "$(INSTALLLIBDIR)" $(INSTALL) -v -m 444 "$(BUILDDIR)/preload.so" "$(INSTALLLIBDIR)/preload.so" .PHONY: install-strip install-strip: install-base $(STRIP) "$(INSTALLBINDIR)/mergerfs" .PHONY: uninstall uninstall: uninstall-base uninstall-mount.mergerfs uninstall-preload uninstall-man uninstall-base: $(RM) -f "$(INSTALLBINDIR)/mergerfs" $(RM) -f "$(INSTALLBINDIR)/fsck.mergerfs" $(RM) -f "$(INSTALLBINDIR)/mergerfs.collect-info" uninstall-mount.mergerfs: $(RM) -f "$(INSTALLBINDIR)/mount.mergerfs" uninstall-man: $(RM) -f "$(INSTALLMAN1DIR)/$(MANPAGE)" uninstall-preload: $(RM) -f "$(INSTALLLIBDIR)/preload.so" .PHONY: tarball tarball: changelog version $(eval VERSION := $(shell cat VERSION)) $(eval VERSION := $(subst -,_,$(VERSION))) $(eval FILENAME := mergerfs-$(VERSION)) $(eval TMPDIR := $(shell $(MKTEMP) --tmpdir -d .$(FILENAME).XXXXXXXX)) $(MKDIR) $(TMPDIR)/$(FILENAME) $(CP) -ar . $(TMPDIR)/$(FILENAME) $(TAR) --exclude=.git -cz -C $(TMPDIR) -f $(FILENAME).tar.gz $(FILENAME) $(RM) -rf $(TMPDIR) .PHONY: debian-changelog debian-changelog: ifdef GIT_REPO $(GIT2DEBCL) --name mergerfs > debian/changelog else $(CP) -v ChangeLog debian/changelog $(eval DISTRO := $(shell lsb_release -i -s | tr '[:upper:]' '[:lower:]')) $(eval CODENAME := $(shell lsb_release -c -s | tr '[:upper:]' '[:lower:]')) sed -i 's/~unknown-unknown/~$(DISTRO)-$(CODENAME)/g' debian/changelog sed -i 's/ unknown; / $(CODENAME); /g' debian/changelog endif .PHONY: signed-deb signed-deb: $(MAKE) distclean $(MAKE) debian-changelog $(FAKEROOT) dpkg-buildpackage -nc .PHONY: deb deb: $(MAKE) distclean $(MAKE) debian-changelog $(MAKE) version $(FAKEROOT) dpkg-buildpackage -nc -uc -us $(MKDIR) -p ./$(BUILDDIR)/pkgs/ $(MV) -v ../mergerfs*deb ./$(BUILDDIR)/pkgs/ .PHONY: rpm-clean rpm-clean: $(RM) -rf rpmbuild .PHONY: rpm rpm: tarball $(eval VERSION := $(shell cat VERSION)) $(eval VERSION := $(subst -,_,$(VERSION))) $(MKDIR) -p rpmbuild/BUILD rpmbuild/RPMS rpmbuild/SOURCES $(SED) 's/__VERSION__/$(VERSION)/g' mergerfs.spec > \ rpmbuild/SOURCES/mergerfs.spec cp -ar mergerfs-$(VERSION).tar.gz rpmbuild/SOURCES rpmbuild -ba rpmbuild/SOURCES/mergerfs.spec \ --define "_topdir $(CURDIR)/rpmbuild" .PHONY: install-build-pkgs install-build-pkgs: ./buildtools/install-build-pkgs .PHONY: install-build-tools install-build-tools: ./buildtools/install-build-tools define build_release $(eval GITREF ?= $(shell git describe --exact-match --tags HEAD 2>/dev/null || git symbolic-ref --short HEAD 2>/dev/null || git rev-parse --short HEAD)) @echo "GITREF=$(GITREF)" ./buildtools/build-release \ --target=$(1) \ $(if $(CLEANUP),--cleanup) \ $(if $(PKGDIR),--pkgdirpath=$(PKGDIR)) \ --git-repo=$(if $(REMOTE_REPO),$(GITHUB_REPO),".") \ --branch=$(GITREF) endef .PHONY: release .PHONY: release-amd64 release-arm64 release-armhf release-riscv64 .PHONY: release-sample release-static release-tarball release: $(call build_release,"all") release-sample: $(if $(RELEASE),,$(eval RELEASE := $(shell ./buildtools/detect-local-target 2>/dev/null))) $(call build_release,$(if $(RELEASE),$(RELEASE),$(DEFAULT_RELEASE))) release-amd64: $(call build_release,"amd64") release-arm64: $(call build_release,"arm64") release-armhf: $(call build_release,"armhf") release-riscv64: $(call build_release,"riscv64") release-static: $(call build_release,"static") release-tarball: $(call build_release,"tarball") container: $(eval GITREF ?= $(shell git describe --exact-match --tags HEAD 2>/dev/null || git symbolic-ref --short HEAD 2>/dev/null || git rev-parse --short HEAD)) @echo "GITREF=$(GITREF)" ./buildtools/build-containerimage "$(GITREF)" .PHONY: tags tags: rm -fv TAGS find . -name "*.c" -print | etags --append - find . -name "*.h" -print | etags --append - find . -name "*.cpp" -print | etags --append - find . -name "*.hpp" -print | etags --append - -include $(DEPS) mergerfs-2.42.0/README.md0000644000000000000000000001066615177346257013420 0ustar rootroot# mergerfs - a featureful union filesystem **mergerfs** is a [FUSE](https://en.wikipedia.org/wiki/Filesystem_in_Userspace) based [union filesystem](https://en.wikipedia.org/wiki/Union_mount) geared towards simplifying storage and management of files across numerous commodity storage devices. It is similar to [**mhddfs**, **unionfs**, **aufs**, **DrivePool**, etc.](https://trapexit.github.io/mergerfs/latest/project_comparisons/) ## Features * Logically combine numerous filesystems/paths into a single mount point (JBOFS: Just a Bunch of FileSystems) * Combine paths of the same or different filesystems * Ability to add or remove filesystems/paths without impacting the rest of the data * Unaffected by individual filesystem failure * Configurable file selection and creation placement * File IO [passthrough](https://trapexit.github.io/mergerfs/latest/config/passthrough/) for near native IO performance (where supported) * Works with filesystems of any size * Works with filesystems of [almost any type](https://trapexit.github.io/mergerfs/latest/faq/compatibility_and_integration/#what-filesystems-can-be-used-as-branches) * Ignore read-only filesystems when creating files * [Hard links](https://trapexit.github.io/mergerfs/latest/faq/technical_behavior_and_limitations/#do-hard-links-work) * Hard link [copy-on-write / CoW](https://trapexit.github.io/mergerfs/latest/config/link_cow/) * [Runtime configurable](https://trapexit.github.io/mergerfs/latest/runtime_interface/) * Support for extended attributes (xattrs) * Support for file attributes (chattr) * Support for POSIX ACLs ## Non-features * Read/write overlay on top of read-only filesystem like OverlayFS * File whiteout * RAID like parity calculation (see [SnapRAID](https://www.snapraid.it)) * Redundancy * Splitting of files across branches ## How it works mergerfs logically merges multiple filesystem paths together. Not block devices, not filesystem mounts, just paths. It acts as a proxy to the underlying filesystem paths. Combining the behaviors of some functions and being a selector for others. When the contents of a directory are requested mergerfs combines the list of files from each directory, deduplicating entries, and returns that list. When a file or directory is created a policy is first run to determine which branch will be selected for the creation. For functions which change attributes or remove the file the behavior may be applied to all instances found. The way in which mergerfs behaves is controlled by the [config/options/settings](https://trapexit.github.io/mergerfs/latest/config/options). More specifically by [policies](https://trapexit.github.io/mergerfs/latest/config/functions_categories_policies/). ### Visualization ``` A + B = C /disk1 /disk2 /merged | | | +-- /dir1 +-- /dir1 +-- /dir1 | | | | | | | +-- file1 | | | +-- file1 | | +-- file2 | +-- file2 | | +-- file3 | +-- file3 | | | +-- /dir2 | +-- /dir2 | | | | | | +-- file4 | | +-- file4 | | | | +-- /dir3 +-- /dir3 | | | | | | | +-- file5 | +-- file5 | | | +-- file6 | +-- file6 +-- file7 +-- file7 +-- file7 ``` ## QuickStart https://trapexit.github.io/mergerfs/latest/quickstart/ ## Documentation https://trapexit.github.io/mergerfs ## Support https://trapexit.github.io/mergerfs/latest/support/ ## Sponsorship and Donations [https://github.com/trapexit/support](https://github.com/trapexit/support) Development and support of a project like mergerfs requires a significant amount of time and effort. The software is released under the very liberal [ISC](https://opensource.org/license/isc-license-txt) license and is therefore free to use for personal or commercial uses. If you are a non-commercial user and find mergerfs and its support valuable and would like to support the project financially it would be very much appreciated. If you are using mergerfs commercially please consider sponsoring the project to ensure it continues to be maintained and receive updates. If custom features are needed feel free to [contact me directly](mailto:support@spawn.link). mergerfs-2.42.0/buildtools/0000755000000000000000000000000015177346257014310 5ustar rootrootmergerfs-2.42.0/buildtools/build-containerimage0000755000000000000000000000053015177346257020316 0ustar rootroot#!/bin/sh GIT_BRANCH="${1:-master}" set -x podman \ build \ --squash \ --no-cache \ --force-rm \ --build-arg="GIT_REPO=file:///mnt" \ --build-arg="BRANCH=${GIT_BRANCH}" \ -v "${PWD}":/mnt:ro \ -f "buildtools/containerimage/Containerfile" \ --tag "ghcr.io/trapexit/mergerfs:${GIT_BRANCH}" \ buildtools/ mergerfs-2.42.0/buildtools/build-mergerfs0000755000000000000000000000230115177346257017141 0ustar rootroot#!/bin/sh set -e if [ $# -ne 2 ]; then echo "usage: $0 " echo "argv: $@" echo "argc: $#" exit 1 fi GIT_REPO="${1}" BRANCH="${2}" BUILDDIR="/tmp/build" echo "Clone source from ${GIT_REPO} to ${BUILDDIR}" git \ clone \ --single-branch \ --branch="${BRANCH}" \ "${GIT_REPO}" \ "${BUILDDIR}" cd "${BUILDDIR}" git log HEAD^1.. mkdir "/build" if [ -e /usr/bin/apt-get ]; then make deb elif [ -e /usr/bin/dnf ]; then make rpm elif [ -e /usr/bin/yum ]; then . /opt/rh/devtoolset-9/enable make rpm elif [ -e /sbin/apk ]; then echo "NOT YET SUPPORTED" exit 1 elif [ -e /usr/sbin/pkg ]; then echo "NOT YET SUPPORTED" exit 1 elif [ -e /usr/bin/pacman ]; then make tarball else echo "NOT YET SUPPORTED" exit 1 fi echo "Copy packages to host..." if [ -e /usr/bin/pacman ]; then find "${BUILDDIR}" \ -type f \ -name "*.tar.gz" \ -exec cp -v {} /build/ \; else find "${BUILDDIR}" \ -type f \ \( -name "*.deb" -or -name "*.rpm" \) \ -not -name "*dbgsym*" \ -not -name "*sym*" \ -not -name "*src.rpm" \ -exec cp -v {} /build/ \; fi exit 0 mergerfs-2.42.0/buildtools/build-release0000755000000000000000000001372115177346257016757 0ustar rootroot#!/usr/bin/env python3 import subprocess import sys import os import argparse import time def build(git_repo, branch, containerfile, pkgdirpath): timestamp = time.time_ns() args = ['podman', 'build', '--pull=always', '--force-rm'] if os.path.exists(git_repo): git_repo = os.path.realpath(git_repo) args += ['-v',f'{git_repo}:/tmp/mergerfs.git:ro'] args += ['--build-arg=GIT_REPO=file:///tmp/mergerfs.git'] else: args += [f'--build-arg=GIT_REPO={git_repo}'] os.makedirs(pkgdirpath,exist_ok=True) args += ['-v',f'{os.path.realpath(pkgdirpath)}:/pkgs:ro'] args += ['-o',pkgdirpath, '-f',containerfile, f'--build-arg=BRANCH={branch}', f'--build-arg=BUILD_TIMESTAMP={timestamp}', 'buildtools/'] # TODO: Capture output and write to log print(args) rv = subprocess.run(args) report_filepath = os.path.join(pkgdirpath,"build-report.txt") with open(report_filepath,"a+") as f: build = os.path.basename(containerfile) f.write(build + ": ") f.write(f"branch={branch}; ") f.write(f"timestamp={timestamp}; ") f.write("rv=") if rv.returncode == 0: f.write("success;") else: f.write("fail;") f.write("\n") def setup(): # Detect distribution if os.path.exists('/usr/bin/apt-get'): args = ['sudo', 'apt-get', 'install', '-fy', 'qemu-user-static', 'qemu-user-binfmt'] elif os.path.exists('/usr/bin/pacman'): args = ['sudo', 'pacman', '-Sy', '--noconfirm', 'qemu-user-static'] else: print("Unsupported distribution for setup") sys.exit(1) print(args) subprocess.run(args) setup_binfmt() def setup_binfmt(): """Register qemu-user-static binfmt handlers (needed on Arch, etc.).""" binfmt_conf = """\ :qemu-aarch64:M::\\x7fELF\\x02\\x01\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\xb7\\x00:\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\x00\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xfe\\xff\\xff\\xff:/usr/bin/qemu-aarch64-static:F :qemu-arm:M::\\x7fELF\\x01\\x01\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\x28\\x00:\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\x00\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xfe\\xff\\xff\\xff:/usr/bin/qemu-arm-static:F :qemu-armeb:M::\\x7fELF\\x01\\x02\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\x28:\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\x00\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xfe\\xff\\xff:/usr/bin/qemu-armeb-static:F :qemu-riscv64:M::\\x7fELF\\x02\\x01\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\xf3\\x00:\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\x00\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xfe\\xff\\xff\\xff:/usr/bin/qemu-riscv64-static:F :qemu-i386:M::\\x7fELF\\x01\\x01\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x02\\x00\\x03\\x00:\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\x00\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xff\\xfe\\xff\\xff\\xff:/usr/bin/qemu-i386-static:F """ conf_path = '/etc/binfmt.d/qemu-static.conf' print(f"Writing {conf_path}") try: with open(conf_path, 'w') as f: f.write(binfmt_conf) except PermissionError: print(f"Permission denied writing {conf_path}; trying with sudo...") subprocess.run(['sudo', 'tee', conf_path], input=binfmt_conf.encode(), check=True) print("Restarting systemd-binfmt...") subprocess.run(['sudo', 'systemctl', 'restart', 'systemd-binfmt']) def podman_cleanup(): args = ['podman', 'system', 'prune', '-af'] print(args) subprocess.run(args) def parse_args(): p = argparse.ArgumentParser() p.add_argument('--target', default='debian:13.amd64') p.add_argument('--pkgdirpath', default='build/pkgs/') p.add_argument('--branch', default='master') p.add_argument('--setup', required=False, action='store_true') p.add_argument('--cleanup', required=False, action='store_true') p.add_argument('--git-repo', required=False, type=str) return p.parse_args() def should_skip(filename): if filename.endswith('~'): return True return False def main(): args = parse_args() print(args) if args.setup: setup() sys.exit(0) if not args.git_repo: print("error: the following arguments are required: --git-repo") sys.exit(1) containerfiles = [] basepath = 'buildtools/containerfiles' if os.path.exists(f'{basepath}/{args.target}'): containerfiles.append(f'{basepath}/{args.target}') elif args.target == 'all': for root,dirnames,filenames in os.walk(basepath): filenames.sort() for filename in filenames: if should_skip(filename): continue containerfile = f'buildtools/containerfiles/{filename}' containerfiles.append(containerfile) else: for root,dirnames,filenames in os.walk(basepath): filenames.sort() for filename in filenames: if args.target not in filename: continue if should_skip(filename): continue containerfile = f'buildtools/containerfiles/{filename}' containerfiles.append(containerfile) for containerfile in containerfiles: if args.cleanup: podman_cleanup() build(git_repo=args.git_repo, branch=args.branch, containerfile=containerfile, pkgdirpath=args.pkgdirpath) sys.exit(0) if __name__ == '__main__': main() mergerfs-2.42.0/buildtools/containerfiles/0000755000000000000000000000000015177346257017315 5ustar rootrootmergerfs-2.42.0/buildtools/containerfiles/debian:11.amd640000644000000000000000000000036415177346257021633 0ustar rootrootFROM --platform=amd64 debian:11 as build COPY install-build-pkgs build-mergerfs /tmp/ RUN /tmp/install-build-pkgs ARG BUILD_TIMESTAMP=0 ARG GIT_REPO ARG BRANCH RUN /tmp/build-mergerfs $GIT_REPO $BRANCH FROM scratch COPY --from=build /build/ / mergerfs-2.42.0/buildtools/containerfiles/debian:11.arm640000644000000000000000000000036415177346257021651 0ustar rootrootFROM --platform=arm64 debian:11 as build COPY install-build-pkgs build-mergerfs /tmp/ RUN /tmp/install-build-pkgs ARG BUILD_TIMESTAMP=0 ARG GIT_REPO ARG BRANCH RUN /tmp/build-mergerfs $GIT_REPO $BRANCH FROM scratch COPY --from=build /build/ / mergerfs-2.42.0/buildtools/containerfiles/debian:11.armhf0000644000000000000000000000036415177346257022015 0ustar rootrootFROM --platform=armhf debian:11 as build COPY install-build-pkgs build-mergerfs /tmp/ RUN /tmp/install-build-pkgs ARG BUILD_TIMESTAMP=0 ARG GIT_REPO ARG BRANCH RUN /tmp/build-mergerfs $GIT_REPO $BRANCH FROM scratch COPY --from=build /build/ / mergerfs-2.42.0/buildtools/containerfiles/debian:11.i3860000644000000000000000000000036315177346257021410 0ustar rootrootFROM --platform=i386 debian:11 as build COPY install-build-pkgs build-mergerfs /tmp/ RUN /tmp/install-build-pkgs ARG BUILD_TIMESTAMP=0 ARG GIT_REPO ARG BRANCH RUN /tmp/build-mergerfs $GIT_REPO $BRANCH FROM scratch COPY --from=build /build/ / mergerfs-2.42.0/buildtools/containerfiles/debian:12.amd640000644000000000000000000000036415177346257021634 0ustar rootrootFROM --platform=amd64 debian:12 as build COPY install-build-pkgs build-mergerfs /tmp/ RUN /tmp/install-build-pkgs ARG BUILD_TIMESTAMP=0 ARG GIT_REPO ARG BRANCH RUN /tmp/build-mergerfs $GIT_REPO $BRANCH FROM scratch COPY --from=build /build/ / mergerfs-2.42.0/buildtools/containerfiles/debian:12.arm640000644000000000000000000000036415177346257021652 0ustar rootrootFROM --platform=arm64 debian:12 as build COPY install-build-pkgs build-mergerfs /tmp/ RUN /tmp/install-build-pkgs ARG BUILD_TIMESTAMP=0 ARG GIT_REPO ARG BRANCH RUN /tmp/build-mergerfs $GIT_REPO $BRANCH FROM scratch COPY --from=build /build/ / mergerfs-2.42.0/buildtools/containerfiles/debian:12.armhf0000644000000000000000000000036415177346257022016 0ustar rootrootFROM --platform=armhf debian:12 as build COPY install-build-pkgs build-mergerfs /tmp/ RUN /tmp/install-build-pkgs ARG BUILD_TIMESTAMP=0 ARG GIT_REPO ARG BRANCH RUN /tmp/build-mergerfs $GIT_REPO $BRANCH FROM scratch COPY --from=build /build/ / mergerfs-2.42.0/buildtools/containerfiles/debian:12.i3860000644000000000000000000000036315177346257021411 0ustar rootrootFROM --platform=i386 debian:12 as build COPY install-build-pkgs build-mergerfs /tmp/ RUN /tmp/install-build-pkgs ARG BUILD_TIMESTAMP=0 ARG GIT_REPO ARG BRANCH RUN /tmp/build-mergerfs $GIT_REPO $BRANCH FROM scratch COPY --from=build /build/ / mergerfs-2.42.0/buildtools/containerfiles/debian:13.amd640000644000000000000000000000036415177346257021635 0ustar rootrootFROM --platform=amd64 debian:13 as build COPY install-build-pkgs build-mergerfs /tmp/ RUN /tmp/install-build-pkgs ARG BUILD_TIMESTAMP=0 ARG GIT_REPO ARG BRANCH RUN /tmp/build-mergerfs $GIT_REPO $BRANCH FROM scratch COPY --from=build /build/ / mergerfs-2.42.0/buildtools/containerfiles/debian:13.arm640000644000000000000000000000036415177346257021653 0ustar rootrootFROM --platform=arm64 debian:13 as build COPY install-build-pkgs build-mergerfs /tmp/ RUN /tmp/install-build-pkgs ARG BUILD_TIMESTAMP=0 ARG GIT_REPO ARG BRANCH RUN /tmp/build-mergerfs $GIT_REPO $BRANCH FROM scratch COPY --from=build /build/ / mergerfs-2.42.0/buildtools/containerfiles/debian:13.armhf0000644000000000000000000000036415177346257022017 0ustar rootrootFROM --platform=armhf debian:13 as build COPY install-build-pkgs build-mergerfs /tmp/ RUN /tmp/install-build-pkgs ARG BUILD_TIMESTAMP=0 ARG GIT_REPO ARG BRANCH RUN /tmp/build-mergerfs $GIT_REPO $BRANCH FROM scratch COPY --from=build /build/ / mergerfs-2.42.0/buildtools/containerfiles/debian:13.i3860000644000000000000000000000036315177346257021412 0ustar rootrootFROM --platform=i386 debian:13 as build COPY install-build-pkgs build-mergerfs /tmp/ RUN /tmp/install-build-pkgs ARG BUILD_TIMESTAMP=0 ARG GIT_REPO ARG BRANCH RUN /tmp/build-mergerfs $GIT_REPO $BRANCH FROM scratch COPY --from=build /build/ / mergerfs-2.42.0/buildtools/containerfiles/debian:13.riscv640000644000000000000000000000036615177346257022224 0ustar rootrootFROM --platform=riscv64 debian:13 as build COPY install-build-pkgs build-mergerfs /tmp/ RUN /tmp/install-build-pkgs ARG BUILD_TIMESTAMP=0 ARG GIT_REPO ARG BRANCH RUN /tmp/build-mergerfs $GIT_REPO $BRANCH FROM scratch COPY --from=build /build/ / mergerfs-2.42.0/buildtools/containerfiles/fedora:40.amd640000644000000000000000000000036415177346257021653 0ustar rootrootFROM --platform=amd64 fedora:40 as build COPY install-build-pkgs build-mergerfs /tmp/ RUN /tmp/install-build-pkgs ARG BUILD_TIMESTAMP=0 ARG GIT_REPO ARG BRANCH RUN /tmp/build-mergerfs $GIT_REPO $BRANCH FROM scratch COPY --from=build /build/ / mergerfs-2.42.0/buildtools/containerfiles/fedora:40.arm640000644000000000000000000000036415177346257021671 0ustar rootrootFROM --platform=arm64 fedora:40 as build COPY install-build-pkgs build-mergerfs /tmp/ RUN /tmp/install-build-pkgs ARG BUILD_TIMESTAMP=0 ARG GIT_REPO ARG BRANCH RUN /tmp/build-mergerfs $GIT_REPO $BRANCH FROM scratch COPY --from=build /build/ / mergerfs-2.42.0/buildtools/containerfiles/fedora:41.amd640000644000000000000000000000036415177346257021654 0ustar rootrootFROM --platform=amd64 fedora:41 as build COPY install-build-pkgs build-mergerfs /tmp/ RUN /tmp/install-build-pkgs ARG BUILD_TIMESTAMP=0 ARG GIT_REPO ARG BRANCH RUN /tmp/build-mergerfs $GIT_REPO $BRANCH FROM scratch COPY --from=build /build/ / mergerfs-2.42.0/buildtools/containerfiles/fedora:41.arm640000644000000000000000000000036415177346257021672 0ustar rootrootFROM --platform=arm64 fedora:41 as build COPY install-build-pkgs build-mergerfs /tmp/ RUN /tmp/install-build-pkgs ARG BUILD_TIMESTAMP=0 ARG GIT_REPO ARG BRANCH RUN /tmp/build-mergerfs $GIT_REPO $BRANCH FROM scratch COPY --from=build /build/ / mergerfs-2.42.0/buildtools/containerfiles/fedora:42.amd640000644000000000000000000000036415177346257021655 0ustar rootrootFROM --platform=amd64 fedora:42 as build COPY install-build-pkgs build-mergerfs /tmp/ RUN /tmp/install-build-pkgs ARG BUILD_TIMESTAMP=0 ARG GIT_REPO ARG BRANCH RUN /tmp/build-mergerfs $GIT_REPO $BRANCH FROM scratch COPY --from=build /build/ / mergerfs-2.42.0/buildtools/containerfiles/fedora:42.arm640000644000000000000000000000036415177346257021673 0ustar rootrootFROM --platform=arm64 fedora:42 as build COPY install-build-pkgs build-mergerfs /tmp/ RUN /tmp/install-build-pkgs ARG BUILD_TIMESTAMP=0 ARG GIT_REPO ARG BRANCH RUN /tmp/build-mergerfs $GIT_REPO $BRANCH FROM scratch COPY --from=build /build/ / mergerfs-2.42.0/buildtools/containerfiles/fedora:43.amd640000644000000000000000000000036415177346257021656 0ustar rootrootFROM --platform=amd64 fedora:43 as build COPY install-build-pkgs build-mergerfs /tmp/ RUN /tmp/install-build-pkgs ARG BUILD_TIMESTAMP=0 ARG GIT_REPO ARG BRANCH RUN /tmp/build-mergerfs $GIT_REPO $BRANCH FROM scratch COPY --from=build /build/ / mergerfs-2.42.0/buildtools/containerfiles/fedora:43.arm640000644000000000000000000000036415177346257021674 0ustar rootrootFROM --platform=arm64 fedora:43 as build COPY install-build-pkgs build-mergerfs /tmp/ RUN /tmp/install-build-pkgs ARG BUILD_TIMESTAMP=0 ARG GIT_REPO ARG BRANCH RUN /tmp/build-mergerfs $GIT_REPO $BRANCH FROM scratch COPY --from=build /build/ / mergerfs-2.42.0/buildtools/containerfiles/fedora:44.amd640000644000000000000000000000036415177346257021657 0ustar rootrootFROM --platform=amd64 fedora:43 as build COPY install-build-pkgs build-mergerfs /tmp/ RUN /tmp/install-build-pkgs ARG BUILD_TIMESTAMP=0 ARG GIT_REPO ARG BRANCH RUN /tmp/build-mergerfs $GIT_REPO $BRANCH FROM scratch COPY --from=build /build/ / mergerfs-2.42.0/buildtools/containerfiles/fedora:44.arm640000644000000000000000000000036415177346257021675 0ustar rootrootFROM --platform=arm64 fedora:43 as build COPY install-build-pkgs build-mergerfs /tmp/ RUN /tmp/install-build-pkgs ARG BUILD_TIMESTAMP=0 ARG GIT_REPO ARG BRANCH RUN /tmp/build-mergerfs $GIT_REPO $BRANCH FROM scratch COPY --from=build /build/ / mergerfs-2.42.0/buildtools/containerfiles/rockylinux:10.amd640000644000000000000000000000041315177346257022612 0ustar rootrootFROM --platform=amd64 quay.io/rockylinux/rockylinux:10 as build COPY install-build-pkgs build-mergerfs /tmp/ RUN /tmp/install-build-pkgs ARG BUILD_TIMESTAMP=0 ARG GIT_REPO ARG BRANCH RUN /tmp/build-mergerfs $GIT_REPO $BRANCH FROM scratch COPY --from=build /build/ / mergerfs-2.42.0/buildtools/containerfiles/rockylinux:10.arm640000644000000000000000000000041315177346257022630 0ustar rootrootFROM --platform=arm64 quay.io/rockylinux/rockylinux:10 as build COPY install-build-pkgs build-mergerfs /tmp/ RUN /tmp/install-build-pkgs ARG BUILD_TIMESTAMP=0 ARG GIT_REPO ARG BRANCH RUN /tmp/build-mergerfs $GIT_REPO $BRANCH FROM scratch COPY --from=build /build/ / mergerfs-2.42.0/buildtools/containerfiles/rockylinux:8.amd640000644000000000000000000000041215177346257022540 0ustar rootrootFROM --platform=amd64 quay.io/rockylinux/rockylinux:8 as build COPY install-build-pkgs build-mergerfs /tmp/ RUN /tmp/install-build-pkgs ARG BUILD_TIMESTAMP=0 ARG GIT_REPO ARG BRANCH RUN /tmp/build-mergerfs $GIT_REPO $BRANCH FROM scratch COPY --from=build /build/ / mergerfs-2.42.0/buildtools/containerfiles/rockylinux:8.arm640000644000000000000000000000041215177346257022556 0ustar rootrootFROM --platform=arm64 quay.io/rockylinux/rockylinux:8 as build COPY install-build-pkgs build-mergerfs /tmp/ RUN /tmp/install-build-pkgs ARG BUILD_TIMESTAMP=0 ARG GIT_REPO ARG BRANCH RUN /tmp/build-mergerfs $GIT_REPO $BRANCH FROM scratch COPY --from=build /build/ / mergerfs-2.42.0/buildtools/containerfiles/rockylinux:9.amd640000644000000000000000000000041215177346257022541 0ustar rootrootFROM --platform=amd64 quay.io/rockylinux/rockylinux:9 as build COPY install-build-pkgs build-mergerfs /tmp/ RUN /tmp/install-build-pkgs ARG BUILD_TIMESTAMP=0 ARG GIT_REPO ARG BRANCH RUN /tmp/build-mergerfs $GIT_REPO $BRANCH FROM scratch COPY --from=build /build/ / mergerfs-2.42.0/buildtools/containerfiles/rockylinux:9.arm640000644000000000000000000000041215177346257022557 0ustar rootrootFROM --platform=arm64 quay.io/rockylinux/rockylinux:9 as build COPY install-build-pkgs build-mergerfs /tmp/ RUN /tmp/install-build-pkgs ARG BUILD_TIMESTAMP=0 ARG GIT_REPO ARG BRANCH RUN /tmp/build-mergerfs $GIT_REPO $BRANCH FROM scratch COPY --from=build /build/ / mergerfs-2.42.0/buildtools/containerfiles/static.amd640000644000000000000000000000106515177346257021443 0ustar rootrootFROM --platform=linux/amd64 alpine:latest as build COPY install-build-pkgs /tmp/ RUN /tmp/install-build-pkgs ARG BUILD_TIMESTAMP=0 ARG GIT_REPO ARG BRANCH RUN git clone --single-branch --branch="${BRANCH}" ${GIT_REPO} /tmp/mergerfs WORKDIR /tmp/mergerfs RUN make NDEBUG=1 LTO=1 STATIC=1 DESTDIR=/tmp -j$(nproc) install RUN mkdir /build RUN /tmp/usr/local/bin/mergerfs --version | head -n1 | cut -c 11- | tee /tmp/version RUN tar cvfz /build/mergerfs-$(cat /tmp/version)-static-linux_amd64.tar.gz --directory=/tmp usr sbin FROM scratch COPY --from=build /build/ / mergerfs-2.42.0/buildtools/containerfiles/static.arm640000644000000000000000000000106515177346257021461 0ustar rootrootFROM --platform=linux/arm64 alpine:latest as build COPY install-build-pkgs /tmp/ RUN /tmp/install-build-pkgs ARG BUILD_TIMESTAMP=0 ARG GIT_REPO ARG BRANCH RUN git clone --single-branch --branch="${BRANCH}" ${GIT_REPO} /tmp/mergerfs WORKDIR /tmp/mergerfs RUN make NDEBUG=1 LTO=1 STATIC=1 DESTDIR=/tmp -j$(nproc) install RUN mkdir /build RUN /tmp/usr/local/bin/mergerfs --version | head -n1 | cut -c 11- | tee /tmp/version RUN tar cvfz /build/mergerfs-$(cat /tmp/version)-static-linux_arm64.tar.gz --directory=/tmp usr sbin FROM scratch COPY --from=build /build/ / mergerfs-2.42.0/buildtools/containerfiles/static.armhf0000644000000000000000000000106515177346257021625 0ustar rootrootFROM --platform=linux/armhf alpine:latest as build COPY install-build-pkgs /tmp/ RUN /tmp/install-build-pkgs ARG BUILD_TIMESTAMP=0 ARG GIT_REPO ARG BRANCH RUN git clone --single-branch --branch="${BRANCH}" ${GIT_REPO} /tmp/mergerfs WORKDIR /tmp/mergerfs RUN make NDEBUG=1 LTO=1 STATIC=1 DESTDIR=/tmp -j$(nproc) install RUN mkdir /build RUN /tmp/usr/local/bin/mergerfs --version | head -n1 | cut -c 11- | tee /tmp/version RUN tar cvfz /build/mergerfs-$(cat /tmp/version)-static-linux_armhf.tar.gz --directory=/tmp usr sbin FROM scratch COPY --from=build /build/ / mergerfs-2.42.0/buildtools/containerfiles/static.i3860000644000000000000000000000106315177346257021217 0ustar rootrootFROM --platform=linux/i386 alpine:latest as build COPY install-build-pkgs /tmp/ RUN /tmp/install-build-pkgs ARG BUILD_TIMESTAMP=0 ARG GIT_REPO ARG BRANCH RUN git clone --single-branch --branch="${BRANCH}" ${GIT_REPO} /tmp/mergerfs WORKDIR /tmp/mergerfs RUN make NDEBUG=1 LTO=1 STATIC=1 DESTDIR=/tmp -j$(nproc) install RUN mkdir /build RUN /tmp/usr/local/bin/mergerfs --version | head -n1 | cut -c 11- | tee /tmp/version RUN tar cvfz /build/mergerfs-$(cat /tmp/version)-static-linux_i386.tar.gz --directory=/tmp usr sbin FROM scratch COPY --from=build /build/ / mergerfs-2.42.0/buildtools/containerfiles/static.installer0000644000000000000000000000054215177346257022524 0ustar rootrootARG BUILD_TIMESTAMP=0 FROM --platform=linux/amd64 ubuntu:latest as build RUN apt-get update && apt-get install -y makeself RUN mkdir -p /tmp/mergerfs/ RUN ls -lhd /pkgs RUN cp -v /pkgs/*static*.gz /tmp/mergerfs/ RUN mkdir -p /build RUN makeself /tmp/mergerfs/ /build/mergerfs-installer.run "mergerfs" echo "foo" FROM scratch COPY --from=build /build/ / mergerfs-2.42.0/buildtools/containerfiles/static.riscv640000644000000000000000000000107115177346257022025 0ustar rootrootFROM --platform=linux/riscv64 alpine:latest as build COPY install-build-pkgs /tmp/ RUN /tmp/install-build-pkgs ARG BUILD_TIMESTAMP=0 ARG GIT_REPO ARG BRANCH RUN git clone --single-branch --branch="${BRANCH}" ${GIT_REPO} /tmp/mergerfs WORKDIR /tmp/mergerfs RUN make NDEBUG=1 LTO=1 STATIC=1 DESTDIR=/tmp -j$(nproc) install RUN mkdir /build RUN /tmp/usr/local/bin/mergerfs --version | head -n1 | cut -c 11- | tee /tmp/version RUN tar cvfz /build/mergerfs-$(cat /tmp/version)-static-linux_riscv64.tar.gz --directory=/tmp usr sbin FROM scratch COPY --from=build /build/ / mergerfs-2.42.0/buildtools/containerfiles/tarball0000644000000000000000000000056315177346257020665 0ustar rootrootFROM alpine:latest as tarball COPY install-build-pkgs /tmp/ RUN /tmp/install-build-pkgs ARG BUILD_TIMESTAMP=0 ARG BRANCH=master ARG GIT_REPO RUN git clone --single-branch "${GIT_REPO}" /tmp/mergerfs --branch="${BRANCH}" RUN cd /tmp/mergerfs && make version tarball RUN mkdir /build RUN cp -v /tmp/mergerfs/*.tar.gz /build/ FROM scratch COPY --from=tarball /build/ / mergerfs-2.42.0/buildtools/containerfiles/ubuntu:22.04.amd640000644000000000000000000000036715177346257022162 0ustar rootrootFROM --platform=amd64 ubuntu:22.04 as build COPY install-build-pkgs build-mergerfs /tmp/ RUN /tmp/install-build-pkgs ARG BUILD_TIMESTAMP=0 ARG GIT_REPO ARG BRANCH RUN /tmp/build-mergerfs $GIT_REPO $BRANCH FROM scratch COPY --from=build /build/ / mergerfs-2.42.0/buildtools/containerfiles/ubuntu:22.04.arm640000644000000000000000000000036715177346257022200 0ustar rootrootFROM --platform=arm64 ubuntu:22.04 as build COPY install-build-pkgs build-mergerfs /tmp/ RUN /tmp/install-build-pkgs ARG BUILD_TIMESTAMP=0 ARG GIT_REPO ARG BRANCH RUN /tmp/build-mergerfs $GIT_REPO $BRANCH FROM scratch COPY --from=build /build/ / mergerfs-2.42.0/buildtools/containerfiles/ubuntu:22.04.armhf0000644000000000000000000000036715177346257022344 0ustar rootrootFROM --platform=armhf ubuntu:22.04 as build COPY install-build-pkgs build-mergerfs /tmp/ RUN /tmp/install-build-pkgs ARG BUILD_TIMESTAMP=0 ARG GIT_REPO ARG BRANCH RUN /tmp/build-mergerfs $GIT_REPO $BRANCH FROM scratch COPY --from=build /build/ / mergerfs-2.42.0/buildtools/containerfiles/ubuntu:22.04.riscv640000644000000000000000000000037115177346257022542 0ustar rootrootFROM --platform=riscv64 ubuntu:22.04 as build COPY install-build-pkgs build-mergerfs /tmp/ RUN /tmp/install-build-pkgs ARG BUILD_TIMESTAMP=0 ARG GIT_REPO ARG BRANCH RUN /tmp/build-mergerfs $GIT_REPO $BRANCH FROM scratch COPY --from=build /build/ / mergerfs-2.42.0/buildtools/containerfiles/ubuntu:24.04.amd640000644000000000000000000000036715177346257022164 0ustar rootrootFROM --platform=amd64 ubuntu:24.04 as build COPY install-build-pkgs build-mergerfs /tmp/ RUN /tmp/install-build-pkgs ARG BUILD_TIMESTAMP=0 ARG GIT_REPO ARG BRANCH RUN /tmp/build-mergerfs $GIT_REPO $BRANCH FROM scratch COPY --from=build /build/ / mergerfs-2.42.0/buildtools/containerfiles/ubuntu:24.04.arm640000644000000000000000000000036715177346257022202 0ustar rootrootFROM --platform=arm64 ubuntu:24.04 as build COPY install-build-pkgs build-mergerfs /tmp/ RUN /tmp/install-build-pkgs ARG BUILD_TIMESTAMP=0 ARG GIT_REPO ARG BRANCH RUN /tmp/build-mergerfs $GIT_REPO $BRANCH FROM scratch COPY --from=build /build/ / mergerfs-2.42.0/buildtools/containerfiles/ubuntu:24.04.armhf0000644000000000000000000000036715177346257022346 0ustar rootrootFROM --platform=armhf ubuntu:24.04 as build COPY install-build-pkgs build-mergerfs /tmp/ RUN /tmp/install-build-pkgs ARG BUILD_TIMESTAMP=0 ARG GIT_REPO ARG BRANCH RUN /tmp/build-mergerfs $GIT_REPO $BRANCH FROM scratch COPY --from=build /build/ / mergerfs-2.42.0/buildtools/containerfiles/ubuntu:24.04.riscv640000644000000000000000000000037115177346257022544 0ustar rootrootFROM --platform=riscv64 ubuntu:24.04 as build COPY install-build-pkgs build-mergerfs /tmp/ RUN /tmp/install-build-pkgs ARG BUILD_TIMESTAMP=0 ARG GIT_REPO ARG BRANCH RUN /tmp/build-mergerfs $GIT_REPO $BRANCH FROM scratch COPY --from=build /build/ / mergerfs-2.42.0/buildtools/containerfiles/ubuntu:25.04.amd640000644000000000000000000000036715177346257022165 0ustar rootrootFROM --platform=amd64 ubuntu:25.04 as build COPY install-build-pkgs build-mergerfs /tmp/ RUN /tmp/install-build-pkgs ARG BUILD_TIMESTAMP=0 ARG GIT_REPO ARG BRANCH RUN /tmp/build-mergerfs $GIT_REPO $BRANCH FROM scratch COPY --from=build /build/ / mergerfs-2.42.0/buildtools/containerfiles/ubuntu:25.04.arm640000644000000000000000000000036715177346257022203 0ustar rootrootFROM --platform=arm64 ubuntu:25.04 as build COPY install-build-pkgs build-mergerfs /tmp/ RUN /tmp/install-build-pkgs ARG BUILD_TIMESTAMP=0 ARG GIT_REPO ARG BRANCH RUN /tmp/build-mergerfs $GIT_REPO $BRANCH FROM scratch COPY --from=build /build/ / mergerfs-2.42.0/buildtools/containerfiles/ubuntu:25.04.armhf0000644000000000000000000000036715177346257022347 0ustar rootrootFROM --platform=armhf ubuntu:25.04 as build COPY install-build-pkgs build-mergerfs /tmp/ RUN /tmp/install-build-pkgs ARG BUILD_TIMESTAMP=0 ARG GIT_REPO ARG BRANCH RUN /tmp/build-mergerfs $GIT_REPO $BRANCH FROM scratch COPY --from=build /build/ / mergerfs-2.42.0/buildtools/containerfiles/ubuntu:25.04.riscv640000644000000000000000000000037115177346257022545 0ustar rootrootFROM --platform=riscv64 ubuntu:25.04 as build COPY install-build-pkgs build-mergerfs /tmp/ RUN /tmp/install-build-pkgs ARG BUILD_TIMESTAMP=0 ARG GIT_REPO ARG BRANCH RUN /tmp/build-mergerfs $GIT_REPO $BRANCH FROM scratch COPY --from=build /build/ / mergerfs-2.42.0/buildtools/containerfiles/ubuntu:25.10.amd640000644000000000000000000000036715177346257022162 0ustar rootrootFROM --platform=amd64 ubuntu:25.10 as build COPY install-build-pkgs build-mergerfs /tmp/ RUN /tmp/install-build-pkgs ARG BUILD_TIMESTAMP=0 ARG GIT_REPO ARG BRANCH RUN /tmp/build-mergerfs $GIT_REPO $BRANCH FROM scratch COPY --from=build /build/ / mergerfs-2.42.0/buildtools/containerfiles/ubuntu:25.10.arm640000644000000000000000000000036715177346257022200 0ustar rootrootFROM --platform=arm64 ubuntu:25.10 as build COPY install-build-pkgs build-mergerfs /tmp/ RUN /tmp/install-build-pkgs ARG BUILD_TIMESTAMP=0 ARG GIT_REPO ARG BRANCH RUN /tmp/build-mergerfs $GIT_REPO $BRANCH FROM scratch COPY --from=build /build/ / mergerfs-2.42.0/buildtools/containerfiles/ubuntu:25.10.armhf0000644000000000000000000000036715177346257022344 0ustar rootrootFROM --platform=armhf ubuntu:25.10 as build COPY install-build-pkgs build-mergerfs /tmp/ RUN /tmp/install-build-pkgs ARG BUILD_TIMESTAMP=0 ARG GIT_REPO ARG BRANCH RUN /tmp/build-mergerfs $GIT_REPO $BRANCH FROM scratch COPY --from=build /build/ / mergerfs-2.42.0/buildtools/containerfiles/ubuntu:25.10.riscv640000644000000000000000000000037115177346257022542 0ustar rootrootFROM --platform=riscv64 ubuntu:25.10 as build COPY install-build-pkgs build-mergerfs /tmp/ RUN /tmp/install-build-pkgs ARG BUILD_TIMESTAMP=0 ARG GIT_REPO ARG BRANCH RUN /tmp/build-mergerfs $GIT_REPO $BRANCH FROM scratch COPY --from=build /build/ / mergerfs-2.42.0/buildtools/containerfiles/ubuntu:26.04.amd640000644000000000000000000000036615177346257022165 0ustar rootrootFROM --platform=amd64 ubuntu:26.04 as build COPY install-build-pkgs build-mergerfs /tmp/ RUN /tmp/install-build-pkgs ARG BUILD_TIMESTAMP=0 ARG GIT_REPO ARG BRANCH RUN /tmp/build-mergerfs $GIT_REPO $BRANCH FROM scratch COPY --from=build /build/ /mergerfs-2.42.0/buildtools/containerfiles/ubuntu:26.04.arm640000644000000000000000000000036615177346257022203 0ustar rootrootFROM --platform=arm64 ubuntu:26.04 as build COPY install-build-pkgs build-mergerfs /tmp/ RUN /tmp/install-build-pkgs ARG BUILD_TIMESTAMP=0 ARG GIT_REPO ARG BRANCH RUN /tmp/build-mergerfs $GIT_REPO $BRANCH FROM scratch COPY --from=build /build/ /mergerfs-2.42.0/buildtools/containerfiles/ubuntu:26.04.armhf0000644000000000000000000000036615177346257022347 0ustar rootrootFROM --platform=armhf ubuntu:26.04 as build COPY install-build-pkgs build-mergerfs /tmp/ RUN /tmp/install-build-pkgs ARG BUILD_TIMESTAMP=0 ARG GIT_REPO ARG BRANCH RUN /tmp/build-mergerfs $GIT_REPO $BRANCH FROM scratch COPY --from=build /build/ /mergerfs-2.42.0/buildtools/containerfiles/ubuntu:26.04.riscv640000644000000000000000000000037015177346257022545 0ustar rootrootFROM --platform=riscv64 ubuntu:26.04 as build COPY install-build-pkgs build-mergerfs /tmp/ RUN /tmp/install-build-pkgs ARG BUILD_TIMESTAMP=0 ARG GIT_REPO ARG BRANCH RUN /tmp/build-mergerfs $GIT_REPO $BRANCH FROM scratch COPY --from=build /build/ /mergerfs-2.42.0/buildtools/containerimage/0000755000000000000000000000000015177346257017275 5ustar rootrootmergerfs-2.42.0/buildtools/containerimage/Containerfile0000644000000000000000000000111315177346257021776 0ustar rootrootFROM --platform=linux/amd64 alpine:latest as build ARG GIT_REPO ARG BRANCH RUN <&2 exit 1 fi # Try to detect distro from multiple locations local distro_ver distro_ver=$(detect_distro "/etc/os-release") || \ distro_ver=$(detect_distro "/usr/lib/os-release") || { echo "WARNING: Could not detect distro from os-release" >&2 exit 1 } # Build target string local target="${distro_ver}.${arch}" # Try to find matching containerfile if find_containerfile "$target"; then exit 0 fi # Try with partial version matching (e.g., 25.10 → 25) local distro="${distro_ver%%:*}" local version="${distro_ver##*:}" # Strip last minor version number and try again local short_version="${version%.*}" if [[ -n "$short_version" ]]; then target="${distro}:${short_version}.${arch}" if find_containerfile "$target"; then exit 0 fi fi # No match found echo "WARNING: No containerfile found for target: ${distro_ver}.${arch}" >&2 exit 1 } main "$@" mergerfs-2.42.0/buildtools/gen-containerfiles0000755000000000000000000000114315177346257020011 0ustar rootroot#!/bin/sh input_file="${1}" while IFS= read -r line || [ -n "$line" ]; do # Skip empty lines if [ -z "$line" ]; then continue fi image=$(echo "$line" | cut -d' ' -f1) platform=$(echo "$line" | cut -d' ' -f2-) echo "${image} ${platform}" cat < "containerfiles/${image##*/}.${platform}" FROM --platform=${platform} ${image} as build COPY install-build-pkgs build-mergerfs /tmp/ RUN /tmp/install-build-pkgs ARG BUILD_TIMESTAMP=0 ARG GIT_REPO ARG BRANCH RUN /tmp/build-mergerfs \$GIT_REPO \$BRANCH FROM scratch COPY --from=build /build/ / EOF done < "$input_file" mergerfs-2.42.0/buildtools/git2debcl0000755000000000000000000001166315177346257016104 0ustar rootroot#!/bin/sh # Copyright (c) 2016, Antonio SJ Musumeci # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # Default values NAME="" VERSION="::guess::" DISTRO="::guess::" CODENAME="::guess::" URGENCY="medium" # Function to display usage usage() { cat << EOF Usage: $0 --name NAME [OPTIONS] Generated debian/changelog from git log Options: --name NAME Name of package (required) --version VERSION Place in git history to include upto (default: ::guess::) --distro DISTRO Distribution name (default: ::guess::) --codename NAME Distribution codename (default: ::guess::) --urgency URGENCY Urgency (default: medium) -h, --help Show this help message EOF exit 1 } # Parse command line arguments while [ $# -gt 0 ]; do case "$1" in --name) NAME="$2" shift 2 ;; --version) VERSION="$2" shift 2 ;; --distro) DISTRO="$2" shift 2 ;; --codename) CODENAME="$2" shift 2 ;; --urgency) URGENCY="$2" shift 2 ;; -h|--help) usage ;; *) echo "Unknown option: $1" >&2 usage ;; esac done # Check required arguments if [ -z "$NAME" ]; then echo "Error: --name is required" >&2 usage fi # Function to get git tags sorted in reverse order git_tags() { git tag -l | sort -rV } # Function to get git log between two tags git_log() { local fromtag="$1" local totag="$2" git log --no-merges --oneline "${fromtag}...${totag}" 2>/dev/null } # Function to get author and time for a tag git_author_and_time() { local tag="$1" git log -1 --format="-- %an <%ae> %cD" "$tag" } # Function to get git version git_version() { git describe --always --tags --dirty 2>/dev/null || echo "unknown" } # Function to guess distribution guess_distro() { if command -v lsb_release >/dev/null 2>&1; then lsb_release -i -s 2>/dev/null | tr '[:upper:]' '[:lower:]' else echo "unknown" fi } # Function to guess codename guess_codename() { if command -v lsb_release >/dev/null 2>&1; then lsb_release -c -s 2>/dev/null | tr '[:upper:]' '[:lower:]' else echo "unknown" fi } # Handle guessing of values if [ "$DISTRO" = "::guess::" ]; then DISTRO=$(guess_distro) fi if [ "$CODENAME" = "::guess::" ]; then CODENAME=$(guess_codename) fi if [ "$VERSION" = "::guess::" ]; then VERSION=$(git_version) fi # Version suffix VERSUFFIX="~${DISTRO}-${CODENAME}" # Get all tags TAGS=$(git_tags) # Create temporary file for tag pairs TMPFILE=$(mktemp) trap 'rm -f "$TMPFILE"' EXIT # Check if version is in tags if echo "$TAGS" | grep -q "^${VERSION}$"; then # If version is a tag, start from that tag echo "$TAGS" | awk -v ver="$VERSION" 'BEGIN{found=0} {if($0==ver)found=1; if(found)print}' > "$TMPFILE" else # If version is not a tag, use HEAD as starting point echo "$VERSION HEAD" > "$TMPFILE" echo "$TAGS" >> "$TMPFILE" fi # Process tags and generate changelog PREV_TAG="" PREV_REF="" FIRST=1 while IFS= read -r line; do if [ -z "$line" ]; then continue fi # Handle the special case of VERSION HEAD if [ "$line" = "$VERSION HEAD" ]; then TAG="$VERSION" REF="HEAD" else TAG="$line" REF="$line" fi if [ -n "$PREV_TAG" ]; then # Get log entries between current and previous tag LOG_ENTRIES=$(git_log "$REF" "$PREV_REF") # Skip if no changes if [ -z "$LOG_ENTRIES" ] || [ "$LOG_ENTRIES" = "" ]; then PREV_TAG="$TAG" PREV_REF="$REF" continue fi # Print package header printf "%s (%s%s) %s; urgency=%s\n\n" "$NAME" "$PREV_TAG" "$VERSUFFIX" "$CODENAME" "$URGENCY" # Print each log entry echo "$LOG_ENTRIES" | while IFS= read -r entry; do if [ -n "$entry" ]; then printf " * %s\n" "$entry" fi done # Print author and time AUTHOR_TIME=$(git_author_and_time "$PREV_REF") printf "\n %s\n\n" "$AUTHOR_TIME" fi PREV_TAG="$TAG" PREV_REF="$REF" done < "$TMPFILE" mergerfs-2.42.0/buildtools/install-build-pkgs0000755000000000000000000000206715177346257017750 0ustar rootroot#!/bin/sh if [ -e /usr/bin/apt-get ]; then export DEBIAN_FRONTEND=noninteractive apt-get -qy update apt-get -qy --force-yes --no-install-suggests --no-install-recommends \ install \ ca-certificates \ build-essential \ dpkg-dev \ git \ g++ \ debhelper \ lsb-release \ fakeroot elif [ -e /usr/bin/dnf ]; then dnf -y update dnf -y install \ git rpm-build gcc-c++ make which libatomic elif [ -e /usr/bin/yum ]; then yum -y update yum -y install \ git rpm-build gcc-c++ make which yum -y install centos-release-scl yum -y install devtoolset-9-gcc\* elif [ -e /usr/bin/zypper ]; then zypper update -y zypper install -y \ git rpm-build gcc-c++ make which elif [ -e /sbin/apk ]; then apk add \ abuild git gcc g++ make \ linux-headers elif [ -e /usr/sbin/pkg ]; then pkg install \ git gmake gcc elif [ -e /usr/bin/pacman ]; then pacman -Sy --noconfirm base-devel git fakeroot fi mergerfs-2.42.0/buildtools/install-build-tools0000755000000000000000000000151115177346257020135 0ustar rootroot#!/bin/sh if [ "$(id -u)" -eq 0 ]; then SUDO= elif command -v sudo >/dev/null 2>&1; then SUDO=sudo elif command -v doas >/dev/null 2>&1; then SUDO=doas else printf '%s\n' "error: need root privileges; run as root or install sudo/doas" >&2 exit 1 fi if [ -e /usr/bin/apt-get ]; then export DEBIAN_FRONTEND=noninteractive ${SUDO} apt-get -qy update ${SUDO} apt-get -qy --no-install-suggests --no-install-recommends install \ qemu-user-static \ podman elif [ -e /usr/bin/dnf ]; then ${SUDO} dnf -y update ${SUDO} dnf -y install \ qemu-user-static \ podman elif [ -e /sbin/apk ]; then ${SUDO} apk add \ python3 \ qemu-user-static \ podman elif [ -e /usr/bin/pacman ]; then ${SUDO} pacman -Sy --noconfirm qemu-user-static podman fi mergerfs-2.42.0/buildtools/target-containers.txt0000644000000000000000000000143715177346257020507 0ustar rootrootdebian:11 amd64 debian:11 arm64 debian:11 armhf debian:11 i386 debian:12 amd64 debian:12 arm64 debian:12 armhf debian:12 i386 debian:13 amd64 debian:13 arm64 debian:13 armhf debian:13 i386 debian:13 riscv64 fedora:40 amd64 fedora:40 arm64 fedora:41 amd64 fedora:41 arm64 fedora:42 amd64 fedora:42 arm64 fedora:43 amd64 fedora:43 arm64 quay.io/rockylinux/rockylinux:10 amd64 quay.io/rockylinux/rockylinux:10 arm64 quay.io/rockylinux/rockylinux:8 amd64 quay.io/rockylinux/rockylinux:8 arm64 quay.io/rockylinux/rockylinux:9 amd64 quay.io/rockylinux/rockylinux:9 arm64 ubuntu:22.04 amd64 ubuntu:22.04 arm64 ubuntu:22.04 armhf ubuntu:22.04 riscv64 ubuntu:24.04 amd64 ubuntu:24.04 arm64 ubuntu:24.04 armhf ubuntu:24.04 riscv64 ubuntu:25.04 amd64 ubuntu:25.04 arm64 ubuntu:25.04 armhf ubuntu:25.04 riscv64 mergerfs-2.42.0/buildtools/update-version0000755000000000000000000000072015177346257017202 0ustar rootroot#!/bin/sh VERSION=$(git describe --always --tags --dirty) if [ $? -ne 0 ]; then VERSION=$(cat VERSION) fi if [ "${VERSION}" = "" ]; then VERSION="unknown" fi echo "version = ${VERSION}" echo -n "${VERSION}" > VERSION grep -sq \"${VERSION}\" src/version.hpp RV=$? if [ $RV -ne 0 ]; then echo "Writing 'src/version.hpp'" echo "#pragma once" > src/version.hpp echo "static const char MERGERFS_VERSION[] = \"${VERSION}\";" >> src/version.hpp fi mergerfs-2.42.0/debian/0000755000000000000000000000000015177346257013352 5ustar rootrootmergerfs-2.42.0/debian/control0000644000000000000000000000106515177346257014757 0ustar rootrootSource: mergerfs Section: utils Priority: optional Maintainer: Antonio SJ Musumeci Build-Depends: debhelper-compat (= 10) Standards-Version: 3.9.4 Homepage: http://github.com/trapexit/mergerfs Package: mergerfs Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, fuse [linux-any] | fuse4bsd [kfreebsd-any] Description: another FUSE union filesystem mergerfs is a union filesystem geared towards simplifying storage and management of files across numerous commodity storage devices. It is similar to mhddfs, unionfs, and aufs. mergerfs-2.42.0/debian/copyright0000644000000000000000000000203515177346257015305 0ustar rootrootFormat: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: mergerfs-1.1.0 Source: http://github.com/trapexit/mergerfs Files: * Copyright: 2014 Antonio SJ Musumeci License: ISC Files: debian/* Copyright: 2014 Antonio SJ Musumeci License: ISC License: ISC Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. . THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. n mergerfs-2.42.0/debian/docs0000644000000000000000000000001215177346257014216 0ustar rootrootREADME.md mergerfs-2.42.0/debian/mergerfs.postinst0000755000000000000000000000016115177346257016772 0ustar rootroot#!/bin/sh set -e case "${1}" in configure) chmod 4755 /usr/bin/mergerfs-fusermount ;; esac mergerfs-2.42.0/debian/rules0000755000000000000000000000025415177346257014433 0ustar rootroot#!/usr/bin/make -f # -*- makefile -*- export DH_VERBOSE=1 %: dh $@ override_dh_auto_install: $(MAKE) \ DESTDIR=$(CURDIR)/debian/mergerfs \ PREFIX=/usr \ install mergerfs-2.42.0/man/0000755000000000000000000000000015177346257012703 5ustar rootrootmergerfs-2.42.0/man/mergerfs.10000644000000000000000000000775515177346257014615 0ustar rootroot.TH MERGERFS 1 "May 2025" "mergerfs" "User Commands" .SH NAME mergerfs \- a featureful union filesystem .SH SYNOPSIS .B mergerfs [options] .SH DESCRIPTION .B mergerfs is a FUSE-based union filesystem geared towards simplifying storage and management of files across numerous commodity storage devices. It is similar to .BR mhddfs , .BR unionfs , and .BR aufs . .SH QUICKSTART .UR https://trapexit.github.io/mergerfs/latest/quickstart .LI https://trapexit.github.io/mergerfs/latest/quickstart .UE .SH DOCUMENTATION .UR https://trapexit.github.io/mergerfs .LI https://trapexit.github.io/mergerfs .UE .SH SUPPORT .UR https://trapexit.github.io/mergerfs/latest/support .LI https://trapexit.github.io/mergerfs/latest/support .UE .SH FEATURES .IP \[bu] 2 Logically combine numerous filesystems/paths into a single mount point .IP \[bu] Combine paths of the same or different filesystems .IP \[bu] Ability to add or remove filesystems/paths without impacting the rest of the data .IP \[bu] Unaffected by individual filesystem failure .IP \[bu] Configurable file selection and creation placement .IP \[bu] Works with filesystems of any size .IP \[bu] Works with filesystems of almost any type .IP \[bu] Ignore read-only filesystems when creating files .IP \[bu] Hard link copy-on-write / CoW .IP \[bu] Runtime configurable .IP \[bu] Support for extended attributes (xattrs) .IP \[bu] Support for file attributes (chattr) .IP \[bu] Support for POSIX ACLs .SH NON-FEATURES .IP \[bu] 2 Read/write overlay on top of read-only filesystem like OverlayFS .IP \[bu] File whiteout .IP \[bu] RAID-like parity calculation .IP \[bu] Redundancy .IP \[bu] Splitting of files across branches .SH HOW IT WORKS .B mergerfs logically merges multiple filesystem paths together. It acts as a proxy to the underlying filesystem paths, combining the behaviors of some functions and being a selector for others. When the contents of a directory are requested, .B mergerfs combines the list of files from each directory, deduplicating entries, and returns that list. When a file or directory is created, a policy is first run to determine which branch will be selected for the creation. For functions which change attributes or remove the file, the behavior may be applied to all instances found. Read more about policies here: .UR https://trapexit.github.io/mergerfs/latest/config/functions_categories_policies .LI https://trapexit.github.io/mergerfs/latest/config/functions_categories_policies .UE .SH VISUALIZATION .nf A + B = C /disk1 /disk2 /merged | | | +-- /dir1 +-- /dir1 +-- /dir1 | | | | | | | +-- file1 | +-- file2 | +-- file1 | | +-- file3 | +-- file2 +-- /dir2 | | +-- file3 | | +-- /dir3 | | +-- file4 | +-- /dir2 | +-- file5 | | +-- file6 | +-- file4 | +-- /dir3 | | | +-- file5 | +-- file6 .fi .SH SPONSORSHIP AND DONATIONS Development and support of a project like .B mergerfs require a significant amount of time and effort. The software is released under the very liberal ISC license and is therefore free to use for personal or commercial uses. If you are a non-commercial user and find .B mergerfs and its support valuable and would like to support the project financially, it would be very much appreciated. If you are using .B mergerfs commercially, please consider sponsoring the project to ensure it continues to be maintained and receive updates. If custom features are needed, feel free to contact the maintainer directly. .UR https://github.com/trapexit/support .LI https://github.com/trapexit/support .UE .SH LICENSE ISC License .SH AUTHOR Antonio SJ Musumeci (aka trapexit) mergerfs-2.42.0/mergerfs.spec0000644000000000000000000000306015177346257014615 0ustar rootrootName: mergerfs Version: __VERSION__ Release: 1%{?dist} Summary: A featureful FUSE based union filesystem Group: Applications/System License: ISC URL: https://github.com/trapexit/mergerfs Source: mergerfs-%{version}.tar.gz BuildRequires: gcc-c++ # rpmbuild driven by the Makefile uses git to generate a version number BuildRequires: git %global debug_package %{nil} %undefine _debuginfo_subpackages %global _enable_debug_packages 0 %prep %setup -q %description mergerfs is a union filesystem geared towards simplifying storage and management of files across numerous commodity storage devices. It is similar to mhddfs, unionfs, and aufs. %build make %{?_smp_mflags} CFLAGS="%{optflags}" CXXFLAGS="%{optflags}" LDFLAGS="%{__global_ldflags}" %install make install PREFIX=%{_prefix} DESTDIR=%{buildroot} %files /usr/bin/mergerfs /usr/bin/mergerfs-fusermount /usr/bin/fsck.mergerfs /usr/bin/mergerfs.collect-info /sbin/mount.mergerfs /usr/lib/mergerfs/preload.so %doc %{_mandir}/* %changelog * Fri Apr 26 2019 Antonio SJ Musumeci - Update description * Mon Jan 25 2016 Antonio SJ Musumeci - Remove sbin files * Sat Sep 05 2015 Antonio SJ Musumeci - Include PREFIX to install * Mon Dec 29 2014 Joe Lawrence - Tweak rpmbuild to archive current git HEAD into a tarball, then (re)build in the rpmbuild directory -- more complicated but seemingly better suited to generate source and debug rpms. * Fri Jun 20 2014 Joe Lawrence - Initial rpm spec file. mergerfs-2.42.0/mkdocs/0000755000000000000000000000000015177346257013410 5ustar rootrootmergerfs-2.42.0/mkdocs/README.md0000644000000000000000000000052115177346257014665 0ustar rootroot# mkdocs ## Getting started ```bash python3 -m venv venv source venv/bin/activate pip3 install --no-cache-dir mkdocs mkdocs-material pymdown-extensions mike mike serve ``` ## Deploy ```bash mike deploy --push --allow-empty ``` ## References * https://www.mkdocs.org/ * https://squidfunk.github.io/mkdocs-material/ mergerfs-2.42.0/mkdocs/build-venv0000755000000000000000000000022515177346257015410 0ustar rootroot#!/bin/sh set -x set -e python3 -m venv venv . ./venv/bin/activate pip3 install --no-cache-dir 'mkdocs<2.0' mkdocs-material pymdown-extensions mike mergerfs-2.42.0/mkdocs/docs/0000755000000000000000000000000015177346257014340 5ustar rootrootmergerfs-2.42.0/mkdocs/docs/benchmarking.md0000644000000000000000000001055115177346257017314 0ustar rootroot# Benchmarking Filesystems are complicated. They do many things and many of those are interconnected. Additionally, the OS, drivers, hardware, etc. can all impact performance. Therefore, when benchmarking, it is **necessary** that the test focuses as narrowly as possible. For most throughput is the key benchmark. To test throughput `dd` is useful but **must** be used with the correct settings in order to ensure the filesystem or device is actually being tested. The OS can and will cache data. Without forcing synchronous reads and writes and/or disabling caching the values returned will not be representative of the device's true performance. When benchmarking through mergerfs ensure you only use 1 branch to remove any possibility of the policies or differences in underlying filesystems complicating the situation. Benchmark the underlying filesystem first and then mount mergerfs with that same filesystem and that. Throughput **will be** lower but if you are experiencing speeds below your expectation you will need to narrow down precisely which component is leading to the slowdown. Preferably test the following in the order listed (but not combined). 1. Enable `nullrw` mode with `nullrw=true`. This will effectively make reads and writes no-ops. Removing the underlying device / filesystem from the equation. This will give us the top theoretical speeds. 2. Configure mergerfs to use a `tmpfs` branch. `tmpfs` is a RAM disk. Extremely high speed and very low latency. This is a more realistic best case scenario. Example: `mount -t tmpfs -o size=2G tmpfs /tmp/tmpfs` 3. Configure mergerfs to use a local device filesystem branch. NVMe, SSD, HDD, etc. Test them individually. If you have different interconnects / controllers use the same storage device when testing to ensure consistency. 4. Configure mergerfs to use any network filesystems you plan to use one at a time. It may also be worth trying a different network filesystem. `NFS` vs `CIFS/SMB/Samba` vs `sshfs`, etc. Once you find the component which has the performance issue you can do further testing with different options to see if they impact performance. If you find a specific system, device, filesystem, controller, etc. that performs poorly contact the author so it can be investigated further. Sometimes the problem is really the application accessing or writing data through mergerfs. Some software use small buffer sizes which can lead to more requests and therefore greater overhead. You can test this out yourself by replacing `bs=1M` in the examples below with `ibs` or `obs` and using a size of `512` instead of `1M`. In one example test using `nullrw` the write speed dropped from 4.9GB/s to 69.7MB/s when moving from `1M` to `512`. Similar results were had when testing reads. Small writes overhead may be improved by leveraging a write cache but in casual tests little gain was found. If you have an app that appears slow with mergerfs it could be due to this. `strace` can be used with the app in question or mergerfs to see the size of read/writes. Contact the software author or worse case the mergerfs author so it may be investigated further. ### Write Benchmark ``` $ dd if=/dev/zero of=/mnt/mergerfs/16GB.file bs=1M count=16384 oflag=nocache conv=fdatasync status=progress ``` ### Read Benchmark ``` $ dd if=/mnt/mergerfs/16GB.file of=/dev/null bs=1M iflag=nocache conv=fdatasync status=progress ``` ### fio `fio` is a popular and flexible benchmarking tool. Below are some basic tests but also try setting `--direct=0`, changing the `ioengine`, or playing with other options. #### Write ``` $ fio --name=writetest --filename=/mnt/mergerfs/16GB.file --size=16Gb --rw=write --bs=1M --direct=1 --numjobs=1 --iodepth=8 --group_reporting --runtime=60 --startdelay=0 --ioengine=psync ``` #### Read ``` $ fio --name=readtest --filename=/mnt/mergerfs/16GB.file --size=16Gb --rw=read --bs=1M --direct=1 --numjobs=1 --iodepth=8 --group_reporting --runtime=60 --startdelay=0 --ioengine=psync ``` ### Other Benchmarks If you are attempting to benchmark other behaviors you must ensure you clear kernel caches before runs. In fact it would be a good deal to run before the read and write benchmarks as well just in case. ``` sync echo 3 | sudo tee /proc/sys/vm/drop_caches ``` ## Additional Reading * [Tweaking Performance](performance.md) * [Options](config/options.md) * [Tips and Notes](tips_notes.md) mergerfs-2.42.0/mkdocs/docs/config/0000755000000000000000000000000015177346257015605 5ustar rootrootmergerfs-2.42.0/mkdocs/docs/config/branches-mount-timeout.md0000644000000000000000000000544115177346257022544 0ustar rootroot# branches-mount-timeout * type: `UINT` (seconds) * default: `0` mergerfs is compatible with any path, whether it be a mount point or a directory on your [root filesystem.](https://en.wikipedia.org/wiki/Root_directory) It doesn’t require branch paths to be mounted or to match a specific filesystem at startup, and it operates effectively without needing details about the intended filesystem. This flexibility eliminates the need to manage mount ordering, which is particularly advantageous on modern systems where filesystems are mounted asynchronously, resulting in unpredictable mount sequences. While [systemd](https://www.freedesktop.org/software/systemd/man/latest/systemd.mount.html) offers a way to enforce mount dependencies using the [x-systemd.requires=PATH](https://www.freedesktop.org/software/systemd/man/latest/systemd.mount.html#x-systemd.requires=) option in /etc/fstab, applying this to every branch path is both cumbersome and susceptible to errors. `branches-mount-timeout` will cause mergerfs to first attempt to mount each branch if the branch appears to be on the same filesystem as the `mergerfs` mount point and then wait for all branches to become "mounted." The logic to determine "mounted" is as follows. 1. It is mounted if the branch directory has the extended attribute `user.mergerfs.branch` 2. It is mounted if the branch directory contains a file named `.mergerfs.branch` 3. It is **not** mounted if the branch directory has the extended attribute `user.mergerfs.branch_mounts_here` 4. It is **not** mounted if the branch directory contains a file named `.mergerfs.branch_mounts_here` 5. It is mounted if the `st_dev` value of the mergerfs mount point is different from the branch path. These files and xattrs are used to help `mergerfs` know whether or not a directory happens to be a branch or is the underlying directory mount point. **NOTE:** If on a `systemd` based system and using `fstab` it is a good idea to set the mount option [x-systemd.mount-timeout](https://www.freedesktop.org/software/systemd/man/latest/systemd.mount.html#x-systemd.mount-timeout=) to some value longer than `branches-mount-timeout` otherwise `systemd` might kill `mergerfs` before it finishes waiting. **NOTE:** The way `mergerfs` attempts to mount the branch is by calling out to the system command `mount` with the branch as the target. If that path is configured in `/etc/fstab` as a mount point then `mount` should attempt to mount it with the settings defined in `fstab`. ## branches-mount-timeout-fail Default: `false` When set to `true` mergerfs will fail entirely after `branches-mount-timeout` expires without all branches being mounted. If set to `false` it will simply ignore the mount status of the branches and continue on. The details will be [logged](../error_handling_and_logging.md). mergerfs-2.42.0/mkdocs/docs/config/branches.md0000644000000000000000000001607715177346257017727 0ustar rootroot# branches The `branches` argument is a colon (':') delimited list of paths to be pooled together. It does not matter if the paths are on the same or different filesystems nor does it matter [the filesystem type](../faq/compatibility_and_integration.md/#what-filesystems-can-be-used-as-branches) (within reason). Used and available space metrics will not be duplicated for paths on the same filesystem and any features which aren't supported by the underlying filesystem (such as file attributes or extended attributes) will return the appropriate errors. Branches currently have two options which can be set. A [mode](#branch-mode) which impacts whether or not the branch is included in a policy calculation and a individual [minfreespace](#minfreespace) value. The values are set by prepending an `=` at the end of a branch designation and using commas as delimiters. Example: `/mnt/drive=RW,1234` ### branch mode - RW: (read/write) - Default behavior. Will be eligible in all policy categories. - RO: (read-only) - Will be excluded from `create` and `action` policies. Same as a read-only mounted filesystem would be (though faster to process). - NC: (no-create) - Will be excluded from `create` policies. You can't create on that branch but you can change or delete. ### minfreespace Same purpose and syntax as the [global option](minfreespace.md) but specific to the branch. Defaults to the global value. ### globbing To make it easier to include multiple branches mergerfs supports [globbing](http://linux.die.net/man/7/glob). **The globbing tokens MUST be escaped when using via the shell else the shell itself will apply the glob itself.** ``` # mergerfs /mnt/hdd\*:/mnt/ssd /media ``` The above line will use all directories in /mnt prefixed with **hdd** as well as **ssd**. To have the pool mounted at boot or otherwise accessible from related tools use `/etc/fstab`. ``` # /mnt/hdd*:/mnt/ssd /media mergerfs minfreespace=16G 0 0 ``` **NOTE:** The globbing is done at mount or when updated using the runtime API. If a new directory is added matching the glob after the fact it will not be automatically included. A convenient way to configure branches is to use [symlinks](../quickstart.md/#etcfstab-w-config-file). ## branch setup `mergerfs` does **not** require any special setup of branch paths in order to be used however here are some suggestions. ### layout When you have a large collection of storage devices, types of storage, and types of interconnects it can be useful to have a verbose naming convention. My preference is to create a directory within `/mnt/` for each major type of storage device and/or interconnect. `hdd` for traditional hard drives; `ssd` for slower SATA based SSDs; `nvme` for M.2 or U.2 NVME SSDs; `remote` for NFS, SMB, sshfs, etc. The mount points within those directories are named after the size of the storage and its serial number in the case of physical storage and the hostname and remote filesystem for remote. ``` $ ls -lh /mnt/ total 16K drwxr-xr-x 8 root root 4.0K Aug 18 2024 hdd drwxr-xr-x 6 root root 4.0K Oct 8 2024 nvme drwxr-xr-x 3 root root 4.0K Aug 24 2024 remote drwxr-xr-x 3 root root 4.0K Jul 14 2024 ssd $ ls -lh /mnt/hdd/ total 8K d--------- 2 root root 4.0K Apr 14 15:58 10T-01234567 d--------- 2 root root 4.0K Apr 12 20:51 20T-12345678 $ ls -lh /mnt/nvme/ total 8K d--------- 2 root root 4.0K Apr 14 16:00 1T-ABCDEFGH d--------- 2 root root 4.0K Apr 14 23:24 1T-BCDEFGHI $ ls -lh /mnt/remote/ total 8K d--------- 2 root root 4.0K Apr 12 20:23 foo-sshfs d--------- 2 root root 4.0K Apr 12 20:24 bar-nfs # You can find the serial number of a drive using lsblk $ lsblk -d -o NAME,PATH,SIZE,SERIAL NAME PATH SIZE SERIAL sda /dev/sda 9.1T 01234567 sdb /dev/sdb 18.2T 12345678 nvme0n1 /dev/nvme0n1 953.9G ABCDEFGH nvme1n1 /dev/nvme1n1 953.9G BCDEFGHI ``` ### permissions and mode #### mount points To ensure the directory is **only** used as a point to mount another filesystem it is good to lock it down as much as possible. Be sure to do this **before** mounting a filesystem to it. ``` $ sudo chown root:root /mnt/hdd/10T-XYZ $ sudo chmod 0000 /mnt/hdd/10T-XYZ $ sudo setfattr -n user.mergerfs.branch_mounts_here $ sudo chattr +i /mnt/hdd/10T-XYZ ``` The extended attribute `user.mergerfs.branch_mounts_here` is used by the [branches-mount-timeout](branches-mount-timeout.md) option to recognize whether or not a mergerfs branch path points to the intended filesystem. The `chattr` is likely to only work on EXT{2,3,4} filesystems but will restrict even `root` from modifying the directory or its content but is still able to be a mount point. #### mounted filesystems For those new to Linux, intending to be the primary individual logged into the system, or simply want to simplify permissions it is recommended to set the root of mounted filesystems like `/tmp/` is set to. Owned by `root`, `ugo+rwx` and [sticky bit](https://en.wikipedia.org/wiki/Sticky_bit) set. This must be done **after** mounting the filesystem to the target mount point. ``` $ sudo chown root:root /mnt/hdd/10T-SERIALNUM $ sudo chmod 1777 /mnt/hdd/10T-SERIALNUM $ sudo setfattr -n user.mergerfs.branch /mnt/hdd/10T-SERIALNUM ``` ### formatting While even less relevant to mergerfs than the details above the topic does com up regularly with mergerfs users. When it comes to partitioning and formatting it is suggested to keep things simple. Most users of mergerfs will be using the whole drive capacity and as such have a singular partition and filesystem on that partition. Something many people don't realize is that the partition is not necessary and actually can become problematic. Rather than creating paritions just format the block device. Let's use `/dev/sda` as an example. ``` $ lsblk -d -o NAME,PATH,SERIAL /dev/sda NAME PATH SERIAL sda /dev/sda 01234567 $ sudo mkfs.ext4 -m0 -L 01234567 /dev/sda mke2fs 1.47.0 (5-Feb-2023) Discarding device blocks: done Creating filesystem with 262144 4k blocks and 65536 inodes Filesystem UUID: ede8bf96-9aff-464e-a4fb-a4ab8a197cd7 Superblock backups stored on blocks: 32768, 98304, 163840, 229376 Allocating group tables: done Writing inode tables: done Creating journal (8192 blocks): done Writing superblocks and filesystem accounting information: done ``` You can then use the serial number as the identifier in `fstab`. ``` # LABEL=01234567 /mnt/hdd/10TB-01234567 auto nofail 0 2 ``` Benefits of doing it this way? * One less thing (partitions) to configure and worry about. * Guarantees alignment of blocks * Makes it easier to use the drive with different enclosures. Some SATA to USB adapters use 4K blocks while the drive itself is using 512b. If you create partitions with one block size and move the drive to a controller that uses the other the offset on the device where the filesystem starts will be misinterpreted. It is possible to manually fix this but it isn't well documented and avoidable. mergerfs-2.42.0/mkdocs/docs/config/cache.md0000644000000000000000000002030715177346257017174 0ustar rootroot# caching ## cache.files Controls how [page caching](https://en.wikipedia.org/wiki/Page_cache) works for mergerfs itself. Not the underlying filesystems. * `cache.files=off`: Disables page caching for mergerfs. * `cache.files=partial`: Enables page caching. Files are cached while open. * `cache.files=full`: Enables page caching. Files are cached across opens. * `cache.files=auto-full`: Enables page caching. Files are cached across opens if mtime and size are unchanged since previous open. Cache is dropped if mtime or size change on open. * `cache.files=per-process`: Enable page caching (equivalent to `cache.files=partial`) only for processes whose 'comm' name matches one of the values defined in cache.files.process-names. If the name does not match the file open is equivalent to `cache.files=off`. Generally, enabling the page cache actually *harms* performance[^1]. In part because it can lead to buffer bloat due to the kernel caching both the underlying filesystem's file content as well as the file through mergerfs. However, if you want to confirm performance differences it is recommended that you perform some benchmark to confirm which option works best for your setup. Why then would you want to enable page caching if it consumes ~2x the RAM as normal and is on average slower? Because it is the only way to support [mmap](https://man7.org/linux/man-pages/man2/mmap.2.html). `mmap` is a way for programs to treat a file as if it is a contiguous RAM buffer which is regularly used by a number of programs such as those that leverage **sqlite3**. Despite `mmap` not being supported by all filesystems it is unfortunately common for software to not have an option to use regular file IO instead of `mmap`. The good thing is that in Linux v6.6[^2] and above FUSE can now transparently enable page caching when mmap is requested. This means it should be safe to set `cache.files=off`. However, on Linux v6.5 and below you will need to configure `cache.files` as you need. If [passthrough.io](passthrough.md) is enabled so must page caching. mergerfs will set `cache.files=auto-full` if `passthrough.io` is enabled. And when using `passthrough.io` the there is no double page caching since it is in fact passing through the IO. [^1]: This is not unique to mergerfs and affects all FUSE filesystems. It is something that the FUSE community hopes to investigate at some point but as of early 2025 there are a number of major reworking going on with FUSE which needs to be finished first. [^2]: [https://kernelnewbies.org/Linux_6.6#FUSE](https://kernelnewbies.org/Linux_6.6#FUSE) ## cache.entry * `cache.entry=UINT`: Sets the number of seconds to cache entry queries. Defaults to `1`. The kernel must ask mergerfs about the existence of files. The entry cache caches that those details which limits the number of requests sent to mergerfs. The risk of setting this value, as with most any cache, is related to [out-of-band](https://en.wikipedia.org/wiki/Out-of-band) changes. If the filesystems are changed outside mergerfs there is a risk of files which have been removed continuing to show as available. It will fail gracefully if a phantom file is actioned on in some way so there is little risk in setting the value much higher. Especially if there are no out-of-band changes. ## cache.negative-entry * `cache.negative-entry=UINT`: Sets the number of seconds to cache negative entry queries. Defaults to `1`. This is a cache for negative entry query responses. Such as when a file which does not exist is referenced. The risk of setting this value, as with most any cache, is related to [out-of-band](https://en.wikipedia.org/wiki/Out-of-band) changes. If the filesystems are changed outside mergerfs there is a risk of files which have been added outside mergerfs not appearing correctly till the cache entry times out if there had been a request for the same name within mergerfs which didn't exist. This is mostly an inconvenience. ## cache.attr * `cache.attr=UINT`: Sets the number of seconds to cache file attributes. Defaults to `1`. This is a cache for file attributes and metadata such as that which is collected by the [stat](https://man7.org/linux/man-pages/man2/stat.2.html) system call which is used when you run commands such as `find` or `ls -lh`. As with other caches the risk of enabling the attribute cache is if changes are made to the file out-of-band there could be inconsistencies between the actual file and the cached details which could result in different issues depending on how the data is used. If the simultaneous writing of a file from inside and outside is unlikely then you should be safe. That said any simultaneous, uncoordinated manipulation of a file can lead to unexpected results. ## cache.statfs * `cache.statfs=UINT`: Sets the number of seconds to cache `statfs` calls used by policies. Defaults to `0`. A number of policies require looking up the available space of the branches being considered. This is accomplished by calling [statfs](https://man7.org/linux/man-pages/man2/statfs.2.html). This call however is a bit expensive so this cache reduces the overhead by limiting how often the calls are actually made. This will mean that if the available space of branches changed somewhat rapidly there is a risk of `create` or `mkdir` calls made within the timeout period ending up on the same branch. This however should even itself out over time. ## cache.symlinks * `cache.symlinks=BOOL`: Enable kernel caching of symlink values. Defaults to `false`. As of Linux v4.20 there is an ability to cache the value of symlinks so that the kernel does not need to make a request to mergerfs every single time a [readlink](https://man7.org/linux/man-pages/man2/readlink.2.html) request is made. While not a common usage pattern, if software very regularly queries symlink values, the use of this cache could significantly improve performance. mergerfs will not error if the kernel used does not support symlink caching. As with other caches the main risk in enabling it is if you are manipulating symlinks from both within and without the mergerfs mount. Should the value be changed outside of mergerfs then it will not be reflected in the mergerfs mount till the cached value is invalidated. ## cache.readdir * `cache.readdir=BOOL`: Enable kernel caching of readdir results. Defaults to `false`. As of Linux v4.20 it supports readdir caching. This can have a significant impact on directory traversal. Especially when combined with entry (`cache.entry`) and attribute (`cache.attr`) caching. If the kernel doesn't support readdir caching setting the option to true has no effect. This option is configurable at runtime via xattr user.mergerfs.cache.readdir. ## cache.writeback * `cache.writeback=BOOL`: Enable writeback cache. Defaults to `false`. When `cache.files` is enabled the default is for it to perform writethrough caching. This behavior won't help improve performance as each write still goes one for one through the filesystem. By enabling the FUSE writeback cache small writes *may* be aggregated by the kernel and then sent to mergerfs as one larger request. This can greatly improve the throughput for apps which write to files inefficiently. The amount the kernel can aggregate is limited by the size of a FUSE message. Read the [fuse-msg-size](fuse-msg-size.md) section for more details. There is a side effect as a result of enabling writeback caching. Underlying files won't ever be opened with O_APPEND or O_WRONLY. The former because the kernel then manages append mode and the latter because the kernel may request file data from mergerfs to populate the write cache. The O_APPEND change means that if a file is changed outside of mergerfs it could lead to corruption as the kernel won't know the end of the file has changed. That said any time you use caching you should keep from writing to the same file outside of mergerfs at the same time. Note that if an application is properly sizing writes then writeback caching will have little or no effect. It will only help with writes of sizes below the FUSE message size (128K on older kernels, 1M on newer). Even then its effectiveness might not be great. Given the side effects of enabling this feature it is recommended that its benefits be proved out with benchmarks. mergerfs-2.42.0/mkdocs/docs/config/deprecated_options.md0000644000000000000000000000204515177346257022003 0ustar rootroot# Deprecated Options These are old, deprecated options which may no longer have any function or have been replaced. **They should not be used.** * **allow_other**: mergerfs v2.35.0 and above sets this FUSE option automatically if running as root. * **async_read**: Use `async-read=true`. * **atomic_o_trunc**: Does nothing. * **attr_timeout**: Use [cache.attr](cache.md). * **auto_cache**: Use [cache.files=auto-full](cache.md). * **big_writes**: Does nothing. * **direct_io**: Use [cache.files=off](cache.md). * **entry_timeout**: Use [cache.entry](cache.md). * **hard_remove**: Does nothing. * **kernel_cache**: Use [cache.files=full](cache.md). * **negative_entry**: Use [cache.negative-entry](cache.md). * **remember**: Use `never-forget-nodes`. * **remember-nodes**: Use `never-forget-nodes`. * **noforget**: Use `never-forget-nodes`. * **nonempty**: Does nothing. * **splice_move**: Does nothing. * **splice_read**: Does nothing. * **splice_write**: Does nothing. * **sync_read**: Use `async-read=false`. * **use_ino**: Use [inodecalc](inodecalc.md). mergerfs-2.42.0/mkdocs/docs/config/export-support.md0000644000000000000000000000105715177346257021165 0ustar rootroot# export-support * `export-support=true|false` * Default: `true` In theory, this flag should not be exposed to the end user. It is a low-level FUSE flag which indicates whether or not the kernel can send certain kinds of messages to it for the purposes of using it with NFS. mergerfs does support these messages but due to bugs and quirks found in the kernel and mergerfs this option is provided just in case it is needed for debugging. Given that this flag is set when the FUSE connection is first initiated it is not possible to change during run time. mergerfs-2.42.0/mkdocs/docs/config/flush-on-close.md0000644000000000000000000000161615177346257020771 0ustar rootroot# flush-on-close By default, FUSE would issue a flush before the release of a file descriptor. This was considered a bit aggressive and a feature added to give the FUSE server the ability to choose when that happens. * `flush-on-close=always` * `flush-on-close=never` * `flush-on-close=opened-for-write` * Defaults to `opened-for-write`. For now it defaults to `opened-for-write` which is less aggressive than the behavior before this feature was added. It should not be a problem because the flush is really only relevant when a file is written to. Given flush is irrelevant for many filesystems in the future a branch specific flag may be added so only files opened on a specific branch would be flushed on close. ## References * [https://lkml.kernel.org/linux-fsdevel/20211024132607.1636952-1-amir73il@gmail.com/T/](https://lkml.kernel.org/linux-fsdevel/20211024132607.1636952-1-amir73il@gmail.com/T/) mergerfs-2.42.0/mkdocs/docs/config/follow-symlinks.md0000644000000000000000000000216715177346257021306 0ustar rootroot# follow-symlinks This feature, when enabled, will cause symlinks to be interpreted by mergerfs as their target. When there is a getattr/stat request for a file mergerfs will check if the file is a symlink and depending on the `follow-symlinks` setting will replace the information about the symlink with that of that which it points to. When unlink'ing or rmdir'ing the followed symlink it will remove the symlink itself and not that which it points to. * `follow-symlinks=never`: Behave as normal. Symlinks are treated as such. * `follow-symlinks=directory`: Resolve symlinks only which point to directories. * `follow-symlinks=regular`: Resolve symlinks only which point to regular files. * `follow-symlinks=all`: Resolve all symlinks to that which they point to. Symlinks which do not point to anything are left as is. * Defaults to `never`. **WARNING:** This feature should be considered experimental. There might be edge cases yet found. If you find any odd behaviors please file a ticket on [github](https://github.com/trapexit/mergerfs/issues/new?assignees=&labels=bug%2C+investigating&projects=&template=bug_report.md&title=). mergerfs-2.42.0/mkdocs/docs/config/func_readdir.md0000644000000000000000000000565315177346257020565 0ustar rootroot# func.readdir * type: `STR` * default: `seq` * examples: `func.readdir=seq`, `func.readdir=cor:4` `readdir` has policies to control how to read directory content. | Policy | Description | | ------ | ----------- | | seq | "sequential" : Iterate sequentially over branches in the order defined in `branches`. This is the default and traditional behavior found prior to the readdir policy introduction. This will be increasingly slower as more branches are added to the pool. Especially if needing to wait for drives to spin up or network filesystems to respond. | | cosr:N:M | "concurrent open, sequential read" : Concurrently open branch directories using a thread pool and process them in the order defined in `branches`. This keeps memory and CPU usage low while also reducing the time spent waiting on branches to respond. `N` is the number of threads. If negative it will be the core count divided by `abs(N)`. `M` is the queue depth. If either value is `0` it will be decided based on system configuration. | | cosr:N | cosr:N:M with M = 0 | | cosr | cosr:N:M with N = 0 and M = 0 | | cor:N:M | "concurrent open and read" : Concurrently open branch directories and immediately start reading their contents using a thread pool. This will result in slightly higher memory and CPU usage but reduced latency. Particularly when using higher latency / slower speed network filesystem branches. Unlike `seq` and `cosr` the order of files could change due the async nature of the thread pool. This should not be a problem since the order of files returned in not guaranteed. `N` is the number of threads. If negative it will be the core count divided by `abs(N)`. `M` is the queue depth. If either value is `0` it will be decided based on system configuration. | | cor:N | cosr:N:M with M = 0 | | cor | cosr:N:M with N = 0 and M = 0 | Keep in mind that `readdir` mostly just provides a list of file names in a directory and possibly some basic metadata about said files. To know details about the files, as one would see from commands like `find` or `ls`, it is required to call `stat` on the file which is controlled by `fuse.getattr`. Until Linux v6.16, despite being able to change the size of FUSE messages, `readdir` requests were limited to 1 page (4KiB) in size per message. This limitation limited throughput and therefore performance of the `readdir` call. In v6.16 that was changed to be able to grow to the [fuse-msg-size](fuse-msg-size.md) which allows a lot more data to be sent per request and therefore much better performance in certain situations. ## Technical Details * On Linux [getdents](https://man7.org/linux/man-pages/man2/getdents.2.html) is used instead of [readdir](https://man7.org/linux/man-pages/man2/readdir.2.html) in order to leverage larger buffers for better performance on larger directory reads as well as have more control in concurrent policies. * [readdir](https://man7.org/linux/man-pages/man2/readdir.2.html) is used on FreeBSD. mergerfs-2.42.0/mkdocs/docs/config/functions_categories_policies.md0000644000000000000000000002473115177346257024242 0ustar rootroot# functions, categories and policies The POSIX filesystem API is made up of a number of functions. `creat`, `stat`, `chown`, etc. For ease of configuration in mergerfs, most of the core functions are grouped into 3 categories: `action`, `create`, and `search`. These functions and categories can be assigned a policy which dictates which branch is chosen when performing that function. IE. When an application requests that a file or directory is created how should mergerfs decide which branch to choose to attempt the create? That is the policy. Some functions, listed in the category `N/A` below, can not be assigned the normal policies because they are directly related to a file which has already been opened. ## Functions and their Category classifications | Category | Functions | | -------- | --------- | | action | chmod, chown, link, removexattr, rename, rmdir, setxattr, truncate, unlink, utimens | | create | create, mkdir, mknod, symlink | | search | access, getattr, getxattr, ioctl (directories), listxattr, open, readlink | | N/A | fchmod, fchown, futimens, ftruncate, fallocate, fgetattr, fsync, ioctl (files), read, readdir, release, statfs, write, copy_file_range | In cases where something may be searched for (such as a path to clone) `getattr` will usually be used. ## Policies See below for [available policies and their descriptions](#policy-descriptions). A policy is an algorithm designed to select one or more branches for a function to operate on. Policies do not actually manage the filesystem or layout. They are strictly responsible for deciding which files or branches will be worked on in relation to the function being performed. Once the branch is chosen other parts of the system does what is necessary to accomplish the function. Such as the cloning of directories between branches. When using policies which are based on a branch's available space the branch base path provided is used. Not the full path to the file or directory in question. Meaning that mounts within the branch will not be considered in the space calculations. **NOTE:** While any policy can be assigned to a function or category, some may not be very useful in practice. For instance: `rand` (random) may be useful for file creation but could lead to very odd behavior if used for `chmod` if there were more than one copy of the file. Unless users find this flexibility useful it will likely be removed in the future. ## Filtering Most policies search branches and create a list of files / paths for functions to work on. The policy is responsible for filtering and sorting the branches. Filters include [minfreespace](minfreespace.md), whether or not a branch is mounted read-only, and the branch mode (RO,NC,RW). These filters are applied across most policies. - No `search` function policies filter. - All `action` function policies filter out branches which are mounted **read-only** or mode is **RO (read-only)**. - All `create` function policies filter out branches which are mounted **read-only**, mode **RO (read-only)** or **NC (no create)**, or has available space less than [minfreespace](minfreespace.md). Policies may have their own additional filtering such as those that require relative paths to be present. If all branches are filtered an error will be returned. Typically `EROFS` (read-only filesystem) or `ENOSPC` (no space left on device) depending on the most recent reason for filtering a branch. If `create`, `mkdir`, `mknod`, or `symlink` fail with `EROFS` or other fundamental errors then mergerfs will mark any branch found to be read-only as such (IE will set the mode `RO`) and will rerun the policy and try again. This is mostly for `ext4` filesystems that can suddenly become read-only when it encounters an error. ## Path Preservation Policies, as described below, are of two basic classifications. `path preserving` and `non-path preserving`. All policies which start with `ep` (`epff`, `eplfs`, `eplus`, `epmfs`, `eprand`) are `path preserving`. `ep` stands for `existing path`. A path preserving policy will only consider branches where the relative path being accessed already exists. With the `msp` or `most shared path` policies they are defined as `path preserving` for the purpose of controlling `link` and `rename`'s behaviors since `ignorepponrename` is available to disable that behavior. ## Policy descriptions A policy's behavior differs, as mentioned above, based on the function it is used with. Sometimes it really might not make sense to even offer certain policies because they are literally the same as others but it makes things a bit more uniform. | Policy | Description | | --------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | pfrd (percentage free random distribution) | Selects a branch randomly, with the probability of selection proportional to its available space relative to the total available space across all branches. For instance, if Branch A has 100 GB free and Branch B has 50 GB free, Branch A is twice as likely to be chosen. | | rand (random) | Calls **all** and then randomizes. Returns 1 branch. | | mfs (most free space) | Pick the branch with the most available free space. | | ff (first found) | Given the order of the branches, as defined at mount time or configured at runtime, act on the first one found. | | lfs (least free space) | Pick the branch with the least available free space. | | lup (least used percent) | Pick the branch with the least used percentage of space | | lus (least used space) | Pick the branch with the least used space. | | all | Search: For **mkdir**, **mknod**, and **symlink** it will apply to all branches. **create** works like **ff**. | | msppfrd (most shared path, percentage free random distribution) | Like **eppfrd** but if it fails to find a branch it will try again with the parent directory. Continues this pattern till finding one. | | mspmfs (most shared path, most free space) | Like **epmfs** but if it fails to find a branch it will try again with the parent directory. Continues this pattern till finding one. | | msplfs (most shared path, least free space) | Like **eplfs** but if it fails to find a branch it will try again with the parent directory. Continues this pattern till finding one. | | msplus (most shared path, least used space) | Like **eplus** but if it fails to find a branch it will try again with the parent directory. Continues this pattern till finding one. | | eppfrd (existing path, percentage free random distribution) | Like **pfrd** but limited to existing paths. | | epmfs (existing path, most free space) | Of all the branches on which the relative path exists choose the branch with the most free space. | | eprand (existing path, random) | Calls **epall** and then randomizes. Returns 1. | | epff (existing path, first found) | Given the order of the branches, as defined at mount time or configured at runtime, act on the first one found where the relative path exists. | | eplfs (existing path, least free space) | Of all the branches on which the relative path exists choose the branch with the least free space. | | eplus (existing path, least used space) | Of all the branches on which the relative path exists choose the branch with the least used space. | | epall (existing path, all) | For **mkdir**, **mknod**, and **symlink** it will apply to all found. **create** works like **epff** (but more expensive because it doesn't stop after finding a valid branch). | | newest | Pick the file / directory with the largest mtime. | **NOTE:** If you are using an underlying filesystem that reserves blocks such as ext2, ext3, or ext4 be aware that mergerfs respects the reservation by using `f_bavail` (number of free blocks for unprivileged users) rather than `f_bfree` (number of free blocks) in policy calculations. **df** does NOT use `f_bavail`, it uses `f_bfree`, so direct comparisons between **df** output and mergerfs' policies is not appropriate. ## Defaults | Category | Policy | | -------- | ------ | | action | epall | | create | pfrd | | search | ff | mergerfs-2.42.0/mkdocs/docs/config/fuse-msg-size.md0000644000000000000000000000470515177346257020633 0ustar rootroot# fuse-msg-size * type: `UINT|SIZE` * default: `1M` * example: `fuse-msg-size=1M` * If the value is a `SIZE` in the form of `xB`, `xK`, `xM`, `xG`, or `xT` then it will choose the closest multiple of the system page size. If the value is just an integer without a size multipler suffix then it is treated as a page count FUSE applications communicate with the kernel over a special character device: `/dev/fuse`. A large portion of the overhead associated with FUSE is the cost of going back and forth between user space and kernel space over that device. Generally speaking, the fewer trips needed the better the performance will be. Reducing the number of trips can be done a number of ways. Kernel level caching and increasing message sizes being two significant ones. When it comes to reads and writes if the message size is doubled the number of trips are approximately halved. In Linux v4.20 a new feature was added allowing the negotiation of the max message size. Since the size is in multiples of [pages](https://en.wikipedia.org/wiki/Page_(computer_memory)) the feature is called `max_pages`. In versions of Linux prior to v6.13 there is a maximum `max_pages` value of 256 (1MiB) and minimum of 1 (4KiB). In [Linux v6.13](https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=2b3933b1e0a0a4b758fbc164bb31db0c113a7e2c) and above the max value supported by the kernel can range from 1 (4KiB) to 65535 (~256MiB) (assuming a page size of 4KiB.) The default used by Linux >= 4.20, and hard coded value used before 4.20, is 32 (128KiB). In mergerfs it is referred to as `fuse-msg-size` to make it clear what it impacts and provide some abstraction. If the `fuse-msg-size` value provided is more than the system wide maximum mergerfs will attempt to increase the system wide value to keep the user from needing to set the value using `sysctl`, `/etc/sysctl.conf`, or `/proc/sys/fs/fuse/max_pages_limit`. The main downside to increasing the value is that memory usage will increase approximately relative to the number of [processing threads](threads.md) configured. Keep this in mind for systems with lower amounts of memory like most SBCs. Performance improvements seem to peak around 4MiB. On kernels before v4.20 the option has no effect. On kernels between v4.20 and v6.13 the max value is 256. On kernels >= v6.13 the maximum value is 65535. NOTE: If you intend to enable `cache.files` you should also set [readahead](readahead.md) to match `fuse-msg-size`. mergerfs-2.42.0/mkdocs/docs/config/inodecalc.md0000644000000000000000000001033515177346257020052 0ustar rootroot# inodecalc [Inodes](https://en.wikipedia.org/wiki/Inode) (`st_ino`) are unique identifiers for files within a filesystem. Each mounted filesystem also has a (typically) unique device ID (`st_dev`) as well and together they can uniquely identify a file on the whole of the system. Entries on the same device with the same inode are (generally) in fact references to the same underlying file. It is a many to one relationship between names and an inode. Directories, however, do not have multiple links on most systems due to the complexity that would add. FUSE allows the server (in this case `mergerfs`) to set inode values but not device IDs. Creating an inode value is somewhat complex in mergerfs' case as files aren't really in its control. If a policy changes what directory or file is to be selected or changes are made to branches out of band it becomes unclear what value should be used. Most software does not to care what the values are but those that do often break if a value changes unexpectedly. For instance: the tool `find` will abort a directory walk if it sees a directory inode change. NFS can return stale handle errors if the inode changes out-of-band. File dedup tools will usually leverage device ids and inodes as a shortcut in searching for duplicate files and would resort to full file comparisons should it find different inode values. mergerfs offers multiple ways to calculate the inode in hopes of covering different usecases. * `passthrough`: Passes through the underlying inode value. Mostly intended for testing as using this does not address any of the problems mentioned above and could confuse file deduplication software as inodes from different filesystems can be the same. * `path-hash`: Hashes the relative path of the entry in question. The underlying file's values are completely ignored. This means the inode value will always be the same for that file path. This is useful when using NFS and you make changes out of band such as copy data between branches. This also means that entries that do point to the same file will not be recognizable via inodes. That does not mean hard links don't work. They will. * `path-hash32`: 32bit version of path-hash. * `devino-hash`: Hashes the branch path and inode of the underlying entry. This won't prevent issues with NFS should the policy pick a different file or files move out of band but will present the same inode for underlying files that share the same inode. Previous releases of mergerfs used the device ID but that changes on reboot. The downside to using the branch path is inodes for files on the same underlying filesystem will be different. * `devino-hash32`: 32bit version of devino-hash. * `hybrid-hash`: Performs path-hash on directories and devino-hash on other file types. Since directories can't have hard links the static value won't make a difference and the files will get values useful for finding duplicates. Probably the best to use if not using NFS. As such it is the default. * `hybrid-hash32`: 32bit version of hybrid-hash. 32bit versions are provided as there is some software which does not handle 64bit inodes well. While there is a risk of hash collision in tests of a couple of million entries there were zero collisions. Unlike a typical filesystem FUSE filesystems can reuse inodes and not refer to the same entry. The internal identifier used to reference a file in FUSE is different from the inode value presented. The former is the nodeid and is actually a tuple of 2 64bit values: nodeid and generation. This tuple is not client facing. The inode that is presented to the client is passed through the kernel uninterpreted. From FUSE docs for `use_ino`: > Honor the st_ino field in the functions getattr() and > fill_dir(). This value is used to fill in the st_ino field > in the stat(2), lstat(2), fstat(2) functions and the d_ino > field in the readdir(2) function. The filesystem does not > have to guarantee uniqueness, however some applications > rely on this value being unique for the whole filesystem. > Note that this does *not* affect the inode that libfuse > and the kernel use internally (also called the "nodeid"). **NOTE:** As of version 2.35.0 the use_ino option has been removed. mergerfs should always be managing inode values. mergerfs-2.42.0/mkdocs/docs/config/kernel-permissions-check.md0000644000000000000000000000133315177346257023033 0ustar rootroot# kernel-permissions-check * `kernel-permissions-check=true|false` * Default: `true` [FUSE](https://www.kernel.org/doc./html/next/filesystems/fuse.html) has a feature which mergerfs leverages which allows the kernel to do file permission checking rather than leaving it to the FUSE server (in this case mergerfs.) This improves performance. However, it also limits flexibility. mergerfs should work fine regardless of this setting but there might be some currently unknown edge cases where disabling the feature might help. Like [export-support](export-support.md) this is mostly for debugging. This option is a kernel mount option so unable to be changed at runtime. It controls the `default_permissions` FUSE kernel option. mergerfs-2.42.0/mkdocs/docs/config/lazy-umount-mountpoint.md0000644000000000000000000000203115177346257022641 0ustar rootroot# lazy-umount-mountpoint * type: `BOOL` * default: `false` * example: `lazy-umount-mountpoint=true` When enabled mergerfs will issue a [lazy umount](https://man7.org/linux/man-pages/man8/umount.8.html) request to the mount point as it starts. ``` Lazy unmount. Detach the filesystem from the file hierarchy now, and clean up all references to this filesystem as soon as it is not busy anymore. ``` The value of using this is in situations where you wish to change options which can only be set at initialization or upgrade mergerfs itself. It also helps in the case of using `mount -a` which leads to a new instance of mergerfs being mounted due to it being unable to recognize that it is already mounted. In theory mergerfs could notice that an instance is already mounted at the mount point and attempt to use the runtime interface to modify the options and only mounting a new instance if the version has changed or initialization time only options are changed. However, given the relative rarity of this being an issue it isn't a priority. mergerfs-2.42.0/mkdocs/docs/config/link-cow.md0000644000000000000000000000072115177346257017652 0ustar rootroot# link-cow * `link-cow=true|false` * Defaults to `false` This feature offers similar functionality to what [cow-shell](https://manpages.ubuntu.com/manpages/noble/man1/cow-shell.1.html) offers. When enabled if mergerfs is asked to open a file to write and the link count on the file is greater than 1 it will copy the file to a temporary new file and then rename it over the original. This will atomically "break" the link. After that it will open the new file. mergerfs-2.42.0/mkdocs/docs/config/link-exdev.md0000644000000000000000000000124215177346257020174 0ustar rootroot# link-exdev If using path preservation and a `link` fails with `EXDEV` make a call to `symlink` where the target is the `oldlink` and the `linkpath` is the newpath. The target value is determined by the value of `link-exdev`. * `link-exdev=passthrough`: Return EXDEV as normal. * `link-exdev=rel-symlink`: A relative path from the newpath. * `link-exdev=abs-base-symlink`: An absolute value using the underlying branch. * `link-exdev=abs-pool-symlink`: An absolute value using the mergerfs mount point. * Defaults to `passthrough`. **NOTE:** It is possible that some applications check the file they link. In those cases, it is possible it will error or complain. mergerfs-2.42.0/mkdocs/docs/config/minfreespace.md0000644000000000000000000000150415177346257020570 0ustar rootroot# minfreespace default: `4G` `minfreespace` is used to set a minimum free space threshold when running create [policies](functions_categories_policies.md). Any branch with free space less than the `minfreespace` value will be skipped. This is the global default but individual branches can [have their own value.](branches.md#minfreespace). This is useful for a couple reasons. * Since mergerfs does not split files across branches it is best to leave space to write a newly created file on a branch to minimize the risk of running out of space and needing [moveonenospc](moveonenospc.md). * Some filesystems' performance degrades when filled. `minfreespace` provides a buffer so they are less likely to be filled. * Similar to `ext4`'s reserved space option it minimizes the problems that come from running out of space. mergerfs-2.42.0/mkdocs/docs/config/moveonenospc.md0000644000000000000000000000411115177346257020637 0ustar rootroot# moveonenospc When writing to a file a [number of errors](https://man7.org/linux/man-pages/man2/write.2.html#ERRORS) are possible. The `ENOSPC` error indicates their is no room for the data. That could be true due to the filesystem having actually no available space for data, or because a secondary resource (such as inodes) has been used up, or the filesystem might have a quota feature that is limiting how much storage a particular user may use, or (as on `ext4` there might be a feature which reserves space for privileged processes. Since mergerfs [does not offer](../index.md#non-features) splitting of files across filesystems there are situations where a file is opened or created on a filesystem which is nearly full and eventually receives a `ENOSPC` error despite the pool having capacity. The `moveonenospc` feature allows the user to have some control over this situation. When enabled and a `write` fails with `ENOSPC` or `EDQUOT` mergerfs will: 1. Run the policy defined by `moveonenospc` to find a target branch. 2. ["Move"](../faq/technical_behavior_and_limitations.md#how-does-mergerfs-handle-moving-and-copying-of-files) the file from the source branch to the target branch. 3. Retry the `write` and continue on as normal. If at any point something fails the progress so far will be cleaned up as appropriate and the original error returned. If `moveonenospc` is disabled the underlying error will be returned. NOTE: This feature has NO effect on policies. It ONLY applies to the literal write function. If the create function returns `ENOSPC` or the [policy returns `ENOSPC`](functions_categories_policies.md#filtering) that error will be returned back to the application making the `create` request. ## Additional Reading * [Functions, Categories, Policies](functions_categories_policies.md) * [Why do I get an "out of space" / "no space left on device" / ENOSPC error even though there appears to be lots of space available?](../faq/why_isnt_it_working.md#why-do-i-get-an-out-of-space-no-space-left-on-device-enospc-error-even-though-there-appears-to-be-lots-of-space-available) mergerfs-2.42.0/mkdocs/docs/config/nfsopenhack.md0000644000000000000000000000227015177346257020427 0ustar rootroot# nfsopenhack * `nfsopenhack=off`: No hack applied. * `nfsopenhack=git`: Apply hack if path includes `/.git/`. * `nfsopenhack=all`: Apply hack on all empty read-only files opened for writing. * Defaults to `off`. NFS is not fully POSIX compliant and historically certain behaviors, such as opening files with `O_EXCL`, are not or not well supported. When mergerfs (or any FUSE filesystem) is exported over NFS some of these issues come up due to how NFS and FUSE interact. This hack addresses the issue where the creation of a file with a read-only mode but with a read/write or write only flag. Normally this is perfectly valid but NFS chops the one open call into multiple calls. Exactly how it is translated depends on the configuration and versions of the NFS server and clients but it results in a permission error because a normal user is not allowed to open a read-only file as writable. Even though it's a more niche situation this hack breaks normal security and behavior and as such is `off` by default. If set to `git` it will only perform the hack when the path in question includes `/.git/`. `all` will result in it applying anytime a read-only file which is empty is opened for writing. mergerfs-2.42.0/mkdocs/docs/config/nullrw.md0000644000000000000000000000150415177346257017452 0ustar rootroot# nullrw * `nullrw=true|false` * Defaults to `false`. Due to how FUSE works there is an overhead to all requests made to a FUSE filesystem that wouldn't exist for an in kernel one. Meaning that even a simple passthrough will have some slowdown. However, generally the overhead is minimal in comparison to the cost of the underlying I/O. By disabling the underlying I/O we can test the theoretical performance boundaries. By enabling `nullrw` mergerfs will work as it always does **except** that all reads and writes will be no-ops. A write will succeed (the size of the write will be returned as if it were successful) but mergerfs does nothing with the data it was given. Similarly a read will return the size requested but won't touch the buffer. See the [benchmarking](../benchmarking.md) section for suggestions on how to test. mergerfs-2.42.0/mkdocs/docs/config/options.md0000644000000000000000000003125215177346257017625 0ustar rootroot# Options mergerfs has many options to control it many features. For the average use case the options listed in the [quickstart](../quickstart.md) are sufficient. Most options are related to operating system or filesystem related concepts so having a [basic background](../intro_to_filesystems.md) in such things is recommended for more advanced configurations. These option names and values are the same regardless of whether you use them with the `mergerfs` command line program, in fstab, or in a config file. ## types * BOOL = 'true' | 'false' * INT = [MIN_INT,MAX_INT] * UINT = [0,MAX_INT] * SIZE = 'NNM'; NN = INT, M = 'B' | 'K' | 'M' | 'G' | 'T' * PAGESIZE = UINT (representing number of pages) | SIZE (in bytes which will be converted to pages) * STR = string (may refer to an enumerated value, see details of argument) * FUNC = filesystem [function](functions_categories_policies.md) * CATEGORY = function [category](functions_categories_policies.md) * POLICY = mergerfs function [policy](functions_categories_policies.md) ## mount options * **config**: Path to a config file. Same arguments as below in `key` or `key=val` style format. `#` used for comments. * **[branches](branches.md)**: Colon delimited list of branches. Used primarily in a config file. * **mountpoint=DIRPATH**: The path to the mountpoint. Used primarily in a config file. * **[branches-mount-timeout](branches-mount-timeout.md)=UINT**: Number of seconds to wait at startup for branches to be a mount other than the mountpoint's filesystem. (default: 0) * **[branches-mount-timeout-fail](branches-mount-timeout.md#branches-mount-timeout-fail)=BOOL**: If set to `true` then if `branches-mount-timeout` expires it will exit rather than continuing. (default: false) * **[minfreespace](minfreespace.md)=SIZE**: The minimum available space of a branch necessary to be considered for a create [policy](functions_categories_policies.md). This is a default value applied to all branches and can be overwritten when configuring [branches](branches.md). Understands 'K', 'M', and 'G' to represent kilobyte, megabyte, and gigabyte respectively. (default: 4G) * **[moveonenospc](moveonenospc.md)=BOOL|POLICY**: When enabled if a **write** fails with **ENOSPC** (no space left on device) or **EDQUOT** (disk quota exceeded) the policy selected will run to find a new location for the file. An attempt to move the file to that branch will occur (keeping all metadata possible) and if successful the original is unlinked and the write retried. (default: pfrd) * **[inodecalc](inodecalc.md)=passthrough|path-hash|devino-hash|hybrid-hash**: Selects the inode calculation algorithm. (default: hybrid-hash) * **dropcacheonclose=BOOL**: When a file is requested to be closed call `posix_fadvise` on it first to instruct the kernel that we no longer need the data and it can drop its cache. Recommended when **cache.files=partial|full|auto-full|per-process** to limit double caching. (default: false) * **direct-io-allow-mmap=BOOL**: On newer kernels (>= 6.6) it is possible to disable file page caching while still allowing for shared mmap support. mergerfs will enable this feature if available but an option is provided to turn it off for testing and debugging purposes. (default: true) * **[symlinkify](symlinkify.md)=BOOL**: When enabled and a file is not writable and its mtime or ctime is older than **symlinkify_timeout** files will be reported as symlinks to the original files. Please read more below before using. (default: false) * **[symlinkify-timeout](symlinkify.md)=UINT**: Time to wait, in seconds, to activate the **symlinkify** behavior. (default: 3600) * **nullrw=BOOL**: Turns reads and writes into no-ops. The request will succeed but do nothing. Useful for benchmarking mergerfs. (default: false) * **lazy-umount-mountpoint=BOOL**: mergerfs will attempt to "lazy umount" the mountpoint before mounting itself. Useful when performing live upgrades of mergerfs. May not work on FreeBSD. (default: false) * **ignorepponrename=BOOL**: Ignore path preserving on rename. Typically rename and link act differently depending on the policy of `create` (read below). Enabling this will cause rename and link to always use the non-path preserving behavior. This means files, when renamed or linked, will stay on the same filesystem. (default: false) * **[export-support](export-support.md)=BOOL**: Sets a low-level FUSE feature intended to indicate the filesystem can support being exported via NFS. (default: true) * **[kernel-permissions-check](kernel-permissions-check.md)=BOOL**: Controls the FUSE `default_permissions` option. Primarily for debugging. (default: true) * **security-capability=BOOL**: If false return ENOATTR when xattr security.capability is queried. (default: true) * **[xattr](xattr.md)=passthrough|noattr|nosys**: Runtime control of xattrs. Default is to passthrough xattr requests. 'noattr' will short circuit as if nothing exists. 'nosys' will respond with ENOSYS as if xattrs are not supported or disabled. (default: passthrough) * **[link-cow](link-cow.md)=BOOL**: When enabled if a regular file is opened which has a link count > 1 it will copy the file to a temporary file and rename over the original. Breaking the link and providing a basic copy-on-write function similar to cow-shell. (default: false) * **[statfs](statfs.md)=base|full**: Controls how statfs works. 'base' means it will always use all branches in statfs calculations. 'full' is in effect path preserving and only includes branches where the path exists. (default: base) * **statfs-ignore=none|ro|nc**: 'ro' will cause statfs calculations to ignore available space for branches mounted or tagged as 'read-only' or 'no create'. 'nc' will ignore available space for branches tagged as 'no create'. (default: none) * **nfsopenhack=off|git|all**: A workaround for exporting mergerfs over NFS where there are issues with creating files for write while setting the mode to read-only. (default: off) * **[follow-symlinks](follow-symlinks.md)=never|directory|regular|all**: Turns symlinks into what they point to. (default: never) * **[link-exdev](link-exdev.md)=passthrough|rel-symlink|abs-base-symlink|abs-pool-symlink**: When a link fails with EXDEV optionally create a symlink to the file instead. * **[rename-exdev](rename-exdev.md)=passthrough|rel-symlink|abs-symlink**: When a rename fails with EXDEV optionally move the file to a special directory and symlink to it. * **[readahead](readahead.md)=UINT**: Set readahead (in kilobytes) for mergerfs and branches if greater than 0. (default: 0) * **posix-acl=BOOL**: Enable POSIX ACL support (if supported by kernel and underlying filesystem). (default: false) * **async-read=BOOL**: Perform reads asynchronously. If disabled or unavailable the kernel will ensure there is at most one pending read request per file handle and will attempt to order requests by offset. (default: true) * **[fuse-msg-size](fuse-msg-size.md)=PAGESIZE**: Set the max number of pages per FUSE message. Only available on Linux >= 4.20 and ignored otherwise. (min: 1; max: 65535; default: "1M") * **[read-thread-count](threads.md)=INT**: Number of threads to use. When used alone (`process-thread-count=-1`) it sets the number of threads reading and processing FUSE messages. When used together it sets the number of threads reading from FUSE. When set to zero it will attempt to discover and use the number of logical cores. If the thread count is set negative it will look up the number of cores then divide by the absolute value. ie. threads=-2 on an 8 core machine will result in 8 / 2 = 4 threads. There will always be at least 1 thread. If set to -1 in combination with `process-thread-count` then it will try to pick reasonable values based on CPU thread count. NOTE: higher number of threads increases parallelism but usually decreases throughput. (default: 0) * **[process-thread-count](threads.md)=INT**: Enables separate thread pool to asynchronously process FUSE requests. In this mode `read-thread-count` refers to the number of threads reading FUSE messages which are dispatched to process threads. -1 means disabled otherwise acts like `read-thread-count`. (default: -1) * **[process-thread-queue-depth](threads.md)=UINT**: Sets the number of requests any single process thread can have queued up at one time. Meaning the total memory usage of the queues is queue depth multiplied by the number of process threads plus read thread count. 0 sets the depth to the same as the process thread count. (default: 2) * **[pin-threads](pin-threads.md)=STR**: Selects a strategy to pin threads to CPUs (default: unset) * **[flush-on-close](flush-on-close.md)=never|always|opened-for-write**: Flush data cache on file close. Mostly for when writeback is enabled or merging network filesystems. (default: opened-for-write) * **scheduling-priority=INT**: Set mergerfs' scheduling priority. Valid values range from -20 to 19. See `setpriority` man page for more details. (default: -10) * **[proxy-ioprio](proxy-ioprio.md)=BOOL**: Use ioprio value from calling threads when reading and writing. (default: false) * **fsname=STR**: Sets the name of the filesystem as seen in **mount**, **df**, etc. Defaults to a list of the source paths concatenated together with the longest common prefix removed. * **[func.FUNC](functions_categories_policies.md)=POLICY**: Sets the specific FUSE function's policy. See below for the list of value types. Example: **func.getattr=newest** * **[func.readdir](func_readdir.md)=seq|cosr|cor|cosr:INT|cor:INT**: Sets `readdir` policy. INT value sets the number of threads to use for concurrency. (default: seq) * **[category.action](functions_categories_policies.md)=POLICY**: Sets policy of all FUSE functions in the action category. (default: epall) * **[category.create](functions_categories_policies.md)=POLICY**: Sets policy of all FUSE functions in the create category. (default: pfrd) * **[category.search](functions_categories_policies.md)=POLICY**: Sets policy of all FUSE functions in the search category. (default: ff) * **[cache.statfs](cache.md#cachestatfs)=UINT**: 'statfs' cache timeout in seconds. (default: 0) * **[cache.attr](cache.md#cacheattr)=UINT**: File attribute cache timeout in seconds. (default: 1) * **[cache.entry](cache.md#cacheentry)=UINT**: File name lookup cache timeout in seconds. (default: 1) * **[cache.negative-entry](cache.md#cachenegative-entry)=UINT**: Negative file name lookup cache timeout in seconds. (default: 0) * **[cache.files](cache.md#cachefiles)=off|partial|full|auto-full|per-process**: File page caching mode (default: off) * **cache.files.process-names=LIST**: A pipe | delimited list of process [comm](https://man7.org/linux/man-pages/man5/proc.5.html) names to enable page caching for when `cache.files=per-process`. (default: "rtorrent|qbittorrent-nox") * **[cache.writeback](cache.md#cachewriteback)=BOOL**: Enable kernel writeback caching (default: false) * **[cache.symlinks](cache.md#cachesymlinks)=BOOL**: Cache symlinks (if supported by kernel) (default: false) * **[cache.readdir](cache.md#cachereaddir)=BOOL**: Cache readdir (if supported by kernel) (default: false) * **parallel-direct-writes=BOOL**: Allow the kernel to dispatch multiple, parallel (non-extending) write requests for files opened with `cache.files=per-process` (if the process is not in `process-names`) or `cache.files=off`. (Is a kernel feature added in v6.2) (default: true) * **[passthrough.io](passthrough.md)=ENUM**: Enable [FUSE IO passthrough](https://kernelnewbies.org/Linux_6.9#Faster_FUSE_I.2FO) if available. (default: off) * **passthrough.max-stack-depth=INT**: Set to `1` another filesystem can be stacked on mergerfs. Set to `2` to have mergerfs stacked over another filesystem. (default: 1) * **never-forget-nodes=BOOL**: Keep the internal representation of a file after the OS tells mergerfs it is no longer needed, until the node is unlinked, removed, or replaced. Really only needed for [exporting mergerfs via NFS](../remote_filesystems.md). Formerly `noforget`. (default: false) * **allow-idmap=BOOL**: Enables idmap (identity mapping). (default: true) * **debug**: Enable debugging information. At the moment limited to a FUSE message trace saved to `log.file`. (default: false) * **log.file**: The file path for the FUSE message trace. Empty string will set to stderr. (default: stderr) **NOTE:** Options are evaluated in the order listed so if the options are **func.rmdir=rand,category.action=ff** the **action** category setting will override the **rmdir** setting. **NOTE:** Always look at the documentation for the version of mergerfs you're using. Not all features are available in older releases. mergerfs-2.42.0/mkdocs/docs/config/passthrough.md0000644000000000000000000001165215177346257020503 0ustar rootroot# passthrough.io * default: `off` * arguments: * `off`: Passthrough is never enabled. * `ro`: Only enable IO passthrough when file opened for reading only. * `wo`: Only enable IO passthrough when file opened for writing only. * `rw`: Enable IO passthrough when file opened for reading, writing, or both. In [Linux 6.9](https://kernelnewbies.org/Linux_6.9#Faster_FUSE_I.2FO) a IO passthrough feature was added to FUSE. Typically `mergerfs` has to act as an active proxy for all read and write requests. This results in, at times, significant overhead compared to direct interaction with the underlying filesystems. Not because `mergerfs` is doing anything particularly slow but because the additional communication and data transfers required. With the `passthrough.io` feature `mergerfs` is able to instruct the kernel to perform reads and writes directly on the underlying file. Bypassing `mergerfs` entirely (specifically and only for reads and writes) and thereby providing near native performance. This performance does come at the cost of some functionality as `mergerfs` no longer has control over reads and writes which means all features related to read/write are affected. * [moveonenospc](moveonenospc.md): Does not work because errors are not reported back to `mergerfs`. * nullrw: Since `mergerfs` no longer receives read/write requests there is no read or write to ignore. * [readahead](readahead.md): Still affects the `readahead` values of underlying filesystems and `mergerfs` itself but no longer relevant to `mergerfs` in that it is not servicing IO requests. * [fuse-msg-size](fuse-msg-size.md): The primary reason to increase the FUSE message size is to allow transferring more data per request which helps improve read and write performance. Without read/write requests being sent to `mergerfs` there is little reason to have larger message sizes since the only other message larger than 1 page, directory reading, currently has a small fixed buffer size. * parallel-direct-writes: Not only is `direct-io` and `passthrough.io` mutually exclusive but since `mergerfs` no longer receives write requests in passthrough mode then there is no parallel writes possible. * [cache.writeback](cache.md): FUSE's writeback caching is incompatible with `passthrough.io`. If `cache.writeback=true` when enabling `passthrough.io` it will be reset to `false`. * [cache.files](cache.md): Must be enabled for `passthrough.io` to work. When `cache.files=off` FUSE's `direct-io` mode is enabled which overrides `passthrough.io`. Meaning `cache.files` should be set to `partial`, `full` or `auto-full` to use `passthrough.io`. If `cache.files` is set to `off` when using `passthrough.io` it will reset it to `auto-full`. Technically `mergerfs` has the ability to choose options like `passthrough.io`, `direct-io`, and page caching independently for every file opened. However, at the moment there is no use case for picking and choosing which to enable outside `cache.files=per-process` (which is largely unnecessary on Linux v6.6 and above. See [direct-io-allow-mmap](options.md)) If such a use case arises please [reach out to the author](../support.md) to discuss. Unlike [preload.so](../tooling.md#preloadso), `passthrough.io` will work for any software interacting with `mergerfs`. However, `passthrough.io` requires Linux v6.9 or above to work. **NOTE:** This feature will **ONLY** work if `mergerfs` is running as `root` as currently only `root` is allowed to leverage the kernel feature. **NOTE:** If a file has been opened and `passthrough.io` enabled, while that file is open, if another open request is made `mergerfs` must also enable `passthrough.io` for the second open request. This is a limitation of how the passthrough feature works. **NOTE:** In order to add `passthrough.io` feature to `mergerfs` it was necessary to remove the "feature" where mergerfs could open the same file on different branches. Such as using `func.open=rand` and having multiple files at the same relative path across different branches. This "feature" was very very rarely used and it was impossible to support `passthrough.io` without changing that behavior. ## Alternatives * [preload.so](../tooling.md#preloadso): Leverages the ability to intercept certain filesystem calls to bypass `mergerfs` for IO. See page for details and limitations. ## Benchmarks Simple `dd` based benchmark on a Hades Canyon (Intel i7-8809G, 32GB DDR4-2400 RAM). ``` # /mnt/test is mergerfs over a single tmpfs mount dd if=/dev/zero of=/mnt/test/tmpfile bs=1M count=2000 oflag=nocache conv=fdatasync status=progress ``` Summary: passthrough is ~95% native speed. 200% faster than `direct-io` (cache.files=off). * straight to tmpfs: 1.7 GB/s * nullrw=true: 2.1 GB/s * cache.files=off; passthrough.io=off: 800 MB/s * cache.files=auto-full; passthrough.io=rw: 1.6 GB/s * cache.files=auto-full; cache.writeback=false: 518 MB/s * cache.files=auto-full; cache.writeback=true: 518 MB/s mergerfs-2.42.0/mkdocs/docs/config/pin-threads.md0000644000000000000000000000213415177346257020345 0ustar rootroot# pin-threads Simple strategies for pinning read and/or process threads. If process threads are not enabled then the strategy simply works on the read threads. Invalid values are ignored. * `pin-threads=R1L`: All read threads pinned to a single logical CPU. * `pin-threads=R1P`: All read threads pinned to a single physical CPU. * `pin-threads=RP1L`: All read and process threads pinned to a single logical CPU. * `pin-threads=RP1P`: All read and process threads pinned to a single physical CPU. * `pin-threads=R1LP1L`: All read threads pinned to a single logical CPU, all process threads pinned to a (if possible) different logical CPU. * `pin-threads=R1PP1P`: All read threads pinned to a single physical CPU, all process threads pinned to a (if possible) different logical CPU. * `pin-threads=RPSL`: All read and process threads are spread across all logical CPUs. * `pin-threads=RPSP`: All read and process threads are spread across all physical CPUs. * `pin-threads=R1PPSP`: All read threads are pinned to a single physical CPU while process threads are spread across all other physical CPUs. mergerfs-2.42.0/mkdocs/docs/config/proxy-ioprio.md0000644000000000000000000000401015177346257020602 0ustar rootroot# proxy-ioprio * type: `BOOL` * default: `false` * example: `proxy-ioprio=true` In Linux certain process schedulers have the ability to [prioritize](https://man7.org/linux/man-pages/man2/ioprio_set.2.html) based on a per thread [IO priority](https://www.kernel.org/doc/Documentation/block/ioprio.txt) assigned to the software by users using tools such as [ionice](https://man7.org/linux/man-pages/man1/ionice.1.html). Since such details are not provided by the FUSE protocol, users may not use schedulers which support IO priority, and the extra overhead to query the priority and set it within mergerfs it does not by default attempt to mirror/proxy the value. When enabled however, for all read and write requests, mergerfs will query the priority of the requesting process/thread and set the same value on the thread within mergerfs making the read/write. This may be useful in situation where the system has high IO load or processes are known to have varying priorities. See the [man page](https://man7.org/linux/man-pages/man2/ioprio_set.2.html) for specific details. Keep in mind that if no IO scheduler has been set for a thread then by default the IO priority will match the CPU nice value which for mergerfs is set by [scheduling-priority](options.md). [Nice value](https://man7.org/linux/man-pages/man2/getpriority.2.html) proxying may be added in a future release. ## Conflicts With Other Options If using [IO passthrough](passthrough.md) there is no reason to set this value to `true`. However, since `passthrough.io` leads to mergerfs IO calls being bypassed entirely will have no impact on performance or behavior regardless. When using `passthrough.io` the IO priority of the client app would be used directly given the IO is passed through. ## Supported Platforms Only Linux. This is not supported on FreeBSD. ## Performance Impact Despite the additional syscalls requires the impact appears undetectable with larger buffer sizes. At very small buffer sizes (such as 512 bytes) there is a noticable but small impact (~1.5%). mergerfs-2.42.0/mkdocs/docs/config/readahead.md0000644000000000000000000000336515177346257020034 0ustar rootroot# readahead Sets the mergerfs and underlying filesystem `readahead` values. The value unit is in kibibytes. * `readahead=1024` While the max size of messages sent between the kernel and mergerfs is configurable via the [fuse-msg-size](fuse-msg-size.md) option that doesn't mean that is the size used by the kernel for read and writes. Linux has a max read/write size of 2GB. Since the max FUSE message size is just over 1MiB (by default on more recent kernels) the kernel will break up read and write requests with buffers larger than that 1MiB. When page caching is disabled (`cache.files=off`), besides the kernel breaking up requests with larger buffers, requests are effectively one for one to mergerfs. A read or write request for X bytes is made to the kernel and a request for X bytes is made to mergerfs. No [readahead](https://en.wikipedia.org/wiki/Readahead) behavior will occur because there is no page cache available for it to store that data. In FUSE this is referred to as "direct IO". Note that "direct IO" is not the same as `O_DIRECT`. When page caching is enabled the kernel can and will utilize `readahead`. However, there are two values which impact the size of the `readahead` requests. The filesystem's `readahead` value and the FUSE `max_readahead` value. Whichever is lowest is used. The default `max_readahead` in mergerfs is maxed out meaning only the filesystem `readahead` value is relevant. Preferably this value would be set by the user externally since it is a generic feature but there is no standard way to do so mergerfs added this feature to make it easier to set. There is currently no way to set separate values for different branches through mergerfs. In fact at some point the feature may be changed to only set mergerfs' readahead. mergerfs-2.42.0/mkdocs/docs/config/rename-exdev.md0000644000000000000000000000146315177346257020513 0ustar rootroot# rename-exdev If using path preservation and a `rename` fails with `EXDEV`: 1. Move file from `/branch/a/b/c` to `/branch/.mergerfs_rename_exdev/a/b/c`. 2. symlink the rename's `newpath` to the moved file. The `target` value is determined by the value of `rename-exdev`. * `rename-exdev=passthrough`: Return `EXDEV` as normal. * `rename-exdev=rel-symlink`: A relative path from the `newpath`. * `rename-exdev=abs-symlink`: An absolute value using the mergerfs mount point. * Defaults to `passthrough`. **NOTE:** It is possible that some applications check the file they rename. In those cases it is possible it will error or complain. **NOTE:** The reason `abs-symlink` is not split into two like `link-exdev` is due to the complexities in managing absolute base symlinks when multiple `oldpaths` exist. mergerfs-2.42.0/mkdocs/docs/config/rename_and_link.md0000644000000000000000000000605615177346257021244 0ustar rootroot# rename and link `rename` and `link` are arguably the most complicated functions to create in a union filesystem. `rename` only works within a single filesystem or device. If a `rename` can not be done due to the source and destination paths existing on different mount points it will return an error (EXDEV, cross device / improper link). So if a `rename`'s source and target are on different filesystems within the pool it creates an issue. Originally mergerfs would return EXDEV whenever a rename was requested which was cross directory in any way. This made the code simple and was technically compliant with POSIX requirements. However, many applications fail to handle EXDEV at all and treat it as a normal error or otherwise handle it poorly. Such apps include: gvfsd-fuse v1.20.3 and prior, Finder / CIFS/SMB client in Apple OSX 10.9+, NZBGet, Samba's recycling bin feature. As a result a compromise was made in order to get most software to work while still obeying mergerfs' policies. The behavior is explained below. * If using a **create** policy which tries to preserve directory paths (epff,eplfs,eplus,epmfs) * Using the **rename** policy get the list of files to rename * For each file attempt rename: * If failure with ENOENT (no such file or directory) run **create** policy * If create policy returns the same branch as currently evaluating then clone the path * Re-attempt rename * If **any** of the renames succeed the higher level rename is considered a success * If **no** renames succeed the first error encountered will be returned * On success: * Remove the target from all branches with no source file * Remove the source from all branches which failed to rename * If using a **create** policy which does **not** try to preserve directory paths * Using the **rename** policy get the list of files to rename * Using the **getattr** policy get the target path * For each file attempt rename: * If the target path does not exist on the source branch: * Clone target path from target branch to source branch * rename * If **any** of the renames succeed the higher level rename is considered a success * If **no** renames succeed the first error encountered will be returned * On success: * Remove the target from all branches with no source file * Remove the source from all branches which failed to rename The removals are subject to normal entitlement checks. If the unlink fails it will fail silently. The above behavior will help minimize the likelihood of EXDEV being returned but it will still be possible. **link** uses the same strategy but without the removals. ## Additional Reading * [Do hardlinks work?](../faq/technical_behavior_and_limitations.md#do-hard-links-work) * [How does mergerfs handle moving and copying of files?](../faq/technical_behavior_and_limitations.md#how-does-mergerfs-handle-moving-and-copying-of-files) * [Why are file moves and renames failing?](../faq/why_isnt_it_working.md#why-are-file-moves-renames-linkshard-links-failing) mergerfs-2.42.0/mkdocs/docs/config/statfs.md0000644000000000000000000000213215177346257017431 0ustar rootroot# statfs / statvfs * `statfs=base`: Aggregate details from all branches using their base directory. * `statfs=full`: Aggregate details using the full path of the file requested. Limiting it to only branches where the file exists. * Defaults to `base`. [statvfs](http://linux.die.net/man/2/statvfs) normalizes the source filesystems based on the fragment size and sums the number of adjusted blocks and inodes. This means you will see the combined space of all sources. Total, used, and free. The sources however are dedupped based on the filesystem so multiple sources on the same drive will not result in double counting its space. Other filesystems mounted further down the tree of the branch will not be included when checking the mount's stats. ## statfs_ignore Modifies how `statfs` works. Will cause it to ignore branches of a certain mode. * `statfs_ignore=none`: Include all branches. * `statfs_ignore=ro`: Ignore available space for branches mounted as read-only or have a mode `RO` or `NC`. * `statfs_ignore=nc`: Ignore available space for branches with a mode of `NC`. * Defaults to `none`. mergerfs-2.42.0/mkdocs/docs/config/symlinkify.md0000644000000000000000000000202515177346257020324 0ustar rootroot# symlinkify * `symlinkify=true|false` * Defaults to `false`. Due to the levels of indirection introduced by mergerfs and the underlying technology FUSE there can be varying levels of performance degradation. This feature will turn non-directories which are not writable into symlinks to the original file found by the `readlink` policy after the mtime and ctime are older than the timeout. **WARNING:** The current implementation has a known issue in which if the file is open and being used when the file is converted to a symlink then the application which has that file open will receive an error when using it. This is unlikely to occur in practice but is something to keep in mind. **WARNING:** Some backup solutions, such as CrashPlan, do not backup the target of a symlink. If using this feature it will be necessary to point any backup software to the original filesystems or configure the software to follow symlinks if such an option is available. Alternatively, create two mounts. One for backup and one for general consumption. mergerfs-2.42.0/mkdocs/docs/config/threads.md0000644000000000000000000000442415177346257017565 0ustar rootroot# threads There are multiple thread pools used in mergerfs to provide parallel behaviors. ## read-thread-count Defaults to `0` The number of threads used to read messages from the kernel. If used alone processing will be done on the same thread. If `process-thread-count` is enabled then this thread pool will read messages and the process thread pool will do the work. This can increase how much mergerfs can process at one time but may reduce throughput. * `read-thread-count=0` and `process-thread-count=-1`: Create `1` read+process thread per logical CPU core upto `8`. * `read-thread-count=N` where `N>0` and `process-thread-count=-1`: Create a thread pool of `N` read+process threads. * `read-thread-count=N` where `N<0` and `process-thread-count=-1`: Create a read+process thread pool of `CPUCount / -N` threads. Minimum of `1`. * `read-thread-count=0` and `process-thread-count=0`: Create `2` read threads and a process thread per logical CPU core upto `8`. * `read-thread-count=0` and `process-thread-count!=-1`: Creates `2` read threads and number of process threads as defined below. ## process-thread-count Defaults to `-1` When enabled this sets the number of threads in the message processing pool. * `process-thread-count=-1`: Process thread pool is disabled. * `process-thread-count=0`: Create `1` thread process thread per logical CPU core upto `8`. * `process-thread-count=N` where `N>0`: Create a thread pool of `N` threads. * `process-thread-count=N` where `N<-1`: Create a thread pool of `CPUCount / -N` threads. Minimum of 1. ## process-thread-queue-depth Defaults to `2` Sets the depth queue for the processing thread queue per thread. Meaning if the read threads are getting requests faster than can be processed they will be queued up upto the queue depth. Despite the calculation being per thread the queue depth is shared across all in the pool. * `process-thread-queue-depth=N` where `N>0`: Sets the number of outstanding requests that the process thread pool can have to `N * process-thread-count`. If requests come in faster than can be processed and the max queue depth hit then queuing the request will block in order to limit memory growth. * `process-thread-queue-depth<=0`: Sets the queue depth to 2. May be used in the future to set dynamically. mergerfs-2.42.0/mkdocs/docs/config/xattr.md0000644000000000000000000000252215177346257017272 0ustar rootroot# xattr * `xattr=passthrough`: Passes through all requests to underlying file. * `xattr=noattr`: mergerfs receives the request but returns `NOATTR`. * `xattr=nosys`: Tells the kernel to reject all `xattr` requests. * Defaults to `passthrough`. Runtime extended attribute support can be managed via the `xattr` option. By default it will passthrough any xattr calls. Given xattr support is rarely used and can have significant performance implications mergerfs allows it to be disabled at runtime. The performance problems mostly comes when file caching is enabled. The kernel will send a `getxattr` for `security.capability` *before every single write*. It doesn't cache the responses to any `getxattr`. This might be addressed in the future but for now mergerfs can really only offer the following workarounds. `noattr` will cause mergerfs to short circuit all xattr calls and return ENOATTR where appropriate. mergerfs still gets all the requests but they will not be forwarded on to the underlying filesystems. The runtime control will still function in this mode. `nosys` will cause mergerfs to return `ENOSYS` for any xattr call. The difference with `noattr` is that the kernel will cache this fact and itself short circuit future calls. This is more efficient than `noattr` but will cause mergerfs' runtime control via the hidden file to stop working. mergerfs-2.42.0/mkdocs/docs/error_handling_and_logging.md0000644000000000000000000000714015177346257022211 0ustar rootroot# Error Handling and Logging ## Error Handling POSIX filesystem functions typically work on singular items and return singular errors. This means that there is some complication when dealing with multiple files or behaviors that are required in mergerfs. mergerfs tries to handle errors in a way that would generally return meaningful values for that particular function. ### Filesystem Functions #### chmod, chown, removexattr, setxattr, truncate, utimens 1. if no errors: return 0 (success) 2. if no successes: return first error 3. if one of the files acted on was the same as the related search function: return its value 4. return 0 (success) While doing this increases the complexity and cost of error handling, particularly step 3, this provides probably the most reasonable return value. #### unlink, rmdir 1. if no errors: return 0 (success) 2. return first error Older versions of mergerfs would return success if any success occurred but for unlink and rmdir there are downstream assumptions that, while not impossible to occur in more traditional situation, can confuse some software. #### open, create For `create` and `open` where a single file is targeted the return value of the equivalent final call is returned. If the error returned is `EROFS`, indicating the filesystem is in fact read-only, mergerfs will mark the branch `RO` and rerun the policy. This typically will only happen with `ext4` when the filesystem is found to have corruption and the OS remounts the filesystem as read-only to protect it. In that situation the filesystem does not otherwise indicate that it is read-only as it would if mounted with `ro`. #### others For search functions, there is always a single thing acted on and as such whatever return value that comes from the single function call is returned. For create functions `mkdir`, `mknod`, and `symlink` which don't return a file descriptor and therefore can have `all` or `epall` policies it will return success if any of the calls succeed and an error otherwise. ## Branches disappearing / reappearing This is not an error condition. mergerfs works on paths. Not mounts. There is currently no assumption or active inspection of the branch path provided at runtime. Nor does it keep its own open file descriptors that would prevent an unused filesystem from being unmounted. If a filesystem disappears for any reason mergerfs will simply continue on behaving as it would normally. As if you never mounted that filesystem into that location. If a branch path no longer exists the branch is simply skipped by policies. If you wish to keep the branch path from being used when a branch path's intended filesystem disappears then make the directory difficult or impossible to use. ``` chown root:root /mnt/mountpoint/ chmod 0000 /mnt/mountpoint/ chattr +i /mnt/mountpoint/ ``` You can still mount to that directory but you will not be able to write to it. Even as root. Note that `chattr` works on limited filesystems. Mainly `ext4`. ## Logging Filesystems, and therefore mergerfs, are doing **lots** of small actions at high speed. It simply isn't reasonable to log all the actions of the system all the time. However, there is a debug mode which can be toggled on as needed, even at runtime, which will record some information to help with debugging. The main thing it will record is a trace of all FUSE messages to the location defined by the `log.file` option. See [config section](config/options.md) for more details. That said even with debug mode disabled mergerfs will log certain details via `syslog` which on `systemd` based systems can be viewed by running: ``` journalctl -t mergerfs ``` mergerfs-2.42.0/mkdocs/docs/extended_usage_patterns.md0000644000000000000000000001351015177346257021566 0ustar rootroot# Extended Usage Patterns ## tiered cache Some storage technologies support what is called "tiered" caching. The placing of smaller, faster storage as a transparent cache to larger, slower storage. NVMe, SSD, or Optane in front of traditional HDDs for instance. mergerfs does not natively support any sort of tiered caching currently. The truth is for many users a cache would have little or no advantage over reading and writing directly. They would be bottlenecked by their network, internet connection, or limited size of the cache. However, there are a few situations where a tiered cache setup could help. 1. Fast network, slow filesystems, many readers: You've a 10Gbps+ network with many readers and your regular filesystems can't keep up. 2. Fast network, slow filesystems, small'ish bursty writes: You have a 10Gbps+ network and wish to transfer amounts of data less than your cache filesystem but wish to do so quickly and the time between bursts is long enough to migrate data. With #1 it's arguable if you should be using mergerfs at all. A RAID level that can aggregate performance or using higher performance storage would probably be the better solution. If you're going to use mergerfs there are other tactics that may help: spreading the data across filesystems (see the mergerfs.dup tool) and setting `func.open=rand` or using dm-cache or a similar technology to add tiered cache to the underlying device itself. With #2 one could use a block cache solution as available via LVM and dm-cache but there is another solution which requires only mergerfs, a script to move files around, and a cron job to run said script. * Create two mergerfs pools. One which includes just the **slow** branches and one which has **both** the **fast** branches (SSD,NVME,etc.) and **slow** branches. The **base** pool and the **cache** pool. * The **cache** pool should have the cache branches listed first in the branch list in order to to make it easier to prioritize them. * The best `create` policies to use for the **cache** pool would probably be `ff`, `lus`, or `lfs`. The latter two under the assumption that the cache filesystem(s) are far smaller than the backing filesystems. * You can also set the **slow** branches' mode to `NC` which would give you the ability to use other `create` policies though that'd mean if the cache filesystems fill you'd get "out of space" errors. This however may be good as it would indicate the script moving files around is not configured properly. * Set your programs to use the **cache** pool. * Configure the **base** pool with the `create` policy you would like to lay out files as you like. * Use monstermuffin's [mergerfs-cache-mover](https://github.com/monstermuffin/mergerfs-cache-mover), one of the scripts below, or create your own. The script's responsibility is to move files from the **cache** branches (not pool) to the **base** pool. * Use `cron` (as root) to schedule the command at whatever frequency is appropriate for your workflow. **NOTE:** Due to the additional overhead it is not recommended to nest or otherwise create hierarchies of mergerfs pools. It will work but the latency increases will further harm performance. Even when using passthrough IO or other features. ### time based expiring **NOTE:** this script is an **example**, not particularly efficient, and really not intended for production deployments. Until such time that mergerfs provides tooling for this usecase consider using [mergerfs-cache-mover](https://github.com/monstermuffin/mergerfs-cache-mover). Move files from cache filesystem to base pool which have an access time older than the supplied number of days. Replace `-atime` with `-amin` in the script if you want minutes rather than days. **NOTE:** The arguments to these scripts include the cache **filesystem** itself. Not the pool with the cache filesystem. You could have data loss if the source is the cache pool. [mergerfs.time-based-mover](https://github.com/trapexit/mergerfs/blob/latest-release/tools/mergerfs.time-based-mover?raw=1) Download: ``` curl -o /usr/local/bin/mergerfs.time-based-mover https://raw.githubusercontent.com/trapexit/mergerfs/refs/heads/latest-release/tools/mergerfs.time-based-mover ``` crontab entry: ``` # m h dom mon dow command 0 * * * * /usr/local/bin/mergerfs.time-based-mover /mnt/ssd/cache00 /mnt/base-pool 1 ``` If you have more than one cache filesystem then simply add a cron entry for each. If you want to only move files from a subdirectory then use the subdirectories. `/mnt/ssd/cache00/foo` and `/mnt/base-pool/foo` respectively. ### percentage full expiring **NOTE:** this script is an **example**, not particularly efficient, and really not intended for production deployments. Until such time that mergerfs provides tooling for this usecase consider using [mergerfs-cache-mover](https://github.com/monstermuffin/mergerfs-cache-mover). While the cache filesystem's percentage full is above the provided value move the oldest file from the cache filesystem to the base pool. **NOTE:** The arguments to these scripts include the cache **filesystem** itself. Not the pool with the cache filesystem. You could have data loss if the source is the cache pool. [mergerfs.percent-full-mover](https://github.com/trapexit/mergerfs/blob/latest-release/tools/mergerfs.percent-full-mover?raw=1) Download: ``` curl -o /usr/local/bin/mergerfs.percent-full-mover https://raw.githubusercontent.com/trapexit/mergerfs/refs/heads/latest-release/tools/mergerfs.percent-full-mover ``` crontab entry: ``` # m h dom mon dow command 0 * * * * /usr/local/bin/mergerfs.percent-full-mover /mnt/ssd/cache00 /mnt/base-pool 80 ``` If you have more than one cache filesystem then simply add a cron entry for each. If you want to only move files from a subdirectory then use the subdirectories. `/mnt/ssd/cache00/foo` and `/mnt/base-pool/foo` respectively. mergerfs-2.42.0/mkdocs/docs/faq/0000755000000000000000000000000015177346257015107 5ustar rootrootmergerfs-2.42.0/mkdocs/docs/faq/compatibility_and_integration.md0000644000000000000000000001710615177346257023534 0ustar rootroot# Compatibility and Integration ## What operating systems does mergerfs support? [Primarily Linux.](../setup/installation.md) FreeBSD is casually supported but not well tested. With FreeBSD certain Linux functions and FUSE features [are not supported.](../known_issues_bugs.md#freebsd-version) In many cases the absence will not be noticed however more advanced features will not be available. ### Why not support MacOS? * Last checked the support for FUSE on MacOS was in flux. * MacOS is not an OS commonly used for NASs and other use cases for which mergerfs is used. * trapexit does not own a MacOS based system. ### Why not support Windows? [WinFSP](https://winfsp.dev/) does implement a libfuse compatible API for Windows however mergerfs does not use libfuse (perhaps [ironically](https://github.com/libfuse/libfuse/blob/master/AUTHORS).) Even if mergerfs was ported to use libfuse it would require the use of the low level API. WinFSP does not appear to support libfuse's low level API. Windows, while used for NAS systems more often than MacOS, is still relatively uncommon when compared to Linux. [Drive Pool](../project_comparisons.md#stablebits-drivepool) is a good alternative. It may also be possible to use mergerfs with WSL. ## What filesystems can be used as branches? ext4, btrfs, xfs, f2fs, zfs, nfs, etc. Most any filesystem should work but there could be issues with non-POSIX compliant filesystems such as nfs (w/ root squashing), vfat, ntfs, cifs, exfat, etc. When directories need to be created or files moved by mergerfs if the filesystem returns errors due to not supporting certain POSIX filesystem features it could result in the core functions failing. Since mergerfs is not generally used with non-POSIX filesystems this has not been a problem for users and there are some checks for known edge cases but it is possible some are not accounted for. If use with a filesystem results in issues please [file a ticket](https://github.com/trapexit/mergerfs/issues) with the details. ## What types of storage devices does mergerfs work with? Since mergerfs works at the filesystem level rather than device level there is no compatibility concerns based on the physical storage devices involved. ## Can I use mergerfs without SnapRAID? SnapRAID without mergerfs? [https://www.snapraid.it](https://www.snapraid.it) Yes. They are completely unrelated pieces of software that just happen to work well together. ## How does mergerfs interact with SnapRAID recovery behavior? SnapRAID does not choose parity layout based on directory structure or relative path. As each file is discovered, SnapRAID fills parity space for that file based on its size using the next available parity area. This makes the logical parity layout depend on discovery order, file size, and how much data already exists on each filesystem at that time. Filesystems with similar used space, regardless of total capacity, are more likely to place newly added files into similar parity positions. Because of that, if files are changed or removed across multiple branches and those files happen to overlap in parity space, recovery of those deleted files may be less reliable. This is not a general concern, is not unique to mergerfs usage, and it does not affect filesystem failure recovery. It is specifically a concern when trying to recover from accidental deletion of files spread across multiple filesystems. In practice this mostly matters when the filesystems have very similar used space, the files are created across those filesystems around the same time, and you later want SnapRAID to recover an accidental deletion spanning multiple filesystems. Otherwise this is usually not something to worry about. If, however, this is a concern it can be beneficial to keep files on as few filesystems as possible or otherwise keep related files together. See the [collocation section.](configuration_and_policies.md#how-can-i-ensure-files-are-collocated-on-the-same-branch) ## Can I use mergerfs without NonRAID? NonRAID without mergerfs? [https://github.com/qvr/nonraid](https://github.com/qvr/nonraid) Yes. They are completely unrelated pieces of software that just happen to work well together. ### How does mergerfs interact with NonRAID? There are no known special interactions or concerns between mergerfs and NonRAID. They are separate tools and mergerfs has no known behavior which requires any special configuration or caveats when used with NonRAID. ## Does mergerfs support CoW / copy-on-write / writes to read-only filesystems? Not in the sense of a filesystem like BTRFS or ZFS nor in the overlayfs or aufs sense. It does offer a [cow-shell](http://manpages.ubuntu.com/manpages/bionic/man1/cow-shell.1.html) like hard link breaking (copy to temp file then rename over original) which can be useful when wanting to save space by hardlinking duplicate files but wish to treat each name as if it were a unique and separate file. If you want to write to a read-only filesystem you should look at overlayfs. You can always include the overlayfs mount into a mergerfs pool. ## Can mergerfs run via Docker, Podman, Kubernetes, etc. Yes. [See installation page.](../setup/installation.md#podman-docker-oci-containers) ## How does mergerfs interact with user namespaces? FUSE does not have any special integration with Linux user namespaces used by container runtime platforms like Docker, Podman, etc. The uid/gid values passed to mergerfs will be the host level values rather than that seen inside the container. Meaning `root` in a container with user namespaces configured will not be `root` to mergerfs. Same with any other uid/gid. Meaning your permissions on your branches must work with the translated values from the id mapping. It is generally recommended to not use user namespacing / id mapping given the complication it introduces. ## Can mergerfs be used with NFS root squash? If mergerfs is pooling a NFS mount then root squash must be disabled as mergerfs needs to be able to have elevated privileges to do what it does (set permissions, ownership, etc.) If you are exporting mergerfs over NFS it is not strictly necessary to disable root squashing but 3rd party software running as root may fail. See the [section on remote filesystems.](../remote_filesystems.md) ## Does inotify and fanotify work? Yes. You can test by using [inotifywait](https://man7.org/linux/man-pages/man1/inotifywait.1.html) or [inotifywatch](https://man7.org/linux/man-pages/man1/inotifywatch.1.html). However, you can not get notifications for events that occur outside of the mergerfs mount. For instance if you are doing [out-of-band](usage_and_functionality.md#can-filesystems-be-removed-from-the-pool-without-affecting-them) changes it is not possible to get those events forwarded through mergerfs. FUSE offers no mechanism to publish events and even if it did it would require somewhat expensive [inotify](https://man7.org/linux/man-pages/man7/inotify.7.html) or [fanotify](https://man7.org/linux/man-pages/man7/fanotify.7.html) watches on all branches. Most software which has the ability to actively monitor a filesystem (such as Plex, Emby, Jellyfin, Airsonic, etc.) are using `inotify` or `fanotify`. If you must add content out-of-band the only way to get real-time updates (via inotify or fanotify) is to add the underlying branches to the software rather than using the mergerfs mount. An alternative is to enable regular library scanning. Plex, for instance, has "Scan my library periodically". Additionally, if you are using software such as Radarr, Sonarr, or Lidarr you can configure it to trigger library updates in a number of services. This can be found under `Settings > Connect`. mergerfs-2.42.0/mkdocs/docs/faq/configuration_and_policies.md0000644000000000000000000001406315177346257023015 0ustar rootroot# Configuration and Policies ## What settings should I use? Depends on what features you want. Generally, there are no "good", "bad", "inefficient", or "optimal" settings. Options are almost exclusively functional. Meaning they change the behavior of the software. It is best to read over the available options and choose what fits your use case. If something is not clear from the documentation please reach out and the documentation will be improved. The settings described in the [Quick Start](../quickstart.md) are sufficient for most users. Filesystems are complex and use cases numerous. There simply is no way to provide a singular setup that works for all situations. Since mergerfs [does not impact](usage_and_functionality.md) the underlying filesystems and can be added or removed without any impact it is extremely easy to test and experiment with different settings. Additional reading: * [Config/Options](../config/options.md) ## What create policy should I use? If it isn't clear to you then you should use `pfrd` as described in the [quickstart guide](../quickstart.md). ## Why are there no policies based on file size? Because it is not possible to know the final size of a file at creation time. See [How does mergerfs handle moving and copying of files?](technical_behavior_and_limitations.md#how-does-mergerfs-handle-moving-and-copying-of-files) and [Intro to Filesystems - Creating a file](../intro_to_filesystems.md#creating-a-file). ## Why is pfrd the default create policy? Originally the default was `epmfs` however it was found to cause significant confusion among new users who assumed mergerfs to behave like other software which always choose a branch with most available space without any filtering or restrictions. The reason for using `epmfs` was to allow people to use mergerfs without impacting the layout of their data across the branches. Keeping the total entropy of the system in check. This, however, was not understood by users who did not read the documentation and caused significant support burdens. For mergerfs v2.41.0 it was decided to change the default to `pfrd` to minimize the support burden. `pfrd` was chosen because it prioritizes placement to branches based on free space (percentage wise) without overloading a specific branch as `mfs`, `lus`, or other policies could when a singular branch has significantly more free space. Since it is impossible to know the usage and access patterns of the filesystem spreading out files across the branches also spreads the load and therefore good for general use cases making it a good default. Additional reading: * [functions, categories and policies](../config/functions_categories_policies.md) ## How can I ensure files are collocated on the same branch? Many people like the idea of ensuring related files, such as all the files to a TV show season or songs in an album, are stored on the same storage device. However, most people have no technical need for this behavior. 1. If you backup your data it is extremely likely your backup solution can restore only those files you are missing. There is no need to store data in related units to ensure restoring data is easy. 2. Software such as [Sonarr](https://sonarr.tv) can manage the downloading and post processing of bespoke files / episodes which may be missing. Either by downloading the episode individually if available or by downloading a full season. 3. There is no benefit to keeping files collocated with regard to drive spinup, caching, or other secondary concern. In fact depending on usage patterns placing the data on the same underlying device could harm performance. The main use case for wanting collocation is where the branch is going to be removed from the pool and used in isolation temporarily and you wish to have all data from some logical set on that device. Such as you intend to take a drive out of the pool to take on a trip and want a whole show or artist's works on the drive. However, even in these situations you typically end up needing to curate the files anyway because it has show A but not show B. In such cases it is more convient to use a separate devices and sync what you wish to it. All that said you can accomplish collocation to varying degrees using the following methods: 1. Use [mergerfs.consolidate](https://github.com/trapexit/mergerfs-tools/blob/master/src/mergerfs.consolidate) when consolidation is needed. 2. Use a `msp` create policy to do a best effort collocation without needing explicit directory curation. 3. Use `epmfs` or other `ep` create policy and manually create paths on the branches directly as you need/desire. 4. Use a `ep` `create` policy and `pfrd` or `rand` for `mkdir`. ## How can I balance files across the pool? Similar to collocation there is generally little reason to balance files across the pool branches. 1. Since prediction of a device's/filesystem's death or loss of data is near impossible there is little reason to balance in hopes of limiting data loss. 2. While performance could be impacted by having too much reading or writing happen to singular underlying filesystems balancing won't help unless you have the ability to manage the access patterns to the pool. 3. Over time the churn of adding and removing files will lead to a random distribution of files across the branches which is effectively "balancing" if using create policies which do not favor any particular branch. All that said if you wish to move files around or balance the pool you can: 1. Use `rand` or `pfrd` create policies and just use your system as normal. 2. Write scripts using rsync or similar to move files around as you wish. 3. Use [mergerfs.balance](https://github.com/trapexit/mergerfs-tools/blob/master/src/mergerfs.balance). Keep in mind that this tool is really just an example of how to accomplish such a task. The tool does not keep track of links so you may encounter an increase in used space if you rely on links to reduce redundancy. However, you can run a file dedup program like [rdfind](https://github.com/pauldreik/rdfind) to restore the links. mergerfs-2.42.0/mkdocs/docs/faq/have_you_considered.md0000644000000000000000000000136015177346257021447 0ustar rootroot# "Have You Considered?" ## Have you considered limiting drive spinup? Yes. See [Limiting Drive Spinup](limit_drive_spinup.md). ## Have you considered porting to MacOS? Yes, but the FUSE implementation on MacOS has gotten a bit complicated and fragmented. I'm not opposed to supporting it but given the low demand, lack of the author having a modern MacOS system, the fact mergerfs does not use standard [libfuse](https://github.com/libfuse/libfuse) API, and MacOS FUSE situation it is unlikely. ## Have you considered porting mergerfs to Windows (WinFsp)? Similar to MacOS the demand is very low and mergerfs does not use the [libfuse](https://github.com/libfuse/libfuse) library so porting to WinFsp would first mean porting it to `libfuse`. mergerfs-2.42.0/mkdocs/docs/faq/limit_drive_spinup.md0000644000000000000000000001655215177346257021347 0ustar rootroot# Limiting drive spinup ## Does mergerfs do anything to prevent drive spinup? No. In fact it makes it worse. ## How can I setup my system to limit drive spinup? TL;DR: You really can't. Not through mergerfs alone. In fact using mergerfs makes any general attempt to limit spinup more complicated. mergerfs is a proxy. Despite having [some caching behaviors](../config/cache.md) it is not designed to cache much more than metadata. It proxies calls between client software and underlying filesystems. If a client makes a request such as `open`, `readdir`, `stat`, etc. it must translate that into something that makes sense across multiple filesystems. For `readdir` that means running the same call against all branches and aggregating the output. For `open` that means finding the file to open and doing so. The only way to find the file to open is to scan across all branches and sort the results and pick one. There is some variability in how much searching is done due to [policies](../config/functions_categories_policies.md#policy-descriptions) but not much. There is no practical way to do otherwise. Especially given so many mergerfs users expect out-of-band changes to "just work." The best way to limit spinup of drives is to limit their usage at the client level. Meaning keeping software from interacting with the filesystem (and therefore the drive) all together. ### What if you assume no out-of-band changes and cache everything? This would require a significant rewrite of mergerfs. Everything is done on the fly right now and all those calls to underlying filesystems can cause a spinup. To work around that a database of some sort would have to be used to store ALL metadata about the underlying filesystems and on startup everything scanned and stored. From then on it would have to carefully update all the same data the filesystems do. It couldn't be kept in RAM because it would take up too much space so it'd have to be on a SSD or other storage device. If anything changed out of band it would break things in weird ways (and MANY users depend on out of band changes working.) It could rescan on occasion but that would require spinning up everything. Filesystem watches could be used but since mergerfs is just another piece of software interacting with the filesystem ALL mergerfs requests would be echoed back to it causing lots of overhead throwing away a super majority of events it triggered. And something as "simple" as keeping the current available free space on each filesystem is not as easy as one might think given reflinks, snapshots, and other block level dedup technologies distort the meaning of usage values. Only if ALL metadata and all file locations were cached could mergerfs then do very targeted file operations so as not to trigger a scan across the pool. But that will break out of band interactions. It would require accepting possibly bad behavior by space based policies since space would be imprecisely computed. It would require long scans of the filesystems on startup and a separate location to store all this data. ### What if you only query already active drives? Let's assume that is plausible (it isn't because some drives actually will spin up if you ask if they are spun down... yes... really) you would have to either cache all the metadata on the filesystem or treat it like the filesystem doesn't exist. The former has all the problems mentioned prior and the latter would break a lot of things. Suddenly whole filesystems worth of data would be missing because it spun down. ### Is there anything that can be done where mergerfs is involved? Yes, but whether it works for you depends on your tolerance for the complexity. 1. Cleanly separate writing, storing, and consuming the data. 1. Use a SSD or dedicated and limited pool of drives for downloads / torrents. 2. When downloaded move the files to the primary storage pool. 3. When setting up software like Plex, Jellyfin, etc. point to the underlying filesystems. Not mergerfs. 2. Add a bunch of bcache, lvmcache, dm-cache, or similar block level cache to your setup. After a bit of use, assuming sufficient storage space, you can limit the likelihood of the underlying spinning disks from needing to be hit. 3. Tweak your system's settings around caching: * mount all your filesystems with `noatime` to disable updating "last accessed" time on files. * mount all your filesystems with `nodiratime` to disable updating "last accessed" time on directories. * `sudo sysctl -w vm.vfs_cache_pressure=10`: Prioritizes keeping file metadata cached in RAM. * `sudo sysctl -w vm.dirty_ratio=40`: Allows up to 40% of system memory to be filled with unwritten "dirty" data before forcing a disk flush. * `sudo sysctl -w vm.dirty_background_ratio=5`: Sets a lower threshold (5%) for the kernel to start writing data in the background without blocking applications. * `sudo sysctl -w vm.dirty_writeback_centisecs=6000`: Increases the interval between kernel writeback checks to 60 seconds (default is usually 5). * `sudo sysctl -w vm.dirty_expire_centisecs=12000`: Allows data to stay "dirty" in RAM for up to 120 seconds before it must be written to disk. * To make `sysctl` values permanent add the above to `/etc/sysctl.conf`. * **Note:** for systems with limited RAM the above `sysctl` values could cause issues. * **Note:** if you increase the time for which data is stored in RAM before being flushed to disk there is also an increased risk that a sudden powerloss could lead to lost data. 4. Enable all the appropriate caches in mergerfs: * [https://trapexit.github.io/mergerfs/latest/config/cache/](https://trapexit.github.io/mergerfs/latest/config/cache/) * `cache.entry=86400`: cache file existence for 24h. * `cache.negative-entry=86400`: cache file non-existence for 24h. * `cache.attr=86400`: cache file metadata for 24h. * `cache.symlinks=true`: enable symlink caching. * `cache.readdir=true`: enable directory listing caching. ### References * [Documentation for /proc/sys/vm/](https://docs.kernel.org/admin-guide/sysctl/vm.html) * [How to Configure vm.swappiness and Other Virtual Memory Parameters on RHEL](https://oneuptime.com/blog/post/2026-03-04-configure-vm-swappiness-virtual-memory-rhel-9/view) ### Tradeoffs While it may be a trade off you are willing to live with there is decent evidence that spinning down drives puts material increased wear on them and can lead to their death earlier than otherwise. You may end up saving money on electricity but spending more on having to purchase new drives sooner. ## Alternatives [Project Comparisons](../project_comparisons.md) lists a few projects that are similar to mergerfs but offer caching. Please note that these projects are very young and not general purpose like mergerfs. Their compliance to POSIX filesystem rules is probably low enough that certain behaviors may not work or worse lead to data corruption. I'm not suggesting not to look at those projects but filesystem development is complicated even when it appears to be just a layer on top of another. Just be careful and do your research. That stands for anything touching your data... mergerfs included. To the degree that mergerfs can add features which help in this situation, so long as it doesn't interfere with other fundamental features, they may be added over time. mergerfs-2.42.0/mkdocs/docs/faq/reliability_and_scalability.md0000644000000000000000000000304115177346257023142 0ustar rootroot# Reliability and Scalability ## Is mergerfs "production ready?" Yes. mergerfs has been around for over a decade and used by many users on their systems. Typically running 24/7 with constant load. At least a few companies are believed to use mergerfs in production environments. A number of [NAS focused operating systems](../related_projects.md) includes mergerfs as a solution for pooling filesystems. Most serious issues (crashes or data corruption) have been due to [kernel bugs](../known_issues_bugs.md#fuse-and-linux-kernel). All of which are fixed in stable releases. ## How well does mergerfs scale? Users have reported running mergerfs on everything from OpenWRT routers and Raspberry Pi SBCs to multi-socket Xeon enterprise servers. Users have pooled everything from USB thumb drives to enterprise NVME SSDs to remote filesystems and rclone mounts. The cost of many calls can be `O(n)` meaning adding more branches to the pool will increase the cost of certain functions, such as reading directories or finding files to open, but there are a number of caches and strategies in place to limit overhead where possible. ## Are there any limits? There is no maximum capacity beyond what is imposed by the operating system itself. Any limit is practical rather than technical. As explained in the question about scale mergerfs is mostly limited by the tolerated cost of aggregating branches and the cost associated with interacting with them. If you pool slow network filesystem then that will naturally impact performance more than low latency SSDs. mergerfs-2.42.0/mkdocs/docs/faq/technical_behavior_and_limitations.md0000644000000000000000000003164715177346257024513 0ustar rootroot# Technical Behavior and Limitations ## Do hard links work? Yes. [links](https://en.wikipedia.org/wiki/Hard_link) (otherwise known as hard links) are fundamentally supported by mergerfs. There is no option to enable or disable links. All comments elsewhere claiming they do not work are related to the setup of the user's system. See the [Intro to Filesystems](../intro_to_filesystems.md) page for more details on what a `link` is. A limitation of a `link` is that it **must** reference a file/inode within the same filesystem or device. When a request is made to the operating system to `link` (or `rename`) a file to a target location the OS will first check if the source and target are the same filesystem / device. If not it will return the error `EXDEV` meaning that the request is not able to be made due to the result being "cross device". What catches many users off guard is that this "cross device" check is not very deep or involved. Even the same filesystem bind mounted to another location will typically be considered a different device. So when mergerfs is creating a union of other filesystems there is no way to link or rename from one of the underlying branches into mergerfs. They are different filesystems even if logically they seem related or the same. And similarly it is impossible for mergerfs to truly make a link between two branches which are not in fact the same mounted filesystem. This is relevant to mergerfs users because bind mounts are very common when using container runtimes such as Docker, Podman, or Kubernetes. When you add a volume or mount to your container that is in fact a bind mount of that path. Meaning if you were to add `/mnt/mergerfs/downloads` and `/mnt/mergerfs/movies` as separate mounts into your container any request to link between the two locations within the container will fail with the `EXDEV` error even though it will work perfectly fine on the host. If you wish for `link` and `rename` to work you **MUST** mount into the container a point in the directory structure above what you wish to use. In this case `/mnt/mergerfs`. Another situation where people will hit unexpected `EXDEV` errors is when they use a policy which makes file creation decisions based on existing paths. If the source of a `link` or `rename` is on branch A but the target directory is on branch B, given the whole point of the policy is to strictly enforce behavior based on what branches already exist, it must return `EXDEV`. Doing otherwise would fundamentally break the purpose of the policy. Read [rename & link](../config/rename_and_link.md) for more details on how mergerfs handles those two functions. When in doubt it is trivial to test `link`: ```shell $ cd /mnt/mergerfs/ $ touch foo $ ln -v foo bar 'bar' => 'foo' $ stat foo bar | grep Inode Device: 0,173 Inode: 123456 Links: 2 Device: 0,173 Inode: 123456 Links: 2 ``` For the more technical: within mergerfs the inode of a file is not necessarily indicative of two file names linking to the same underlying data. For more details as to why that is see the docs on [inodecalc](../config/inodecalc.md). ## Are there any size limitations to files, directories, etc.? Whatever the limits are of the underlying filesystems. ## Do reflink, FICLONE, or FICLONERANGE work? Unfortunately not. FUSE, the technology mergerfs is based on, does not support the `clone_file_range` feature needed for it to work. mergerfs won't even know such a request is made. The kernel will simply return an error back to the application making the request. Should FUSE gain the ability mergerfs will be updated to support it. That said: mergerfs itself will attempt to use `FICLONE` when copying data between files in the limited cases where it copies/moves files. ## How does mergerfs handle moving and copying of files? This is a _very_ common mistaken assumption regarding how filesystems work. There is no such thing as "move" or "copy." These concepts are high level behaviors made up of numerous independent steps and _not_ individual filesystem functions. A "move" can include a "copy" so lets describe copy first. When an application copies a file from "source" to "destination" it can do so in a number of ways but the basics are the following. 1. `open` the source file. 2. `create` the destination file. 3. `read` a chunk of data from source and `write` to destination. Continue till it runs out of data to copy. 4. Copy file metadata (`stat`) such as ownership (`chown`), permissions (`chmod`), timestamps (`utimes`), extended attributes (`getxattr`, `setxattr`), etc. 5. `close` source and destination files. "move" is typically a `rename(src,dst)` and if that errors with `EXDEV` (meaning the source and destination are on different filesystems) the application will "copy" the file as described above and then it removes (`unlink`) the source. The `rename(src,dst)`, `open(src)`, `create(dst)`, data copying, metadata copying, `unlink(src)`, etc. are entirely distinct and separate events. There is really no practical way to know that what is ultimately occurring is the "copying" of a file or what the source file would be. Since the source is not known there is no way to know how large a created file is destined to become. This is why it is impossible for mergerfs to choose the branch for a `create` based on file size. The only context provided when a file is created, besides the name, is the permissions, if it is to be read and/or written, and some low level settings for the operating system. All of this means that mergerfs can not make decisions when a file is created based on file size or the source of the data. That information is simply not available. At best mergerfs could respond to files reaching a certain size when writing data, a file is closed, or renamed. Related: if a user wished to have mergerfs perform certain activities based on the name of a file it is common and even best practice for a program to write to a temporary file first and then rename to its final destination. That temporary file name will typically be random and have no indication of the type of file being written. At best something could be done on rename. Additional reading: [Intro to Filesystems: Workflows](../intro_to_filesystems.md#workflows) ## Why does the total available space in mergerfs not equal outside? Are you using ext2/3/4? With reserve for root? mergerfs uses available space for statfs calculations. If you've reserved space for root then it won't show up. You can remove the reserve by running: `tune2fs -m 0 ` ## I notice massive slowdowns of writes when enabling cache.files. When file caching is enabled in any form (`cache.files!=off`) it may issue `getxattr` requests for `security.capability` prior to _every single write_. This will usually result in performance degradation, especially when using a network filesystem (such as NFS or SMB.) Unfortunately at this moment, the kernel is not caching the response. To work around this situation mergerfs offers a few solutions. 1. Set `security_capability=false`. It will short circuit any call and return `ENOATTR`. This still means though that mergerfs will receive the request before every write but at least it doesn't get passed through to the underlying filesystem. 2. Set `xattr=noattr`. Same as above but applies to _all_ calls to getxattr. Not just `security.capability`. This will not be cached by the kernel either but mergerfs' runtime config system will still function. 3. Set `xattr=nosys`. Results in mergerfs returning `ENOSYS` which _will_ be cached by the kernel. No future xattr calls will be forwarded to mergerfs. The downside is that also means the xattr based config and query functionality won't work either. 4. Disable file caching. If you aren't using applications which use `mmap` it's probably simpler to just disable it altogether. The kernel won't send the requests when caching is disabled. ## Why use FUSE? Why not a kernel based solution? As with any solution to a problem, there are advantages and disadvantages to each one. A FUSE based solution has all the downsides of FUSE: * Higher IO latency due to the trips in and out of kernel space (though now minimized with passthrough IO) * Higher general overhead due to trips in and out of kernel space * Double caching when using page caching * Misc limitations due to FUSE's design But FUSE also has a lot of upsides: * Easier to offer a cross platform solution * Easier forward and backward compatibility * Easier updates for users * Easier and faster release cadence * Allows more flexibility in design and features * Overall easier to write, secure, and maintain * Much lower barrier to entry (getting code into the kernel takes a lot of time and effort initially) ## Is my OS's libfuse needed for mergerfs to work? No. Normally `mount.fuse` is needed to get mergerfs (or any FUSE filesystem to mount using the `mount` command but in vendoring the libfuse library the `mount.fuse` app has been renamed to `mount.mergerfs` meaning the filesystem type in `fstab` can simply be `mergerfs`. That said there should be no harm in having it installed and continuing to using `fuse.mergerfs` as the type in `/etc/fstab`. If `mergerfs` doesn't work as a type it could be due to how the `mount.mergerfs` tool was installed. Must be in `/sbin/` with proper permissions. ## Why was splice support removed? After a lot of testing over the years, splicing always appeared to at best, provide equivalent performance, and in some cases, worse performance. Splice is not supported on other platforms forcing a traditional read/write fallback to be provided. The splice code was removed to simplify the codebase. ## How does mergerfs handle credentials? mergerfs is a multithreaded application in order to handle requests from the kernel concurrently. Each FUSE message has a header with certain details about the request including the process ID (pid) of the requesting application, the process' effective user id (uid), and group id (gid). FUSE and the kernel have two ways of managing permissions. A kernel side `default_permissions` option and leaving it to the FUSE server. When default permissions is enabled the kernel will do the entitlement checks and only allow requests through which should be allowed according to normal POSIX permissions. When not enabled it is the responsibility of the FUSE server, in this case mergerfs, to do whatever is necessary to manage entitlements. Prior to mergerfs v2.42.0 it would enable `default_permissions` but also leveraged the uid and gid available in each FUSE request. The thread actioning the request would change its credentials to match those of the requesting application to ensure permissions were properly handled as well as dealing with some quirks of non-POSIX compatible filesystems. However, this strategy had two major issues. First, it was not compatible with the new `allow-idmap` feature of FUSE which allows a filesystem to advertise it can be used with id mapping which is often used with containers. Secondly, it caused permission issues when the kernel would say something was allowed but due to the way mergerfs was changing creds would fail. This mostly came in the form of `chroot`ed setups like used in containers. Neither of these tended to impact casual users but did break some niche or power user use cases. Since the casual user won't notice the subtle changes and it would enable new use cases it was decided that the credential handling would change. As of v2.42.0 mergerfs now runs as root more generally. Either changing credentials when creating files (Linux) or chown'ing them after creation (FreeBSD). As a result of this change it is now necessary for the FUSE `default_permissions` feature be used for proper entitlements management. mergerfs does allow it to be disabled but it should only be done so for debugging purposes. ## Does mergerfs support idmap? Yes, by setting [allow-idmap=true](../config/options.md) (which is the default.) Requires that [kernel-permissions-check](../config/kernel-permissions-check.md) be enabled (the default.) ## What happens if a branch filesystem blocks? POSIX filesystem calls unfortunately are entirely synchronous. If the underlying filesystem mergerfs is interacting with freezes up or blocks then the thread issuing the request will block same as any other piece of software. If enough threads block then mergerfs will block. There are no timeouts or ways to truly work around this situation. If mergerfs spawned new threads it is very likely they too would end up blocked. ## What information does mergerfs have when making decisions? Every incoming request contains: * The `tid` or `pid` of the calling thread/process * The `uid` and `gid` of the calling thread/process * The `umask` of the calling thread/process * The arguments of the filesystem call in question Naturally the mergerfs config as well as anything queriable from the operating system or filesystems are also available. ## Why does running `mount -a` result in new instances of mergerfs? See [lazy-umount-mountpoint](../config/lazy-umount-mountpoint.md) mergerfs-2.42.0/mkdocs/docs/faq/usage_and_functionality.md0000644000000000000000000001541315177346257022333 0ustar rootroot# Usage and Functionality ## What should mergerfs NOT be used for? * Situations where you need large amounts of contiguous space beyond that available on any singular device. Such as putting 10GiB a file on 2 6GiB filesystems. * databases: Even if the database stored data in separate files (mergerfs wouldn't offer much otherwise) the higher latency of the indirection will harm performance. Though if it is a sqlite3 database then its likely fine. * VM images: For the same reasons as databases. VM images are accessed very aggressively and mergerfs will introduce a lot of extra latency. * As replacement for RAID: mergerfs is just for pooling branches. If you need device performance aggregation or high availability you should stick with RAID. However, it is fine to put a filesystem which is on a RAID setup in mergerfs. **However, if using [passthrough](../config/passthrough.md) the performance related issues above are less likely to be a concern. Best to do testing for your specific use case.** ## What happens when file paths overlap? It depends on the situation and the configuration of mergerfs. The user chooses the algorithm (policy) on how to behave when a particular filesystem function is requested. Which file to select or act on. See how [policies](../config/functions_categories_policies.md) work. ## Is adding or removing mergerfs to/from my setup destructive? No. [See below.](#can-mergerfs-be-used-with-filesystems-which-already-have-data) ## Can mergerfs be used with filesystems which already have data? Yes. mergerfs is really just a proxy and does **NOT** interfere with the normal form or function of the filesystems, mounts, or paths it manages. It literally is interacting with your filesystems as any other application does. It can not do anything that any other random piece of software can't do. There is no migration needed. mergerfs is **not** a traditional filesystem that takes control over the underlying drive, block device, or partition. mergerfs is **not** RAID. It does **not** manipulate the data that passes through it. It does **not** shard data across filesystems. It only shards some **behavior** and aggregates others. Think of it as a filesystem [reverse proxy](https://en.wikipedia.org/wiki/Reverse_proxy). ## Can mergerfs be removed without affecting the data? Yes. See the previous question's answer. ## Can filesystems be removed from the pool without affecting them? Yes. See previous question's answer. This is true for planned removal by unmounting mergerfs and changing the config, changes made to mergerfs at [runtime](../runtime_interface.md), umounting of the branch's filesystem on the fly (whether on purpose or due to error), etc. ## What happens if a filesystem disappears at runtime? By "disappear" meaning explicitly unmounted or due to an error the OS removes it. Nothing explicitly happens. mergerfs works on paths, not mounts. If the branch path still exists mergerfs will treat it the same as it did before. It just may not have any data there. If the branch no longer exists it will be ignored. If the OS returns errors then mergerfs will return those errors where appropriate. See [Error Handling and Logging](../error_handling_and_logging.md). ## Can filesystems be moved to another pool? Yes. ## Can filesystems be part of multiple pools? Yes. ## How do I migrate data into or out of the pool when adding/removing filesystems? There is no need to do so. mergerfs is a union filesystem. It works **on top** of existing filesystems. It does **not** replace them. See the previous questions and answers. ## How do I remove a filesystem but keep the data in the pool? Nothing special needs to be done. Remove the branch from mergerfs' config and copy (rsync) the data from the removed filesystem into the pool. The same as if it were you transferring data from one filesystem to another. If you wish to continue using the pool with all data available while performing the transfer simply create a temporary pool without the branch in question and then copy the data from the branch to the temporary pool. It would probably be a good idea to set the branch mode to `RO` prior to doing this to ensure no new content is written to the filesystem while performing the copy. However, it is typically good practice to run rsync or rclone again after the first copy finishes to ensure nothing is left behind. NOTE: Above recommends to "copy" rather than "move" because you want to ensure that your data is transferred before wiping the drive or filesystem. ## Can filesystems still be used directly? Outside of mergerfs while pooled? Yes, [out-of-band](https://en.wikipedia.org/wiki/Out-of-band) interaction is generally fine. Remember that mergerfs is a userland application so any interaction with the underlying filesystem is the same as multiple normal applications interacting. However, it is not recommended to write to the same file from within the pool and from without at the same time. Especially if using page caching (`cache.files!=off`) or writeback caching (`cache.writeback=true`). That said this risk is really not different from the risk of two applications writing to the same file under normal conditions. Keep in mind that if out-of-band changes are made while also leveraging any caching of the filesystem layout such as with `cache.entry`, `cache.negative-entry`, `cache.attr`, `cache.symlinks`, or `cache.readdir` you may experience temporary inconsistency till the cache expires. mergerfs is not actively watching all branches for changes and the kernel will have no way to know anything changed so as to clear or ignore the cache. This is the same issue you can have with [remote filesystems](../remote_filesystems.md). ## What are the performance characteristics of using mergerfs? mergerfs does not stripe or shard data. Instead it acts like a reverse proxy / multiplexer. As such it is not possible to have RAID like performance improvements. However, its performance is not limited like [block level concatenation / JBOD / SPAN.](../project_comparisons.md#raid0-jbod-span-drive-concatenation-striping) * Single file / single stream: Max throughput limited to speed of the chosen underlying branch + FUSE overhead (usually 5–30% slower than direct access; near native with [IO passthrough](../config/passthrough.md)). * Aggregate / multi-stream: Can approach sum of all branches' speeds when many independent IO operations run in parallel (multiple files, processes, or clients). * Other factors: Latency-sensitive workloads suffer more (slow branches or network drives hurt responsiveness); directory listing and metadata ops slower due to combining branches. Real-world performance varies heavily with workload, kernel, options, and hardware. See [benchmarking](../benchmarking.md) and [performance](../performance.md) section for testing tips. mergerfs-2.42.0/mkdocs/docs/faq/why_isnt_it_working.md0000644000000000000000000002634715177346257021545 0ustar rootroot# "Why isn't it working?" ## I modified mergerfs' config but it still behaves the same. mergerfs, like other filesystems, are given their options/arguments at mount time. You can not simply modify the [source of the configuration](../quickstart.md#usage) and have those settings applied any more than you would for other filesystems. It is the user's responsibility to [restart](../setup/upgrade.md) mergerfs to pick up the changes or use the [runtime interface](../runtime_interface.md). NOTE: the [runtime interface](../runtime_interface.md) is **just** for runtime changes. It does **NOT** save those changed values anywhere. ## Why are all my files ending up on 1 filesystem?! Did you start with empty filesystems? Are you using an `existing path` policy such as `epmfs`? If starting with a set of empty filesystems such a policy will select only 1 filesystem when the first directory is created. Anything created in that directory will be placed on the same branch because that is the point of such a policy. That is the expected behavior. This may catch users off guard but the point of those `existing path` policies is to preserve the directory layout and you need to consider what that means one event at a time. To "fix" this situation change the policy. Most users [have little reason](configuration_and_policies.md#how-can-i-ensure-files-are-collocated-on-the-same-branch) to use such a policy. See the [quick start guide](../quickstart.md) and [FAQ](configuration_and_policies.md) for policy recommendations. ## Why do I get an "out of space" / "no space left on device" / ENOSPC error even though there appears to be lots of space available? One or multiple of the below are likely causing branches to be [filtered out](../config/functions_categories_policies.md#filtering). * [minfreespace](../config/minfreespace.md) could be filtering out branches * using an `ep*` [policy](../config/functions_categories_policies.md) and there may not be an available branch * [branch modes](../config/branches.md#branch-mode) set to `NC` or `RO` branches will be excluded from consideration * if using `ext4` ensure you are not running into reserve limits (use `tune2fs -m 0` to remove the reserve) * it is possible that the filesystem selected by the policy has run out of inodes (check with `df -i`) mergerfs is presenting a union of the content within multiple branches. The reported free space is an aggregate of space available within the pool (behavior modified by [statfs](../config/statfs.md) and [statfs_ignore](../config/statfs.md#statfs_ignore)). It does not represent a contiguous space. In the same way that read-only filesystems, those with quotas, or reserved space report the full theoretical space available but not the practical usable space. ## Why isn't the create policy working? It probably is. The policies rather straight forward and well tested. First, confirm the policy is configured as expected by using the [runtime interface](../runtime_interface.md). ```shell $ sudo getfattr -n user.mergerfs.category.create /mnt/mergerfs/.mergerfs # file: mnt/mergerfs/.mergerfs user.mergerfs.category.create="mfs" ``` Second, as discussed in the [support](../support.md) section, test the behavior using simple command line tools such as `touch` and then see where it was created. ```shell $ sudo touch /mnt/mergerfs/new-file $ sudo getfattr -n user.mergerfs.allpaths /mnt/mergerfs/new-file # file: mnt/mergerfs/new-file user.mergerfs.allpaths="/mnt/hdd/drive1/new-file" ``` If the location of the file is where it should be according to the state of the system at the time and the policy selected then the "problem" lies elsewhere. [Keep in mind](technical_behavior_and_limitations.md/#how-does-mergerfs-handle-moving-and-copying-of-files) that files, when created, have no size. If a number of files are created at the same time, for example by a program downloading numerous files like a BitTorrent client, then depending on the policy the files could be created on the same branch. As the files are written to, or resized immediately afterwards to the total size of the file being downloaded, the files will take up more space but there is no mechanism to move them as they grow. Nor would it be a good idea to do so as it would be expensive to continuously calculate their size and perform the move while the file is still being written to. As such an imbalance will occur that wouldn't if the files had been created and resized one at a time. If you wish to reduce the likelihood of this happening a policy that does not make decisions on available space alone such as `pfrd` or `rand` should be used. ## Why can't I see my files / directories? It's almost always a permissions issue. Unlike mhddfs and unionfs-fuse, which accesses content as root, mergerfs always changes its credentials to that of the caller. This is done as it is the only properly secure way to manage permissions. This means that if the user does not have access to a file or directory than neither will mergerfs. However, because mergerfs is creating a union of paths it may be able to read some files and directories on one filesystem but not another resulting in an incomplete set. And if one of the branches it can access is empty then it will return an empty list. Try using [mergerfs.fsck](https://github.com/trapexit/mergerfs-tools) tool to check for and fix inconsistencies in permissions. If you aren't seeing anything at all be sure that the basic permissions are correct. The user and group values are correct and that directories have their executable bit set. A common mistake by users new to Linux is to `chmod -R 644` when they should have `chmod -R u=rwX,go=rX`. If using a [network filesystem](../remote_filesystems.md) such as NFS or SMB (Samba) be sure to pay close attention to anything regarding permissioning and users. Root squashing and user translation for instance has bitten a few mergerfs users. Some of these also affect the use of mergerfs from [container platforms such as Docker.](compatibility_and_integration.md) ## Why are file moves, renames, links/hard links failing? mergerfs fully supports rename and link functions to the degree that is possible in a union filesystem. Problems related to rename and link are almost exclusively due to incorrect setup of software or poorly written software. ### Docker, Podman, and other container runtimes Keep in mind that [rename and link](../config/rename_and_link.md) will **NOT** work across devices. That includes between the original filesystem and a mergerfs pool, between two separate pools of the same underlying filesystems, or bind mounts of paths within the mergerfs pool. The latter is common when using Docker, Podman, or other container runtimes. Multiple volumes (bind mounts) to the same underlying filesystem are considered different devices. There is no way to link or rename between them despite them binding to the same underlying filesystem. Neither mergerfs or any other filesystem has a say in this behavior as the kernel is erroring out before the request even gets to the filesystems in question. To work around this situation the highest directory in the mergerfs pool that includes all the paths you need is what should be bind'ed into the container if you want links and rename to work between the paths in question. This is a common problem for users of Radarr, Sonarr, Lidarr, etc. when they use the default volume mount options suggested by projects like [LinuxServer.io](https://docs.linuxserver.io/images/docker-radarr/?h=radarr#docker-compose-recommended-click-here-for-more-info). Do not use separate "movies" and "downloads" volumes. ``` # NO volumes: - /mnt/pool/movies:/movies - /mnt/pool/downloads:/downloads # YES volumes: - /mnt/pool:/media # Then use /media/movies and /media/downloads in your software. ``` ### Path-Preserving Create Policies As described in the [rename and link](../config/rename_and_link.md) docs if a path-preserving create [policy](../config/functions_categories_policies.md) is configured then mergerfs, in order to follow that restrictive policy, must return an error ([EXDEV](https://man7.org/linux/man-pages/man2/rename.2.html)) if the target path of a rename or link is not found on the target branch. ``` EXDEV oldpath and newpath are not on the same mounted filesystem. (Linux permits a filesystem to be mounted at multiple points, but rename() does not work across different mount points, even if the same filesystem is mounted on both.) ``` [Most users](configuration_and_policies.md#how-can-i-ensure-files-are-collocated-on-the-same-branch) do not have a need for path-preserving policies but if you intend on using path-preserving policies you must accept that `EXDEV` errors are more likely to occur. You could enable [ignorepponrename](../config/options.md) however doing so would contradict the intention of using a path restrictive policy. ### Poorly written software There are some pieces of software that do not properly handle `EXDEV` errors which `rename` and `link` may return even though they are perfectly valid situations and do not indicate actual device, filesystem, or OS problems. The error will rarely be returned by mergerfs if using a non-path preserving [policy](../config/functions_categories_policies.md) however there are edge cases where it may (such as mounting another filesystem into the mergerfs pool.) If you do not care about path preservation set the mergerfs policy to the non-path preserving variant. For example: `-o category.create=pfrd`. Ideally the offending software would be fixed and it is recommended that if you run into this problem you contact the software's author and request proper handling of `EXDEV` errors. ### Additional Reading * [rename and link](../config/rename_and_link.md) * [Do hard links work?](technical_behavior_and_limitations.md#do-hard-links-work) * [How does mergerfs handle moving and copying of files?](technical_behavior_and_limitations.md#how-does-mergerfs-handle-moving-and-copying-of-files) * [Moving files and directories fails with Samba](../known_issues_bugs.md#moving-files-and-directories-fails-with-samba) ## Why is software needing mmap failing? See [Known Issues and Bugs#3rd Party Software](../known_issues_bugs.md#3rd-party-software) and [QuickStart](../quickstart.md). ## Why don't quick scans fail to pick up new media? Media consumption software like Plex, Jellyfin, Emby, Airsonic, Navidrome, etc. will use timestamps of directories to see if it should be scanned. Be sure to set `func.getattr=newest` to catch that. A full scan would still pick up all media and for those concerned about device activity it is recommened to disable quick scans and leave periodic full scans so the activity is managed. Or to configure your software which manages downloads (such as *Arr family of software) to trigger specific scans when files are added to the pool. Additional reading: * [Does inotify and fanotify work?](compatibility_and_integration.md#does-inotify-and-fanotify-work) ## Why don't I see mergerfs options in mount command or /proc/mounts? FUSE filesystems, such as mergerfs, are interpreting most of the possible options rather than being given to the kernel where those options in the `mount` command and /proc/mounts come from. If you want to see the options of a running instance of mergerfs you can use the [runtime interface](../runtime_interface.md). mergerfs-2.42.0/mkdocs/docs/index.md0000644000000000000000000001465615177346257016005 0ustar rootroot# mergerfs - a featureful union filesystem **mergerfs** is a [union filesystem](https://en.wikipedia.org/wiki/Union_mount) that makes multiple filesystems and/or directories appear as a single unified directory. mergerfs is designed to simplify how you manage files across multiple independent filesystems without the complexity, fragility, or cost of RAID or similar storage aggregation technologies. mergerfs as a smart pooling layer allows you to combine any number of [existing filesystems](faq/usage_and_functionality.md#can-mergerfs-be-used-with-filesystems-which-already-have-data); whether they are on hard drives, SSDs, network shares, or other mounted storage; into what looks like one large filesystem, while still maintaining direct access to each individual filesystem. Unlike RAID, there's no rebuild process if a device fails. You only lose those files that were on that specific filesystem. You can also add or remove filesystems at any time without restructuring the pool. mergerfs excels at cost-effective storage expansion, making it ideal for media libraries, backups, archival data, and other write-sometimes, read-often workloads where you need lots of space but don't want the overhead of traditional storage aggregation technologies. **Key advantages:** * [Non-destructive](faq/usage_and_functionality.md#is-adding-or-removing-mergerfs-tofrom-my-setup-destructive) adding and removing of filesystems (even at runtime) * Mix and match filesystems of any [size](faq/technical_behavior_and_limitations.md#are-there-any-size-limitations-to-files-directories-etc), [type](faq/compatibility_and_integration.md#what-filesystems-can-be-used-as-branches), or [underlying device](faq/compatibility_and_integration.md#what-types-of-storage-devices-does-mergerfs-work-with) * No parity calculations or rebuild times * Does not require hard drives to be spinning if not in use * [Direct access to files](faq/usage_and_functionality.md#can-filesystems-still-be-used-directly-outside-of-mergerfs-while-pooled) on individual filesystems when needed * Flexible [policies](config/functions_categories_policies.md) for controlling where new files are created For users seeking alternatives to mhddfs, unionfs, aufs, or DrivePool, mergerfs offers a mature, actively maintained solution with extensive configuration options and documentation. See the [project comparisons for more details.](project_comparisons.md) ## Features * Logically combine numerous filesystems/paths into a single mount point (JBOFS: Just a Bunch of FileSystems, think filesystem [reverse proxy](https://en.wikipedia.org/wiki/Reverse_proxy)) * Combine paths of the same or different filesystems * Ability to add or remove filesystems/paths without impacting the rest of the data * Unaffected by individual filesystem failure * Configurable file creation placement * File IO [passthrough](config/passthrough.md) for near native IO performance (where supported) * Works with filesystems of any size * Works with filesystems of [almost any type](faq/compatibility_and_integration.md#what-filesystems-can-be-used-as-branches) * Ignore read-only filesystems when creating files * [Hard links](faq/technical_behavior_and_limitations.md#do-hard-links-work) * Hard link [copy-on-write / CoW](config/link-cow.md) * [Runtime configurability](runtime_interface.md) * Support for extended attributes (xattrs) * Support for file attributes (chattr) * Support for POSIX ACLs ## Non-features * RAID like redundancy (see [SnapRAID](https://www.snapraid.it) and [NonRAID](https://github.com/qvr/nonraid)) * RAID like performance improvements * LVM/RAID style block device aggregation * Data integrity checks, snapshots, file versioning * Read/write overlays on top of read-only filesystems (like OverlayFS) * File whiteout * Splitting of files across branches * Active rebalancing of content * [Actively attempt to keep hard drives spun down](faq/limit_drive_spinup.md) ## How it works mergerfs logically merges multiple filesystem paths together. Not block devices, not filesystem mounts, just paths. It acts as a proxy to the underlying filesystem. Combining the behaviors of some functions and being a selector for others. When the contents of a directory are requested mergerfs combines the list of files from each directory, deduplicating entries, and returns that list. When a file or directory is created a policy is first run to determine which branch will be selected for the creation. For functions which change attributes or remove the file the behavior may be applied to all instances found. The way in which mergerfs behaves is controlled by the [config / options / settings](config/options.md). More specifically by [policies](config/functions_categories_policies.md). ### Visualization ``` A + B = C /disk1 /disk2 /merged | | | +-- /dir1 +-- /dir1 +-- /dir1 | | | | | | | +-- file1 | | | +-- file1 | | +-- file2 | +-- file2 | | +-- file3 | +-- file3 | | | +-- /dir2 | +-- /dir2 | | | | | | +-- file4 | | +-- file4 | | | | +-- /dir3 +-- /dir3 | | | | | | | +-- file5 | +-- file5 | | | +-- file6 | +-- file6 +-- file7 +-- file7 +-- file7 ``` ## Getting Started Head to the [quick start guide](quickstart.md). ## About This Documentation * Like the software the documentation changes over time. Ensure that you are reading the documentation related to the version of the software you are using. * The documentation is explicit, literal, and reasonably thorough. If a suspected feature is not mentioned it does not exist. Do not read into the wording. What is described is how it functions. If you feel like something is not explained sufficiently or missing please [ask in one of the supported forums](support.md#contact-issue-submission) and the docs will be updated. * The search feature of MkDocs is not great. Searching for "literal strings" will generally not work. Alternative solutions are being investigated. * While not intended for end users nor completely accurate some might find the AI generated docs at https://deepwiki.com/trapexit/mergerfs interesting or useful. mergerfs-2.42.0/mkdocs/docs/intro_to_filesystems.md0000644000000000000000000004030615177346257021151 0ustar rootroot# Intro to Filesystems **!! WORK IN PROGRESS !!** mergerfs is a union filesystem that manages other filesystems. To understand how mergerfs works and what the features do and mean you must understand at least the basics of how filesystems work. Much of the confusion with mergerfs is based in a lack of knowledge about filesystems. This section of the documentation is provide a primer for those needing that knowledge. ## Terminology * [filesystem](https://en.wikipedia.org/wiki/File_system): A method, data structures, and API used to organize and store files on computer storage devices. Often in a tree like structure / hierarchy. * [file](https://en.wikipedia.org/wiki/Computer_file): A named collection of data stored as a unique object. Filesystems can have numerous file types and "file" can be used to reference any of those types or a "regular" file. * regular file: A file as commonly understood as a named collection of data. * [directory](https://en.wikipedia.org/wiki/Directory_(computing)): A container which holds files and, typically, other directories. In Unix/Linux/POSIX filesystems a directory is technically also a file. * root filesystem: The primary filesystem for which other filesystems within a system are mounted. * [root directory](https://en.wikipedia.org/wiki/Root_directory): The top-level directory in POSIX and POSIX-like filesystems. Denoted by "/". * [path](https://en.wikipedia.org/wiki/Path_(computing)): The location of a file within a filesystem hierarchy. * [inode](https://en.wikipedia.org/wiki/Inode): A unique integer identifier for a file. Like a primary key. Also used to refer to the underlying data structure which stores metadata about the file. * [link](https://en.wikipedia.org/wiki/Hard_link): A reference to an inode in the form of a name. An inode may have 0 to N links. * [symlink](https://en.wikipedia.org/wiki/Symbolic_link): A file type which stores data that may, but is not required to, be a path to another file. * device id: A runtime, unique identification value assigned to a filesystem. * [mount point](https://en.wikipedia.org/wiki/Mount_(computing)#MOUNT-POINT): The directory where a filesystem is "mounted" or presented within a directory hierarchy. * [permissions](https://en.wikipedia.org/wiki/File-system_permissions): Access rights for files. * [owner](https://en.wikipedia.org/wiki/User_identifier): System user which has rights to a file. * [file descriptor](https://en.wikipedia.org/wiki/File_descriptor): A handle used by software, provided by the operating system, to reference open files. * [mmap](https://en.wikipedia.org/wiki/Mmap): A way to abstract access to a file by making it appear as a region of memory. ## Files In POSIX filesystems there are several types of files. Interacting with them is often similar but they offer different capabilities. ### Types * regular: The typical file type. An array of data which can be randomly accessed. * directory: A container which holds other files including other directories allowing for a tree like layout. * symlink: A special file which can store a limited amount of data, typically a file path, which may be transparently interpreted by some filesystem functions as a path. symlinks do *not* need to be a valid path or a path at all. They can be used as a key/value like storage mechanism for instance. * character device: A special file typically representing some physical or logical hardware device offering, typically, an unbuffered byte stream based interface. * block device: A special file which represents a physical or logical hardware device (typically storage) allowing for buffered, fixed-size blocks data transfers. * fifo: Also referred to as a "named pipe." A FIFO, First In, First Out, is a special file which acts as a non-persistent, unidirectional conduit for data. * unix domain socket: Also referred to as a "local socket" or "IPC socket" a "UDS" works similar to a FIFO but bidirectional and offering more features similar to TCP/IP or UDP/IP but local to the system. ### inodes The inode in practical terms **is** the file within a POSIX filesystem. It is, typically, a unique identifier within a filesystem similar to a primary key, represented as a 32 or 64bit integer, which is what the typical user imagines as the file and its metadata (ownership, permissions, type, internal filesystem details, etc.). "typically unique" because some filesystems, such as FUSE based ones, may reuse an inode value for multiple logical files despite them being separate entities in the traditional sense. From the user's perspective multiple files may have the same inode but as mentioned above the inode is the true reference for a file and the "file" people interact with is really a link (see below.) ### links / names To make inodes more useful and accessible POSIX filesystems provide "links". A link (or sometimes referred to as "hardlink") is a file name which references an inode. A single inode can be referenced by multiple links (except for directories typically.) If the number of links to an inode reach zero, and no programs have the inode actively in use, the filesystem will logically remove the inode/file. When a regular file is first created think of it as the filesystem first creating the underlying structure, assigning an inode, then creating a link (name) for it in one shot. When a file is "link"ed to in the future a new "link" / "name" is being created and referencing the source file which will then cause the "nlink" value within the inode, which holds a reference count of the number of links/names that inode has, to be increased by 1. This is why deleting a file is referred to as an "unlink". Technically you are requesting the removal of the "link" and once all the links to a file are removed/unlinked, and the file is not in active use, the filesystem will then logically remove the file. Knowing the details above the API for POSIX filesystems is a little odd in that the programmer does not first create an inode then a link. Instead that is done together with no way to do the former alone despite being able to add additional links afterwards. Modern Linux filesystems do allow for this using the [O_TMPFILE](https://man7.org/linux/man-pages/man2/openat.2.html) flag. Since there is no link on creation should the program which created the file then release the handle on that file the filesystem would see it has no references and remove it. To keep the temporary file around the program must explicitly create a link. ### permissions File permissions are a security mechanism and apply to all files and directories. They, in combination with ownership information, dictate who is allowed to read, write, and execute a file (as well as some other niche allowances and behaviors.) While there are more advanced and complicated forms of permissioning the traditional POSIX permissions come in the form of 3 sets of 3 permissions (the read, write, and execute.) One set for the individual user owner of the file, one for the group owner, and one for "others". Execute in POSIX systems indicates that a regular file is a piece of software and can be run (like a Windows ".exe" file) and for directories means you are allowed to list the contents. A directory can be marked as "read" and not "executable" to allow users to access content within the directory but not list it in a soft form of security through obscurity. You must know the path and name of the file to read it and can not simply search for it. ### ownership Each file has 2 owner values. The individual user identifier and the group identifier. These values are the raw integer value known to the kernel and not the human readable user name or group name most people typically use. In fact the kernel has no awareness of the human readable identifiers. Those are managed entirely by userspace. This is why if you mount a filesystem on a different system with different users tools like `ls` may report different user names or only show integer values for owners because the value stored in the inode is "1000" and the name associated with integer 1000 on system A is different from system B (or may not exist at all.) ### timestamps * mtime: The time the file *data* was last modified. Can be explicitly modified. * ctime: The time the file *metadata* was last modified. Can not be modified. * atime: The time the file was last accessed. Note that Linux generally uses a heuristic to update atime so that it does not in fact have to write to the filesystem every time a file is accessed. Can be explicitly modified. * btime: The "birth" time of the file. Only available in certain filesystems and via a newer system call. Can not be modified. ## Functions * open(): * creat(): * close(): * opendir(): * readdir(): * closedir(): * mkdir(): * link(): * unlink(): * symlink(): * rename(): * read(): * write(): * lseek(): * tell(): * stat(): ## Workflows Filesystems tend to be [misunderstood](faq/technical_behavior_and_limitations.md#how-does-mergerfs-handle-moving-and-copying-of-files). A number of behaviors users are familiar with are actually high level concepts which are made up of numerous steps/functions. As a result high level context that users expect to be available to mergerfs when certain actions are taken and decisions made are in fact not available. Below are explanations of a number of those situations. ### Creating a file [Creating](https://www.man7.org/linux/man-pages/man3/creat.3p.html) a file can range from a single call to a semi-complex procedure depending on the requirements and expectations of the calling application. Most important to understand is that when a file is created there is very limited information needed / provided. The file path, some flags to control a bit how the file is created and if it is to be for reading and/or writing, and the permissions. mergerfs knows a bit more details like which user id is making the request and from what process but that is all the data immediately available. There is no size. The initial size is always zero. Any data that may be written to the file would come in the future via other function calls. The source of that data is completely unknown. Keep in mind that while there exists this ability to create a file in a single call to the operating system that call has numerous aspects which my be exploitable by malicious software. If software wishes to create a file in more secure manner it must do some form of the following. 1. Attempt to open the directory where you wish to create the file. 2. If that succeeds check the directory to ensure it is the directory you expect it to be. Checking ownership, permissions, perhaps existence of other files, the filesystem, etc. 3. Using the handle to the directory, attempt to open the file using a flag which make the open fail should a file name/link already exist with that same name. Also set the permissions to the absolute minimum possible to ensure no interference from others. 4. If it succeeds then continue on with whatever you had planned. If it fails try to unlink the unexpected file and try again at step 3. If it fails multiple times then something is suspicious and the program should stop trying to create the file and report an error. The above can be made even more involved as you will see below. ### Reading or writing to a file To write: 1. Assuming the file is already created/opened... 2. Allocate memory to hold a portion of the data. 3. Fill the memory with the data to write from wherever it may come from. Another file, network, programmatically generated, etc. 4. Call `write()` function on the open file pointing to the memory to write and how much to write. 5. The kernel will take the request and attempt it. On success it will report back to the program how much was written from 1 byte to the amount requested. A write of fewer than the requested amount is called a `short write.` 6. If a short write occurred the program must then adjust the data to ensure it doesn't write the same data again and lower the amount to write by the previously written amount and attempt another write. Continuing this till there is nothing left to write. A short write could also mean that the filesystem has no more available space and following write requests may fail completely. 7. Go back to step 2 or 3 and do it all again with any additional data to write. 8. If at any time there is an error it may be necessary to query the size of the file or other details to know how to continue depending on the needs of the program. Reading is similar and `short reads` are also possible. ### Copying a file The "proper" way to copy a file is quite involved. 1. Open the source file. Do so with certain flags to ensure it is the type of file you expect. You may also need to perform a similar "open directory, check things out, then open file" workflow as mentioned above for security purposes. 2. `stat` the file to get its metadata such as the file size, timestamps, etc. 3. Securely open a file as described previously. The name of the file should not be that of the destination but a temporary file name with some amount of randomness. Often also making it "hidden" by prepending a "." to it. 4. In a loop read data from the source file and write it to the temporary file as described above. There are some platform specific ways to copy the data which may be tried first such as FICLONE/reflink which takes advantage of CoW (copy-on-write) filesystem features. Falling back to the read then write loop if necessary. 5. Request a list of all the extended attribute keys from the source file and one by one query the value. For each key value pair attempt to write it to the destination file. 6. Request file attributes from the source file and write them to the destination file but first filtering out flags such as "immutable" as that would make it impossible to make further changes. 7. Using the details captured in step 2 change the ownership to the destination file to match the source. 8. Using the details captured in step 2 change the permissions (mode) of the destination file to match the source. 9. Using the details captured in step 2 change the mtime and atime of the destination to match the source. 10. Query the source file's metadata again as in step 2. Using those details as well as those from step 2 check the source file to see if it may have changed since the copy procedure started. If it had determine the changes and go back to step 4. Perhaps unlinking the temporary file and going back to step 2. 11. Ensure the data and metadata are flushed to the storage device by calling appropriate sync functions. 12. `rename` the file from the temporary name to the destination name. 13. If the file had a special flag such as the immutable attribute set then set such attribute. 14. Close the destination and source files. There can be additional steps too depending on the platform, available features, and safety concerns. For instance it might be possible to put a lock or lease on the source file to limit possibility of changes while the copy occurs. ### Moving a file The moving of a file is similar to copying a file. 1. Attempt a `rename` between source and destination. If it succeeds, done. Note that the rename itself may require setup similar to securely opening or creating a file. IE... requiring the opening of the source and destination directories, confirming they are what is expected, then issuing the actual rename. 2. If it fails... perform a copy of the file as described above. 3. After the rename and close'ing of the copy `unlink` the source file. ### Summary As seen in the above descriptions these high level concepts users perceive are in fact involved sets of steps with loops and conditional behaviors. All leveraging low level functions which alone have very little context. For instance: there is no practical way of knowing a file is being copied or from where. There is no way to decide at creation time what to do based on size because its size doesn't exist yet. Even making a decision based on the destination file name is complicated by the fact that "well written" software will create randomly named temporary files and then rename the file. Only at `rename` would you know the name as the end user chose and at that point it may be too late. mergerfs-2.42.0/mkdocs/docs/known_issues_bugs.md0000644000000000000000000003431515177346257020437 0ustar rootroot# Known Issues and Bugs ## mergerfs ### Advisory file locking not currently supported mergerfs does not implement POSIX or BSD advisory file locks as provided by FUSE. Doing so is complex because, as a union filesystem, it would need to forward lock requests to the underlying branches, which could result in blocking calls. Locally this is not a major concern—the kernel still manages locks for applications that all go through the mergerfs mount. However, if an application locks a file via the mergerfs mount while another locks the same file directly on the underlying filesystem, the locks will not interact as one might expect. That usage pattern is uncommon, so it is generally not a problem. The issue becomes more significant if you rely on locks over a remote filesystem like NFS across multiple hosts, because mergerfs never actually makes a lock call to the underlying branch. While network locks are possible, they are generally discouraged, so this may not be a huge loss either. That said, there is a strategy that could add lock support if there is sufficient demand, though it would probably be opt-in for performance and resource-usage reasons. ### FreeBSD version * [https://wiki.freebsd.org/FUSEFS](https://wiki.freebsd.org/FUSEFS) * FreeBSD does not have per thread credentials nor Linux capabilities like abilities meaning it runs as root and has to create files as root then chown them rather than changing credentials and creating the file as the uid:gid. * FreeBSD does not have `getdents` like APIs for reading directories. As a result it uses traditional `readdir`. * FreeBSD's FUSE implementation is lacking many features of the Linux version. * runtime interface * ioctl support * IO passthrough * statx * lazy umount * oom_score_adj * fuse-msg-size * kernel symlink caching * kernel readdir caching * writeback caching * idmap * ... ### Host vs Container identity While **not** a bug some users have found when using containers that supplemental groups defined inside the container don't work as expected. Since mergerfs (typically) lives outside the container it is querying the host's supplemental group database. Containers have their own user and group definitions unless setup otherwise just as different systems would. Users should mount in the host group file into the containers or use a standard shared user and groups technology like NIS or LDAP. If using Docker or Podman containers with mergerfs running outside then you can pass in `/etc/passwd` and `/etc/group`. ``` docker run \ -v /etc/passwd:/etc/passwd:ro \ -v /etc/group:/etc/group:ro \ -u $(id -u):$(id -g) \ -v /data:/data \ containerimage ``` ### directory mtime is not being updated Remember that the default policy for `getattr` is `ff`. The information for the first directory found will be returned. If it wasn't the directory which had been updated then it will appear outdated. The reason this is the default is because any other policy would be more expensive and for many applications it is unnecessary. To always return the directory with the most recent mtime or a faked value based on all found would require a scan of all filesystems. If you always want the directory information from the one with the most recent mtime then use the `newest` policy for `getattr`. ### 'mv /mnt/pool/foo /mnt/disk1/foo' removes 'foo' This is not a bug. Run in verbose mode to better understand what's happening: ``` $ mv -v /mnt/pool/foo /mnt/disk1/foo copied '/mnt/pool/foo' -> '/mnt/disk1/foo' removed '/mnt/pool/foo' $ ls /mnt/pool/foo ls: cannot access '/mnt/pool/foo': No such file or directory ``` `mv`, when working across devices, is copying the source to target and then removing the source. Since the source **is** the target in this case, depending on the unlink policy, it will remove the just copied file and other files across the branches. If you want to move files to one filesystem just copy them there and use mergerfs.dedup to clean up the old paths or manually remove them from the branches directly. ### cached memory appears greater than it should be Use `cache.files=off` and/or `dropcacheonclose=true`. See the section on [page caching](config/cache.md). ## 3rd Party Software ### Software using mmap * software using sqlite3 w/ mmap * Plex (for config, not media) * Jellyfin (for config, not media) * Emby (for config, not media) * Radarr * Sonarr * Lidarr * other * rtorrent * qbittorrent (with 'Disk IO type = Memory mapped files') [mmap](https://en.wikipedia.org/wiki/Mmap) is a filesystem and operating system feature allowing files to be interacted with as if it was normal memory. Support for `mmap` is **required** by a number of projects. FUSE (and therefore mergerfs), in order to support `mmap`, requires [page caching](config/cache.md) to be enabled. IE `cache.files` must not be set to `off` (if using Linux before v6.6 or mergerfs before v2.41.0.) In newer versions of mergerfs and Linux `off` will work as it can now auto enable page caching (and therefore `mmap`) as needed. When `mmap` is needed but not available you may see `ENODEV` or `No such device` errors though it will depend on the particular software. Details on enabling `mmap` can be found at: * [QuickStart](quickstart.md#configuration) * [Config > cache.files](config/cache.md#cachefiles) That said it is recommended that config and runtime files be stored on SSDs on a regular filesystem for performance reasons. See [What should mergerfs NOT be used for?](faq/usage_and_functionality.md#what-should-mergerfs-not-be-used-for). Though with [passthrough.io](config/passthrough.md) enabled that is less of a concern. Technically **sqlite3** does not require `mmap`, and in fact the default is not to use it, but many programs enable the feature and provide no error handling when not supported. Ideally the software would catch the error and use traditional IO instead. Not only is it more compatible but could also be more performant in certain situations. ### qbittorrent Same `mmap` concerns as mentioned above but called out specifically due to regularity of queries. The default "Disk IO type" setting is "Memory mapped files" which means it requires `mmap` support. If qbittorrent errors when using mergerfs ensure that either "Disk IO type" is set to "POSIX-compliant" or "Simple pread/pwrite"; or setup mergerfs to support `mmap`. References: * [Software using mmap](#software-using-mmap) * [QuickStart](quickstart.md#configuration) * [Config > cache.files](config/cache.md#cachefiles) ### rsync This isn't specific to mergerfs but when using `--sparse, -S` option with rsync the block size used to read and write data changes from 256KiB to 1KiB. This significantly impacts performance. ### backup software Some software, like borgbackup and others, leverage inodes as one of a number of metrics to notice changes in files. Depending on how [inode generation is configured](config/inodecalc.md) it is possible that the same file may have different inodes one mount to another and as such interfere with the expected stability of the value. In such cases you may need to disable the use of the inode in the software if possible or change the [inodecalc](config/inodecalc.md) setting if possible. Generally speaking, in modern setups where there are many non-fully compliant POSIX filesystems in use, reliance on inode to have a specific meaning is not always reasonable. FUSE, for instance, has no requirement that inode values need to be unique or that two files that happen to be the same underlying file have the same inode. ### NFS clients returning ESTALE / Stale file handle NFS generally does not like out of band changes. Take a look at the section on NFS in the [remote-filesystems](remote_filesystems.md) for more details. ### my 32bit software has problems Some software have problems with 64bit inode values. The symptoms can include EOVERFLOW errors when trying to list files. You can address this by setting `inodecalc` to one of the 32bit based algos as described in the relevant section. ### Moving files and directories fails with Samba Workaround: Copy the file/directory and then remove the original rather than move. This isn't an issue with Samba but some SMB clients. GVFS-fuse v1.20.3 and prior (found in Ubuntu 14.04 among others) failed to handle certain error codes correctly. Particularly `STATUS_NOT_SAME_DEVICE` which comes from the `EXDEV` that is returned by `rename` when the call is crossing mount points. When a program gets an `EXDEV` it needs to explicitly take an alternate action to accomplish its goal. In the case of `mv` or similar it tries `rename` and on `EXDEV` falls back to a copying the file to the destination and deleting the source. In these older versions of GVFS-fuse if it received `EXDEV` it would translate that into `EIO`. This would cause `mv` or most any application attempting to move files around on that SMB share to fail with a generic IO error. [GVFS-fuse v1.22.0](https://bugzilla.gnome.org/show_bug.cgi?id=734568) and above fixed this issue but a large number of systems use the older release. On Ubuntu, the version can be checked by issuing `apt-cache showpkg gvfs-fuse`. Most distros released in 2015 seem to have the updated release and will work fine but older systems may not. Upgrading gvfs-fuse or the distro in general will address the problem. In Apple's MacOSX 10.9 they replaced Samba (client and server) with their own product. It appears their new client does not handle `EXDEV` either and responds similarly to older releases of gvfs on Linux. ### Trashing files occasionally fails This is the same issue as with Samba. `rename` returns `EXDEV` (in our case that will really only happen with path preserving policies like `epmfs`) and the software doesn't handle the situation well. This is unfortunately a common failure of software which moves files around. The standard indicates that an implementation **MAY** choose to support non-user home directory trashing of files (which is a **MUST**). The implementation **MAY** also support "top directory trashes" which many probably do. To create a `$topdir/.Trash` directory as defined in the standard use the [mergerfs-tools](https://github.com/trapexit/mergerfs-tools) tool `mergerfs.mktrash`. ## FUSE and Linux kernel There have been a number of kernel issues / bugs over the years which mergerfs users have run into. Here is a list of them for reference and posterity. ### NFS and EIO errors [https://lore.kernel.org/linux-fsdevel/20240228160213.1988854-1-mszeredi@redhat.com/T/](https://lore.kernel.org/linux-fsdevel/20240228160213.1988854-1-mszeredi@redhat.com/T/) Over the years some users have reported that while exporting mergerfs via NFS, after significant filesystem activity, not only will the NFS client start returning ESTALE and EIO errors but mergerfs itself would start returning EIO errors. The problem was that no one could reliability reproduce the issue. After a string of reports in late 2023 and early 2024 more investigation was done. In Linux 5.14 new validation was put into FUSE which caught a few invalid situations and would tag a FUSE node as invalid if a check failed. Such checks include invalid file type, changing of type from one request to another, a size greater than 63bit, and the generation of a inode changing while in use. What happened was that mergerfs was using a different fixed, non-zero value for the generation of all nodes as it was suggested that unique inode + generation pairs are needed for proper integration with NFS. That non-zero value was being sent back to the kernel when a lookup request was made for root. The reason this was hard to track down was because NFS almost uniquely uses an API which can lead to a lookup of the root node that simply won't happen under normal workloads and usage. And that lookup will only happen if child nodes of the root were forgotten but NFS still had a handle to that node and later asked for details about it. It would trigger a set of requests to lookup info on those nodes. This wasn't a bug in FUSE but mergerfs. However, the incorrect behavior of mergerfs lead to FUSE behave in an unexpected and incorrect manner. It would issue a lookup of the "parent of a child of the root" and mergerfs would send the invalid generation value. As a result the kernel would mark the root node as "bad" which would then trigger the kernel to issue a "forget root" message. In between those it would issue a request for the parent of the root... which doesn't exist. So the kernel was doing two invalid things. Requesting the parent of the root and then when that failed issuing a forget for the root. These led to chasing after the wrong possible causes. The change was for FUSE to revert the marking of root node bad if the generation is non-zero and warn about it. It will mark the node bad but not unhash/forget/remove it. mergerfs in v2.40.1 ensures that generation for root is always 0 on lookup which should work across any kernel version. ### Truncated files This was a bug with `mmap` and `FUSE` on 32bit platforms. Should be fixed in all LTS releases. * [https://marc.info/?l=linux-fsdevel&m=155550785230874&w=2](https://marc.info/?l=linux-fsdevel&m=155550785230874&w=2) ### Crashing on OpenVZ There was a bug in the OpenVZ kernel with regard to how it handles `ioctl` calls. It was making invalid requests which would lead to crashes due to mergerfs not expecting them. * [https://bugs.openvz.org/browse/OVZ-7145](https://bugs.openvz.org/browse/OVZ-7145) * [https://www.mail-archive.com/devel@openvz.org/msg37096.html](https://www.mail-archive.com/devel@openvz.org/msg37096.html) ### Really bad mmap performance There was a bug in caching which affects overall performance of `mmap` through `FUSE` in Linux 4.x kernels. It is fixed in 4.4.10 and 4.5.4. * [https://lkml.org/lkml/2016/3/16/260](https://lkml.org/lkml/2016/3/16/260) * [https://lkml.org/lkml/2016/5/11/59](https://lkml.org/lkml/2016/5/11/59) ### Heavy load and memory pressure leads to kernel panic * [https://lkml.org/lkml/2016/9/14/527](https://lkml.org/lkml/2016/9/14/527) * [https://lkml.org/lkml/2016/10/4/1](https://lkml.org/lkml/2016/10/4/1) * [https://www.theregister.com/2016/10/05/linus_torvalds_admits_buggy_crap_made_it_into_linux_48/](https://www.theregister.com/2016/10/05/linus_torvalds_admits_buggy_crap_made_it_into_linux_48/) mergerfs-2.42.0/mkdocs/docs/logo.png0000644000000000000000000121204015177346257016006 0ustar rootroot‰PNG  IHDR+ƒgAMA±� üasRGBÙÉ, cHRMz&€„ú€èu0ê`:˜pœºQ< pHYs  šœtIMEék¬F IDATxÚìÝyœfUyèûçY{ïwªêjh0" ¨(Æ 05*FdRÄ)ÆÄ)W¯a”ÌsŽšã�Ñ{̉‰Ô=7ŸÜ˜˜ÄñÈŒóŒ‚CŒÆ£ ƒŒÝ]Ó;콞ûÇ^kíµ«11 ÚÝü¾Ÿ´ºªÞ¡»j­õ¬g€;ÅqOz�ò.ðyÌ^ª¼ Àís¼öuÇÿÉåúØ?ú€Suîq|A€ˆˆ¼ô�OfMÀwïÑü6�€ä%ï9�uÀ>‰ {½ãÿè²ÛÝh�úwO~ã§O<ÿÊñùx§žå¶“þâé1?ö�7þ`ïñ‹ï|Š9÷�§Ýî^ö÷.?kåŽz¬×\rÎÊ«.yqoR¯NDä¥ï}ŠŠˆ¼äÝm¦Áyï9�ÀÀá´7~ú‡¶±:ù�ŸŸü†Ï°±€½ÈË/9S_yÅ9Û�ý»—üßÃÛûï/}eß“'ýå•Ë{ãó:ý¯®ò§w®—¼kÏÃôï༽ò€ý²Ëþ¯’?1€ÿ¤S_ÿáɾô|ŸtÁUþÔÑ«.{aÁ»ð<áu"e�¼ââŒöù@Àåg ˆ~ú¯¿B*= yåå/ﯯí¥ÿôôâ¼|M¸û‡sÞA#<ÜE=ñ‚«¶ó.Àž^yÅ9d‚`ÿsÒ_|fúÃ/¹Ëü_vÙ‹*þ&€ýÊ“Þðñ1ïà.íw.~aɻا½æŠóè|°?:ý Ÿ ¦ög¿þÞŸs¯þÐ//ñNÿŽÓÞòÅÞß�óÞõTyù%/RÞ àtê?Ã&À^å—ŸÍÏ%ög¿uá JÞàNtú_ý 7n~¨þÛg~gÄ»°w8çOw¼ û±§ÿõ¿°ùðq¢íAó)…ˆÈ+>øó!ögO}ËçØðíeN}Õü™ø�zÅÎä¶y/ó»—½`À»¸Ã¼ì2ÿû¶Óß|Õ�w€½Û+®8SED^úžÓ)à®ç)|ºâ]Ø7=ù-_žôú�‘ wA¯þÈK–ED^òÎÓXì� ÀO|çtQ›Nç^g‹….ê¹4‹Z·-�ËÑh¸ä´8DT3ó÷lšúÞuãïÝ4þ�·m¦êLÕÌ[éÍ—æ})f¥™&¢NTUÄTÅ‹º¹šyñÖ¨“õ¹›ÊÂ]ëŠòÚ¢(®+ w½:w�ˆ]ëÎ];§³ÆWE©E¡6”6”6¬*»ô¥�0þÔ°ÕÓßòù•wþüÑ»y'|·Îþ‡§êùÏ|·ýÖE/(ÿðÔ·Õ¼#¸=¯¸â�7›ns1ÕõéºlÌ×uÖ¬ËAKÛõG&÷Ø¡Îæ¥Ý'™Ùá^üÝkhl±ÒÈb{c~¥ñ6jšF¼oÔ[c"fNÝ©›;-fN܆·ê´Øåœ»µpÕFå†Zjy]!Å×Åäú¦©¿õÕ]_¼yn›R#©Ê¡Mª‘Œª‘�ª±�Ü’½æ„·±GßÙ‹/º®¼þ[ßÞ±9]º1ó‡Íó»/óóÅЋU¦:r¢Û u+ZèvU=@D4‘eo:u*êÌÌœ‰9‰¿ÔLTETÄLDLD½ñNÍ‹È\E6ÄlÕ{¿Û̯ŠÙª[5±UÛpZÖN]]nc8,oªk&ãÑ5ÛÚ~Ëßþô‘‹;ò}xÆŸ)ÿ鬇³ùÛÇ=áõWêåçÇæîb^vÉå«N~󾎿Wís‡nÌ׎ܘo±6];hc¶>nlVT•9?nÌVLÜŠ³r{¡ÅŠsº$ÎF¢6Tµ‘7xó¥/æ½xóbba_¤�ª6"ºÓ™ŠNUuª¢s'…š·ÝµÕ·Õ~±¶ðó]ÞêõB _U]•ÃÙ¤¯�ãë&ƒ¥k¶U\wÜá�¸íI÷~QÃ߀ §]ðùát6ݶ1Ÿo›nÎÆ‹y3*œÛ6”‡9WU{}Pã›û5¾>¤iš±7x•B¼8UQUqš¾‘L U)DT­=ß‹ˆÓxç/b¢&^LÚã¿7“BÅÊBMÌļ©÷^¼¯Í/"^LÅœŠª�Š«�ºyQÈ®ª(¾^8½JÌ®^Ôõµµ¯w«Óù°ÎƒÁêd2ÙuÀAoþݳ÷üIßµ�tþ•Û.=û¸UÞ Àwãƒßþ[ýô¿~ºZŸ­�׿kKõÆÒf½6ܘ¯¹�m_l€sú㵯��.¦‡Ïêé6/óª*U]¸…-¤ñ&bíFɵW!êT¥pNÄļ˜Š¶3oÚnŽÄTDÛ€€ÅÃŠŠ˜™÷µ˜yU3QqæÄ™SçU‹¹sÕÆ°ÜZÕW -?¯�|¹öóë¼úÕq¹Ô ŠñfU ׯÅxmÇðÀé/?öµ@ØŸ�ð§ÕÍéÜMgs5Q=èÀîÝxÿðébñÈÙl~ÿé´>xVû‘ˆœscÑbÉ97) ¨s¢êT�Su…™¨3U1¯"^µpá;ÊÚ @\¶,†ÔÚ•MÌDLLB9€‰¨Š™¶¿abæµñ^ͬ]&½ñ¦*æ�“Z}³iÞ¯Kã×Emª…ÌŠR׆ÕàÛƒrpå`8øhS×_ùßß¼f÷Á¬èÒÒ²ŸL–ìÒs¹ ¾+:õÍW /:ãØïàöüúEÏw›‹u]Ô3wàèàQUT{ó÷Û¬§ÇLëÍoÖë‡Oë�•ÙbsTûfâͶ©Ê²:ˆŠsÎÉ ,Ä•¥¸¢PçJ_j¡ªNMÚ½�Šš:çµÝ#9kÃñ8b*^ÅL}øwK¹f�6~¢®Ý:™ˆ™Ic�k|ã›Æ7æea^¦*²Q‰l ÊÁtPN¦£riuàF_¯ŠÁÕ¥–WŠÉ7®Û¼f§+ÌÆå²_`râÛÙ#á.¡ä-À]Á ß{}ño߸æ§ò çôÈÙ¼^¾áÆ›qêŽ4çŽò&w7Õ¥²¨Î\á¼j!Î9u®0u…oËûEE]XvÄÚ@8Ô«šjXÇ,-hÚ.z¢&"ª1,Ð.Zb*¡,@EMDM4ÄTÌÌ›… €š÷1¡ 2ßTÖøíVx'æÅÄ›oüÜšz÷Ì÷õ»v]7‹kW&“�*r“sî‹£Éäk"rîz.:ãØÙÉçnù’³¶Æ» :ïÝOs¯ê»È»‹{Õ¯}ó¶kP4åƒ6ýÚ=¾¹ókÛ½ù«jpˆ¨;Â[sxãë�Õ#Wˆ”¥QçœwEéU sê¬pN\Qˆs…8UqâÚ£º¶[ 7ÒæFŠ8—²"E¥Í¢4‰É•"bâÛ²I5+­´ÒBÄÀTLÍÚà€7ï½yñ¥/¼·ÂÌ&fþ`ÕZ¼x™ÛfÓ,šÙ¦lÜ_DXËâ�-¾­*·�dt›Sýò°~YDnæoî ÈÀ~é™oý|±k÷Úx¶˜ïX_ß\ªÍAÃÁàX¯úøÚÛ#µ?`ÑØÀ{q¢ÎiQXQ–V•¹²0W:UU-TÄ©‰ uû¦fæºÓ}„Û}qm¦šøüÛËb([²ÏßFÃʼnˆyQ¯æDÔ4 ˆ�†kQQ3ïͤ-hÔ7�ZS;ij1ߘYcjÞ;'kUé¾QÅe¾öŸ\__ÿúʶñÆdi¼{yeeçûÏ:®w+üÄó?©žýH"àû©S/¸zpÑYÇÌy'à®ëµŸüÕb÷Æîm·­Þ|àælã3ÛQ ‡Ç7Ö<~³^»ßl±q@móJ k¯TÕ™J¡¥e)EQIYV…©sæÅµ¹�Ù¹ÂÌLC!dÌá3ó.@DÄ*)9 \}¨¨švõñ+¶y•jb1ÃÒÂvJ»ý˜ »4/â͋׹¯ë¹Ô‹Z¼÷)ÚàEÄ©«K-׫¢º¡”Á‡œTœÏ_¹Ñ­ŒWv/ &·ýÞ‰E‰{³ßx•nllêÆÆz±ci´Ý›=°ñͩӇ­oέ¿R”ƒŠÁpÙ\éœ+E‹Òœ+,,Nª)‡?\á«SU×–ï‹™v%ÿá¾_}ûѾ]¥œ¶ë—o×7Õ¶%€uMÛã{Œ&´®Ú„Ü8KßDÍ,ÎÛOoÃ&f¦>fX\VC|ÀÌ›ßÔ®ž/œø¦¶f±^onÜÖÔ‹Õª,v°}ò­Ñxô¡Á`xyÝØõ;W7¦;X±ñ°² _ücþ÷s'ÿå•zÉ9”‚À]É+>þb­­vߺíÛ¡£{,&_]ßyòútõ¸õù®•ZëÞÉöFüÀ¹Â•e¡eQ¸²¨¬ÐÒTÅ9qêÔiL—¶t߬ݬˆxsé .aƒîÿÕLÔÚ÷çvWˆ©¹pÇïÃL¥½æ·´]Šå“"161íHcF�J[L¶`月Ô*Ö˜4Z›·…šoÔÇ�–Iã¿hÛm^w–2¸e¹Zþç•áò‡ß\ú•�ÿrÓ�ø` FþOùkÖMì7(À~c0î˜N§l¼?öú[v^¨^ ÇxÜG‡Õ’3) ‘¢u…×¢0ç uñ"ßµçkQ ‹T8zÇ*þ¬²_´ `·hkÃ>[ù,§‰¶}pÚ(‚˜uák×EqíÚ(æ%¶ ‡ýØN0f½‰ˆ‰º*oc Cb"^¬ÕB )Í_XQosZ­8߸²Ðz!îÖùZ}Ø|¶þPWº[&ãÑ·œs_Ž_ýˆÙ��M¯û#ÿp×ò{zɶÑhTmÌÖŽ[©¼ßu»¾yD]ûû7¾9ÚËü>uYæLœ+¤tƒ¦,*+Š6�¿ÐB�í.£=Ê·Û/"b®�ß×î�Ú㷤͊„ë•Ðò¨ÝK™¦ã¼ù. ýX ƒ’ÚdHë’»~€éƒ»�-µ·2mAmc N´ˆÛ0×v0o¦f¾iJ/õ²Ishc³z}ѱ1[½w#õ1‡Mîy­ª»fP>sÙÎ7]wâgR.ƒýا=öu[ZÌænlL·�&£zÑÇoÎæO\,š{z§ƒ¡+ª�í¡ßÂßy—ÿõï"Ë¡?üVÛ§ÏÚÀµt)gé$¶ó ‹T€kÌâ�×ò¦á³º,µ”І¸E5â*§bš­œZ´¡î.KÁDTÕƒk[W¢î1nVH5SójÍBêÙÌ7õÜW¥[ «âk£ªü¨yÿa1ÿÕjXÝ<V7ßû¾‡mþÕ“ïÉaq?õä7}±|ß™aÔ#ì‡Þþ¯oЫ¿ù¹Ét±~·Õém+e58j0?ec¶ú¨µéÎ{­Ï×ËF½+ §UYJY¤,*)´U'a\Q8€«Iºb—4è(^†X¸„Ðl£ÔìµÝâÄÍSLgl3$Õ,tô×й�+„ÍQ¾KS c•ÚÇoS ÚG³ngfji÷äºII{°Bðm0À›o|-MS‹÷�Ö‹Ú|-¾,ÊfR®Ü<.'Ÿ±wšù/;q7MË7þȶCÖóøÿNy?(§]ði]lNemcQj5xX½¨OÙØ˜>rá›{›ºƒ´íвjQš…9uñç~¸µ�ecíŠsÌBF¾u+]l1+Ýh?ñºùµK]ø¯ñ:¾­HƒxÅ/©2nK4Û¶\ïK\ b\»ïÕðœâ¢Ú&Ö™ ÍsLÃÊèÓ×në ¼ˆ¨zQ3gÖ®Ìa ô‹¹4ÓÍY3�îVñ;Çãêšååѧ˲|÷`XýËl^oÌÞê×C `?tÒ>3¹ô܇oðNÀþá—Þ÷lu®,–ª¥ñ´Ù|ÈÜÏzuzë1ë³�‡Ö^'Û\é†EYhQ8qΙSgaVŸŠï†ð™xí*ó5;‰‡ëú”èÇ"¥‘èš"‡TÊüÙZ;6©Ý?¥¯�®Z¶ì›´‹´›¸°[ò!ÛR5}M-Ú/“ TÃÿ‰Jjí$±«€‰7óÞñ¾ÑÆ7Ú,|mµ­©ÉM£brë¸\ú¸¿}TM®Þ=ß¹³*ªæ¿Ÿö�ì�°Ï¡ûœÉd<Ù5�ßWÍ?bº9ý‰¹×k¤¼¿å²¥¸jhZ”¦®“úÒÏ÷ð�ñ¼ÚÎôašÏ¥¿nµ_F{ŸâÞá\�·ú—pðëftgwéÕX¶fO1„س”º®!k˜ŠÂâØOÁsaF�¤šµÑr n¨cÓrbV²;|mcq¨èü°j³øÒh<üÒd2ø„ˆìäoÞþçÒs¾qòùW•—œ},™°–î¾9ß8þ†Ý×ÞoºØøQ¯ö¨…lÑèb(…“²XY ¬, sa´PœgG‡[~Õ|?c–u6NÕ÷&Y^bÖ¼_Lzc‘²/c¢ý(@¶ñJmº¯“² bOÀ6añ¬/mmB¶MÒnËÖËç h·ù‹>¢ê¤p¦¥83)­ñÞº(jW(Þ\ØÂ7õêaëõÚ¶j^}yX¿4,·}ÌÌnPJ'±�!û„çÿÃÿq×~ëúÉÆæôîÎÙ‘æý£šÚž1õzÔÌÜPµÒ¢ªÌ•¥™s® $‡Æ3¡Alì$ÓÍßÓ, �N×Ù9<œÂ5T𥲴ìç|ÌíW ‰þm…�o—SQ*Ù4”Æiè ha ’05 ëx¢××¼.Õ ,W¡^ â"˜}µ˜~ "©©`ûRBÿßÎâ1ç i£þfM][³˜©Õ3)ÄûAé®”ÅǛƿݼ|yyi¼^–ÅMüŧ‹ü~æÔ ®ž\tÖ1dÀ>èw.Ñp^Ïî¶{cçÞÛÜ+nºX?f£Þ}àÌæ…+U‡ÕPFÕÈœV’nËÕâU¿¦ó»k 5\t]‘}¸®h{Æ›ø°# ó‹S“>õÚõë�[§¬™ŸôâÖí\Tãç¦Êvb t=’» Cï4“ê:Ãcö Ö»i_]œâœ7mÖ8´@ż™yï¥iY,Z×µ8ѦÒÁm7ül¡îo†ÅäªñpùÆa9ºå5'¾…`:w„Çý·“ñÒòúúôÁÓÙü¹Óùìᳺ>D‹Á�H5i5”¢xuª ÁbµX~îÓ©º—Z>ÅÒÕŽò³´.Æ“~?’Ñ‚™zÏÆ¦¡ÿ_[ Ðö°éjR+œößÃÂÙvÎ çwòßÂzèTºº¹øtÛ1é)§Ø½“®XÏÚ³¾Æé!$n!Öß(HlR¨ª^Ì‹5µX=W¿˜/¬©W�ê·Gƒêk“ÑðãªòŽ�}é_¿þ؇©ùÕÇÐ g?ròW¯\rÖ1»y'`ï÷Êž­µ¯õòo¼ÅqØsîgf?»kãÖGížÞv¿Æü!Z4KEUƒj"UY‰S׿ÂÇ Žt:63[îiüÕ^h˜¥ôøP«h! ±+g ÛŠvߥ©uq¬$жòP-¥G¦�Š¥›së*÷Û;‘X’7Yav2Æ*åÛ%Íš„Žil+J ⃇ëš.v^¢Šï6[1!©å 5M#MSËb¾ðM]¯•â®Û6ØqõÊxÇföÞ?=íí×ÿöÅ?§pÊÿKFß«“þü#“Ù¬~øt:?v6kŽó¦�«M¯Õ•E57z-Ks®hoüÓ‘6¬qYBèîo’Äv…þ)`œg´Åe©›@ú¦5Sò@,,ùû¡ë€¦·åÿ”*ÕÂǵ3®ÇáK‡ÓFáÓ×Wµ¶ë@ „ÐEjJؾ obª>>k‘ÔS°Ë˨i/æMšF½¯�o*M#…È®ÒéWÍìcU©Ÿ^¾0¾zÑ9Ÿò·tÿqÊWm¿ø¬cwñNÀÞíuŸþµåÝë»�þöÚ \�í>VÌ=fÞLïר|›+ )ªÂªª’ÒUâ´1‘Æ{33±xþ•nÔÕj»I€ØUȶº­Nê­”ÝËwGkÍN1Ñ Ü�¨úp¢×”Þ¯*">íV´K{·qÝ!]òù̽gnnbû§Ô‡PÓî)&f†@×ÿÙbxÀ4DÂ'o^꺖ùbæõÌ*Ý8pãvæ?1©&½ûòaWuÈQ×?ÿÁ¿É% ß­ŸýŸ_Òµõõá�·î: ñþÁ…sÏœ/êÇÏv¤Wj5W�¤("EìâbEZU\ÕÆq¶J´?¼Å\g#YöY¨ñ×´ jw@×6¸`áH?€žúÌfýl%,4šZüµˆTׯҭdíc©H Mѵ~€PÜ`Ù�òH£R DÚ |JHÁùØÇB^3q1±ÎTÄ«ªªk£(õ|n~±P«k+œÌ…^5¬ÜEMã?ܘ}åàƒWn>üþ‡/Þzâ݉xïN=ÿs£‹Î~�ØË¼ÿú¿ÖO|ù£ƒknúÚAKãÉCƒái«³�OX�ïºÿ¬™—Î2¬F2Œ\QmaŽübæM¼f ü%¼»|êÂÞ%ìA,åöËÖWjêÚ×�þc�ÐT‚Ÿî[T,MTn·k]Á<¿?µÔ6¹QzYŽqs>(Ô h{èj9ÛýOûÐîÞ?¾`ծͲiVü)Ù#…ÌÍÚ×¶>_óóÅL�w2ÒÑú¨˜\6©¶½GE¾àDÿÏÝ—½íe'ü%�þÃÈë?>ñf÷¹muýôÍÙâ©‹…¿�iq  ‡Õhb®¨DÔ©·ü‡sÖ&&L¯‰sðÌâojJ‹çý4Ò&~7X¾äXÌHKKX,R7�/û ù÷W·¾¥jü�‚Ð]ö›ˆ '{¾^w]¯¶u‚M×á¿—R"öÙDƒ°¸µ¿Vt‹åyíWòqtަ¸»‰¨ÏBéícx¯M]K³˜{õõz!þ6§öí¢pïÙ¾mü·£Ñà:™Úô¢_dÆü~ñ=ø–/—ýü©eöaÿõCç¹W<îõ>ög¾÷ñzÈä¨ñt6=ìæÕž=·Í§ÖÅüÐZŠÊh0ûA1”BŠxâ—í&Äw‰‘ápŸŠ¤ëa.òã´ÄˆAw§ßm4Â¥…Y×S/n”ÌÂp¢^k@3É:ݽ{ð‘dm˜4êEÌ…ÈCœ%ØÏÔ�¯Pû �²ÝYW™¥U†¬Ðˆã ²–ª)ë2ëѬޫoêf¡óÅÌ͵™×]#ݰ­Úö�A1ü»Q1~ï ¬ÆEóÊãßÊþ{ ¦`¯ò“ú¡ÃwolüøætþèEc'4⎖jXÕPŠÁÀ\Y¶áéö€o]ÿMÃýº•& ”éZþµ�â<ì;Á,V›eiiqå²Û;ìwËU÷@Ù:—'þ‡$¸Ôа{>yGÚ.ãÏ�]|¡æke7gË»Ñ_XÃ3”lÖa×-§ M´�rUW¨VÎÔbM½lÍ|¥n÷læ‹j×m‹Ù¶üÙ¥¥¥+Eäkü-Þ÷qøö}þ÷/+û=äÆÕkyÛêÎ5²8AJÿPQseYYU |Y ÄI!i³bæÓ® ›@”ZïYÖaÈÒî# Z··Ê'§ny²e?/U4íOB c꜔ïaâ–$;ówý–¶Li q"sz qZ`ìè— `N÷2qßÕ�ÿ»WG:¥×¾N7ƒ9¯HÛ¬¬¾Á´t…+œZ©…/µÖE=ßQûù«Íê=‹z}4ÐÁ¡-üé%=à‹"r#‹±· {ÇÁÿµï«�Þ£ñåãµ=ucÖ<¦Qw7W ¥,IQ œ:Uï}ì‡/F”' IDATRíÓéYSN[JI“6áM»¸´…I³’zê[èŠÅ²%NC ÜÒ*Óµâo¿}4\Ú[hñß•Á¥4~ÍbšW»øƒfÝÿÛü².œaaèn¨™ ™v>T%hœÏ–ùذ@Ú<½t퟾~ à²Å.Çm?ÚÇ4�Óu�Qõæ½÷õBšùÔùÅÔJkn[ ?S–îÂÍùÆeKãѵ‡Þãðµ·?ïþ"÷q'¿áª•KÎ=–Æ€öÿå²³ÊWŸxÁw\Ÿþˇ_°üêãß¶¶7<××â·‹/ÿÛ—·íœÞr¯ñÒäé‹zþ”�›·Õh³<l<ûa5ÒB g�hc¾mœŸmðUDÍ[Zç³Î{ý¾øj -öî [ª°™i÷9qc�²Ì,6T ‡­’6Eù¥ö?8Ѷùqû$CÅ¢æm˜ÔÒÕ®%@a¶,é, ˆÅ®‚ñ¶#¿6‰;ž. ÑÍ4³Þ@ÂöÈÇ7-õ,(Äœ:Ss&fºhæ6­§6]Ì ×:’ɵۆ+ ÊÁEµ.>å wý_œúžß…øas¼øa:õÏ?©""³…jÞ^8�ÎÎZ›Ö?éÝà j´Mã)ÊJÅL¬ñâDÄ©ª8U¯¢>6˜M?ï-F¾C»S•BÔœ¥FwVÀ´„u‹`hoë4+ˆÔœ¸ºªˆ¨½f%-¢±—¿ÅÐ}ª0Uõ4ox[j³–¸üÆ×Öu ˆen*ª1î_Xìè´��^ixã8`o"¾í~ãUD\QVn0Y’r², W.ݺ¶qÜ­»w¿¸ñþåÞäqë;Nzý'É0ÚÇ]rî±»O}óWx'ìË~÷²¦õèß;ü‹ˆì-‡ÿ߸èçÊ�›;öâO¨}óû7íºñŒ[7o~ +u2o“ÉhE‡ÕØ©w®Y˜š÷¡ø=Ný13õó]Ï£v›¢é—šH»×P—j%ÅÚV€m;á¶Š±­)�.a>ì¿Ä‹š�— q0@Üiê—naÚÍ]û…²XC*­‰, wŠ�œSugLˆ•‘ÚåJªZ¶cK_PTTœ™¨75µîhßN4§b.…ÌkJ‰°ØGÉ©ˆSñfÒXã¼z-«Ê-�–‹•ñŠUUe3¿ñ#7¯Þtúm·ý¢7ÿ¢º®ù�‹_À,~¨ø ˆš3ßómwÃõ×øo7ÜxÜt>?¹P;©–êþ�.ÕÀÊÁÈ´(۟ʾ=�»P›î%�H³¿Äé‡ÿ/vÌ\ £Y½€„Sn^PßëÚþ׺Lù¬AMöA]¾›t3s->›4ñ&²§œ=•øüC6^8«·_«ÍåËÂú]-ŸÅ\€.! ËÙ‹Å~a–n–í&ÙoŸAט Žòé%0¤Ž¸mY@; ·žÏ}=Û,Ä×®,ä–²pUå‡Ç£ê3UY\uÙKµÊßö}ßýеٮ‡ÏÓm¶¹²”a5lÊb(EQªÓöâÜû°�;‰Ý|,ö¼“îlçì¥Ë 3ë§f±�nžfýýS�¢¶éPêMdù¶¦k˜}�¬kqÜœÄDþPj�¶Nm>B6§©ý,×ïÈg·ŠI5Œ&](#½0Ó®ÓS·—Êà šÒF%Ä:ÚNRÙvNÒÖ0–˜©:§…¨ªxo¾®²˜ÏÝbѨªÛ(]ñ5õrÑÐ�ßw䎣®|̽Ž_?áÈçÐp×qÂë?>ª§³Cóù1kÓú9³ÆŸÞˆÕDËáØiQˆº0£EÛ¸³zí"Íݬ–­Åe[êÇB™@Z¾Â…¹³în>Þíoý©¾õ»#�õ&øå±ìPHŸeû‡U&â!:n§‚þlI�™zq ëçÎå p$��.k!ÄØÃS ³n­k{(]çœlÖ€©ecº6;.¥Î¥§Ÿ¾¦j›Ká›F›E-M37µºò¯“²¸\Uße¢Wm_Y¹õâsŽa¡Û‡�rÁV.>ë¡»ý§Õ�ýÒcø³°WûÍ+ž[üÑ Ó|¯ŸÿKW<݉©5M­¯?ù=þ•yÉÊËûwZ0áµÿ/zóê ÕÍkÿv�så£TÝ 7êÝ?¾Ùì¾›ª¸j0ÒªŠ“ÂÒ:ç…u=v²“töï–&ïu‡è.ÿQûÕø1" YÕ»e·Y›½¶D2v H{íÖ-ïÔg1[~1’¾\›G�*ò»€z™¤±óÚ‘FjÙóéšùŚ̬‹av˜ïšI…ƒÝTæ˜+ÝætŸ»¤=\l©ÜNPð²hj›ÎfÒ,Viµ>pƒw,UË=Žÿyûö•[_ñEI`ÿ÷˜?¹¢(«êA››'ïÞ½úÔ…/ŽÖj|@5YWÌÔu×ÎáÇuøÁ~;)l–£»i.yXËzË„xˆ-kvî�W÷ù”Øv‰í³D³nˆNzxëô:ÎÄ|´Ø^ =€iÿ._¶öÕÑXâ—gÝÚÐ$©+–ÍZÕ†x@ú¶×Ô"1ÅFº‘?é‘CþŸKÍSsŸ,�@LœŠª31“Æ×ÒÌçb‹Ù¬ôÍM£Aù¥²to•w|ê7·Îßþ}<ðæÏ¯\|ÆÑôø�øÛ/ÓËþàUO€}Ì/\zºþÙIïµÿú±³'¯xôùwÆc¼üò— ×g»Û5½ù¹³Åæ36ëÍ#Ì-¶—ƒ² –¬( Qõ�uî¦[/ÅUºþøš6P½ Å®�]¨‡Ìb íéÜ©¨¸p¹¾VØ6¥µeE†iˆ e›¶=úçÅY€]#AÍ&§¸€Šøø…Ôâk ¯"ÍNîz,i·{Ó”ÅÙM#Ô¬!íÅI˜‹`qŠAÜCº°k³lö²Æ‘‚ÚÅY\ʇˆ��´k+˜:¶õMã¥^Ìu¶˜yñþÖ�VŸ9`ràÿܾtÀGæu}ÝkOz; ;Aû¯ãÿŸŽ›¦yØlsvòlQŸ<óv¬Tã¥r¸dE50Q§f·Û˜F%o߯YÛþzÛ¾H–/Ýš˜ÿÍO ø4 +Xþ­×K—Uök>§oÏ6ü]êZxN.t̪,¶, ¯A5-˜f·óý™E­ÓCt‹êžó´‹HZ˜D»Ï3ëÏé 7°Ôù'UCX°Ha¡ƒ€8u!^â­iiæsg‹…UÚ¬:i>¥êß½²¼tñ±Ç=êëþ“Í÷aO¼àêá…g3ã�°·úå÷Þ9g""Þ{©½·Å|ZøºÞ5Ðá‡Gåä�.xùx8úÖ+�+{#Àþç¿á²™>Ø›´Ÿí†Ð›¶ÕþñÆ>Uœ…d¯vÑj›Ø´ÅZÝ\€6ñ=¦�m}BqŒlì*›ÓÂ#ôW‹Øî6&ùǘ³vÿ›w1Þl!M·º»I¼©H®ß( =‰ÞΞ^ž<ÐŽFØшËaûf†>½ù”3éÞ˜,8ÃéŒßU"d¡µÔ<Àå]�5,t&Íb!~1ççM¡öõaY¾i<]Z Šo–e±ûÒs�kø®Ø7�ò¦«õâ3)é€ïÇ|ì¥åÆlzÀ®õÝ÷]_¬ž2÷gNëÍ{y­m8Ú I¡•˜—® �šˆI~fÙ£®„ÐÅFi“#’Wð‡#q¼6o bÅ¡9Ku“y«póiÞ’k+Œ èm›ººƒ,O@BO£|§ÒvDÎz2¥+úntQÌ;´¸iÑ<&�ÝþX–¥éBŽcØß8Û#ÐË~H7ü[ï_,5QÒ®ö?L(HoP7tÀI;Y)D0ºûœÐCÚ9'N+?¯g:�m8?÷ó�>°4X~Ç ~xTL¾ùÚ'ýÍ&ßøA` ~0‡ÿ×\X™É£ê¦ùùõÍÙSæVÜÏ ·ƒñŠÅ@¬ñjæcºé·Øq5Öd…Ý¡-}h\¯y—�é]]E˜ôrÖE�õçØ¶ÍÃ(¿0D Ô˜õ[öŃº¦¨ºµ#gÔÚÐu›kŸVÛ®Ç�I¾¤™„]ZþTL»\<‹#gTÌ·ÍC÷[‹áŠØÓ&äŸY¬.°×µÐ8$ tïmë²wÖ²…5¾Ü.�À4K²‹�5Ì&ðñ—ŠyqªRUŒ–ÌUã¢öîÞëÓŹ«ëëç5Mó˜¦ivð]±ïºøÌcì´ÿñ¦<?çþãÓ¸¬ÙOÍæóƒ›fñ„]³›Î»ezÝk‹]÷ÐÒËx<‘Á`¢N«¶K½zQñí^ÃR¾¹¦y¬64ufæÕÅbù®á¿f뼪¥›–´‰0m;¹-‡Í»ë·÷ü]Ïþ®�°„ý†Ä½Pl±díØ�U˜²Ç aé.)¬KÉïµúÓîÂ"Ï�ôbí–1õ]Ja‘4áX²ì‚öòhKùf¿˜ÂÅþ –>%½¨ôRó.Þ[Ø«i(­"âïµiæEY–n:Çò¹ÞÁ?�õüµ¤Ö9ý>Á{¼á�¶l@¡…ºÁHÜp2´¢¼ïÂÛ)«k›Ï�Ng§�ðgŸ<’ïŽ}×ÿzÑCë'þå•lV€;Ù~ê]dÛü~ã’çüÀƒ$¿ÿ±_Xþ~>ÿå—Ÿõ€]»žzý®kvm±ëÄFGeQ ª‘Uå Þâ«™ñqZ^68m:4¿FÏæ|Œ}—-¿õbCÃÔáT§hÖßÕX·7H…Šïß5K*è.í-ÝÍ·Eœ–ö$Òï¤/½3½æ úÃnPz5¡ÝÍ¿æû¿®ó‘e%*ýÛŒ8ÆH³B†¼â–ÇIùî'½¸nOš³½­IïeÜEu7ZjâUÄkᜠ‡#©ƒ•Æù‡ìžî~êî�Ý?£âŽÿ•÷?o‰ïhÜÙˆ*ãNuüŸ~xy¾9}X½hΞ.ì'gVR�&ZVCçÔ‹ï·ªj;k6v†�I`ÒÕ¹I~̵ì竦Xx¾XˆíZº¦3m—ÛÝžg�`-Æ“UúócÓª]0¡×½¯]~BÛÀXç{ÑåTÅ/’µÞÓ˜P¦½îùíÚÞH¾@w�³ÆyJ\„ãgøð9Ý”žváM]þc|¾�–‡ÄŒ|þax$m{ ª‰™Ko•¦R‡ðO®0“f¶©~>ÕÂû�“aùɪtïóŠúk?þ'ÌùnÙ7=éÍW­¼ÿŒci ß…_½èg†ÞÛ=ÍÜéë³Õ§Ý²yýÃê¢^ F6.'R•ª¨šút�5¦!å¥|10$²÷öI©óp˜©²Ø-ëuo×㇉ÆiÚM½Ëæå�–z ÿ5o»œ²þ{I]bjÑ×Ö!¦&ûNÃÜ>‹-øbÖ~Vó¨±+ µ%ᙨúpÙJ^yÙf;äÓ—4{ú!iS»¶Ïá.Jò9IéLŸ^~j ˜n ò6Mz;íLµMNU'EQJ]×~:�úÙÆÌFnrͶáÊeƒ²|Ûd0øü�òv'ãNCî4�{íJß4�öâ~~:·ÇÖRݽ.¹b0tâ ×–s9iirÍNúm4 K¹².ಓ»vߘû–5ƒ‰iaÝ}½¦f­¦ùéÞòŸßÝȽ<S ¬MUH½pL¥Ë“KYy¡JAc:XX8´«æ×®ÁŸYÀ0íÊzã²:ÙøÂ8§ëÅk!£¯=ü÷ÄçÓý(0iùiÈ\HÉ¿~zÓº•T­‹Ê¨iÞ’'T´�\9�r¸dRŽ—7gþ›ÓÅó½Ù Ìô¾[ö]ï?ãØÝ§½ùêÞ ø�5Þß§öõY·nÜøü[¦7>L*·´m²Ãoïðƒb$bN¼©ˆWs¡Ô>öÌwyá~8Uç­|{Gsq픞t)Ÿîÿ-~¸ûmu-‡Ã)ÛtËæ,¿ÉÒ)%Þ¸8J(}|¶Å ; ËÊüã†Ïº;—î·ò‹ : ´›Bë]âgMãU¼ä‰ akCDQßîêR¤¤íñö¦"ÚN¡ŽŒxQei˜““^jÃwºZ�»%31óÒ4µE¡ãñÄ '£jª›÷ºuzó‰µ_¼ öþ‘¿|áÏ�a‡; ¸SœòºO¼·‡îšÎ~vZûgÌ}y-FU1šºnΟ¥s¨…VsÚÆ‰S}sM?@{Cèz¹aÒ�ZÓ(šx8×Û�|iŒ±Çž‚ÞÒô–=®¼{uûùãªä©f¶õ u \/L{fÁ MdRïþ´Îh×w6šcº%?ÇIׯW²ûíýƒ×®‘Nš˜ýO׫7¯pÈ µ7;0=Ã6… }ò)«A UÓÆ[3Ÿª4óµBýW‹RÞ[úÞÍêŸý¯¼ˆT×}Ô©oþüø¢3ަ�€ˆß½üEÅkžð?ö™f²g¿ö$-ï7yøÌÏŸ6õÓ§M›�#½ó£ñpâ‡ÕМbf®ñíµG7½7eÖYš�×^hjf×n=R6@̨×l`Oœxlùv¡×ä^{sÄDÛ>*½ÜŬ¤Ò²�€J³H¿c¡³öª­›i¬j½�™m­-4ÝÚ™H{›Â0>)í¹,¶BÌ£ªù.®÷r³¹šfÊvZí[è»\‹×+ª©›áÖáÙ¿÷’DUœIþ{΢ê¤ñ�lnnèl:�Žué[“jù½Û—vüCYVŸû£'¼uƒïvÜÑÈÀî§ÎÿLµXÔGLgóÓ‹æ„Y£‡i5*ŠÁ°QWX:Ÿw·é]͘m-Ñïnù{ñf‰óiã%¹—=ûüwqî,K³õEͬcˆ¹_šnҵמFóçÚÝø§à¯šn ¬i—ß g­úc7™ì»n=Úk[+m# 6´¡½~i7 ½à| ,d!µnª OuÖ5$´l´¢n]¡»tK£BL<¤ùilŨªNºL§ªÕ ”Áh\k9/¼>¨iäyMmÏÏïÔ£ÿøãC¾ƒöM�qôæß|5~ît¿rÑs—÷†Ãÿ«?xîöïæãλð™C÷€É¦ÍüYÓzó¹«ó]÷³Â'£‰UCS3mê¹k¬ÛËX¶®wMlÞ¯‰õ÷]õb^˾¥ö>oa”ζÖ]¥k¸§·´KEy_eéÝ�dŸ¥*¦[ ø{ÿªåÓ/Éû‰¤æ…±ð1Í>ÔîОžG÷ÙíŽÃ‡½¡ÙOVòMhh“œ&7ÅP‰e™™m’@w�ïçFÆ?ž~Ó&�UžÙ+·8ß0dZx߈ùZª¢´ñhÔ ‡ƒj­Y½÷ÚbýäõÙÚÓ7××�úíw¿`Äw<`¯ö¤×ÜMgó{Öuý¸Ýk§Î¼{€Lœ+*Õ¶¯¬S3§>´—Óþ€{‘.ÑJzù[qä�†æzê¬k�Óš5­m:»¤Vx¢]ÖšŠzk§Ï˜¦u¥]~Tœ„<³8h£Çí’ëÌÌÅ•7ï½×õ¡éÖC|ZñBCÃì´¯yZÃot{ ÉY¤›îÓ›�«ÚµHPU§ÚK�‹™‚–/Yá‡@š†Ó½cY>`x¨Ð|¨m» ·4ô‰Ño©ßa—8çT¼yi|-Å Ðj22 ªYm‡-öt19¯ñÍýù.Úw]xÆ13Þw¦_{ÿsF~¶k¯È6*Êâ»ÊZ󾹿©ýÂZ³ö´ÝõîC‡UU-�–dT TÍfÞ¥Á±ç|×v¾«UŒ“{; Iƒƒâ¤ PóŸÏJ•…ÝåBœ ÔþŠ––†XVŸ7Dê®RÔ²‹�B=Ò¤¼ü|?9]žçw ÚÝÔ„2±Ôö¸+ÜL×-ùÉ:ecÆ;ˆ0‘/‹ „±MÝ8Àx¯ªú R0!/™´ÔàOc+@ ƒ¤z½ 5ÿ³2ëÆhŠj„mÿÈ|Óhé*7-ëpTʦíºïÍëß>u¾˜>µÖú�¿ö¿ž]ð��;õ%¸Ã<ïï¾Y¬¯î:ðÛ7\ÿØÍéü§¦¦0-ÇeQy-4›3ãz§äTuãQ–7À³ÞÊKÄöhÏ— Š‘-]²ëð4�6[k$››bΖÕd“d¤?"¯ûtK¯Bcg�Tž [êçrÖ_÷ºö2ÖÕ´¥æ²Ò¸5dÙÛ–/#ç!ãM»«ü,Ø ½Z¾4¹GlË;™ZÛHÿý1¿ÇôÝ#öaýÁ‚Þâ×TñæLÔ´ˆxÕõâ¾›³y)jkyå¥ÿäG+Ÿúçßxåû¨SÞôÅ¥‹Ï| ŒÜá^û¤ÿoº·<—©oþÝçrÞ;ž©~ÜJx¶î}L÷Ù㙵s¬ËâWë2×ôvBí;ß�Ý …û])€Ý^Ø"~L–©`1­ÁBàÁ̼™…ö:âSo¢�©ÎÞ-jsâ W Æbå`0óvDÝøçúÆÿl±±ó�GÿÞŤ“ï£.>ó!ëOyÛ–y'ÜQ~ç²3÷º¾UξsœúÜ‹ž>¬'ó]øù³~þüÍfí^®�j2\²¢83U_›˜9+âN¡½'öq}O„é’ÁLSî|6Ÿ8´;–¬›ðÖ»‡˜†õ~™:±T³×í²YB{n$lK ¥v¥’¡æ +�×¼ÓqÞøØ¶¾Ø,x‘gæ×.¡¢qkúhÞH9ŸÎ§ý�î6„sK{”³.ÒYÑc¯âRúïn¨Ь¸!õ$Ý«c7hi_n»#ô^Ô{of�oÌ{¯e1p£Á²TÕ`²é׎]¯WO]ÝØõøÕõ]pãµônì=ž÷�ß®­¯uë®�gm.ꓼ«†ƒñ’Vш+âù0å¬ÇtþxÛÞ®:±½jvõoËÒͼ¨õ#¬:Ýo­d³˜—¯šÏ T�1Ýìb:«#èwú—®y_û,œ†.ûYïý4~V³.})X&Õ¦†j©qAž{ÐJoÂ`»Jøô”º¢}•,�-E âÚ›jãz�-ÔÃ…Ì9uíp€®h-¥A¤O ¿²ô¾n,¯fÑÿê�M,d�BÞ]Îbo f*ê )‡c)GËemî�ºnžf&¿b"à;kßõž2íê.-Ìmpṫ8sâ¤+`õâÛžZ”• †cqUYÍüô‘·¬Þô3ëÓÕ}àÊÏ/ÿÖ¥Ï"Ø;|õ ÿòc³ÙâyóÆ~ÂÊá�åxIʲ§/Û5ÞÉÇu‹wÙ[êØ{�íÔ¶,¶¶G¡}ÖÙ¾�*ÐMÍÓ®ÎíÜd‡yjÚ›ô§½¼³,tÝéœ=zW–ßE´kg�¿íõçOÝ ºVñClK4¢Ë È›õK^ú�š'˜fÕz*ÙhÂÞŸ·Yм˯öÇ Xÿ�¤]-Uó¾=iµ´�´.Ìz-„³µ4^˜©¸BÜ`¨ÅpRZQ1¯›“DôyÍqÔKßÏb·�ºô܇í>õM_ �€ïÙ˯8s¯]¼³Û}n¿úžçm ÿS›‹õ“æÍôS)ªb¤¥–½ùÁyó]ß«²O별ÃoWTží™â‘6»ÈÐþ�»lÕ˲ow[]¤,j¯iÐ}Ý6•xë¢Òí­¹™hHeËŽ¿éŽ:$'äusªÚŽHÓsÚî÷B¡0_bÍ}[´ïb‹Ë«Ö¬[ä-fòõ»ts»wЍ[[Öüß4lýœ®öÎI>ÜÆzcô;ô™ÍÛãkÞã°ûäî_â·uÈl|ÖÚ5îßã©JœFÓç×ó–=¾tAùψ1„4î  ÈÇŽ~é�+„áSý_wm�]jøÔ48ë��ý)÷«,ÚW佘Š8WH9©y4Íü¾ÓéâÔªr«�ø“¾«Î?û±_8™ô·}Ðeg3;ñü«Æ—�},™ö ñNú·ßq¦®�n;ns±ñ´Ízý‰S¿q)tT+]•–ð|«rã´7§/lnâÞ$ÛôVý-I‘í‰6˳‹Ë}þUâaÛ, ¤Ýž)K¤—,£Q³=DÊ«·ì2;oÀœíÆLu�A½Ë´�Ò.sѲ'¥ñò<¼šìEÛž³dKŸcÍ“-ãE}z áý×n¤Txc³©Ùž,;zÅ‘á� }ýt�bIëmÏ4î»R(é�ˆŠµ¬]Y„‰7/NUªª²rXi=¯ï»±X;áÿgïÍÃ-»ªzÑ1æ\kí}Ω&]%$`BiˆéJ# !�tšD „"ÊUï»ô*Âõé§xAº\½ß÷ìé�F‚ ×  è!}U�nïÕÌßûcÍ9ƘkW¼€œÔ|Ѫ:çìf®}Öè~ÍÎ¥ƒnyñû¯¨×ç«ÿú?.~ïX�ñ^Ž1ÆäƒãK·ç®='Íëö±MwRð“íåòbö}RaÄg"Ý[æ 2ÒΘô´égÛÊxÙ~[ÿY6Lúü-ŸöÜOr˜K»n$H‚ò¦“„zŒPž£ÖlÌbn`T À† [ˆŒH‚|Ý€N³«’x "ó">¤`�ét(¨Ü ëÇÔ¡¾pusíÔ•ê�q‘;Æ8ã»—ÿñ?q]7+wíÙ÷ˆõY}©Ÿ,QL—ÉùJ�\ì9JÚ€ÁpÌä’^<3õN3™:œÉ]q*«RzbÄGê ÀQ?ÐIÖäåXeÀ›[mÌE`í’UfFÄt�(_Lä˜ÉqdëGˆ^RÇ¥†½‡‹‡Ÿ2ÊÈhÖ &_žØBøã É®WÞuD–e@²tN.%‘8…èM9Áí8²ô S3.ÙΙDçy=&}@k„˜L]Ìw‹6Bz^’kÃ:†@.G˜è‡ÄŽQTU(ªå¢nè~󺻠gáØñ·p žwÚÆãßô™QpŒ&žû§—øñî�áK ¡ ǃðÓkõÞKWë=÷+Ëår¹ÜA¥ŸŠúQ¬\8wþ•˜VjïÇ´N4¨¤+NöH-rÚ^ÇeHlŒ�¬"_Dȳ¢)Y‰9‚™EXšà¤>Ó¿kYzÒ¤KP}}�© @²%†üTò1þ„ìœzG$Λp�‰Bh BC•b¯§@ß"{Fy™ŠXµÚ�@nºDº�‚úb÷ÚI±DK“*ªòàÕzßYwmÜuZÚ¯ýØO�÷—1ÆÀßùø§/üãÁkk�ýyÁù£‹ÉRé‹*9ûA¸\é~§‰K'ÇoF¤Æ2–²Å;YV ÑóÃ33b}4íZ{Þ?å´·ar•ìdlîe½V¤fQ¯ò²ÈõxaVáV“–¨0RY“Í·`ˆ°3Êg�y˜i…q­5…8É„MÑül†Ð ñõUÝ~ ï˜}:,¥®OÙÞ4©¦ì‹ià8Ÿ7v]ûä3õ#§œòkïݶh\õ)³K~ÿs#’cŒ"Þø”wv?ñö'�õÖ½,®øÿ~€¿qÇ7ΜÏgÏXÝØ÷¸í±EUUU5eï‹HJï�âMµóp²Úpö¿L»—É´Š‹ðz“yã^@¶ P.ºñRNvɦmMtüجBÆDÏèg"A<(" L«i�½àd’Çj¢l-õ”% Šéƒí2EŸ Zxíç$Í@C Ì~©”QÅ**VZ° ÑáO¥Œ§ÝRFI0, S’õ̪Xßæ(8àˆiR.…ÉdÙ·ÜÑP}Î�·=ñÿÜúw�¿�cŒ€1¾£ñôw~¥àÂ×táröÅÃ\5%_N;Gè=ëÓ]œDŽÅ �³›7[p—i–³o‡¥Ú›œ�?dv' Ä>WÌ×é�1ê³ép +z“×!²Á°˜™Œ'i‚5äÍm R.HTq¤Ü(¦ wÜ“w ;M`!–!³Џ¾Ì|ÈœCB1¯‚ÄHF€8×þ¿‡OË0Ù›d0.°ÅOÊ›è—䊂&Ó¥à‹rÚt8¾íÂåMžX6ûƒ¿úñ±‰Ü¢ñÎÝ]?î ŸÚ>žÄBüî“ÿ<Œ§p½öŠÉ¡+G�0ogO©ÛùÓ7›µû9ïýÒt[( ÏD´I /ÙÔ‹OŸ2ð�möU y£Ì ü(í1+¤ÖÚÈ ËFŠ¢/òµ‡v ÃঠRc½´0a-BH_ŒôõÈБ±bS>ˆ‚á lÁà5jßœ/tDX1A> oÔŠ6¥}UÖ�ƒÀYß°!Œdá=”BñB «í†F*R+Ñcg… :*¼Ç¤Z ®(L«Ûù>îüÕ‹FÀã`ŒïL<öwþšïüúmG»Â?lÞ…‚+*ª%€…@ÙVYZQgEezeˆ9\¢V!v·º¾‡í3zºÎVuS½0 °9„`f ílæÚ ÈÛœ~ .p8�Q°Î ¢�ŒuºeÕãGBs�Þ·†�’¡Z룧E$%¶V¶F4F½ ,pà#«ï—]­‹?wøp»­§4¤¤‡èï—�ÿ²6±ƒÀXqéŸfÁ4f@°}¤RÜ“CD«¢*�ô;j¹#WTN–àŠI5oð€ºî.!¢+»ÐÝüÍܺqÃóN_½ð-#`Œ1Æ ú©ž¸eš˜¦kH„l6kmv«GNª¥jZ.qÁì(´Ì vÞ9Q˜·fÁœKá(®ÜNÛ¡;ÖfŸ@Ü3Ø" c!�©â³a>&ÿ�6è6dôÀi@‘vØä½m¡( q?NpÒ,çS~¢¨÷Ÿ˜ °Õ ’À~,Ž’ï8°Qý—ŽšîR¢°Œ²(¥éFÂ*¨mØ@Èôá¾b¥JI‚Ÿ91˜‚YUq_õ%”E:1 T(|">œN^XfÐu¤T…©ƒd^gH:fOÊ%€heÖÎŽ)¸<ókû¾vÌ}ï#*rŒo:ÆËß|œóJ~ÈY{Røê&ð#|µ´³˜LȱÑüf«Kö¬�þ›�ûS2¿I;÷L?¹Å) Iâ6We#Ífš¬ý¿ÿž@ƒ;�(s®õG”a²ØÈß°JÝ�ô`:U +Ý“FüzbQKDèqvœ‡–Y>ûbå‘3cá8ÁÙßìpÀ%ÑàÈ¿5éÓ„åbõ^F29xÄT½Aì�‚2å‹^.968G(ØQ ¦n¨kkçЮÿH®ã]³åöãÿø³ç�J¸[4.|óg–¯}Î)ãIŒ1ÆßËñ¼kžÊÝöùC;n.m©~J6� ÊI±DÞ—ÄLÐÅìé2„¢±ë!ؾϮ±Äí%/JמÚÁÈA7„Gñ$NÉ™7ÛÞsV’¤…[·!JŠ|ñµ‹ ‘Ð#`Þš ‘­2¬�S¯m²nÆÆPÀìþy�Õ e] †Êïaà‘@ÊtÄM0ð>ÚO¤tG6[)¿ì£Àz |˜Èì=ôÝ(4>¢ ¡ˆ4ªÄ`BZB‹gÇ*cE$òU-f››®™Ï÷.—Û?Qúê�o»ì†wŒ¿¡cŒ€1¾­ñ¸ßþ¤__ßÜuëÝ{^Ø¿ ¨VVüd‰\Q²½E'¨AÍcÔ¾65ô†Ðeû[;D6iMdb9¢Â÷“+XIrQGÿÖûÐ1»t«eP�¯hÉĘ´tÓ[áþ%Gy{ÈRœ’Ë Ä|Ú‹C%ò³eÐGçÙ4ª†È Ž&8ùËXš}š£÷¨6UVü\ÜÞÇܘh†é( 0o@›“i·ôêÚ�³5Úµ”„øeVƒ ÞÏ´,'jEy™³cÏTDp‰£GèçëÌýȧ›S×Ì[‡în&ü‰'~ƒgþâÍ?ÎlümÝ¢C€·Þ²ýÚg?xu<‰1îmñü?»Ä¿þ²wvãIlí¸êÝOÐ…û‡6\Õ`þÔ¯Y–eUúª÷N"6.* ¢ÀI±8Z" �Ò-XÛs†ÐÉIìñL“H™„.ÔE‡†’:NfúpÑ$0h}#“íŒ“Ž“l$¤t±„â!ÈiàܹNÚv] @$bÐYs.û‘…–÷Î"ÈÚ”K%3,º˜T™/0ÉNPdŒ‡ÚQÖ‘ZÙ4FKÒd“e‘ƒŽMôE&?!_-]p‡v-ž¢¢“ÇßÔ­×>ûÁ«Oxë-+ãIŒqo‹±ù¿wƒH„çϺµ'ÌÂÚQeYU1!O…ì§#OŽ”ùžh$[…>¹ƒÉ Û<%>6¢8H¬veä¥ü õºÓÔ˜¹+[Gb‚cGn?J”áõ™’ñ°’õlŒ…ŠJ„mŸE ØhIq" žte/ úú¢Cîl(œd8‰¶šÎ–¹ii…0>†™­¬:!@„ i¥Y= æÕ˃¤˜JÒΙ¦`?ˆ@¡?Ã%DCü‚Îvbk'ØkÑó#¸*+L––Ñ¢�xWœÍÌϬÛùãoêã`Œo[Ì6Ö[_[=Ä»}µä\Q;§‚{vÛoûyš¾ªöŸÎD´†²Õ°¹}Jã=ĤY°8ÙÙ€AžéÆq²ˆÀ9öç ”?ŠY¤‚Z×f¯ ν÷ã«iÆLÏ�!`Dþ’?®eÓÙ¤#ÉÚ<ˆšb!Á‘Ñþ1›ƒ¡ .³¾Oaâez‡éZÄlÒÂA/õŒ™ìò!I¤‹¡Ÿ¤¨˜däT�7r<|Én2-àË£›¶{l ðcgüò‡Ï>ç·o}æ·h¼ûÙ^?ÿÍ7ïObŒ1Æø^Š—Ýpõñ•�«»ÍsƒkŽó…+K7aG^é8›ÈgzHºØ–äË™®±NÒ¼ifÔßÛ×éÜ`P¢ÈFVþÞ€ûÉq›[ܾ•ç�s|$f)�"HÐz/¥* ½|`í ’5†`|ŠN<£÷4t6Íú~Ü� Â\­3ò> !ëJ�2ã>6ÚÓ=JªÜd+CVvl„p¬çiT°ÉJ_CW1ÉLÙ(��Â03…§²*©¥ö„=ëw?rßú¾Ñ`Œon 9ÁÿV<úWþ‚§ÓÉ¡wÞ½çœÕÍù/pµýäbigà²ì“UÚå'ÑÔx/g(ª‹‘\W�]L!îÉ9C»Xýç~«Ÿàâ,bµ¢“µÁ�Y©ºÏÚ¤B £L Jæ 6õ,ú¬lò¹4èŸÄ�3˜|e1 á­hëxÄ.õá‘ê DŠøØ1ß§‰²ÁÚ±õ=è¹ Ñ€ R8‘ ˜ÔÁHZ‡,¹Hþ³‘¶˜ uÁL˜sñ£ `tqYätu !µø,h†h ¥]LôÅŠƒùañŽo™ÚzNÍæz7ñØSxzWéý›½s·|òÅg­�¿Á[3.xËç¦×]µ{¤sŒ1Æÿ©ñòëŸUÎÚú¨y×Ãü3¸N×EmIÅsÒa�~°Çª/&TL·ùyCÏfÍãë¦ùéY]Ÿ0þönݸîªÝ³KÞö¹mãIŒ1Æÿ™Ñ„öè€îŠ»6nêíß8 DË•_Bá&œ¶Ä,xaбEïÙ3î’º3õd¿ž×ÍŽ‘J(z2 µ��@¢`¼€µeA�HÏ!±ýÍûLö}b],4D9­€uE!•™A¦Š¢ö[÷'ià¸HᘱIl‡™É‰ß\*¯REº«!‹�pf`ãä¬a‚ê-‘å*še•¨D½È :ÓÐÆx 73AX%Ù@,`(¦ôWQ \ÚŒ0MŠ {>Š)-‰ÿG”P!yIµyŒº?Z¹"$‚:¢x •Ó%ò“ejÉ=£ëÂÓyÎ'�úÊLÆßæ­ï{þéë¾é³Óñ$ÆØ ñüw^6Ü÷‚xñõ?Z«Çn6ëo´ëWìiï8¾Û±<ÝÖ•Õ$ºÿtƼ�3»?¢Ì®&¹Åu5Èõ:ý9]™Gr�".²>ÛöÛ©CÖæŸŒØžÙ]³mr…;ãsDl^½¥&ýH5¦E„¶Äd€¬(ü¨ôWÊÖ4*†Ú™xÉt€3û2þ¶JI‚…ÙþÁ”t”L ò‹•-t¬u2 °ô¡Lq�¥ÈMŸEH:€Æ´€9›±Q»f•E@.íÈñ„8t•¾À´œúšf;ÔØ×ì=é“_þĨ‡4Æ8ã[���Í]óyý4rÅÃ/}QVä OJ|×{œ�-Î^ ü,kÆaÇ”ÍôVÊÐÑhô„ãä£ Gî,*¶ù@�H¥]´ef‚ìØbA‘DQ@'ÔFâ6˜¬¬ªÁIŸŸY Öž&%j§s”ˆxƒqaÊõ©öž­,$L€ÓMÁ 2J#;s¦æÂ³Ù¥0‹•‘™Áœ�ùô‘‹ÇÐÁ3Ód2¥¥•® |p[·è…é[8®½ú!³‹ßtó8Äã{>^ÉŸ�œÛ{A´]{ÿ€ð¬}󻞼o~ǃ _-­Lvò´ZvLŽUú˜EALº?Hp8ræÈ»3Vri|­ÊDê Ëo‡�®uPâÙE…kæÔ«ö ‡€ÈAÄa „`”ûSƒ…Š\Td݈Ҁ±2NüC°ÔF£¦?6}-ɆHK�¸*I’ⱬ{ ¥$�÷§/³˜%ËÛˆZ©²�BɉZ=H€H¤���20;ËoÈÜ¥ENDD½û§‚Rÿ$à¦Ñ!LÏàÓúÉK3*|AÓrʪr¾,¾Þ¬>mÏüî]ãoóã`Œo9ê¦=x6kN  £]Qû‚’"Œ�JNYhN5L‰ €[X™¡«aX™œáxÕþs.þç½H¦ÈŸƒ…þΆ¢/$²«:îµ^840u!»¬Ï´qõæo4qÅr@ùôg؆ã×ä44ÜÛ_ˆ”b>j1B7½øždÙì  M1Y hmYâ†êˆ²aþ¬æq º 7<̲«\GqÃI‚©‹(óåéþ½Ó/ÀÎy*«)•ÓmLÅô~MÎmÐ=óäW½ïzé5ãvn‹Æ{®>mþø7Þ<ÒÆcŒïXü⇜æºËOYoÖžºgó® gÝæIλååÉ WEEŽ˜©mBuL’µC^8Rβ@ûÔŸ&aߨ¿ƒ¬¾e†À¤-1›z2ËùX4$n¥:#gFb�RÌ `«¡ô­Ð=Ä´oj+2SRº½ù›` �Ö�3BÆ$-,ºÁ7Ex K–Èûâ¶';ecŽÃ IDAT,à-Šó¦u‰Ã†PÉÖTp?{¯ôó¬F‰I€0¯+!(�òó"‚D"cÎy”e�Àí1kõÚéM×~ãÞ?û¼1ÆÀß\œ÷;Ÿà'¼õæƒØùcfóvW¨òEAä]º¡+µ-ÀLÍ.PÊ06s|!200’¯0ŒjŒ€¿´ýKtsb²Æ9Xì�!-jô‘c™º¢üÅa�hÌ–?>t€Ò8ÃæÙ4ƃL£�ð€°f~ÒÀd”-‰­mÒSÔF<%¾Þ;77é5^Á¶PGY6¯[fÖñëa m“A6d°ÏIÔÆòÙNêûWÊ¢a�˜ÉbTËQµŒ¢&�)\¢ÔAÿ�Ž˜]ýaòŽ«åm¡˜.sGîȺ�žvôò÷�pÆk?2n’·h\ÿÜÓÖÏÓ§«ñ$ÆcŒow¼à½—U·­Þvܬ޼dÖl^±¯¾û$8,/O·‡i9%ï˜C¿ã—b¡·i§\½†3ó=pØ¡ÃlÍÕ2£×uŸã‘{³ÁGZ¿:6:BÌ’>Þl¸`í�‘™î%d! �¼Øn�)ÂÌt_e TÕ8Ü'•„„V FIZ€97Ô‡¤ÔMS@ÂL/ÈØê_ŒÜåCý޾ƲÁ™‡ñ`Tƒ5¥¢��6€è9†‘e’Í Ì )UZmgÚH® PèÇ4(¼GKÍt­]»Ç_÷7×íú¹ë¯—cŒ€1þý]àÙÆü䢨Îîȸ _”$-ôæ­éfÅ&m Ê´÷­æ~–á(iÇ›,!ßÆÂˆ²#TûørëvöÓk@âö Fº£Ïhi¥Rùý¿ÿ_/¨Ë ?e°ôn8’ÚõeIó3‹D^ÊÛ”´õ“`Á¥Ì„7‘\ÒRˆ°=§@w•ñIú8l´†d´˜>Œ–�aê~ÓigSæ„a3 :ˆ–nÂ<ªt¿1ÿÍr¨@ÚNß18@à{œtAÄŽz�)ZXt”…~S>ƒ]Tî‡<u!{ÇåtJÕÒ6ß‘ß:¾�‰*Ç�¿á[7Þwõ©õ¹oüÔ8cŒ1¾­àØ€påêlï×ë=Ç••›L§KT§f\Þ8*O-8£çºAð謊74Xí+w¯'XrƒGW=�ZöÄGJÌKv f‘áÍzR’‡ ès)^k0/~…P°�ÐUªWÄ£Qž '‡?…T˜ ¿Úû2Œø@2tRðCJö‰HGÜ3„,hKíÚS‘d•š1$¥êôÃîâ™@¸gt«Í$D 2ÈM­}Õ½(%tÉTˆ j f,¢õU¦Ë” "ª:•¨$ÌÑSfWD7 â=vßlÏîY³>özc,D1Áøí¶=´²²t|Ótûm®¨À¾äOו2`DïØŽQAYûlÈo2Ö0v›‹Ð«ô£¬tµ¨·Øð¦&¢IÊ`,Y[îø‹¨õÌ€,è³9=†?¡ã æo�>ÔÝ—†ÏÚ¿ýþ‡9?� ]ÁÖÌÆê 1ç,Š…ç¦¡‡m®åoéøH“˜�_ßÑÁO²ÉÍtx(3œdj=¬æ96‰«eä09©$ÇöÐ’J±pêBpŽ=|µDàC3?¶nºÇO*·þ°_ûØ;&;Š¿þè�ÿÀÈ×Ý‚ñ�çž^?ñ­ŸõïzöCºñ4ÆcŒÿ›xåŸý,ßæ¿rjÓÌ.®±yQKÍ äÝrYNà}¿ø¡�+Ü&:6�?¶í¬yOL¸@–‹cmÔ4Áeº!³O%ùŒDÏÐ·Ž³¢LŸ‚­á^fEg7ó¬m5v$QÎ�+%Îk éKvGJ–Tš¡ž ­Ì•™ÙÚOs?HU‰¼x"%I§¬ a–‰[)6µäþ 5s:z}ó+€”ª±¸¹ÏÔ—m)jëU ä þ„qŒ%¨eáJ*‹*„6lkÂæÃÖæíÇ¿tׇ?4þ¦�1Œq*4F?ví­|èao[ߘ³9o�碘ºª;ÏIÍ�2‡¹”:Ääè¹öɾÎÜÚsVVáƒNÆÙô¹lÑeÙsXZ»yxÁ×g ,€Ä ú�=‘"º’ÈŸÐ�éä !Jíí_XCšH «¬HÙÓD#Pˆ¤Ìß(HiïñŒ×|t¤lÑx׳Ò=õ÷o)Ç“ã»Ï}ǨîoŒ«Þuþä_üޝÃìÉM¨Ÿ1›'qé–'Óx?aŽC×q¡w³ ¤ ¿Æ‡1°ÔMÉÛZ檓°¥ÅQrîÀèœQÂ%bfÇ §u—âñ€íÒùÇ�4Y­Uf30®Ã‚O1¢Ðo¤EêHdð‰ÌÊj[$rÍ–ªúöfX247ÈŠ,ë¤lŽÂúç¹ÜÙ�(U,¤ ÊÊ]­“RL“ËòþÌ93k rq‘¡¸L}4ù1¬GV¬9·]Êv‹ˆJq>2¨ Ò'êa®L¥/yRNPÅdÞÎŽž·³cN;ú©‡¼ö¿`ì÷ÆcÜsÜþµo,eqk† Œ„tÚýç- DÐ1{Ç~ºDnº\l¶Ø5›µø�8þÆoÝø“}psþïÜ4Ú�ñ�7^:ªûß+ `¸á'gÝꥳ°vŒs¾¬Š) _’KmfS¡ªÛ“ºë˜’*•‘4bíá(gFO#ç(A©;}Þh\'Ų@*ºDäž³öXëiiå5é Àev÷éÑ BÏmT>»"1oW }!‰%ÉÆáК)C›|¡ùëyŠjB:)Ñ'õdeé÷kÁd0H�±^Vñsʬû};1I/93¬õjQbÀÀ‰›Œâ’É’3Ó£;™-å¨Qˆ¡ 4ð Ôò�ØeÅUµÄmS¦òd¯nìÛ9þÆ�1ƸÇX[_?x6ŸŸKìâ—9ïÓ퉙 à<Ýÿ‡÷Qãk„õ8Çԋ¦û1 Ä@ž.Nž­ªMÎïbÓ“ß�Õ`;àÕÙ{ºõ³Y�›ÅµNí÷[.LÌÍ=·�É('¦YêX>f‹˜Ó¾[‰ñÙ“C¤ô4�e׺“•.íbðF`¥Y� iñ \Áli¯zj« Øé¹ù‹ü§�êŽQìçRˆ$QGy靖L™‹IÙ‚�™ÕíyÑ3Îüõ¿>óÑ¿ÿÕq»·Eã}?yÆÆ…oùô8ã;Ïûó§Œ÷ˆ{Y¼ôý?v|åÊÇ·ÝüÜŽÚ²ã©÷e?±&]™ç =Ú 3Œ/�¨ÕÚr"K⋆ǜÞ6ªY».Egôw¶âvýcçzÁfªBŠÔo™Y\˜™‰ó’+3$c³ÏμŸ9ûG60ÅüXê íír±Ô.ú �>¯ V‹l©´¨VD¦ÆKØR†eXˆN¿žB¼r.LMª¢D9$¶ð¥¬ÀZH!#yÂXp^å…iš¼P{.¨,J \àpâz½ñÈÕÙêŽñ·~Œq0Æ=Æl6Û9Ÿ×�ñƒœ/Øû‚ذØ­�¬íªÉâüÍ ôùEQ5ùÌ’áDõùF=ñ4Q@ÔSH¦ž0¨ó´š7£ã†%íg#0Y)òÞS£Ì¶;ÆÂ}Üær2H6†š^=—“"�¡aŽËãñPƒÀ%2 ¶¾3È™Z4ô!-ÒA žÂ¾1ùÞ0d@¯Aö|ĸ(_l†I›ØÔN”ƒÞîšËM$áS’‘14ÉŒ„Ø»öÎÈÞ{ª¦Ó@EåçîÛuኦi._ýÚO:ý5é[4®½êÔ� ßú©mãIŒñ�Š7<éOGÀ½$^vÃ�UÿõÚ§ßm¶vAÝÖOhC}4;WÅ$8W0=ädóiÜžÛU2Ĭ^)Œ±)ö>“S×Z§Žð”;±ˆÝb8Þ·r|‹‘SΡûù¼"YòÂî9u¥Hb>*×£C|5øCœ¶çÃ�ø&¥)æà`�‚!²ujˆ|Êo gŽx‚œë#•õí™gâ`GBfÌ õ§ö÷¤k%©TåŒÌy³BÒ¦LâòÊ”yr)’ê2½Á(£(&ƒƒ©NÎkP{$�#&ï<9ÏÔRó}õÚîÕùêh£;Æ8ãžcc}£ÜØØ<¤ XñEGÀfl*¶°l˜Û*Ë*¾§Ê/¢ÖbñõL�E¶%¿,}Š’ì�ÚGã&ÇV0&™ò(ë͸Égñ™µžÉš,™BÏ%à�˜OJ¥Ê7SúDcñ0¶lm•°ÖS\¦o!i¹´�1Èg.Zn$›=;EÈ¥~`ý™ŒbQÛë’š1ç¦Å`¶« ØÔ§^Ö¨&&¿ÀÆÂÆØÚ�>EÂÀ.üíÄÖCÂH„Xuõ©8º=�Ná` !„Wx*—–¨˜,—ó:9ßœ? ? â“Æßþ-<xöékç¿ùæqÃ1Æcü›Ñ†öh <óîÍ»žv÷æ�§»å—äœ?Þz/Wã`ho9PoVÄl€|Z^¨ŠoÎ †mðØÀøçŸ-DØ4{œY‹Äf£l-™a}‚(Õo�@� �â;gfÎÜþ |$�_,òåeÔÁ‚yW7ÃLPHô6À:…” ôÅo1£Dv “Me2#¥XËD` Ö��Vœ—ã̃ìš{rfâ˜Bë8î ca>hÍeF"ñ=›MWï�Õ?¨3W:]èiPh‰øI÷•S_¶¥ÕR’:tðeEµÛ7ëÕÃfóµÑ=gŒ{Žq@Çoº‰—V–·ÿË?õ¬}«›¯¥bòýÅtŠé´§d#$ˆ‘a; >G……4@H¬8 Uµúœ×”ZYíï"}Êê²ÒJ�™Ì’™ª"Œnñ‘4TžŒ29[˜Ù!ÇVõŽ5”ØyŒj^+mÐèÄ^¾Í.„â68Ÿ�@Ê Éô—#ß^ysL-¥,!p†°VF‡8Äá`f#ž#óK½(dk3κ °?”}�†jºP‘CܲïK:�BªdÑiÐZ§·NJŸ­D�]ÇíæS;… ÿRz÷Ç…woŸ8úä_½ø1ã¶o‹ÆEoùôô½W�:ObŒ1ưñŠ>�7æwïÞ¬7/ÜhÖ/]kö=¶¯Lv�÷`31!èÀ»ð÷²UœZ§üÖ'bkR ›°HlçRá“!öTÉÖÕqüÛuû€(ËRàë ¼Mõ'³´V-Cƒ=QËÈ®(À™^†ud¹@0ºÆlùz6Õ[1â0¨e|á,¸?s#Jå[Ò.êÏÀA6ô4PÙgX‹*»>¢ý^dxÅ�Yœš%äŒ @Ò?›[@tÚ‰éKe8­�¢©ÕBákÝ“,b„ŽƒgO�›Í:æ³� >puø‹NÜõýÙ7Û»þªóÞ<Ö8cŒ€1ú˜Ï^Ý·v\Q”er;ØäÊ¢_¾'dZTN±Ãj+< k¶"tŒ é�¾Ç¬…-šÀ€Á…"�ì-&ŒU ”Á .‹™±�aÍ)êmØxc8"ÓL§JôrSröÛÁFzÿ°·„æg#`¿ß Á6ÑG ¿^°TBN»{£·È9-#Ë&CD¿èøÚ ‡îýe÷Á„£žÈCˆÄ+™£gôü ‚h1|é¥Í×Q’2GyJƒ9HI],� V•‘ˆ|áQL§à²r]à#»€gt]¸b£Ã‰§¿öÃ#`‹Æ{¯:uvÁ›o¡ŽcŒñ޾çÉ[f�ôs×>¥Ú»qëq³fó’ÍvãŠ=õ]»ƒï¶M&Ë�÷Eí"ÛêA´�Ó †L(Jÿ‰*ï`Ek"D=£º[õ=¤\MZ%H² ä´âÜ¿¨@ÄÉœ¹L�‘0’þlTŒM.eÑÝWpòü¬Ûõ\ŠœêŒ¸ÔN„œmh ,Ådîc`à€&@+óuë�ÄÉrÉ‘É7ކJ;M‡©hô­0 •uÐru`+õõZ2ºHP†%™ê X<9FJFT²·FîA‹¦ìÝÊ©H¸IQÂ{O Úî]ùÐ;7î8n³Ý¿cŒ€14f³š76fjÎbWît®$vEºEXŽs(=S®w£äzØ6­ŸR"Âk+—éÓ*£+&%„~Á�lXo‰FT/ˉ`y6£ øu3Lpý „µ"Ê#4‹ìíßÖ$ñ9Uµ!2æy9µ-¾ì~âˆ`¥jz˜’ª¬ˆè å}•v�>Y§†ð Ø8f"ç˜)éáª[›np86HÕ?°9ö(䉌Ʊ’U T&œ‘B艒‰2Ñ¿"G€S‚ž�¸@$)RödýHªà.Å�­˜ö�Bä¼§rº‚rºÝ·�Û5oÂÅý Œt€-×=çŒõ ßô™q0ÆßÁxÝÅoß2[Ä.„„ß7ßóä½õÝÇ»ÒO§“í\•ËN5æzR:zH6³éÞcs™©è’y³.¿lEycMä$%«.¾iØSfÖf<õÖ�JÂöÁÌ!‘ …§i,å"YŽv€x2±¡0Z§t­é{¡–½Žr%˜y‰.2±´¥C½”€ù;¢ÏzÝt4̦ƒ7U`2e°¶JŽO9õ€Lݦz¦@Ä!¹ôVM.>WZ|ôrÅò„i<ÿ¤¦°S •c`ÛùyAek;^hþ�•´©ɲå¡ «¶' 9*È‘ÄtpƒæÜ½ó}^kÖÆ¾oŒq0†ÆÚúŒæu{dÛáv~™��“~TxqIž7uiFªÈ{«ÿ/¨qíSó54ËC1 ,P9íêîFJŠƒÙºš™ÈõäËò¡u®�çLŠ0þjË:æ[{¦EÛY3Ø!úô` ÓG”Mž­LŒh»ö�Ú蚇`³ÑšF1— RìÓ_ÆC•^!"ÚŸæ7M°PV¢Œ«9;V}½l] HgF"\¬2À~Þ�™*XhâÀe’tÿ‘̘ÈyWNÀå’G×mw^ݶÏ|ð«oøÁþßwŒ“ò-×^}ÊúÞö¹É1Æ·?ñŽ§Ž¿÷÷’xÎÿ:ŸŸ÷Î'ž¾Zo.¼æó“²,ïºvWÓ6žKØû`hVŒÜÁ¶å40ö1¬·=6Öòl]ÁEŸ²[=ó+_ÓC½œ¬ÉYâ¼ÛjJ0‚ù†w'FÂG0éé> J65É·OϬž¹¢œo‡ @ PˆO˜Ð�Сe»Ð1EœaR¤åhqéõÓ¨!!ÀÌì’gbÿÕÐ2Àtƈà;fË–çtãfLZÅyAbê…)&±`²ªˆ=Ž!aæ"Ø^¯o²½�±&‚5Î5«‚,÷(ÌNeˆÝ`ÎÉ*™[œ¾°ÙX{£þóù*³÷ä«)ŠrÉ·�ßÕ¶|1�&Nï[7®{îíÞö™Ñ"pŒo)^ý¡—ŒŽ[ÙÅy*Ô�‰TŸ íúŠ$P&ƒD–ÁϰÒ`B(ÜWAàÀm˜úBÌ.)„X„° 'lA”¸ˆA�­ª„Šòd«”‘þl]¢íad‚†«u0# &åýLC nÃ8,ؽ˜è9¥­[æbÀÆ�;^Eæ@L;¾@ƒÆ�pÈr¹tä+?xõè0�Û‘1¨kÚe&:Á;ä¼íœsرRĤ)Œ:´Œ\„Ætî†kemâe¹ïÎ}–�P;Þß<‡¤s¦(`å`ó×À™œŒ¶Å¬2<Ñ“ b›©2ýŒQÆ ¸ ‘Wî5[�€.BסuÎE¿Ð‹Ð )`v2Âè‰îð}BõÎ{òì@ÆëP`k@ü¹¤ü�4I¶R,YÏKæ )ó°è6,ž8gEd*޶FYtí F‚8ÉñfÈ:kÃ¿Ä cû|ñ —C€¤K.�(§2P0Õ‚µ–ñG××MΡ˜,œshêcê®}¼/yõÔ_ùÈŸ~Ø®¿¹áª“Guù-ï~Ö)kO¸æ3;Þ}å)ûÆÓ㛉—?æµãge‹ÆÏ\w9oÔ›g6M}IÛÕth�%WLÊb¼/úé3‚hë©óDÎ?ê‘‹ÔjS¼dEúw£gaåY=³ŸGÞvÚŒ¨¹;¾¶XC¥‰½A�váiáÞ¿aH ]§[nöÇøÌ„’(Ké’Ú9H§íYÕ‰@ê˜ź¨ƒ=UN¸ˆ_`°spαëç² ¿ÌB쪦©Œ8 ÎI�к#2ü UËY"™x ì #¤üâÓÙ )$YÝ«²IóÂ�693ç–sPgíþÌ àÂǵ®9c kwÑ�ãÝbŒq€G]7+a7»âûúµªKkûx_�ð(£5Ùj”ÛÍ%Ñ}Ó°ÃËógßUByPk—CÊTofV�º÷Œooœi¼`-@Üd8Ÿ#cÙd?Ÿ\ñ �SOqb:¢¶et ˜Bí½ŸÂ,tíœÁm/H!=÷œÙ;à&/�}Å(K¢’Ø!°L™Aîó¡ß€³£¸x'›{ãz\´sH•ƒµY7Í/Ø+•ŽbÕšÙ,\Î*”ºŸ.³±9–nœe5 .=­‰@Øÿ§Bºv¡fQ¦(†ÌÈã›å!)©^Éà,+ÅNQè˜�s®,Py�†�og›GÂsÓí¸ýö;šGüÆ'¾ð�‡îÞ÷†Ú6B„·ÚàÊSö]ô–ÏîxïU»1î1^ûá—n{ÉÙ¯YObkÆUvÁdßæ¾ûÑÓºÐ<¥ng÷!ç&U1AáKê`»X}Ä„öÎVHò¦dz³Ô+à¡A[8;†dÍÔ‰mÀ‘Ig øPéxÀWÌÃ<�~Ò~>/¶0*Xâ�hôe^~S& B!¾NÃ5�wŸJ.†:ö®"2%'¡E‹†:´D:Gܨ  \3¸�yöŽ{•\BADŽÀäØ3• öÌœ.H|Ž�ž)‘ß9..Ô}˜‹NOlÕ“‰r«)¨ÜŒ½¢!Ÿ2‡D!åÌqêd,%.´ÿ·k* Ú'�Áš§²ÌE; bA˜pVÛÚ�³#ç<1˜=óñu¨Þ¢ýä8cŒA³ù €S[àþÄE²ž1� èÛ¼v¼õ3[Z‘…³Kÿ—o}Un‡uË=HLšºÄ {ÒM7Ä+�uìlÄiÑ›éJ¦‹ÝtšI05ÉqÀα „@z»vý]¹©ç®›Ï‰ºÎ1œçÍ¢ðw–eùå¹fÆ¿Pà;l" 1;&ÇÌ+wÿtrÛu'tm½«­çÓ`çù²$WTä\×Kø:Qq“§™íþ5Ñ1 IDAT^F Ƚ L‹�Í>̈0�ÂÊÊ‹éM|4§* h1AÆL7/Çf…€¡8èá4jB®̰ýp¤ $¯ºÿØÙqFx°ÉÐ’wÑÓ0Ø1•“ ˜�ofë‡uM}QW†CÓïÜö¯·~â‚·}nvݳv�C€-ï½ê!û.~ëÍÓ÷<û´É1ÆBüÒ_¼tûKÎ~Íêx[7˜øø@á¹u;;¯Es$yöEQ¡ðž³´{±Øâç’ôÊ[LûY+«A‘íIœg3”¢]%[¤„UÜŸîœYTð`aÑ“âT@'Áýƒ¶„HRƒùˆ“i2ê!³Ðà’n9ëàd;'¢u}ú—™€Î.ò=�wž¦¶kе w]ËÇáW¸é¬påžÒ—wÞßéØÿ+“»L -8¸EwDÇí}Ú®9´C½B;m¨.ÌØyG…/áÝ„<;;òpdÖßûm6Ò}lZ~õªT-¢;¦"E&¦ú $~Î Ý)D UÏdDÿ :T"—�&1œŠÝ©Ak8ˆ§#„xJIæO¤å*ΔñY\ÿŠÈyÇ-Â}ÖçÇ;rKãÝbŒq0Õu]Ñ‘p{Gì\êpóöÐéÑ| €¸­ñŠUP•{§æ™…Dh'Úl!NœMF“š»ŽÄã³A¹ÿ"ô‚lo,¢yÊ®‹Ì:¶H;¡{…qÊEèBh[êÚÖ…¶%OØôEñ/Äø,{þ’sîVï‹[˪¼µªÊÛ½/÷9çæÌˆ=Ú¶åÐÔÓ¶éŽhšîÐ쾡ÅaŽºC�ãï…tm}ßеKì r¾®¬ˆØ¥9FL¬v±+{’ÓÎ@ Fþޯآ,’6MœãØãÑäX5Î'Ò¹cѵM#o…AªsŸIÑC}!;¦·¯T*®Ì™Hq‘0{Ýî((°ïÿWŽ|Y1BçÛy8ª®›³œk÷|éË_wÛ>èCtOòLc|OÇ{ž}Úì‚7ßT]÷œ3êñ4Æxþ;.w¯¿ô�Â+?ô_wüüc^3¢C¶h¼äý?Êì&Gßµ~ûYëó=ç4TGEYTÁ{ß#βå…0ä1è~Õ²&ê Ûw�Èô军2غ”‰8×½•‘�¡àå"w ™Ï4Û<¬®ò;uûÄŠÙ2ú>TîaMšF�Éú-[m;0(€Ù‘cˆ(t]ÇMÛø¶m™òä×'<ýW"ú"(|ÉÁÝá©Ú[ºÉê´¨öUÅä.ïʽÌÔ†ª¦k·Ï»ùA5懀±# Y*\¹‹™îvw»Ú¶.;î¨p%¼+@N÷½3¨PÌ$ó4o/ÊlT&¬ì) ÅNªdŒ·‘X@¦$X¨\̾ÃîböS;c èDCÐÔ}·éôAʨ‹ƒ/ mضYoB r¼kŒ1Æ aÒ,ƒÈ»¢èœóÄÜû§š–0äd–,¼'¢“I„¬Y„­qœiºØRî˜Dª–3œ€òè3”¿z¢.NÌYp » V¤x?!`YÉ—€õ!Œ¸!¡mÐÕ³®k›Yá‹;'“É—'KÓOeñ^ïùókk«{�Ðõ°·Fˆ*up-…®ëÿ ø €¿!"·ã íSçüá”Í�ÍGÌfó3Ú®94?ÌÅö�]9!b¯½™ÊÃØk-£Ö‚2¥fηís Ô’Æ ��ûãÅ q²Gå&o"UB €ñÖôèF/Ç ØÌË{(ŠcÁ�,ÔldM" Ëú€:í¨í³©è„í�þ}1±£r:4ßìjÚpiÀ¼ÝøÚ׿qâÏ_ÿÅ¿ÿ¥Ç�›ä-×=çŒúÂknÙví•¡Þx¼þÒ? DD¿ð˜_›ÿ-¯øðó‹Íùú®ù|ï9M7?¿Æì~`* ?AáJf"d„ÝØÂ¾˜È†Åfú}�­«Ž6éŽô©aüÛåãq1fi,•ˆ×¯Ø“–X,óˆÌÀ‰Mr4ÂÞ§âEιùÖT¤åÓE¬ƒ2r¡$rQ®ãÞT¡/‘P7µ›×› �÷”®º«*¦_])¶¾òÓ�¯nž5ë·®ÕwÖ ª÷)B ìzå€ÀÉ_ªCG?õ‡.~ß›gÎÚµ 6›ÙIó¶9¢Cs\˜„"À³'ï ×_“À†iWMÁЙg;€œ~/wL!–‰¤šÿbV¨´FŽ/€#œ&ÁƤɔá÷e7c1ÄØRVE—‚† lJiSŒC¥/Q·5Í›ùÄs1Ær\üæOóŽí+Ó/~ùë‡Ô³zŠ\!kÕ§Â(ÆÄ6¨¾M$¢-Š�OܶvjY+ÿȪK'vÃV·;bf�ë èJàziæ*j4>u“lg,(:½Å’ׯäÈÅoQ¸Ð65Õ³ F;'ïÜÝËKKŸ)Šâ�EY~Ö9ÿ�²¬n;ä>G¬ÿåe‡wßÌù?òu7ñ_ýìC[óOóóÞúw³ÙÆæ]Äô©²ôG./MwÏfó çuó˜zÖ,ûj‰«åe¸²$f怞y&7¢[c°hd20"‘náÙaV‰o/†ÈÌêöDåج(ôϰƷѩH0‘Ë×û$�âÝ30=M™¦ö°š�‰Àf2DÑ©†Ôyòépd½ŽÓ‡3ôe™÷TN§ÄLn¾¹¶³iš‹Ê¯0óoѧƻÈÖŒk¯|ðÚ“ÿà–moÿ‘qpoŽçýéÓø Oùc=ïíOå7<9·ø{Ñûfò+çýÆ|<©­M[ß' <îîõ;.Ûl÷=ÜWåJUNÉ»2‰³xº±É†šÍ}ÌÖ~P/ˆv½NÝ6Fñ2ØV4^Ïr Ž2¡?ÎÄ–Ä‚·ß¿÷O 'fÄ‘úÏwÒPÀ¡‰™-Þ�xÁŸÇ:)Éå[Å YÈØÄ¥Ñ€0DpäàÙQZš7›®™7LD4qÓ¯-—+×1»�¶]÷÷ŽÝjé«=Û–Ý÷çÿÁ·ŒÀzÕÇž÷•½³v¯sbyWAtzáMWŸØÌëiç;*Ÿ >+µPM�5}Ð /{ï=1u][l›lß~Í^]]yÒËG$Ü<Á�üÞM\–Å}î¸sõq{Ö6_Öqq¼/'¡('}rBf9.¥ 3Zµ³j“9¨G"±I~z÷E–|Y:E–©\„ªÁeÊôÔDºñµ÷tÀ~¶ ˆ@ž/ùßpBL!�σ’úØ1Ì�£Úz†¦ž•¡©7¼£Ï–Eñ¿ËjéÛ¶oû«SÏzðWs7ï·éÔënbrD7þÔYáùC¿õ7 T@7¾ðŒýÂÉŸýQ¸/ÿíßÝïÎ[o=s}cól�&_ç'ÓmEU�}Aäœj5Š(�8 ‹q|#ÀDCx°'M%5éѱ„̧ °Eæ ³rÌÉ,û“¾‘V?%¶ˆÍDáÈpFΗ£,�©ü�†îÊX½@6êtqœƒcG@àzs�»zFŒöŽù�<ñוÿø_ñØ‘°Eã¢7}jû{¯>}ä}€ñ‹ñâêûËc¼Eãåïû/Œ²¾ßÝëwœµ:»ûòµvÏ™àpÄÊd;Ê¢"fG!žû‚¬>Ôž8¯bGÍÎîÍ­ÄlÅc›7±ªaSú08 ]è› ‚â\l  Q°t¬ã‡>q‘AçkûjþÀ’kûšTsû&Ö©z>åMèö…“Û±cv�™¸éjš®qÁßJD7yïn" ;ïîõÛ.[k÷ü ¯üÊd²BU1í­ÞúTç$Ép&§†Ô¦QœgJpÚ´gjmHjî2z:™Òº9bòÒŒ=ÙÿÉ7s„\ à[ô‹2Eœ˜­3gÓ‹4Y'ƒG@âÑ"8ΰ}CH½ôž+OÝOãÞ¯ýàË«—œ=6ÿ[5~ú£Ïçé¼~ÀÞ�»ÏZ›í½d3¬�É6�.‡ÂUäà¢àÔ²Õü¬ob¹ã[þÿbaCÄ.{4éЭ�.L'½PIê3Bo¦FÑLÖ³­sú9efÉ™“«Zre3>@&�kŒs€¼�Dij=¤êBK¡k=�W'~òÙ¥bé=Û¦;®/«¥Ï¿æQ¯ÿ®¡k^vÖë"º�ˆnÎ;»Œ@䃿¤mš]3lbi:!fß«9qÖiIªX×]Éù‘¥N0¢ ´PóÀô(óHÌäsGù§kk½#ÈØšZ\ªçègœ < Œ4ð8Üxð`^Ól^﬛æðT=Þ‘nH™tNm,óôÞØunZ½ªæ ¢ ¶)�xíD9kç²ý|¿pÿ[Îø¤;]ùdÖ=Ì<¸ëZ‘ýr¯ü޿ᮥn>#4õ>çø¦ÉòôMGÞÿØlÌg³÷¼ùÓü¨ßúÔÊïΟ»ûÖjié#;>蚪*Þí_êÚzÞ5s ]Û/xP~ "ïż�t9¸°M6r¼°Z~�¬{M¬³D¹×ì5Ù+Chˆì‚\Å|Äö# ž.&Bæã¡ùC_’1’G$ËþÂj"'çXÅ$»ý·2•b€ä 쩘.…bºøâÐÀütÿð.ÚyòC_ù¡Ñ_w‹Æ{®ÙñgÛ&+å»ÙüãÍ—þŇٻ7,ËŸp�înê jº9…~w`þöÍ’eKè‰Ûn�–Å“…T©æÅˆ¸/qÂ3²Ó6.D ‹(òV¥ü­3w¤« ‹U?rd¬¬3|ŠwÞ¹bÞÍ[¯×¶o4ëã�eŒq@ê–ëº�6M·bçØ�Ù‘ þ;êuHÙÅ–‘�6›àÀS³f›1&§-3�]oèD¢\ÜÕ÷ëÖÝïÿÂҲŬ¿?�þÅ”&µ'w?míZ=ô}`äýƒ3}ÎæéŽ™(tÔ55¡õÞlyºô–éÒôs×>û�uÐu7þôéá»q�ùºO-Lh·zøz9™üÃÒòôÏ—¦Õÿ,8| m�n># �q?ô†#˜Ò‡YTÁ©­6»÷ÔÍkeÒÔ«Nƒ†Â/úY´C¯É Å’¢/HÒÕá„®“½†Xèj+£k¨/9^jp>ìNŽNÆc0¶îQÅ’Eë/­U ‹ɸ"{Ý¥þq@Ø1ûjBåò²£¢Üv0ñ‹;„S/ûÃÿSœ÷»Ÿ'ë[qpÕiõù¿÷Éåñ$î]ñŠý·åWž÷ªݱ…£í‘@¸hßúíOZ�ßùP_ú•iû'ŽzMÜT�£@LÌÁøê±üÏõ½Sb”‰K‘4cB(„ BZ ËL:Nœ9WpÓò, ¾ÒÚ¾ƒ{×™�R[ËÃòê¥Í ÔRv4a8—ê1â¸ÑËDý™¤Ú*(@—0:t'Š_–áHZjÛ–q7-–>¿}²òî²(®¯üäýÜ?hÿ³?';¦‡üÃrµý7«bzCዺm6Ñv5Á³KFÓÉ@÷ lTü�®w†ÈÞˆ«züð�Ÿš¶¿ªöArE`ùcÔÖ’Š›©#y X>´îFƒËŽÊFÑ�àÙ…ÒyîB½<ïÖ&u7‚¡ä)pl¬o�c*Ø—7Yaç ¹åd¢ûéÅHø/E:¥�~lÅU¿ ùPÚ8ÈÂŒP1ÀÁÑð‡’¿[†§Ë™æQì�2ƒ¿üQ™,�®5õ¡2æG@hjêz6­ª/•¥¿qÛ¶åW–¦wÝø‚S¾«ï�½ðô…ç{÷Sw�ˆÖ/ü__üÛ½wíiš¶iC×>!tõCS᪠œ÷„zñ"v‚GSw#ƒ¨­¾TH —c`“ÿÇê¡ VƒG݉$'‘Eʼ †FFÖ@Ø›‰4#[$Ïo”Ó¿±åMfoÅê.1ԴҌ祠3rK”,03;våw4û¾¦™ŸËèV¿òO_^>èÐC>NDcvÝ‚ñ¾ØÆ¹oùÜÎ\µ{ïx÷ŽxÕc~uü]Ü¢ñ¢„çëíÑ{ç{Ïž7ó'ͺٞˡtb8FI‰–÷—Æ�—ƒ½(eXp“Ë2í>3Nhܘ¢Dõ‡Á¦ï¶ˆðL|Ïš³ø²%Xïbi÷‘0!Sý3¸29È@œ6É%UgΦÉ:W …AêB@]áÀ«7¹eâ'×.UK×;Ç_|íÙ×|OØi>ãñ?¶ö�OÜðɯÞùÏ÷�µî��vß™ Ïw²ó(}AÌD!Dø#妥΃ ¹”ìgÀ,♌ń<‚NQRåH]µš1Ï�Ô›­óà³äPÒÊÂBɋ쌱@ì@ìɵm;íBWb¤Ð1"àX.ˆç³ ß4µw¾$ç<�‚”8tâû‡1iOI.áÊlfÓá*'O9d<o²°A–¢–é¿‘xФy; °Xl Üêí’äâU±ÎˆÆ©;Bš—GIû.„¶&4õ¾étò—ÛvîüDGî¶÷>çAí÷Úõ»ö™X¯Êêownß~Méè�Rý9é+M0Bp!À9ï«%ç&Ë.åaÑåMž¹÷ν§>ò×nÜ9Þe¶f|àªÝ{/zÛ-LDtÖo}t,’¶h¼âƒÿmÛx ‹ñ‚ëž¼%>Ó/|ÏÅÚÝGÌfgo4—®Õû®I±ŒÒ-ÃsèˆzJZèȬ_SuЧÁ´|·4új'µÊH ¾mÃҘǾ:î€m££hImNÓn¢¶lÓTªjT­>};gärÍ�ÃÜJÖ<7\xò@ ‰*'OHQ*Ï,Ò»  €@ºîÿgïÍãd«ª{ñµö™ªª»ï½LJÔÇ5…§$ÆÄ!2¨Ñ��HBÔg|fŒ0ÎC?c‚óó%Qd Ä�YQ‡H Êt�;ßÛÝUuÎþþþ8{¯µöéöÅM(úì�¡owuuÕî½×ú®ïPÃ�w•®üö\>÷ÉQ6÷ix|ím¿òw÷›•'ñs0�..=dýÞ_\(×}*çÁ]¾i0�.q[ïéØ]ªÓΤ 8ì³En8Öˆ Ç>–TÌ*U¥¨= ÅŒž"�02õRB+]´æEQàb×f%) X“Àðm�h`A--7'® å´A^e}‰ÒýZ“kýºùŠ™r9᪩¢›Ð&¨Æ~ˆÃ!GÁˆ]IJÑpWÑÊ( àH¥JmñÔ�\µÈsKulÔëAÏšØ7q»—\#\`!oEL»Í�ëϵ-«oˆ}Cä›M“¥¥Ïç®C1¬ï¯ïáh07�Ÿ›¿w4~¶*Š¿È·`:áfy™™™\æÂu"›‰að ˜.H>ŒÛÏ †@p˜%×¾x‘ ›qáÂy(]‘‚|CÜ•5NYÄú¡‘wH•Å“æö GÙtñAôš [ ÊÞ”HÃHD ¡îƒÐäBf®ÀX¡€°Q=ˆÒÏa"Ê‹ åp!k¨Ø0™ú£ÆË“?/�zÞy·”G½çk}9ƒës'?G¼ûšuWýÞSzcÇYlþ¯|í𠇾½OvXe½ëèógbOƒð`ïqÔŽ¥¿¶kyÇ“AÍBUT”jSe}pwoûtgGþg´öÎ"Ž÷GØšDYÖŒî[’“ë9ðøm§.7™ :Ñ;,X7#Cï‡NLHsýÈØ1sHeFd¯s2Ñ¢JÈe¬ð~xXÄ:V?¤ð,ã­É*>ÌLÌŽ™eD 5\×Mæ¼CIÕ?UÙð³ÌÙÅUV}ï�‡Ÿw¿«�þô©jöÙãg~Àœß<_nø~Aƒ�õ´FÓ4mí˜Ú%ÆŠR{ÂP9…P ¹ƒuš¢#±4PPRtøÔ~©¥�À¾Ýai`R¡¦•RÆGi·°W7ìÎÓ"ãrŠÝ–*Û¾«­#b¶×pïžÞýZ‹k0Ìç.¯ØZúð¼ãD¡qKŒc”T§¨e×€]#V­™rÓP*šƒíLãÁØ)±6©âÙk�ᬘœWÌ«å¼7ˆ;ZhƒÈƒ›É˜þ®ªÌoj¦“ï|áÄÿ¾ó‹¿»ßý¶XúÜÉ�ÀE/Ù¯~â¡OºmnnxiQd!__ßLá§c&ïÁŽ-ÂÜ6ÒQGO$Æzö%“N:±»Qê‡ãÕE·ÁÃ)¾Ýù×ö1mËÏ"—j>‹Å@,¢À*ƒä“ÄP%Iy¤duŸâÄNæÑÓ ­¢�SK�ñíP” Á7Yµ÷´ÆS›Æ¿ðÎ[o2Õõ ?mfs]ú²_Ü~ôûnªúWb¶Öë¯~“{ÃÓßÔkþgx½ýK¯]¨¸k¼ó¸©Ÿü<{äyåò¼»LZ+6±êBÓ׈ëŒÌ�!]“R ÃÅ€„¼Ø±ð'µ�±E­G‚öŒ;ý¥­«q‚)¹"q-õ‚g¡íëÍHH&õê/ÏdìÍä¼ IDATÉÚ ¯¸­™Œ ® ¶¼|ãMJWþKáÊKKW}Ì·¼ùð/ß_÷ÏÉ�ysMÎÝRæÕÇ÷Ux¦©Ÿ²‡‡c±ÐHÆtoX¿ŽƒVŽ2g×70€ŒEQòF£Á)® õ0›gÄlkë("ž@�j…¬ßaªOi᥌óÁúj}Ï�ê€~­Å•enC‘eײ„(‰ž‰loRY‹‚ë‰ÄI÷df03jÑ"¬Ê='Pt—ÙÆHOÛîuSy$9×úؘRo9…»5´ÀÈ䚆ýx™õ·Fó£Ëv[Ø2+ïåŸÿ<ûÁüü�ëwßío³Ìœüô{Íò®e?![ü‰ E`l„™¶íÓ“È´èÑôA¦‚îÈ�6;nÿ¤@: Af†WB–©�¢iդߋgcÝc²_ `Dð× œ¶—,Yº§€ØL,ÞÈÁ! ž_ˆ(«†àj5ꆞ7O_¸i뎞ø¶«æúg6×E§<~|ìnìAœYú÷o¬Î|êk}ÿJÌæzÛÏp¯¹ä¥ë°ù_ZœìI#»zÇ&æNCë!üyN<ñ”°ŸÜNÁt!aFX…dÞjÝ.V2Lz‹g™p}’×Xu�¦I‹¾ËÁ²*%@'rP}oÂ=&âó¸W–BKàDBpg Qæøš±ñ"0;<5ÍÔµ+¸¸k� ¯ÎØ}4ãükï:úSõ,ì¥ãö~)œó‹ë‡ ÛæªÑŽÆÃ×¾aÈåM&51�ö…¨jø‰ÊÊ·eÑHrêAê�D²}VL8bÇŸÈfYjÌ&dì‚n3h8M3›@'6å» 4Ú Î8ë�à{ _ks똩 z°žT”¶WHmÛc{/2�àÂ&èi'c6ú ÊTÕEQfy^x×êôØ8þÂ8Ÿ‡ÖÁ¨I‘M®—ôr�á» %Òh[CÜ7— ÆÇŒN[õôœ( õ;Æ\@tžÛØ$Ï" ÓËÔÚh3c”œ~rî‘¶šz¯JÔNÊ·w ‡÷ 3¨©\¹±tÅå%—ŸpÄß8çèOÌ”¯F™—˜«æo«²ê›ðXjšš=|› (ŽÃšÉ B [>„MfÊËàJÄj]­W$AƒÑfÒød1ЩiÓ ±’ì ‰±à´ò"r°ÉXX­Þ�dDhf挙‹þÔé€~­ÅþßûõÎ¹Š˜­ìšÐî —rÉ"Û;ž$‰²�ØB¡¤€6³ dâåD„Á³ ÅMšyûØ©M ,´ KY‚±GgÓæ£cš–Æ9‹$ëc§½µ©�H|‘ÙÚ!u|”Æhrj­O`î5°¦û,^ý•H½ õÛ­”Ÿ'ÌpCèÀåDè¸É¹¼w”�¾8Ì«óA¸ì]Ç|fæL5GÅ‚Ÿ/×'ãòvxßP|{˜]7ËŠ»S ûâšZ6Ð�”dŠ©iÒ`"]”m`Ò¶()¢ ´bJý6a ‰g ÁÊÙ°ÿi〜c¢²?}z _k Ú‹�›§–Õl›óxD°šår¼ñŒµ:+ƒLSÔ� 9rä‚Ï‘”v„׀誙Œ!¢Oþʨ ¤eD៥K±kÕ}˜èÅò`&À{¦ºY.Šü›ƒÑè̴ֲ†t~ýnãr8ºm4¿påh4ú<î­'c®'c"&r™ÛæÝb6r@^Cl*dª ìHú�%TÊ¥çU7oÈqL:[O7S¼^c<ƒÌK8Ž=䛃’Œã(ÌT™\•L"‚`iÍ#ûIcèk`wg„>þ†èók­8&ªª ù…Œ\µ¡iÜ3áé´ÆûÇ=ÿÓ·g‡ýÕ�}:À ®‹ç‰KÇ|ð«½'ÀÁ:õ‚’ß™—â·ø5Wž¶î-‡¿u[ÿêÌîÚ5^\¨ýä±wÝþÂ-ã{ŸÇŽ÷UónT�œ‹¬kf&ʤ6bͱ L.픉,dìØ�ÝZåQb“c)‚¡Ð±ó†p)D;5ãÚ&LDca$nñ&W¨æá‹ýá™à\{ÙÆÛÔf�%°—s*SˆEË Ä¦Vj½Í�rÎQLýsÞ¡ á¶ÜÍß@\¼7wüå¿<æ³ÓYÜ[—fÃÛ›¦ù.‘["€|S›Ìaަ‰!«(Ú¥V ÄpäàȉÊ–<ÁlÌ…Y_øvêÔ%Qt˜`RE¹ˆ:P´ EŽ�ö­‚‚GÎ39´žþQ.Cµ8 ?Ì®i°R×8æ^°–Wÿæ¯áåɯ#¦ª3\•¨Ùè„£ì6ŽÀ#·—§hóŦÄÎò/BœÅ³º«uÉVlÀKþãnÖ‰5-NY;%êª#ÿ…wí½×,fì¾6ŽnõM3ÓÑ_ž°ˆhé©ç~çnqq�b2�>­�ÎÌœ%Ø9��éÂDݾIZƒ}K¤5FòUbæ `4 ;ûùl>ÏrDª™úÛO‚}#4€ ä�j„£C’*ótÖÁ‹ŒmŒ=¯Îˆ˜“ýŒäÇEÔ¾¤Ò9GY^R9 nØ=´©—m|³íÛ_ûúhÏ=wû2õzå\Ÿ;ù,?çÃ7Ï_pâA}ÌÜâ:÷9ÿ79—ׯÛ+óÓß¶½efs�}Ùëx9_Þí®m·?~Ûò¦_ÝÕl;”²úa£jy>Ã1ù�&±À�`@}õÍ#eqC\Ü,Ò��¨#Ðm¯·¥ûþ°�B Ó0y@^‘­dÊFª¸%æÎ쎴DŽ>³Šv¶–òE"Tà@”õ§ÐÚ]=`-Þ�ÐR€˜Ôù,må!ô¶Ø5 Ò¨u�jÄmGõ÷GrË­à¥1)ÛIHýÌÌh˜a{+Àê oŠ�+ŒAê í%"=�'y`É{ÿ½áÜü�EU= \¤¯>uÿ{²¼øòܺ�—yq{g½<žÖ“ {xt8i‹>p²¥/ì�EÑ]™Wˆò‘~¢P“F>}k¢î.=85UŽ!;ˆá72ì0©�¦9—(\%÷‘Å `&÷lcÉì'½åa‚Iÿ)áË”ºòº@`ñí(¨¨†(†s@^îáɽ ñ|ü¶­Kþò;¿´ðÂóÿµgÌàºàăv>㯮íïПâú��ŸðC_ßW_ôGÕ›Ÿñ¶iÿ*ÍæzË5äîñ×ß·cããwŽ·=gûtÓsáê}å°–#ï8£Æ#e^S”Æ9k;цfžCM_) +RÇ¡ŽÐÒ( ë•UÏöb“NÜÐ }ã´ÉÖ§*Õ‘½lTªH¢‹Îeë Õw%�E"4‘‡Mü<¬l“�u¼ÚÏAÍAÞר;Î73—×ñßþ‚<ã³¼ÏÎxÚ_á7÷ÚÉr³¸ÍQV39òF’Ü�H�Â:àn-�°B8 £nËÔ”`„±ld&h™Òˆj1ëwâ^më è% _¹`jåkÄ3(:D¤59=ÐýZ‹ 똨²1&Nk±#de¨÷z›@Q"ÀÚ¥*Æú/"¬Ì¹(ÐÌÓÄi-\Ã-áÁè„5î¤eîÇÇ“(§(lŒô Q©íZâ`„8¼oÃ9k¼Çör0XüaÁ¹³¸ò¢Ü–eù5Ãáðã£áðÓì›�õx‰êñ˜ žØ‰M±¹AÚwÓYw‡ «”¾:�uYE i3ðÍăI?˜Äµ„KóÀ% ˜ä±\fñíQwf&"öÉ6 +Äd;-º b½Ûq“`pøwDÞE£A°èÿÄ*¸ pŒ6h7¨#xÕ¾q”e\ççƒuÙÓ©ÿƒñxòøÛ¶ Žxw/˜Åõ…—>Ñõþú÷î§´Þóüÿ»*{Æågeo?ú={¦³^qÑsø—7ûqy¼¼®A}Ð}»î~ÁŽÉ¦gS†ÝFÕz–ëÙ#¤×º0 ˆí’g"ïDûL„0!�ñ…ÕdAÝdâ˜âm[«Vɼš _¸Èl¼ZòÃJ?AM•wÌŽÓÐ"ØñI 3jøŒx 0þ6Á3µ³j£Ï#Ž®oŠ�'ÿpãéUi‡,Co± 0±‡oàý”ȃJ;4¼>c÷ç]ùÞã>5ù«£ÏÃáwñó¹Ë""ïk0¼Î⫤Å˜Ø Pbø�Â(KâLJb]bo�¤[ËúI0y2,ÜP± ˆÐR¬‘\(Õ"F#tKÆ�‹0Q¬åÕKÖ6P��‰i�¢Ð ¦SÌ—× M*d©‹¥‰xÍÖk°ôÈ0Hß ŸÇ �Ÿ ®ÝQ$pXÒ‚¹~³Ö5” Ã7äëÍt:-¬«—v~q¼ó×–iñPŸù‡ Ê¡/óLŽßpkgÆ Û[7ûpÉCÏc9u­uKzcÀð Cg+'ƒ”0”^©ü B³^Íç¿óp«ê 4oP™Ûêfû­ÂdĈå6–* €‚ôÖËžÒ€%±W†R;ÁD�¯¾F†b1sÙW*WžŸ9wÍÙÏúøÖT³“;€0åšÐ´&}°®ý2eО›õEWÿ*²r@¤Û$±'¢.¯0ÖÉœ”ͦ–�yÏÓ¿±ï·n¥!¤-8VÑd²8PHf$˜€Ì7èSmÖðêk€ƒ÷L&1qŽ ¡Ô±š£FnxJHƒ‚”ö`‚MüƒÈ´©¨¾ë’H˜Ì�C{b¹kðx�ºVú/‚.žc+ˆÖ'�˜�÷ 5õ2üt¹Ùð ¡¿ü”ýð@{»¯8呛ʌ®Ý°nþcÃÂ]š5õ~¼<ñ“ 3<93yŽ*4n™òö1yy5UNÀåv!£&°ç’LäpìàÙÇïÕõƒ¬lÍ&AP0ÜMAŠ¦Ý·ÁLèJO !é†ëÜ °ÎÎ� QÄl1¦1y0<ˆ|û±pp®¨˜‹¡k8ߣ=o2õ/ؼeˇ¼õŠQ(Íæúü)OôG¿ÿºPÿ)¯×_ùú²oþg¼¹ò¥î/~ñú-;6¼k²ãY»¦;~ÕgþE5@™™@Üø:Ì^™¨!¢†¹�¹+©�…´xœÇ$@5Æ3Í[¤À#MZ×;ÉØ n`²ò,Ñ˺ßFÒ’lSN…KG|á4B.(°j+™b\�é;-Ÿ²cëßÞE­-G“dÈ:ü‰Ãè;O 7¾!x¿#Cöu}ªÊŸ«ŠÑÎÛ$ËØgŽëP6¶ï¨•™è«D¤ŒC6‰ÈP lJÉ;"¡vPŊغ!úÁÎåC)�Ea9+ÜÁ¶`~¢WG xEÃçv¿9€<@È›} @ôkMöÿ­þ?ƒW^˜¦…hPZ’#oíQõD1‘&‘pí$jÙÐ0š7«e²fì&¤½]aÂ*½¥¶j`½xC‡{SÕ6¨ÈÏGûB%0ZÅ6Рi¦õQO \�ù¤³[šrUðŽ¢Èn«óGÃò“õÆz²ìêÉ”[*¼#ï á–Ò<"¦Äí!öÅvB»{¬ÙK¨²T í-¤ï¤X#/bí½ãõÌÁÁ¿ÝMJL°<ð°9ÐìúdSsÊ@ì'U˜*�`þ½}œø,cÆ%@Þ+‹ÀDdèK¨��qèŠ<¹ Š ãšžY7ÍkšiýØþTšÝuÑK~¡î_…ŸÞzí¥¯©Î|ú™“þ•˜Ý5i¦ �÷�Ûº¸ù7vŽ·?¯&ìQdUÙ�û¬:hÙ@†nO{¶åGÛñ»ÖÎ.HÆ`þ–¬?>€éëÀ%h…ÆÅ=>ÇjM£“Ã92'�yrx\V?ÃÁ–"q~‡ òSÀÚ jh ‘@:E–¦?|7e£ëØ9fÊ{‚›N—˜kÔ9ªoå®|w™/®Šjó[Ÿñpg™m®ÛÚÄ9¨Î†l¬D}AT†þ˜ØëèœÕ¦^<�4VK9Q�¨H Ôø6sÈÍrd=¹­ü_C:êîä:[´‹‘ ÔË×Öðê'kýýgvÌ]Ûxv€Wó’�ç˜zîªF4„”¨+)�ã-æùmŠ�v#zW:µ„ïË´B‹ÚL†¸ „Gö&…T‹®º<šç2?à¦ÿ_yÕ! "ºô¥{"ÚzĹ߸‰y5M3XžÖ‡ÖË‹�ÌxDœ­ñ¢µddóž³òíknQ%¢Ôë�ÓÏf›+`ßHJˆúIðžÌf¢?DÀؤ*±¦.Yn3¤ÑÌ$ w~+|ÐÝøÿ&�’4JÎø«F×0VGÀÌì²‚šŠ¨™ÐCÐŒ%ð=OxãÅ Ï¿ü¥ÓŸÚÓÉûÕ¯°^sÙiÅ›K¯ùŸáõö¯œ9÷ƒÍß=pçx˯�ýø0ÏþaE^!w˜ùعpìõ%’Mø’Íåûàp–k}Öš�ù£ÐV ÚKyl¸0Q—ÌæHtûœ:ë›r§Ûˆ®¸.)MááÔ7©ådZid¨›4 Îdׯ‹(MÝ ÕP‹`8‡Æ×\O§L�g”__ºÁ'ùüß¿ëØóïxàî@N²¥9-(9¦ûzÚ Ã.ÓJ³Æ^™²�W)‡ä=æ¤!O¾J‚±�<ŒÉBJ è Ô5¸PÞ-žÿ,¿%RàÖÍ2þjô'Sôkm®6×™O¡®½,�ŽÚ´èá.Ö€˜<£6ê";c&ë�$Ç QR‘*©°šÂ.Š®IdZíc¹xìÁ^…‘c'…ǨvƒÃ+  ÖDãué©�ÝüôwÝt}^ä„Í›ýâòÒ`Ên¯¬â‚‹"Èô2FìÉ9BÏÑúžì›nó¨£|!VÊ-G(&ÓQ¥lqlaûhч€%/'Ä­r·Õ�gCÂà k¡¯´¢„èü/iVj t�B= �Å€½óņc&.+4DÔ,ù üoÔµÏw4“Í�{ýe·|ýÌÃû†§_k~�~ùiÕ[{[ÿ»0£ëÿûê™nã¦�s·ÝóÝG覆=ö‹Ïk{gYÙ”yÉLÌ>êÀ´ÿ‡ôÁ6íWiì1~ÕQ'ˉ:I|kXüníDAΦъ‹½S`°ŒQÅe„´Ê±áõ#ÈÛÔSÞ˜Î�É›•vP�¬‚(WœøŸÊ«t­)-Áûz2uÍtº£¢âŸËlpÞn {ŸŸgÅ}ä}ÈNœ‰A>øYJ¶[†Òh!2Öý¤VÈŠµX±¢ä•¹³Ôq›ÃP!¶ôà#@pÔbõJæh4$OŸ¢·` O&þ6±ÖB-Áÿ²_k·ì_‚5½ ÆíÄè\ÖÛ” Ó(§ddzÅh»/�oÆÖ¾í±‘z½‡D¿’ ægk‰±íøé*÷ç€銈=üú=:”‡ÀÒk<üøåsVw˜/«jGQ7Œæ†çÍ�ªóütù®ÉÒ.n¦“)ĪÆ�/‹…°}Ùä† }1écèˆÝWÜ|Mt&Š‘zÁ£F³�šáÿ•ÉENdpÓud˜qPN\ðmJ rÔy¹5ý�—%'·µ¦ 8Ñh†*5hË�3Ô#A~ôhºë‰Ù‹p€}KòËŠ’Üp.Ãí6®ý3:�ˆÓO³½~õC_+úWá?¶^sÉéëßÚ7ÿ3½v.îšküô1÷îüÁ [–î>~‚É^E^ð «8𳂙jÏ·mš‰$6®ëá€v-O­ ²Gì•}û‡4C)[ÂV f.¤·�±À�f0%‚Yž™}ð+¶BêÍnÛ,ñNj¥`0i;êtc"k`¢�Øÿ~OB1�w�#s÷¸p êåŒ}B¤²O–—2š6u‰òŸÊlpΰ˜ûìú¹Ýî}ë¡ï@›Ð²c°c);$¬øèc´�B(1U±à*í®‰òTëjÅ’}�¨ÌZ©{RèÂ�qVj³­®€cQ…¢›%c©mþ¥ÖbõÄæhu £‰¥¶Ds`rÌÄ} À^=`mwÿ.kÈÐŒˆ›[Ž“À‰wŽé¥™ãÕZÑšñ(Úy¯!¸qtLžVDü Æn�ñxzs'›ijoWÔÀÆú­…˜’ˆUê@ý˜õ¥W>aUIÃ%¿}€'¢­Gà›7Ñæm˜LvÍO}sh3^Þ—œå99×&†wØHƒ‰mÔ @|™b À æcG*€(Öd2qÇê³—ì œ<1uN=>ÇDn’ŒxRÓ]ƒÙGu\  ôÏ:‘±BUÿSÊd- Dº7ÚÖ{ff¸¼ _ œŸò>5&Gä„Í¿á’!ùåk¾væ³{9À ®O�tðô™ç^—}þÔ_èMë~Œõ‡¿¦zË‘oÙÖ¿³»Þù•×-ÜzÏwÞ²xÏs—›íG’Ãà 7‡Âž9#��M’^Õ-'Ú%.®æ.‡hûX>¹5W‰~{`�$b£ºŠ:J1ÍX¥ˆån«}ˆˆP¼”ä ̃s{£¹´¸‘ë LL]‘%è‡^mdØ–¶> s†{xE�Q±1ÃûM=ejš:£üÚ >1W¬¿ü]Ç}òε±õUïX=Úº$ 3lßkÔñ¹¦DLJ¤IZ„ ëB UÔjÙ SiöG¢’�4JVù¤Š_»OPêyCI\)Iè×\=`-€¤Á–CbŸgæþ‰žYýrœ¬ÔR‡5q^W?´pU²CB8°M—1‡ÓïêFÈEû”ÄÎ$¸·Š¡}PrÜwÒëC*Àšû�¸è·Üê²ò«ë7¬ÿĠ̯䦾×O&5ê:Ê:¢ƒ_òâ3¥®�R %3µ78Ž1½‘Ë88évRqº~d6¦ùÛÔ‘ÐÔDÚËÇ 3ÇÑ0 –”tž8·±‡É…ÄÐÊZ:ÛÀ*ã±i‘}ѯ„â5¯pÕ€í16§ý1‚Š�$š�Í·ŽD1Ìi]e/‘Y?OŸ•k¢;�ä¿É¬¦é±zаÀ˜N§D5|æ‹ïnîœQ¹îó^÷�-o}ÆÖLr ‡øE"ãŸÏIµØòDØ1±s`æ�ïñ mÖ%Ê1ˆE¬�€ÎMZ‘F( Û% JÆqĘ­=TF N½°% 9r0!A±ì‘@em­Ÿ wûþ-¯~2±† �?ñMƒ1à€:Hébê®6¥ˆ–ìÒ«é ”RÁõèSô>éÍ:}—uóÕs)gÀ(�À 8±˜ë¸½‹s›œ kp]ý{{"Úò´w}ýúñò8�O¦Í“›Éô¿�ÁY^‚]ÆoD¼ÂIó–,™Dáñ62†M 9d¡€ôÊCŠÑ˜{´{“ÉÍ©”%)àH¬‘•›ÖqR¨^?ÃøXF—]™9ñJã§¶ …*Ql&‚K~fG®¨Z÷ŸfüP�úˆœiË!o¾¼ÊüÒõמql/˜Áõ¹ßü…æØÝ�_xÒ!}T࿱ÞzøY½db†×_\ó†Ñw6~ãÀ-K÷>¹Ùy$g¼Ï¨Z@QTÞµŽÃD�„! ÃFÿ Ýg›Úb¹†lð¡^h¤Üôö°³’B€mÊ»úë5$lD¬ÂrŒS#¹·_º‚Ažd $ìlã=ȉ»¬>›Ü¢x×ºŽŒ\x4ä}Ãõ´®3¸ë W~r”o¸ìן~òž::ki_ÆlE ÷“‚ÂÐ%`B(«—0Uæ’'-FÕ¥Z`%³ ØJdÓ,!‹.Å·:Æ!óŠ�\.�&>˜”-q]î“íüM� ½zÀ^Ú¶DssVscú§~ÓÍ%~ú�C‘¼ñ‹30uÚÙöx�ˤ™¢]�ü;b)Ý�g5$øG×Èekú@¼ê>în—åÿ0Í}ª,ò/2š{šñ¤®§|h�ÍûÈš²ÈiS‹°�kTï]JÈüòPH›ý“îfÜUÓÄfO3¡R+ ±†²n‘ªý|Nj€Þkl|¨{‰FãgfS„ÉÎf¯"Ñ“4áøÃ9ÇE5ôY1 Oü ú�ÆÓ‹¦<¿ßÞò½`F×…'RóÁúéöY¿Ékúzd†×Û®=Ó½æ /�¿õž>`ûÒÖcvL¶¼�ýìh0çGÃ¡ÏØ‘÷žÀ^ÌׄA¥Œ|2å…ž‰Á¢ŸÒ3<œž.=À}û·Þ’¢;ÁCÝ(>Äôu8ufc¥� Íl…*ÿ2E5GÂdM#R˜¾ß‚ƬzÚ‹DæÆÓ€ÞqAs­—áÉ7jšé"yú.#?oÏùda0w×Zkþ»ý5ÔÑ‘’BÄ QÈÂ0ãx¤o©U Zma¬>½Ñ¤9ê×ÿÖ§ý«‘®ÿ}ä[zvË ¯ñxqTûúÑ÷ì¸ã„ÅzÛqœÑƒFƒu4(äÑ´v?ŽõD†´MÚc™`3 v½bÊÆñÊ7±3jáͧ}Ž·D5°(êÃɺ1oHÖ°Œ/„txæ4ÄF5º‘‚Ñ䵬0Í¿ü‡<-ùÒù†Ä˜ÆâÌœLŽ9à'¬&„Ì Gxò¾¡º©‰ ƒûç*¯þºÊ—ï1¿ç}ü”w­Q’¹¹Á r®%ü[³I¡°²�]ƒë¿vâ±üH�‹’<äXÈ„àjca,ƒŽö!5DÀh\b=ßâ”Z’PQ�ÔÑÜñëR×”8ƒ�ÑŸ¹k¹Öï_‚5ÜÿC¦ìˆ2nŽ86AºïKƒ4ÛÇð”$+«¤ [À|B‡–Ýñæc¶:<’Pž$ë—ÌW¤–îÌâE‚}¨‘ ˆ¼'x8Çœ½XÓ À_q`ó¥Wtïp~xM5(?Uåùr4·úñ2¡£ DÎð®$9zˆ[ 0á76t¡“9iᩌôÖëBÕÝyYÀÛê–ÝÉé"›­ºß•;±Ë°b‰0´xšù�â…ÍÑ«Hl{À‘Ëœ+†ŽóaYS±ï¤Æ‘�÷'?á­ÿË¿töUýÙ=£«oþÓõÊϾj¾f{½éK8wßö;»yׯN°|^£¬ÈJïˆ[³œ—Y=„ÒLÙ@ÁR‡ÀÐ+mÌÌ[Éx¾St[I˜é¨¥jAÂ1ËÕб¨(ˆÿ�\&­hPR”¢ï,�`ÓÖ4.½¼lIÂfì³åÀ61”6íUèƒÎ ä�Æ{?%ö˜:Ê®/\ù±õÃõ—>í±O¹mí6ÿD�÷hÿ´$ÞÒ°´RaÚ™Y: ï5ŒÀHr±Y‹ùG¤ù޲Í�)4&Jd嫺o-�•S°I#¾cˆ±£–á"ÛʃÑ#úÕýZ{¹ Ê­#¬h?U@ÅÈeFOê{Ž4^D‚9¶�Î]YòÛ%õ–V¿!²är(yË"ÂÙNJN„þ´ši="šOð�c »õ[ýïÑU§xwÁîêuósäîòÌOïÄtyâ#ÐεÕ�"ãÌÆ7‰e`ûo¾½U£‹~Ö´™ÔÖF›sEv@âà][½H}Ü–lˆuѰ ø'ž‚º@KÆ`KÔ·i‚¥¬@Â"ÎA™¾õ¥jÓ #¯¡Ýøˆ ¢o/ˆ¼š¦}~œ•Ε#F^eÏi@'6 ~s×.<ú 7^ÕËfx=ÿoo\UpÄ».~@�¿ýÉß^ñsýÞ¯ÊÏ9îì�ýn˜ÍõÚË_î~ÿâ“æ7n»ë€]“íÇ,Mwü:U”TåÈ35¾!òìÈs-'æöúp1µ¥IÒ‹‘k Ñø3L£¦ùЀZVͼ´^I”[ÛÁy©Sz,lÎç`5(ü6[ IÈ`t%0‰¸$Ç‘nÀÚfŠ Q0q@½%3F Œ6+ÙGkw:ؘ@Ž=;‘'jïë©GSïÌ)ûvåçí6Úë#U>¼ãøG�¾¦½5jà=àц(ñÄ'•sɱbMKI#û×÷Œ‰~ ÄJ¸EËŒnH±Ñ¬¬‹tÿà:(�i0‘"P¸h|)¤[GL­Y<‘÷áçåXË«—¬qô'R‘¤½Ñ[J�€„È&“b1õ])û‘R/B>•`3[kÉj¦²©%�9Ù’½Sî·ñ ”¶3 �K OrqÌOb"TàAðíÞ+£â*²b›çæÚ¹aÕ-/Ž'ϪÇËûyQ°c¦F8qIOÌ:×a…G¸À8É‘ _È€QäKѰÍs´Å ÜGdù1ïY¡Í|?�Ám"þp+›$¨•ëxˆ×Ãh)ÐeŠ€Ù@øá9!õk1‡2Ð0L5òä‰3Gy93ód¼´¾®›g–y6ÇŒÿMD7ö»t6×Ç�BsÌû¾â>wÊ“æ¥ÿó¨äùóÞç¾wÅÏõçÏ9»7Eœé¦ª5¾þ¹mË›^<ž.[ûɃŠ<ç¢(=;§õƒÚÞ«/1XïŠûƼ5Š(+›¾˜ï‰š,×"&pÂãbÒ ZSˆÈ‰0ÜR ¢ P!„�z5” ˾6:†µ62î˜Ð^•Æ�™i…j[’x¬óLô™g&öðÍ”êzìÈŽó.³êÜA>ºba°p÷Ü`¡ÿ=ƒq4*Ѱ«”©!W6þ%<Ç–¼Ï†^¨6–l²þ(R¤™ÄqÜá‚Ì•µ ‰VQÞ({Š;k 5…ŒÒ jGëLÜŽ"k…™¸7ì€~­É4yä ŒÔ²ÍŸÙ˜Ÿªj d™$ÑÄ6aNšgÙW^Ä $`õ�s‰ � K\»/ Ø’p ìó2ŸÝ>¾¼Y`Ì=¸ßq]ùŠÇz"Ú|Ô¹_¿qçNöSß䓺9l:^|Ó€]1€s.¾]A¢)( '[%n#ê(éVŒk4Q]Ô†Ó¦ñÊ‚ctÔ©ýXË)h&®Ñ¡š:´2œbåžã_Ž ‚yj1Cƒ4N“ Û†�ß4èÀ7 n…ŠyQ1<ØOÇ�L§‡ç…»÷ño»ºÊç7\sÝË×kùfpu›ÿ~õkVÖ‡o>·¸áÎ/þì®éöŒëñ‘u3Ù7sÎçyé3W° ?Ǩå³Ã²Þ£i«áܳªÇ ¥öФü¦zRV$·L·ê€vßH•úiZ:³I¡AçÎ2M™žF7žê‘cíd�^Y‰ß±½7Yãm™QûššzB@3ɨøjÁƒÏóùKÚ÷ç¿ÿÛ¾¶OÕ�WU¨ÆþÙÔ°ûˆ™W¼�‡Kv™ý8Ì>Јé0kcŽ G_Ñ­%V‡‚ä$ g¤¢ÉXKÄÈCó)ÏD«©ž°†Wÿæ¯éÓ0ôŽ•gyÜÖcV'˜¿c[X8õ¾1²€àô]œ‚�Ä|xOìƒ!\Qaây÷ÆÓñõ´9ayÓÆý:ë¢^0ÃëYïûR?‰é×L¬÷ßtŸuÙ«F_ýþ—µkyûËõâ¯7~ú(fjÊ¢¢Üåm�YËàŽ€9O)y0¤ID+”Ö‰õOéç„q�öQ*¡O¾Ä¶pÌÆ¶8åWCs‚‰(8ºsKñîv[šÀŽ=’œ·X±Ø½Ã~¯øBÀðâw6u oõŽ-7¾F3� ®ë�ù?•Ùà¼=æöþè\µpGßüÿ�Ú7ÙÖœ�“* ÞçÌÆ¢¯S4$ñF 5Ø["JR´ÈÄ;ؼK©fµl ?C¨&€i5{­8Ì` :RK&P× +uÌè×Ú[=` /¦Vú¤ãSƒœ”,\·öîKlt} æ‡7f±%Ñ«X2OôaµcAǽøé†>ŸsÊ/÷ c¿fbm[Ú:¨›é#6/Ý}ÂR³ó9žš½³Üq™WÈ9g"†÷¤]kð:±ý° n`‹Ø†”uì�÷¼ÒÍ‹ -›˜õxLÌ!·HÎ×ø0Žn»Äp�d̯‰D*`íô̵&8ÓYÍš `1-Ò�' J޲„ð ˆ×h[Â�¼çñtÑ¡ö“Å?–Ùà=£bá†ëïZ­ëiÿIÁë£áB¤ŒÌ®sx– ZÕ#IP–(B#iÁ`€¼™ÚS"P ã,9V3 ˆRgm&]ˆ´."p¢D"'ÔÇ©ôV< Ú:H2¶M3§ªÈ~õ@¿ÖÐyÈIÂlKågppè]Iy2�|€·ù¤L†1@d+å¼¥,<Žj“7`‘LýéV¬ ”(£Y¤ß7âìláÙ€rük¼ˆ%¦¥®¾.ûí<m?úýßúÚ¶-[ýtÚÌÕÀá~ºü(vD®(Á™ãŽl˜— Ç×y»ÉT{±)Gâuk¨2X�1¡ ô_ ŸÈšò˜}¯•hG•ʤN~É®]A-…ɤtŽôÑÈgÌžcû“0¨c mô��ƒo‹�¼,�Æg~JûL›É3rö[>ëóƒ’ü5×�ulO+ï×ýn½úâ׺·õ¦~oÎðúÀ×ß1øú¿~í€-K÷=wûtë± Möd%ʬðyV2Q{þ‡–ÕL܃úÉ„»(EY{x[$êdtC$! V¡›àÙn)³Šò™A¶K×»"Qh^-ºåMüOá³Ú½§KRÏÀÖ3Rh‘ †Ü–ößÔ\×ò¾™d”__òà“óņ+~ÿØWß±/?©ieýJâæ'û¦šrzÓi §š$›(É¥4Å„© ä*wf ÀîyNKàY)=¾ÜêsÒ_ ¾ÊIáb]bV€•&ôk}õ€µ} &§x”92ܽèKBDä ¤Æ¸KØH8Sôa×™?[®st®I´áñÃDjÌN$ãùm—\´FK×ZšÚØ °»“”Ö·Jb¿aÄÌ䨓£…~gü?×E/yôv——7¯Û°ûǪ²¸”©Ùè'Kµ¯'q „ûEÃ’w)èþ2’Í&½5ÜÂ�øV†Ž7ãÈíµ‹69¾‰CS” ÉŽy}1ÉФ:Aœaó©‚ã?ÙŸ(ý³jA¢öÓ$?aÜÓò×ñ mZ˜˜ÊÁE5Gžò½>Þ{:a Ùþör€™^ǽÿ‹¸{ùU—œ™÷ͺþôò—ÍÌæ½ß<›Ï¼ü÷FߺýŸ~nÛòægnŸl:q ‹�öû²ú"«˜µœd¢èîïäbùÔÏ8¾jÓ J\ðÚ Ecc̺ˆµŒØ@_ã5CŽEåÍ6HÂýbÂpêBlDYœ– ŠtP6V¶°‰ÃÆG0q»ñÌ ŽêGó½MÀ®ñ)"b4¾ÁdºLÓéx1£âÛU>úăúñuà ûæÿ‡¶;FŽûåøVµ—tò¶™)V0²äÕpHü#µ« òÉ…ÑF¬o –Lbv»P^ !CqŒ&•@bè5Á$2FüñdôŠ”Ï·{Œ¹ß+kxõ €µ¼`£jb/äòl=× »&"gr¬È raï8ìGZ·…„o­¼)ñ1Q§U±ê�¥N¨×´ß6äŲ™ Á<žÛŠÿæ*Šá.ïë›Ëá`ÞÕÓÑd<=Ò�ÇEŸ·røÆ›ÀÜÐiCê#&3ócÍu„¡Á±8óE÷<=‘Ä,›ZQ�~d¥¾•a7Å:Q¿[ 8« åÄ¿Ð$\€I™x‘›ê¨ÃF ðXpÊ™ÆS „ ›¡¡¦ZèÁÎåU…<ϸ^ܾ۴Y>:ËhD s¨—ÌìúìKžìŸýÁFŸ>ù�ÅYÿY^ù‰Wr±~¯ê�Gœ±Ü¿³éú“ÃÞ=3ím;7&Ídß»wÜñâ�ÓmÏûɃGƒ–sÈ8kÏgOWs¹‡Î?9JÉp¤Ù¨óYüÌÅ ]?ÀQFÅɉL@ V±2¶ú¦£«Á�ë]†LhU ÂÜêd vÒ^"ì›ÿÙ^v훆·ÞwË·o¿íE;'ÛŸYûzßÁ`!–s(\ÉÌ®[4„K?Ì>ÉAyRéùkcn ØÂÂDÃJt§–ªZƒ}lÂv´þÃJ¢äÆï* ñ©o_wÀÊlu…Ôú VHPƒX2<Ëôê�©¿„þå ¦˜ÖjÔŒìš2|d]¹Û¥¿ôð_¼­oþ”¢×8ø€’ÊÐ#¥ïé­ ËÇbƒ ŸÓ½¬w7Œ±ÐIx•²"-\Ÿ¬‘F¬‚,ÔÕ‘µ�#’"7-g<zVVôkM.^ÕÀ”•¢Äf°oMôˆœ^`©�¯X¨k¶9C8bl+7)CyÛD�““%= œ¤± 8 “Þf™U©ü/‰`íz X°Ã“c>£Aÿ{ñ#®/¾ô �y^|q´0ÿÑ¢(.gÂÆz<®›É´ 7f³ Á7Ìê5‰: âT5ŸÄLˆ›m´à�¡Ø§â€¸¼iª£m$L〈\øJµƒ}¦œ ¨V –¡uAáÉ<É>2 ë[•üqŠÈ%[4âuÝŸxï L”æ�çWî r/&r'Îgó?wЙ—ör€]ç�ø„åãνzxÉïy¿‡%ßÿ¼¿”çxòù/“ |ö±g.öïäl®³¿ú'üÇ—ýîÜí÷|ççv.m9fçdˉSLöËó²ž,ø<+É#ž¸`=8ƒ,31gDä¨õó5Fj¶’rÀ—Ém®ŒƒçS{­$ ’X´øq€R·Ur ı¯¶t¤�,æÖÑ!XÎkêÐ%EHÀzm©§<Ç ÈÜRm©$Œ»ø8ùwO Mê OëérÆÅw W}l÷áîSÕí/<à´~’ûo7ÿ´2 ºcv%Qls* ð®¶�IøTw†T롞{1‰£ÒUv“mù5!H 8¶šÆ?ŸÅÄŒ±…-ƒÌŒ…@=ÐýZ“ç¡Ežá¡d¥S{î^ÚFÍ«»EwŒe#°1#†Sv�\…áxòdít9¾"’¡ÃsΔA-Ypꥫ5Güj&4ÑŽ‡]æ6ÝÒ[£þ{VU¶gy~ã`P}v4(/f_ß3�,Ñt2f&° ΋�;Ž= 5“˜ÈkŃ.$Fû °“ñD^€áØ<ˆv3øÈ» w/kB ±†k�CcJŽ*üÐó>î>iñË;N,¸> ãÈ@ ²Àƒ  -Ü^-PÌòAÄÀÚY±cffGìÙ3Ø3çƒyÇÙ`=Qv4Ÿî ô;tv×gO}êÒ³>üÙ,=ç>ïÝ=�ê°v--Ž?Ýoëâ�'.Ž7ýæ¸Y~ð`0çæGëØybj<|•r z"ON0£U^Ëyå{idûØ"{Љ(aZ.…@¨,{h¹Íá™<8”-ð‡Ö´(¿m xßjïÖ: ±1`OuÚŠ †É´.îBàI£œº¿3 <ÍQ°Àñx�-_{W0“ô7Ne=y×¾ÒÞ7 MÆcò�çÌß䃿œ/æ/Úcn�ûÞzćûÉÿ�²Œãu˜~‹ùP4ôEÊCeëÄ ã§SÜÂøZ+g 2ì8ˆŒ9†è^‚Ò5–„ö©Æmº6§û”�`[iYIê,8"´>WJyä8Zë÷XÛ€£¶q"µšõᬄ ‰»î„DЯ:eO‘Ðí� ÛÚ¡ª%N×'7�ãWóTµ_ž@H¾�>šÐú‚;J“n²� vÍrü{Ö§>ÚÑ–§¿û›70O§“ÉdR?}º´ëggeé3vìáÉ‹mSJÛ1SŽ×-Š ­Hy ûÏÄöa僈4Y ¨)I§îZ<ép‰‰V:WR'ÚÚ°T8É£âUŸ:ÛŽ ?½~cå×2«Ð€÷ä[PœWäà�ŸÐkêéEF÷=á�——Yá®*o°÷ IDAT»î´§÷hÿ ®Ïœø”æÙ¼š?}òSûƺ_ÿ)ë _:}ݽ[ïxÜ®å-Ï^ž.ÝøzߪPUTÈ]æÐ4±S�QI©~¢s¶¼º¹€:×7uÃð¬Í¹‘>u¹Ø¢üO“�q†�»sœˆBl¥¶,¦r*/P^!g¤G>(ˆ bwUç°¦&p^¯'ÈåÃLTûÓé2¡ñȹüf‘ /XW®»ìÉ�|âm/ÜÿÕ}÷£V»T1àÅÇA|#�×DRcJVƒuæSðH(I#dþ4×'5ƒˆÛ³£5€ÚÿÙ©Œ�ü]â­Mb>ÁâÁÅ ÄGfc¤ÕRsúÕýZs‹A­[/'á¡Æ°† á^z¦pgÂÜÒdOQ¢�º[—M`Ī %9kˆ�G1´¬¬s^6-Øf³!À±`…Mµ�sá«��ç½À�³®|Ù�Ÿòç_½zÝúu[·Ý·i<Oæj潘P¸ª’×Û„ç±- � ƒ–üÛ$i9̆Ó) ”œØÜ }%Ä>+ÛÞt鬸¸4ä°V’r;z µ&ã_ÕA"ØFBŒ@è)Ô¦gš'oAzÅј;%³©uä-ÀXhU|˜$�¹²ˆ¨n°GFþE�§Ê/7ÛÿúËþå¦3÷;uöVßü÷ë?c�ù÷ÿË-Mw-lÞq÷ãÇÛŸµ8ÙyüÍÞY6ðU5¤Üe ï“A§±3çv„/S�ŽÊÉ� €iŒØΣgã�Æš¨Î‘ûGÐù|ê«Çi¯Ï € AFR˜ˆ}« d�8¯…‚´û,5ÄA¿çšñû_1pŠkÄW‘‰Øs,f@ÓzŒºž,\Ý9tà vì}^æ²;ûæÿß 0€ Ôd¿’seö'[ihôÃdÞøý‰‡$ œ>åÓ§¢‚8º7(:©Æm•a‡_±IÄ]ŪÒZ «í¶Xtñµ#2lAÄðÈú�ÑýZ“'¢M1“i芤QÀÚñY(Òºø¬œÏk>[¸O‰W6~ ';ÄElÛ!W¸ÄŸ„{a’Ïj»*—¨ ¸¬9J¤eǯfjy{,‚�õûôÀ�»ªÑ`g=™~}nn.ϳåfqié¹cøÿ^#/KrÎQãÁ^2kÒ,hÃÒ4•¡âÕí[¨ñx�È�& o²uûg.©¡ë³�¶¤,‹�7_ȸg€˜ÔÙ¡œ¢_!Ï‚CŒ ·P­B…R*fR,4催$‡•  %‚t•ûÌIOë™ýú©¬Ú×ëß¼}ñÞ-N¶9®Ç{Å�«bÅ]cP+½â(a‚Ö‡ ß&ÛG½Ø­3ôjŽþlh…bŠ& %e ÜË9(@1â%ïí—íµUÍ1TƦÉLÖ„Â@#Š VI¤^ÿâÇNiþ0bÚ`"qâµ"J\ڙɹŒ˜ &“]ðuCU·Žòu•ó_˜+æn-²²7Öüw®�IÄ¡Ø,Êz†µéÌ5l,Yù©P@�þM$‘˜Q#$­ýˆ6RÈ.Â1´›:–»,¾ÚêA­3‡ÑØš �[°J4¼}­ÛýZ³+˜êZÓ ‘Ì]ÛtP¤I2{ât‚$X‡ã%L¦½G¶ÖêY Ô»b3M(Ohe¸zËÕjs^Wõž'¥Z¯ƒX³ósý¡øã®ËNy´'¢íG¾ïÛ7ïØ²…êzRNšé“Å?Ë4O®¬Ú¼[{| ªaný�ý Ï^‚ôX-%Ö&\ìêD S¿­|GÍü%>äŠ×[»ãH¸ ̵ê¯Tj5i('ú½®€Iãe6¿Y$FÑ ãÕÒ2’‹<ŽÈ9dEIðÈšÉò>“éäyžmúo¾ªÈÜèºNÿù¾‰œÁõ™“žæŸó¡+ò N:´î_�~ý$×97½±üÞ]ÿ¸ÿâdǯ-N·>ÅdŸ¼(Pä\–3Ð(qYNµÄr,ôßܹ]»w.SkÁ©ÊO{&V@¼B쇕eB|ŒÀàNî ë# ´RQßÅ–¡Í�`ZøgbܵÞI@\œA±^±W@À)`’CѳÚ[¿cçPûšêé2û¦nr*¾QesŸ[¨6\ô�Ý÷ùÞ«ñ}óÿc»ä£§#tO”Ö Ìi6±­4CǶ`+ÌÜñ0#/hÈ5’’zÕÒ„a²dx.6X�,%Q¿N¿:ýÁŒ»&öd��ûµVW¯ÿXëb ¥¶ç¦±‰é?k_eµ"–6þf.ÚÝ´í½ÞŸ0^üR8­È Æ©’&íNä¤cØ#ŽÓ´‚NK–: [‡sØ­ßÿáuÉ)?·¥T7îþ ½þ®Ìé"?^¼c²´8©Ç“06Jÿuw‹~NìÔ:"%Z’Ìðã:ÒÜNW.¾SbMi¾]!²é6�'ȃ§ ‘ùƒ‰WNŠÆ‡½«?·CBL|RÍ‚ìø8’°ŒŽÓ°'^bvy5 *ÃíQ{zQS7'L§Ûö?ø�_èÓft]pÒ¡õóÿö+÷›»ûô‹ßPôïÊì®�Þþ7|Ú^6øî÷ÿq¿íK[ß5Ùö«?~8;çÕåYÖú•EðÒÀÛܳi_b"Ò,4ãZ-Ú)š.;s5>À‰qJ‘Æ?h�È4‰�ì·q$“[—6¶ /ñ'FH;¶Ö.6x6(Læ dD‡áHe~°,1€‘#iRmÚb§ÁdºH“ÉârîófóŸÚsÝC>:(G·ôÍÿ¤Üåè<™TŽIDj©§[I°>µ²£/Rç^µ¿´Æþ†×ó‚XÚúø4EËáŸÆVNës!¢q¢ÐÃ+�šsßþ÷@¿Ö0õú�&y­_¹XšGþœ8ìLš—Shg NÙÑ–ófuOÊŒ‚m’زqj·Þú›xXOÅ[BÒô8×!ÍbiíÓ“¼·6îÞû—q,þ$ÖpanWQU_ÍÍ}rn4ü;?^ºsº´‹}]· QÆqÞÎ샲Ó놉{Œ­ø†ÎÆ1m¹õu6¢dN´Ë]€¬N˜1›jÀˆV 5ªF¦”)N‘x  c ÁÜÕ€2¨YÞ×â„¥A¨UÙ$YBàÕÂÊŽ� ¿V�›U%åÃùlÜðãñôX§qŸ0ÃëãÇ?ÉÿÑkÑ1ï½ð¿ìÿƒ Oã·õºÞ…|†×íwþKY7Ó‡mÚy÷ñÛ7Ÿ´Ü,îUÏU äȵ0)<ÙK>°öúkÈYËëCðÚƒâÑ+¿ý@éÈ x!-NJǼӋW@ ç¹dr÷$”�µ+— ;DuD{7†–7F¶ß¢ÄíPzHÒ‘f€Rî€ ?a¶A nv�fP H$Sã½[ïp¾žº‚Ê[ùº¿•ë/˜,ܶaÝž}óÿªv=·¤ºàüGÒâG‰÷¢4 ô½¨ ípñ"ÎcüƒYrþt�´aXæÑ®u´¤Å›$ô"-æ¹™‚Èdv«ß¨Ë àtÚЯ5ºz À‡DEŸåóHœm`Ìh±ÒŒŒ¬Ö­Kº£ÄßF>«½C.‰=z¹óù&!Þ> K/ŸœÜ�Ò‘<%Z7b3¢VˆˆVßöëÇ_Ÿ´�|ëæm›6ÑtR¯k|sX=^Þ7g°Ës°s1äIÈnÖVBÕ¥"ÔìRÜ:NR?T¾Ñ ±�obU™ÌÝ-ÜýêÔµ¿Ý…ÞxZ›gK;�»Ï�9M’‚Dl Z6òAë •¤ýDrÎUyï3_ó> šg8ÂæCÞriÅnríõ§ÓËfpýíoü¢öû®ZÿéSž¶í¿ê9üÙ±oëÁÒ^þÞ{Ê/ýòý·,Þû«;§ÛŽ%ç5ÊFTdœËØ{€8•´¯8¡#ðĈ5rë:A=dh\,¼)ýö„L]¤ÇhRk°™e"yJFt 'ë*^ÿ0 ÷2Vc7ÈIžT?݆éxä9�náèa$”1&G ï=5Mͨ}�Sþ�*]8WívÉ£|À-¯<äÌdû�×»DR)£ ‰oÅû«YAq"Ò7è’L$ɧÃ@U#*ö"ê·¿‚¥%Õj÷ânñ®¾A ™Æa«-¸5¬ˆ‰ÉÙˆÂ~­ÁÕ3Öö2áebnG®±+bóIÚdA¹ô°W°-Øž~Á!5µQ‹8§Éá14<ëº:oÿ.ðø<‹©.8µÐÃ2ž×¡ßWsAV� êŒûõ“X—œòèm.ËoÞ°ÛnŸ¨Êâ 4“{›ÉòÔ×Sj%yÆìIÜ•·¢ï¦”*‘¶,ÊT§Q‹êæ 0{Ð!´Ÿ•Ô…J,1NiæwçN- cÐ&þÆhß8Õ2dO‰Ö¤=˜Ù‰]äKäµB8ÐzH á1„’ÅeŽ‹áÙ`„†‹==ÜñÞó‰¾ìÈ›®ìå3º>}ÊÓ¶=ïo®ô¯D¿þ=ëü[ÞϯýÂË7~ëK�Ú±¼å˜ÅÉÖS¦<=À•¥–sÞqFµo؆�²8ñ@îã].D;mþ5¢&¨/œ½J×N^‚ᆩ¼À¤2¢7ꆽ Œ/.„â*ž¸3i«ÊF%˜L7†‰âpî3$Î%át·G}¬—Â-ï zSÏ—–ÒIˆrÙøºa?õK%Ußå ŸÜsþ!ƒÛúæÿ'Ôþƒ™ƒøPDþ±xU·ìq�¨¸S �ï³xñËîCŒ–fFœ,°eüÇ›[v¥]0„uüƒ¡�ÄÝ CÄÑV¢3éT3Ž”" fæ~ÞÕýZÃý¿\g+ζäR¸®jM$.ŒøY5žkŽˆ,|Ð9…M'µÕN·ÿ§u�aÝi6¡X¯HÝÑþ¿�™i$«èlfŸôçâOxåy¾#/ÊŠáèÂA5¸”êzS½´ìšñÄœÅ,•n†÷7˜U8)‰ˆãk’²xPhUÉÒÇâS“m¯ ¥ÐÁ¦ïv*FgM.LîD’ÙkÊŠ,2&áÈTQ¨Â\`boM9´°LÀzaºbŽ’UóŒX}›ÎåeAY>t5ò Óš�ñ�ð˜~‡Îp3÷â§/¿ào//ûW¢_?êúÁ½·“éøa·}ÿ„“Í/™r½÷ÜÜ:^7·��ËR›"y†8áì²A Û9(¥Kj?Œ˜îbONií9ñweÒ’Cîí0<€(ç…hÍŠsv†õzÈ#¶àá|Ô`¡üëìƒM ˜S‚"Ô6½�´L~a§Et Zý·"ÅhFÐA7”é8“óMÝÀObï¾?È×}h¾Úpá\9Ûºáú>¶õ'Vî ß�¬ö_…yQÀÚŠ·›B­Ã•Ë€5ûwfTeG÷ÆÇGæe$¬‚‹©†uºBÁ¶^ áŠxKÒX+ –Åß&f;�à8€ðêsÑïŠè×EDÛ<�x�†[¬È+\ÍcXODð-Ô˜ŒÿaSÖm×¹¹ad{òWXÊ„=WÙü=[³]N?—4|U}Xõ‚òäÕ�îî~küÄ×Õÿëÿ¯:dK5Z¸¾¨ªOgYþe†¿³™Œáë Á{9°Zƒ¢Ä€™­s2ugý‰¢·ž¹ö]ïèJ`fùz'ƒžøÛÐQ 2l£¯�˜N²‰Ã’òC ’›;<\êz±z)£¨¥¢ùµ€ ZÁ‹¨u´ò./<çöYùÐÚÓ3j4'ô¦‹ŸôÐ3Ïëïƒ];þ°É >Òƒÿë�/=i¦¤”ï¾é�Õwïø§ÇܱåÖã—¦;ŽóÔ�åù5ðõ–fý’S‡ß½ãæývŒ·»8ÝvJCÍcÊj€ùárÎuÃÞèši5Ô‰TôKᜄÌã‰Ù�`‰‚.„â"œ”Þ3y,‹²QÙØ5NÛÛi¦g�`‡•Á?l«¤¨m,Äû%Çl9¢¾EÄLÎÆšŽÕUÎxJwá$`¶h*@ ¦©y:�N›ÚÿÀQñ™ÝæwÿHž¹ï�ö oï ÿ~ÒíÊh•Hú¬¦ÔÑB´…�Ðÿÿ³÷æq¶]U¹èøæZk7Õœ““Hߊ€(J:iŸÒŸø”ž ¼«ò»^”€ �+6ˆ¨ Â•§ò”w”¾‡$tA@é»(­JOà]„@’srªjï½ÖüÞkÎ1Æ\»rÕ+„S©5„“œSµkŸª¹æã_S ŠÛYÝúS ûY5D.ŸS…’V‰¸Ž»¯r€XMûx—Ž•_€EÚ�¯)“ïrôÿ€qN<4™éÓüBô&,dnz 8š?néÒq²qÊPIÀAÄYö4ƒ…¶S2e;YÃ;O–,`N’ïÙ\=ÑÂ{ªv¡ÔÎý? TžEbOíûæE#ð­ZwzÎGÖ¾—Õ7C¨ÞZO&¯™L§ïcì.m—{¡[-úäDêÌž×Ç\$¢Ä–”šA)µÑ‡¿á�ÿ�@š/IW̺Ó XëÊ�$E‹FØcÐoª,\É� õå DY×Åû ¬,Tqò št�< 4Hˆ*`$X–}’& ‚U „iÕ±9ÊXÝ+žØví÷�»öƒ½×ò!/yãè p%¬_ÛÏ6Ïü‘˜1ÚeÇ/™®âò_¿ü¢G^¾úÆ£—Ü»ælc GûC*Fônÿjt’"€²{uÚéTxÌÒøªªx­W‚^¸§QA¬ÌÀTRÌù$Ûö¨¿EboOŒ4« …±AgfËÂ[V³ ´j bÀЧ>Í «ª·­•b€àŒ�@Q>#-â¶/hbŒìÚÚÕ  |ekvä¥[³íóf“ùgæ“Ùîøt}–1æz}†“ªÀƒÙ€™¾W¤[°€ˆË‘rm{ªtûT£#!f8t¤F—ç "‚NY Aóè?áF9 ƒJpȹNÈQ%¢/úJˆQDºqcÞ5¦î1öJHíÖÈCLÖµ¤u zð¹Ü^üv)÷]™úüµB/7guúdôáñ†âœs繈 a±¿X’WÃ%¨“}nz¶Æòø|«Ö{›µùCO¸U'"_½í³/|W¨%víjµºC۶׬dSÂdÔð)×V€K|„©æJ½GÚt,y­ÇôOgØ\Rýœçž·å§y »h:åY»�á- öyÛD1½JtsD ;d ]âEùn³Ë±û*Z„ÄØ[‡JªÉDºU¬Ú–7ØÙ[ÝG('~ð×ߺQWá}þÚ=ÆéÀ\/}è}÷~âÅï<òê‡Ýýø·âõþÿ=yÎ�þ—åø�-×oÞãÏŒ9Û³?úôÉg¾ôñ›�Ü»ì'–ÝÞýâ�æ“MΦ3ÖU%±ëÀH‡£{x™òmØy”B$±V$'Yp�ÞÏQu€RÄö°8ÉJJ¿8‚ž·èʈ9é©+î=ɺRÛW(p_ÝuŽÖ/Zì�ÿ(Ä"ßÀ] ÙC™a;麤cWIøx&oÞÚØ~ÑÍcŸxÆÝž¿3>YßžUI ;¡0JL(y2†.\†K ?û¶³‹¼ªœgYnT–µ4“áœ,±Ì©â°6O;ÑJWý d&Ž~"u‡Õ&Ì5|æŸ$p¯�aì÷‡{† ~!.vtpÇû£…¾]2ü“®p&{¦šïù£˜3MNÕÉBM”éŸ)âš)àõ*s–BJ`º.V©�œ™®6ì#&z¥¬�së/L*œ·¹1e#|�ìí}ƒ‹Ý•´+¡7½7g;{Ghív�ó„ÁHÄ�UïÆëêD¡t€Þ@š:ò>ÅÛ æ)�r:gmHV)é„8A�É𘙳”•Âík§ƒ0÷!ƈ;!c$Tu�z2 uµ³âµ–ÏîÈG-Úî{¿ÿ×Þ2ÊèzõÃî~ü/ý›ùôu~ñ�Ï®Ææÿà®ßùàÓðÄ·üÌüs}òÆ'—Ýw¯=ùèÞlÒÌâæüH¬CEv]ºZÓuÝñH�è+9ÐѰìXs–êY%Í5ýt&À%ßÍUÓ…LKXwö§é8þü ¿$¥+Y?ÍqÓÝŸy (æý°w À+ !¢WrùÊ‚~plzEÑñˆÅå Æ.²]-¥]®vÑÉg§2{ÕÕ6¯ñ—aþϸÛó��;öÛÄÀÀEÈ(1éW-ŽO‰°fhÚ×¼�”R(j¬ãhöeZfvòG¡3ôfDÉÒ8*� J�†àe’ ìitŽ’s7œ€‘V;RC0Þñ#0®Ã¸ ÷·Y&¶WV½èF bæa÷ÿ ë—“�®#Ú›³ uœ•‰D #-އªÃZïµÔdØé£é�QÄ2]áãN}ˈÂsöÔ¾¿¤§Û2º£|×]ÿðCzeM›ðͪ o›O§¯ÜÜœ½³[-/]재ºÕR„BHî·Lº‰¹µ$ÌDPÏÁƒú59Y]vÌbŒ ù¦†Ë§�E%–‹)Jâ̺O½=¶^Å4á¬& P„p”Pª|Õ{ô¸òYÝ ¯* 0Ù)�i†�¹È…uô.[Y;£h%2"Ô�4óM™lmW-±eϢȯˆÈÍÇÝzp×_?äGvüWçnÿG^ã¿Ý÷œ=ÀkoqbÚÅö'v.>{oyâÑËnqõºi0�nH@Ò±‘� d(ü¨ $VuN¬Ž'¥I©ƒ‚A¹ÔΑEg›t§›Z–ºÈ_:æ¼óíI!Þá—&ÉJ-ö§{*’$ª”UC_öÞîÉõ=…¾Øû éÈçþkøpµÌ-´«G’¤ A(ËnWb·B�ð…y³õg›Ó#¯Ýšlþ:[×iÿWJ»“¤…«¼¥O¸È“þgêý'%'eŠ¿hª/MsŠláÒ‹Èbjå�µÌ‚†ù†wBGåô{0[¤w’ÆÂ^» ÿ×á\#ýã°#ê^ëÝÐY’æ>„˜ë@Ùúžžo¨�ÈÐ ÍìqE©R¥° XBû Ëxwª,À ²³[Éa (ø9àQgI5=6@Ö#&úm]÷„Ûê¦øÛ_¸m'"_½û³?ø®½½EhãW]{Çåîε§ØêIJH;CF¨x Üж7GüèfSÏ ‘uÖ\¾Ó�I¢ûM/q>>nÀ…f°m‰�ß–DY“@Á Küsˆšøã­Q¼W·÷E BDªV�«„Zê)ÈH´‹Ýë®ÚÕ½ë:\üƒ¿ýöfÉíþÓ¯Þv”Àõ²GÞÿă^ö†ÉËü€qŠÈÖ+>óÂê]ÿxþ÷ì®NüԲݹ—7©ê:6õ4V¡AVÝyò"ɇð„wAaÝëMQè/|ñT>÷Úû„›”¾ }º�µ5óS  ÖŽOɳ[aaJDï(8äIç÷JGuÈD­W|èˆÙ ÿÌ¥7ˆÛ[´ìصK ¶]�úc“0?{~ô�7¸Ú÷|ö ·û�1êïÊ*w©E×oêž0)‹\£&œK$Rlµ©î-ºô ØËSH»ßmûŠ L��^F| Ÿ ì}¢(EÊÇKaôÆÛcû?®‘pˆ]t ÍaL-ËÀÂÚ/ƒ§ÄBU©ÄfŸý 1j²ç@Kþ�-ò{,¢ wNKfoÓª·îË ŸåõRÊúF”ÄúÚ¢Ÿ¤¿ !Ít<¯ìõÎsn÷åP×oÙÜÞ~Eð®n¹wñj±·êV­‹º×Ÿ"E‚czº»ˆ��2˾‡/\z]°„QaÜNL&Ö>�GÕ*Cù²5`z�à]„\Jßд:$û+W¬ Âõ . ðµØ pC‚$¨Èêt]‡£T˜Ìçl¦sé$\-ëÚîáS^|“3Ÿñ†Ñ]þ€®—?øËŸzÉkæãwâð¬'½ù±“·ò�7¼|qÙ½öV—?ªåêf¨BœNæRU „ÁNÍjÄáˆÃðß2\ÌŒXX÷Ú)ƨ&¹TöÀÓWsY³1™sÙRrž‹zq=Ud 2⸠:” @ßd®i¨~�"!zé]¢ºŽAÈÒ²5€Z¹%yX”ÛvOºÕb¯‘ês›õÖ«¯¾uÝÍëÍÏ�Íÿ•]ò2m]ø†º`ØyÃî”ÐX¾Ç‘úø„�)“Æ z“\µ¨°Ukë„&ÎÚB’Û5%Z�ݯ½O UЦ•@Ý'¤ IDATËÏJÜJ!�ä8ã:¬Ç¡v:é$Ë á�Ï?MÿQ}êícj°¸`›þê ê@.pD|c Pgïeïï¢z4õ¯÷Üe!ó·f96 Œ™¶gm”SJ§vÉú>¸$Wå�Œ·8c¾#‡QÓ\RÕõ;&³é+gÓé«ÝÝo,vN"¶+ãR ‚yHêöô ¸a12'EzL>ï@ù¬>³WÀŒ‰'ü%A«Ã«,>R·>¬bD£:eMŽP$!Šô2DͼpÞÓ’Ò�¼Gi�‡ !LÑ’+d¯aºŒÌA‚GSr6±ÄH‚4³™Ì6·«6ÊÕ—‹Å}!ññ‘Õ˜p€×+úÀݽè•Íø�¸ê¯?úÀïÔËny�K÷¾þˆË—ýìå«“×F]WÓé–T¡I~dÏI(»âPÂ¥Ÿ"ÿQîÌ�m¡?ˆìZ‘Ù��~è(I0æ/ÈHö·øÀA0ù´!9£ª½I>JÓÝ@_Zäb éF[ÐÐSe)»ÚǤéÁúó7òKHLÚÅKÖ‚ ¡¦Pd¹Ú qµ¬kÖ_œUGþlczôµ[³í/Û8cŒú»2ËÝ^•â§ìȤz†8¬ …–^œûžsvкÀ%hšÌE¢$4Á"¢E Hoåç#@ÒG›h�.K�DQprá2‹à²E(ò> Ø¸Ý%‡x©¡�OYë¥M¸šôܧ‚ 5ÄëEë1úÔç{ŸõÌ£3æv>�‚1ª1j-зü;ô �ý:2o û°ýÄSsÕ"”­qk|GÖ»f'"_»ós>ø`ݪmÚØÝ©]î^«"UUû»6Íôu¤O PX‹Þ4ßÌ%¼p ÄÂÜ–*Õz±› ƙۘ] –ê g˜¥nþtNQ®ÅòÃQ�R©†"àfýΪž78°Þ¶‡O2�0'Å> TRÏfÒu]WrÃe»¼oSñä™Ï8oc2•÷¿÷‰÷åp½üá?¹zð‹^^öð‡Œ?¿«èú»o }Áóo|bqéwºË¬'cdËju¼‚ù𹈌|ëûp~ت¸õ‰°«†_<,ä °ñuz6,{ÿq� €Ã} ÒxÄ:üõ§SÌ¢ÏIj‘¸ôöÀ6zTvM¤?’àTùž¦ìSÄùúZÕ›QˆŽøÑŸ¡`v'D~*†›geÀ;àããÎø·ûu]½cûèö«gMx�¬—t‹½®ëZ $f‚ăH™¿’Ó!4êÑî>–±Rt°ï½Á4E”O ùÕEõº_¡«�æe6ZKåFž®•_± ð>À„å[{ƒ`ÿnÍ�CÓ Å¤5n˜` ‚éwc”)R™ln²žmVëk“á쮓³wNÊMoñ›ç�.t½ìá‰~É_Tãw⪷žú–ÿ2yåÛÿê†'——�µ×�|l+‹ Uè6¦[±©&&ÁËy7‰'±§Lé)Q-Ät@ê/îu85S�¢ˆ0`Ø•ÛK(G:�ŽBÕ ” ˆ³8³éøö>4ݦùÝÁNFõ�ߪžÐÔô£Ò#`ß ê�´ÀÜ{ÆHY.÷°\î.k©¿8o¶_}µíë½hÖl~alþ¿s€“^ÍqiœÚt]L B+CÅsðÜ�j¢W)'åNÊaRÀF§úùX´4¿,"¤ükºŠHÿ‚vM[V¡å¿õ²?à’KGpô;½êº¾¤ªë·O§“×mÌš÷VÝò²¸Ø ±]öκ¡$¿êDdÉ&Ñý¹†ì¿ cÊ«²…‘¤Oˆ ï©ì½¤dëjŽkŸ ÜŸÙ0~š¤Š9‰]ãP4Æ)�­°pUÃ?cú´o¦B ŠdŒË½aÛb*³Ïo6Çž·5=í5[³£_8mþ]£æÿ;@úŒ YZé;�"MhˆÐ縉xeÞpa‰S>6R½°\À`Îè_/:cÂÁ\¡7êÿd\‹‹·ò(û8^šÎ5Gnp”ö:{üâe±%i$^�æ ãòBão±nNºŽ·¬#Xzÿß�>;€"œ·š©ª<ç.ÉšÅ'ª¢Ä3†6¨žgMadd*„¬‰î�è½Ë®ÚÇâ]~÷¼ëÉ÷<¥‘ßw?áö�ˆüË]žýÁw-—«Iì¡íÚÛµ{»gTS„ªª3$•l™XðRö$ŠåÌÿço@„ÄãY˜ùý,ì§Œ°¿nÀWPiuß•hCÓ̪ÀË®¦M{Ÿ îsò_Eê�k ê' ÙÆùÔÛ‹©ªŠÀŒm$⪺^'‹{‡Ø]v«§½n: ;ïÿ¯>t¤“ÀõÊÿüîO¾à…[a>[üùýtrüŽÜõAóÁOŸÓã{_ÿ±“í‰ï¿o:�Çi3�U¨!mè«'ôžõì?¸»%SYOjàŽ Gu4Î|¤ÁÅ ¡Pد�¸~>Éì&®õo¾2)�Cª• 'ö¯ë_¬ŒýLûx ²¸2fòÎ2>ÆÍW…]l¥]-CۮؠùļÙ8o{zúù7¼æM>ý‹·þ�±ùÿÎ"nû´¨BéÏ"šŠ¾ŽÌÑ”¤ S(¤pà-î| ´,E ^|h]a/ …/Š7¥úÙ‚ÓH×á� p538B‡y� €Ã t¤DÒÑ›MP܈8wiê™@qºª|2åFB#|Ê�ÈçñÑÌKôð;Â|åºq‚8@´÷ñUK—î –ùÂ4~t²J!¬‹«8pª7ÿÅ{=çv_”P�?�o¼¾ áòZï»±k—æº /zï¯5ÕÞù-—2 }4on ¹�8•½Ož¨g›LŠ·�¶ <Ì«’ª§ßËé�1«œ&ÅÂ(]àT.î mòè'j4ñ"øƒzd‹S¸Œ!H]ÈÎ\¤ ª¤žo²šm 1¹:%<,Æê'Û£7ýþßxË(8¨ À£Î¾ü|ÐjüNÜõ¤7ýüìï?ûö]¾¸ä~»íñÇ®dùƒ¡®ºÍÙVl0¶DTýRÇ2&Ú¿`­…!EbÿØSÌ{Ô¤ASzóÙƒ ]GÂRE!ŒéwC’D¹¸¼Þ­€\!½�Îá ÖF)‰JŒó¤“} %¢¤%r_0Á99H´\!—;CeTô*±Õj�Õjo¤úÒ´ÙxÝéG¿ë%“iõ¹±ù?êÝ 1 è]t�ñ«TX»¶¬#�Ãò‚C¨2Åe0†‡Ç8Dµ�zúA>XÓ,;´¹‡+ÔÅSWa„¥^ýrÓØâ527šN3ØÔ^Gª=©?¥jˆd@DN‡¨x1¿\¹ˆ ô'æ]®B’ Ê%€UÈM}ÉH1D Q¤oYò{qB=ÀáºÎ�&ìéƒUï߃j÷R ÷~Áçð–GÝhÔG� ÷v¨¿Æó&MÓ†€zo¹8³ UU‹ÉL&R�»µ™¸¦âÊEæü@Ý™)ÊŠCóƒ"%¸=iU3Œñ¢Û ^ðÊAROš¶[R€ÞÐ6lƒ¨$×¢§òíMIH„²dèÆþV>hŠq68v™Á •ÆL@�e‚¸B$‚•HÕ4"Ü Ý2ëºå}BàÿXD.w鏯uå®g¾ÿ·'_ýÆç¯ýÍ�/ž½»:ñS .®5�n‡Ùl#&3pÙÓ¯'úG箳BÐ\~(ž¢¯ŽÀt]�„$¸w',s ž%¥ɲU�3ëPP•Ûz¯­6èøìgôö@PzS²äK"«"¾M™b‰�à$_^0²¯(�rTRñÃ8� ÄØbµ\c&¡¹hÞl¿p>ÝzÓ|6ÿt]‡Ýq·ž2@_.ˆÄÄs z+‹ÊÿQÀA…Åò… ·™ŒT¸ž ÈÞH, Û¾žã¨-PÚž´!†»½KlLA}fñ )z©Ã�@Êh!—”Ý�»bÆu:Ò»Ÿ±ð ×}îÖmCX5n®ànÐ@T†YÚÑ1ýöaMqÀÌ=ü†_¹xÑÛÞLŽLr•#æû(¶~öÁ‘Ø|ʬ÷?ñÌVD¾üC¿ÿ¡·‡ˆ±½´�ííÛ½½ë†É˜Ô1„¾&•H‰ùVLÞ*{Ü¡Ñ?ÓuŽ}„s,>§´RšÌpF`X½˜¯/ÊWFÁï3¿!�Ëð6g3쿲ÊÉ/H9‰S †Ï‘w ¦i~ûÉ]Ÿ.TO²f7 Wg…¸:~‹_{ýüôÓOûà;·qš<®q] ëO/|vóñ‹>|Ó�Åñ.»Å�EÄ›Lê�8ŸÌ»:4ˆì´e·4ÜòA—˜¯ÿ"=jS³=wÓt¨ºÔô9TîÛ¬y@o % ÎY8 ¡¨wÿ¿a´ 9ÀÕeþ‰º¼ÓTŠ„?ÎÑ£ÿn\Ë¢üà R@ˆ>AP¬v�Ž+iÛE`Û²ͧfÍüü£§�w�Ó¯óOO¾ýõ©w¥ ƒ¿Ë;u¿`+_*Àkü”Þ¯JY¸»ˆ¢’—O�-x6ÿ~n#f¡žÎp^ƒÀòºp1ê’�3Æuh×Hÿ8Ä t!=Êl*ñ�ï©Æ@pŽè ,,Ψ&Bp"é¢+*,ͨö)ÐÖÓSú©~y—yJoËžÉÑùå“X�E‰âM×’ïpÚ¦1ÆÈ0¾õÑãôÿT['Žóóͤzí‘#›/žü–{߈‹Ý•¬–{*‹Îl ?z€ëF¼åD¢™] \°³%RB !)Eœµ¥{¨¨Ud¦¹ˆ™gŠúm ûn+t-ì7»h÷ïFÅ+P�«¡ÃèŸQ«.&6ÁrÌFŠ‹YmÞ»x“c»(±‹ˆ‘�€*L¦!Læ•TÓ« ªGÕO_rÙÎ÷ÝþoÛwé¸ÚzÒ�>0uÐó?þßðËoú¹Ù'/úÈ�N..ûѽöäÏtÂï¯êI·9ÛÎQÒ÷9Bv$£€1E×çk¶·coßg�Oã3òsjm‚ùû¬]èÉÞLsy@ É+†�ª; ’DºóËwßzROYæû]ˆ@牮•†‘tdÑå·œ\ÙrÐz¡$DˆtƒšÏ¡J"s)(R¥_¥eÛ.е«e�úKójãõ§Ï¯ö’Í?�Íÿ©µ";tì*2§#É7¨ Ùiƒû¡)ŸJðöy ¹Ô[ŠPç‘Å’$`36äy–+.‚¹|�Ï0; à†rÑÓ¶ ÂЗ)Ò�#0®Ãûóüé"¦îoê>¤Gœ`ï¡®=þÚ†z²k0ró>ZpŠ5㥲 ?Ù@Óòõ }-P¤ŸŠZÿ²¿™áM ÄœLLñ?Î/ˆ!tÜã/?7Œ§ØúøÓnÇ�Íæ›u]¿k6�¾vc>yGì–ß\îí„n¹ÌÆ>yo$3g‹ÝSÀeg¿ Í Ÿžl ’AAãîS¡$~Súçê2*ÌÀüvè_< É�m2Q¦ hN-�„9Ôšf+œ…Ðt¬<€ûW�� A%È(ÒÛÌ)Eê†H@¢;$EÕ 1™V³cQšû¶m÷äåjuë³ßðÕúþÿïGÇgg\b=ñ­�ÂïÝó/Ì ìâ˾޴ÝòÚ—î~í‘;«K³×¿f¨%L'sT¡ }#Ë d@d¶àÑ`³ÜÆRBý�„Ä<ž‡iøV€P˜¡2e©iž#ªç��ìA�±2£Ã÷8›è×4*­?š²¡�u5Ù­/�ß&Ÿr²mw»§S>¦C­èÜ\áá‚Ôà|W †ˆ „JD÷»ŒË.42ýâæäèßœ}Õ¬™ÿÓ¼ž�Íÿ©áÑ‚`ÿ)O0$³ŸDÛ/½yJoª<”§zKÁæûvçÂ×ý?Q 0„–ÅCöHiÁJä,mEú7¦‰ºK¿EcþS ÊÇA×!^£à¯ÔäÞ©§ £ ¡8‰´Ùö‹tLëÌ ,Ôwô6(Y™Ä}wm0±§¨Ç˜¥.l©È`(Sžø'NíÊ)|�¡í\ÝÇuê­ ~î6QD¾þ¿ýÑGÞ‡=Ôm·’UÛþÐjwçÚBÔ“(!h0ŸÃ®à({= •I¨æöŸ ¡íÐ?zs• .ÁÃÈ z9¾l®qÍÀSÃÏl±M·êÜÂNº°fK¤¢¬_õÎ=Ðý¥I}´®ÇB Œ �H# å:qÙÝ“‘Çÿñ>:;ztû="2ê^Çuʯ?¸× Lü~ ÏíoÞhgyâ'öÚ“heù½U 6õ”u˜@HÌ ¥”Ò3�½¯"Ó±æ .w¹äþ¬p·#�èNUô„+ ÒéåEu1«=ú€2·Ä%¯ $K{÷Ò"WP¬Ò€¾ª?óQmy’� 쯉ÜÀAg ¹û0²�m»DlÛ8‘Ù'fÕæùÛ³cç^ýôkýã“ïøcóÊ®� J}Ÿþ(â9v¶©Uµ  „úçˆýê�|¬;·ÇÐÝòB–W²¦Á&ôó|÷É~Ð_Dd»30‚]ÃÔ¬q¶52; êjâÇø y¸ÈÇ oª�*á˜rJ=…ˆ I�ä�n àœ€¢CwMœŸ4¸“è­Î2‰š1 M‘ù ,͉Iý=: d‚ûC5Œ§úzÇ/ÜæË¡®.ØÚÞ~US‡wÅåÞÅË��U·\R„±ßoO¥—zžiÒõ`Ïk8ž³ù—Dýóƒ%¥ˆ3¥`ùLI5©’_Ÿ,«Gû1kÅȽhÁQ“·e9O¤|üt �CU ¯øWRJÁŒ¸RÝfwB€Ég¬žRšYMN�‚‡,Ûø¨Ë.ßù�;ýþ;Çlùq�ë[´ûº‡TúÚ§]ïòå¥÷\t—ÿŸ-÷nŽ@Î&lê©d\�ö^vYE;좿RóˆÖ[f‰(ÙˆÉÇÏÛ�8Р0V ¢1%,1gUõÐ+c|3ÿ™Hþ�ÅÀ�™lå¤×)¾Ãr𧨔ifOÃráí�Š9ÿ§T÷쩤[µ{\®vöÔ_ܘl¿þjÛ×}Ñ´Ù›ÿSºÙ).HªãžKßs—º3¶Ö›?ë鼬µt§¶{=k[²(V†›^dpÜÛ²OÆÐ¸#Ÿì'$éçYúŒy;/1<#ŠŠe �“±Î=Ôkdj0 ˜™’À™8t ©?LâФ/�lFšøÈL*½w¹…dy¶¥øôNþ~ÂéjG Èí PÄöe Q(­òÑn$�Ù¢áC �1N7„<ê{Æ“ñT?¼šæ’ãÛ'ÓéR€ÕîîÞ=W{rͦª"š¦ßŒ‘™ß¢ŽüT‘&Ì#ûJgCIˆˆDÕì{wŸÁ¶‚J^5fÈ>Ð¥g¨g°¸ô=ç²EG¤…7+̦[)£ ˜§YëTÿ€›E ÷ù§ØqÕ¯âiè�m…ú™³ñŸ«MRDvúFv=´QÕRͶÃj÷Ä‘¶[Þ#®V ÚöEäƒã.׸þãë²�¯m,ãîC(Ý#�î:“IS5õŒu˜jÇ+÷ Ë_ð'‚�;õ6Ìÿcîcà¨zpqjXn‡N:@ÔÃ'«î�%zR‚ŸM¦�¡Ê3 W Gþ´û^mV¥ø»±xÃÚÀÑ�²C054A R1v{Ë!®Z©»éç7›£/<2=öÎ�éÖ§'õld=�․U]€TTõÞ†m=ZBVN²†æ ©«¤ä’c§ > L`öósz[«Dã}A�ø�K{HÔƒ¥`àøŸƒT€H°G¹nÁHu€qV@‰Lð´W4HNá¥%Ži�„"ÝÚvjªZÎøƒÝëv4Ù½í¯sÿ¿˜fŠ’ôSNG~tG¾’µ áz¨tÐæ ±ù?ë��»M'"_»ës?ü^ìì [®f­Ä;u«Å5« "¡.m÷^ñƒ�ïZ–¿ûm×ÚÓ#`ÂEHW¹R•’eU&ÿÅ ˆ>M2œBˆ¬‰{~\œ0úì¬�êÅY_Ù·^5˜õ ¨'"“ ‰K¹öª]þHäk·zú['óÍÉûÞ{ÎÝǨ¡q�ëa]¸øHøã×þÆ Ž//>k÷ˆŠ7Ÿ6é›ÿ©h3£zd± S¯²·¸Sïß/Ãÿ,ÔÇÎsþîwçƒ")ë�å 5� ú™. Í@ÕäýÂz߬—Ç*¸þ'tñç4ó’+Ðý«„@ÕÓy$¬¾…è�ŽÛØIÛ.Ðq%�L?1«¶Î=2û®7^óØ5/úå;=kœüd €4h4á  ž Gñ"VZ‘(™ö%<”Љò}ÜwåEA& ª¸€Ã÷b{7ž2À,SüýSL‡ú«¿Ç¸+;$6®Cº¢D¡D¢Ð Áºžd»“­È¬°( FßN$ë4õ13Çq Mݯ=J±{0ž¿7T÷o«<ŸY)]êÏÖwo�Žê?hthöÂÀj9‹iýÝãÎüj@õ·›G޾f2iÞÏvu¢[,»Ø¶f EÔaþN£±I“tž^0cÕ=˜R¤ñ%AŒP�&Ë=Kdb‘Q=ØÎ0wBÑí9� ‘,,. &¯+í5!Áôb`ð—¶£ÂTZÁÅt‹ˆT“91Ù`ÇêôH<2vñÑ»'7»ío]0w鏯õï[çœû˜ê¿¿éÙ×Ý‹;?Ú±}Ñ�‰*p:™³ª¦BõóμሲYf÷ÙQéÜÓÈðVôyaù2‡ Ãs¬‚R Pù«Á¨§ƒÉ•Ã/Ö{ ¢ðõ-;:ÀžnPëÞ= ·U W&wS/â‚� É÷ëEP:ƒ#ÉåjO–«Å^ÃÉ6›#¯¿ÆÑë½|6™®�;‹q·žúK£!h׳ßlìɯ¾*µø•©ú @U6(Á3±f dŠ Hïz­´¸³Ý{p÷PÄç4 'Ô7ßËWhÑÂêÏíRŽÆu(×È8Ô‹Ê*rÓz5T¡œ¥”w'õ¦¾d,ª‡Fö¼â5@xóA§1ìû(ß±¹›`pë+"Äûœ Œ_œ$Òœ†ûïä:®ƒs�Õõ%‘ü›jÕÎ'•œ±Z-oc< ™2ÔMÆêó>$‹^Ÿ6ë¡0º`)),±4ÕÊ÷½¶áó(>GøPƒ¾�¥4ÛË·rò'$­XÏ6~4¨Ëy¸@#'Éü{«‚’c`CÀ¸éœ0³7h.&,‚3Õÿ}ÝÁHAšéŒRWa¹süh\-ï3©«i‹øG2ÊÆ5®×:±÷Í­�Õ‰‡.âÎ#v±s½ÉdÒÌ'›1`¢ cÿ°‡›`Â�þ ¹ðË}{:c’ÇÀ¢úÛI*—/swŠÁ,•¹× `5›$ Ó÷5ÐîFqŒÞSÈLÙ€˜aO/Vúx””稊E—ºŽ,«¢¾a�ªÙq±:‰ØE4˜|q«9í/·¦GÞ¼9ÛútS5»äîz €¤cí)­@]õÒf§|5èsq¹Y~O»h™\ôâºÁf+¼|E ²èè¯6?̳W¯t¯:°´ÂÌ¢ÍupÑQC1óÓX_ŠXCθå‡�Ú=S¼ôŸCÖ½eŸfäÔàJç¡"Þ=jê&®,=þd衦`¥ž{îM øû$ì—QàQÔò+A’ƒ|÷8î�ƒ¶Þý„Ûwï}âþ%„ð·U¯ªD>.]{¢[,¤ëÚÔv»]â¡ÜfË#nþ@RôËk[ÞîÖý¤Î‰§üMg«­ï‹Ÿéñ³�DÆ?šƒ¨‹âk©á>�>e �ñ/Of¯°”B�#ÒBÙ±|P‚TÍŒÍt“¡ž^{y¯6¶�¸ÅÓλó÷ýÚk«q§ŽëÊ^¿ò¶Ÿ;pŒ®‡½än×9±øúÃwWÇÿ�–˘Lg“éd3Öa*"Áæò @v¼Í\}í÷éíÅ}*E¶™ãþ™á™?†UR—(kZ>ñ»„j®ó„’ÅY¸ï,²0*ƒ”ï´F°bQŒx4¥³Ñ€e Ô`@„ÀŽ-WÝ]ײ–úSõæ¹G§gœ£«ÝüSO½Ûsvž|çg1Ž=Ô�X$%2eDÃyÿa@ÐD(ºh ¬öºèþ‹eAŠ\H¸‡Ê§_ˆÅÆöó*z€Ô—ìÞŠƒÿý»dY+—Ùã€qº?Åi˜­ëwV¡) '8 ðÔ²¤Œu²´dqÙÂnaµ*QK3§KÒH GÙ»;kò{Ñ<|­á>ÝV!z{ãôçé ÄVp¯|n”¹Šœ: IDATÀõ‘§Üõ3^ÓLš7VÀ'c»ÚiË»¶´ˆvé»>½Ï׳pFùÊׇ#ÓÂÉJÄSj)Æ8¥©÷²\Åìa$œ2[„`ôîðµ‚Åø– ®%rH²ºÆo_ÒJ ˆ&ƒL,ãþ�˜²(˜k’ŒÉåh2ßìêùVÛ¡:­<,Fœ=if7¹í3Þ:w鸮¬uÎ�Á3ïñÿ˜"÷Q/¹Wxø_ßíôU·¼gËå9+Yœ)A¸5Ýæ¤š cXØ øœ:=Πm„Ïý+nÓXX–š˜ãϨ仟ñ„l”ãîj–$í>ÝÈ>é H�Fd"‡ˆf6`§9Ÿ[3eMÃl µK‚Ë%d!ë²µPª[‚›JÜr÷ªÛkkL¾2o¶Ï=cój/«+|öq·}Êž ;«q�â€8‚ XêP4ÖǺy¿…¼µ¾êóòeLO¼7E�p¸AÜèÝùúúÄ ØÜ b�:�I¦OãÈw¸7Ͷànx}FUä(8Ìk”æQ$Ò Þ6ÈÛkê/ÍOÐe¡Ú‰­qj+dͼ+«�x™÷�H)ò¹IÑ¡Ih—‚ñ\<¸ _ä¥U]íHD½XíÝŒì¶0�³ª!‚ttÞy™3›µrέ…O$D$jõ™ø0A=y\`€#ö«Ó¦¢õ¾f†e™ü=�„²ej•i�ý¿E»öénv¸šØAE”†�'Nߊ¤2@Ê-òÏ}žV&$(‚ú { #J×ÿ^Í„Ó�m¬vwŽv\ݳ 1Æ?‘ Ç]:®o÷úÕ·=O¿ÇóÔANá&…?c÷È]î\o2Û ÓéEª¤Ê¡�¡p£ïoÝ•�Fô$dÃO |6€š”güƒS)Á¼ûÜíJ'ØÓ?ˆÉo-ìÀú—â³Å7óp€„†©™d0Ej!ÈìÕ§ELPÁðU¨¹ºýŨÑô@ ãJ–«„L/Úl¶_:o6Ï›OæŸ ÀnÙXÆqXpVH~{hû}JÇE¥&\$) X˜èzËI'¨3…€ÖÆ4ê>pOoÃç’è<YÄWª«§¡ò�ä’Õ';T£Èê�\Ê!£@ÚqgŒÀ¸%Ÿ-‚¸d€Ìc8fô–~ưlÊ €—ûzŸ‹ˆë.Tílù¦ƒ¬R Zžüu)>nÈÞ¶ÿzYZ­(9vØ2‘Ýa\u]ø_ïÒŠÈçnõŒw½ QjœÕuí-ºÝ�3ªÙBÓ¤èhF½½á ôZÆd–ö©:cû½eå2l´/VlЦlÑð5ÛáÅîÛ‡ö‰®@H/…Â'[Cé mÈ@äëlhC«K’ wRM¨Ž°2°ønl˜@€ˆP°nf£°[ì^o¹ZœU¹ü6Oó|ÚÈûÞû¤ûŒb›q}ÛÖAjþ_òù—T|øe7<¹øæ½[.o5i6âl²›jvy| —îzsÌ÷>ûÂBÜÖƒ†X;οŠëù}ú) Ï”UÔ{žžp âHÔ(§èóN°�#�ot¬Ò´¡< ®ŸŠ–ƒXj£û!'"öÿ€!´±åª]V±[±Áô“ózã�GfGÞpÆÖéŸ|Ê]þäòuÄ9ŒÓ‚ƒPï"Jäpð¿6ç/|�7ø-þÅãjˆ¿ë׋gƒö-Éî~@æàæBÙåT‡Ï ý k.ß»|gµÜÛ»C a« R…ºF')ÿ'è¼:sbYèþ¥ m2ĦSŽB‹~Jžý4u^ç´C¾æóãäÊàýì0õw†Úþ½yDQÏû DzJlO¯QÎ0Ma”Ýr ’ì �U@£ì’”(! TRMæŒQd¹³ºÏF'[';¹ô~ýÍŸýøoÞgtÐס^¿ø†Ç4ïþè¹×Y¶»÷ëØ=®•öU]Çùü¨T¨EºìÅáùœw^ï‹!e†ó™Û\g†çñ} ÈUø–, î~t&yFš/]H4~K/×OwQÃX“éKÉH(qÊœècægÌ7·z¦ex /„ζ4á,»;å=E ?««ü݈ìº%ºvµ¨Yÿ˼ž¿îØÆÕ_^|ú)wù““ûÖQ£Žú@¬Ž¥—ã¡_É>Oy*ޝç­-MrgÔúÝ�¹…å-ž?ùù ZO÷ufµºwÂL^uÍ¿úfG.Ð=›ú—±j„„œ‡z=_ Æð¯Ñàpÿð+ôÂA£�ôÈIrg©zYË'™|Ä,òs-ô3{�u‚C‘mÆ™ƒ÷òYš~*#“Ù2%šÒ:HZ1{r54$3S0]ý6q‰EéhÌ×€"&·þô�ÆKý ¯çÞ‡Ó¯UuuîtR¿b>o>ÄÕÞ‰ÕÞº®‹At·zF¬¢xwleÝN¥£Í:ñ]¾Ê‘¥'Í”Oå´öú^„B–ý¶…Z ³Þ9¹9Ð÷E—þ }PrG@Óû—à EÒÒ3/’Š{J.²Í%L¿;�Ì:â ê­L‰±C‘f:•ÉÖvµ’úØÞ*þh¤<�[Œ›t\‡y½iïØkwŽ^¶ó/[¬.ÿ™E·{Ýf2kæó#¨CÓ×ò¤q…]à§ þ‹S¡DýôšÌè?'ÿ“ZuÄÉQ¡¯zü?f _�&èÝŽ6µ ÒÌUú{6}E½ìÓùÈ28ô|¼F�†zŸ`ÀÉ̃t 'óSË׿6¤“89€D  µ îu»Ò¶ËP±¾h{zú_nÏNí|²ñéÍéÑ�+ü!‚c}’›­AÚÈì|xnŸ#¦èÓ¶fV¡ÕšW2=—TË}2gé¨:ÀvDdý™5]@Ð’´�kOÌî–/˜oä~³;ª€ºp¥Gm\‡v�èÏ¡>-íŒ%@¿SP”kü}ïÄC8o)½ƒá VŒ'-jêó\X‡*,µ–^Ú)£Æ?¥,À¦Åyn΂}îa=ý«Êzçϟىȗïúï~€¦íºØ¶«Ût;'ϨgsAÝ(¾Þï7Z”ŽCHU¼ª‚[4}úplÝltÁ<Ãr{1‰t‡õ,zH}1Ü”^Å/eÉ_|L�p±à2óQ(õÑ E­‚¼À&;f‹‹EÌðE¦ã1’"!©¦sDŠÄÅεWíòÞu�‹oùÛo™¬¢¼ï“O½w7îÖq¶õÊóûÚ«vñã˸÷¿·²ºyÝ4qRÏY‡‰HÌ�`töäþ1ÅàwÜÒ?‘ *…È'”i.©�óA‡L£30%Ö‹å³÷5pâEأѣaþ@y–J/å+P×^ÑdÞÄ 8 ]®`ÙêÁÙÃÿU£tÒ¶Ëж+ÖÒ|j^m¾ùÈüôs¯qì:Ÿü•;üîÉÿùO1Žg×A(w³ÕÝyÚãç–�_Çì¶× £ÿ"-Ó|w�ÉT”ÁÅ©*Á¢ä.” YÈ·¦j„u=Q,´×ùy—*Bz~÷þŒëð­¹<Ü+f^],X]¦Þ@vzb§•c.‘èiÐ@!Œ*åÄ^A�@Â�8f@žcÐã ¤óÈI%%$å�1úÈÀ4³çKÈÍc#pU[÷Ä;Nªêu³ÍÍ×V�‰{;—u‹Ý–mË�=ªrÍ™õ±…Œ¥‹ƒØŽBvåÔŸÙ§îJí–•rÃõšÕÉmÛYdÒ—×ð¹Þ‡å{—žÆâŒ%Oÿ�.Ë2¦ëìmtA�¶ìsXä¡Hz~é|ˆE:F‰$€J&ó V³�ØJu4�ŒQ= rÓÛýî[Æt€qšõ Þ9üä îxlgqü‡WqñŸ[io)5â|¶%u5éŒÑ¬éôDÉÓ{ $ñQ».0LÔÏ>¸¶�Ì %�wÍQ)ÉsDì„£h�9í ø”A‚”�ÇN?$Íü>ãÌ$xKM‡¦µ¦¾Òa�Cpv‚ÎQe�ú×wj¨%H·lw¹\ì,«X]´Y}Ã5Ž^ÿ%Ójþ©½ù/}Çuê.gÒ5 íÇ€&ÓPÍÂ:"_¼ qMß…u°ªeq‹ÅP˜U/Üœ_´•' ÷j­Lú�ˆâƒI¯ ÊÏ<ÊÉ„¯ž�º@\e<®Ã¹FÀá>ÅÑø•¦£6k,€ÅSœð©G8µYO¨È{¯É‡vÝ9"È5=.qÍÞšz3Sñ&ƒÙÀ\ÿ¯¤�ààš› zŽ£º˜ÅÌYŽG®1n�«âB]_ŒÏmšf .W»·�‘§×³í¦U¯#iÙϽÌýŠôSvbhûc.ûpw~€ Óëélâæ�ŒþkæMM³Ö'…V^kŠh<áì�5´M|ü�=3ŠPpP(÷ÕQSØ÷Ä^ÎJ•„/¨è0ë)1v!ªP¡žÌEXíž<W«{oLC)Ï‘�»t\‡¤ÙÂÙ‹ÕÎ#"ºï®&M3m6bUM‚Äœº‰Â„_iú.w¬—õ„¬GÊÈ^Qù§\ºKÙ|y3[§ì¸álE-¾OÙÐÐá:sNÕ¾î³DHx<¢—@íQ˜I‰ Õë³™twüåË\ç´Þ*…vgƒC „* ²ÃîëÚºÂôóÛõiµ59úæ�ÉÖ§êÐìü›~–cu–áú {Žˆ‚¶Ñ±22�E¤³îM9‘P^*Ô Bµ/ð‚ÍþÓ*5ñú5÷Ú÷ÑÓñúÇ— !E!î¡7ƒTÕJõ66žCÏz I+ƒÑìjÆuh‹³v×#Y {æ°S÷™ã$ú,³hæÒûâMÕéò4Y®öùŸâWuË Ìy/~äa,1Ó”ñD¼Š®÷=Ꭽˆ|ùŽÏz÷Û±D躎mloÛ.wϨ«© j"‚Dç¤íÜíó0Œ‚˜´õ.D£€ô¥ôÌ'M¦ê”´D�+ “öf;¤O¤ðýóÛ˜V»P¼=_æü¢`;ë!ßÚ;ßNmÖ}¾ÓóÅR<à>¤ÿÍû¨ÄXOf»®pÝe×Þ§|ý¶¿wAUMåCïü=G]â¸þMë—Þö³õïßãÏT”Õƒ^|§ku]¼ÿrµz0À3'“šÓzëj’1C�°ñ„ý5Q|yB ¼¼J•›Nß�r‰pü¤§Ñ“¼1º‘—ýo‘zà¬]¥S:ËÐ_uÃy©åÆJ½R Q­×ê§ÑÖ6Ì:P†DWôÝ?».rÕ-ªØµ±ÆäSójû�§ÍÏ8ﺧ]ïÇgìþÛ ©8RNÑ q.’ðºÓ‚çÊBn2x겫ä 3û;˜ Ihè*O»ÃÝ·) 2¿²öéÊäbFõ©ÆÖÕÜn^Ge7æ¿0×Åq¦5JóJè.BU;³QŽ �@ÙL”´?7sßþFfž{†²ÍöñB™ºL8�ÎúÔÞ»ý–ÑR†€¦†ÙeXŠhÔ|0ª_p&vï]>n�«4ðËwþP�;ߨ|M]…uíÞ‰voÑÆ¶eÎÉBqýSïÒ~³DRÉ´t‘~.µr` ¨t*�P½ªÝn�á‹wÓî·f�ÁÞMÜ@’ŒFÖá ¨›g Xþq¾m¤~ØÓ�µt­‚Åe¢¬øûÿŒÙUTmCœ&!FaŒ‚i¦s†É\–±>£‹xh×É#–—ËMný´ F9À¸þÕõÔ·üg¤æÿAùÃáÁ/¸Ç±ØÉ=£ÄsZioË œÏ¶8©¦D�õÊÓ)=ý1$kÝ/Å óàäA® püffã]¸Öžð­¾X¹màZÓÞÛøš®:÷Ô#­Ôé08iü1“ ›°€´»ÙŽ3Æ^2�³]0Õ£´tEÍ6?@o¿Z.±Z.—u˜~e{rôÜkn]ë¥ÓzòÏÿ®æ¿çc} ÊÝ̨�€2bš˜ÒÛW¹¥´2ÓǤ�¿{òd§žhpo¶â4À¡ààb²hã{ó0L¿’ûà{?&Ð¥&~y�^ïw<®C»FÀa>U3,.2< îX03̵ˆ%v¬þèÎAדä°p$[^åE[—½é½ï ÞbVÈÕsÐÀXKÖ± s…“íŒ pæ©©™!Ò�÷ÆU}UÕäbJ|cÝ0 Ä­¶]ý@œVABM" 2:dI<^ï�óQXúzæ­÷§‚¿ÖÉB]Ȭ߇ËBÉ%@Á‚¥ (‹´„ÒeXrúÌ!o[”ü˜¸ VYgÓÀ<•CÎ'0Í$á\‘”å/®ÈWƒ@5Zr^¡0F ‚Ô“©@PµíîÕb×Þ·©0äy"rá¸KÇuEëqo>¿uï?9XÓ+È…?;yÄ ËïžmÎêÙt3ÖaÚÓŠHô¬yåÜ仉Ba1E>5‡D©õ@ñ–b<ƒ:Š„ÅãôÏ{pSó4\d–ïqˆöÙÑåÄÚKÁ¢ÅYåXD™Í�TÉI |«ï©Ñz°d{sº7£O¸”ÕžïP…ŠŒäÞrGÚvjÔi޽tkºuÞædóSu¨vÿÝ?Ö0biüƒj÷{8,ªÅòþ‘(t€9çGeqtÀ˜îr€{b³r`„g ãFþ4¹‚Yl�£µì Z%LTÀ�¯ÒÜËcüã€qÎ#Ñòâ9À®1±@0cìÎÝY©ö9ƒ¥øLßG 8éÌU=ÒýH´óYÝ�\—ä,’׆¸®¼)•ÎF&  ]Œ*€«úzÿ“îØ‰ÈWnû{ïy;ÐMÛUìÚ[Å…“ €ºH s0€mTÏó3¿ ”Õ(dÏ 0é«X•Q@JÝËL�á3gæcÒîg§áG7„¸=ù°|#þÙ-â:¸Ï­š�œì£•Å値¾%X5i…Ul×oc{VxüÌg\0�Ò}ð§ÜgtØ×Úzî}^x šÿ‡¼äž×б½ÿjµ÷ ¢»õd2ãt²'Õ4M#¼Ý½ë· �c °è30èÊéo;¬ß¾ƒÃÄ�%5Ù\ú‡é&èL1hdIÎw¶Àe#®½Ž3=Ur®èÜqÔ?ˆëšPخҠ«‰¬{„]lÙ®VX­–¬Ñ|z^o¼åèä´s¯qäšÿ¥zÖ¿›û÷¸7þØ>-ã:58ˆÚC»ß¥EÙ•Vê`÷‡ãi·2•Ç]ñ„ÁÁ•éD­ŠeÁ—æ(v¼Æv:_ÓÕÒ¦gúÔ( `ï îŒàÕ!^ãÿp·ÿì ‡¶80Ú¡/’û)‘Ò‰Ìä›Z‡À§«* ÙÑ�[˜ Ô:ôw²$u*¶h5ÝZdd"›Š¦(!ºÚÆ�Z�÷¯Ù °'FC³¦rÉgªW5³ÙBÀ?Äåòx·ZÄÛ‚¯j…h¹¥Ô#‹´˜¡µÆ9Åi—Ÿ‹¢\À�èÛÿK${‰)‡€·»ôEt_®<62#)¤b`¯¡Êõ5“?ÐÈŽ)² þD ¸ˆ}n1àØ T(1ˆ�19U�z:£Lfh%\£#ÙE9;°¾ñíŸñöQ0®»þâñ�c\Ý3²;§ÃòL4ÂÍùV7 3‘. #Õ¢&QsÞ31Kä)¼DTÅÃ0–Ãú‚ì)Êh:–î¹BqÐ{C¼íŸé›Û@ð¦¥n�tt‘ž!McÞÁ�,š+‡šwa‡£xqŸƒZÓ9œ�Εö/ä²ÝâÝmƒ„¯nL6ßtµÓ®þòª©>ñ¿Òü‹ˆ<÷¾¯g%2‚”¡ÿ/Ûó�AmìïD(ZÌzÁIÿó]žKS§ðx¿µ,šÿ£$J~ªà…ÁÐÎ�rÈ2^uôr8½n×næÑpÆuh€�ŽˆTr˜|NuL)ȯOôÓsAÿ|­ÏÎ ‹tG•kD$E$z.u,@ïÁžý“Õ*\_f§1d02uxË�c%GôOBª½K%Üû_ÆC°Þý¤ûUóµÂkšº~Y3i.ŒíòÄjoÝjÅHBŠ— çe‘æWª§MûÓåñe#j¦ø ñÁ�nÚ–T0Ti^Þÿ½øŸêdéõôî]Ð5ë·µxè]ÿʰN¦BÁ‹rgÝÅl9ŒTˆ2F+½. ®q¸‚~„¦=v|"D ©ê u3Ôó°ˆÕéËVî#Ä/‘¼ù¸KÇu`¯X‘ Š<&ÆÕ9ËîÄ ê¦©gÓ-Ô¡¤R¬T¤k!~„„hw®äÞTë“sqOjH ×:hdf½õþÌâ7E/­+³GµéÛ¢¢i�R¤ô9.´þ•D-x}°šš¨˜YPé!°ÆX.‚Øé@cÊúùð 2v²Xî¢mÛP£ùÊÖìÈK7f›¯šMfÿ0�MOþÇ~Æ#à`4;” Œ~ ‚…ÙoöÚYó—²€²g×ø>JIíË‘¾ÙÃ@¼"Žš ÑË€Ä ¤¶˜ïóœ}Ý¿r0ga)| ´(7B‘•ËŒÂ8‚W‡x�€C]œ°JÞb0_/�)ŠÑ"2Wx Òχ'׬‡Ä3÷¹& ÑL2æt cÓéDAŸ�žýÔèÈWe1ø¼"É ] „ã¹xXÖG~åv­ˆ|évÏüÀÛжudÛÕêÖíª=­šÏ¥j&Dȉ—ô5_I'„Zý—ÛY·'ªO¾ ñeT¦="…YYL1œòÀô~ü®ÿQŠÃ’„r ²÷1,t)â"Á‹a •ô(\WAÙÉüÕÿ_ìñ Í„QBˆíâ‹Õò¾!t'nùô7Í"VøØ}ÀøPŽë”_ÏúÀÓpÆÑ«…w}ì-7ÜY^vïÈÕƒ‰xëºnâ´™³©¦ú,À3y’Vج>éÓáåínvÙôç á8H;8 ™}®Å.n·÷P¿æåº;»äÆBJâÀÚ/ÊR¥i]4c þâO4µÊ<øÇ P®BŸUxd/9iê…Ã}g�9r4€qÒ£°¦³çǪ“9�GÐTØ!b$dMGLf¶à¡K*)rRÄEÍ.ŽW5(/S,x5ç—¢D ÖËÚÙ Øé(’½Ê]Özb[!GsÔö._ÔŸÛšt¯©«Yµ{ùIì-vÏì7Âdš‚éÆEÝ­c�lÌE燕íö-^#ÇS8tÀv+×6™“ÝÈBÍ5=zöôùJæWË'VOfâ$³¤ÌdaûŸÿ@EEÙCóå‚e¹ s­pbÏ¦Ä QUÒ„‰t°·»ºF#rv-²L/½ã3ÿö ß}Óî½äǯ?ŽÜÆuÊ®Ï~ùás_Áõ—íî�ÅØþB‡ÕõC8¯7¥®&ƒD‰Iß“$lÐG×LB¡i|Ù*ÏGÜJöµ…5ɤrzòlSI°èæÃ¨oìÔt3’fº«_ß%ÕÁoàRh“5y f›O¬¥ŽRDÌÈP”S8ô_�½?ÚŸˆd>¿¤í–ãjQ£¹x³Þ:ÿØüŒWI�xÚÝþüø·âç=öPgQŒÙc7ËÓ¼…•ÐÀ¥~ e¬À  Ù#SasgDU\ˆ°·má«aƘ´Ü¾Â7x©Y7Yñg�]/Hâwº\˜a•Ó1Ùû:Û ÅBRÖ«ù_t©ÊpbØØ0f51P4ñH‚šüe�'@~û}êa*òA "¦…–˜¿)$H"Z"'óì?{&ª”¹?4J,F"ªI#ÍÆvhÙ[®ä¾"øÕã–{‹ÉýþâcããyHÖ9oúO®F¹tç_6.9ùÕ‡î-Oüܲ۹N!L›¹4õ}” û»)›|f0�ªÏO@´(±˜æõå¡ÂBXï�ø35XáýÔz…úve³7²fê Nyý‹¹Ñ«Î"-[½QDˆTékÇzVúŒëð¬÷>ñö­ˆ|éŽðþ·…e˜tm·êÚö–Ë�“§5s ê)•À’ubÏìoÍB$Syn>€ù¯<3ÓÑ—åW&ò«‹$2Ðß¿šÙ ø” ôÚpÞ~éËzÞ±ìóD¯=ZRª„ C @¨ Â�[Ê y‚d'¨‚Ta 2J\Êu—«å}È ¶‹ IDAT¸óùÏ©ª*¼SDÚq·^õ׳Ïzþ�¢b=â•÷¸vÛ¶X.$ã÷Vu#“fκš Ò{ðE‘�¼EopE2›Ø±ê�2q‹�ËÝ-br9Hï«kÐa‘Èg:/[rä}—^�szÓÝog„ŸžjÄ©Âþ÷¬}[¬Ò`ñ])ƒûã° ¡ëØÅ¶]…Ø®¤–æÓ³°ùÖíéÑ7œqäêÊ]žsâ[úC�2NQÐé³§s+ê£ì¼tSå´(zö¿ÿ¸M]lÛAd…”Ò;²ðÄtïÂýåÊj÷¡©èžRç.PZXø� ¹Ÿiñ¸F`\‡aeb|šÌÃŽ6¨J=ýúQ¾^Þ� †&yŽIŸÉEBÌ#ŠÒ�ir' k¶V‘¸t_Û 8¿lL4ì@ •ïxJΣzªšß™°Ù–ø–Ÿ¾ñx0â5Ýœ~¦]­^9ߨÀîîIY,vn#"Õ<„ÐïßCGvÍ&»ysªŸ+a*8F% */ȱ0Ë�"œ+�s‰û›¦xé æºÅ4³e¶ º¥‰A~€Oà%ÌãX+ ¨2 ´T>‘hÚqžòåNŸ ÷Ëõ 2»�Ù61c}½&@€ Í|ƒ+€Ë“íiìâOÆÅ*áÿ»Åo½í³}ê=–ãNש°~â?HY.—÷ð‰QºïFUq>ÝfSO "Ù]ÖæzïüÐ1‘u|:¹³ÛI¾=yXŸíHµ¯éoåhOfï)˜¥»DÙJ³Ö¥B #œÁ,ÄÐ>™Ü¿?'äÀÞ<[0Á‘]ØùäËZ†ŒÜÓ8þ…ÿJ Hc`#@BˆÒµ‹¥¬–{«‰„olN¶Þ|lóê¯Â'¾åÍ¿ˆÄˆQ/x`úÿÞrº·ÖL¾ Ûäo"C3Á€¼¯¥jÁE÷ k± ï‹Ë"ý*=ZtA<68Ëb�@E0õ]ë¬ßže ¸JeEâÉVùÉvƒ3ŽýÿŒëPˆYS$Ð.zUËÓSæ 5Mp:Û´Pápá䤊Úù&&Vaþ«Á&ÅñÛS!ézxì®ZÌCün…ä›JPb?gìsÉb�|×hë{Ø×;{+Þá™ïýÁ×Tu³×PÂro÷–ÃÑÉVÓUUÈÆÕƒTlq4wgÅ~åc,3¾ò3æÀ!u"ÍfÀÍÚrtXúðàO…) 2ö•�ú�+¦Œ•'‹X”‡Ö–¼“‡ˆf¨b"¿ñ\õdG!Z†ª‘z2ÂrçøÑ®]Þk6 •H|®ˆ|xÜ©ã:EÖ€G.V{�ˆÒ^¯žLëéd3Öͤ§òÇN/6f‚»÷ÉqÍ-Tìo'D‚óƒjmt`¿“_ Æw£!çùö¡»fËã]{i â$ R[]˜•XFúßN'•ª$I!ú~0uxˆ×)Y'å¬}a”ý‰ŒX-vB·ZÖ©¾tdrìõóÉæëf“ù߇P}Ë~þ�ã Ø ã:åVzlrŽ…yñ÷Öû6"·\µÎ˳öd•ŸdÐÞŒ}Žåï6Õñ¡ˆÝ´ÂT=ú—c†R_o´p°tãëüÁg1ÏYfcŒ€qâÑ«…¸™IÃEÁ5ä`?#/Ø¢ˆ�ÜôÍÑ»›ºqsü")�Ɔö>H0`@ìTöokï6‹}ÜŠ!ޱ\�Éãã‘÷ÿʵ"ò¥Û<ã]o£ iWÝ’loÕ®v� fBpÌÔì‡IÕ©8{‰¬„wNC…ÆU̇ß3ë×lˆmÿû­¯¦\Ö­c_ « Ê˜S<0¦0œANí��Š÷yôþVü©3îʬ»‰ÓÐ0ÆNj©§3éºq%×íºÕYB|ãV¿õæZÈýý¯�5êÇõ[?õ¢»^«‹Ýý–ÝâA‚x›ºnÂl²'Í4]²Ñø>î¡ÕA¼‹îòb^wæñ%â¸[Žzõ�)gŒ;SyúQ òîQ–ul]yÍ,óD&†BbŸ�–g“F ¬Ôé rÀÈNº¸@·Ú«™~i£Þ~ÇÖìèŽÎ�^øÔ»?ïÒoÇÏþ9?úZþÖßþÜØD@Y’)ú¯©]ÚžoÊ‹±(*™L°�–¦³qzÊð r_ñ§ô©~¬£å…$ «; <eæ…0pP,2CEŒÃ®ס\t¾~½ï |Ðê|=߬ßÐâÈ2¿É9¨êôC Îz$'~ðPƯªfšîÎ^°4E¥OÈH*á4[®›Q#£ôÿìQÑqÙª°ølšWmlmÇe»�ÕjçöaCê 2u>Å`!¦Ñ�«^�õ)”[cA˜ž £ýœì-. s î/è Ïé9úŠæ_`íul0‰<Ý v$%ÍG·<ì£9 Ä8•És¼àãÀarE…oÖ‚Œ”Ø BÅÉ|CºJ„‹ã§“ñá1Ê À¥·zú[?ÿ÷¿z¯Q0®+u=ð¯ï Õ‘–‹{Ý91´7®ë&lζeRÏ Ä®5�|¢»äI½Á„ÚÂÚãRô^8øš=j;@³ôí³å�xHQ4z6Ä·¾šê`&ffæpqz¡Ì`F‰ÿ€å~b�©§%Ó ­ŸhêäÕ}¢…61¡´q�®ÝkkÖoMN{ûi›×x5D>ôÔ»?ï’oïý0JHÁ›È+ý…ZT¯}ð¢Ôr—­UhR¬Ñ‰N™,€4þJÙþîâg2¿NŒ›LÐÙ¤@íé@ ¹oöïÎ�ƒŽàhلת„ÂLK<Ö˜m3Ç5ã:Œýï¹ë Äœ5jY'–¦GUÍ«š0_ä¾ñç™�DÍ8³–™á .Î ü'À =h2(Žžš¤ "1AH.ÙŠHHÈ˜ŽæÌÙJå*ì^2ã²õÁÿë¼Íï¾ïkŒñ “@Ö1n.{ß¿jÛí0™±©HÈqvâGWio;cOD.w긮ÌÁ\„ïØ=|…�ïžon4óÉVœÈ,ùáGR/êk…‘QµÂõÖÂÃÞ3 cïæùe >µOûX£f8åà^¤í=P�Æ€v<Å3T?fû2Çr= ’–Á»“8J6-òA1X¹PÎ+� A(‘«v)]»Aê¯nÏÎ8o£Ùzý¤ž} „úø·'pLÓ:@EoŽÙÉ‘Ue´­ø�:k •È0W͆»õ·ô0E^)Þ� {‰÷î3µmŽÉ…üzz ·{`©sª+€ó1í­xóB†lå1Vº#0®C»ºÂñWÿ¿�5çcÆQö­‡sæ_šˆJ”•e츆.;µ¬ìr×rHÌx�pà|[]ãbí=–›Z¥$»š¬¨êâè/>®ÁúÈ“ïØ‰ÈE·ÖûÞÖ®Úy\-ªm ãÞ<ˆH¨k£¦"@û (¸xîÑ£y îo<Ä¢ñðŠ«Ó è á�çê4HB orðÚÞ D,×À¸?ƒó!»¦6§ÿÚÙ¦ž\{v]E“û¢ø¸ š�"Œ”ªbUmHì"ºåîõºØÞ7€Çoõ;ož´¡ýÐÇŸt¿Qp@×cÏ{žw¿—ˆ‰ÔC_zßkE¶gíµ—ÿ”„xæl²QÏšM6a FAdFR~Féé�ØÔäÙÐßtøÜŠ(O‰‚åë®A÷±k€�¢�ÎNt¿!ÄA‘yPú�Èšý¿~9ÍØZv�éR›¿�Í{zÛ³Ž»nÚvÉZª‹¦Õæ;7§G_wdãôþÆ]ÿèâ+c/ÄÑààôþ>/W¢Èˆ•HÉnóω_P¤XsŸ$,÷4˜ç•|U_Ú’*®“µÐ oø¯Od¦! ü„Ì�‡ú€Ú8@‡}�}éã:dkD.óÊ©»Œ*1²Ù2p ÏW¹–¦™„ã)›^¯q_Ö8ÏaˆF�Ãè„°pszLV-ÆÌ©úgÙµL‡IÙM%Èžl ¡Œ­”´‚ãF =—ò¬¿þâx«�km}à—ïøÏ"xÅd:}sðϲ\îµË»¶MDx:»}Cæírwãtè­¬~ÔI£ !Œ—£ˆ èÓ–‚ÈÓ‹¥ŒãŒ¨µbr7ˆH€�ì$Æ(D�z¶Åjº…ŽÕÕ#呱“GÕí䯷}ÆßŒt„æÿ1/}@øO/{ÀiÛ‰lO´·«k„íéild†nÅе�H$�’N4½æÿgïM£l˪2Ñù­½O÷Þ$­zâPŸ"�tŠˆ4IR”ŠÒ©¨ˆ¯DZñÙ7…Ê£µe�gÕ–Z bC’I“( ˆô½”MáSQÑ„„lî�ˆsÎÞë{?öšÍÚØ™{93ï�8çĽ{­5ç7¿FJü¸¸št›*‰â�çQ_ËŽlF öD|´©$žÌ@ï÷ït,�6–ô0ñûW/Ô[*&½Æh�Äù#éúÆÖ†®3Ô«ÛÓ„ƒéiù¢Á Yº¼Á¶[÷‰rÕªÝýƒ‹W7{I#ù­×Wó_Îá t<95/M w“·Ï¾C´S6a¬í³÷¥ÊžÞó�g'ávË@�öI�´WÚõ,Rº^Ó�vk…c@�ˆ¨ŠÚ`ð[ªùÂb–ád˜ÖLëT‡ñ²Ž…áäs!jŸ@Ï=3¢“&þæ‚'äèMâ†àU_Bc×$$gérâàKD#H© åHÓ/„ÊÏ#åG¨ËZ�A¸ IÛµæMë´¯{üÌ;q´†À‡RJ¿ÚÎf/\,çïËÝú`s°ŸúmWàÍð,i½Aíq-ÚÇ *ÄšaËèòñÜ48VçbµC),4KS3 Í¾ÑþKÿìØ? � c~Ç(2EëÜõ5Kå4AÉ~o°PŽ]Cü¼Q4€Péð"GRED’QƒÃ ÿ‰œÈ.¡šåíroÖåöÛ-/ñ=”üEÓS{2Ö¿îÉ'd¥ä�L~Ø?iÛ]s»Y›–Ëù.äÌ¡ïP$ ÝB.X[a.–�Æ!œãwzgxb`Ñ”l0/=ʈrèTh¬|CÓL7Õ-0Dp+Z‘@Mbm¿§~9U¢ô’.Ê�à�V.qmþ]04x®;'¯dséZİÉÚS„$Š@rî¸Ý€Û-–2ÿȹÅůÞ�ï½dÞÎß0¯¹^‹hN€“ÑûÄN!3|/¡QiÀèãsj©Y6R´ËDaúc±ÀA3Z�ÍÊï’Ñ]@+_¥•P‚D'–2‡fjçOÇÿÜ LÅÌÜÐ�±$üxÓ:�k’œâE‘&à“:‘03xýQ¼OÄÏ,7Ó‡Œ#SkR}1>úDb”=ÂèdšÇTª…J÷G3ªƒ„ÝO™ãé�ùLž8`™ÉIiˆêd¢FMKDDÞü”;yÞù÷ÜŠÈ_Üå¹o{%ºm;ÏÝ×tÛî‹úƒ {íÎÓl>\Óª|—‡¥¼QÐM}Ê—Á¿ŸŽ‡Ñ£8U5ÌÀÿ“ð*{Zê¯ ~cþÛ/¨1ŒÀ:™˜!óØe;êcP9F%€Ôµã²øÏŒÁ€ÒK.VN�4›}�¼Åm6]ÿ ¼öN?ñ;óùoË÷>`šÌ݈×3ïó³'ê”}Ìo>ðÖëþðA¹ë‘ÙݹifXÌvd––ä–s¹ÍèÜ(.15S´mK9†‹[§á¸Èøkdì—oߘ¥ÞÆõ)dð|ûUÆæf3Rg{šŽÈBOÄÇôê(�J` d5hÿ$a²>M9Óð>ID�ÀÌŽÛíºé¶k.Òâý«Ùîî-Î\±š¯Þò÷ý¥�\ßÏENÍdx" Þ,B&KÆS³½¯N•Ç.=! æúeü@G©ª‡j1Xf¸†ÀÍAjú¾Œ ³ Á¸[l—3ˆô"Å †¬6Ôð?9øOÀLë´žˆ­@’S‘|Ô_(º€³ êéA¿ZÄgµ3²ƒÏÈ1xÐA×£G+PUFØG|ô}é�~)´FÚHŽ\Ñ¿’1k,QU‡Lô‰„:’M�Ç´þÑõÝüݪ鮛ï¬äðü>îÀ;ÒHJM‹lÏ7LÈn(Eµ2¤%wß„‰~ƒ[¾oV5»Êµ¤¡ÅŒ»�§¹v–�àÇ^‡“llÉ`eóGK†�È÷É�ƒX � zèAažCæŸD†;Š¡úQÕ·ÉÀ@ØåA–”’4ó¥ô¶ÛÃÏ@ê+Yöö÷yÍýЕõÇ?ñ õô¤Në“Y�þ�û&çú~óÕ™ù)›|øy@J«ÅY¶Í|À1RLÄÕÆKBªEÕÕ/sø43Omåu¹¥&ݳS }±Ý‚Ð T(´k1<,wÔÞ¬ìÂ�7:#È`÷f¢ÅˆHÂ!ÛC’9”9¦,ØU¸L$uÍ»~ƒ®ßnÐ¥«‹Ýß=·{‹—@äí"ëknˆçƒ“gЉX96"Ò(~ÀÊÌzO‚è &Ù¯%ˆ5«Lœ:·ƒš–AÃç%ìsõϵ(4Ô°€‡ûÕ:?ñL qcÿ_õñ@=ffÉ9#‹L€S¾& À)^p*±”¡šX4Páñ2j*SÑ™õ¨fØìÃBH ÍÀØtÁÃuNó‡Ûø gl.zi{qeØ¿yŠŸš®*,pÆs*Ç }J%8a8V3™sn2µÿÓú'×ß~ÿ¹h›5)ýÆ|Þþêj5W¿9<¿Þßoú¾:óá‘£1 kaÀVd ¤5!È*‹¥æìÕÒ_è\´1Áì»ö²‘ f@§)Å� �$l¾eF³>GÀ¨N!‚þ™.¬Dl’LÅcgͨ¼tK�ž@ä,’3…™içK¶ËݶÃüæë—æÌ@ÂOOé´>éÆ�ÝNŸ»ÇtyýÄõöÂíÚv¶X­öض¥ùÏ”\¤<ˆ‚¹r9ƬŽèqc–¶MèæÞ”ŒÒ¨MˆI“5Z£8dÐX7N8V‰°Aó©4ØU"©&X$�Í9é¥Ðý¨µ‚燄)ã€ñ[Ð!Ý©¼Ø% þ¡dóQ�€%›Y¶j� Ð$0A¸é¸íS#͇.ZÝü%{‹³—ÍÛå;V‹³×þÄ}_tƒ\Ûàd,»V$šnT^.Œq�„ � /�ÙSê¯:ý¿Ú9ê‰÷¹PþTùYE?L÷Ù}ÎèØ£rµޤ!GÜL¸ã\ ¦R÷¯‰pÊÏD¿ä}®` T~§59×<ÿbŽÙ±lF vÑ8°ŒEޤ Äs»~SgW9ÀÜ]Í2kÐVQÞ‘Øùd2æ¼nHOÓî$ecv„Êà;²4ƒïg®:ŒòÄY°.Bm€ mUN¨€­¯2<�²t…Ü4Jÿ+¦¤ Q;Y½¥*Œ:¹é·Ý&m6ë,}sÕÎüìë.Þ½ÅKÒÛoèæ_D$ËÄ8Õ.Có §™€±â-&yº Td:ÈP¨Íöl6/Í­Tç�á:5nkmA� ¨Qñ[¶Ã€Ub €~PèU\,8 úéÂáT€ézMkÃÛ3§u ×$8ÕËXvj*šÊ� Ø~M#G‰ ©† z¸&c5Y:°Õ ¸ú%GO"Mó«Æ%œŠì±Á>Ù#�Ì ¥qTåàT}A>d&¹:3Ñ¢¦õ/[¯ýž»mó‘Ô¦—Ígó­æ‹7o.\³Þ?æœ=å©Z¹¢µà¥“V"F|~ý—§Ú<¡2Bz˜êõS™Z�R�J~±ˆ‚!4žx´XØ{îðoâº÷±k ³;” 2U¤ú5Ä(ɦˆÊà 8bA&È¢�Í¥Ý9Ó¬s{ñz“¿ZD¾;÷ò…ÓSzìï}Í“Nb�¹#àc6ÛüÝû›óŸŸ,—ó›f6ôå™ÅÛßä3*ÊAB±°M3žT„x¿! À:ýrã‚s�|çöA,âÃF�ÎÔƒ_•Fû…~=Lq"AõB/ñ …ÝoZ; ð½˜-À°+-‚,¡Ì“3ǦgœÚë6;‚šøÄ’‚P’Ð @"sÆvsÐngÈí‡Ï-n~ÅÞâìo.ÚÅ›íâÚG5)OF¹ˆò÷¤Ô‚ÚBy\R/*¸3eZãÉÅ»±ßg……•Œ-•õˆ¸a(H<ó{u°'6˜‹ãŒê£�`aPq3 p ›ÿ­åüÁœò51Nù‰è�=k5_¤ :ͨ¸üUÎFˆßï>äþõU[ODuT0‹ÝÛ/‚žõ4ŒNeõ$·�d¢c µR5e¤Å"œO°Ø´þë­O¿W/"¸ÇsÞøû)mš®ï�sw—~»¾¸�µ"©!ýA«‹ãX5ñŠ€Í!›^Ãë60¤ þ ¨mþ£³vôãÇÚ«‹5çrGT¬]ß|áØÀXÖS¿PøÑÕ ö1œ*9þ •Ã'ü0)¬ ¡d �Í|)]Ç”ût›ŽÛK¥Ï×ÞõY¯l‰î=ïø¾¯™ä×ãzÎý~îD5Hßü‡ߺãöAýþ#2ÖwM-›y»À¬™—¡ýOÅ;ÏêþÊqSGãð.¡zžT¹;”ȰDrTâõ•5ž¶QOýʼnÚö?°•+8`ôÖAH„€cJ ÏÚuÉq–cª÷HB(@/d–¾ß¦®ßp&‹.Û3o<»¼èŠs;çÞö£_ù_>z£y`ˆé<9å. ý.'õº/ÜP¡ †ERKtÀ®Ò.Ž©«þ·¾ ‹ùOôÔ§(²06 Ù=¨‹ìPÀ©°F÷†’šð çú‡Éð4¯©Õ™NÅP˜ŒÎ« x?Ù)xK¢A=s,_‘u¢šm:VPe†W³oÛwõ›õö]öÅ{˜ÞŸû4�šaé#6‰Ný®Ãnô0`³ Žcq�HVcÒËÖ¬ì»àX23Ì=°ö=ŽŸÃÄÉjŽâÞ�ºçÁ‘k6#V ¿’If’HIf;;l–{í–íg÷L�Ê�’~~Û»ýäïΦ§ôÓ¿¾ÿ÷ž<yüå�>uÆc^xizì |nËõ};nŸ¶•ó_Ö7ûÍj¾â¢Yˆ !3ÀlþìùEæZÿz’u¤HÎ&/¦…ïÎz¡¸òÃH:Ì"’áÎ=Þœ#™õÆ­ ÃRE¥H?k6b�ÿºË9ÈÿýmIÿ‚hØAåÿD WB]Jíp³�œê=澓¾ë:pþѽÅÅo¸å™[_1k–o½Q5ÿßßTGŸ�J×fø*xŸ9U$yqKÍ+ÃôA¼ëª#¨Åˆ–…Ó�‚@; ìÚ³d` ”/`Ÿ{0¹¶;Øaõš×3|6¥¸úÐ�ŠÓ ÜÁI¿rŠ×Ä8Õ'¢ùs %H,‡¯”5y¨ü•>/Q¸'ÑõG‚„ßBQeIJO,@¬8…�CMBðY@jÀ›þ�;IÏ-³4÷r°Àzn–Cfƒ¨Jb=a¢Óú$ÖëŸqÞã¹oú(ÉW`Û5 äfý¶ûüLœI­Hã$í¡¼/¶ÍcÂz3ð÷ßq·Kß1&¯‡}EbKT�¿ëÿk@ÑÐ(1ØŽ‹‹Dç,Xú7ŒìàÚà>`’aÄZGqDb„@¸:,J�ÆCvÃQºˆù,‘"’û,)2›“²7ë·ûŸ%Ü>hÖHCðEä½Ó“úé]ϺïÏnDDþqHZK IDATÛÃ~í¤™+yô–‡�Úçµ·m—y±œíä–0¹½„$8!¥éaU})÷ɪk6Q}éõÃvqμíDøÞ¢Biš` ›±F–°©I|Ǫ̈�އ ÚL“Š h\‰ãV_*/&ÕKÔ7`ù¸¬²cš�E’k^°ž: ‘Ü÷�äÜ·³´ø‡½ùE¯YÍv.Ÿ·‹7%4Wßèʨ4›*†°,L&n1w°ŒÄ•0¯7ãÛDȯ†T–µËE ³ (aü¨óU`P޾`ÐÕš�hø ìð˸²´�l�ô´,@«¬3ÒLÀ´Né�hdM<´â;öÛ´*œ&‡Dƒ.¸>ÍŽL1òÿ7V?ŽCÆ_“TÁXÒÕ«ØUké…GÞ•ï‰3®“5GÞ‰ôÛI5­On½ù÷ìEäïþÏõkSJ{]î�Nî ä<µ­ i(�%3ÌÄQÓæY•-Çì(' úDÐçoTs@€uªF=TéÞâ\˜® &y×NžÕ–Çhc÷/ŽÆúö”šÇˆ€0:B‘ãŸ'ê„ÁG)I¢´ ’Òäþð¶®/m$_wçg½bÖ³Ï{~`’LK䱿þÐÏìÙ]²éöÑa}—f!íb±›çi%’ɹ"̃Þ* •jPÔA¬z¾+-Ü]ÜømÑ£SXð;�çDzŒò?ha¸8N2ø6#×}kŒ ³ÏqÇû ^ëHv¹Aµ1y}çÂ,C šsFî{ieöáE»zë™ÅE—ŸYœ{ãßç¾±=7ßõò‡NµÂ‰Y¸µ7ì*™h¹8¥Í¼ªëœÔ7t€¬-YSC¦«Õ}.#ˆ�:;`”Ô£T‚±yÆN×GN/ŸÍ>ËY|{å¯é/ÿt#}qþ*øæpš7mΡ�#žÃBN -3ÐÀö1ÖNðRÓ¡¬}„Î=ð܈ˆ|Ș& ÷ŒÄí(HR¹9›—ZôÌD“Ø,–½ÌV͆ígwÄ£rN�ldþïîþìWOr€S¼¾å…Mßú¢‡]”swß>oŸ²æ…»åf3Û[žã"íQ8“¾¸M(ïÝ ¸ù!ceõÿÅ _@Á8ÐíÄ^>‡­O�ÞE-ð�‡3Ü�¬¼8#qN uϽ”µ\ZÆ~Ç~œJ4À�‹6Ü¡ÿ>üOÀ\yŒØÈ¢ÌÄ”9géûœ…éšE³zÛî|÷e}Þüá�±ùùù‡¼Œij¢NFûO£ÔÐ)¨N”mÝ!žG ½dÄc0C—ŽA" Ò¡¿]a7bìÉËþU§>Ÿú3Q#¯BY 7||°dí¥Y•ÊõŸAИUé´Níš§P]î`kÔÐä¹eÆAÕ Ã¡º�SŽlN® x«{ ™Ï¹‘zM„5:H‰aÊ•ÃXÉ *)+(†å¦ÒMÑMŠ‚¬é3õ7Q ‚¦i.t)OƾÓú­œóÿðß‘äj‘üèn»ùœ”ó²�͘š6¸‡0-©¬ˆ¨±ð°$ŽPÌC²°vó²¢{mÄL¾ ÖÁÞ6e¬}ÁXf%þ‰¢�.òÚÅ�EƒI!,éÜÿš Ìfr©t< ©Pþ…*aD˜�À ¹áhés/Mд’ÚÕlÛá³s¿½dÕ 3ó/‹ÈOOéií d‡ÂÇdnµî¯þܦåb>ßeÃEqÕ¶¹z¢@Æ!yTµ©Ç�s>{(Ü“öÎ |7£[¢ˆŠ]šgBeɶ1£W†�¬†BV±��#Ý#)`NͧŽB´Ú(x`AfÃa�4ú,Ü·úSúy`A Ù]L öI‚ì¥ï{‘Ü7-Ú�/g»o™5‹ßlSû{™›�ݨ!ä‰F}V¿Ô<¿C™ó.å© ôÔÈÓgôᄚë zi•„ìÀW{¸ý´ÇijòŸy„ ‘è*Á8¤œê—뜛JJäÞ•ÆÀ’L¦5Ó:͸¨nÕ&¦A›…Ò»z£&²¢9­*ó1¬€ZÙCD2ƒøÀÏ>0d°DvPþ"¸3ø ÀÑ\Fs–RõdowHA®"V¦5­Oj½ï™ØŠÈÿúÂg¾ö !g‰r)ûîö]Ÿ÷Ú… 5m©¨ñ¯"*÷ßÑ�Ÿ°§‘À  ê�áNÜA˜nÓ…xHˆš{Eâsý2SFV¾Öæ×Nâј�.2J£˜r W÷êÊÛ˜\�Ž>GŸ™B$Hš-„�6÷¸Ý¦Û<¹ëîø£—¿”IÞñG?ú°IpŠÖã/Ô¿Ýlö°Ù|CŸ7wM Ò|¾’¶YÌXkõ‰ê1‹�`´Õ.1,ÒåÉÈÿ¥‰ò¨¥k£h�:­ƒt1¢C¸wE+O‰jcø§Ý]üvB (âÕþ}3Ç:´½U–̾ߦ~»•y3ûТ�¿uÙ./Ÿ¥åëŸwÉÿøû=À;1iOÈRŒØmþ¨ö:¬`ó¸cq$ÌÊ.ÏZYócÞ*`æ æ¯¥Ž¨jêúóR"í?úƒÆ·wQ\Íâ« õ vj–œ‰.K3=0­ÓÙü[y_A¥ƒ—ÐŽ[eñ�µn)�£S1Çé{G˜ý°ì§?iÉQ‘¢õh =ÌY´ÑWÜe€”!Ýœ­�3!9Cúž‹ùŒ‰0:­OíúÓ«¯ûÓ;Ýüf×6 ÝááëÍö=e…¥ ÍfŠaºÙ;ú,€Az\oEPIÀaoE”CPÁpÁ=F•Â�Õöt"�ûÿg Š3a9rꕱŒí•µ˜KGýÌÊ$*�c¨;�ZñæKÊ~²\Èž€äLš†M³`ÞÈ|sÐß¶aÿ¸FÒÍÐóš/ý‘ËÿêÝÿéa›éI½i¯oÿ­G5n±Ù< g÷´m^ß.K×,çgØ6s�4’3‹{%ÉI¹h1Æ2†m„‹m”Pš=@•ÇW7øôæ�j·Þ žýAÀŒã26az¼²ã3‚<ÀBÎÇ·¿Alˆ|;“Юå42¡d3$´ën“â|+37¦úžy+}ßõìåºY»|óîòÜeBüN¿?ûÈIxž2&µàÉhÿ• ?\eÞkŸÝ>_êFÞn+/g‹%¨>Èt¿ÀPÚ"Ø ¸.°Ol³Çi¼Æ·±=)Õ8͈B¨�t‚†š£DýÉÁ¦˜‘Òô“n¦uZ2{” ÍÑ*Ç5º.EÈl�ƒòµïPž“Ÿr֓苆ê'ÊÚÍ…©àjîqàQjÆ 9òÓXBŠ £áÜÉâ 6­�h†ã¬ ‰C¿@æŒÕÀ ˜Ö´>Uëž/xÞô´»p÷oþà¶ë_eëMO» EDþði÷èDä/¿ìÙ¯¿�sÿ�®ÛÞ~{°¿;[®DR+‰®ž-·7ÂU�PúÛ¿b¬€ÛmDþò¨Óíó⪲8¤âã8f0&æ â�“üMéqƒ�¿8œLƉ?\AÍ0ñ0W%šÖH-ƺSj�fIrdÊ¿Ývû—ÌÚæÃw}Ö«e†Å»Þô}÷žä7Áõ]þÈ[­»Ãû¬/<|›×wÊè°hWlÛE’™Í»³� cŽAÌ‚{Gˆï´žù˜l§ÖAb2^'xëá B`Ì é8á:”`k.v0Œ®PH-~÷#al¡Pu>è¾sŽh’�„YÈ>o�» ’Ì®š5;ïX-÷.[Ìwþðy÷ûåž”çéIW>=§:úD´ÿe×¹™nØiÆU\ŽáTÔ~ÊIýq°U1k¢}Α:׺]P쨤¼î™7Î0ßwÖgÉEÅ�þÂXP¤\Ùéɘ€i�ZÀðÄÐdçáªÏF¦u~Õ€c¿À8¼˜º€:»ß·›�1Ö1Ba‚ÀG�¥¶Þ)ù{‘æ’L÷Q¢ P`A”ºLc²¦½p;›Åi}z×rgõ§ûç÷¯�Ïç̇k¬÷oȪ™¯ i.u1V—}y~Mz›çë6Ž 1C>Ò, Ý*Ïq:z^� u]ƒèÂå�æ oYhE†¥qèô¡! ²ÒÜ—¼Ò1G¢ 2ûOÓë'œ1rà¡ížÉs› ƒH�f±dGrÓmÎ%‘oÜvy¾•ó×|ÉO^þ×ôƒ“ল¾î×î—úœÏìo.|%Àïêes‡Œ-æ³¥ÌÚ…$´‰¹8ÛúǤu:Æz”áÑÊ¡á]¤^„à 7_—î@ö0:B|€ � 4•i\ºZÄfaé‡M¦üfk˜ÆQ~Òh)¨Ÿ‚•Û¯˜ �þ»ç04 á/?mñ �È9ï§¾;ÌÂtí²Ý{çîâÜËxõ î÷Ë>IÏU�d&½àÉ(v5¥‚ÃŒQ€ŽËWè3-�#oлa[h¨7ÿpÃMT¾Xê¤t³1u;÷�«Êd'^½¨/îò ^ö2–HŠ•¤z—i�Æ5™—œjHT¬%CƒáhÉPr1=¤/A˜†Ž¹`ªˆ˜fé­Ë‰d¯ Óã£Ñ "*FçÁÊ÷XÓ�]»EË#²ŒWÕa ‡$-e æ©‚2ø) ¬2û/`B–ÌÌÌùrz4¦õé]¯ÿî»æ¶i>˜RzQÛ4¿>o›ÿos¸pxpÌ]É´ƒFæ ]„×î»·Rn_ Hå4D‹YØb^XåG–�C©ÃJ_VŠ1ò°½P`Â2Q)©Â%-°š%ªJ‡F2Š–å¡»â°+u² ë0ì#J@ùüˆ�Ñĵ —ú¨Þèɤôs¢�/ÐìœkûöVû‡Ý¥YòÓ!ÍMOéMj­š”ua{Ýw]Ø~ü 3¶»³ÙBæí›B‡wbÉàÔ…$@Š~²Þ&�YõÄbÿ°ºLý‚TV�òŒ5WP=sÊ­”Ô[?�…ú: †âÐßr~¾÷Ý1±×rÂX9ÂÍвÔÈ…Å{zF/Ńy5 ÑD1¬×‚‚D]ÉÃ6ÏúÚYˆ®?h¶›Ã9}üìüâ7®f»/jSûŠÚ«N\KÉ’§u£ˆ4ä>KÉÖ‹æñQ<�ÙïæðûNc³0ÚÔË\z:TÈ@ßÓ,TÕàà¡7zøÇ$qp\Ó³b¬�;‹Ê¶¯õB8%AÂLÀ´N5Pêu¨¥‰š¤�m…iÿm¿H™•ø”êDõºÜp€HÁ¨•×oÑ1aE2”˜áZ“£«´Â4¦,cë1œã6!þ­ÛŸŒi}ú×[¾÷Ë·oÿþ¯ü‹¶m¯œµÍo&É̼=ßu‡ÂÜ•1u,„}Ëj'šŒ��콎ñ¯˜¿VãGç@Tdàâ÷ƒ5ªm…à¬ÁøÞ�p>hu`xNg<JŸ¾Ú UZ�á䊒ÍÊIIj3Áh£$Bf‘œ‘�d¶Xó�¶oæ·ÝætiÎø†;ÿÔ+îzçg¿|rI>áë‘¿ü€[§ž_ßu‡�Øöwëe»—š†É*›¤~vKku=ÂSïxÄ Ô„‹Ñ†Ã:x©7…–á"c.å»ËGÍ#SÖÛf´ýÂV¶d±È§ÊTGCõsÄÿ{ ¢:‘P»õBáA )}Þ¦m€$íµ‹´÷ÞÕlï²3Ë3¯{Á%¿ö�ç_ò«�¾èóÞóä!Nþ¹K_J`RŸŒö(õJë 3¥ ÿcl–}ëŽ-xjý¼ʨî*Ä¢Tè¾™gWW_,g%\¡��{ŠƒÀû6/H2=¶Óš$§ûDtÊ¡Ñò5@‰É �\4ÏPŒ @R8'%&š3$yÝ °¤"Ë#ê)TÁÑV$Áü‡­ÍF‰Ç@Ê“T¾c©î’ MÚœ—ôÀÿþ—ùww» �Ö§}íìžù³ë®ýøu«Å]}çg^ù7ïüáMr€¶ý⇤”š3›Ã _•Ù=µ—õç 8[4{2oV’ЀÒª™�]/Ü;;€ÓµÙ·Ïö´¨¯£þŠPn»ÊP§XxV^š‘¤ÿàFà�}ÈòS÷ÿ“¹ÄÖC� kŸSE#ˆ‹Y;÷ˆfŒ× …�ÌåGÐgtëª_™ôì¤Ï›Yίڽ÷îÎ.z•^õ¬ûýÒÍÿ÷ÜñgOÎÝ›& À‰(w ×,à*tõ�\¸Ý, ×Ö'>‹IÓÊŸï/ØÅßÉq· Ö"ðS! w@Ì‹`'�}|²”HÇ1z‡˜è«JºÂpJ°8ÕkbœöE#Þ"˜ûR9�Dä3‰ˆƒ Ç3F³Ûv"¶—H`%�7‡!§b´îÌR¾,Y à uŽÆßE§è +%T ²c¯ˆ|¬�0Cל*O—iMëÓºþð©waÓÈSJ/jÚÙ gMógy³=è“l·L"Ò(Î:q廂ówá#Ûì’ ²•2Dˆ,ó�lœáÒ20²fP#†± ($ûì`V¾@Ò&A| I¹…Âh‘bC%Äò#¢Ni× JP%­LŠj€îO⟬ä�ÎÙhÉÌ’û)%™-Vœ-Ï4g·\où@¡Ÿ¯8KKANBW~÷ÄÐhWᘟ¸¡ß*’Œ‘ßY³lͽÀhv„�KÛÇQ:ƒÔU6ƒÀªcÝ Œ-¶)Á¨#‘Îá7¸ª"X}½³¬ÃRNHÉ̹C×wÓ‡gÍâ]«vïòÕlùšg?à¼ÿ&ñ°Mc´“QîzDžË>,Ég¦ƒ;&ÀC–eØ-D4Õ‰ ´GÕ>Ÿ�áâvþëéŽ~ú˜?Ü–!kT( ü?§uz×tt�êQM·Ë<�‘È/aA„#CFÖzÞ>{ÇÀZ{+ì(d•Šbœd À*‚È�’x8K–»" <¼�¡Ý y��cÃÆÔêÕ&%DúuŸ&s”iÝ+îÿ9Ró¢Ùrqe“ðçy»9ì¶ö¹'Ö;ï˜ ^¼ˆ'J›óȇù‚/8]\LþÕXÌr¨£ªF‹,ÔÔ ‚� ‰,ŸA?Ú0)L,‘öeÎ ¦GP»µPêo¹m¢}/¼‚ÊR…è¸Sr&û^ �ùr·oV{Ø¢½uO<:çô˜$ËϹóOýÎlzJo¼ëq¿ñ˜ô¸ßxì¹mßU—·OÚöî–±™¯–g8“…°'rîIÉödeÑÜ›‚dåbÚç6÷šFcœpÁYäÌ�#à— È*oSŸL3 ¤‰ØÊ¬`”ô—½ѹ¿Ô–ø!ÊçÔ¤3¥Ê•�Œ2ýHP G1¹î£K³ê”„(~¦åþW—,Èž[Ùö›>g^·L«wœiÏý6³¼ôì™å?Úü?ï=O:1<§báäÅSÜBV¢¦�î']Iô¡%¬VŸ6НZqÉ.é!¡G1ð*À³´øÃý¥Ú…$8fÄ�†˜á§×EƆ�{à6 F²DL\× ˜Öi]ƒÝÿPsÇ1âÔÏÕ‰ÕÅOå!ÒÐÎ@¬Š hâ@(Xh†¡{,J²²’ b†`�31ve‚¤¤”El^½¯1þ09T{ÌNR(¶iy'@¤”úMrÚÓºþ×{ÿÓý™fíSJ/LÀ¯7 þ*oÖëîð}·¶Z$% ’Z„Ž›ž&F ä„·'¨¾”H(a]Öc(y ¾]UHéîÂ?9+'Ù2?†Ý™†mÆ$…vdüþÒ€(5™b@*�c ÐBðTÃm¯,ßÓänºNµ`.–¤‰`bq;ìDRF;›q6?Óô²øÌmŸ.ÁÉ|ûÓò,>õO=qÅ!…;"ùQÛ®û�6û|i6Ëùl!‰ó†™‰ìÝóNEnô¨H#ÿ’Awçðp, ÑP2:Ó ª$ýi¶†‰s„©ô¥«§í% 3ÿ˜7ˆ ¨¢ >áb†œåw³@24Ðc€6  H4>�…Rœ5´D¥%&‹ôæ¿ØoB%!0 \üYº~�®Û¦Íu{‹³ïZÌW—µ©}•ôÍGðÿímš¿çŽ?w‚šê©X8!ðºˆäØèmIºµ)’IUì§õáI�nSÎ@³lsø¸vÁ•;5[´V@Ç“@ó|™-T€�æÌ–£ “!ˆÐõ?iìùÑ> Ò*Ï+sÑ3Lë”®Ipº1Ñ0tM¬'méyiS6;Ų²”š_;m›/R%6 ѧh°Œ1D!Ô ¯ ’kË©©–R‘…­祬°aA¦¬Sœé\œÖ ´ÞýŒ»u"ò_òãðJIi)Ò?´ï6·ïrÞ™/WÒÌfC¿�+˜ê¯ÀN¦»íT"2½‹€ðh²Ut~\ç5¼±sqŽš ›÷Ÿ½§‡¨‹Û}%<¢ÚÃ2ŽM–È�ö_°w£Zƒh³FgA³°�Â(•$rß' ±™-гoó6Îf»}ð|–Îßýy¯ž#ñÝo~ÚnÒr€Ÿ~ðOŸ¨Éæ£ãa·Úðºû3ó뻼þ2Iy6oWœ¥•¤œ$¦µµù×ÿ†oèð;~íøÞðîWóÅ Þ[õZ!ÌðØ×{§Ê€E~ÓÈl ã ªAý©Þ§wq士¯Y}£†wÒw$+€Ãþý}ËJþ‡“’=»n“º~Ëó¿_6;ï\ÍV¯šµó×ýÌ_ô÷7µ}Òçf*NÂ2õg&™„¹ ºW •”Ê´Pò©×ˆí&‰w�Üu1 d|£é ì[Ôîוç¦f¹Sñê—Ôí s=¸íÃø¹2YNÀ´Nñ‰h31õ "Ž)p$Lh6%pùn%w $HÍ$Öæ$=ê«›•˜ÄÄ�V^Ù.³L"í%ËGê4=ã)O4ê“Qí¦bEaÎ ¥O.¼F )Ù2>’ Sƒ½­ªØ tV£Ò1t£È Ô›åÖ¥;çd îôKë¨buáÝ{HߤÇl3:^7Ìüq°@0±WNñšþòOyÿ/挪Œ‘VÐTQFHw)¸H,CCoþéÁB¼Ra²‹CrW#žr9²E#Wý3EKóTÞÁ|•­²«õ’ % _’Ì$œÌíb–e:§u¯¿úéûs¶äóùìÅ«�ù_õÛÃõæàØwL€$$ó.–"e†é^œ�Lµ=AæÈÜàþÈTá „ÔrQ <Ì*°@Uœ¡A¢Š©ƒ@˜y¨ˆù•·¬?²�©È¬‡\‚Áq‘)÷=Ϋ<[îÍÖ]ºõÁaÿ !@î0=¥7‚kL°‘oÈyó„®Ûÿ‚&qg¾XHÛÎ$M¶šüT¯p'@½©H·n^ÉiQtjYPÄ1°D=KÏÈS3{\Wè–[ Iv$ýF$Å�%Eù–á<`“Õå:ÄàxTš$ˆ$ëçj¬Ýh êdJ#·Þ5 žL)eúõæP6Ûö‘ÙÇo¶ºÕëöç.›·ó×]´äòö¤üùï=Aò“©ý?‹ÉÙû Â)ÝFþ3]½3x‚êfUa›öÖ.‰uuéF¹NMØö(/Fä:ê± z'…Ô Í°3âá`÷¯Õ÷~mÖñX"̤{寉pªû†ØïÊrc/n¯J“ »xpù*çE¢ö&!Ò˜)åöûqQÿ»ÔB�HuEª@ýx@¸0º¶¯RšK…¤�‚ș̌[}Z7Žõ¶§ß³‘¿¸ûóßôÊnÛ-·ÝÁCûns{\XÍ+AÓÙú_Ý•{ûÇòŠ¿(*)–#3xw-òÿd8êç±ÿf‡1У"»ÉXõš1 €qÿ–ZË´Ù±ö “z–ŠÑÑ‚ºæª~¥0‹0IJ­´‹ÙPÚMwx[9ì/�ÏqÍÝžÿúX¼ç-O»Û”p¬ïøíoºÕ6¯ï{Ð]ýu=7w—Ô-Úv%M3ÓÙÉ_QÈ6LÇl䯠M Þ©–ŠÑ�ÚLÈÇy4�¸Þ8~ê0¾=§²èÞ©Ëá&µF¤Ì$%¦‚…ø^nnîƒqúXAB*À¦%4${éºM³éÖÒÊòÃ;³3o9³¼è²ÝåÞü>?ÿÿÒ¿×§ñÉ‘Ÿ¤4 '(4ƒ?TÙT~mZ¤\:¶2, „µ¶o‹L®l J”êZ’cM$+ξý#VÞ¨N�`œ3ÒÑQÊ<«öÌ ö!Óš€i�¾E‘DJNBG …O äûÉ óC²“ –H/á=£«œDæ''›ê*Z‹³ˆ=Ô›¬ŠwDeUÁL‡O=ç¹b<š¿¡Ê@I1ø>"U´æ\‘Õ6§0�˃Wwúp✘éÈ,á�Œòa¢Þ á‘.÷a.4_3þ×1#”áï7 håÃ8<ïh�>õúÕN9. ö'ˆ¤‰›î0mºƒ^˜®Ù[\ô¦‹wnùR¯ž/Ú�Þ䫨)Rý$¡yÀÎ`aW5rŒÐóë�F ¶Ö-]™ˆ¸xÌð9÷œ¢ŒMúí(¾Ó$�FtZÎeL,êò%>ª”¤Ç\‹šÝÈ)DB³À¶ó!Ï´¦uC®7=åÎGžÄÅrþ>Ié׿‹Å+øçýúÂ!»Ã,ìmNéEL•›Yô¬Ð5ï92•6\PÑs*L À¾p0VbËÕú¬bÈJâº&,)m'H{Bé(d©†ý;ôq eÔQ¶y,g¢@²ˆ CÀ2™1¨²|@EM†.Ÿˆ&O>'Í9‹�Ò4-«�ÜÌw–›.}NßË7ö½<‚ýü6wΫg'åù:®ùÿ–˾óFY>þ%�LßqÙ£ÎlúÃ{núÃï¼vó±¯8ßü¢f¶À¬YJÒm�‚Ù_'+çû"«…kÞ=á¡Ö7Jf†©¿‰…alz¬Ï§Hv J z�ÂÀuä  û†�OãT[@{H%�Xj*|é„ëQ˦fÓItÕåR�ZA|3¿Ù[o±{«—%´¯ÿT4ÿÏÿ£§œ¤Ædª£ODÿ¹1á^´ÌN»• 6JQzY½�*�Ï”f+RBn±�›SY®(BBÀ+@Ð V¨¡nåœS"u")— +Üë˜ß•0Ó:�+S˜Õ;áÄ g�õí ®úÊ –*7¡^§Wäjû]¾'Ä‹ˆ %':‡šÀäÊ+IÃ{µ@�À#–ÔZµœ•vë»'(*Þ¤‚ i0I-<˜Ö´nDëÍÏør6mû¡¦i~½mšßš5ÍúõzÛ&É™HBIîÓQ¬Ð´Û.1Dð2C\e tD¢áÖ¿ÈÑóÁ’@$ø,ö #-.ÙÙ“Ý> 3ÅâÏ_pF•ó@eµiwû%@=¦¡›ªz�€˜ÐÍÞ‡?ó:E( “jÁ5Þ¬Hµ!EwÝ÷=�ÚÙBÚv5ëºæ¶› *‚ï¤äÏ?ÉÏ×/=üÿ½Q~Y’ò°u¿ÿmß|èŽ}sáìr1—y»HBðïpÒÀE õ±_c/´–œ|ÆY�rp«ŒÀÚ\8\RÛᢲ²qå @ 7¡3‘B&²ÑJV§¿€+÷œ³Pz5S#.lCÉñ¦�¨r£®¨AºïÛ”a߯Ùuhˆ«n¶¼åëv{/š·óß™5óOIÔßÓ¿ägNÌL4“è‰t[zšUœMé!¢…î5…€–EÍü KfÁc Ô6?3?˜ £©èì4Ëø+6¥~ÑùJ~Îhµ Fx P�¢ŽÊ÷¼êMSÿš×$˜Qõu+ñèÝ7¶à6«Ôšg„#ãÊ×e•{Ì£e�HÍiTâq�\…÷Qå/Ýâ(º#+pH0v د“ÃÚ²\$¥I5­÷z×Ü{+"~ÇŸxÝ+ÐswÛ÷ÏÝöó(Ò4‹… i{jæÒÏX¾_`ü� û�×&Ú„ÉKý»UQJqì=GEs4ðŒlK÷ö«¹ÔÑé>ž‘ â1Õžˆ �Ñ =d¢Hƒ’�˜P®Ö[oÓá£HÓ´‹vH öëÏÝn»¶myþÏU“%ÿñ[Ÿ~éÔ| Öã®øö[nºÃ{o·×~íaݽrZŸ[ÍweÕî2±-Øh‘=~ ìÔ†³ÇÌÁŠEx²õʉl}ó¨ÕáÁV0|5üa· 3ôí#Ñ›Û�Ç| ÉÑW£dŠUÙšôoF,m«(`xŒ¨ôýV6ÛCi¤ýزÝy×™ùÙËöV{¯ÿ±{ÿÂß�Ê:ŠS’Ú‰j²•„ÐWìü�¨%×£:#t¨4Þ@CàHèØaŠT00$líúC@4$¬¶8ƒ˜‘·«ßë0e}‰'sëA�Ä‘‰ë:Ó:­@Í f­ˆª¢Ãhüºüa•.¨lŒ¡–|îi�©VÅUMÄ:¼ UD7c¥a¡\‘0GñŽÛ“ûO!C£Ï!Iyx‰L¤‰0­°Ýæ^h×µ)�éºnÙ­>[„óf±"O€!ᨃ>u�ÕÑRÓ<Ô“3k5‚sxõÂRÇ ¬€îúç.W爷v©‚:R k¯-言BÇ©0wv5”dPÈ'jÝìUXŒØ< ]gt¼Jf,Í|!©iºn�v³¾p$>2õ²lRsݽú5xýSï7¹Šü+×·ÿö#„{ëí…{u¹{Â…îš/íå¹�ÅYÎΠ‘̽Rô‡ØÚõQý¯z f܇‘=8²2�1! ÔÛ6xåÙ£±2Í «nJm<´Ay“> ,(ÓH˜_Âm†aã`h{ƒjYËÁ×OŽfcø+d˜Áá‘*67T¾ÍsÞH×o²ô¼°šŸ}ÏÙÕE¯È9½æÇîý :­Ïè”pBþžÄÈò:ùŽØÉï-º]f¹Ï,!F餰�LóªAL§Šy±<ÕM®ïUY{¨0�ãgËìx0(pÔw Ü‘áÄ)ìÒá?óÞ…¥âŒæxÓ:uk’Lg¢;ü”Sn$qR÷ãòETdfâ€SsXS ?Z¡ýx)� ¹ÔeŒyÓÉ’3‡%¨‹kF”xÜsdVÂx FþÒoŒ¾ å ©ßv˜¤QÓ: ë­?öJÓüRú¯MÓüjÛ6Üt›ý È]'�$H�UýÞ®Û4݆¦‰ö´õå—Š(c4çO›rZ*‰aŸKQˆR* $ Õ@žF-‡�}pOç Ù f4Ìr|ÚåÔ•¥p+Æl•Û"†Ô‘LËLq(’f!È>5mB»X f«ùºOÿÇz“/‘ïÈÌS:À'uAqEÁ×vÛóßqþàƒ_šeÿ¢Å|…e³'’ú®‡–µ"i�»ho_ž¨ ã±X E°”.‚2DX”¶»D‡ÂÓFÑ@Îd{L‡gÌî§d–5úAaá4 Tä`Âb5TE@’ ¼–¢¸£RÚ€Ð:¸MXQûa3ÃÕ?£»GÙ] dvy-ëõA’NΟ[ÝâÝ;‹Ý·iþ2æ›~Ôß?ZDcbœ„e×–ˆÈ°�ܪäA!¹1T‚õÚ J­½XáPç¡Æ­Ý¼ëöiVÙÐÁ±$Ò„Ìyc°4­y ÕOD§ñ_>9¨ÇÖ×Ó:�kbœâ•‹>�†@_9–®ë”¦ø‹–(Â`©,‘‚é@BIB±æA‚S±}#·idt|,‹ØPÕšæ?7«fz.’û�Óºü˶FÁÔBW®gÄ‘28ˆïÇVÊß§õñÕtTk(w°õg±È)µ2£ú)Tín^ÔQº̹™ž‹ ˜Öi\D#h H R‰à*DÇ‹<0˜T©tJ N't£p0š'ÛñE›÷™٣ţ,‹±W±� 2î\EŒª¹ø¼� «=ýY‰ð3äž9ÍÚœó„Lëd­m³|﬿îêÕr†Íáæ¡Ýáþmò¬�µËÔ™ù°»öö™›�Õü çíJ’´ÈƒËµÝÁRßzÌ’á­º·Éˆf–'cv³ÑKS‚ €‚•Nm~1ÀDÃý3 ÃTmCèWŒ%,Sa V'—ẏÞÐÑ0f'òAK æ°X‰›Y™©�‡Ûµq¼Béú ºía�N®Ý™�yû™å¹—&‘—7ó�ºž�“Òü‹ˆ0O&'¨ÉB2‘9Q’:×J¦D�˜Áƒ(ûQàû+ùÅ…>4ëÍÁŒÄQcñº”!´£º¯–h%/"N 1j@Ý#ªh¼^u#T¹b™ }�…¨ÄÄœ§ð¯ ¹<݈èð mRr–b§¤uBñ/¸‡YGfÙ³±Š÷·;z…Á턊ø(�†'¯¸¡’7Uoî"Xô@\«§LŽà@-ÍÀÉ—�Ü`1P)!É5iÅ~§5­“³þì{ï’ç�ü}Ó4¿Ô¦ôÂYJלï7ûçMxX0¸hó]”7J"öžß“Šhî™d‚d ?CYØýt¤ ôA…þ¨†#ÑèˆVç¥ë‚«»Iº!�Ã94L ªÖÿåÕŠòšÉž%1¦AUG˜fÀ¢½i§¡R±Kv(bRA>B&%gaJ�Ìf+I³ÝÙA?ûŒ y`ŸåÉM’;LOé?k­ üºM·þ¶ýõUŸOév³™Ïwh%碇É q/ÁØ êà _bd~#ê�:bè£XP$Š:˜¦Ùõ$Ëbm–0RïkBšNì$h‘%mTÎU¬‹([q]\[XîG(Ñ?C$z@Š f±IÏ@�Ä Ål|˜@dÛíc»½Ð4ÄÇÏ./~ÃÎb÷ųvþªøÈO}å>õ(ù“^ù0Èät¢ŠÞ’hIðÊ*RÊ=¥Â`ÈèƒûY£¢ëÇÆ‘:$BmÔM�@ý'�aÈótJ­kóÄ¢wT:[rM"[g—Â*ó`¸õ1µ€0­Ó¹qÉGbæß–µå•‡ý²•:Êœr:í˜êTCœ.V3 ?u5úô˜—3åT0Mµ×‹6ä†#°v+Œ-ñ£X’ d ÒNkZ'f½ãû¿jû®¸ÏŸÍšöå³6½Dr÷¾~s°î/sGÉ�ì ‰k[c­\ü7ª¡„z¨ø6¹�‡á&ë-íG8¶J#‚P<1jèŸÐÂÌœ¼:J%=ˆ’"©r=XÝRàP‘´å(ÛZì0[QaÎ…Ý”¤i—’›e³•Ù¿[w|ð&Ë#îôÜWßùNÏýƒë…vùÔ+¾ÿÄ�bßuåwßr9Û{Ц»ðµ›þº»gîÎÚ…ÌÚ]�4%)6Û_{²Ô¬'iCër¿ttV⸽£®�)ëÇØ´cÁa†×Ò&À vŒ47ŒC¾°#h—i¼¦Y]צ¦ÈŸ?øŽô›GBqx³èhR“…ä¶_§m€FfW-Û½wî.Î\¶»:ûÏ{ЯþÝs/}á$g‘Ÿ»ôr2Muô‰XÚ-§H/e¬³Ç¸ü'Ìò꙾sŸ:!_´q¯^< |°(O‡™«³Cj#?¡³èÁ¨ìÅÈ) Ǽƴ&`Z§ †X6±îâ6A±[NÆB,“ô8í` &Š�°ŒsÁbÛO‡@‡rî©gÓÀÑ2“r)žc‘�k�ÏÕqf•D8åc&˜75æÕ$�]:­i�Èuö·ø“v1ûÅù|v%r÷—›ýkÖýö 's‘’#¦£+£…ëµM®ìˆ)£ª¢pÜ2¹íTd=³ëåQ}—ÃþÂçÜå¹—Ï>ÝÏÀOͳNÌ!öm—}Sú¶Ë{f½¹î^}^?aÛŸ¿{Ïköóæ³]IiæœÈŒX¤")�ü-1piÏͦŒm°Ë#šiŽE‚)fE3õÓ™]:" "å7T¸Õéϱ¥Ñéw4"^M½Fa̓‹ì¢ÔýTfw ¤D¤Ä.¯eÛí÷ÂtÍÎìì;Ï­nñ2 ¹ro±øÀõñ<<ç�žrb´É¹o&0ä$ôÿ ¶›Ñ”º€l;ü©'f4�6Š«Þ/ÅvÖ¥a~ï{(…¼jØ­C—¦ðÜr#—Aã zÅþtຠêT-µê)N×åÎL…ß4•¹0­ÓÚþ'ˆ‡„@C�hÊl%uK¤Vy¥M0ý¾y¢€1^ɪ5;ˆ³P2Ô¾ØP”‡Ýœ …Õäe@+Ì^¥L%3tjYœ›uðˆ¢ö¯èİqÃy“4)9(f5’’Ñ4IæË¦ùN»ígŸ•szl—Ó7­›Ï¹ë3¯˜�Æçò —}kúΗ>~oÓoïÑõëÇïo?v�uwõ™y»”YÚ#df‡�ª»±c!¡I-î´¿ÙX?/äkF ˆ©ì¶LÎh!;@]¥1èhDdH‡ G\š�Μj¡ƒNÓ?òµsQ‰ç¦ÁÒÏMQ�6H  ÙyÁª»Â†c×o¸í³ätíîì¢w_´sË—§¦½rOÚ\ßÏØŸ˜û7qšœ  fp FئnØ! ¦ &æ  o+×……i—k‡àj##È * º7-('\À…�HÀÂD±Ý‡˜ 6Cz–‡(•Áx¾ÇXðL&€0­SÛÿ“Ê…gÑê‚2Wð|š^ A)¥,|ó^6ãàXQqçÿxÄæŸTÁ"{bpNv#Ñ&©ß1„· ¯˜«ªÑ9I HÊ[™�ÑiÝdÖk¿ã.}ÛÌ?�Rú¥„ôbHþp¿Yo»íF„ÅñÂØˆŒbGçßÛ¸ P�µ¦Rl¬PïóÔýjÃ"uí·*¬ Úd‰‚D½×ögc›Óÿ �JÛ©1'G!zÀ@q:©Èãú³îµ9¹* ÆV¢ 8�&I3[äf¾›¶yñëMz )ß�Ó›°É_³é7ßzíæÃwæüÂÍ»K™ÍÏ ÒLªú7šD˜„9aøÇ½í‚;º “Yûg郦}¡üz$3ÖF(â%S5÷æsc=µÞEÔf_}fªF_@ëâËÏ „`?q…?Ü„6†Ð’XÅï@]i‚´Î@‚d!×Ýš›í&5\\sñò³Þ¾;;ûëm;YÓÌ?úÃ÷ÿ¯×û„;çtrbÓD£>O)<º˜aJ›Ctºõ‚?µûλ‹Î«i ×s–Õ{Æg¢¤MÌr‡!Æ4~z" A—AfûI"ÃAÏÃú@´zzb¯œâ5INó�hÔ5Vÿå*cþ(´DÀ<­Þ‰ÌD�8ö‘FE�¬-‹«Ë29ŽXÇ ¾” :öÏàÌd‰… sAYU!õ |L€iÝôÖ;ø>ù“ÛÿÈkç‰Üɹ(·›Ïa“0¤fØ}y¼ë4t˜'°r3–Œ®JŸ±‚GÂ^=ŽS/Öè黨ÀÔ߬%ÎŤvGMZGÔÕ�‚¢A*®Ã»�êûc‚‰Ô%ê¨Bæ[J ¥]²Ï’ú·A>|p“òµw{ÎM/›÷¼ã{¿îTÈžråo¾ÞÜóÂá5?쯽W—/š/–iÑîý¼øåéœÛ‰ÇûmS9î<Îü>Ò½(A0+£´¬O¤ÿ Á~ˆ�û ;Ú|ħ|`›èPÇÅÄyÈx¸-Q=HT?û±ÆùƒÿNd½0"öSéØþ²î£à̹˽lú�4l®Y4«?Ú�Ÿ}ÉÎ|çµ?ùÕ¿ð77Ôó‘RÎ'¦Ž"&Àñ÷$Qæ9¨c§m>¡&p£Œ¶ dd¿)�„‰:86gtó@*aÜHP'ÒÔß\Kb†�™šó[†Ž70’§'c¦uW)N%ó˜>è,O‚2@ DKÖ*ÞÅøÿÙ{óxÛ®ªJx޵÷>çÜæuiHC@¤QA Ò7JÑŸ_}6U‚–¥4E£ –e• ÂGcI£bS¢–¥(øI"…¡'¡•@­–ˆ¤ $yïå5·9çì½Fý±×šs®} $�Üܽü“{OwÏÙg®¹Æ \ž±;ù35A ü=´”Ñipwè—|:J’sd¡çø;qGOG;º¸9g²LAö §�k\7¯?Ü1\ +±kgmŒçÔMÕHŒü”±®Pé¾<…­9Šƒ >üù+£�ä)‚‡h~ÄÅs€p'4Nî¥5“Õ ˜ —c–îDƒs¨§DðWU'à��éÅÑM�¿p¤ Oä73¿‘@�j2뺥`Ùvç@–?#W+Y9v¿¾éŸßõs[Þ\¯¿'ÿõO¬Îç/»ÅOl-�œ?ç±C“ÕYlš}1Ȥ0+/ÔtO„’˜Ý�¼É~¶ŸFç§ ’eDb—•×�£‘…¹ÞWvл+³×«RÐ;Ýdƒ ËÒ5çÀ ò ‚ ˜æ­HÏ›"!DT®rÏúí(ÔG¦íd,Ü@r+z5SØÅVÚn!akÖ¬~tµY½¸ë–¯½õY·¿êÛ› ˆÈî8X�‘A»�Á¹œ.¨ed�µFãû#·—Ðj�-jgê4Aig1 ’Ùc�>{4{PÌzKÓMh÷uñÜ©æ°l¤Í 9> Q‘`”;¨ó5Gðj/÷ƒã[°§¨å°ë¬µ…%]�QÒa“¢´ÑU p˜©dsÕ³âe;4ä:F7š ?a.^ÞŸÕÅþY–�«ônÚ“­Â3ëkÌöJÓ캮G`t\7Ãõw¿òÐ("Ÿ‘ßð'ò…n±Õ¶ó-Ķëç"( Ä©¾\Yž“½û™CË��ö².Èi«á¸ˆŽ2ä²Ó�š“2¢Øœ¡ _OÄéý{f>tŠã|ýUd .ðT¾¸XÕË')ÉöÌ’ƒ ”°™Ò¾[—V½-J*i „©‰ÕJµìš³»6<ž¥»¹Ëf~ï|yò Ç·>w¯¥œ8TO¦ÒÔk1„®�ˆQ»gš.EÄ„i™Œ’b­qV%Zd"³Ð�™ÍB1£^‘½÷é|j W½P£ô9±*õè�3ì’õ 2Ì5YYN'IA×.q6I¡P° TÇÓò„¤%Òš¦Ûq”ØãótÖ£ãÚ‹kdìi@.Ø™t;>t–ælû‡Œ(ç1\ä óç^X»•ÂLl@…”³üÂ7Å—å”.ÃDqŽpÄ�$“ì§dn©£`\7ÏõÏù|ìßüÒ¥$N!ñQlwìº8©f+¬ê&ùŸÑ4Ív®ïÞ‘Îr  + ŽTéÙþ_�ÚHÕ’æé†‚º˜¿ÂÆ€Lzo} vb'LI”LL ØÞ®^�ÂØ_0¸£ ؤßG¥ä?›ä©ÒRêZCX!ÛªYÆùíÙ-Vê®Ûø®ç¾nR!|àÝ¿ð¨›Õtæ§^÷cgÍ»Í-çÛ?¸hOÞ¯•ÍÓëf‚º^‹�H°7ßòClñÇvWGÿIñ¹–15n6(E¤”vJXLØA¿)_—Ĉ!NŸPòqi*â°:|ð„çšD’Þ�Ç#i�Òo£øÅüÍê§‚‘m·D×¶R‡úêY5ýдž½¡õ›^vÁ«?uS¸V~ýƒO¯žy·—ìŽë¿ªÆ>z,äf¶¦…�÷Å{]Cw8� ÉüÎ$ÿZãeN£|„,ls7“æh¾Œe«Â„üD"bƤ2ÜÈ {³ýesyä[[nî›L×ЄUu`5v�ZòUÞ¥ÞYª"‰)y;}R æ5͇¿ DÌ�>_; ¨¢?=�幟 ôä�Åç��²}íoú@ “ÓÀÿIÚP'h¦ꇫ›%“¢:èh®x¢B¶íBÚvÑ q|¥^yïþÙÁ¿Ž/>±¼îê›Ê5³kÿZƵ :^R¤“`ô°ìãê:RéÙo,!lç9#%¦ 7÷BiBë�á ˆ‚ÃÈ‘ƒÙ�EÏ+YÒÄÒÁ*ÿ3¨w`Úˆ2¢¡P½R×@ íÝM›ñºØ»k¤.íiDTb²þ§�øŒ9z+ê5œé´ %30NÍ-«I2õUMÅ™‰ˆ¥+X3øn)•¾úx� N=«—ë•'b+1ÇCE0¬ÝòÑO`¤TR$��k\7·uß—^Žîʼnë+ÕçCÿ³©ñ³Yõ…Å|³ÝÚÚ]oëª^y�þpá´5bç$+dá«V­¥D“h@<ú¦IŽ—Dj¤‘ÍZÓUƒD ZÉ/àp OÏÓ‡O[¢2MÒŸ žËbK(ÙBZúÑu¢IÙ;¤ókdÖ@¦qS‰W"$ U3¡LÖÃ\¦gnÇðpŠ<¾íæqµq"�›·›�?1¿ú.óÓf¥šÖk¨B�¸®bâ’H�„Б;`lyˆÀËX�Žè‹^2mßq»’&ÌdùÊc£h¾c’£˜3MÇ„ñy%‘-qr&Ñ];©Ù'ƒÛiMyq"ÑÿþJ6Ùà?Åå:ú”:‘e-èC*©„"qÑnÆ¶Û ‘ý³ÓÞ>kÖ_5©'oÜ?=pÍ+ûú›ÌQö7>ð´]Ó›†ØUÈÂerñ×j¯6q¢|ŠFcõÍ)T榽ªS(% Uk§i+’>™©C„ê—Ü/r‚­SÌåæ[Xl­~læôb);}üaš£%_8Fìõ52ö6@„4.¾µH&8Ebo6ŠR6(b…QãÚ ÀKÞ�w=ýž­ˆ|ü^/¸ô£íÖÛvñÈn1¿ã2�Nf‚Pê—™?EÏP H~3wL?Õ<‰ùTªdº B¾¹ZÔ5Ä�¸œ©¼Ù’�k”¯qŸRX»ÃB¤$¤·_¦+F(ª‰ÂÓ²š H1ÓMû6/J@©§²Œ±Z.ãmÑn_ÐÔrÝ}þûß„*TW¼ó�Ø•r€g¾áI‡6—›çŸ}ì¼=yß.ní_iÖ0©×©Uº�boÁðçʵ¤àý[´¬û˜²+=‡gŠ©‰´$CP†êˆ¿P`~‚þ²¡æÑ$qÐI MÓ0œäKØdknQüѧ‚ ¹Ýb |If�‘ÛnÚvkL¾8«Ö/[›îÍl²úŽçÏïþ&wX »èP=’¨wG¿[~Å­‘5ÂÌpwq·q¶p†ÿâZY;Fn±ýO`f. Ãä-K6)wØAõò[¬»©îtšñGÿú©$j¢:†^�À¸ötEô]1XÔ'm®û¹ºzgB½çŽ (êRÿ€iêÏvâøÖïϦӸX̽Ø8qû 2 “5*@biÜ {*uö´}5,÷7qf鉈 Ÿ¨ç˜t?ù".É3JͰMEHæ�ž»0%Jç—Nº@RW)€A0jQ'Jà�âÂD\Î�×�2yÙç·&%'%Ƙ4•TÍŒ-‰íywf�îGÚ–«K.�}çó/ºò?¿{äO¸ð)ˆV7'ïÑÅÅ¿[´'Î_Æ“&õLšz�éb?#·Àºaf ‡IÑ[zW ‚SöÓeF¹©k£'û‚R˜`ÁBµ`#µd cQòÓËh4¹„êÉœb æ: Ž¶ SˆnWŠê3'*ñ¿‚‘&œY®úO ¥OUˆØÎX.·c%õñÕæàeëÓCxSÝ4×Þ¯ŸŸ½Ûoî އ¨]ÓïBD:P[N¦Ê ?˜wdü™aؽ¸FûFÃ!9ȨQqûBþʪ�L}CL"€Âˆ«Lºuú»˜iŒ°›Ý²{|Óᥡ‡=£nC@V ŒkO®ñÃßË˼ûˆrtN%ÊÒ9f1¤Ã¹�ˆ¹k‰Z·¬ÔÂá z°÷9â¹ä;6q!i-†Ï&¶¦§@ !¦a<ß F†¤T�‚øTF~Ùt6§¤dÒ¨Ú(ž„7!ȧKHŒÆ(UÒLf Óõz»kÎÚœË#"ågšJ¾c—]R³Jø='ó=¶}õýÛ¸ufSM1möC¤‘.¦ºE!ŒpÞ bnZ‰%,²/o .bKœÉ¶åfó;ãý‹¿"sBE@O ~xõ™Ó¯YT@a$s`¡;PSm¨v”I ´„àhÿªUñºô›´²'ÑœÓ f[Þ¿†Ðk$!cX,7Âb¹YƒÕÑ}ÓÓßµÒ¬ýeSOÞÒT“#Ï}ào�ûÜõ=WŽ~A»£ÝõJ£>%Dk0‘)sj�X~MÚXœÏM=–‡ìt>T¦BÊ"4Z,r"_F"’ýˆÙ�ú@.Øg*x%É}¥ÌZo ª2Y!rê÷xíîå52ö6àHKÎy‹ƒ =ʈnïrZ‹¢èŒU5 g†œ¾½;³öEp}\áß_>z¢"0Xr ‹ù\¦x:°ï$½½ôŽþ‡Õd¼4Ƶ÷Ö{Ÿ}ߥˆüÃÝž{I`ÚmÏÍåü[â¢Y Ó©H° aš¨w+Fr*4ÃÃTŽ�çº?¹Q­;_.§Hí¼Î0´Rgáš šgxÃû«kõ3)�Ï`†ýÆ„R”Ñ“7‘Ë'�„ÜFÑVƒ 5ÔŠ‚PI5]‘%¥Z.yÚù$®;ÿ…¯%!|ß³s“–üôkŸvpÑnÝcsyâ±m<þ ŽçÔUSMšU†ÐF!“‹Ÿùºz›,KQpü’[bq€ìH}‘Ò†Û¥lg°ºk•°¶{ˆ›Ât)bW‡}¦åÆ#ÎÚÒ^:¼• ‹ žÜ³y! ˜·Wq4Áàš‚ž!m\bÙn¡Æäð¬Úwùêdÿ…+7QÚÿ.n¤F€]ƒÖÀát§‚¡Ÿâ«»µøÒ'yìh wH�àë–x�Ò}ÌP×í9ð¥�¹vÑyñÞù;{qìŒ%HÂ4º(�q�À¸ödE”¢]ò}:$M(ÂÀS1•²YÓc•K²‰ƒc€ˆÙ‚ùF'Ïõ„@pAy¶¨C­Û%3 °_Õœ[´�J6Oš>‚a¾9RúƵ‡+B=ù´Ë?šM›ÐFÖíbóN2 “ ÁòÅ!ª3”H–Jx JãÀʃæ”îÎÝ¢¢Hk¿\ÜJa¦îî…w™sÙŒâ“HÓÜqN,†¸’èOFðzÚO쥣´ˆ&Ãâé�™ÓKëï;CUI=�I'¬‹îíWQV!©&OÂìÚçÜïÆ©ß ¸¢„v|vÐA$Š}KŒU iL…”³‹uÎðGþܽj®€ƒò<צjâõG¥M<3 DÏ*¡RÌò«0ôiUeŸyA±(eEV¶ÒVÜ'äŽÆ^ãQgoC¢©¡è›0xf£8 æÎAW©¤´?E‘€âƒ o5P¡OkfîòÍ©�Ú197h‹+@�þàSË=9‹æŸÔF{G’f6®qí�õžg|çŽÁÿía­ˆüã]Ÿ{ÉëBÇ}\ÄÇp±ø¦ÍDêþ‹£ =}�)ó6�ÓHû%‡ú Ä= I(E{àèæ`MOÓÄà‘Íà NýTñ}kG¸� mvü/éôÜVdÀ³ :59©6Š"�!T”f»È;œ·ˆó *tÇîõë†ä×ÿÌãnr€'þÍO\.¶î±=ßø¾ywâ!¶Î­›I˜4«2 %]+ÞE!™HÀK_}Œc1ÀrµœÅ¥†�q^¾”@§—µTl7¤#a–ÞØ‘< ¶(ñ Â2À_'úï2`óªe5�Ü.GwÍB=¾Ýf(ƒ×fz‚ÀH²ëZ,Ú-!åĤžþÝêdßEë³}—<÷A/ÿÌXínøFÀ]²†ß×çB”ý£™6À`@f¼yßA³ÄÈB(+J"ì'¥nÉ,G9¼ƒ¿=\18…�ær x œï?-g\#0®=¹¢=UH%$Zh)]B·…îÑÔ‡&¢-´øFeR–ð€ö$,¹È÷u‰ßï ã)ÎpƒªÀ3Çq«JÌçyZKÙ;…›cªž"A7âùãWÿ-›ÉGpBŽÕUXëØ­vÛ›gKdUMDBU‹R�UÄNª Ñ{éŸG3?s‡2 YJ :ÕP™Ÿ¤‡¿LÜô£|–rç:˜Ë² *Pµe_Ú²>”~Ø£^$Føöˆ¡•Çòp«”uýu‡³w u N;ÚÓþö=]¬ ROf±kæ-ÏžpþCÒq¥êäØ}_págÞýìÇ}Ãä?þÿÿGÃÊb±}÷6nÿèf{Í[nÞ²™­°iÖРëºD4E¡lUW�ï¦�…´á¾  a�JI*‚Œ 8�m¦‡cÄÐ!ÁÎô?x¢¿{V¨§„Ý(0Àì>©ÐKÙÚ~àÓk³Ö%¨ë¥sȶpÎ6Úë#ÓyÁ®[Èr¹Ûv¹½2Ý÷÷+Óµ7λí7<úÎßwÕsååcA»1š¨jdQïŠãH_(…”Ù43Ér^Õ)bC�9HnoI¿¥d½@ú‹~¡Û R†–Z`ëvåÔqÂÄð÷ÂU…H£ÂÒ a8dÏ ÛVÒ Å"¯ œÆ�k/‚—ã[°—ñPxö¬w,í Yð3óÙÙÞʺcfÚSfï'‡b«\Tf,µ»‰ »Ù4™�@ˆ¤P13èvò„äÖ¬ã:W$ÆUÔj)hÿL¢�œÀ’FS"¨°Ø<ìO®¡Ñqíùõ‘Ÿ}p Äçü~äÏjðp;ß’ÅÖ&Úv!"UÔh¿œ}HA°�“*öÝÑ)4ÙPI¤äóM_�ê «Vyø)êòœÓ”‰�\®RH@V AM”ÓY>¡©àŽç¤€\ÁÒëéå™)~I»BÙñ¤Ü¡ÅÄÛ¹�¥Šqâw€ „ªj a¥ž/§ç.õÃ…òäù–oð&2ä�‹åÖÿ»¹¸ú�-6ÎAS‡ºYÀØÁg[I¦ÊSˆØR‹0 „ûð.Æß§±Ýó�›ý6¢Ò’„õÀ&‘¢!Õ²‚f›ïÑ—,õ€Cm2"‘Ä·†T«~ÃøÂð©,l`  IDATz—ìI¯^Ë4]ÒܬñÙ<Э4ÛviX]â#Eºv‰v9¯‚pkmeÿßOšéŸ7Õä­¸yõ÷ÜâvU£ÿ~Ú®ÙCQ»¤áuMnNÐËûŒ‹¤ÒMÈ’hLµ¥J/#rý<®‚sº±’%"é÷Hó±ráο¿´ÌßzÓÁ¹ý"7Æ© ™’Gô ³é�‘Œ&€{{� €½]k!5*ÉÜ�d§u¨nÙå4OD¹PÞô? E oæfmÈöùÞyHX°¤,U_Æ'\þ.%°x¥Î™�È2|h‚Ǻ8®q‰ˆ|äW¼‘�|ǯ½µé:Y#ã#b7¿]·ÝUÕÊ ªºaN í㕊ã¿?±—êc!ORXP3MÜíF°yÈ{ʯ¿}•ÝxF#ÕôG¤ñ³wÌï5ŸÏòP1gw èÊXa1èPð‚&ó’‚3%uõËtNTœD€ÀºžJË0éXÝaÞm?:Ävy÷ç]´6›T—¿ç™�þº2žxñ³Î\.7ï³µ}ø±ËîØ¢lݲ®'uU¯Æ “ ‘`Œ}Žú�{ 5ÏNÖé#Õ�HOè÷X’yžÏáeàÌ/.€ÒÆê(þð”}•xXJo®ý»¥ ÐçE˜²Jƒé÷6{è’Â[JX¸EzÛqªF:ª„DWéâ2´Ë%+‘«›jöáédåMU=yÃ9³3ÿñ—ôò]·™ýÌ·¿t×¼f$cÔqÝÔÛÝ(½)KúHŠHÈÜš¾8 µ�é HW�OIE²ï&ü6QˆÝü®`N¥tº#ðÔÜJ‡ì0zj›î&=£USnLØædyYà ©ÜÄôŽŒkƵ'+"‰¬$æøà4„/âô<ëÖyü{ç"�‘�âX»æàtº®ŸÊ¾Üžïsc—y^§¥exPÇ’*{ÃQõ1²ƒŽR{5Ð6saTƒ ³8(r%)�Næ" >é�٬̑€#»n)]»hc쎯LÖ/Û7ÛwQ„\¼Áöêü=«×�XÑ�oÂnhwтšè‚ÚOùÃ:$!•Cÿ(Zé‡#8߀|º¦æ˜h.®Ï¡Ub™Nû=+UwG¸ˆÇùñY´0¦n6½g¨–7SÕ¥âû|ÉqеÇ×(?QB½£rjlÕJØþÀt‹™®„Þ¸”ÄdéÌ̵b$­?¢ª3•NÛ£­Ô6ÙE�Sýu(“)¡Ùb[_h&f&»µCÉzbi0‰³é$½$0z£Œk\ƒõ‘_|P·2›|¶®ÃÕ!¼jÖT‡»ùœËí-Ä®#{ncžOÚ×_¿°F†¤öCÙ.±ƒ´ß&¶·šì'®¥KgÒÃyÈVÎ#pUÂГÒ±ZH¸ÖŠî˜jöO‘ ‘ñ“= µ”$SB®œÉ7ž¦  J;½”¾´‚†� Y\¥obr‚‘ºi¤šì«:¬�¶ˆÍwwQ~®íâwþýè×cO_äæ‹?yòäçïåøéõdZÕÍZ&ý“mvr¹g7Q"’+ª4¢ÿSC®ðêØo&2n3ÊKo‰�tgŠø¤*.ŽŸÑ? ‡‘ÉÓßÝÁŽçH´þœ ¨Éö�ª…­ Œ4�.ô¼é© ¸ÁJÅuˆ¶? ôˆü?½>û)Ñ¢íæ\´[�Â#kÓïœ6«¯ªëÉ÷Õ«WÿÏG^Eª±Ã¿‘DF× ]�ˆFUõ_¶�¿`ÿO'€ûS™×X«ôõW}O¦¯©x 96Ä?¢�ß¾%ˆÓ±h´MQ”›cªòVãD²Á)×êŠû©Õ#pìt÷ò{½$æô,Ñ‘­�Nå–óq”I"6±=ªï¬,P¾Ì±ç…2°aà¾m³~”jbÏ/.]1•æ”l¬M&*qà®ìL ׸ƕֻ~æ¾ ùð½žwÉL€ýÝbùðØ.Î[.êfJ � Óé’Õ!ò(í šNJ¥NÀQzòyÚû/ÄçªUÿ_y‚L�Û:·×w âf+™X)nÆâ_ˆ«4ƒÓ9ÒÕ.±ˆÃ1+^¨d)\ˆM0 ¨Àºn¤å »e¼UŒñQ!¶Ç/zã'åž¿þÚ÷½ÿ™�¹Q%OýÏŸ¾½Ü¼ßÆüðãæíu÷kyݾ¦š„¦^%dÒ3§r¶ 3IÃOµÓ@Û‘÷½QuÿO�uõÒ×I;ј”‚ uðöó|ÏÅEÉÛÍ àEºŒeƒ—¶�ô[�þùì:�cPòõGqÿäàÄ�¸4åoñ"E�ì�Àê¶[Ȳ›¬¾4 ³÷­L×_3ifïxÉÃþôóvIŽu7~ÆAÚ®øœtW $dR«•Ÿa‰Ög˜¹háx=ŒÍ¢×ŸîìGM®†S•/_êÌü�)ÀÐ 7ÄfB ûnz+•<4Ëbº€qíÑzhc´�ø˜p”¥TýrÓkÑÕâ¼þᬸ3£2¦R•Ò²EƒóFö~ÍÊäw]X”Bãúû‡N†Æ†ûÔIJR/ë¤Úf%ØÈ׸þ…µ~àÀOž<~\±X¶,æçHU5• T�8ðÞ`öñÃE.€?['‰�~3û jŽv§¦ôÁ�œèµþª ’’s™•�|¾(-á¤2óM0gª…QØ«­Å3œU‰øgu'0{TºúÃ� œ=¥€zæwŠË6$Ì[NÌÁ0©ê†‘+Ò.â¡*nýÛEËIâ5|ñ_~úíÏøÁÌàñ¯}v „ÕÍ寽cÜþÛíá{-xx_3]‘ºYïÿ�n Ìæ­©D'¿ª ÆPc¶\H i\þôÑ|`Ì�ªHŸ`p@�YK¨\Lß½dšgæ`c”¥üB©÷@`º«úÙ˜ŒÁ>¬Â"�ùàÏA‹­>þTé Ý(¯*ô©�AÝ&í…rr½^¿lßäÀ…yüæ5þÙ~ùÁ/±ìýü?5»èã€g 1kú¨˜í÷º ¹Ù•)ÅÄpîLÓ ‰†èݳ‡¼?Ÿß0p!Ý.¥žL¦¨ÊJË$P¢\¶,Ch½b\{w�Èå^^Èe¢80Ó¤Ô¯¿÷".,º²m¿K.é…O™‰ënl a.~ýàF.�(à—“‡·›Ñ+Ī2Ë­Ÿô*SËàN¡ŽTÚF›Ët_õ'µ0Œæ¨ã—®û¾ì}E»ð¶'ß}1Y™\YUÕ„ ¯¬!×´ó-.’ ç4†t²uçDȩ8UëEº;f+ÉYæe9€«SéŽÅß�� -01�òX:!-¤¤°¤ïÓ 2U\oD#?‰xTÃÕ'3„1-g%—h55�õ<©oULWÉ®B €ÔÍDêéjÝrvæ²­À'-c¸aÓ ³>zc¹ù„ë¶þùž�j&34“}6Òu6ÞE$& }È6×΂۽‘´ÐYçÅ�ßoá`Z Ék¼kYúë"æÆÀgÕ}ôôz•0á½€_‚ì°xèï�‚TÍm¤f�ÈY½ý7óǘÿÂÌò7ÚGÁ'õ³ "ˆ²hOʢݨqtsÚ¥+ÍÚ«&aò–UÌÿÞCþ¬Ø¸~ímO{¼}�,‹ÝÑïæC¥H«N-£ øR‡ç"ÓZ4ñʧóåàº\‘¼@ñ†1à¼T…–§Rt¾,¶ƒ(`ì[\Dd"ô’8·/¡ˆq°÷Xöð{»:…cÁ­4†½sÝW0Ò9 ÒüAÙ‘¬lc�ÂÔTyžRŸ £M¨%†ÉsÔ‚则èI3 ,ù”šÊê{ó>œLGÀ¸Æå×»Ÿz¯ˆØ»žzŸmùàÝžû¦ZDÖç‹î‘]ܾ]`@=[a¨*ÐNÙN¼“¿ÎÔ uš2IÙhßù²V@�K›S[‡ÇEÈÕ…½œæC•&QúÒ)‘³Ø¨ðñ†þVuiÆpFüFñwÛ‘8Pµ@$"ÒÔYĺNÎ[.å{QwÇðâ CUM>zÉS/¸^ÊŸøëÿ|úr¹uïy{üû—Ý‘ûwñÈ¡I3©šz]€©ÄŒ B}¬¨‹€ÔíÁÛ?æÓ-l~Ÿ1[ý(ÖÍìN ƒcàê5Eo4ëS& v³vŒ{æ…JHè4vÁˆ”¢”?FòݧC>€‡ $CìnGL¹^#£´Ý<´í–TÒžVk—¯Mö]8kVßñ¢‡ýÑçOõÙýâC^6žNoìÅ8¶ »åü_tŽfß ge%â²>ÍÄfÈý÷‘$,*ý`«"u'�îí¶,¶‘âE–1ðEË3aõ%¥ÝGstþV^í‹Sî¥ãÚskDöôÆeS‡<ÄÒxî4Ÿˆ0=oö`‚fc'Ú*l¦N— ѱ]Ÿ…SQö·Q\â—òrKÜ“¦”¬5/ñü¡ž¬én_„Cvd‘Õ tÝè�2®q}¥ëСCªªúåUÞŒØ~¾ÝÞXÆù¥ëÌÏ}@9dr6KŦ�Ïlž,HõÆwÃWçªueru�CPÅ/ æ  -�´c³ïŸ”ÉÐý×ö£`­©˜=;†@"5A§AªTðăLZpoG-î® ¢@¢€u³B©Ö&‹nåV1Ö?ÔÅð#‹Åöy÷~áÿj¾–Ïõ õ³áÇÿê™km·q~Œ›?1_|öŸOkê šzŸT˜BbÚB,­¨$Šr5ëç·†Ô�fçõÂÏb‡¢ß¦¥7dÁVÁ•pÖŒbÊûü±÷woYtØ:¼Ë~`yhïè´YÃç^ò”j¬P7r=r©w  „xYS©3™ÖþÀpâoæ­Eºé}GlkËî{~ÈÖ³Ò´V§Dʊפvç’rü’z)·Þ$Ð*V‹²Ù`Qã°ÂˆŒÀ¸ö2ÐOéœ�·ŽöoQâ…®Èô{QŽoBà Ik±=K“’bö"T–F|Ê«õË%s+#ôÊ::± ä¦ÛùýIþ›Á¼§k!0ÖÅq�ë+Yo{Ò=—Ídze¨ªÿQUÕÿª®ê¶·»v{ ŒC Œl:é´H"ôðt½Y–üÓf4ê/Ý÷­=ŒHé�¡£;#Ú±>‘ñ©Ôl¸xzÈóOV§~l§i­êÞ­Á*';9Ü@éTZÐLß?¾K’Oˆ@Â?�%M  BêzÂP¯V˸rËÅ¢~DŒñ)õ�¿ÆÝa&"�j»ãÿ~»ûäù˜^{Úlµ–f²H#1š„A 1*ÞJÀ Bv”2ü%+¼üžì’®�˜NX¶�ä³} 9ð8ˆ BöÅR¾Yú‡b >�q(þÈŸýÆo£F`wþµž+áF ÷îpÞ¤˜JGñ̲WŽfÙ‘ ]*šœ`Mí‰ÍÙ%볫+²T†äÍf°�¤2VxͤZ’3±Ü´+k—T‘@§ @3,÷ò%{{E<ªÍt¢ qȯ§3ËÖJU-e§y‰Òe­v)å}t—=~Ñ}&6(Ô6 *ÎÊ÷ñ¦¨ÅÐÞ¬5f ©½Ê¢Lfûg“(GŠÄ$³/Žq�ë+]ï{Öæ"òÁ»þê[¥mã´]v�móo"‚ÔÓ© #ü‹;°Þ0IZð¨ø£‚¸zää$dñ¥K\×$ ¢BŒø)ÅØV«¡E,cÐâ3�¬½ ]Ç8Yeh=ï ñ§YC!/áÈîž².…ù|z Q51v¬—”Û3òQuµ¸î/~¥áÇ.}Æ�|E ßO½ágO[.¶¿k¾uòqKy «Ãg4M�ªÚÏ'Aº�_ÌÀgßý�pŸ?þ�‡Ð>w ©“‹"+åæ ý³é¼r7M�°‹f¾Ü“Ê”�Á‹§w±Õëe˜cáämŽe‚Š*.Þó»$¨$`É0"²í–X.ldòÅÕjíýë“Íf«—>ÿÁ¿ûÙís|Þ¥ÿ)üƒ~s”ܘMÔØ+ì ÆM·vÌÝYVØA=ШWªMÁ¸|)å¹3�*ér~"–úâÿmXO\%éͲàìmGTÛRGÂõ:[%ÕY— ']#0®½¹ÀØ'4÷£—ì·��7©¥ÄÔÊi³â:)úñÍÞG 9…E\؉�…tâK£ hÄ@‘ÓŸ�QðýW‘¥£*À‘Ab%ã×W¿öÍ&>²±}\šj_캵¸µq&Dªz:•"ý™˜ê”œû®tªfѦ%YO¤5T0Ž5Õ„K'âÎFP ¹J.uùX¯'{o÷¤È&(‚àNÝO‚2‰I,®ÙNw:hž ©Ö‡î4kxº¸<§ÕJþRixäFOd2„H‘:vÝjXtá`ãß¶‘+"ñ÷ïóâW~ö=Ïøá/›ð„×<=±º˜o�ßqûñóxÕ}"ŸÑ4S Õ~‚3H –iOgY�‚‘Záé­¨#ô¨ýLE8z×´»ý] *ÍK–×B-Á(à€2î%w ªˈ'¥ppþ³ö¿2ýÃÙáRtÎæ2µ’\.?rÁJuÔ"jò}òŸGÿ)i󓂆6®½¹FÀX%Û19C”ü«Tæ< Ékg‹B+“âR“rC–´4§5HQ®”e¯Ô&=©‡rÖÚ†3@[+¯ÍÑ*ŽJàëy®&±4Žk\_ËúÇ_þ|ø›áâš�uaûH.·Ïë Ó™„¬÷öMM  ™áe�çøQѪ_DЉìN*¥ 2‘ìn…O¨ IJiÜ3Ñ›1sN½(tTu7˦x+'÷çÞ¸µò sš"B%H-Ô¡‹M½”pÇã¬Zžœ×s^1Årëƒû«Oiý+û±ÿý¤3»¸qtÛ?@€ÈÆ�ºž¡ªV(ýä?‰òáÀS%’º=€nfnˆ*¸dÜï°ÓèÂq(ü^ñ&пI~bö^!%L²ùí+÷:7a£# seœXD =z‘Ó¹ÝÅÔO’údÙ’ c0J'm·D·ì¤a}õ¬^¹l}ºïÂÙdõÏ{èï}þ«ù.þâƒ{Wnd/üÈÓðsßöÒ]ñÚÛX� Ë®èt³IÁ>»;‚gwj–q¥—�P>îp¢ñTSSÔbNaïïÒ` _„jËÃ@èåä%E›­³­ ÍZ—£ØuƵg³M‰Úu÷³95Ó§çUyᒠ䌀Y5Ÿ¨•“V)o4µhENŠ3ìU’�™¦›�N¶ ûxcJѬ¦]È‹Á=ÒEY}ã×õ[M3ù_*"U×u�ŽÛ›g±BM#A$�õ�fÌ¡¬¦¨¾MBÉløÄ?+A¹eã¶,–ÐAÙ9ž*—ô3™�Êm¸Ü'‹†2RÓ)dñv–�å!ÖN§‡Ö×C-]) ù –œä »1T  ª EbœM·»pÞ”íãë°vHV÷=ÿ%¯ùôeOÿþöGþ꧃HX‰íâ>"‹'F^}7„�ƒÓ°.+Ö`Ms¤ïpËX=Í/ÈÚPø´"¿n– ¡Ñ+�¡wƒÓNX®À̤O~{ôž5jïÀ˜Ñ�QFÄû æ>Ú„m}Ìwš¢•f^—ODŽT†.a#>—ƒYÀLˆý@°åBÚnÑáĬÙÙþÙÁ A¼¡^™]³WjÇn9üûkx\»` Ä@µãt¿„�¾bæ.¾Ö:û)e±%qS?¤ÏƒvdP4?RìÍImoBªŠÍÎn¥ :Dy&1‚wA-T®†/äוábŸ"{ͯXœI€=¼FêÒ?þÓ"º³})ûqœ·gu.¥Qö� i‰E…Í#ÁHÇmJd{Óí÷¥™Û“.“ꕦÆL«ô겆ßò�Œ•U¥’Ù¥eu_ˆ…"AY¡FÂ%Œd2JÆ5®¯}Ýï¥ïÅßýÊ÷tkk³Ï4Mõä/*Ä£íö&ÚÅÁz“¨‡¤ÐkÊé‚Dr[–ܘS'å&Ì™¼�ýÙ“ñ\&ý§@&³$‰bOQ4R°àá÷uÑ*I’�2ÓË“•(Õª9E0÷?Š^bÊÔñ¡çÁkFž¢�%ra.9ôPrÚ ˆ¸¸–ÜÚ1½�é>ɵZd¨‚ žÕ‹êŒ³æÕYßÍjòdY.ï’>®™/èÚ­m×|GŒÛ‡3„z�‚&½Q^¡.>"O øY,ÑßF°_à'Ä ÷GkÊa™ëÇ”8ƒ¬PûÇtpO¾Ù¤KùfÎep{– %#¸„ØŸ Á“QÈ‚”àLôåƒtgå–Ù¯]çÞÿ<ôß.ã¶tËyUKutÿì´wÎ&«¯nÂä͵ԇŸ{¿—ŽÍ›â±ÝØ,ìžž7ji ‹š¶Ähk&Axû(µé/J Fvfí>°÷· fòAq…ʼüúîôˆ9(‹¢™~¾Ÿ¸ºDË)¤ƒ¯ó ý <´Àˆ1Àb�¯‘°§ñP$Ã{úô)3Úw,yZ `é…ì…¸}[?CSð²°èwîURÚ4#iŠWi•.“â P[+wY”e�>Š©ŸeA�I@ÿ—W2£Æ5®ë±Þõ´ï¢ˆÈeÏzÀâ>Ç^ü‡ožv]Ü¿l—í¸�  ªk2‰ Ê6Qïu¯ýQ OOøÑÛe¨Ñ¾øž:çÆL£ü˜= ü<Ö�F�‰!÷Šh¦r  0ÿ$:RiYš¨�rP¤Rˆ‚¨.Eˆ½{ D¡ÔÅ+wE·ÏAŒ½êA*骕вº-—òÈI}ò3�þãN>yFì®{LŒ'ï/_äm ô,'[ê‘¥d{…sËmý2ød“ºŒ¥hù�¡Ëƒ1T[ÔÒžN†"ÒL¼ÝEúw^)ÈPÕ C‚9¬‚‚@Ä(�tqYuÝ’µL®™…Õ÷­Íö_8mVÞþ¢‡ýÁç¾Öïáó.}zø…½d4¼WÇ÷wWþ3G ,Y8ˆ�ÚYY Âþ¥˜÷û/,¦’EÉà±);˜÷ h¡`.9n’a¨ìŽ—ãånÚfØd¶>ÆNwƵW7.gV�äo ")=4€  éI®E¦?÷«ÊÈ V)yz§ÌÈ<Ècrø§ã_&W¿`Tt‚ÎUà“TTl E–‹öÔ^ÙkNQt†ª¹ËK…ºªD02£Æ5®d=ïVàƒëò+Ž?v"JDÛÍÕm.o1[ݪIMBLjèÌrtœÌQÒ(8¨K²ˆ&dç|zf$MèÝ»ùÛØ¶OXÏâɤÁfö÷ƒ¬³8ÆÚP:É@:‚óIdr�\ˆ”ÒòT‚h‰ôPlú�hŽ=aÝ$œ$+WÖ~<”~!H$.9m¶çÍ9Û�èâò[(Û)W߃Ø>a¤Z‘FbŒ€{¿q¡@X¡¥Öa8éh›Mñ ~xÞnE\¶�ÎçÓ4¬Ð±2¸7-ß&ÀTóùü¥tÙ IDAToL£º!ò¬S±ê ×p§ÿþ„î᜜ MjÊ$Nea¸  &£Ï™nÏÑHWtAÀ¶ÛFÛλ*†ã«õ�ËÖ'/åõ2áõ£ý�Vß7úŠ#�zBÐJãâK2.l ˆ¢#2ŸIUœ« ,0>Õ}ÔAÈLôÓp_$(jS•…b¦!ÌX¬¶«ý†�¾Â6Àl¨¥µ†eCsfFõÊ?ŽoÁžÞ¹h§èT�h†&É5„J²tSŽ|øOlMC¡ðUrùêÝ—Õ”Úîe{d:0éÈýŒèã­bªop³$@‰ºÆ¿t-ª3ëVÞpßÏk¶³¤¡ç[Ea„Ã}Ç5®ë½îÿ²÷BDä’§Üc>[™}rÒÔ¯¨!¯ ±;2ß8)óÍÍ@Æ~' "D4Ke#Þ ' ôÎùBˆ,Pa‰À ËåêÊ¢mï>_œxdÛ}ñU8yN]OB¨ö ¥ÎòÐÑïU Ü<\#‹zïR«¼”#I( õ½¶t„HÏ)}’@6Á†›³±×�!'×X@ÞŸh1�¹]ΚûÜ Sá…‹mð—{k^ùÂÈZŠ˜M>YX¤cÞQ�å­T¡‘E»Úż®ºúȾæ´KgÍê_LÂäM™~у^q½:ô £–íÆ^©A×MýÔ/ʃwƒr87–ôË Ù0†ïÑ¥½"÷½Ð‚äÆíêìŸZZõh¥¹ªf6ËjSz¨KÛJµ;ö%¨Óš]mÍS@H ¤êï–emôiÙZÑi16aöò{» fY¦cH¦ÙX.D(œÿfÚ:•ã�±ëþÍ9ªLÊsú¥`tf�v…ÊÄx÷@_ÐÀiÓ°AÕäiîoä‰%T#/j\㺡×igž±}‡;Ëåyïec»º\ΉÛJUI5�¡—ÿ�nV+�傪?(7îfš³&z”Ìü!Çû/"KÁ’þégÝ„2* \Rž³¯k";Ýþ™üÈœF¢7ëBq6…Ã?®ÈYqyQ…_Êᓜ�E"Ñ.¦²=oB¬Î>íØ‡|Iêê¸ !«ìbcã/õO¤äÓð 1…òÏ—sW|Z�R£!ÅÏ�Y„PLÐ_~ª¥Ý¶«î…)ÛxlîÓpzº~£ ¾¥ƒ„�iìóͻޤô³B…Ò¶‹Ð¶Û±–æÚYµúþõfß…+“Õ·?ÿáÿãó7Äwîçø’n¬<760¾»âcrfЄ÷ó<…°*õÄ€0•ð²Ï�‚�ÄÌ» àçà>xE½lŠ”(Q^2&šS!. ß¾œêIÄKÐÜ>a³²1îj/¯‘°§+"ixi€å“õ̢؈r IýT(RP`T¬§E�Ø#^jjÛì½b¶ÛÙñ iHXT_õÑ&º^ÙY‹i§¼'ÉVZXÓÄ¡©Æº8®q]ßõΧö^xÙe8~ô˜|ñ3Ÿ�§�yúåÓIó[uÞ ¶_l·7;Y.¤Šƒ„<Ï—"e$€eh—N¢µÍó6¬vCøü�wÓ Ï<ºÎÅ'Ñ&³ê�Æ]w�#Å�èm†¤£y1 ”ÅÖ1Ä8šyZí2å]etR-Ð0ëz#XE 9yrEbK9÷ô«åÖ·þ4oqÖ'8™†(Xgä$ÕÅèé¡ #†•±yÒGȪѡyèÁxÉ$±ŸU8ª¨ñlúi�^B¿É 0 %”Å%n;)‘h”éµ=G#ùôø·Î×@~âÑqä+ÃZt)ƒSǹÆ=]•„P±m²˜oĉµÉþˬ�ñZTÕ›g1|á†úþ=çÒÿ4öx7v1¾Ç»§AæØ§®Ï±ˆ2E5ªoéߎŒ>ÙyŒ"‘˜·+éT¿ú œ»R­bùÕDñê‚2°¯3NLàÜS%û¬F¢8'Rëz3ŽŽ‰ft\{u� €½ôÅ!(ã ejŸ‹q#.çøï½­`ímŠY2^J"¦�.q‚þTÉ’ 8”ö»A ”€Kߟõ(A"†ŠøhpÀ+„¡þ4})(”ØŠptG׸n°õާžï�Ž_pé'—Ëöwˆê˜€Oè¶·J¤„é U> :¿$øsçÐÞ/' 3µu̺~3(�•$�¢ûPAÂÙ)ÛÝí¤‡�/\_ëh!ÓÑÙAç¬*ÆBH�Lbï°ÌÔèEjb©$3Ù©^4?,-l Ažˆ)&Xn¯ÊÖ‰}²½ly—Û|Vîx§wËê¾÷JÛm@¶o!äTb¤�(-ÿÎ1‘jŒÂäª/E(¡ØD�" ÙðEƒ �€3-pr1ªbK’Û¿dA*ÐBmj]˜bv~É©,]f 4I˜ƒ^.fÁ¨¤ )žÊ1Ø/rö…vAG ÎW1DX…šá|¹%‹ùfUK}ôÀêiïŸ6«ÙÔ“·pø—ú{7XSþ_ô›»’žþ‚+žŠgßýe»âpÁj¬ð»`uEb§ˆÛèá׬Íe0�Åà�õàr\“8ËY]+!Ž9¦¾~Pk?¨` 7½ê.›rACWï••_%�fgn#jlSô¼€�Ù¿†#0ãÚ“‹ÃÞÍyQÛ¸Í9?Y;¥yÎuˆ[:ïR)<®ÍÙIb5¬[cP˜<‹Ò|ƒVƱ?‘s¿œ…"žœP Ç5®qÝHëoŸý mùÀ]ímÓ®�‡bÛ>”‹ù­êPÅÐLDB côêw×Wõ€¢Z(Òi¬‘½žM9oœÏ’�ïê�™žÂ‰ž€NŸ!@jO&¢âÑœ½lV†šçÌ ½‹4œ¦)=piB]@°C`ÄýMH~Æ®–å|[[©«9¿õÜÏËíλBN;ýb™/?#óùm¥ë¦ˆ ^)áRñ® ‰PLÚË=¥è²MÿÅb‡(s\œÍðÇÓ„öR”þä=(ç¾»ø†—�Ãd†—C~¹ðÚ0Äü”¯«x(î–‚Þí_²í˜/¶ØH}íj½þ�õéþ×̦«—<ï!¿ûÙ±2ôk·þŸöúïGèç®ãºé÷»¥BËúC`(*ÂI\'YĬ”Ý' =y*ßÞeÑ�öøåƒ`:ék�”{ŽâŠÙñu§Ç§‹Æ±ÿvnúw'ds¼vG`\{uE'{tFRâ Œ�s¾_6—¢k•©û‘A‡ÂÓÝŽø™… ‡ Hz“bN>@"`ñör�¼æû'v• ¥¼ÞS !™ú[W»JÚÅŒÇ÷ɤޒۜû ÞñŽï–C‡Þ.]w'�ŸË“›ë¡Af<…=ÝÐk÷¡èŒsè¡‘0ù%}#q»Aaöâ³™ € D :,õmÈÄ (zC˜Ç?ìÓ¦9ÐKd-{ÖcKšÌˆ¼“ËèÊF4°†ÜÆ)·ŒÇM¬cpÙαXlGéäÄúìÀåÖ^àµU3ùÒX l½àƒO®Ÿ}·ßnoê¯ó¥�| Ÿ÷Î'Ùfá—.yBÐÁ1D ‰¿ô€?^_o,¦TYõàxa…Þ_IË4Sd¥˜NÝé{P®9+9 <ÙŒ *ó:*Æ�™]ƒ<ÔTâB. ùEÐøV‡AÓ粊�‘Âv¼2öîµK#*꺿ÜweA(Aý÷ E£˜è–IøDÓWÙ˜D2ÚWy¨úJçLøc·Š¬²>ßX=:`ê©^±šË7\Â5x@}O3ÕÊzC(Au†„Ú¥ �ëë±~õÓÄt¶RÕÍdÒL¦ÍÊÚjµ¶¶ö8€g¿ÔcÜ\×[ŸøíÛ+++Ÿh&õW2ÆcËÅÚÅ6„‘A€ p1"y<‹\¨D9™é,F¼¸)™1›.HÝN ãg$Gùnׇfz¿ªÔ û§ÐŒï‘µ—¹ºdJ©Æìh§åaHë7ó{+Ô�ÿ!|gC €�Œ�,櫲±±*arR¾ùÖŸÀ]îðNìÛ÷n,–Wáºc¸¹¹Š® $Sþ‰ö%gê|rB—„À2ùB†ÜkÁˆDÈt²\ª©ù0êÇ�?*óÔ`µÆÖlÙÆÍ/9豈Q„‘Õ,G"¥èvE²µ·þL÷üñ(@œ®…†àäé$�ó+b�rÙnÉr±jâÈÁÙ¡wÎ&+>©'¯oªúšçÜÿÆ™xÿÚ%OÝ•µqw8ë?ãõßçOR¬ßýÈMUO¡€p¨B8B8½©êÕ?ú‡ÿ:öÞ_ïk ™ðßǀТr+«®%¹¾é7½ÜßçfeO�à­B4 ÆÙÃ09�(RíÏñ…%ŸSû§úãâª_@d+œ˜v6QK�„d'¹˜&–h€‹�¦2&Xìé52öôáv*fá®Ä,‹tó ëÀW6SOõŒU–d)/ãÏ}²idw¢´¹ƒ²»é´�Î Û—).ʳeá#¥ P&RÁ@Bœ/âÜëþâÊõ�“'Ï>¹yòœíííCóåbÖ.»úÏÿðâd ‰UŒQºˆªšu¼ü£‹wþ•·vM]oMgÍuÓi}xeZ^_]9v‡o>oãE÷\7±]¼ÞýŒ{nþÐŽ\ö±Ë>„%Ûiìæ‹loË®•ÉlE*éb'M2—uŸ³&n¦+êölGq¯²£š8˜qø(JNà‰äÐÑ·+x]H\KOí÷ŠÓòOÂpÞSÚ�ÚMÓ?‘ØNŒÛЋŻ¶’ÓgÇxë[~ gŸ}…LWß.óÅuÜܾ¥ll®Kׂ"•Hg1ö³Oª7×Ï#v×LïŒ4”p±ôª¯_Ù�ŸêÜDEÞçÑ_°>¿nmky²îØ…¿ùè몦jf“f¶ŠÌæâ]lί|ïæc^ùmÝÊd­[�ì_®N÷Ÿ\›¬_»:]ÿü¿óW=xzÁ¸§ÝÐý.¢&˜ö3¶+þW4ÏP8BÙ)yúzO8$Ô«šàÛ^ÛJlsqÖê•IÇt£ŽÆfá(… WßÀbXž–¦pkÓ�‰ñ 8ãÚ£˜hP·Ð„t�£#/‰O@ÙôÀk¦òÏiЦçØZ{X˜ *©·LO#\i±‹b"ƒlèE¸C—0ÄôÄ�–«\Rz¾yC \,�8î¿×ÿ°ÿi´Ëeuôð‘ÙÖæÖJŒíìÚ/]}ž„ð�í²»Wåd8]ÀÁªOú¦D ý¸ ¡?ÙôN`EŽÄÈO-—íß³ë>¾¹±}宺ö‹÷zá»NL'“­•ÕÙ|¶2[´-»‹Ÿp§ÁÙEëºkwû÷í¿ìØÉ#×´Ýírþ½q±}ƤB&3!b`Šdê}êÔ¬ðù¢No_ à „¹"dL#öc*¤ÙÓûƒ…äÔ¾òŒœ•‡ÑÙž À*{¢¸R ¹¥>ÄŽ‡9‡˜Òqó!9¸¾Ÿ G-•$ÛÍF¶·§<}ßqžwîÇp›Û½‹Íìo娉ˆ­­[²[®S¤êåŸd:mѨ:*Ð õ‚�Òõ‰òo–÷p.׿Àh‡õ΀¤|�üΧQ¾ÒeQXÅZ´ƒ&ΈWè{«z�¤ _°.Ÿ…W­bäqóìL‚½‚lëò3.Øs‘Qºv)m»è¤“͕ɾ+öM÷½‚×Og+W�ßü/Ó˜ò¦Pþ‚÷? Ÿ½ö³Íæâäêñù5“}Íû>qÕÇoY×õ·Ï—ÛwZÆåÝ)ñ,™U UC'm˜Ç­ )â4J”«ªbB¤�Ò�lãâ‹[ËÍ�-Úù{ÿô�/¹ì‡ÿênG÷MÏh®ž¾y`íàâÎÿݱ!¹Þ RL3ú.dah&Iü˜zˆ>VTó< õZ'C£×�–›“ Xø P=bUÔ•ö2Џª7 „“¤k&eUB/ñïóMŒ‰ÕÕ‚¦$Wœ:Æ0¯Œ×Þ<þW‚(�Z^úa‡ÑÓzJ% ÐÕå^ ‘Hï£êîïúZGÐ/šL‡‘Ò^²´WÍ-´~n`1 lQDv¥Á?ŠphfÕiŒëú­•õõ°qìøY"rO ï»\¶·>|äº[ TgDòLû$TSTMUïWž€î„Œ;ÿ³H‰äéóEwöÖvwç»c‘ñ8ÇW&“/N&òO¹<o¦Í5"2jÛvÑzý¿»#Edy�½ùÓÛ[ø½ØvÇÈîñÛ›ÇO¯ÙI=[#()#Î…‘²˜‡‹Kí+¦²Ô™ˆÓãÃOº C:ó¢÷“ÈA޲3À³ìÇ0¾Oƒy¥PŠâä¨ãV }bN9u(‡3cͽ_Œ·¶×eqbE¸Znw»¿ÃmÏ{‡„úƒ²±±�Íͳ¤]®öséRÓš­ê½¥”ž~‡”« <€Ž5Fï¸�Š­z_Ãó"ÂÁÞcSwHA?pRæ)_Y†Ò–ÅH{ïL›Ýíá_oî²-x�Yó�rÁ2� ™pt5d¢¿LúÃÿ2.¥íæ¡Bu|}åЇ¦ÕìÕu˜¼IÈkŸó€—� å—;¬á¦—O>�LwÁCê»ÙúÜ-o|a_¦‡$à€H<=™Mšªj")ý•HS"¥ )��]ŒœsãŒíùÆYìâm—÷.¿4«W¯‘ÿÈ[«ªú¸ˆ¯Šë·ØQëPN�‚ òmFU8{ö�¯Ö�Þ¦Êt¨9TÔ�¾ba)JùÒŽ8?ªÓ�hq*UzÔ×pWØy?£¶ú*¼c ¢ùÇ $Í�kƵç*¢_•”|ª_Ÿ�ðœ)roó�Ê$�|@÷ƒ’üSxLC—-XÀ–XÙÚéíÒ¬Q§é¢`Mœ :UÏÂÍ¿�cgöµ¯ÿç5_˜}öŸþéö÷�|+»î<†ú Õ=c¨Ï‰‚© † ‚@„À^#îž´liw‹„�“ÈxzD8#†ª—¯QºE'GdsûÓ[[ó;ɵG?Á(Ÿ½ßo¼ïSkûÖ¯|ãOÞyœ²í¢uù³:‘Üå¿]Ô´´íÖÃã¶Ü†l&S"‘Nãäè•9¯Ï•¤ @l.ÃòûŠY� κ™{¤LéñÜôEOýæ!Ç}¿ä2co³À’ï“ùªæù4>JÏ’¤V ƒÐu ç‹FºØÉÁƒ×Ênÿ1Üâ–ï”jöÙ8YɉgK»\IMeÌ�föu-ª`f$�ÀΟ™zSxpj‘e ‚#QèñYz‹”j¦éÇi-v‰üªI}&¡gä:ÏíÂÀÑ…Ùdë�sùN‘‘æ¨ »dP^ ½ƒ#Ùõ´ÿvÎZªc³jõÃ+³õ×LšÙ[ã{þøŸÇoú¿ÖšÜ4Î%]\^ù®?<ëøüè]>|åûn9ïæwŠÂûuÒÞ!œ@¢„ª–jÖ¡bSÕ ¡f@2å4'¡‡„‚À(!vÒÆ¶jãr_d»_¤»M… Qº“[‹�Ol-ægéØÕÿç§þæ?cí¬�}ßý¾ÿð=ëÇŽíÉ×´\š'¤ŒWqÅRÚŪ«‰På`êaü‡ïi +˜ƒÞº�‰åêy°îÙËûÇjŸ—¯9”|åÔPš1ïzƵgwYƒ›žä&×$’Z.rls¶M27æòæ³¶`ŠZÂÍÔ�üJàwyXX”{@ ÿÉrË‚Z}"k&@Œ:@—&h-.‘h-*•ÆT�#.úÕ¯{½è�Ó 8ø…+¯¼Õb±¸ íºØÞšŸË×ê•Õ&4ÓªªëˆPG UHÄéhçË5#õRé?¡  I!1Jì:,—‹Óæ‹åH¼s Y4Uõ¥eÛ^ºqòä[ÏÑ»?PMšÃ³µµ­·ý‡»,ÇOiw¬³Ï>ëŠÃ×>¾½½]µ‹­ ¶Ûîô°ÿ@¨&+‚²}¡½„V#z0T)’ã ÀœŸ½<Ó’—èMŸó ¥h—’÷¿d“Säú3l-�3£�ºîl�Ûµ˜ˆ äSDïÙ§)Bt]-óíÚ–<¸v•Üêœ�ʭλ Ó•+äèñ™lž8“ÝrÆZÑ&æÉE¤ŽT P±›ÓWdHZH˜H2ÏÎÈ]_ž )  f�þÒ±ªÙ›ð+>SÈø©/0Uó¿iŒ�æ=ܳ�´>uA�ÍI€EÓ\6ž¦àv£ —íR–í<‚ÝæÚäàG×§^'ÄkØÈUã·û__¡©¾¡Ïÿ³oùáš‘û_ñ–ß9´ˆ[÷l9ÿÑE7¿ë¼;y("Nêz:YcSOc]OY‡:«‡�Ù¼˜ÂÄg`r§ŒæpŒ ëzBaŒc\Šp.í²]ÙZn~kÛuß4«×Ž"à}G7�üÉ+ßög~Æð0[¿ñðW�Důê¢ê}bÓÇav°î8�uA:ûrP¢ ¯6?”ã¬PnA9›Ô˜¯zOcÀŠœ!FXÀ6HGÐÍÁŠnúsèç–É$¦w5MÖ‚Ì&¯c—q�À¸öê<¨“Ç¿�”SU¤ïO­i¤µ;ºkËàüt$Q“ÍæN^ò‡ÎX©ÿ ®éFqëÛspU.ÉÚÏi”6,F°�™Kvoê”U¨]ôÔ¸¾ÒU…p—åbqÁÑãÇïÖFÞ¹ª'·iÖÎB3ꆂžÈܾÔ×…�÷ûbôÈyL€^?¨‚4U`ÝÔ`×5]·œtm»Ö¶Ýêüäæj]ÉÝ&Mý�³Is±ûÈ?»ò3¯ÿ‘Û�;Þ.Xo}Ò½÷ûõ·|ª].‡±;*qþc›ÇŽž^¯tœ¬î�!„@F%]ªs�ú’³^zQ´�ì@ 4½)™A+@й ø Sõ�÷vƒFët£qu–*`I#'x÷h&­ö9Ñû\�+DDé–�loî—íù Ï8ãS¸ý¹”sϼLšæcØÚ¢l�<(ݲ¡ Š„Øëk1T3òÊi,£ÅOÃDϺÙËJùw„qMïœ�ý‰�W«vÞ0ÝFÆS¨Ž2„Ê P¾ÿÿŒšài±4`!Ñ)¢gµ%ˬ¬´HîÞ:´Íy_9†¶Ø¡›T•PˆE·)‹åV¨®Û79íC³zåÕu˜¼)_úïü£±þ|ëYßö’oèûÎmeù¸ë¶¯½Ç‰ÅÑo–ï€JV“I5 �Ôa„$PHFŸ,\Öó_KíNJ¶è‰ãù X…Z„Âj2A]wÍ¢]4Ën¾ºØÞ¾ÿq9r‹}ÓÓÞpvú¥U¨Þ."'Æ+å«YîÈÏ2,ÆÄGH½¡gsf G â<§´Fe<Í©÷Ðf‘v áÀD6ß!j’øŽ÷�vøðÑ»�8~òá<”ÕäŽUVêéJ¬¦«U“¯,a¯å©“BóÄeηqy9ô“G(Õ9ŒM*A"¡–®ê&íÿeï=£l»ª3Ñù­½Ï>çTÕ ÒÕÕE!06Ï8…0 ðC؃q~£ w;t·c¿×ÏÝ=üèö#ÙlL·Ñ"5I ÀFØIˆ`L”o¨pÒÞ{}ïÇ^k͹v]Úî1üÚµ—†[·nÕ©:k¯5ç7¿Ð¬.$Û ¥n/k·v.‹ FÕèÆGüþõ7þõÏ>äÄðÎíýuÝ/?f!"×Óo^]¬êöàj¹x¼—â‚bTµE5&DÚÀ…§áˆaiÆÆ’*a•µa¥­à‘2B²Ã0lÞŽ¢D5BIÊpª©œå¢+q ’óщŒƒ&ÑyýIû¤ëfˆ`[Êb~@¼wrö™·É=/ú{9û¬ÈxôQÌN¶fǤY­u/µh®†ÂÀ²bì£Â±¹K뎞ý5Ía‰˜}�O2ûQ2—EiÉ ¨Ÿw:ÚU6&["÷?‡Ù‡óð,{ObÌh@C4PLI¿?±ë;Ð4Ž"�Ö¯P·s)¥ØœkY«\=)'×ü—+ÿëÍý·×Ÿ|îùîæ¯~úÈWN|ñ¾wnÞþyâ¬Ù~@‹å!ç •ŽŠ±/])eÂŽ"iuÞ¢œ£ÞÓƒ]ŠÃ€jGGx qNÄ…GQÀÕµ[Éê˜g{ö¢Ý9ïÄÜŸãÑûÑ7>ìÝú¤ë†}õ�­vEÓ§€ü1ÎãXŒ—Ÿñ»‚í6 ØuÆÄ“Ê™,Ä$™Œd¾«†ù�€)DkØÀ“ÀE™é Eº‘[¦Ø»åÀaí<ÔgÇVG�2¢+bp6©J(/Ë•–J˜aàOÃÞ4× B™¡¬2y4\® ˆ Ò• ˆ•>•û Zä l—¥ƒ€Jê@#97J\‡ƒñ\�{É�ÅG®ûÐY³ÙâÛ)øÙºöß!®Xpž~ IDAT¯¦ÊÑdâ]YùÆ‹ké!Þgnabí%ŒÅºšÔ;À,RÉ»5áM —“j\ á¤iji— Y®æ²Z=vÜ–v®¸~Þ.ÿè;Ÿû¾÷8thûЙGš×>åœìÙãëØ¹Ç>|ûmw?¯ñ« ¥yB½Ø>„(FÁ $vP„†-„ÀM,Ó‘«¥�ˆˆ¸0mÏ2ݬ-^´ˆ�Sü›¾TI¬…J÷ˆU~þ¢ŒÊ 4HŒ]s œx²qµXG»ªpäŒÛäü‹ÿ çž{ƒŒËÏÈöÖˆ[ÛgÉjµ&\ž*—ˆ^½?ô}üò®E="{�ÙoÜe¤B6iØygIŠ3HÃ4I?«¡ôÛŒ¬ø¿›@"ÈÌøbLkUÌ‘>ÀtÜ îØ ò"Å!ãðö›$6à(¤iWÒ4K_vT‡?¶>:ôf@®v®hÿÿ“ëÿùè/â_?èwÿ—œÍ¿xÍÓAñÓ�Üü¡{´¾}PÓÖÏX4³+æõæºm1OšéhÃáNòÞ£sp‹Tä‘HgJÜ#f¹¤ÝVu†!¨5a“yßQ‰JŒXŽ+©FS¿¨ç²ªÖÍâU1ù‡âÀ3^ý]JÊÉW<íoÛa×üƒìÌ?ÃuÕµ:&C¥{®'ÂrÏé¤B a°RuûëkQ“ú:Ï?ÚÈÙT +6 /BǨ°—S˜~‘>mÂî DM«9ýñ5A×a À°ö"êCV±æ—‚²Û8¿³8 G�óZ—‰kC¬¤×ßÅÙMžmM‚ɪ7Ó²] ÙZ×§9rAM(ZdÒˆI�ÒVÑÛ®ïïFþ�Ò ø}×–aåë{_þñ¢©›ÃÇï>þ¸eã‚®ú–ÑÚúáÑxì¥(…ÎIKºÐS]°bʺM›½E¦ è2ÆôÀn�D î",ªr$­+ØŽ*ñËÅ´i›swvV+À3FeñºƒÀ늲¸M†´€=¿Þù3]}ÇsßusÛnþAKwœ¾}F»\œ)в¢sïU#¯¡¡Œ¥8LÕ–bæ#éhüÜ­þ;u°Lf(Ф.62ÀŽ;rUÈZéL,ÈCU tI6%ÎN M3Ál¶!~QñÜc·È…߀£çþ­8~YvvF²3_“¶w¾ãމÌ5 Ñ˜»Ô]&Ž•ÙÄ,FXN‚Á¬ÍMf`T0Á¼¤ä=9l �˜&:+åq‡—€$N3J‹d=‹äccjl0×gÈTÆkÁn£ËegÖkÖYÙ¶ Y.gÎ[‡×�|l\N_9rÕÛwÇs÷²á2ùŸ\ÿ«š‘ÒUEËú‘³ÕæNÌïþ¦º™_&ŽgN¦••/ŠŠ…C7%¡¢I#ZdNŸ„`Å )Þ’yÒ{Òþ$Þ7“1‘88L«5?*GEÓ¬Ö|Ý\@ïR‘‹Èíîù‡+ÞÔ‚£ËUa]à¢Ï¾�=Ñ“*%F›wE¿¢Ê’`ù± ("ÝÆÖ”)§ì„�i“°1gÜ� +#ÐvåU8Å·*Æ27L�/!^,Àaí×ó0G7Ó¬_l+e*¸-FŠ™ùBeM;zéOÌ‚ÅØ[KÏÙTÿE,Ü‘’WM—þ[HÆû7þΉ�k­¤d´®î3ünšé°òuâίžÏæ�k|ñ4ÕÃG“µr4ž´®ÑSà½G ßÒà3–«FµnTqFÍk$Æ]³B5çe¶Q½�88HQ„s$\ÛÔµkëú¨÷õ#X×Õ]w܆ålëÚ§¿þË7¿òÉç͇wto¯üÊ£ÿêÓüÀ»^ñvÔ�_këú±ÞãBT¢ œ Uku˜ÒsQ6VÈË«å”Ì{g˜¶Ã½É¹ªúm”‰=™ììÜH˜c—’M„L³ 8G�8¶õXfó)è)ÇŽ~E.¼è9rôZ)‹[e±=•Ùö®êª{C~´ù†¤iïSÓ’^»áÀöÉ6H1™»æD�ôQôx­¹ì ¦½— û4ªÔ€ô½ÿ�xÖ.ét°½ÿéŽñ˜Æü“réBücÆ΄ p�‘bÓ®¤®çâ(Ûãbüwk£�«§ãÉ5¿ó˜—nxr÷özæÛ}æñå—ζü�U»zT-ó{HÉQUT¾O¤ÀH ®KUgÈmsöX€¤Q¯h »­Žèú‰ÄÒ\ B¤Žã4Ê+ 9çY¾æƒ„,Æ£Ñ�Ï|ó£ÞòÒ'¾çóÃ;ú,3™ì³�ÁÌþz*ެ�Õ¼iôßÝ”ë a�¶â ViÎ;À ±õÑ ã2';¼äЪ%\¦š´&jÄÄÁHr†µO&Ä1«Œ-ŠÉ@pS­+lŠžE¢g’�8 Ð¥w™9Qå &%�=îUª)i°5Ù»gÐ÷Þ‘dÈÏýáÔ“+\ÞË�Žò5Ö•ô1̶w6¶NÝý Å²þ�:šn¸jm­礮ÛN¢ �U¾ÑÂ-]¾6M½žr"3áÒБVB3xUeÂÈÑõ‚¦»ᜠɨ(åÈ7‹YÕ‹‡ø¶=«,ŠÉ�_¹ímW¼èÆ› )f×<û›‡Ëp¯ÿ÷>ð�yÑo<~bkk¶\V¾^>�ÞŸ�ÉÔ¹QEç| ­ÝÂÀ¦óA¦Éšƒ"�™c?3Ê€qæ³@fr‚¦É_Jsc%¶[ÄKYK"€7X²æ•�|¾Äô›vÂÅb]š•È9gÞŠ ïõn9z�ëY·ÉÖ© Ô³ ›z$Â"ag‘`ÂéÔ‘‰ëN��2âUmÛM ”BröŠÈ ë…Ø¯Ëbü·€Ó‚ÐYjcGîb6ªWÙ3ˆ&ZáIqÑjM6îÆ{L/ 9½×ê�Á€LqDä5)õ\±içÒ4ÍâÀøÐ'7ÆÞJú×X[ÿÊðÄîÝõ£¯}8ØÈdµj¾ƒà/Íê­o®}=­ªR&åZ3rUGñ÷"OIâ"LjU9”Øka¯3ÄLâh„låßaæ¯Ñ7f¶‘æÂâۇ•t“‰_aEßø{QÚ_¨[q?õÖÇü9à6_úøk9Àÿ ù׺²c&uÁŒ&`š6Ý)ƯcnA“8I,ØäkmD¨¥ª±¤�6Í™»ôÞV’èi±"„£0œLê°B"(¢Bm«´X:¥›K@¯'†€}½È}¼¼0ÆK‡˜eI*HwXD“™’¡3©"“¢†Ðád  gD™§Ôú˜â˜ü¡‰#�JsR„^—Ýh3ýRr”N…øÿ’'¡�›K£ ç\ë[pº5žLÝÉ'¾ªå9žãovŤ*«ŠÞSÚºÕ€‡ø¾im®y‘¸õÒÔ‰‘–(zLÌ�äÅ–T*3¢Þ¤´ó>ˆOï)ôÝÞ) Èh<WNFuƒ 6·f?rü®ã?Nï¿Õ•îÀðîîýõÎgûbm:ùì¨(^ ð/|[o¯–3W¯ßÒÁ…„�hæé²¹¨“˜P%Eúz8 ôä@´�7ʆÙKqIUЩq…˜Sš’ )Mb¶s®¾ *™.3"]µ `7ù¯d¾3E½p8ïì›qñÅï“sÏþ À[1ßI³œt2ñá{™P ªKŸÄo”¸É yDÅX”úÛŠ"+ûrão”Ù5 ÂX+S%§‡–^)âÃM‘Z¤ðsÇÀ�ô�Ó�Î'".üb©_3^NÆ{=½³ 9°²øì~ùHFa]Ü¢~g/á@ Ù´K©W‹^&‡>S�Ư,ËòÕ^äößøî …õ^}JWâ{—«ÕOo­6è]½1�Œ±^­KáFâÕº AWäAÌrØ™þ?ž^k*ö`è! &ÃOo¢%â4–)ž8’u¼H¼Êàî…�&è\Q@œŒw–Û®šÕÓDäÇ)Ò¹µºî&0%Šj[Ťoƒ6·0Æ'KîtHvi> å:¥a_ìã50ö;(kÁè·—»QÛÓÚ•HÎûÏ\“Ó¿°Ö%¹O–©Åx+F…Üq9ê¢ÔUz× Šiæ%ØEÿíþ™Ï™ ÝwÉæ1f�FíZü÷o[¿ù–›¿µ|Q\Žª:€Ñ¤¸`Š”Lh‘h%Ñ3,”þiôstÔ'gwáŒõ-\xÞ§äèÙïbQ|Ivfk2Ÿ¯‰øŠdç¡â˜¹Ö+ZâèZÝü²“[Ç™­Tt¢¦’EÅš_BŸIÁ~>L6Y³E¬â" �žw$bÀfxíþUCNëÞb‰ý6²0MÖhN-¨)iò=P~‡ˆ§gÓÖhV )ˆSÕhòw“ñô­e9zË ®|Åg†'tï®%ï¿zË¿8çÔâŽG¬šú‡ZiÉU1–q9'#ç}׈;ì’Åxæ“Éíô4@iD‘Ý£^s}qú—žñ Óç*h€CAç<½“Ò»öÁ-—õ˜Õ~á­W¾ïùW¾õŽáÝî¦yÞeášœVFÄ^ÚT«Æ[ư ñ#{SC ŸQŽ%Û*1Ìsí>Jã 7i·´¯›™ó?„ ™NÂ(>üàk¿cbÃÚ¿"¤Ë›q‚`Ó†0Jdm™Ni(¦•–Ë dæNYCG!<Ôù F& u™™º§QP÷Qß&x–¸ XðV%ÿ–‚Áຠ-‰?Yä"¸ôšé½s.Øý +;,\q¬iý�´pWúr¼î¦�r$­ÇΟÌQè(>Nåá)ôâ¥û˜�[ËXk©é Æ8% ]øÔt .ÐÞR$%&.ás%¸ÂG}Ž´Ý(+7Z;àÜd�+).ÙZ,Ÿ²XÕϨçó‡~× o8ã¿ãp.îñõ›Àéxò¡µIùŸ'¼ÓùÕ�íΖg='�ðpÒ¢3ôˆ:¦¸yÇÚš1¾¦$ë>Gã �h5—…F1ÅœÀ‡àÆi¿$‹À®å'ćïÒ�‡ZŠ4©Ii)R¨ WC¤z/\AšE)‡F 9ÿ_”cgÝÌÉøó²½Sp>[c[WômA²$YÒÑÁy‡‚ÎÂ;_­#Âã�8_”@yós'"ÊeEð;�ÝDçÂDO£#£ý%EvOԳƹUøouì¬YˆAX.в-²› .$‹"R»,Ò£‰‡qæ†h!’ ãxÚ8Ý3¢‘¢{ $¥ik©W˶]ùíÊM?ºV¼Þ½œ•|jx2÷îú­÷üÔè×ÞñKÇæõì{Zú_¯ýòq^Ú�µÑLŠ5ˆ/˶•Âw�|G’ '¶òÉÍ‘ÔÈ®® Oã˜ê§†5"tâƒÎ0�j¢ýhàžàµ€ëîUŠ “ÿÀÎÀBà ®ÂtºAŒdÒøÅe­oŸÖøæÁ¿ò®§ ýÓà€ê{×/>’‹zb²ˆºƒE‰BZŽ2†FYϨ ™û›ÂTú1>¢ƒlãüßÀÍ‘«Ô\$7B{UI ßJ…sôC>Pb}ë½Ð �"¯`Xû³ÿQ̱�ÿ…”;¨sK|JÆŒJ×4æR½e&:ª½?u<ä)‰Oe8œñÔkVè£SV|¡ê˜”´Zx«´¡³‚Æ„.jSCÏê)p’ÖÃ’'ýÙÍ&Õäâ¦ñ—yºcM7r�Vxç<=IOíË}Ô—Ør<°)uP|¤fÇÏè"˜ƒ;YµS‘øÂÝ–óÈ--ŒoN¨žDçàFÕ£ÉZ)euöl6¿|gsó©Bÿ=ÎÞñ½¿nøõGÕMo©ÊâG#÷Šj‚Ífµƒz9 æÌN’“|2£¤õ/1¾$Ôôå4õ ®_ဉ­/Ÿ w³©Ôt‘£žèôi,¯hà‹¦Ã‹Î×­“ííCròÄÙ2ZÛæ¥÷ý¸¿ï}ßͲüˆìl�d1?ßLb‚ ‘D8éL‹… a¥ ©Z„ñÁòЃ±ç‚egô`d¬Šu4È™ÀÛh >êÓqÅþ]ëÃï"Ò§:Üa–Àa” ö‹«AОAQ ¯?† ðJìÙHuS/)¶¾a½Z8xìŸñáI±þŠÒ•¯ÕÕmpÅ«Ôx�®ÿú‰_RÚ£·ï|ñ‡·V'Ÿ½¬w.�&ãÓÃRU'ð&˜Ôžéc<¹#ÇgX[4Q}#uI¢¹%ãùp¦$È:ëNiý*$be†|Ž,wtRH!e1¸‘4"gΛùwΛåœ+ÿÆu?Y ï¼­wƒ´*µ]ý ¡·’©tLÆÄ25˜ÔÉI ²w1}\K‘&_é�bVñRAj‹åt3)¶œ&\Ôæ>~Åä‡Êt®ªŠµ;j` À°ö+ š:z›´m‡u@&z‚eGFß+�4|6kã\´|Ϋ¸Ü‰zá…6Þö0E[~ÀëiÉÿ‡ŸÖ#šr�Êp0f붯~å>«ºy\KwQ–®‰À!¯`�“m%Õ3€G­'²þ"Ý„n/²ŒÊÝÄIžÎf¹‡¼w#ˆxqÊј£ñDqn]·�oÏŸ¼š-¿õŠ—~ìÌá]ßûë½?ÿðå}.»ÿ«IùÚrì^inmWs4«¹½¸®uÌ�,(\˜:ȈD+ …Ú…D§¥Üuì™ë’fNñTêŠ=—ŸD¤҉ХFµm Y.&Üž�Y­ÜûÂ[äœ ®“ÉÆÛ¹¬¿,;ÛgH[¯‰øÂ<^0�ä8Íñ˜gZÇŸ—9KÊ>e8Í1«Ð]öãÇŠÙô?IFß?¡³ê8=èý`ëøš>/›{Ñü µ‘Ý™,[ à¬Åx~êCc�¤ošFVõ’NÜñI1¹a}¼qõÚøà5¿÷äWÝü¢§¼b0^û'\ÿù¦_ø'»€ßuÇ«ÝMŸÿ» ¿|âËß·¨wžÚpõ�Ѩª¦ãi;�%y„êˆ=K~dlÚò\¥˜À/»i ÚúEŒ°-ùtØ�ZômW £m­R`äEÙ°½Gí›ï:±}×Cï8ñ•õa'í:»¢­>Õ…Fõ¯:{‚öã[,Õ̶ҹ(ï�bäQ8ˆÏ@“Ø…ÿÁ±+6H‰ëŸ²‘AãÃÎ\Ç4”L4ãDGî¾ 7›SL|:�Ø4š?g0ƒÈøv,ª hšÅâœÙÎòQ9¾(Šúá/¼ñƒÕx¼uí30ÐAöð:yünàà�íœÚ9)­¸ºiž°šŸ:s<�s£)!ªZgÖº¦FßÇylø;¤ÓkØdî鯾s’:«M[œY�4’Qsheá`(žôíª© YÛâ9G¾â.ºðXÛx—lÍøz)µò×ÿX¿ü-Ïÿ'9sã=?U^ó±·ÛZm^>«·®ñ«KËÜX;è 7‚÷ÉD]°ËóÉÇéÖI�uMðÑMÓ1Fw7èÙ¡7$SõÁ]a—êP‡pâ¨^<ÕÅ×ààPúÖyxχ.ëùVéF‘Ía7eµnPj9‡äÿ“‡"[)°¾DüÌõúbbSbal™ˆ©Æ¿ˆü{È"J™‰ó‘ÜŽÂ •¢ÙÔ�s¥’Õ²oÃ^bö,Rm–†›B¯†€ý¼À¾> � 0mTm µò Ã�HˆFÑ9ÚmÜÚÿŒÄ¤ �bâ|F¿Ip:ˆ(5¨ygÅ � Óœ„ýÿMd>` ;�3A©!ìıt(@XOü³Ï”£ª:Ú6õùõ²>Z–£Ñ¨Q¼2 Í1tPñêÍÕàߨE¢þVÒm¬n^Þ\‚±ÆòÒëÌ"¾à$ZºÇë;õ+ÁO ô]ÌǺ‚b4B1,Š£óEý„í­Ùå!¤?4삽½ÞüãßÄw=ë;“ñø³£²|IYÈ_ŒÀõ|[–ó×I�Ô¦ èy†HÌ›sÈB+Øqô#�Æo9¨xc ¥”¤ˆšÆ"ŜԂ:)ì»Í(ΑEÙÒ7Næ;e>;$GϼMpŸ÷¹ËîóNT“ë1[¬0Û9‚º™vÿÔ è if©ÈØl»pÒ²çRh$ Ò6ã�Énßà¾V…#þT�bµO¿Cþð|HÉ·ÓÅ’|ÒM @FíQÓZÑÀÐàì’±b£{{ߦH!!I —lEP”WHÓÔX-g¥kýö¡ñ7NGk¯ªÊê¿W“Ñ/xÊ´ÿ=º^uË œg{Æm;·>u»Ù|ÖÒï\<©ªr}rÐ#ñ$<.¥�‘y”“D0%÷Œ^FH>™Ý3îôd`Z4¨`(8¿wÏ$a nb=¢ÁEb„´AMÁ2>Tbž¾ˆ+\)EY:/íÙ«fyïq9¹àw¯ÎÚ°L‘Êþ9‹S—=G‚÷t,yÍ6 I˜6!€�å”$C1Ðp]¤D�8³VGú(ŸJ-k(þ„�"D”8„�–œWû¾�Àaí¿#‘YaÇ̺YÍ%æÔÌ”“æ|ÍÑIÙÒ¡ùÝ$Ô’•+K:W0†×è¯ÖDkѦKÿ­2ª~Ã΢%REè�Y¬#éüM0söe:á°ÀZ†á4º�ÈR(\1ªXTã¢!.^ÖÍ£·6·¯šmÍøø—vˆü:Xõ ›çåÿ`5r¯- ÷Fië/ùzIßÔ¢ @²vO®s}Ãd)KYO¹ë¸Êͤ#†çþ¹E2}˜p;¢(¼8ç…m!‹ÙaiëJÎ:t·Üó‚OàØ¹ï”éúÛX×_–��3¥®× t@H¦ßÇ<ú0ºšhê€í™˜�sUhPbZ¦ª*µv‰È[îfaˆ%ö@ (\²ËîÕžN¢c½˜¿Iì�7‘ì�áË:×e†5Mƒºž£ ;5)×oÚ¸úÀtãÚç?ñO>ÿ¼ÇÿÉ@ûߣë wÿañ¾OþõE_=ù¥ï›-¶ŸÒøå·�Êr2Mü¨¬Bóß×Ö[?!„çÙ÷ŽÌ+iw�aSCÓ#¹Ã[¹\ ðÄí®âr+ÇaïÁ¶Z–ð`£Ë( ,¼4ç6mý°/ÞùÅ‹þ-OꙬäèi›ÔYdWYÊÞaу¤.r÷ÕÀÝÅ*3²Gä6‰ <6@t‚¢¹i²ÃÊ-ZØÓžä/ƒÄÐî«¿ À>^!6MâmgSRÛ(òëAmÌB²ùn¤‰êuÉÀš•I×ÑeµS¬’™7 sL­ÅYÈ_d‡FB*”AgB[À$„UË,ý"?èrã‡;SDd1["ùD÷](‹RŠ’tÒ‰@’&KÝÞ„FC’ÂÖ´XϨsPÀÖF×´öÑÏ+Óg9Kq›º8�Àe?a/HˆC!MHJÛ¬ïÌWA°µ½¹¹zä‹núø¡#‡çoü¡{wè^/üΉÌ‹ßwÃæÉí-¶+4ôW¶õâ,88#m-úC3;×}«3Ê$öL;‡�}¯'«ýH­w°gN €£8G)Њo*YÍH½ÜÀÑÃwÉE÷ü¹Ç9�QùEnmNül±æêf4WŒþƒq¶”à‰c×½ t/ÎÎã!§.¤ØÌˆ¬…¯Ï$åO´edňÍI 1 ‚ICW–º?¤äEè7Nµn¤ºF¥�$’P¸O²”5ËÁÖ.èõ‘ǵÁ "Ö¡ÀEù˜ÀIÓÔ²ªçôm=;8>ò±�ñoxuéš�ö¿‡×o^ûÌÑûn|ß±�åÎófö/ëfqiQ€ë“âŠRZßéQ:ÍInÐiZ0¦+lØýDc¡Ôkµ¡Ú6R¿‚þóôfiÅi¿&·dZÑMÔ¾À8Ééÿ‚£sŽÞñè²]\ÙøæÓ$?1ì ýC‡D´Þ" ¥ùCrK!òÄP¨—£R-ò‹˜m- éh–(ˆ”`úƲï ÅGÉ$ˆ¶¦L¢K$YÌ\$…,í#Œ�vØ0¬ý‰ˆÒÌ_zLÖœ/šI;=Äh]óÂ]–Y륖›­•Ɖˆ8¯H»r»Í,*Gä}:OSã§*òÂkÐ6{‡ì«±õ &D½z0‰Ã€•Šˆˆo굺iÎ÷Åèh9žŠ"Ü’)SM|÷î[Gƒ+)B“…‡CŒç¸µ`DúgÉ € T¿‹ p÷ª F*ÿU3™†,’Q^âÅì£^œãh<�Êf1?g6ŸӬܙg™Õ«ús"2vÅÞ^ïüé‡.ù¼¿þlSû—°õ§Ä¯~œ5·¤¸b”‚‘<•^:V¿ IDATNjr³–‘¬i&*4¶÷0Ÿx�L!¤éôaú �žDÛ˜ÏÉrû�;r+ï}É‡å¼ Þ/Àçe>w²XU®mÇ",’ú˜Æ�PTp;ø$+u4é¨&•ÕD±X7ÍØá@µ©á¥g³3Z5#ûd²ÌzÑÜ+ñW ‚©ÎÖ®HÑ?öf÷ÉÄ :ÂÜhN2`Z } ÙÐ.©»ºH®º©e¹œ·uhzôããrúªª¬ÞJ)îø�Ǿt ýïÑõ’ëÿÏòÖ_9v׿OŸ5;?¸àüâj\–“ј@!ÞÇÞÈeiéù@€’ƒyMjçsŸ™äŽd¿MPe¼}ÀÔÀ¨)blYg–¾œ§íï š•p·¤†³ÏHø© ?*G¨½_›×³K ÊÑ�o“Z£1’F€lsa‡ó»šœ†Ífˆ¾Y*nß}9Ýói²«5 â ‡²ªXŽ'#/¸ï²n{òÄÉ«NÝuâ~WýùMå×Áú«ùˆÙãúñ•¸ºt|“´ÍWY×Î7MÇd‚±¤gÏl½Ã¬�š*»~—øî®Òrâ5®kÓ}3–��3¥i*9väN¹×Å7ñè±kY–Ÿärîe¶½�º©@_0!åB‡­3Q À=ªŸ£©/rwFzÉ»¬¯µxÕ˜9•?wã7ª¯„6P²û%ŽÙvÙm‹=nÌJÏ~Ù=ëìžo: æ¢´—Uö3ú’@ØúZV« 'תµ›Ö'¯^›xÇóžð²[žÿ„—ó^þnÿãâ3'?uámË/ÿïóvûû.R”EUUc_–•ø„)«q»!=ù‰Ö6„–y¦�Hb’˜[ `全 ÊÓú xz,S ¼ ùØ•@€4þèž{GçJ¢påŠËƒŽý»oùñ³~ç?³ï#Í1�¬HÜ—’�ŒQ²LvR ¶r5Q’^e…1²ê‘ Ãl´Å0Åøn%ö¿HæÑeËRv+«�×cÉ9µ3#Ö kˆ"ž‘¾Iii’Û«‰cb;s�'ŒÑu~¦BtPbÔ°›¼P ´mØ Me)˜tÄdyR»Óðé´dOį0®Óhߎûé¢ Ä{/þØõºsÅ?ê‡Û:uêXQU—IQWPdƒtaB¶#X|¸U‚&8�2‘]¬¹Hf99‘$€,žVeËF‰äÍV²—b೫½óPêÀúÎQ0ZvÓG“µ¶OZŠ»ÿ|¶ü‘Å|qå©»î¾Ï£ï¦õÇÿñ'�È_ÿñ(xäŒÃ7N&Ó8È_‹¯O²^Ñ7Þ«ÒV{h)+8�¢Û.3ùïk* Úã…*ÍC² 5ûaƒú¦’ùü óƒrÖÆ.¾×{äÜóß%ãɧåÄ©J677dµ‹÷edw‚taÄ #BEteM�Gb×PãÆ2Íp–ˆ—uâ6#A]" Œ‰VÉ„2¢ˆzí8¹V#ÒIAé‰(:?ëR�Go1ž9)ÁÍ¥™k¥ûÞö{êœMÆÔ@àÀ–-êf)­o“ƒ;ràì7”EñŠºm?7M´­úäêô13a¢§ÙéN�ÅD„pe!E5a3ö“fµ|à²õÅæö̯yïŸüê/}üõ?xÁl8Iöö:txmçÌ#þæ ·ÜJïÛ‚\\.usýÈ¡šœë×òa‡yBŒü]¢¦7ËÄЇõ÷ß­^‰èSß:,vÈlUñÈÆ¦ÜûÂ�ãØ±÷H9ú¸lÍJÙšBÛŒ;›2Š]Ð,Çr‰L¬¹Ñ‰3XsyŽ�vAœk™aïy Ï‘±Ú€¤ÌB‹�ECuZµ›D.³‘pawU37³ÿ„•1ØKF2s?2A¼`.­f[SÕFJ{ ¶ƒÒ¶5Úv%ÎãÔ¨ÿÝt¼þæQY]óÜG¿äæ¯ç½ÿk}Á7ôEö©Õçñâwÿëów–'¿âüû—~ù�Q9bYŒYº �ÂÙŠ¼eù½jB»s‹EÅ8v»XôïÌ # V²'@?pƒæ S±s£Ë{4ænÃ1%�–êG‡Â5¾¾ðäüÔý ²ïLu‹ïÑžòßf8ëòÂb‚¯Ù{×¼S�y£2È"Rj¶zñTiÿkjÕŠÌ¥Ï:Bô8î`\dò†$¼”ìEˆˆ \ƒb9 �`Xû…±JZ$'3:Ò>c»”lMiJ'QÇ+ÛߥV=­Óùë3™OGÁŽŠlTôìHÇ7×#ÙE¬Â»êÄÓ ~}òƒBòžf„î ^µã´"ÀÄûö 'K`›Lpµ³cѾ鿹~˜±ë,ß\¨¡€¡O™áù»~¥uJ†PNAìk˜ÅŒ£‡9Acº?zŠH ÕúEäɳmQÐ,×Ö¤q�ºmî³³X=Å9·½y÷‰Õ/þø§Ækë‹·üØÅ•n�®7þ؃ø„—ݸ�Ç×yÙ¹µ`»lëÕ“š¥;»JT“h{/bäÓÎSÂr4\”Z8étš¥ csÙ Ì…¾)¥YMd±³æÏXÛá=Ïý$Î;çFN¦–'KÙÚ>̺^ç¢%†Ðõ¡T¶§N'­9@ßíeD÷±É"".Íømm éÍC!: c´Ga §æÍ¸ýµ1Y[ñ²iÂ4PTË¿Lå-ga \-›#>œÙ4 ›°J‚ �çŸW·[&á)mÛ°iV"­Ÿ¯•>>-7Þ ­üÖ‹¯OÏ7®ýÉò�Þó[Gv–›�\4³g{4÷…s2)7àX¡mEi~ñôÆÍÇ}“\Öº›É™¢ÄÛͪ� rÖÒ#bF%6NÙ*ÑÇ¢ÛÙDd»IF¦Ôé p¦H�KSýŒ¥-“›d¾š›µ³ D¤ªÝMzG¸ØaG=t‚�òDSNvT<ƈW$¬ O¥r"àkÓµiÃ[‘Ìx’Á<ÙaL¥÷çæÉ]áDØÐ‚À4H´ô×aƒ:qÝ% BqíÀß×kxó÷÷B”ÂwzKï»ñw4ºQðÁ -¸k$Y¦f)¸Ak ¶6ê›øƒ…*¨ö½é«ÿÉf&…TßÿŒŠAqlÙ°i…#vÖG‡>ZÓW”®¼z´*n{Ñå/ ²öèú³O<׉´‡O-¿ò”Y½ùÌíåÖ%EYŽ6Öø²Å D—Î Š…b¯§¢lÒõx‹QÙ�Úw³‰`‚=‚`M;wª \§öÕ´A-õRÊ9kHÇ�É-JOìÓIãl—|=º’Í á„^Úªöõtåë¡Ö'B§YÔæíÐ#DʼnQDÊ,-X”˜oF^1ú!ª`“—¤úúõIÝcL~ � ¾Ëf|¡‚&!�‹¡4ÿÅ䦴 7芲ÌWpXûv €}�ˆŠqÃN–ý$MÊ ÿDÏ÷=¶uÙ4(B°òüTaZïç03b–Ó®üΔåGVQ$+ ÐP*sŸGª»¬íL-gÿAzµ<¡+ îwaÔb¾�QY–žœˆˆƒsA¢O›fÊ–T³|ÍßÝiGø¹Ç¸H_®›wñbŠ2ô÷rðuÖ“™ÅNO ™– @¤öÈ\ð]Qt^�TÍjñ€ÅjYˉ“‹å|ñ†§^}ǧ_óýg¯†Ceo®¢œÈå/xÞýœÇ¯þ¯O/oxÝ«ß6&üá¶Y^Ñ®ä(‹1á ›^©£žøÇÌ\„F •ü÷l~W< Ö«©,V…lL7å~ÿ=Î?ÿ¯0ž¼G¶v('7Ï–z9ˆç|J±`æÓg OPâ–åßDINF0…èJD< S‡¹¤+‚m0-»ªDÚã>7Ý�äe9 Ù 6‚CzÓ,¥HþÕs°)’Îî:€”Ö“ÛÒfñ×D'n`ë4ÍŠÅÉÊM>:m¼q䪷¿ðªÿ6þíáõþSoÀ«þæÏÎßYm^±]ï<¥ö«oGYãjâ«r,¾EnÁÝ„í�£m¼I«`êÔÁìVˆ t÷…]~¶¾Mò3qíI@Ä”ÿn¼þ£SH,F�â1m�õ5/TµÚ°w›e‹†íˆÂAëM'qÚåLi{÷3|2sSz… vŸm‰BcuÂÓ$ äosדöVA–ZMd…o¢'�ylMF_µÞ�^Ð…Õ k†µŸV°öƒ:Ó»ÎzYLTbµ!gÕ‡ª$ �òKƒX'øxµEÅl<—lÞI"}ÃØVE…L^/{§h Hò„ôÙÈ”O鯤=†¢=â´’~¢¢((û\pèà!lon^¤qF =Ò[m‰gš|®ÕºµbHkd8ƒM€Ö3¢ Ø“ýŠ*Ž™F4PEAÐ'ÄÌ\ž¦QÑàôÔ0ôÈÄiVC2ftw¬‹²�ÂUlØH½Z>ÐÏë$·ï¸õÖå/þèÏ<çÈê5W�7\«{l½óç¾'½'ÿî>c^ñ{ï¾askvj�šu³zb½à7FYT“èùìÌ\(öžJ„‚À«™œVldø¤n\ç),¤­+YÌG~½:.ûîuÁu˜®¿WŽo•rjëlY­¦Rˆ‡sMØù…]'Q‹T{×K¨�)â(=š=Ó[Òªf°�0±¯Œ-"ùƒ•·Ñ´3PäÑqâéЕaùV)ÒÅH«ad_ê¹B¸D<‚�H9DÀpÓ›¤�:ì“*ÎCÄ7í M³¤øvg2:ô‘µÑÆ x�´î¶áiùç_ϽéÙîW¾åE»ÿöÚ-®¾þ5gíÔÛ�˜7ógÏ›åe,ÄZ?Ô®(Ø>|ìv.¦\˜”›±fB‰Qgšs°gÜŸIÚL“—Te‡Ù hþ`î;¡ˆ�ŒG±Q¹0)ÊéeÁØ×Ën$¬êø8€B´¾)³w ÉNôÑÅ4œ�ÑEÕ ’ÆÓˆó~öÀDÀB²öP¶­} –0â's~‚Áè!%r”rè•é´ ¶Jˆ”“<áˆÞ$sg§p(oSÑ×Ó3d¯áÍßÏ€hœ’B9ú=L%þÁÓÊC³Ü6ÑðÉSÙÈ\Å­i¹¢Ð';ý’1M„ç·u;N–½¿®ý¹Ë6¦ŸWÅËÊB^Q¸ú®ÕrÓ/[ ÷’.%ùë‹cÒ�e“§ç<¼> 抢¡ˆ—ÕbÊ­SgHQîàÞç}÷½ç{1ª>$Û3bsë(êzÒíºÂ ]À`»Ä˜N?fn@Ä�Ú�pÌÄ¡ {-ð@×:é�¸}Å��É`u=šËé‘b7L7d¢ÏLˆyo£aî$=Ý�ÃXWwLW…û”¾*ÑÊÚrÔ�¢PÆW¤k&œÉJ …P«vé–«YÉ–[kåáëÇÅôeQ½±¬ÊÛ_øýí/¬Ó5ÿ""µ_Mïžß~ÕN³õ¬­Õæ}‹r4Ù˜d�‘Ó¸Nd¯ÀGOÕ“¢½_ …@K‹˜©ž¼6ºÍÕ=è…¿˜�i?› (É2|Ÿ¬AÒûüæñpôc¼ÊK„°Ò¶­]]Ï]ÁbsìÖ>:­¿~2Z狾÷Onyá•ÒOÅÞXÏýÈsvÕ¦?ÿæ«Î9¹}דfó�§.ëåw¸¢œNª©—ãà}{wä¡y¦H›ƒØ½ƒ‘ ƒÌÅ“wãI¯bG¯™elOnG%zõQäpw[Kк*˽�£?M~‡ Dèahÿõm`©£�C^tÚÐH¬’À‚:/€=—„VXŸèÝý CŒ#`Ä~¤d �iín=]ýJý9,œ úßaíÓ5Höó‚a·Ñý4ú…câøÃÐ@^žéM #.Ìð³ lm§L¶–ZÁç ¢žˆØó�š»"FjgÜ®Ø3¨FŒîŠœë÷¢Óé4>rÎ×û{þ¿ZÎE …tqÚü‡‰…�†‹XRÚwzcŒ×Õ2×\Š(“Bh²t�Úšè•«Ô6óö'ó�ßÐz*™�0¤LB›s)™v`â Xæt|ÙÑø¬õ^Š¢@5]ïÙ6«Åƒæ‹åÁÂ9ÞùÕ¯´ßóÒ�}~ýÐÚòõO»d(¾öÀzì¼""×üÌãÒûqâÄIY-ÛöÈ¡7œÜÜ>9wµ´¾þÞ¶Ù>›`ÁrB¸"LU=Mx ƒ[�jŸ¤(�ÔË)fÛ‡¤ªráyŸ–‹/|?Ö¦ËÍmáæÎ9²ZMQ@(·CØ Ä9­á,'‘öž¦’É-Ò S@^¬s3Al¶mIgô9¤±÷7¤f�¾ /qFŸÂ­²£;ªuf ì¢ÚÂTÂk˜î¥ùV�d�ríEýØ´µ4í’Òú�õêŒ�­U‡Þ,Â×SšoXÚÿzïsܯ>ü_w¬†_ùf}Í¿þ®Ÿ,—íüðÉÙñG®ÚÕ/-–óË(<̲(Ã(×Ç„t¡t ­æNt›Ë‰eÿ'Áa8ðM,­šW¦&Õ2Z¬Gñ¡u 0:2C×õ‰ ß4¶‚‘ÜhŸ+õþ Âèb‰Žˆ÷pŒÛÑæ?Ù–¨ò•I„¤éÃPÇ•p>&Â*³åBv–hšDà|×¼Ò!E�Q#ÄUÉLíñÅVv±½/ "sK<}Nµ,Lõjô؈‰?¬Cn³©ƒSˆÍ\ÕÃV1ÞÌÖ:¾×+&är KL-LîÇ¥?¶š»$!AþÃ’­¯eUÏ\!ÅÖ¡ÉÙ¯ŠÉ+GEõ6‡âöç=ñ¥ß°´ÿ¯Çæß®?úðo·ÿÜ‘“‹ãO�5;OÛ©g÷-«r:©¦,\ß{.P­©ü˜ùk(Eç¡ÈÄ&Ê`¦DI)2Ñ5)vAE A¼E“忘rÆXsF‘½QŠyZÂYÃßÓG¡š8ËJE—ï;öî×BW;ý8-“eij²é’Q­ºÊ?™8?b’ÐD‡àr’ª!uLÒ,bPóŒMJ2Т8;Ì¡pÅŠ¯BÙ¬U™)†¶³ø k¿6z!ëŒÙ܇Ì�� £„>³D‰UÔ2]ú̳,ѹÿ:åŒD�$+0g­½Çú¢A¼v¨‹>KŽ6’ÊRMçö7dÎÖ (®ó/§áÌõÞ6&Ýa&ÜÈoÒ�™qäsš �žÍOÇRžô°äï¬a d$_­žRYÂ>ç ܵ i^úÕ‘~ÇLÖY锇eºö÷ΰ`XûmùÔ>¶){ÙÍ¥bñ3 º IDAT¼“*N¡´|1¦V �x2z+çµ�Á wš<€ü®¥1j�7#Û@Éà‰ ž%\E:{0@hlÙ×Ä(4øªƒÞ`ŒsO&Y…±èOjŒôÅ;ºé„hfÙ0½Ã�lO�'Rã"ù›½·mO"zó@i�DEQû¨n_zQ¤]{e\Ö]èÀ<„mKW¸’ãµ5¿šyiVËìÌëŠò®|ä oød»Ââº_ú߆ûöŸa]ó¬+³ßû÷¼ä­yGïãݦh> T'Fß\µªçgµâJÂu1�üvN8#éKY6clÏÖe2Þ” Îù(îyÑemr“œÚ¤ÌçgȪÃwÓîPÀˆ´öåþÉ&*ššPúàspeLjé@ë‹Î$cFÖ-Ä¡¨‰D‰§ï̪²¸ª„ÕšYf:�ab`:‰DΘ0>Æ/ÝE»ß(ͤÍÐsâ#LE(ý Z¦,¯à¯Õr%u»$½Ÿ­U>1¯¿Ù³}å´Zÿê~Øû_¯ÍÿϾéûÜm§¾:99?ùmù™E»|`+tÖr„ À‹'’Å«Ght}[ «Q1æ„ö"ñx%t¤P¯h0áÉuY{²è,�‰[ÌüCôU§¸(£ëƒ>3‡òÒõÿ]ù)"„“jm £É¤ªáÎÖì�ßyü)mÝ^ZMËépÜì�õŽg]ÉÓ5ÿ""×ÿú3Ú¢}¡px)€ÿV8Þá›9›ÕÌù¶Iý¹K(S4ŸwR/§²½µÎrr§\rÞÇäÒóßÏjô1™/æ˜ÍJ½ªDº«aJ—ˆ4ÌŸ›¡B‰þdŒ†ª!o,�ÎÆ/ì긬�X ABŠTrªÂzä¾Ñ8¡8’dÖ“dnhi0¯Ö×ÌLغ§0Y¥#i¼Ê�œýëÁ˜0˜8™˜)b�yå34M�¦^¹B°³>>ðñª¬þ¢tå_Ö¾¾í·ý»ûÂíÿ?½÷9_—7™ƒÛ(ËòéÛ‹í_Ø\žºe1Þ˜`%#�¡'CšbX‡Rº%¥ÂÄg$ؾGßtBMüH¸3iµ3È4ûÁr°ö²îž¬˜šAš`¹($`zv˜Ï!¨0šIN�·q5JBƒÙÕê-\IÝïr°zK�wYá%%©¥)éì*ŸTOÄý j¨o½úDhðŦB„ª�'Ã8fID¯àP”F ƒ‚i;Bsah§n1¯ÒW$xb:c©õ{œÐ3„«kŸ®�°ÏÏÃØˆ…i;ú“ïó§ô#öE¥ñ‚LÒ~ qK^,fÿ(ãªÒœlÈLqúy¸!£EMsìWØeíN%GA{Hè š°×®vhÛfß—áÊŃôŸÂø4qQiˆ–yŸî dÉ<”[iöˆ–4‘§ÅUlâæóJ8Af`£ŽA€]ÆþªcÑo„HÙ(€\�§ÐQøÍ¸4BJ˜&áÙ…'Õ˜hÚqÝÔðµoýÎl¹.|ËUþÙO¾á‡ï½=œ<{{}ðW¯jDä¦ÿö\YpÍIó(/r/ßȺp"peê—IßBšzŠ��5 /½ÇÝyç½_66n”Ù|);³ÃÒ4Ó$턦5N¬)$= ÓQÚÏž¶±’MÕÍ|Ë*vˆqA“Ld‰cÒ ÅP)´ÒÌLÕ€'£¶Çæ1t# 0¾¡b9Í뎥vKØtØ4øïhÿhš ¸UQ}dRMß\–å[ÿà‰ö™ý´—õá/øºšñ]ó™?woùÌÏÛ\�ztëë®Y?ÜÁ¹QYùQY‰x:â/�˜–:IºŒ5?¤×úªÅŸè>Äé¦"=ÕI|2lÞq¦²Ñoi¬2Bî° RÛ #IÛ¥£‹O£ƒ±0H|v�óÇ:z2‘1ŠY¤õí®,�ýYðzЉ§º&„ã&“‡ˆ•"Äéå°®#Y& Og¹ÀÓ¼g’…=D¬GQžÊšL®�$rwðIßõ(+{ <+B1d†À0¬ý¸œ�ÎÊ,ÓÄ%2’ª¡THdxHJ1‚Z°«§MvR èR_eú}Õ‚†Â’ý3ê:Ã8—F¬X×g—¨U¦fòíêä(ÌVàHˆ÷HéÜÇ’ô­o)lñN¼@<(md±‘É#"b>Dï’Ë´“ì +™h�6'Åxê (â!N$w@‹³M¤¯§n`‘ëgC]j®#õÐ 6ÀÐ1OÐ(Ðdí@IÑ�´%×°ùѾ%F“u©W ©›úm]oŒV6Ožâ£_|Óß�¬Ïßú×Ù^<>º¶Žç—¥Ü½XµWÍ—³ûûÚUÞ�m a ®w¶Ö¤ð�ó�Ý-�÷9<ü,—µìÌÊj5 P7hï¬i)lmiÉL7VdœÜ@Ñ´HEŽ�ˆ€u"žèv�äðT0#˜J ù4*gsrYÄ›?g‰­™ä5 âCn  ¦áW˜„ÂÅÜ?ØŒhV&˜†^°ø‡°mÖíª!Ûíi¹vÃÚhãõBy]{û°«÷0XñŽÿ£¼öæw�Õ³ÇÔíêÖ÷¡ør}|#W‘žÒ��’ÒhD,–gú6B-¿t²ôu¢ÈPí<¯¦×fÉo<]—ŸZHnëω½D¡Ò™Üs9ÿ’’gàÂgLBOLÀé}Oʪ]qDmP~z'RD5_ÜG§ËuñDë8#éø�mÉ£IŒP 3§>X:c–™ oa3‡P¾€©C"s™™? ¶œ†ióxR<èE(p~è÷w8ü †cQ$²¼5!ÜeÄ”ó;‰šªNÂŽ‹”ª,q&ç&Ûâ3÷1é8ßð¶ÒËX¦ "…K•ÛU�ކ‚®Sk0öûáÅÅ‚!‰¢Œ­*È}lÐñj™õé÷lø�Ô,È®ú  :5€+zLšŠ&~%O£Ø�Zµ,<õ@éjÕŠ 2±ÉgÝçclZ|-¤&*…žÉÔÀô6©Ëð$=}¼é#ÿ_Œn4ÄZ$ë©$qR-s‰Q5•b4yºóg³ùSOž8ùT ï#žkñ³÷×M¿õ¤æè±òKÕ¯©Frõú_ˬ!�߈¬ÙÚ<$;mËKÎÿ<pÙ{äÀúõ¨;²¹yÐ×˃"~"â!ôÎtãqÆ�N~ÒmZ>ô´ì޼Àa¦!5+“îLt’µLn(Ñ$-<¸tÑý<ü‡ª–b‚Mt8Ba_‰SJ�æ»ÔE%ž´e…ïÞ=TT4œeßE¸!H˜L Ä1’¹¤<`à}úVž5¿p9¹VúÀ¨œ¾²tÕ›+Nïxñ•¯è®{t½ò“Ïs^ÚÃw.o{ÊV}ê§¶–'ïíJTk|YŒBJ…‚@4­U^Ëè‘x"ITF'¦Û}ëiwoú2c³‚{ ›f°&ké wd÷µœè i`ê8˜ñ;1 Ïa5–™CŠ.Êóâƒ3 |©íïå�É•Ju7u¿æÈ›H­ü®z¸KÍN†#’êÍÆÒØäÔ�kŸU„ˆ5»ò#ƒ­ìž6S”)ÂÄUÐ$»34ʯBtQ'Lé€3&rÙ ÙÏk@ösç¯)·æ ]2%‰Ó(S•Ñ5Žã{¥}D¼Ïú765´½DÕV§Žžb;'‰kNc„kà{‚»psûõ3ô>8¾D 5Þ›ôØßÞ(éÚH·`ßi[²Q û¿d#P##MÖË®«3`Í‘rFÝî·Ñ˜¡Áú™H;’]q²û“è£æ�)v‰ìëVLfùÉL»Ì¹#©¼)Ûz~ÙbÕ6'�oΧóåŸüŠ›?ùúº×¸Ç×~ä �ˆ|òÑ¿÷¦·ŽGEüc¹j.iWµu‰åjĪlå²ó¾$]xžñv4ÍqÙž�ÁÅκ€#ºÀ@QÏzC†õõ‚ò¨Òb„8’gnôo}ñÅЬ��£)Z*Η¤Ÿ×a�pˆz”«MÕn+ñäI#9ÍàJ$“iõ¾h§m4eD~ÀäœñlEÒîvƒ,RȆ5Ø.ĉ;Y㛦ã�×�ŠÉ»~ÿ{_ö…a'ïÝõ�ÿú¾—Ÿ¿So^1kf?PûÕ·K!˜Œ§m5šF†–ÉÆPzJ�Sˆì–P> û§¶ä\2ÙeìߣlÛ ‰ú@¤’&±°«éæ�¼CõŽ´IÆ=¤Ocb�j31W …?ÌÏ«OË@ˆ!]Ò_iðµ ƒDvÕãºWÝH–â“ ÅoiùôH“ÚÚsOÎx(±¢•YiÌ­Ää¬&WŠðEm2¥áƒ˜Ãdgˆa_ À°öë‰@\ŠIÑÆ/�’ Jœ¢ó^p Í2¦”¾j(Ü©õ;ï^€NÉ�&ÔTÄEä“SÕ^ë¡3‹…n‹“ýs5úO«e–þÛ,ÁZ�³{ò±NÆP§ 30¯6 œöMpX‚&2ôKzAÃàôímº½¤ÉÈQ1ê %fò0¦B˜[8ì?�çQ!|Š�êÌ¢Á$FçÄ™Íî¤Å5˜”(©·ŠQšHQRcYŠ÷«Õâ²f¶Xrqâ®ãõå¿ÿ‘Ïm>kñ¦gœ7l¶=¾6Öñw³…{)œ"¬êU{öj5�NŠÖ;z«\zéuîà¡wÈj¹�S[gq±XÐ9ŸŽ(ê ¦ß†5úÓd"Võzõ¨¾‰'VŠMUäJ½ÂCƒÑ}ÈcŒ…ädfbÓé'``LÌW¨}Œ-v4dí¾›3ø)€‹ÏTKÆâ—è#3 ]œ±]¶|_lÂÖüë2Mö½öñ‚ßqò±¥éKZzT‹ …{‹äæi$ËÇ:¤’KËÁ¡u~õÙ¶yóUIP65B1Ú‡@´æö1 †zÁ_j~M�*]ét:›UÑ~Ö/—_²X¬ÖÜwÿÉr±xÓ3_÷©½þYŸ{²ÛŽ®2x”þô±�ž-ÓÙÝËŸ=óžÛï8{ñ\§G×�¿÷šÏºþ¶ëÏ^ó.Y¬>¡—�¯—ã“3P-RŠß æ‡�—FyÆ^¨A½—Ñ4Gd´‹Q¸ ÜõL“ ‡¸«*cµ´‚¸Uñi0 ìÈœ“ŒÍ{cÕ×)÷X»�”³ª#ÞÜ�YxÔ+âÓ!_¨ÔºÆz}„NËŽÉÁoÎÏÝ4›í½ý‡žòÊßß-á«÷ú©Û^ÜýÚï½óóî¹|çc�VGÏZ×Õ#»Éd:Ÿêlº‡!`U5ú[%Ðêe.ÂMo}ŠÑ¿ë´4Ð*�#Èž–—�w‰£Ö”oû‡œèA÷ R}ÕÎPƉ¦Â)°‚t*’þ‰�n3Õºó”öaWaú§1ŠÁ?5׊‰8Ÿëš0hZ}²Yè€Fô†L©"—$Î�• a­k )ú¹òa2˜cã”ì­`ì®ííþ‘r™¬û«5ê7x® â�­M¶¹;ÒðʃVÝv]ÌÞ?®º ò8a‡� Pº¢ƒ?KÓݳJÛ-�vhµ6Ï?A¢û' i²ji¡s[�Ð+¤J�¢°ÇWãIЯ5ÿ ï6*¥(cÞJݳÙ@6ŸÜˆãsÞ¢Ü@ã²P_f�Óè‘ó#$4`\‰R‡€×ãÄTž¡¨…X4Eù«›"˜—³ý ³8�f:¨ DÊd*ó®“…^®ýrùŽŽOYÞw×�«'¾ü·ÿ샮YÜtãŸÞq5¯‚«È ¹é¹Ï׿ño_�–¾ž”õª[?øºO~jv÷šÏﺡ›Ü)'ýE¹|rŽgDµÓ‚~ì ˜û¨±ÓF–*ÖÜð Óá�òÑÉ ‚Õõ£ñò[Š Ý±ˆ�Np!�Ô�E`¦:Ëjƒ¿|Ð%FCh(ñˆ%à[24ÛaªÑüÞÑêÚS©ûøÖS Z×Zû¥–^�ÎÌÏÝz°wþMn’ÒíhÿWñõÏÞñ¼éû>òžÏ:^=a±^¼h¹^.Õc¿Q„ŸDÜH!#&Ô)™Û•Ÿcü".â”�g¸õ¹pÄ#é0NŠ Oâ§Íñ¼Ì9äÙؘE‚y�“­“*6,„[Ùbì· ŠNçû€`¶^->ÿèøèëµ_ï_÷�¿V«~TDvL€«àzýsŸïE×þûoÑ'¾üÅõÚk®—ýýkf*oùà®þìºë⸔“Åh� °†9Ô»[Qs²PÓ1›I…1Ž‘Úc¸k¡o„“«QQéÑñ’ƒR]�lÊ�æÉú#NðŒ ¨ªV@Šc54…Q!|Z9‚µÁNñ×±%–°Â6P(ÂÝÀcÝEJQѪ+Y¯OÊDpùÌáƒß?›ìýÌl2{+DîúÁ'ýØnÜy•^/¿õ_t»ëã¾÷ÊÝ7­.ßxÜ_yèt6ÝŸÏdRfjf2…ÝìÜhijÜ_uUÙXšâýP”)Aøf÷ Óx•#¹u#™xXÉx§7reSVxyÏÈÙÏîÁ·°£Œ?ÇÝ.ÎrÐVE�ã !z¯Žlo=° Õ”Ç@«Ç§Rä/l#p%¥Ð J-‚{ü¥:! YX…¨ºþ4X’ÄgÁˆÊ¡�¸ 4Hý9t©Ò2“ˆO‚„k„º‘S<\•‚õnWÚæAÇîÚâñf& ³±ÑÔŒóp9ÒôÓ>®s Ø=Õiœ’ÄÞü:bÿª™W´9²å…ïtùy©Ösù˜KÇ÷ Ëà­<(9ÔÏGúzú|Òíø�?öMâ?68Ít'¢1AQHÍøŠN+h”¿Gïz¼QOMTjºÀKÂÎ]Jði¢yh8 Hó-ÕA�Yº &³½ÚMæÓ¾×¿t²\þµûï¿÷¯Ýw×�_øu?ß|·1]}×Û¿õ;õš³·íMêÏ}…¬oÖjuï ‹å}ÿÍÉb!Ç‹©u&hf[ ¥Ùóž½PÔM¾•î¤ �&¸ÌG—OΫ¯M^søCîî|hšéÆ-- Òæ¯ÉHF²­U†^Gw\Úh¢ÜM'O<÷pËQéu�õêD‹êåi7¿õ`ïìÏœ}ÛKnxÕþÁ^ÕïVk\ßÿÎï¼jN²×ÞöÒîCŸúàçßsåΧ¯/?c¥ËG`2ÙŸÍ÷u6�‹HA ö¿´Ø=I{:ß$ Æ/0åP�T¯¤¦É`cåûQ@³e±-9ùÃ&ÅÎËC‡¶�CûßgÙÄÒ~ðû/Ì•n–¼ö:º#{s_^ \蚃?Nu›ll–l௞O-É.XFe�•:*y$Ù°Ú@vwÈEYšSœR„qÍLr„áuU•�6d›¯`»!Ñ>øpv2eh-N4»ïŸw#'6�ß[Ø‘�©iÛzÉ®µò®{K(Àð x£‹F›Qu6‡NlY *,ÁêPD¥uÕC¶Ø3‡ÆóÞsØy£a—ÛjHu^¥Ù4ÃÆ˜�fB‚KOãa>/Áfƒ™‘GTZ3†`ƒ¡}óoòb 5¬ Ø]¬=¾zú‰ÀŸ‰cø¢IÄ'Mip¼ÄT7tÔÃx¶ÚÝ1™è ûºÐª«õò/�`y÷'?¾|Ò�½çc·|Û—-vÔÕs=û§ÿ×ý£Ë{Ø´»ë¹Z/ÜÐ÷—¯ë'û]Å¡öuO¥EXLÉàl¡š­ŠBNÕrý‰¸·¾Ï“îQKJ Ú‹®`«1ŽÀ§ Ë`Üiµ‰s4R^év5¿…²Y’ª¸*AŠ\×Ñ'±H@4‚™ý3ƒ´ Pu%ýúDëjur0?ûÁýù™·ÔÚÿÔ|ïðS»Uºyý“G¿øª8ÈþñÍÏ›þú~ã³/®.>þ¸^þ¶…ý9íŠî�Ç�Ô^^—ÅËnÖ‰êo8Æ<*U|¢¥Z2é0?8Äd¾?[®õó/]¹ò·ï¹ûί­ëÕgßøÓžîv¨«çª'ù‹'Ç¿ýèäòãVëõC×MK9W€yQé†BP‘R¡Å,¸¡©ÃŠ,¼0ôÈêIp“Y9¢‰JK�:�¦L$6Âp#µ²Ô‰ôŠÜiÍMiQ\Jƒp雬T7¹Ž2YéPI˜›Y{ƒÛà,9B;¤œJ¬’²Ã†¶øÚ1¶|O :OÎy6]š¿¦�¹«_-n¨µ~V×í—®œkèO¥\2p®]2ÑSÈHÈ�Tu" é<V¡Œ"¯[гi,£~øÄj5.^•�€È�遼P/DÄ‘ 0¢/A¥ŠÍŽø¨ê»ø†ð4²d©–Äx±áµ§›¥JVЂs˜ý$ñb»iÑF20¥U_̪¤Û­‹°»¶²û—Ò\ÊÄÍÊQ©�€ ÷¬Q�q‰�Ð�ä9°U™­A¹o!ñjóTaÅ”ÙÛ„‰/ÈqZb¸Uhßc˜€ÌpFî°ŸZâ–4«ëæ/%Òó†[ ËÕ6·Ó-–FMg�žHß«JO¢4E:»È™¦¹é¨8‹ÍèZá% ƒ=#ãTÏØˆ Tðî Ên~Ɔ …‚³1¹è´®Auv3¿á¯h@c¶ >Ãc"ÅWjô‰åœM(´°Któ…×ážÈtÿPÖ `­ë/?Yö,Ëý÷Þ÷–Çÿèüø/¾àËw Àáõ·þ¯—âüuZŽ—¿»¿ZÜþŪ‹ï�îäkjù\™ì�jÅ }UÕZú¨�¸î)òªo³&ì#k3©wÛ sò"wÀ–‘·‘Ãçûùjµ¹…U'Øî¸Ò\ ݽ¶–«D‹¤²“ü^?óÜêç~Á_—Õê?Ùju׋ÖËû«õä:Ì'˜œÈ|X+Õ[”ö¥Ò–V651˜‘ ¤N$²N¬#ýÙ�R-HūʢÄ%k+oü�Rc"r)2ÛK-»Ó”°¥axí6TÏúÌ6}ê>¶þÔPªYãçÄ2[؃In)“@ ‚®ƒ–"뺔UÔAêå3{×¼o6Ýõd2{CíïxñÓ~zgøw_«zrxÏñíϺ²¼ømG‹K_ˆ³½ý}�L&–4ló•VijÁÛ¼Ö fh{°ìZ�Ù-T1è+h|0±†tU& *x—n/¨Š†G¬’mxj" gíÞš»¿0šû�*”�¶¦msÓ瑪  JÒôSF)ÐÉ@�*!yÜfFcÀóÆ)ÚHF€2�^ªRwŸ&©ŸéG…¤19 ᦚmkz: *ÑÁ¸ìIÜâ.A—¸‘rÌt«i¹v c‹¯ú³åÀ¦n &Ô•ÑÖÞ ÆT¦ˆ$1†(R$n ~!cò*ù áZÉ*ìþT©€VöSG ÷êÉ©h-Üç*ÆÉþZÃ3`·Fÿ-œ››oá#f¸g_–Ž�Â�X€ÌNS6ð¸ò¼Ê@î’”¯›) ’o% uMÇéfYÀ/iãßZp:$4À c3`ôÀÆvÙ¸ †#ºë&"R«Öõ¼ï×_º”Õêþ —¯œ,–o}Á/]þý}Ü™]ÃóGp}ó/¼ôìG~÷¿´ö<«ï—7ˆ¬¯“n®¥;T`"ä]âK‡„ãiÜ\·á” &§š³rª#‰ÿ@45NÃQA¾×(šsÓ‚ŸÄ:%f]æö%ÕŽ¨8zþðv�3u[5⥑~^…š~1£g-Î�•p# þ[rUWÅðÚ=›ƒå²¿œm¶2Â;ç_M78Ìa!jí±ÍÀh_׃8D<ÉÁ=Yó¶)ó§Æ^ã˵åUá“:) ]ŠUw*t$üÿŒ‡2Ì)Ù Zlñ—Ähs}l HñÊDÈ¡ÐÕ”b)’ Sˆ=U)›f¸ìyhŒ+.Œ�Yü(ª–®“2ŸéjQe]û/=^.ÏŠêÑïýÎû�Ÿø£ï¹ëí/ø²Õnçúÿ±ùó��]ôKúþò·ÕzùÉ}¿:_f’29£Ð ¤öª¨qÀMîUD¤!t ŒD Š„8%ÙX8•8‹é @U)ƒÚcO@Y�@ÆÁ@þ±A"„¯`î²?HØ\„� ¸5ÔX¾#4@L¶8H�çv8žëÚÕ&ÁA©EÑ/û“²\Cjt8»æw¦gß ÁkJ);ÚÿU|=÷瞀RºýÅâø+«öÿhY©‡{gë³"µCW¶âÜAV-q(Ú) gHÛsCèÌð« O\Œο>¯/i2�ý³�±2¸¥’$.£7Óà gÌБÐs-Á¢B) „LÍ݆ð\-ÖHO‚ŠøPB§©T¸»6x ÂÈtÕªNmtJ–&ð>$êåŒ8¥î·gö”íË2C-ÕøŽ»pVj‘�at…¢n?¨dTánચQY „32vÒ�°»¶B©5RÃ>”¦>ŽTk´Lš„ù�Ìžãzÿí°šõ®WÆ~Üb„Á“·�º?õ†¹TNS1I•¾~ÀäUmX�†UZ‡—Ö©è»ærò¤�Y-ÏÏ-ÌAX¹‰ÍÔÛþ`-ª™)1óÃX$�%‚b €lŽîô8E7%*¿¼”=¶f Qtÿaä=÷¤tK â/�óašJ©‰NCÃi¾?ÄV5‘Á@¿î¦˜îAÖË“ùz¹ø3'ëú¼û×õÌõ×_ûšoxó=wýÄÓ®ß1þ+_ßýËoÄÁÁç”�ÜöŠ/ïë¥o]׋�©�k»ùƒåPD;Qí‡Â;ò%4ò"XÚ÷‘Ï·oâ‹+ƒ£KAº[ãÍ›Å~[¯$�-äyPhž‚.E?Ïw9‚º€íQw£ƒ!­¯1moJþƒŽrè†õYbäÀ…Í«~Y‹£®(.�Ù»æÖY·ÿêI7û¹ó‡oxå®b½šÁcYÏjß?k-ëoX®�¿¨›NæóÙ~?-{€´º"vOµ5u!”&ôH&íMƒØ¢fãQÕ2ü´�CPWsJxÊh”¹ÕÚv?(n"DSM3¨N§¶ tcúYa…ç÷5Ï¿87�ãánr"¤à£!<Á¤æu æÐåíBÜW¡Zá© @h=©F%«4°•Ü{»]ƒFm,£ú£¸Û$;E_å,³f`d5°–øo5 –ÄߌU› •¢±Dvëbì®-½²„ÎÏ\xʈ!O9µ9ê¹ÙÉ´SXqºƒ£>�gc¹ó£âÇ$§ÑÎNþï�B`ü£ž#d¢†&WõÃ|Ø•K·Õ£VM 8éÝÆL{v¦¯Ë4¡/L °Ÿ¥8sPH¤=ÀiùÍôÄ^ýÀóÜb�™œ a‚°Ú`‰}Õòû ßæSm|Ót÷} ©»­îõ*2VJ“"´x-ÝTº©ªÔ~¯ïû‡/VËõ}÷Ýwåøèè–ï½S?þ½Ÿµ›íü×¼n¿÷ÝóÅwª¤ä’0’(Ûr£;p5¥k@a™8ÀàM æl›€<¦%:É*~Bç÷Ô»PJfNŠ&Úvª‡²´ªj�t“©t8�ÅñVýú˱XžSÕÅ/½ö7ßö¤—¿çÞ[¾õËÖ»]ì¿ìúÎ_|=î»û]³£“?xèZ�¿Uõä©�“3“ÙùŠîU»âÁÉ&BNÉ#nÉÁ(N]F‹ÙH…;\ƒIr•–úìA›€ªŽ O‚*‡…8Ê`è Ì\4ÒYZ ÆðcÅ}`%øÓ”:€|:ppô³¼ljýýƱ|2±Ø�Q’µˆÖ¾—u¿ÔÚ¯�Î̯ýÀ™ùù7òj Þ¾[©Wïõ]7Cwiyùðè䣫öÿdÕ/ÿBí´;Ü;«Ó2h)Uª9¹h³Â¼ªrävrI¶¿m –¨¤ú=J|yÍ�QÔ P'À¨ñŸÜfÉ=Xư2Ù\¿ÐÂ,”ŠÈ)@dË÷T£´×­à„Oxö T8dvˆ&?QÚÉ6ü_�H‘*Ý�zÇç6+w— í�Ö{±g/(Bà¥ð«¡®©±R4íÿœJA®j$ZUf¬îÿSŠ ‘5AxÀ�?DX �¥ŠÆ-¤|ÇŽí¼ÚÁoñµûòw4Í‚Ô|š‘ßá&7*…”CÀiF)ÚLp“-j° ²ÍmÈ©BµfÓŽ°²9ªª?/*N1„ Rµu³äÁî?¬Z[”·+£T¤ÃV3ªV ^à1XPr5–4$¡Þ˜ÁùPèÙ?î8F7ªÒ@,{ä’…‹#¥ÛÜP¹X“Ô—Iä:Ê”@t2ás‹g°ã„/�ZÝ�R�þ-žk #'Bmq…‚bhÒ£i’1ØÌ}xÐ"U ´ ”©Lçû¥Lf‡Ë^z¼X~Óý÷?ð U½îy·<°Ëðý/¼ÎŸX9Yê+úþ�ïY-x\•Õ5Ó½seOj-¢58•¡bRZ}E#î‰wž¾7/ÒÁüU@¶ªâ9Ö�‹ *JËœÕ"ˆ"V…å¿¶¦)nó¹�<=�ùh˼ˆZØÛ-¥»)Œ?"‰Sù~ye g„÷œ60ìõä²áä hÕZWËt=®\;È­Ó3?9�Ì^?íöîxé ÿvGû¿J¯W¾ïû מ¬Ž¾~©ËÕË_\&88˜b:Ù+(…@'X†OP•²2¶«·i­—Ã)KTÓ b³ *nÖº™;S¥!dq©)2P…7}O�!Ñ—ëÝj3¨Šhõ Ž,m{¿šŒü¢i³zj¤&9dGaI7"G ‚á“WiI>»B·‘ZbŸÔd6©NÆ:£á¼ÖЛ*i¤ì£®–bIz~[‘9åÁ3\Æ`.ÑR ×$–ÝPu“p�2\£Ð’/d…™hA]C`uþÿÚækÇØâ‹Î·�ýEí˜ šÁòÔ“Fž`’rVŠ ³¢G4﬿K9 t–¡xxõÄ8Ïý'CzÝ(§6µŽ×£ÂfôZ¤l·yŽ&CaVúj8{µ�3#Þ¢U™Õý–£Õ”¹¢…6 ÚœF…ËH! '2+‘ÁM˜èh�S­‰Ô«Å$5eïf¿¦lqž¨†æ!–^D�ìSÛrú€Æ`¢�F‹v“™ˆ@W"ýzõ‹åº¿÷žûNNŽŽÞñ½¿¯ð½»éÿÃõ¼7üÓƒ|ð_=bµºòœ¾®ž.˜ž+“ýŠÉ¡ÖÚY9³4¢íõÅ d#%3S…°}>­U  f-&’¼Ä¬O]%ËÄ£ÁåZÞÑ”¦[éîö{cÄ»‰ç$ä5ôúi÷päÝTâ0£Ó0µöR×+‘ª‹i™}ðÌìüM{³½·þÀ /ûðn•^Ý×{?õY®W_³ì�Ÿ³–ÕWé¤LfÓ}™Oö`Üó!gu€‘mZêÎÿ¼§‚‰Í–b4WH|)=]#ÆQ+£Úîfã’‡†ÉÖ4î´Ö|ëhÁc4HÉF¶Ì ´â©Œî³º!Qƒü̲ãï(é™ÉlÇÞ¸Å2ï( L‰�½[�­ZŒÕ`'cýD¹ÚðwHŽa  ­ÓDc§Ê*?­.Ÿ•%)5…�Æà•Ž|ó(ëØÇN²v×6c‘k§ŒŸ²šŸU§^:ÖVÛI�¼¬]ÆÔ*bPgDg'4ü׫ûõ˜¯®‚·DWì{¦®ˆ¹·ÀUJMŸ“R£GË9Pu`˜WÕ°¢¡ð[v!\!µñé­$aµ£¤ô#¤Ãh•ûØx #q凭"£аz(d'àwuþ?DtðvÊKgÈy?”´t�0:féž™²c€ö¯RUJ?¨>1B0h Um¬`žç)ÆPKÄ<çhx &Ó™E–õÊtݯy²X�dý«oùõ[žð²wßûï¿ý+wéÿ/®oºéûŽŽ>úÅëõå¬û“¯YWÙŸ\Ûw³}éµuŸf¨±?ó¾«+Y8ŽÅb„މÍ*ø÷Ík“ƒ£ž‚îë>)íµp(Ÿ§•›%%-´YHÇìupGn:mº‡ljA ZIü W„Á5Ëp§7Û,5€ª¬µïWÒ¯Ö«½nþÑédþöåúäÕŸsýç}r·J¯bðìµO-—._ž_<¾ô)úK=þ =´;˜Ÿ•i™ ¤ í>uýì”PQʯ³K—Q.Æ0öWwÝ¢©�Êý‘ iÀ6z¦ëÏ}’I¤©bжšiÛWBª›/®·æjfž|ÁkH&ù«lÌ=à.�™©@Â6ÆT‡¢ðŒ�4Ý î¤ê®ÿ×1` ‘9ø«ªÁ4EÀå7Õ¾†J¤¶bÊp’[òÏ p®€´A=X ÉÇ‘{¬È§ˆXª@ ¤¤:«eÂݨýtñô Õ*¢u7<Øâk'Øî &MÕLhhµZó£ÆnâŒjÔÖ’ùSŠ¥Ÿ´NP�ßj(zþáºÔÝIá"�jþiªÞ‰R4P ¦F!/hÈ„õj1,ÞæA¤»³±l£DQÔ~ ÕíÝ@§ûÛ‡(HiÄ3hv€TçIÚQ)P&Ni`�8T6·ÎFD �Êgš-o9p�$6Y:ꉬÚ@ Š”‘iÿˆ’i–ëNœ³Õ$C*Bà ž-†mšíÓÝ ±ÊðH;«j­Zûªu0€H™L0ßß/“éìpµ®_t|¼ø»wßsÿ³û¾ð3~æww`îÿÃë§îR\¾rÛÃWËKßµX=z­z¶›žƒ`&ZªªUÍv¤q‹ª§8"XV EÉ=ÂRÂ{¶‘V !&’zB™f¨ é™ÖŬôXÂ"°}Ú[b¨¤Ì¡Ñ&óHÚª6øÇFh¹%´)I¶œ³¢”ƒe�=#z™½Õ~µjÕ•¬—‹‚^×û³ÃOL&óŸ*¥üä¥ãnÿç_õ?î Ó«ºp,ónZnùñ·œ{ï~÷_ZÉêÆZ—OULÎu“y?™Š ƒöa·ÝnšÎ+Ïñ”½Âéñ¯òDG7í¾ó~qdûJ�*–òGAæáGFxÚec…oÀe=ù%•@Öžpàw \-KÑYA4!– (²)ªè¥¯ë²^¯´TO0ýÐ|ºwsW&oxÕ3þÝïîVêÕ{½éÃ?S~ჯûÜ‹‹û¿z�åß^×ÕcµC7ïæ:ëf~wh¸“`Ývt=e9ƒã2XFþ²È€1ïÀZéŒ2SÏþnHË_óÙFI®‘ã 6ÕÐ`6"+½«»y¦øÁ0@Näÿt¼!øŽiÈänèi/8òrÊ®ýòÚÜO0 º�¯þAÆ­J «‘¡¤RÍKÙž(°Q›�Ð{ûMV†ËšVíi:�X Ò ¦¦ô7ÚXš©Œ €\v+cì®í„˜‡–‰BĤÁ¬ÖaîȆjm<(D±oÌ™ •bÛl,§–ÒVª9àFØæ-x§„óö¸%WØM' î?H­­ñœ�‡ˆ[ù 6Íyì÷ß‚_þ'Oú´o°›`p®®†~J Q¬kÀ¹´<Õ¤¬¿q݆– NFbÉäV•ÌíàŠPqN¢LÑ~ú‘A¥�[�4g�…÷A>ÞÏö@Á¾« �ÉÆ+ñs[ˆ#�‰$�4b¨¤Ð:[PÚËnsªÂìOmwU�ÝT'{«LVuñ,××@°ü½ßúµ›ÿ²ß¸û¿ý‘;9]ç5?†³×œ‘Û?ö–óËå=yÝ¿ Gý«=Ö‡ÓÙ9�L÷K)S©µjÕ2ÐÚÝe«¤jùÑÃ÷R *½L ÑÜ—9…À¹�†"ŠvpÝûñÒöGã6Á´®y°$‚›%E‹—ÿ ‡0v9 é08fb)»ÇiÕàŸi™x*ú3‡za, 5FX­UVëUíW듃é™�ÌgoÁ¿‘OìVëÕ{}ÏÍß8}LJÞzýñêèI½®¿s�åÃzÑəə–™ˆß-õÈÀ†á%Elxµ@=*’h†›¦ñ°J¶éÉœ“÷ºŒoa$ó 9²¿Ù½½LÃÿR‚œƒ€‚7A9)Š±ÈŒXuqÈ ÒBl› X�TÅÇ“–vÍæ˜Fî+vd߈pQ(**´í�PBQ`XlŠˆR[›#J•�dþ €¡Õ¦M±æJ[ûʬ@ÆŠÉÙнhS¶¢† ¬‰±¢hÈ„EDDK©}·3Þâk·+ló†XMKÝ(H:êÉÚ:ùÆ5[ø‡ºš <€S¥„ZMÙòJåbP³›k<^HÐöÑ: êˆì›êJmÂ&{mê�žwlaO¥@³{u÷ÖÏhÀÖü‹ˆ +µPsãÒúUcÆ|�ú_ëš4x’AÄ�^C"�×5w�•§êfãê´9ŸÐ~$ IDATaJ‡6(±ð̽¡¥ fÇž@ÕÕ £I†+Ÿ3R��$¶^«ÉT+ ä2•xüv³h VUT*"˜-)âµ´ð‰8ã²Jé:™Î÷Q&{{«^¾p±X}ó…î¿Qj½îï¼å®Ý¡N×Ùk®‘ùÞ¹ùÉÑǹ<ùÔ·¯Nîyt­Ç×MfgJ™¨`¢5é­ÐoW©’Ó¤jfÀ@e¸_´púI[¼‘kB„NmÓ2Ãl>é6¢"h¶ ¤rdØÃÃ~=½“�ëF¸«˜:4…uzQ©Cð€r÷¦RµnâYµéK«ñž‡” iJ×­RµJÓžj_²ê� Gûó½29ø‰R&?�Ò}âUÏøwýnµ^�×�¿ï誮¯»ûø“Ϲ´¼ðmWV—Vº2?Ü?Ðél®�nL!Ò¾ŠЛ¨¦¢ýccÐêf-Bf¾ö–ý› ‰ƒq¤ átÆ£"ߪÔw;ÎÌ8�b†”wk„‡PŠi‰?¨(�#Z"†F1¤ª¢•U7F5h›û«IËt(Ã܃G꓈  �9O°r&®£í†cuqÄv4Qí+@Ø–çWcfe(�Ñö9g•ÄV‘ŽòOvQm%)�­NSm„nkl°D�p RA­m}:lA1)^æD�䘬B´Âž½èÚækÇØê1ÙÔŠ°©¾µ žý-ÑŠØ)°íGcR4Okm®o€� O˜O•|–£0­¸Å[;Æ•¼ƒ²¨Û˜ì}Jq€Žã›•ËVó¢Si�0cKH1+t0üÝÜË”æâ£P%ŠsN•˜|D¥KÌ8�š£=…ÖÄ=�_J«œ�ð¨é‡4ÅéÒ˜L«Þtd–S"—!,îØ4ý×"’ º«yÙŠ÷¾÷%ç¸ë¶G,—Ÿ¹î�ŸXõätsí&û�x™ ó¨]çÌç”Eì�ü¸‡ ÆU»’x$q’QÒ ª††;uòÆŒa³ ^Í 9iòí¤yJ&š�šQ´h›L.a…¶UUéë }"ÐriÒíߺ7=óÆI™½éß|í+?´;Œ¯Þëm÷þ›òsïzÓŸº²ºò”ãþèÙk]>:ŸíÕÙd.@ÕSW¹1=E’E–¬ˆ¦<{îʼnÁk/ ÉÔ-䣿O]Ðå/9ü’5Òh½HB6‹‰"„õ3�`–޳FŠÊ™åM79l¼¯›.5àÙt|*ô�ú»jBÊf2j-·ý<l™¹sDÄ ù¤Bùd¶EzJX¥¦'f"E(Þ:•W£µ ÆŒâaWöÖ’]©`8Eƒ˜z #1�ÖîÚ»k ¯b~ÍHÛH›:ÂOJ˜ô˜Ú7•1Z¬µ ¹Û³ ¬Š§öÙiG‰êä;üíi˜ó–w8³o„Ï Ù±…;}T6vóÀÜ{Šƒˆ ÛbÀ˜†‰žj æî«¯Þè¢9Ü&~3‹A÷§%î< È‚GN5ãt¤ �8wžî`néðÌ1O—G~Mø•’¦iÚæž¡—k見%\ÚÔ)"ï‡^‘pÏ€ù5‡ˆ%FÂöéGUè7ŠÁ--B±Õ'ÝlV'“¢‹+µ¬ëò¯,Wë3"ròª—þÚÍõe¿qÿ;¾ý‘ëm]Çßñ¶›ðž÷ýȹã“;ÿâj}ÿ7¯úËO\÷«3“Ù™ÚMD0‘žÊ(Dr·0o¶J,KYGÄc�IªŒ&GÒXäìežWýÞv Eœøýé'©·("Z¡fûàÀ"# Ö«û ywQl:D}$b9M2jÃVVÁ¶˜s3iOé‡*"�tuÝc½>’ZëÑáôìö¦g^ÿ®Wܾ;ˆ¯Þë»oyîä­ÿñí×_Y_yüñúøEK]<´tÐÃÙÙ:é¦Pj¯6Õö´]U$e¦ Ò()o3uk<M*Jf3  ðæ«ƒçZ»WtÜ#E×(Øä—RZ5F ñ»@Ü ¤˜D4sˆóÍoE/üœÔ(”âÌ£Øc EHÒF»PÛ=^*"ø0ã®ÐÙW‚–�©ƒÅ©¦¶ Ûº þ5”ÆÔ],Æ„ÈæcV¬,�q_,r’iŠ+ûq—$¨¹ �Å1Ÿjôƒ¤\ á°u[9§ÈH£³»¶²Ü}[¼!š’Tbq7ÓPICϨwfÙ{Þ06Ú]k;AjÐ ;”Rþí0oW6Ên”&„ö™s£ÛƒÙ)«”7e†¾)k°�«]€ð¹$ŸA­e6W-Û{kØ·Aƒvc§kˆÕ›gmááþ¤3¸í@$e­XkyCfø<�q””$Ö\4…€î&¯>D±§µïšÌ|‡…nʆ°s#“ópr7{^õ>Pá-`fšn¬É8:†?¢àŸ'[ š¼š ”@À¦j]b‘®ë¦è¦ó½ÕªØb±þ– /?[E®yÑ{V[yÂÿýw¼óù¹ùÅËþŠ£Å'_´X]zt•zÍd~¶+“L©x‚Dä�òøBÎDTe¯°à Gû_iQânR¨�újà¢:(€ê5S=ÝÔÖÁ½ø8L}Ôo™-­\ I_à®Uò¢`WÛ>1ЫÅM? ïJKíã®-úEM *(E¤ˆ¬û“²XM´—+‡ÓÝ:›ìÿä¤Ì^7醴ÿÛ¿ùŠíÿ*½Þø‰E½æž£»o<î�¾eQ�¾`Ò•éþô@'e‘‚æ5À+6ÄG„¢jøûºôÊ‘Z¡ä–�¤¿°5ÝÃwe#¾%¢1HI?”*JìŠ*Oqãñ�<¶AÝãÑL“ø‹Ó ?´&ë݈l »ò;’±6ÁkË’8“¼þÕ{(_ȧ¬U§Ÿ"–k˜ùXT´�©B²$J7„„èÅn•ZE;‘2�êDk]õu¿¯ý£«Õúþû/\úÍ_|×/þˆê'¿cËä.}èðÊÉ�†C›ÕNëà¢GÓÐã§ÕéNÜE!í‹d'/”H¨Nî7“ÙZ)�¥n1à§gL#è¬ oKº¯ë²ÅÀ¨šåãÀ&;tÍöÈÔŽT‚W<>Gš±@ŽÄžðçå³79“<* §+«ÁíÃcû¨¿ý„5åÊLëA�oÖ»©ÒÓœ%ÙÔ½ãTìÉŽí†'°žöÃÖòW®zª†S³ Ò ç@˜$ªdLPk­¥0�ÉTP—ÇW°î×Çz}('²~ÍýÚ-�{é»ïÿ¥~ågü´õüò-¸ðÀ­WN>ñç—ëû¾¥¯GOîuu8›Ÿ×n²'ªõ#{oe#1ç¸ Ýˆ[ì‡<$5ãµáWH½@‰0wIˆT¸ î(+"ÙŸ7§Hµ] ã�-ÖlâÊ`ƒ[ŒäÈö*ö·’ø£þ"‹MµY’CsŠÇ`®UŠôýB–«cí׫+çöü�ƒ½óo‚èO©¬w´ÿ«øúž[ž7ýõüÖõG«ã',ú“¸ê—U¨ÌeRöD´ J•$² \T\2݆Òä\PW‚Ù=©F,FªÑhc ÞŠÌ ³#'Ê:«&"ñ©Ÿ}Ī¿øÍ‹þÒW£”sÓùyE7oÂG“Þ‡ ÁvøúLúSù e³¼à^†Å�á%¿Å2^4šÞ#™ &ú¾9±°¤m‚)¼QUI¸ï-SÊ4o«f?n&Ô­‡˜I †›—2`“) øô×+¥ Š¨®Ö'X,®H¹xþà³n�Oöf:™ß\0¹ãeO}É®è¼J¯—¿÷_v·ÝýÑëï»rßsŽÖÇ뤿òÝ¤Ìæ“}íÊ,8KRbQ“ôdç‡ç¨hðüc2¯îŒgVCâ>€ÂY¾t�Hæ.:ª–°Æ‰�—…ÊÐ30Úk©”¿éxƒ7YJqjdÚ‚qqC`�t }7CÍZÓl6HÑLBø¹¤RŽˆÁ ƒò_\"”Ðç&€P…îHí‹© ž‚5ÄÉÓqä¨Ùd‚´‚Ùî²%LÓ¬_Y»ÕFM ¢ñ ”‘©‚•S³l?�Cp26 òU…öºl§ƒbwí€Ýµ}—Òì‰ ¤Ç©Ða¨ç46›+��Sŧe�ŽÑÖ+ÙiP6³áÝðÓìß&¹%¡šQŠÇDM%ùWù�’°Óé-²Ý̨0†U|h&NxQ8)#¦;îXg’ÈËJæjŒ€oH›ð\oG¢æ‰KòÀU†›À%—?“‚›1V¢† tV4Ð�ÇüΘí‡d œ—¥¹¡oħÀhÉñë±ÛEãîI3%3\ÿ"Ýtf÷éa_×_¹\¯—®\ºø¨ÿã¿úÄ¿ñø;þ§/üÌ”Üwñæ½Å]w=|Ý_¸q¹:ºA‹ž/“yíºý–jâ#cý@‡újLóûjh•ôÙ•”¾Ñó©ÓÏ¡yóÛ«G3q !4‰_�ˆŸ öHu‹Â¼˜hìüSi ‚ ‰+ߊ®c6‹?c7³¥I£Tíû¥,—ÇZT.Í&û¿sfïüÏÍfûoýá§¼ä#»S÷ê½.é‡ðÏoùçŸweqå)ÇýѳVº|„tÀt2“i7hç¡âÊãN%^"<Í!YŒÖS�Òi€Àì™ßG‚- š¨Qâ‹ï¯Þ [vu!+áæYØæJ½•d<›Q·° H÷ŒqØÞôkŸ† NÉ&ø·6MòáE‡á'hÎÉF…HqB#Íî Û\ð†V‰öSDÓM ûÑ!MÛ'éZH¿Åž€\Éðïfù*4ånÙcà´Ù〃M™+g^#TÃ5+Cóo®ݽ[Û{íL·{Cd³Ú(mcÀI¼ï ·’r]€6ê«ý)�±§ŽøÏãÕú@“ºp7ÆÎõkD $?NÉÆqf�šoC¥ç5Šj)ÃKÞf@@ÕS�…*6DBšG¶ðp&}dJf }”XÚžæ0´ÔòÀ—É©`‘/,_Wýxb>ƒ^:ÇQ¸QÒ�×Û2£-'²”-Ü=}–M«àŸ¬òEi…±Xì»Jš5¸�5?,LØ È†õÂ'±áWêiv¢t“™N÷DK7[KýÊu_ÿÁb¹zÜ»n~÷õõGÞÙ}¦­Ùç¾þ_Ï�®ÜýÐåú·öuñœÕz}¦›œ¯ÓɹZµ¨ô¢ÃfŽûáì¥(¢¥$V€/ŸæbªÙÚña›“‰<6¤Q(´ˆå’%‘°é_F� ª*oŸ Œ€{¢ÂÛ&�OÓ Àìÿ›C˜Fó$á‚f a�“”s¥Ú˫֗1xEÈ"ѵ5?}]Êry,uÝÌνÿÜáƒÞ$Z_ÝMöoÛ¸WïõÝ¿ð�Ý¿xó÷]ñøòc�û+/\Ö£/ëe­ûóC�v{‚Ú�ïiǃª&;^M°–oiÐ!\Ž—V}úÉßvc´VÖð7­P+2ü¬ È£M”\¡Y;lÅ0Ž´Dy)4ļØ1¥n2+‘ËA-ã ‹Óì@f3XrË`ÓgŠ"ò9Dr}e¸xåB>žî*hÄœfë2Æ'¨Jj€�Ø[š+´"Û™ /RÃa× É:C}ÏC€¿heèó�/!ÙPçD’ïO[ú… ûiÓÀ ¼Š� Û¼Œ›© ­�F§Q÷†¥£$±NTuÇØâkÇØò q8íªFî ¯S¶þFǣʕCnmϲænœ^­ªìu£1ÐG®s®¯R›ë€Z0HK™Wá^NrP·.®餈¢ èj5ӷ몵†Ï7wð»ø¼ì‘K_.tdåob £D²w’•VJnR vÞ‰›óТ…R‚o.ÊMW`¹…†a …Si0Y‰>¢£ÉkTŸ¡æç½ý¹*©hâiNóm Tjü»çEÌŸ¢÷ó]è~xž*éºN°·�õg—«Å—@ÖÏàÂ¥3gç?#"?“ÖìÉâc_×£o=^]|l\3Ù»¶3ÑZLZD¢ ·$�°'�ôH‘Qà3¥A 5Û]|ƨžîdy‚©ŠHÎõ“ 0�Ôgîþ·ö4”iZédï…1Fƒãe·d²3„ œb{Q0qpªÝÍ.¾©a#ØŽ"¢ZuÕ/±Zw¨åÒáÞ¹Φû¯žMfoÖº¼ã%Oøþ]¡y_ËõêÜïzÖ Ç_ß—“/èºÉÞ^·W'2Õ¢�„1em6öpÀ‹#$9ÁDÓ~HwƒŽü¢¢Rœ4ˆÌXq’ŠK È‡˜Õh0XàN”K$/qæ`«Ê.°Nâ‰/"´ˆ¶ôÍÙ,ßr(…ß Îh®1Dgß¼�矵p¦ wü¢øa:WÊU�SryJ¶üØær7Ó¡Â�¹'·@£Á§nt‘œ ul¦B�[±ï‘ëNÔ˜ˆåK¿IqŠqdXK¨9u�œŠÀœ‘y d�u�#ìöå°»¶tCDšÓRb;Q•�¬À×dL�Ü&ß=FXÇÝÎi¼Sœöw ƒ#ËɨstmÀ§ëÚ[e®eì䅘 ¬­Û»/öu-"µÓ!° æ�*™µQÖç~)/ ÿ9JÓ.;ï§/9�‚I~ÏVdÑ«¼š‰1/Ù^P’Û2ZÀ¯x8<”¬øÈs𔔯kÓ½T^‡ÈJ‚\n8ör7Ÿw ?÷PܳQ e2×REÖ}=³êû¯éÇÇ‹û¾ênù•wýÃ'Ýý'}­>÷ ?ræÒ¥ßÿËËõ…çT]=]¥;�n¯NggšÙD5’�}Èhy`ÎZ^íY6¤VDtce«ˆ´à”ƒB·Š$Kÿ +“˜•Ê?Ú%Ã5c»Jõfc¼¸½Ò´žÀ¢†°?Gf"›š¬7|0ªÕÌÚH•ªëº*ëåBQËåi·ëÁÞÙ7M&³·¾ìé¯Ü¹ý_Å×�¿ïº[?ù[ŸwiqÿãVz|ã².…‚2/3�–9 ÝdúŠH{“"÷@‘òÔK»ß#&Å[2𥹠é–& a+M�T‰‚Åüò,íÕYñÈGQó¢›Å]œ›½±áK8í'ѾD`_£ð¦¡c?¸ö¡ )FÏ`0 Ñ•²ØÐÖ0Ó8Ê•J*0ZÊ/ÞŒ“Ã��dce >ͲR ÊȯsòÓÈ�ôd²¢d¬#Ò¿»>ÄuO§Ú[k9Ù»kì®-ìÿÍp³Ü utŠ#Gû…­®jIö·¶#ÑÎæ“¥èß ª†± Å9¼€cN” ïz:®› r8ÖÃ^4ÈÂv.(ƒ÷ŸJ]÷½t]Õm–FÕµ P±©½Ø'JÈ8YÓ6¯[‰šÉ|ÈžäPvÂçANø`Ýÿ f}ŒeeW³ûS §Ô �óN`FMÏûšuÊIŽ•��î[ƒDH�ˆ{­‰rƒøýú¼6QVŠÁjN)„' ¥ÂFY*µtÕ2™ÉtOt¹8šI]=jÚËž,ëÉc_ò¶_ªUŽÞù�OþµØÿÎk^Žó×~–\8úäáñÑ�_RëÉßëëúI*ë3³ù5Z&{)hÎ~PE�ÛèëWq…?ûÔ‘ˆùÃìMÌ/<Œ$ 0Ó@°cŸº3i£!HvUµW“†ÄÎ$Þr³¡›ˆ7M-Ö9%çÍ&ôtÄk¸÷´ZËN·�¦xË�¢$7�ÆT�kZÍw ©u�ÕjUëJ�ÏÌϽÿ`væ ¢øÉÒaçöÿÇ|ýë_ýøÇ_ýƒ§ÞßÿøæçM?pûzȕՕ'/ëòïW¬*¢erV&e"ªlqZ„I%Ö0SÌir:QË©OªºöE#ÊŒvß`åSÊßÀ1ií{dóÁG°&ð‹“ÁoÃJ}Ý€ÆjôÏ¡¾V'¼…2À3\ÿ “ö=âUIçfÆïÁ6s»çDª+ƒ¼UŒfÕ¢Áô1.Pì%PQé*;Õ«µº=t¨—ªÊÎÔXD¤B ¨nö<|�5²+¡ì 5zi?iý¯d«Qù�)…% ó@J5$49à5~œžgló*GÆ·iNâyHÃ._šÎÆù$E{™îÖÅØ]Û :"ë’6sÌÔIšØö¾‹*)i¼EÅC´H¬Vi25w4Ý×x‘ÚJ^çòJ"‚+@¤ÕjX:øÝCP¬0*c‘Û�‹JSuPM['ÞD:{¡Y Ú GS F£H ƒ¡­q2HNÒzšJ™F‰÷Aç¬æÜI¥tVÍ…CºŽ‚}ÜÜJãmù«Š·�SW´ÈÀû—d"Å0~Óq³Ø\#ŸÈ1e7yÏó»Ëê‚ ÇQĨ@€)&ºYËùÅòä/É Ï?>é!òYüIZž×=äóåðÜõ“OÜñ+_±^]z¾ê•ǢȵezX�¹Šv! FWçÇׯ¾Œ• ÉT£K %ˆOÒøœãšŸ­ø‚;â9äx¢<0Í4À öâP )@ ¯ñPb�Âò•‰y!…Ñ¥UEU¥ ƒˆêª.t±:îPË…3óë~g6™¿f2™Ý,·ÿèS_ÑïÙ?ÞëÓ5ÿ?ñ�ÿ­üÎÇçÚ{�ï¼ñduüœÅzñ…2ÁlorP'ÝÔ€&c, ZëÌÎg Ú¯¸[ñÓ�ÖœYª¨šP\‰.<'œ‰Ý ™xŠì‚žlùC|£¼’U°YiØõ hn ™u•"£M,aʼn £�0!ß¡ð!¾}@ðFJÒq{ÿ‘W8R+%íÝÏj75elqYc•‡‡@«$Â0w ]Ç&E1öÐÀžq‘-¨˜-†í‘øOî²êS Rdù´$ñeT\¸ 0@6Þ&”MÕ4\5J™�`‹¯ýc«xï› Æøƒ÷d¤ã&”tƒô::ã¬ß8ÇH¦omÙA]Á�¤#_à�ÝÝwÇ:Õˆí�5ãê�ßöi`{=sF_C;“À¦6\޾ehTfé×yùDõd?à¤fxz N]c’ÝudpúBÙx œþÓˆ�]Ù4:°S› .þð” ãÏzF¢H¿£6sŠtiÕÌ"�\‚[6ù[ðë‰Á20�Τt3鵜_¯ëãÖëúLL'�ùê—ÞrþOÒú¼ÿâ>¼õý?ýèåò�×õò×Hé?“©–n_T&¢ulGæ δ+N1rt—ÝÀ?Mw2Þö’ù¥*ÇD«£�Q¯žøHBq›šBÀ þ kÚB¡Ÿ¯èÁÄPcµÐüuìv¢á–©H¾™í“�)Uíû%–ëcÅ}ónÿ=ós?{0?ÿÖW|í+?üŠgìšÿ«áúWïüûàë?õŠòþ�?u÷¥»ž~¼:zæR¯�N§³½:Ÿî ¢qÝ@›iî¨J�ˆ�$’qd¡¸ê:xÕfšªäÖ5ß¾Äh+šÑ´ä¸žò)Æ@äÑÞ ¢ÿ$SõÔ÷ÞcQb  cLwôpçЈ\’à÷(ÉÒÁ %�:@Xw©ü‰a +!»ÚGO¹‘À¼Õå.Ÿ’´¾ÀÚ ^˜uǨ AIáP ç‚Xæeª“ÆuŒù±jŽTæcTÁøã*rÐÀˆ" IDATø~¢;RR­¤ ¨ÝÛ|í[ ‰¶±eI“žQT¡Ý)}º!ØAà7ý˜€fX®1P3gÿá.h Š�'ê¬GäJ$_ÙS�±~=#I7é~f厰DjmØ+PåB¶9 Í"›#q'¬“Í4ê*$\Îj}r`*{ økÄQ©C9©�ÅÄÈûv¼2GÅ„^å¹óŸ9%kóS2�3P¸8EM=`R'ÞÙx6JY˜¢ýIkĬCÉAÐ U(ý+$„ª?�£Kâ&bÛ¸WU*c&ÃZ®T]âýf¤›L+tOV«ã3}̤ê¤_­×�yñÍï‘å¯|çS®êZñ›Þúʃ >úçV« /èõøÉ"˃2=_ËäPT;1*¾½wÛC,ïÃ÷+¶.Ív¹æJV—\Ág+ G­¬IòÈ÷W�l ç Öãà£�ŽW({²̦d '·i˜¦Õ±0§8Ã� ã-Zµ óF4Œ&ÔC:rõ¬@§¥®×Gº^Aûzt8Ð{öÎÝ$Š›j_îÚ¬WÏõOý’t?×Íß8y×oÿêõGË+�?Y¿ð¤.¾H&¨ûgµ+Ó‚Š¢5Ô|„ý·†C[ᄯ�e†b4°÷åö¨Ãù-“Ï;#—(&¾ÿf#^Çä¶kÀ³9ØU�L40궡¨¨úQoã5Éaäþ¦4l¾q\/�G-  m„cr‰Í¡�ÕÝno½'Ø0Ä© MŒMe¶´Ü —'Û‹�†Ì'uEª‹…X&î oªØ:í8G•œ‡á¶’ÊiYã1UÈL ž±2²Íðò!Žv¶_qøKŠX:í®°»¶°Ñ CZµÌ(êÕ8d抭…Áæi [ºT+�œÖÁ¸q­`d›2¶4å5ý‡|2!�ÃV½Os°” ”Ö¾u‹Uû¾ŸÎg[œŽ’GÔÍN¨e«f£:µòBÉ7Ú°X>ŠBâÜ©'PÚ¼´µ4 J¨øêÀ(«�º�d`&ª##Bâ€Ø$>%7„´¾ˆ-M&˜�±ÊéRÉÒOÓ©ËùCÖê+û;ÃKS-�kH0S�8³d¶QРÁ”Øöz€‚Él®}‘Ò÷'×�}`2›í”/"Ë«ymÞuÏû¾¬¯'ßÜ×Ë_…®œ›ÎTKÙ‘Î÷�aѶË#’®JhùyĹ! Q�}) ÚQ£^ÄF$}þêeG�X£ì}¡JÐŽá>àØV$Ý#7(4²”ºãxAmQ»?Àx"X’ ×Õéeµ>Áry4)Š{Ïίûóéþëf“ù;ÊDîüá§üàn¢t•^¿t|ÞøË7�¿÷Ò]Ï:é�¿nÑ=¬›Næ³Ù^�”i)Ðð ÏÒuV5�e%ÊØqÔ«‡óAYb f?)²<:ˆ÷Ôð‡*ÀðVu…˜Ò¾ð1ù™Á§CÕ$¹L1êf«h»y¥Š¨í¢nU$wpÃoþ6´9€öo'ÛT¤%´§jäˆè8ˆî¯¤ûQEŽ_V>§¥@vûœTËxÙ’j]!ü[Ì«M—¢¥÷¯�jØ(PÉÑÂeÉ翚gò&Ç�Ü(ˆn¦ä–i°TRªY´lƒ£*’ë¶Ý/^\`‡ì€ÝµÝÀ(Š¢pÛ=U‚æ!…âÆŽ&È Í!qÛýà~6¡ W�¨Ô“ÞSC†‚T£E!‘Ú~WTü´T;`!»pî;U±í["¹â…žM"Â~dYã§‹G0@êIÛGklð\Âf€¦Š‘bäT¿\š øÂ"Ž’ôÙì•"¤Wu¤¤Þ â™žïô34B|FÖýp‡ŸDVU�Á0¯w¸IE8$õ…Žã·í‰h çå†ÁY7›i¿Ò®_éC–«úDÕe?›—ãG¿ô­ïyç o¸ê"¿îµ/Þ[®ïýÒãåÝÏîëÑSÑáÚél_»é¡H-P6ºÒ¢B?ÍCH¸E¶å†2;˜ã¡ý#„„ xiD¶Ži=�‘åH‡/„£… Ÿ0”d½F7gX�ÅÜÐ]Çxý)È U=œ3!bÈnUÍ=ek""àú~YVëc-2y`>9xk~n>Ù{û=í?¾;J¯Þëg?ñªòº[~úó./.>þx}ô¬µ®‰IWf“ý:-óigçx;iªº’�-g‚ŽÛ6Ð5� Þ~ìúðã]Ž7}eïŒ>Ó¨€@æñs®§ùs"g�oCå{ÀƒAÔ‹äx”Ø ©‘ó×9Réð6>èŠÝŸ¶I@9G)G}æ`fáÍ,�B »Y/Ÿ�dOE$}Õq%"É�Ã`òr’ì\%™Ù¢ÆoD ˆ_ÝD¬e‘Q, [b)/ä�ÁO§¹û0D8žBvËbì®­ÆDu]æx¼Ûü5ÙÉýp24 iÕalmô§öã© 3¸A–1ç *ñ¬í%…ÍÉÐ¥ù´ß'üÉ:%{>… I®õ“ªä[ÜH±¥¬–ÝÙc´ñ}3¿>Æ)V⨆Ä_IùæYbÊÇmû>ç^$¹¢DYné Ú‡‹Äš4õ‘”kV$¦£§“%}tŸª«€DU«ùq!žÉñ™î\Õ>œ0ƒVOÔ&E¸ñ]ãÔìܬb- zRsòœ*YÊÑ-éÝ®zúÀd:W-¥[œ}n_WOî&Ó}�®Ÿð²·üfßëê—^ø´«bnôu¯û�ùby÷Öºx�H}j•þüÞü¼t“ƒ©†'©$_'JƒàDYÆ;L×¼ŸÏ,¤ÜçÖS´�½‚9Á�!¤ÖÀBTµ8`ä™zˆ({Iä81{_¡fÿjò}Û™­ïBô "CøWu5•’ZNc³½TGj ·î—²^-Tª\9³wÍûö®ùyy#Dv´ÿ«øúž›Ÿ?}÷­ï|ðÑêÊýÉ‹–uùEZ€ƒùí0kê§~`êiËRчSšV­P¶DÃÀ`ãm׎�eƒ nªˆ¨)��±8kä,ÉHÃï\èAäŸ d­(P$l4œ÷c×÷s¯&ÐŒ¢96Ú1q8dÅBûPàt/„ZIB¢‚¼­J¬q{k�ÒÈašàF ö½©ûÝò‚&sJ“÷Å:rÐÁ,„%è¨ì­q# �°¨oG8Ж6TÓ]7l„ÏıÊÊL"JBÊàæÁåú^…îì!vÀîÚZ^=sQOV¦³ýÉt.À”€§EÍ1 p©™b(ùñƒµU‚ç±yÙŠLSžŠ‚Í5‚`æ±{ª)Šxd¤ôš@  Ê"-wí·Õ1/XXZ¾e틞ÚB¢äS*Üú‡¤¢7ÆK1!È]Ic�`²Ž�IXÕï2¹(›Üg>NÉ�¸.ozšWóÖµÿfº@ÞŽ.zѧÈÈZN!¶„Y˜�•m³pãWvÁ´ói±oyÁ*{DíJœ™vsÀe/-XÛ–F¾amRç¥x[ƒæ_°»vÀîÚR êHHï=ðNåû¢faª†IÈùÆIX§kÐ�üyô”³6CôôH^†�¹ÙÌq¥D”®aj�¿Ò ï†3»î€QwKfÃ"*s#ÏʳdƒK¥D¯2ÀId±R¤“$Fv›,z�ó&�†8 j4r¤ˆxUàÍ^o ®Ái7v¤é5ð6ˆR¤•61�:¢ÁF|ï9–È–/üxÞ2>_í�ЦuZ €Œ;5x ÒÇ]H áGõÎ ‘Aši+”öäz¤a˜šå*~ʳe±-¿·[¯Ï¨UÎh\ˆ0!+'³R¡¡±Î$G�w!T6â ’*-T=ª‘»kì®-BDpX…NuçšQ‹$¹ÖE"¥J­±š#zT=Ï*8|Æõ³”?2ïs�À?a({Ù©P¢¬GåÿDÆ�)U¥ŠH•Áí¯e–*¥ öklu à� ÑÌ #˜Îµcâó€HÛ÷§l³¨’ žè4†;ì0?_ÈB|p £'9›ŽÀ- le!¼÷¼Ûq†\ë… ØÃ“U›æ;¿º¥õñÚÁém•Psh‘©�$¨Ìm§R®Ô-í½T‚Vßs÷Ù{¯¹æãßìȫTÈŽf6Ž;Ûl/kë37Nïy÷}×îÐŒo­ž8ž wïõç~ò¿nÞ¹yí©ó§>½Úî«/yù{Çžœ\³Á†Éê¦LÛ+0möÝþQd)Lˆ¨Ùÿ«¯è©£ˆ nkyĪ v4ŸfÛ›�ê»õÉtö¸¸¬'^ô@3–f7=v§îpÄ* 2] Jó£åC§@g¾ †t‰u�mF»wG¨-#ÐârÛ˜�[ƒ€Ó…×I™g׳™^7TÄ,Õ.eŒhxª �Š�)ŠŽÀÇýExüƒ˜ðýàeµR"ÎÛôã�Îç¾XQÙÎ|˜³®ilgZå†ÜFÙ*½–£YaêQrŽ×áöz•3Ÿw1'¤‹£í4'P¯ïÛB¡ÖJVOâJ¹¼èÍ¥Ðí¢Ø^‰úp]/ Zˆ™RS逦 å[yRÏà:ÅM w@­‡MèÑ8¬0V4#E9DéùÉ)+º;6AbäÿbùÊYã®N¾¦€ðß J¸ì¶öHþ²×’ßn*C5–6g”ú`ŠÎ³D–¨¤tÒÜSÁ1„£µt»4¶I$œÒ©X–O"(ÅdåÄÃÕ3ýHÏNï1í÷:„δDÂÇôû+a–(«³¡Ž}~yñ’“CÁó ÊO˜ÙÅÿKïÕo~.ÊùÉùùï|æfwþ_�õ™—Ûç–å5+à €ÁœOÅB´¸êž`ê¥-E1äPR¯ù]¥IæŽ< =îŒ%T_Á{“<)á]­fLYÔ+ªäÈá`R ˜Uó¬IYêÓÎ�Ä–-Y-49²Ô‘¨/¾k’VmÜmm/‡Êã'g÷¾ïduö†ÓÕéÏ.‡ñCýeýHû¿K¯wÝyþÑÛ_ß“þÒŠÍ——Åø X¬Ö«Åº.°’ D@´ž„*Þûžrê‡3Ó©j¯‘LËÌ$;­3“¥‹ÉJ{è]�#z7l—ÄMzæ =³�¡;Â8G¬7rYÚßO„â#‹LÇ’^ádÓ*T ¥Q’“úÀfóÐ$áSNQ®¹gpÌ$}§ï)ÔlÄ»»vo˜ÇÖj±ËP^´Ã³XàëùXTÏ jêDìÀ¾šçWŒ¼ f,ÌK öyU]Þ!*‘PF&zòpx1çºdGYë¶Þp#šžqÛwÌ#p¼±Ïóʹí)ÐÓWJHçKÜ”ç°;¡¨ïr�œ"=S«{Ï1nÍ·³=Á_ôŒ9n¸›ë Ò[¢Ÿâ¾û‹÷FV£»Cán‡cnŽ�@ÖdoÔÛü4üAò'ÿp ñëÖõ+á%˜Ö§Ìu-9´;Í“‚@Mº@¦<Ò>t>I7zGÏSâIxOPŸ‘¶è32÷m³tÊ7Þf6ÁÈÖÕ¡ÀV´#kf)ú‹|Ö Xˆ´�ÂzOÐ^‰ß †a]ëÖ–»Íîc.7—/ÇqXŒ»Ë—½öÁŸÛ×þñÇuu¼ò{#Þü•_üíAùª‡:ýðö±^^~à“¶vû•ÛñâÕpï°8å°º‡f¥Õ\…J•„[€q&TÉV÷Q:ë}‚Ôþás=¤0ˆF\¢x@¥¤‰Ôü˜Ð†=WCàIË.‚Lš©*)&é)Ì\1Õ«\ ˜$æ¬ð^ù6úU™@Œjäv·³Ývc +Z¯NßwãôÞW«“Gþ§—ÿÏ�÷Å»»½‰¯ËŸýØ›››/¹ýŠmÝþ‘Õ°(ëa]WeÔŽ­O©x*sf,iÓϹã™Çá {DüÄ‘;|ç;s†‰%„=ãÍ�M‘M¾;´D"¤ÙÌÖÈë+}z¨ÖE±lZC º'•A_ñA�ÑŸý7»:^Gà €(ñU7¸Õ¬}hÙ=F n»­Ý×Q&;~v@‰¶éÕ”LnºAŸ„¹¹NI è´tvvë[�îÕR~ÁR +•XT¢Œ»êø‘;àúÌ¿ñÓå‘oûÜúïmû;¶bœBÕR¢îözøÓÆÃüPMÐMÔv®× ›£~`ìè< )@U½³´y`Ìu ÎfÖ¬7JKùz‘�;ýÀ+"ÈÚjw-¤Yés¨Å�ÈÍPƒ‘]qE‚&¤É‹ì TPL?W�kC}ñwg듳iV“Å€ÁËi˜O ÿê‚‚åÒÀSÜ>ßÜ·(ãç\/ö¼‹ËËøü¿ý¦w®®�ÝZ�¬7›§Ÿ$ÿ#€_ò£ÿeµ)¶ëó‹~âXÏ_¶ÙÝþ’��ÿ�-/O«ë6¬NQ†jç-­H+*�TâHûèµ%/Ä÷”Zy%&œ+A9ÓHk f†B'|ªS˶`7Õ�' [= EÉž•!"±”­H¹/ûäý V·ÕT}1g1ݺ•(“ô¡=œ»ÝX·Û¹ã­õúž÷^_Þó UüÄ°Â‡Ž§æÝ{}ã[þ»áßòêûo]ÞúìÍxñMÕvŸØâtqݶ4Ô‚WGÒ¼aÑ퓜Ñí:㹸’ �vvORïŽÐýzƒØÕ]`Â~Ý{æ–c5œëŸÔ‡¨¿ñ?s ¾—ÆìÔÙ•C½3cÿµ}gèz…>�Q§Íƒs3�ÔïõAnÇ [ñ‚Ô/vðiØXŠTÖ#zþ.;U²�¥L@}mÿ9øz·ì¦=°Vƒ- ¸!¹ÆâëC–Výv$³ø+QÉZ“bÌõ!Q�·W©æ„¶ãb†ñ¶TÝŸÃGÎaòßìõ|1«6Vk\—cxŽ×a"¢Í|¶›§ó§ºY�ön©ˆz5"TéðbµÃ÷ŽÇÃ}nÑ"Ø©~ÂÓÞU½»OÌk¡ÍöI4œ…ç-ÿÔPI.P‹ 0ÕK÷ €O~«‘# ÃGôü¿4wºÿ$)øjð¡‚@Ï4MŸoIG†½ ¨…Q„Æ=Rï=Ï&Ïoó07‹|JÈYML7Æß‘I:eîëÿ²„‹:£ b‚ŽtÅU.ðµ ÷¨ä)@ÈsB•ŒF|›e;x*’Oç4x¬›C-*ëfhðøB¸¶MŽ"^|#³ƒ 8,×¶²{ w·î;¿¸ýÉ›íÅ«‰Ý'=÷úµ·/—«_yÝW~ñÓÿ1ÖâëÿÔWðO¾ñ^¯¬Ÿ}qùÄçn6O~úÅîéß[9^_�\ã°8!Ê¢%ýÕŽqˆÄdBÒ�sgŠj®ÇŸ*ÀÖ“Ô¾ ÊÜžx¢µ~…ÌS‘‘QÕ·h�‚¥ïŽK†RÝžã¬2½ñL/NÀn€QMò†,УÈ_RO 'ÇNoœáX*êåæÞ]åK..vÏâƒzÞSO<ùâ—ýðƒÿò�ç~Ôû?éSÿȇÿÒÇàÿScø5ïxøÚ‡Ÿøõ�;?ÿ­?T9þÑíîö§o·O¿pÇ]ëºXž™aѾˆš†’Ujê˜MÕ#¦iNï×(Ò�Öêè§×ì éþÕ[ ™câÿ…¥ƒ¬ÖÈ‹êÜݰ$!ô½Ç>…hm”×4ýD¡²�¹DTÀ9@É<�ÜP*�uÜm°Ýž³�¯†Ó÷];½çÁÕêä?øŠÿå·Ž§åÝ}}Õ¿ä>ê³.wç_¶«ÛO·B[¯ÎÆÕòdrÁTõºD=2[œ#»�ï�ÝMÅ­ðSØŽ>^™y’TÄÿÚ3ÇO2'CÖòÄ”1�mŒû Ù¬›`/¦Fs9ÈPõÀT–æ òN¤“m ûºG^@fíL½'0pvÆLß·°BphG9 pgEßòÅxù ÛSQQL‡þ¼¢ÂÜøw¾r³Pˆ):Dp-d¢q™½•%Q¶±g<“{鄜=¸¹NÀ¬>˜»Ù¯#p¼ ¬–M^_“!qAäÐ?�UÍÄû¦ûoѹƤg®0{Ç9²®¼r6Ÿ.B„æñDa–ªp÷<£N—¡™ÞLAìÝÒe˜>`ÑVë@W2„«ÝYK,«Uh�@ËènD¹d�¯33ŽÚ8<Ål±ZÒ7¸¹¼�;—ç/º¸¼ùüë×O>ß|æÃ¯×CoúÕÏzíÿñä}÷ß·]­VÛw»K#ɳÅ0õµVŒã¶Œu»Ülo/Q¶g�ðß|ü8Þù‚ÝîüU—›§?v3žŸ°ÕúƸXžLß"k3…",»Ñ! Q;»w˜‘x¨eÛã|´XÃçÏÈTêÍóÌ ­ "‘¡ÑUœ±Òô½¥O;»ñ^i‰²Ä_64öøh7“’P¯6{õÌ8™Ñ*©H¨IH`Ûw ­ u·»ÃíöNå®>s¶~î{®ŸÜ÷FÂÞ2Úx¤ýßÅ×_xè+‡Í¸½ñÔù“/ÙÖí_ÜÔÍj…vvrƒË²8ôY_[]=¿G Kë6ù´”sIó³±Íèª#ˆ€‰!ò‡šBc%Gµ©úEZÕ´¡Sb,KV³bê—rŒS�ž4ÔÑ®ž8 0+ûöE0ÚÜt³Š¡ÄÛdYSþqäˆ(ˆg,§Ã[Ç[âËäs5ì�½5$u ýäÁ#LHdÿFV2M¢ªP-Ö6lfê æM# IDATâ?ý~¡ßÆb! êI�Pã�ÄÉÒÔš¸-"�ƒH>ÁòC9n3Xd@ݯ#p¼nC,‹s:h´â�)Ô«YtÍ€vg@ý`2¢…[žAK€.ˆ�Œ«*r.Oš0S,½S 7•ëqÀ“,ß.3‚À”Ô=1t‹ø‰èAÉ,×wâs1›RóÄ=&Ð&î�Òœ#@ê�Xø•£ñïCÑ?Ÿ‹høòÌ‚O¦ÝL³˜6xA_}6 «®ìÖù1žÓbôç…:Ûj(€.¸0ûkßF�tü͜ꊲ0g«åŸ[øÐØfID JÊœÔë´œ·©•e§ÔÏ©�¥p¹>³2”Ÿ;¿ïb³½¶Ùn^vóÖ3¿{¹,���žþ:€_.eø¿–Ëåã¶°2.†b‹xzr­ÞºõÔêâòÖój)å÷_n/^|óæc¿‹¼ó¢a¨Ÿ`×eyfðæ0,Û¿ÎÈ=pHÂÃeÿAo„¦È=”ÂLî š<¾2OoDê"¹‘†iÕ'_¼e??Î T†WiÛѼ_ }±Ns^Šü uãN dR„” ¥KCŒFÛíî`sygQˆÇÎÖüÜzyíÁÕêì] [~è{_ñW�´ÿ»ôz÷íŸÀ�=òºûžºxêË.Ç‹/ßìÎÿ“ÅPN—ËÓº('er+™ÞHÄ�Ö$ƒ©ú�jî+>þÐL¸§¥*QºrYhÚ3Íã1ÃŒý¡H‰DÑY£eÞ§Ñ&gŠ€ª„‘øÔ:Ë%N•ƒkÓr„� <ïXÙ>>MÐ'K ²3ÀÍ�LhÄè�¡L3»ÏžÏ¬¨^(Å\ íÛª–Îè å8êí£¢™?>ç W/Ú)‹m„¬g빋™WZ§Í©u'†–j*2ûhÏR„÷äH4Ý«çܶœLÌà8““Ëg qêÀŽüÿãuðÓ+Bföh­=v��ÐÏœ¸s«\<ÝŒ³9dZE9Ž” ,Y6jÓ„×·_uñ,q+ðlV‰¥£ 64ÐR V«>¿¡+gî?-šN$¯?½¯�6¬‹ü1›¢Ì4u–WãT.V»ÊÍÝýÕZ5æ*Tg_bÏÞ®ì‚c`ÂìÃO)‹ÃYWI,5}-» ©pjSiÍðÉf `’ì™O³÷ˆú(Hýké!‰z à1…ç¦ÐL†²X†–Vw›aW7/D?ÎFÛ\l.ÿ Ÿúðï«Üþj±Ý—KÛÔºÛ�»JQ9V œ exAðI´í'�õÎ'ììâzµ]©¸Në°Xa¹}Â`:QD¿J2`I\Y扸?¾ù°eò,? > *QnÒ-„�/ƒ‘«ò¡`ñkr³±ù²ƒ2N‡SØSSÌ©äœÕ�Ë–@H´âL‡fÖ½û(Â0ؾ-HsÑÕ3¬ˆÇ y${›XäëÈ ÄŒšâ;ôÌ=ŸØg'*$³¦!Ö^u›³.g8ògZ4(S7âdÚüs�eó7€,b 8®‹#p¼´ÿ¯J‡E¯pY;?ŒR�~~Gû–\fG¦p\ãtE×H«£dIó¸DãEê²úùˆ‚–>fgÃMÁα®^~O±(ß+.3ŠuZS.˜"€Ê;ƒ[ÕkR�Û…R¤ÝN„Ô¼Ò96¯ÙÔ ÂÞ�bSÙcÞ™×…Ô¬�?®Z#ÎÄøæUÀÕ$Zônêo)¤ÚsÞ9/’Ó1 €â¡P•™îs¨ßLà×Þ~mBAÒ›v~`ŒýwTcþÕ9>œèCµ–`¬€[¬NÍk’ÖzÉÝx¹Ø^\üžÛ—w>¦ ~þÉ[[²n*wÕ0¢²‚¶]mÇzÂÝvMl—ÀnQ–ÅVËuXœX±aJH¨cwifd`M­yu“Æ.bïã7 ó¶xjoÙÅEL”*ÞÇ ÌѽXfŒÎÉ�ü¨Í€KA€nßÌ4MÊY^F½ûšK  Ú,qÒKïodÕQ¢¤ºu¦Þàr{aÛÍ�jVŸ¹çä�Ÿ»qúÀƒ0ûi²>q<ïÞë›ú3«ßø­ßø¨;›óϽ/^½Ù]|¢àdu�¥¬ZšEe)³Æ’H +æÎ'šÆÑîa7aç}G)&~€‘‰ÁPMÝ�¾k ›” jöt™ºóˆ'²CkÄ÷KÒ&!æ@ìlÝÁ¢K"AqRoîF4ñ]kM™™�­r„;H8jØg6êþn|ò »ýÄB rfHЭ”;/¬�÷ݤ1þ{¼ríáÓ¼¾+:"$ÂÍ%\Š’í|©�¹…šª�–95e 6›ÝþÝ'#³Y)Õä§`E‘ ísrfôÊ(‰=èé(8Çë`¯Ò�ª¼•cýšØÓöî…â%E¿[V�è˜9õQMb±ÑgvhþË‘~·t÷¾q«8.ý:Ÿ»Ë¿S¼QO'„N9A›ÄþųQ¦D`×à††„úOÐK’�RêáŰٜ$ÅI{p´Š%³*y?h]Š4ŸÚFï„9JaèËX ÁxÎÆJ‚í[T¹©K§W� bA”€áâh”’ˆ W÷ Ve¬Ÿõ’6ï³`C­¢æÀB.«LÊÃFsã+ý5ÀŒlm™ÉQâ²!S4t8Ѐ²°2Ë0°ÖÍ¢r³`Ý•í8šmÇZ€êEÎôbÅÌ€aàPuŠ¡Ë€©O®l ÷¡–ɹ?¾ ÀdBÉùXG"Ápæ~/ÓÌÒâîÊòô6ôeç»;_²©—/.‹ÅÉr±¶2,{šÑ¢y’Æ¥¯¦Ökt@‹Ñ•CRD,âûn&Í¶è ”6 Ëu¸Z‹äÐù;Õ:S¬4|O�=Kxôñ¼{Þ™ÿJ:€ ¨`¾S­Û›I¦ýDò{w€W¾² 7N.LÏ#÷<ÕLü+ª3r»ª‰ÎlAÿ•៤Ôs=ºBÈq׉M”ÉêùÐ'^m}¸KNJˆA0B#¥(ñ%ïª *|œ|£hb�Àý^%ÙÇ1ø ¯øè:}�ˆ"ô×Ê Cær š`@RFmǽþ¯ÆC�{Zû"Á!1ÑlSÄäK£!‡Ï¾"Ĭof”¾çžo錣›ÝD†$÷Ì[~5<‚•Ø{„Y�©ä[ oÜ7æÍÚ¸ø 3$€&iÙ�Í+ê=[´îŒ|±¨âÿ„T ø pÆõêÈÉ MÙÃ9”8…m&ÊwHyæHK×,*& ÎøUnÃÅÉ:fÀ`‹)zªÖ:Ðꮚm¬ÚÖØ4�§Ü1Ô p Ja)¥Õ8£q!4K‰'—MI0CiíóbäÞ¦‘ƒ'R¤éläQbJ…¦�/»¼‰ApéX„x ;›Ã�–fG´®ä¬b£Í8¢~�8³Ö*²‡¦Rr*Í} �bdån»ÅfsQ6|èdqöOoœ>ðÆ““³G¾ÿóþÚoÏû÷ú‰ßùå§~ñ¡�»uyóó.Æó?±åöÛP°\¬m1¬lÊ�#5¨LÈß ˜HJ¦R¼kN2aÚç)x§î¨âü Þ‹4’Öß*„°gYŽ<]Ÿý1‚&£/í»3ö»>=ˆ‚h(|fðÏ#`èV̲�©d&[¹‰ûKö+À~l»�ÌÌ�%íÜa©˜”¦YMú;;ž:ñõŽý?;äÍ+r§\XÂdÀ7ƒ]@—؇g�§½C›RZH^_†0( ÁäÌ�8CžÆ¹—¯/;æ´‡ý`&œÄQpÀבrн?ªu�³Wù(BÃïp2œÌgâ°Ý]H…Ð{õP€' MÙ«vDô6Üç½]ݹ+ù¤ì†-�š†m—Nùú Hº`Àž”º¾µ­å#x_ü÷5ÿÓ×SŒ³mrG”6iÂðyxÕÅ1:�S9aqÂ)æ©�ë'ZieOqÛºˆ4â<¦Âg߀…æu-°æ4yºóæ¹í¤u%:¬¸,ÆIœ š¥Õ‘Ä«cj‚3ÖK0¹SÓ W[P®�ÞÙs¶CmM�׉ّxu¡�ñô�Ùô•³ýWêèæ8Ý­‰k `Àb±Âj}Šõɵ²Z_ðsÏÉ}¿ðÀ�ç½i0>T‡õQó_ßüÖ¯]¾í—Þù‚›7?û|{ûk.yñÉc©X¯ÎlQV®£Bð¥J{HªyÀ$ú3cýÙh?#v)~¦«m®†¢ÕŒ•Óe³½©éh§#Ü%¹§ ž3Aábç›^»\Åþê l䩸#–`¼2ÍØ]ƒ¥Ý ×?УŠPß;E =mç•[4euôÐ"Þ`´eðÔë‘r¶OY]èÍ0ãEpœ�­—âh²ê_«5YH¾þÊ[ÿüA ; Ñ‹ �na-É?�s1 ¸<ŒÂ<›ÕÃ8‘Ý$ÔÑ }Š×tIû‘dÁ�4?ŠßËç¾É¯mgpÇ(Øê¬(s@1ä ^ëIHbÎ8àëÈ8xH”:DB†,XØë�Á98‘¶Ò�qÙ5«Ù˜¬q®zF 5̺“¸ÇZg³yH—©`Ù¼ Ì¢C)(ú W›2 †Âq‡CÎÍe­–\ýÃz©ñ‹ß[eŒžO½è‘0fÏ\b€±(TT´Œ€Ê�/‡y”�‰æ}¦z£ŠÅ[ù8 jno9;{’:EÝÓ‰*z>¡pËrè_[ïjÉ �æCŠöI#†øhAºµðÑèÏ]ßï–› "ëmzµÑ?&мMžªTÏ@ <­£8Èñ¡j-Îp¤gï²­ÃC¤„^O¾ÌÂõm®œz?eß¾¤ì¥Qzi¤*X‚(Ű;ZdÅ#F¡ÆæÃY[ÓÊ{õÛƒãdÕÂTuºÙ ¬ìF)15AY <€‚ÀaLÝ( _¼�Fûû ¬Öw——6Ž,°xâôôž÷®Wg¯?Y�¼s¨»ÇÿÖç|Ç‘ z—^ïýß7üÊ¿ú?ŸûèS�}ù¦ÞyÕˆ‹•Ű^/Ö\`ÕäoŒ=FOf…X¡Harû7¡Ã�V´ÔêÓ9-êj¢ ²ˆì¥*�{»Áy]�|ó,–n‚  Ðì{Л0¥q‰MŸ€Î:l|~g¾™.rì´îÖ jçELiˆÎtd°�ðb=8À98Áv ҳ뮈ì"¤Ù~žÇÓœYJÍlA“t„ Ð0Ø¥ÏqþNÍìæÁÌ»Y¢Ïà5±Ï�‹MSåÿä«è< §™%XñJ'V"¯ö|Wœ\ܨ"Á–±v8rÆÛŒ”â™÷UÓoJéÜ š8ýíØÿ€ãu¸­^µ•é¤ñ‰bµ+%cÈÎæ­ØTÜ åjâ“®¶i"èõ¼·=–šSÞZ=í¤ßÞfkZù·ýî§$¥õPxš›ˆ¨õ0pÑWüà/ÞûO¾æ>½ŸÛ‰Tk!k!ÊÕzýäbëAGbM†`oÌlÏÔÙÁ´úJmNà0t¿jh?4 ˆ vˆ§ŽÆûæPH€géyw^Êî{ó·YTžµðpø †ÕÁ2’e]Ä-±?�Èy 8§Â)° ¤UAµîL߯e²¢ƒp—;ØTI“­?Ú54ÆSÍ�Æñ‡™¡ÐjŸŸ·Zš¥DjíhQóZ‚¹ V�e±+ò±¨¨9`A£¿®¸7¡aæ6§(g×G¤¿˜¾œ<ðÄ~(9t8d)/€²:i]­‚d"–8Æs÷ÇØ‘¬Yº7TišïÑv»]Ùn/¹,ËÇO–×þÆÙý®'oÿÞ/|ÍoÏÁ»÷úÞŸÍê—õ?þ©ó§^z¾½õª-·Ÿ6¬ÀÕb]èͯ„nr/îæpU;$Ú€X„Â*Öô º)J$¤8 XïvUÚÏX~2‹”rFë•�%šÀ¾Úö÷.ræžgâs£©,ùo«{"ôCOJI)µ®¡X»‚B,w(T�>UƆîüîª =jå{¥›.éA2¡²…“ÑÛ‹…Ûƒz˜�פæ48D׈†ÔCanèõŽåº´¯PÆ#ÁÀ ,ÁU¹´¢%)mˆüg�Õ<ŽXJô™|F½3æåHÇ]ö¯C¼ÊT!²Ñ•¦½¦2…M3{‡[øÝzC�†ð¤ºn…o¿¸�¹ÑI=RYܸgmÙ%+Ýê[°%>%Oð|Êæ(Ô©{tØ”i?Q�¥:ŒÌœZÇó+ÏÉRZ„V[Ø0‰K;Ù}Ÿ…¯Ç ¬°¥ìCôˆrF*ļU™îX�ØFSÞ7}šò�âÄ-¢ËôÉ”[ cŸjêÇ”ó©áëÎJéÃ-²jV°µ¡cÆ5þ‰’~CLx�'Äþœ\‰«¹†P6‘Ôå5¿†Pg:8§‡ÞCOp…Y�豦]½È¾÷LŸngsT3C2uw�c/Öv.—^v机NöqCâ—QÇÊÜ‚çÉÈRô‰<‚�~l=÷2ÆT�+'†Mn O<21¢Í•¯¹bSÈ�baՊѪ'^ µÖÕq§=Ç믫§bŒL3qð3Š‹YF™c³ûÜQQË,‘ÚÓH�6\H‰|²au}4¸çþrĨÚA=?eMº�¡“€†2”^¾W[,zéÿ}ýä×ýáÍÕ £Ý– ¢y›íÛšH-¾¹¢ÝRP£‚H€ :Ð5òr82™EʽÛ3ŽŽîî鹨HC[Уy£«´ V5ë1ÍPŸ¿ø(U�ï©zS(ëÐÕÜÒÿ3þ�©½ddøÒ>§%ãH¢³U‘?Asòpÿ8ÿGG$Í„ºú„ƒÙ¬3†ß³É„¤!µ·Uš+d�`>ïOhÁå(ÔA¼R Ú9›=F;/5UX�i¤ŽE¢íL.8 åx“BúõÈ43|�>=ör�ed¤ ¾ž±pZ¨ßw]™e}rÖÿÉj»Ýìvç‹Á†G¯­ï{ødyíÇW«ÓwǾÿ�þÕ#íÿ.½þ×_ùîÅû{ÿ {æÑWÝÙÞzÕåxçE«ÕbµZ�ÔEY‡¿Ãx½³/mV¨Ù¨˜›&š9#ð7ú}_êî£Ù–ªÈ›{DªuýsXû/˜ ÚõúÏ›º‘0KQ°Ò¹´­ÝÇàTõ ãqˆ÷ÔF_zè:íŽÖ‚žWBr;Úä:Ø|i¡8r›�NÓnÞÉÖdæÙËÓí ãä“ñqd»i6®Ú³&eRCnÙ$�LŸî*Àoÿìï=, ê7¨Ш`àgI¥`‘ž4„˜cÀ3{ÄÝ¢bu?V�)ýDJÎlQ¶êM™¬3“‡YN26@¢p ü…ž†%�~¡øØxçQpŽ×A^{9öRo4Ûƒ /PJ5ö]î—IUæ´{i“2Î�µžòϯ$aÓ#µ÷ \)¸Í<ÔŒAŠf¸äºð(2 f‰µ¸0ÀÙ}ÔíclõjgJYØ»yY6SPÌ�,¬e bb®FÉs�Mp~S1÷~·ðŒ¼ŒZébÝû߈+²Ð£ÏE†WX 'ÿ‰ µ ¿(�™¿¼]ÁjÄÞ›ä^Â@&¦+ÅuÏ â­�úZùõœ½ &‹Gf&„L­æ9J1¦äž­X§¼ÖYýR”çhAE*b{FµáÒ‘Èsa?¯è¯m„Éhç©¥cüæ÷!=¥�ðÜÐ;3k¨ â›’“9f bÊj§Y©dµq¼ÄnwÎÁÊN×Þsýô9ž¬®?ò_ø�¿s<üîÞëGþõßÞó/ßõñ·.n~Þ­ÍÍ?¾åæS°(<99­ËÅÚŒ°ZƒŠã ú9°¯zsÌXL³Px{þ ë�¶lø‚£ÓYȼceœÞÒDÁó‹ƒeæëNÌŸ;¦ÁÕAþ`0%q´˽¢&&·žQ(û¾hH¤{){ZÓ`Ž5ÐJ˜Ths)RØ(s~óø[Ï…KØUÇÞÁ¼�ÎV³lDœF\*D ×ÙÁª�†?�>¨O <è]Æ~‘€yÆËÞÁn¹NgšG ÿ9àà)ƒ™Zs\Gàxf§×ËîÄ)s{lGtßÙ½¥¸9q Õ§»ß€�lË$‘élt+ ) �j=ûVŽ{Æa™´íÖÊOÛ¬„Âù\ÔâS´_X 6ÊÞ=M)PaVÁRæGÅa]µy«[iîèîüžÏ"9פ†a“é7ÆG ;{ì·v]í­�°Lúi6“¿ÓŒ¥/:“¤tÉÆ2Eú�åG4TM´:ñrwK9˜øE™ ó°ýl2Þ©* …(» •ÔP<0­$$!ܽZrUä¨%&Õ}ØË͉÷‡>ùSi¯Ñ«™`Ïä¯>»§ ½” ~Þ`Ùú ®LôÈô%Ì'&➯X‚x-øvæR_âПÛ/õž}¦î»åÔõbC†Þ…`ß’ŒUïµÌþ´r8«ñ-ÜœreoE¿Ѐ�´RwÛ;6noª=s¶ºï‘ë'÷?Ã;†añäñÜ»{¯ozèë¿ü¿üüg.žyéíË›_{9^¼¸¬Êxýú –²,V1=ãú05 /�® Á¾{ôy‹á°<ël×x1béK„Í`›“w:3–*¶"^iæ¢bõ’È2H“ƒ2 dó�¨‡4!€»©º™ ‚æ%pF€©Ý[°3§Žua�¨òýIO³÷î fäd½Ú)‹j=ë0®c´Ü÷ˆ‹0ÒE’ìÈ¢:)˜ë()2Š ÜV• ¡FÔ™7Á¡C™Ê“Z,…êzKœâ¢M‡‰•%£{7Kð²y«G u/† î"vŒa‹u¾J•Шó0¦UB)K¥V ÆBg9Çë0¯c àao‰22uSöÂ.Ê$.vÙR;`#CÐ*Ĭ�¡5&”·î·ÓÖA£‡aYÝ"Ì�wÀ€ðË´«³Eߨ�k˜Óoé˜{òè,¾Ê¡,«rn.`(Eš9z¶·ú-²ˆÎœb—("=š133âÔÜ^]ÊÐVÁ¡¤œwhY’)“’bμkÊsJº@×®GkêkQBÝc/RÞ Þk³üæÈâ±ÃÖÉžî»G‹à=“3Úm ö�áøõw³æîŸ×Êb:g?ȱ©ª?‡‘ èÞž…< ¥;Ë÷>%sÛ NeM�ñô±¼wÚ`Žì†&€Au>lW€ì—±=É]Ë@ÿ> i¥û“ºR™byèµÏôUMIY�ÐÜBÔ&ñe’…B&]°ÄÅèKÓ½¹ú*s;s§Ã¸aáØ×§„E!Â|6šÒ›ä¿Xµ­]nž)Ûí­å`Çn¬Ÿó¶“յׯg�,lõä÷~þ·iÿwéõðoÅ8Ž÷?úô£_rksë+7ã�-WÃúôäÌP–ÅXP«Ã�]b…ˆÄLVðKž†ÁãC\ãìÆ.ºÏP(?®VB$dz¢yŸ¡*½Q�I R6ž&Òò£ß S0FÊ´ð7Õ"‡{³Œ®‰f À âÀ§ñ¯-Ž Ñ…õ-‘x¬ÎmHB‚Sû³9yœBÒoâïé:‹š®{”§�l‘ÍaVÛhã¨ì¸žnêö  rØõ®Eø´¿¨À-â¡øtgx±ì™‚¥A@âEÕNž¿#‡$Ú* ¦¢— jåâvÜ]{|¡ ¶EfÞœÄoXŒH<�Ò,Õ/GlèÀ¯#à�/b–ÜÛ·¿9\Ý1í¤GíÝœÐÔ„¤OeÞ'B2¼K~¼1M¤O`;µp~àÏžÀÎí ‰ æÅÞñ:¸ëÈ8äýÐb\Ï ÜGV½í+ýD²N—�¹ò¿Ï§àXz÷ç‘îª�Þ |]LÊÉ`Övæžõè°>/PW¶:ÍÇ%‰FMªpŸ°Ò8H¶†Ã@Ì¿à‡~éúÞºàdE\X°í“Ç<¬ÖQm 7â7÷Fäìmo¦Q¬kÎÙ£®S›Þç8™ÌG赘H�8ÍÁ¢YO5')„r†U5»H%é´œQkXˆ[_È_%Î`’È jèÒÇ >2šmöMdû§ê)qÉÞ¸—J¥11é:Üä‹ ßBª�äù@ Y£�À„Ì Œ¹Â«¿ƒ.I30Á…~7#j6y³¢¥DDÞ„§”¬æÆœL�I–ÀÒ2m¨Qé’¸Ù(%õ”fÆ>²k�~Úæ€ ˆй½Ã�™i¢ƒ>9e 9Ŭ/ê>æ¦<†ˆOŒÿ´=ÔS0Ú÷Ñ_·ù¢»†x·ÛÙ¸ÙÖ%ñô�Õs~î¾³ü/ÞûüÛÛÛŸs±»óM›ñâS­'§×m1œÂ¦@�öØÂOá‘°Ú›ê~¼Me0ž; (P3’žÇÉ!Ë“-öF_“©‚bïÙ:¿÷¼•f•aõ›rÒûë—ÆöR¨,œÁŒàoÆ…ÿéáŽJF´± ï¯æY�ÏàV'%ÅÖþ¤_ëŽoþEÒBÒ?6Gâ˜ÓGÅTðS:Û묛8LÓ¶3Kƒüη͵ƒl�v%ñÓà"ÖÌÍ9­~àQˆ‹Hí>›'­{:(§^SCüg8á(1eb±¥ÑÕt†fƒHgöøPOi‰‰›ÐÏÿN`d9RCŽÀñ:ÐkB%;mMÐúÄ-®É ôCÚt*Ïp0'7;†Ÿˆ©E�™îÀC~¢H—x2�Iƒ>í»Õ½8R:.×®½z'£„„²úeú“˜íž5=ù#ízËWÊ­½eá6¸^ÎtŒ¦×<^|ù�¢sèÅV2I(zmÀŠeaF1CñÀyu„1D/ÖŠ¥ÒqÒ„°C;åßOgµZ‡Ø öbÒ‡çA…TÂ`[‚úÚMþGEúGÁ+Qœ¨™Ô ÙO_<üŽQÛ#¼Ø¢¢:,ZÆGoS('4º˜‚]8*Üü˜„•.I÷/Í¿2b¬¨ · ƒÞ„�H6ù£:¦–›ì`œZõáyÚÝqkÜcÏèÝîHï¤*E ޽ݽU«LåQðÏŠÃ$xB’f—d|à ™žD²Ô/=‡æ3›ŒçKðöW¿á8þe?îKfSTVZˆõØWî ™¬†`¹Pîg@AñJ„R™`Ò ÎăíñLþ6Í•0 Ê=üL“7ã’2}þ�×a^G À¡c¸*õÊ–|¶Ÿ›sGF¼íÓ�,´Íbô'Áp’‘ ÌÍNÖ0·¾�•#)¼jÞ%ÍÉý Ùª´TÝÇIÌÆ'WP¡U*BÕQ¸ÌŒbÿü6uÇÙ³�“œˆ…˜ÙDë çÙ8aÀÛÁ„ô9©E¸ÿ’þ/*,QÜ#»WBµ#.Oßólò$ÁÀ¸Rw§‘OjLq–—÷K ºŽ ª»zÎݯ-ûð¥û‹Y´¼¤>¸Ë!BÒ¡Y†ÖXCœÖ÷?*„²ÛÞ}IoÆf[‹¹Ó2�Iß_ã‹f‘l³jšh^%w©‡q¢¸³k3hÞA”Cðà±H¨hlI"ñuAC®dÞ³S�‰ 4¹–)Öž:`ˆ¼CÊ$¶r7n°Ûmê€á‰“áÚ/Þ8}þOV×þž?úßiÿwñõ÷þÕ÷ ïûµ_úø›·>÷r<Õ–ÛOÅPlµ:áj±nù«®¦2×…GŒê^ŒH¸ñ…R†Ü?²Ã]Ñ•�A÷l&—–¬iá÷л�é�2ÊÃ"“Ùš~æzi–bM"Ïfjt¯ÀTŒP‹˜$83õ;Äœò E&ó[“gÏ‘ùìE•æî z,Ó®RÆ`"عëlé’�MŒæ‰½ø„+ç¼?ô'þÉA•9U´ÿ˜QèS¨µ‰²%ŸŠ$Œ8¡¯¾=þ\ÆK䳿’ìõh^uÔ:‰e»¦Mè^Ì‚WØ•§i²Ý:Æ€ãu¨Í?Y›YWFBÝ>p7³dŽÞN~h ´ÏÂÚ¤þk€f­žéíîØ¾Á…4ÊÑ‚bn ì4+VD)0Ù'G„mJ+¯Ýç耷Eb°)ÃYüÆäf·c´>Ë1±Êí) ì²4H>=z/“±=”Ó苉’ç4ÑP"ÒØ�סђ€ç3¥î–& Kï[+#òÇ;k„7!€EG­˜™æ6‡ÅŸi,Îá!ùÌŽK @Ëy@>àÄ%§¤À}€%[ólzD‰ß«“þ¥ û`Kø“žßÐAÄQ%–)“l“ïÉóªc~DP-) p÷#˜õ·auÐ-ºŽ¨•>nÞØ•&á à¿@d>½Õˆ®Å³Æä ½ëVÿE]ÆŒ6Ú<˰oFÎe'QwS£èÄ ^…‰t›…6@Úî6¶Ûm*¬Ü¾¶¾÷—®¯¯ÿ$m|ûÉâÚ‡Ž'ÜÝ{ý…Ÿúúå¿ø×¿úü[›[Ÿsg¼óê�]¼È«'ëkX «é dœl“©ûduCq*SŸhª¹o«µ;Oâª]Kó)DÉҘϰÍe.�K¤A,'óŽ�EGVj?8»JÉ‚Æ,â1àB‘.š…g,ža’BÝC�sÐÓ:ã ¬)!N&ó¢NLQ¸Ís³¬^å¨ñhð=Òe]ð�‚n'ØèÁOsÇc?5ÜÚ­§Ó¤“›��•®nO°®ip%Ú½# ¥›Á¢ÈéÀ(8ݼˆ’ÞìÍÿe!Ú Œëc-ŠhájçhÛ¨IG²\ʶgÛã Øvt°3B=¨mÂL`ãxÙa=ê;^{Uc霷þ.ôc;ªÙIrMRÜºŽ  +úwØÛÄè:Ñ) 眿è>qÞµ´Ó”œ«èô;ÿ ]¤ë¯Y§rb½­­OOñ6ù�Ý*ÅŠ�#™Åð.óàfWÚÇ8&Èp3Û¼nÄÌIúíúE7c³Hr²Ý,$Š=Pÿ12íì‹'u,ªøªÑ1²›oø˜ÃM%’(\’Ò­˜¥¶nB BT/jèŸJt¥¶µØI¦OOæøo�Ü-\t:Â9�Ïéðl+&y‚#²�|í•;ŸÐ8£òï߇©~Võ Ó}0ˆAì|âΧï"Dä1ÔØšZ†µoEýIïÎú%ßWç×{¸S·ÛöRºÐØ †T’ŒÈ¤Ä`aóŒ¤<qk5Ô* ‘ÕK4h4cˆM¦)wZ¸ÃáÀPJ!YírsŽÝæ²,lñô=ëûádyö�W‹õCVÆ'¾ëåßp,ìîÒëGóGÊnä¿ýÔ¾ìæå­¯¼¨/Âr±^¯ÎlUÖVX¬kþÓRÀ7ˆ¸M`s8'Žèþß‘�ÚŒvUëü—,íO¦À²±2�òi©ÁöG4u/ ÛK£V‰e6 Ùâˆ�˜îGL·�AC«›gŒîôfIâÅLïOö�©mÖC#P<±$AW.9ãZB`ˆ�>ßæ'RÓSy 3§]z )E”Áèð”*¾ïâ’ÊÈ—y»÷oøñ/=¨*ÂɧëתçÊ8L q "Ê’u›¸�¡ ë£wˆl„ŽÏCÒ$Wcfµ1•ÝiÆúÙ9yRº €a&Atm‚3" µÔòëxN€ãu˜ütDR[«ë˜ÛÖ@¡JßPÁ€¾™yL^þ§ 0ݹ`š–$uf¦r¦H�÷A€4vŒ�˜šø­Ürd&·×W”~¨z€b¼ò‡e™;Èj˜‡>ìtže²¢Ò$·Žh;zEá!vFÑiYšc˜(þ% òY^ÕK\Q÷_Åx µ4Œáé2øîfàm«Iílº€N—ÿﳂh‘Ã2¯«¹ÝüJCxÎóTÔp(^Ít€(¦Eécÿ’›â_¢ÏÔn—ê*ÑY'ÈÊ~sH´�45Ð…S¶éÔL…ÁÐkÈV¢²¶1‰7ˆí¬§>3ÜüZö_ËïSeƒ“7�#s³Ø'ÿ®ú”GÕ+®ü •¬üh±Ö @Áÿzñ±Ms÷(ú\CIñ„;PQ÷œB+ªEôÙD×…I&ÒàB%Ö»•XÕ¾¾~¬}ÓpºX�Š óµö^�`�ž…˜Ò?b2¼BÐt¬pß4_¯Ý �aÏ Ž®7ÓC‡aªïp¾&» ‡jLo¤îv[Ûm7·®­o¼çúɽšá-Ž´ÿ»øúæ·þùå¿zì×>úÖŭϻ؞¿zS/?�(¼¶8³¡ 0š�I{é6)GÕ‰å ÀzH#ah¯TxÎÒg�.­¡.fÙÜ CÕóPJ2B€YÈüy÷>ˆcS&Y#h‚%ð¤˜"ÉÐácéÔa(œ¸gŽLDÇ _KäKÒûi°«|++B;ÕTEZÓ‚u¸ß+BÓ#cx¤¼nr Rgp#⫇‡0M(RRë›ÃÉô·ªÁXG«2èý+Ÿýwž>Ì'p׎� Ú�òé¬WͼåGÏ]ÓcZ±4œjVUõ³—QýªçC©h¦��Sf.)A?wã­¨‰@±ˆLò°ÎöP”é‹Ã¼µ!Gàxfÿo6ÀäHHÁZ aš+¨%{;KÙ¤ÿ²kæAèÔçdjBí™ÚÚóÙck4±ˆ£ŠÇ[…ßuÏÉ@1[Çe1m”Ó_¬NZœþ^µ2cøÖXt¿GÕ@гQ„Í>äèOn0Zý€E;¥yP[<5Ê8rò¹{)™t÷RL–Q˜ xœ=ŸÑSá™U5Q£Ë“ùÚ·˜Õë8.hŠ1”*=½®3óØâݤ£¦DY'Û ËyQyàÓ©‚Ì,R�“Y|N§¦œ3Ñ/8Í’»¡?t&åÂý䤨í¨tX†)ž«Íu~o-:’ÐW �£C2ttHœ;]•Ó :ýûé¯*5-AS� ­ ‚ÐDZ¤>¢ëèÓº0&¤1[2tM…’H4Wz6š9‚æ,“ô¦ÊíIüëŒ)Q¿«5m_`)ƒ‘£mwwPÇ‹ÅÒ†œžÜÿžõòô «ÅÉ#0>þÚW|ç‘Îy—^¯ÿÀ?,ïúçïzàÑgýòóË;_~¹»ø„ÅjµZ­NÇRVeBzè²ãæ«ÚåÂ:;Ĭ³h²»ânH “æ˜O&+'nÆ *èæ `M�ä:îdÕ”ñöi*x˜2Ëaw1­Ãrä;a“$’`¥UÀ†AD: ™às¯ÃìߊØZÉØ¡_‹%}V/yÔœÅÒ^Ýùþ)kI©‚!¾³�0ígkl¦â$ƒì…;¢X¯¸j;]¾â¡XmTÏ>\‡�èˆMÜu¸B8õÞfqr)vGtá$©C¯^+˜¤wBx^Íêcª4ž ³ç2ÕÏ¿æ(Ò‰ Ûœ {"^°ÛPL¿)Y Òg/!nÃ~ZBæ+•yºÃž*&¤¸òvn:G+'//ß<.�¬¬õ²p¼àÒ†ßY/¯¿÷ÆéoX-NßñC_ô?{ÙßaUÀ}„­—_>‘c­Ã0–øÖ¯ù”�8ÅèMÌ’)îû€š-†&4ަùnT,Â'ÙI–æ"òœ=Ȉd…õô šJ: b;ÐRÁÜ|ÒßÌôŠ —Jû¡²ÒvÛíÂêîÉõÙÙû–Ëå¦n¶ÿÙnÜ~&·¸Q«‚a˜YZ ‡u|„5A¸âA2Œ¯0¢‚]Ý ›�þ|¥Ÿ�ö6¬ÒX‹1 d8IM÷®JÉ)?K8g�’æ© @i{{²º‚&ì;"¼°qZK7ä#ýÉlÔHØnZ1c�™“—t?³¨‘Éà˜¦M'R\&�ëÀè[4‹`r| ‹ŽÍçŠPjFΡ˜ •¨Þºƒ �  poßÙ8n w—‹–¿}muï;ÖËko:Y\OÁòÉïå7 ¸»øºy~óäöå­/Ýl7j;n^¼^�­W'§#P +£0¡‡çãÙ,šQ˜�…¹ �¡‹–?™o˜êô-oÜaˆÂâ?mÅEø7¡²Ty“¼[ñø“ ×4‚ïbC‘ÉÏl�ÙÈÂìˆòjj€ QÇ-Æq‡Šó2`Y€uS9’3Ý‚ûÄvxD�:9¿2üÀ+)@fÂ+ º~¨­ l¶?ˆÊ»<±ƒ%f"A(»DøÞ<}_©�ÞsÞ®|×9ï‚|YYÍjq=˜jRm&†v;k•jž ·®uMPOr“!D5…üÀ7¬Y)b¡§ëCÈŸ»“ Ou›·;ƒøûî =Ïb—|¼ ;^ŽÀXâ¿6›MÊ6ÈÜR¤¹Õ¬î�Vß“¾,»£ ·ÐÔ°6qûöiK¼É ÓñŠ˜<Ì>‘Æû„RŒá†aà!åæ¾ä»~6†nƒ³ZÊVšuöÌp }a�X)vlÉ{gh„ò¢ÛF9© Ú¤˜Þ†L¿r;A}²•\àÇ´v»Ý°»ÜnPëÿ½^­fð&€ï®ÛË'Çí¥YÝ5_¨U¹_Ä{Só�ÉN¹Å×Ê‚‘d9b+W¡}�‘Üæ{Μ÷µÓÉG‰4q¥dDž$¹*…£èãð�Ëûº¯ø˜›wžþÂËíå«FÖO/‹Õjµ:«CYY‰Z…¯m³‡§oFáZ¡�oæ]¦'P˜Ï¿! Xiu†I*DÁ3kQD¾£¯•ÛS±$·™ÕE¿B#T0w Ó3ƒìˆÞ_¯GáM{|e­µÚX³Ê‡ÉúþjuÇ:¶øUçôÍ¥TJFT©óÿ‰¼‚@FÜO ©ƒcn9ß®¡Ilæ¡p&l‹>¬¥³8,Å)Í ´°ѰQ÷³G²½ýº7ÿ±ƒÔ7R¢~dŽ5WZò¶²îyÍ+_Ѳ(F³¦!0›eÄÒf�Wû¼A}hyëÑ«©ìŸkb÷/Cðª’d^‹¯#p¼ �2_MÞ‘7-ä&œ"P†ž›ø`wi3z¿ ð…/µº`/ïéóg‘ GÚPF¨IE§\c†0¸+¥ �$õÖ •)Àô�øÈ¿þÖÿ‚{�•lï¼Tx<™°15[ß÷ðõ³�zƒYyd±°£Ûÿ]|}ãCß°|ø—ù¨ËÝöå#ë·ïjý4+ žžÞc( Û�´Z�Í�>hub`Áž 9s)V¸É~dÚ¹˜DÍÔ®6".S»ÁdîÒ"ÑÝe¾5>Þüš +mhé,;ÉU›èëP¨8Ú}…â¨^ö2µ˜&²Kã²Úf»£�øðÒÖ?¿^œý]–៎•Û±î*û‹oMJ�îo' ÎqhôóÍ5ýVŒ‘’“š¢áµU ´+I=Ѿ|W'96ä~þMœ z8|V­ »Ä´¨büüŽ·ýébfö¯|ÓAv}íûèy¼};¤ôì„|ZJ£tf\'Œ˜2Ü"08Dj.mG¡ØèûWEùŠQµ‹vú–@(9ÄÜKI™™eŽÆe7½Ž×8^‡ˆ‰öá¥Ô Õ´Ô\»â,<ÃÉ=*« }Íuƒ@çû<²²Xra p4br¤“¡8¾AôŽþ÷TÞ2?ÆLzm }®Wë¨ê¿�øë3^óö¼�Qî¹o-‹tY„ºÜYkƒØäg3 G=ò³ɵ.]3©N½¤›VkÒTÆÉ›}¶äE7,G,.ÚoCw™0©†À#r\2 T«•F+(e(ð}áïû]�-WË÷®ÖËPн«n·»º¹,w“tB¬*;ÂT�Xˆœt§�¼tž):J§áêpœ2ÐrMÓøŠ Æ¡µÞ­»�6sÔR�ÐÔ¤p0Å{ƒ®Ý¥¸üEn59zÏ'W=+äg1´´arî°2É=z³S�I·15ñÐI?Ü$ÄY^¹]… |è¤KÒzT:€ %DrìDP’“/7Ù}Šû=DHW‡–¢‚„*Eº°ÅÊ0�Fn.îpsyÔò�Óõ}o=Y]{ÝjuýÃ�ÏË¿í8ù¿K¯×¼ï¯.Éú1|æƒÿÕ�íåWmêø‰‹åúd½>3ØÐë ­ø× =ØžÍëKÖ}qØ÷ À«“Ü;´FBékø{ gmz'ÿ½œÔ5sã\¬KZ}cÚ®Í7áN=gJ*19N˜çœžîé˜òläyæEÀZw¶Û]îÆMaùéõâôï—²øg›Ýå3»q3TŽÅ3GƒÕÔ±‡ˆìäû·(›’ßNî}­S�ðc²0i‘+âéß«gðx–€VËt׫|?4€eê- Ð=U"Ç;ºšÄµÞWÚ_~Ùß>ð}A›i|"¦˜\hÜ´É–Ugþ�(yë>[䎛!Œs¼Ó÷Ð!Áï/Á«òÆëGQ YõI�mý:¶€GàxævI›áÕˆé,�G3m�Ù½û lÔ{‡°ÆIô{ñ c®fTÜxy†ÀÙòÐßd�‰XŸÀYŠY˜yò’‚¹¨³®�äë%ßõv¼ë[^Zç°P 6ÈÞ²ÒùA_/ÇüÐ ®‘›u8¯{Sº®3M‰”ƒ{Â9Û7µ…N”fÇ_~èÞqqüRá|²ÂX­”ÂRüÃÏùè:œ¬»ñÀ½?³\.~²…ÛÍͺݠÖÚ)æ›$ ÌM¦½¯ü5¥ÎœÇf¸]Nì¹uúÝH t$0T!†ÝÔÁ �/SñÅi+=»‚XDA˜Ãò{ãsø Ë9:ôÌŒ¥�4áÙS},¨…hžD”Ä€"AfIö6f2�µ]ºÙ§¦ÈÂÓeQÃV޶Ù^`syY¶|ôdqý]×NîðÚÙ=?÷ïü‹�ýÝ?öMÇæÿ.½Þüô[Êûçß}Ü·ŸzÅåîòËv¬Ÿf‹Õj±<©Ã°4õÕA" #2-a~®ª}]°]ºØ¸…{ 0SE^OòSÕ}f¨ÎåLyßrzå4ííÃ*òíI<=c.Ì‘háÏtø¶ý•±Ž¶w¥Žõ饕÷.ËòÍ/|Þï~çíñæ›Ýwã®ÔZ¥àˆ.І+�øœ˜�1r¿|731˜MÛnö82ÍR‰¡–õló{ÌÆÄ3`8Ùº×kT;Z�¥©ða×»¶ŸD¡Û0÷Ä1É$fvtÏu$Hg3±w¬aö<î§zÎ=“Üiv0×_îUBz¶F=ft­ð,•Ññ:Çë#ÿî#Ü„C Ýaæ¨g·æIƒ5a±&T½½h8 Zê‡9¸[ ‰åœv‹0ÖL(WÊ…ñ–zÕu37Ñ®3€ÒäGì…US{Õ™]ÒGîõð·¾”WC3‡`lvE¸í“ô�"‰£ÃÜ ß¹Êß]›,–=ŸRbùü^ƒ¹«ÔˆÈ ‹qnƒáe.CUgv¶<Á p4°34«—µL•¶ŸÉìXùèz½þÙ““Õ?*¶ûõºÝ\î6—¬µv;o7Ú Mgsò?ºhL)Ę�Õ=áZêo*MÕy ^$h]?™-ô×ím6ƒïÌ¿’‹¶Í¬ ˆ°Ö�Ä‹¡  ÷ÃMùû ½ÿ�‰y©l¤üAªÃ9Ûí“�rÑG'õþD‰˜¼(–cŒèíÈý@gò6»„N¶¥z’ÏR'5J•”8ÑþF5Ä´Ö Ŭ£U»Üܶˋ[#*ž¼÷ô�Ÿ}Þ}óc?[1~ðx`ݽ××½ù?ùŽŸ|ÞÓç7?ëöæÎWo¸ûV OÖ×l(ËÉx²g’êÉ-¼bYDUrηÊå¦ä $M½…‰/ûFLc â8ASBSîéÂÔs¿Zø8LÑ]™ñCm8ð ™°'ð–èÊ›d±11ðœ‚T»*èÓz°X!VŽÜî6ƱnXýê�“ûÿîýןûÈw|Æ÷ݼµy¦îꎻ:Ný¿Ãþª¸ŠO˜†ª3WUUêGJéj{é¢5œÓwîçªs}2[€�û¶�JºÄ³`¾.‚ˆ~úסlèY¹a;â×7üø?кöÌ]Z¤wžSäúMfÒ8öœä–FíŒ}h¿î1<=CÄd x+W ^©R¢*ÙK¦É&·KñlÀ°MvO,†Í’eŽ aÇð€¯c À!_œó‹ØÅôÈ §Á›Jf9îš%HÐüÌ•RbÌ”Äæ2Oþ�d€ mvA•ìëpI–:Ši˜°¢¬H½LwJkÞa^{Øõ’×¼³<ü-ŸU95Æ)–Ôþ)b6îÛU†ìnÌ6ýÏ ŸuIÀ#$«š³i‘ »M,¢�ì­ó ¦Ç t'ä ‚¸Á/öSâÝZ¿G´.²We£ÁvýýÜW2Íl÷ß÷ ÿÆX†uyãr3rwyñÉ@YË'w€üÞ½²O§{o …ã}^“Ó ÁÍ3éÏÖœµévĽ8œÛ6v&mõ¸7&tÁkÄ ÃYÂ[„#)QfpcÀ�—Þ_÷ð°$LÓþš×U«QЈÏ=r¢)T&Å’c‰ezx]­+}Þ‰äÍ€zEJBߨ Å[ &ˆtDÖ`p‹1[¿]à13ÌìñˆÈqwiÛíŒÛËa…ÕoÝsí¾Ÿ¾vrãÍ×Oïyß ë×ç}Íqò_—›{æƒ_¾Ãæ+ê0¾hX,׋ź¶è·¼3€Ð�ëÉlƒ×ÊÙ`ÏOUë)Gz�sÒ}¼qøè”ßå¨ÏzêsgÛ+ý¦¸ ™v§Cjy#Â’ÜÓ€©‰-&0ŽjØÒÄîÓ«W«¶Ým1Ž»R »õpòî“áô g«kïùè>úffãn ´a¡qØãU!©�¨† ý†y®pÄéNïÍ!•Q”hø®�½=†Û FÌ-–‘|pƒ�a&>Uj?:n”Üç}Ï=x�{Ir3W §³i²K<J—Ñ¥M%¾ “”.”³þ„èξ~Àôÿd¹ëh›Å H¥Ì2žˆW¢Ä‚ Y�u<îÞGàx&P­†Äx�åÚ÷1ñ¨"gFÙzTQû)ËIpà•4Z“žÂ{Ó^/,üÀ´×ÁhµwŒâ$ž`[µ)N/œ½SDÝŒP~0×ÃßòYRÈ�Eiîé^¶Xv=žõn o|ÃÌ\mc%!%ÓìIH³¥ e(avÔËâãU?N™_3¡‰†>ý­É“ZkBËßõê?tþißýžß(‹Ó‡ÆñöIÝÖ{¹Û~< Ö‹Úœ´èg­yû'�7¬>þ¾Ž©èû·ÄUR{Ÿ C–zŸDe£Æ½1H‡~µ™+&çª^WD‹ÿšg0åý¡-œéÏJ�%Ìéz¼£‡í™]ée4ËÍ‚�”¼…L§í³•”hšÝ"aÉ-`¶rÚ·I›¦—úyçëÑßm·‡b07*wÜí6Ãöò².±øÀÙêÚ#Ϲ÷£Þpýôž÷}÷Ë_ýÄñ º{¯¿õÞï^üúãïÿاϟùÌ�m¾lW7Ÿ6 …ÃbÉŰkÀj˜ÅzZöìšõ„ÖG„pK@ÿ#ÉïHäxz\Ÿ6�ÚÔÒæ¾_°HÝ{ЂlÔ»Moµübå4Ò±ï%F7C+ÎRÖ½¤Ç¨·–¬Æ< –¶Íí권㶠ڭõpòkg‹ko~Îésª~û[ÿÐßÜ¥ÆMÝ>¼�gJóÜ ªM-!™>ºjSº‚'èP(ÜãhæÒE äCX2·¯fÆWN‚»Ü*ºÛ¢T}¢Âê·Ð�ÕÃ.wY'çUg¿ûÑ�ýþƒj]ѱk/@%øÆO³½Sbÿh1@ŸHr2Ë�¶\³ ùœ¡íÉ~$º‡1VçíÚíŽpd€ãu W%Y­ÖnŸ%5±‰ðˆ�÷?Uú Ç’žd5¯: vÓ5ëNn>û ±" bßÞí"J¶È(r´gO 8¯HÕŽô�׸‘EPû©9«`å¡£/yÍÛ1,ëh´ áòÃçÎŒÔjz‹LÖp·@Ÿty®ºÑEÍop:[9ʹÆÊÉ“=·ÙšöÀ{ÌÈh÷puFH\3ô‰™ó ÐÇq½°-F ÐX{±uVk½ÇÕ_Ù¥‘ÿ|¹Zž”¡Þ³Ým>϶ü8ƒqX, J­BÌ“N[·_W‡ñ+igË3[`á–ï”pxv»%è)¶Î6:Mp…ˆWyzðòڹ؈=Eû§BÐ9V3Å;f"¸Nq0Œ.FG� øØ{÷hÛ²²>ðû͵öãœsï­* ‰&Mm¢ÃŽ“¨‘‡ ÚÆ´FÀ옘ØI�Ú´#Mì@'=”øÂ¶iµcb"­Eñ°ª(Q”7�‡yuï9{ïµæ¯ÿXs~ßo®}ð�UåÍ8{a�÷Qçì³Ö\s~ßïû=`s˜¿tôKÂÁ‹ÍŽ�Ü“€Ôɬ°è˘3,3�¶·ÖeìViýöËË+ÿ~½8zùù—†YU›�¬“`ŸÚÈ×+ÉO‚æ¨m'‰æÒ6°±6ty‡5Àl±I”¥áw4Í"-2�ô°�ÇCElcÁ˜w07—³YÆ'òW¸x×ÈÌØÑ˜�:GÕ2i‰QqÖMŸ“T.Ö*éf’qˆš¿›®„¢{Í\*Öxuü @B$ ]®j¢†„§£Ïæ˜H„ºd±b’M)™è3±:ìäàp]Ä«ÞÍÔ[éŠÖpß*_©�siŠød?Žª³Ça&)/Êù³±»ÕQSÛ˜x‰¡6êŽôšêƒÇ6ãµ~•ÆX®†  Vª aê‰ z`¾ê[Ë¿ü‚ᒎ �r4jzŒ}Ô2µ ˆD0(õø™ÉPñKæ¢AT ä«-TLÓrH’ ÎY0³‡pÇçó�YÖˆ’ ÐuÌydÞ�Z6‹ú÷­/ݱ^¿pµ<þ¥kÛÓ�=ó/}ÃÁ½ë:½žó¦ïíßý›ï}ðo_û�'_Ý^{ÒéöÚg ³Õq̾_Ðäi�{ŽGõ͘Dð³³ÓA&o~Ce�ŒMîniJbäŸ#‚óÎ�õ}Wv}�=KL_cŸ!>ù£x?T\ñc]ý˜+Á´ õP�ÖŸhÛí+J ã8n0æM߯uôÆãÅ¥­ë—Ÿ¬.½û™�þÁ�ÍÐ IŒ�:uô?»û3‹Æò®+N=gûížA[¢Ú1:¼CuíGõ5ñ›ÏÒ}Ö_AìØvzl|néä± Óù"Éêt|‘§]9¼6'„\¢nÛ‹ Ïš‡LñÇ dÆÓ:\ÛoÊ+mŽÐ!XtlÊé}fžëÌØòq£*n•u…ŠhzFí§ÐÞÃn~×…¼8çÿºÔ¬8]q6ìj<{c´ª™ÃØ34oZ—@b—†ó��ësûìEkõ03bkv:wàm\¹g‚/32u=/²9*ÇluÎrêèŒ)@7õÌ ” ?{¨“Ö‚�^×1ÿêR¢/<„¶¿i§^x^™øßkÈ“t‚¾Âg5#™2§ß%3÷—¿õ ?úþù«^—úþFæí"�׌»Í`\X¿˜êêcVMñòŠš&Š£´à¥u°ñÖe§^ZåÖÏúÚ ³újCƒ�eÆ\o3�Ë[V�~˜†EOµåÔ\E°”ëZjæ±É¹ÈïAk¬’„[·+¾Ãh»Y}´ T¢Y2ZÖ 0U˜Ïn¸M�kÂò@mÅ+ XJÜE˜9sà8n�‡Mî­ûÀ²?ú¹Ë'7ß²^�üÒs¿â[>t8›®ïë-¿ö®O½¶½ö¥ß]ý«Ûñì/fd®û#.k3Àr +’Æ. ï� =oK НBÔÚ¾%!kب £/`2M»ŸíŸþ�fv-1+×OQ£ÆÂ,­©lCS6X´ÐppÙ4×´°ösÎ9ô0ž®»õ>YœüÌ '7Ýà?=óÑ?¸Ù›k´é}M�í`^RÄþÁ¶R²™®Èy¨<º?Þ~BiAñ¬áâm6Þ …¢vÿÜ;šü3QÀ!é?ç!Œ`šô‡XŸ³‡è5µÊå~Da³ FO�ŠÓ&6Ï,¢9�­} gú³=A`ó¯S÷‰ö¬™EG4 UŒ\èp€ |MÕA KÒê„[kmÖcN‚àµàˆö¢š¨yV'@iSÀºö””è['PÊ õƒ£[êÀS~Ý­ÎZ4×ÐE /"ºKJ6XΖû%hyg,•+€Z_yÙÉÑnÒ/&ÃÇ'Óõ{=ýgžÑ�y¸ñw>öÑ/>Ý�=íêîÚgXG^>¹Â ˜² KÔh?É’(<]ֽȨîŒi¿ÎwM_Lßb}jÌÀÝ€ JXG¨Ü¢S†xÎ3ßWª,/úK K àåR…b‹N4þwêtﮚ"¹)?ƒò�h#ÆÉl·ê�ß}yuÓ-Gýú%$ßnfÛsë$G54öEB9´�Rœ ê('ˆÀ?ÓÕ¦=£FÁYd€�ËšÑFp¤E¨6€eàöÿÕ0PÅ‚ÅCQ:ýó€ ; zuYŠà^‡<�’¨`•¾~ð –SÁàNý“ÿp’`ÔNš§…f¨¦RÊZB‡Ò-|Á:ùrš�o5A¤jìx¢�Ò"æàp]È Ñ"mÌéõш‘1¢·�sÆUs>�«þ¾h€oDé‘´3—cÖ=UéÏbM׊XÔiKÕP ­†¨&t"À†míqCâ®c6’iq±Ì¢w¢œµQ³@{xµéª ”Â6OñMa&F4A­��-¦nu4ƒÆJ2 „ð*È�JsÒ÷©“›Xù Y¿jøm>pÉ œ¤s¿;(ôËÿè/e3»úðÿóU¿�H¦„�ãøÈq³¹ÙÐõÝbaè:L\D—øù»ÕX;ƒ’«a*½VD·h¦Ø­\ÕkÇ¢JÕˆ�ªÝ56ãüŠ™PÛ k,�H¨ÂH „ÜQ¼ÀëBH%ü®òƒCa\Ê_ÖD‰f þŒ5¶ˆ•8L/¸(lfdIå™ðè¤é+³1÷‡˜¥¡|4‡;§Â›‘^ÐøXÔgT¹ËÄÌ€©Ü»dm<ê8î0îNÓ8œõ½uï9Y]þ™õòäÅëÕå×ÒGÿõÿðôÃLæ:½^rz'~úg_zÓ‡>þѯ½¶»ç)§Û«º_tËÕêhìmY�Iøƒ+—¨·@EYWríH‰½¡ô‹‘×ÍÙ&ë+3Ê6¡rÎÀacD‚Fê‡püivÖ¨‘b3’LU€h#Vå-QFrEãë›Ó8gp 'K §mw[Æm×\÷Ço2] ƒ�ÔÕöR1œ£ç¦ðw*�Ñê�ú( *ÉŸ|.¡³•„&E‡ÿ(ôÃ8+ÊQtH‡èN¾jÁI‚ÖÈAlϺ+@�vߨ d讋º%F®¸èë¬âsÑÆŒfOß'xûœ†VOßÒ•UKsúÀž³o¿°)„%(^Óß—æ ùDÐÙ )"OMÅ¢ôƒµ®Cõƒ%òœ{…Ù’ˆÉ£> X†*BÝÇ©â›êО�†›l¬ñ…Ž” ôÔT[õ§§šèLä}$ü>u!oüé·þì³^qg×§ËïG~w›OËà¥n±¤'ÿqVÀÍø…­3x5Ó“Š>xö6‹·hŠþV“>göÚÞg(ÜÛ²)T[�ºØ6ì�a~mk¢×NG0GÔ �:['d˜F�ƦÄ�.·÷!6e7ºÚ!bª·°:d×rÜD´©jê™EAA&J3@*"ÓØH„l#ç�ãxÖ�ù4÷ì?°î�_uùäA·¯/¿á_}ùßÿÈá<º~¯Ÿøð­éù/ûÉ?yíìêc¯mN¿v;ne‰\-�Æe¿.J•<ßab7-t£6dL:GRLU$šâ—Ó*o¨R•²4�1uŒ1±èþ­õÊœ{÷5]P#a0kÜég’@;oŸ¦Ðî)øYÕS4M¦äÆÁÆq×�¼gÕ½ýxqò¢Žoz) oÿ]››ÓÝ#AµìdëÜgsXe!d²y¨êЛî9*#PMƒ•K*¬ ߟú‡($ˆv_óCNŸø,ÂÑæöFTc§Ãš¿=ÐØôÃ3þ&ÊX5Û­ø/)ãvk§´Ù`a†Ë´ûÂd>lóœ?&uÕ(Ÿ©�Ý‚6g2Iîòþ>"Ñ‹Yéz¸ÀaO„x¤K,mæ4†@µ—¨ƒ4t ¡R"„8ÏØr�¹eñ_§~%IcÓ>-â‚<°@rT!uRx[ÅÏ‹$³0Š �U«÷ ™y´‹Í˜ÙZ——Œvz�Mõ7fuŠð! =™Ó0V]ßÙ¦Cx—]gøÐÓ«©¤ªö1L•¤rÀ£°ƒ—šÚqŠ’MÝ–K1t(´QÆuXBBú$æ�¼À­—._þOã0~Ùµ{®}õ¸åà ©ëúÞR1"¤†Ô5�¾šHÒr�V]§O7W¯ÌZø&žŸ„™ôP#ëjÑ„ÙÅñ‰)MÃ;]",ñÜ„m¹Ï˜(Zr#›!©âH^ÿda,–K¾„°ö5%Õ£Œ+ƒïQÉù…³_6¬d s—P2Hkuˆ}±Cìn*°¶IG†­1ïÆ>¥_^Ýô²Ë«¾àë­ßhÿ×ñõ´Ûÿ·þç^ûª›¯�]}Üéöô==»öé–Œ'—o`ß-� 3jæœdÉ*¢\ßZ •±¸éU§L7åDì¤nCá©dö™(*Íдðù³Æ¼“6k(P®r ¨ò.SÝ‘©l§lÏ„5g±5±d!„O8"tu `óȳí)ë_½aùÀs¼¸t'ÉwÜþž{o2kÒFí¿! ABûhÉhH€Y^ºíhqrçÍÇ~÷·~Á³6¿¯‡–YáfÊ�S[c%Y8±_†©®�£Ð‘Y“¤ã†P_}‚Á‹ž4¸­�B|D�ÙD&4L‘+�|!%;(üF•Ξœ™î”Ò±bì®å¯6¿áa( Kå(’”ª¨¢3Ó$­*|þZ¨ƒ& ŒLŠ/¼ØªúLÐu”íâÉÀtìÕ4‰).´ƒ5Ä8\¸Ó£½CLÄ›xÍBòØk{T´Qj{Þl@H�ª|ך33‚k[Þ²Š¾0Ì­Ìý 8bîV-ÍÖûæÄF†{'Y“—jŸ�‹~ÑÆÄZcö{ƒ…}“Zéé4úZ•Ör$›ÑT ;3£æø¹!¯75¨sÖçÿ\„ྵZ6eœ÷áü䈔/ÿ[Ÿyõ‘ßóš·­ó=×úq7¬ÇÝöOlÕõ‹¼ØzÐÿ›³Ä…¹²búÊ”9[KÐA{¿@𯾸`Eù®{Ç>Ö+‘�äŽé³.L~;F13-MÛžE¥»]bNˆC•sà8nSvcŸº®ǯ¼ñø!Ï?Y_yã÷Ùß>Ðþ¯óë5ïøÅ?¾Ùnžpº;{ÒnÜ=’ \®Žòr¹™*pfHÅÞ†±^œ¦kMÇêà=iL…SkwH‘ ™ï‚¢6Ê{ì%ù…ç,’r¥�‡ù£�ˆæ¶€æhÒƒÕí�ó0L!Äx[‡<ØnÜ&d^]/.½ë¸¿ò’+ë½ÔÌ~ÿÍÝÐÔ€>�GXðÜl(ÎÜLp 骽Mldá8÷Ž&\e[¶E–>Q´qs¶WUTí·njàq�²õ‡NOs-«ÓÚcT5¬2 ª^›6·hD‚û[ƒýT¬sëÛyr+¡Æ‹t£%QØ�ÿ6Çù¦b ·¡ZèÒ ãa—?‡ëböy9N9ˆÛ¸Í•ÁȰ’Òúuðùš;vÁÜæ«TÃ` Ü^ÝÆÙ”ýBâ&5rÒ±¹wrø¦²ú£|/…™€a·›g¨_¬+còJ'8·Ãe�%rºj¡RWã@€ÁTŸ¯¨\ vpêu½Ûð9¸xS‹$¯8ÎsT{l­¶I”ÐÀB•‡ó¸îÔl’ Hß:éEËúÑÊ'+˜ƒá”ä//=,O·›'Ì5Ð-ʘ™17ty}5ÃÏa9íãÀ�ÓFÒU”åÕ±pNÕ¼ÈÓ}o ”oFáªBS´è­0s1ó`ÛPtâËèžXM¬¶´<-N�Ñ# ¯¸~½ajš()þ$Õ†<&=ˆ4=Êl�¡yk U�LÞºÊÍc›Q׆ Ê0xJ|d6Æa;v©ûðå£+?såø¦[{Cgý�ö_ã¯;ÝnŽî>½çQ9�O?6Ë`>>ºb‹ÔÃË…¹S�/dƦA6vÈa˜rà§ô‰³„·Ùšó �ªr†²èý‚¥Å® 1Ýp^³Dž n¹þãÔCŸhS;¡¤šÐ39Ùh’?@€³‚oÀ òhg»kÖ1å£Åñ»¯Ýô“GËã—’ùWìþÀ¶¢„4¤ ,˜n6J3DnJ`ÐþóNÐqq˜­ö©›PF%D¡ 5ƒ¸ƒ1uö¿Ûë) …ưtƳc°ÆÔo°a¡\Ü‹µª \XÕZ¤í–úv:@ç©À×¥²ac�í�@Ì‹À3cK’®Ö8ñ«ŠöM§vXFd/A¬%¨YK²tðg/ù"NOÔ¨&’ÌF;àp]Ìí°ˆv½éN$3E†*’aEBU²úJ‡—¥$i\÷üTœdr¨¶ï¡6„ÂÔ~ ΆæNÛ!@ŽÃZRÿ",·”Uµ_#bW­Ó�ºnÜlÓE>.s3™e4Í=VÆÚ¶®ÄºUè‡P�bªp_,]Ûˆèü\h®V©v]´�G^°zƒëœ½pã)_„Š&L 7w¢Å&˜uŸìåÕßüù4³ÓG<ûÕo&‰õ¢_ c~Üxví¡Ýê¸Ký"[JÓGÍÙ € Ù¾a¦8PÁyÐ=„ LáÃm‰5;˜¯B¼GX—iDQ­r¤’àúzz†‡9¯×Ì�%¼³úAƒ¶ÂºÀXD¼¹¡”×D‘`^ Q‰¬™^ÈY{¡›bMIÕ_ Ï�ÌÛ{ÏFäâ�Ãê6ýI±aËyÀ8n�<¤e¿xÿñòÒ�GË“ž_~;~ì{÷7¤ÜëøÉ+wo¯>iÌ»§ÐÆÏH]·^÷K.ºÅtjd‹ðcÕ‹#\àƒ?Ýašþ7ÁwêX!Fb¢•sž¢`}…ï© e b¿B}�œ¤ÌvjH$ܼ_ÄR´†qÔ�gªŸ:­Á"M¼Lë}ª/=wãÖ†q—ztãñâøí'ýÉí«ÅêöKëËïúŽ/úîíôÙ e‰¹¢Ä` FX‚Ô¦øï{’¡1PÓ7kÕô€dGÅd³¦>’ナfÜítb–áj,zo¡ˆÌBµ““~�ä$H8(½Í̬S»…ÊHMf$:`LÏW”òð¨|~6ÚµFgˆV-§úº&¸¡$Q�’Lá:Du2‡J/q½‚l«…`ãsákíx×ÅDX,ƒ£âJ“²|ëhÔbC2È#l¼úMµƒØt^Ëbëv+=Icp«nȵ^BM>6˜¥ÐÅíM5 Ýy‰ †%‚cEiÂ.êåË!“ñ¼È]‘¨FÔœÜB螢Ûo¿‡Í¡:sc†q«{Žãæàì[–¹Ì9šL±ho¬†•+ËWÊäÚ¨–ÁvM¼æ�úè#žýê×õ}wrví4åÝîK˜Ò·dËÔ-r&M½»*…W'rêSüüѪñ%¤š~Ô$€Ë­£5)vзò&YåÒF*!“£ Ü{¢qSu®Iª¹6Zó1kÝÿêÏ_ï³ 'pÏô?¦±•UÁ¶h¯?47X“I•ÅÈJ,.ÑbΩ$�©„ ælÃn‹©ó+—­+C‹Du6 pf›"ðpã~¸wš{×}¢i þšH‰‚1/ò¬b MTáešïÝ¥‘Ísƒó½`�çô^ð«æ‘îÜÈóþ–°Mq*gu…&Cêb­ƒÃÞ[*¬6'Ï5Å/›³7æd•V`¡iÕ�l'l¼IJ"eîá:‡ë"6‚–«z’1æøSÆÔfdÖ-²ï )#Ö¨øCÄy{BgÝÙ0U<ÉP¶'mçÀ±‡!dŸ_#3XsÄá•;8fÒ:–)øÅܺd[c¶�fcîrÏ4�î¨nYN;X«wŒ0ªÈ8ïœam4UÀ¢RiÙŽª d‘Vbª(BÄÛ‹í�t»�“�Boõ<¹jÌàš ¯–c&‡‘÷Ê¢¸ffw¥”wË…ucÞ<Ævø°„¢¶HL�‘ÙÏ~ÂÝc8j>ÜSÀe46[ÿŬ\[þ�XÀ"¹Æ¥H[TÞ¬b+®6‰BÜWÄÔÛí8^ 2W¦rÅž#,:ÅizXlžò4:™IåGÉ“Ñr*ùGZ˜º…/8?„fáôšêA+eåý“,ÓŪ;v‡í˜SNY/O^vyyã Œöê®ÇG‡Îõ{ý•÷Td³ÕµÍ飯œ¿evŸ•ii½¼d–F&dfŸôN¨Rª¦ùpòÙç˜Æ²k&¤r3ÝØÑe¸í^%³Õ�X³ácU:� ›4) Cº-Åy§}K¨\ÓÊ3üßädrк<ÆæºiÄtµ�RI¥HSÒ¡ÿ�ÅÊ©ì…I(Lˆ9f Ò�ÇÐ=ýBBèd€êùàƒ 4VŒÿÓ™|ÄM8% _d¶Q�ÇÓ H­?A6C6"Òr:ìüàp]ÄþâåWJ]}ë¬!Jþ5P˜E�«#�'Õƒ”f�´TJ'¥€�ýŠÂñ:Cß¶ê°ÂfaêojŒÔøÌåÊC,½Z$sÐu4æ Ëy:êü¼šz2ò\Y‹j¾-5F*˜O©©‡e99§?H &¼±¡ÎÍ| 믲 ÝM¼éXÍ\â }²·HaË<ÅnÑl4üáÇ(¯yÆ£²™]ý¼gýÌë�Ì�ó"�›/s~H·X%ëú™ ]Äêù«Fq¸½Ìƒʤ‹ZºÃ»êK“ç™T_�‚=P›ë7ç+ífï"49Øóò*6è¥l�„{äÌ’%ÐSA­îbêð=UçIdSÎéOŒ™#”h_$PÑULÅý U…ÔÇœ‡³k6î6ýé½'G7¼âhy|ëª?ù¥ñ ù�¯ú{‡1Üõ¼ï%[uÄSNwÛ§n¶›Ï´”ÖëÕ:w‹e�ÇÝ+ÒLuÑì^uð‘Ä�ÒZ®8œY"ÜýÊm™ @Ì|ÊM¶Ið‰–€’F‰ˆP“ºp&„�!8¨5#Ã8é 2áMªs³|ü Ýò)S5&±aÜb·èh\÷«_[/Ž^±H‹[–iñ–ï|ü�œþa'QŽÄ´_ˆ>ÿ©Ú4ú6„pWE½Ñ•N;Ä#5 @—jP‰Þ¹Â†€³›²ÔP5©$¿7üþ*È6WTT¨A9$01Z$‹SËaë©OÅ{Sö¬EÔCSˆHŠs…(�Õ�Jç05ԵƱ!züy ¯Út4¬81剢}É*[5á…™1IÞ7÷Gp‡ë®‹‰%Nö†Æc\"ºeËZ"çÜ5´y]l ìâÀf-—Y3qÂ/e–­ÚÔê³j^å䌡®5ÉD ‘¹:‘³ñB‹æ€TÇ4Ù‚B;7¡ºè—AÕ: 3ë|: cfxKÈØJS& ›†(7±NlA»G]lô ˜�kÌÛžŒ¡·Ýr�×Û—~øóžõÓ¿Øuv…îËãøh&»™°ž©¯ùÚÑ+ü?\ŒÓC±þÿuŽÎ0@4! 6ï£O(}æÔvMÁS�$ AÛc3  �±8§[ðÅ4Y†í°&óÊeЬÂIYgóŸ*ßlÇûÕ+¢¦„–L¼óË·bh0'MB¹ãÞÛWêpö @F‹Q¥åY9ífÙ¹Ø9ðJŠïºÃNâÀ! :CiZšòßÉ¢C†Ù°=»Ú�»k¶Dúð¥õ�/ºáäæ[�ô&‚wšë¸ñÿ·_Ëq¾pÌùží¶Ÿ�déää2ûn³„,Äz%®‘@ÒI䱎_©„âêAwÈ„à•lõÃD…Çg AƒPM$ô °Læ-�xKº*�‰jâã{]û£Î"µ!ÄéªEðÓ¼lߨþâî› JvGîvg™#m™–¿q´<¹³ï?Eã/À>yÚs ºÏÙˆÀªáŒã1€øÓ²ú7ê£<=¼d>Q˜æùšEªÉ¬P Tð5 Ä“éŠÆ¶êG÷œ«*0dÉ»™ŒÌbXPn�ôC£çÌ0€°4 ·(¬PÑêƒ6ËF›QÊ`M¾ u°”à 5-{®•-Š:øl®ùÏ Håý;4T§²p¬°3]«#Œ^ºIsë®p¸.ì•DGèí~±Õë-KU>µ$bI[Pf­á¸&j0¬Œƒ3){l›ŽK?ÊšxoÎ#r†»"�!¥ªÎè>qEV­àíd�Àœúž¼À“O‚…ë»ÉÄ–‰1pnbØ«MZ$ê¢Õ:¢qPGc´^+·Úæ ýQ�L¨`@MýÚ5æëe–Åð�k²"ß§|ÑÌ*¡ø@O%!îeåë¿í˲™Ýóðg¾ôÕ6yßç‘㌻íRJ@Jf)Á<诮ñ¶ðñ…#çYê±¥jÅ)sóÀ+™jCµ òÌ{¿Ô—ÉüVB-a@UlÂ% »Ét -íCùù/fêLEØÖ/®B;¦|=B?¶X …ôÅæÝ—2ÔÔ‘`ã8`·¹Ú�ÃY¿H‹ÿ|y}ÃKNÖ—o»rró›ŽW>ö]�ÿªÃèízî `K3{ò0OÝìÎ>»_ô'‹å:wÝ kN\=c(ŒÏdzÌš{Í0ÝøpC=ñÕ°»ò‰[y¸÷AbnÍ{?µ ‡Ôý³ZŸ7–‚Êó¡ž²±o´cÿrÈ«G†Ö…‘KÛš*â‘Ëygðé9 ú;zÿÑâ设ë¢ïû7<ç‰ÿîÚ½÷P³5¯¬+º(~êB“*MQ­M´¬ÐÓÇk£zB!Ø2쟻µ²5dPFš$8T[7Fø{u¨ Â%¸5â•-rãêÿäØiÙ¤¾\ì—=4«ÌŠŠ$ˆ_4­=sáA¹B¤@óöJæ‡:÷¹çtÃü‘:W%rq–…èOÞ7ìe1SQiSù›÷V�º14ah¨‡ë® ´²þA|uÙßWäWúõ443ck–ŠsÀøfê·£6¯xа±V®;çÇÙÌ-®i#mÏ&À`LU¿1:ŸZ—dÝ…6Íež†H(3i™ÎSš™hY¥Ó¿)N›4{M™ÔÚî”ʇB¨Ì“yð]œÃѺAXk,©à5åGÝöŸ|q‰H÷\þÆoÿòßzø3oe»’³�¿€ÃöFëR²Š?LÞ_Þ‘P2‰)#¥ù[BÁ\D±Ñ”žØåµ Zò»ìˆçª‰ �µYu˜)ZÝäþgÄÌ–‘ºdɬä7•º*³`óƒHÇ$߿ن–I2{Îjy�ÉM€¦ñaGv§]Þ�ŽËnùþã奻på!·\:¾áÍÏùÒ¯;þ]ç×WýØ7Ü<ŽããöëÆ<<ƺÅr�—‹u¤5@Z8…œ{šF­Ý.~í¿gxœœXÚËÏÄó ×¼º_´á>¿&É·M¡Û\ºn ¢“Šz }ŠÙÜ^K ÍpAkÎâ:+B÷æ6©.>Tû.õš'?xØ!FPN™!fµ’ÙÌÆŒ’�6¾Úh§÷þVÊðïcË~0k<>ij®Ú8ŒhÏ&w.Aª³“†aVõ®FÒ½—÷óª<|×ìí:�*HžYµ^{5±É/"ãA7ƒk-&@�ž¢YÏ+оP4o¦²×:‚˜©u²O*çÉ”æNþŒEÅ:=)ë!fztc�" uGPÃc`� ;äC€Ãu1=o»$˜AKsš¿ò�{$�f‰°™eZ쎵Iô£P:xuüÜìáÐ5†§&$r¡Z—VDT#•‰<õU•�Ëu ƘÚÅ5ÈÈÆ¤†Æ3Ï©ò$’Í™•ÞqÕóR9˼%é"lüh÷\è�™œ·£0›¼¼ٿÑÜ#�h†k2³)ãÜro€úðÑ ™÷!ðÆoÿ²lfÿœþ³¯J9Ó’}}ÎÃ#†Ýæ†År K-çøÌÁ`¯9àÍéÞ†íY…Ö6ÖQV½'–U›ñpÀ†›ó—mÞ§¹É -Áöü˳):Ñ?pÌ|¹ ³Ï�H‰€@î�–iëÙ·yøÕŸ .)@�ö;[š0°`ÎCÞîN1»´LË÷\ZßpûñêÊm—Žn|ÙßýÝ�}Ò¡¨ºN¯ï~óuïzß{Äœ¿bÈùk6»³Ï²E:^.—ì»E4LH:ªS·KßèzáÚwiŸ @>ãÚȾ•GüMG‚MdŠrߨèÈݰÞäLÌŒ× ¶—ÀR?@p‰¼ F@ôí÷�Aª§†²«>‰DlÌ[ãÈÆuwûŽú“;–ýúÖu¿zÓ³Ÿð¯¯ÞϘLÀ¾g^âóÝh’rHÕH!$Â#K¦ˆ9¼]Fðeÿ ouQxX?–ØUPsP,Øm¡)¨&õ2w¡‹4[/A�5.5�N„éÍ0 ¥­µ�ß+ï±5ªñ¨¬®ñ´Ù9&þ|âûÙXLÑæ/pÃQsLãf­mÔ° qÐ;ÀúÚã<ÙNaÃúê«8ýxXàp]Ìý0ƶí6|%øäl\þb¶FÈ-Ç,#~(ê|ªÍ±¤ r-{$%YP%‘|L÷Ná,À!t5/ó‘uE[é2ŽùB磄Z:3!gùjª–ö1ÿžÕf2KFRã$AÔ¥ªF'°m!k*]õ%¤š·½ä�Z¹ME]"¯iðý3Fyó?úâÿògÿ�;_–:\ÊcNyØ>j캓d–€DÎë†JòÔ‚Ä' >_š^jªô¯é½¾¢¬f™¡}„…üØdÞUk—jØH6 ‹r?À†¹…ª IDATØÄ.×âLp;S1³ã’u¥ÎKšhf-s2œÔåÙ$ .C5f-àS¹�ãÈa·IÛíÙ°ìº÷-Oî¸áä!·¯oxýÿõeOùÈáT¹~¯çègñ’W¿øSN7§�ÝŽÛ§9&[¬–+.K3vq4êfj¡ßD®©Ð:V´µ¥|Kºm�%;?¤-r8ÙøÆ5}f£J†'”+&Î=’”Í™ÍæÊ,k:$íxl/+m @„T!ÛÀ�ã¸Iym™ŽÞwÜ]yÙåÕ^dÀkžý„ï¿vŸ=h1ó¬÷ LN¡ŒSM„™(ƒÐàÅÖ0Â}/á½ÓþMõ©Í1ÒX[³ˆ#Zù¨Â ÿ¶u Ý0ý”ÏÄ¡ÿ÷ÇTiúh*L4*¶–=Ñxfò^õäøu£ælˆ‘5T!A[²H›RF¼¹ƒ}לû²fãÄÇ;“´úZIù,Ub”£Qu€$kùáˆê…—œVKÝè7¯†¼„äh›¸ÄÓ(K`+ææû ú¸™=?Y{à¸=}XîóI¿X9Ù¿yY‹§–�î%ö×ýZ3Rîqy7Su6­Â`‰T°&Šxˆvy«È¦vÕ1@t”„ŽÉ�›Ç8¢ G8š—”ŽTr&ƒsgiVŸ€:#£MŸžÅ–%Ê�D.Fò~Gö¥àQR Ì,Ûfwj»íé˜`º´>¹íWp+R~S²åÇ'Êõ{ý�}{û/¼â¦«›Ó/ÞŽ›§�ŽgŸ1XîÖë.ºÞŒ Ù#!ª¨…‘zÆ&§NÝÞ!RÄu®ØuÄÖTêdòãÝ h3£bJ„bÎ0V·ìd¸Œ{f‹ç{8kªcðclÆP›n§î õ-Ê™¶Ým2h\¦£÷_^ÞôâUwt+ÍÞãÙ}{€Ñé†êäêQ-\2*ú&}’:Ô„ÌÔñ¼”4€ø@:S‘z÷¼º‘N¯ÉìsÏETʆP¾Û~.p��bÖVÁˆ²ûªXü"×»Âè£tÞÊꇲQ ™…¬FH1bÉžJUt–=£^¢¹™ƒ ‚P�Ì7 Rò=KT�îw[õq3AO#®œ~Ü k]@ëâ® ÛèYWòÃ\«?‰¾ÝrØçT:œŽ-(Þ1ö%dTÈÆÉoÆiŒM8ÏrxÆTw¹Ì(ÉK6³¥¢™‚LK*ÀÚú©Ðå‘4CÊ–2ŒÌÈØ€µ‡c60€ÖîôÞž˜3̇ÀÔòFòâªC!](0]�Ær˜fÈXFÆÈ�Ú@Ö©3Ï{X®§2戽 ì/hLFˆS��%æûÇ1÷-ÿø±ÙÌîþsÿâ¯3Olÿz6Ÿ3Ж}¿0¤D�OÅ©�ˆ.ð¡CT Ëi·6`Sä¶ï>E·ªÚüÂ+…< ´5‡ä¥[³?Xn*E¿’iý[f6U™ºž›S�È!ØP,3HA9$SM ÀiZCŠ|©ÖX˜xÌ)sÛm'Úÿ¢[¼ûÒzý¢“£“Ûn¸|åÍýúcwÏÜþ¯×ëÿ~ÏóÒÞö¶›?rõî'�íξf3^}XN¶^öë¼è– –ÜŒÌE”Ä¿ !®½{y ”BÌÆFÒfD9ÁtE×€Ô8˜f3hbž6¦î<‰\|Ÿïuœ¢èB8åÙ#[�Θ*ÎLÿü¥¬…yØÚ8îÖï:îŽ_¶ìV·®û£·~׿ÿô>?¿èÕ£¿3&É¢#CwS§UD×mÑs»Íb¨)B5{g�b°Q¦•zªÀ�Ôû ‡©eéÌ]é`ç ”m�fÙŒ]‚ƼæìŽ,¾7"ÀÛ°äg[hXãj«™‘PàÁlÂES-“ÆÝÔ—¦F¸û®Å‚V` Ün4Þ@*ÑþÅ[)Jêl†ƒà®‹¹!2©AW9õRÚcë4ëms7^‘J…´ã Œ’¤qa�¹¾¨À%µ«9ô¨!nV§"ê�™ x®¹Ù>ñ-—ºæÂ]âÅöH­p5AÖÌg�™b[6¸ fi &`1Ö éåŠ;N^N6ƒÑ5{f�?#óVfýç°8Ûeè«ý»îŒ„j^‰û{I|öÃ?ûýïú•_}ñÕ«gÇ–ÇMææs^ú)"0æ@Ž|U®¨›û˜Sˆ~F»eñ·’ P‹ñ¼7#A=ž†f-ÍØ]°|jXb­««Y¢ÐéŒÒ&|#ëðÕK}7­ˆ¼Š˜÷´Wixêj,÷¥ð&ñ-ÇlÃö¬ÛmÎÆe·xßÉòøåºñ�Ï¿|rùmÏyü× ÿ®ãë{ßôãÝ«ßðÚ?uÏٵǜmvOÙŽÛG6bµ8Ê‹Å`‚»®A»'ˆR-B¼§TþzL*Ðì…{btŠC¤mT.ä¬jzr1eLŸýåQëS«VkbÂ"UnÖ•Îÿ�°ç…5ÛxÆÄ&ä˜GËã.%æÍª;þàqrÇåþò‹Ìì�ßõÄû�ö/Wv7¼¼¿e7qТBæôD#^*`%㯣ÉÁAT4±¿4”³YäƒðT\•]¢î,9#a™–™w›3¶Ûa�ô›W–—^ðÀ“ýrzk·Æ�ö_÷¶²xû{ßñÇ®��>þl{ö-÷l>þçÏv›´è�¬ï×ÉÐ¥‘´Ñ¦£jZ†ÉŒ]™¦¦0Ö$É3J`Á35³¦ñŸ˜EÔ¥RÞ¯é_H“3*-U«Î‰‘ÏJµ)>Tâ/@M|+›UÔIw/Ú—¦äkQ §k¯M¾�;ÞA‘·l°L‡ a—ýꃗ–—î\-V·Òø‹fvz=÷ÑFË6&NÓï‰Ä… È� íòxÝ�D³c\nXÁÀòŒ«T-¶­‰ ΆH¤âm†NŽîônIÑ×8j|KNz³AÍ$ -›Uæ*T^~4GP'סԯoEîI¦ìN“ŽéÜ w¢à—©Û†Gy9Q�4Kºæ&žÞt#ı,qTào–RD ^Ñ9?–é9À“%¼jòülV ÖÁS¢SBf2X ;^>,Œ‹{MfLd.[É ,ápw#/›=”½¨øšÃPíuIíá DI[V3“Ø�U !‰sn¶B WÒ¦ÓS§Î¿þ3�ð9w«Ä‹LH“2zjÖXÎ �§éTÔÆŸ¡RÔ@�¯Dä²ŠÓ YN)ä3�d›CÕ¦$7Õj Q®w‡Žh×÷seäÁ…¥j¦÷ÌA9¿ß)¿øŒ/Ìì£�øÎ;nÇKÃ0üµq<{ø�Çu·\¥”¤¹�ÊíÜWÒL¤Æ'䯿‘�LP•›FF¸Ç"‰Z¸g#3ˆ²Ð^D¦.Ö‘oEi|ʧ_Q/—-â$m²Q|ê :»¿Pdc‚ävÝ’9�¶=»y8ëÀ;.-/ßr²ºôÒŽn|[:[Üó½_ôäÃ`í:½žûžÛÒkßòš›ëc¿ýäÓÍé“·»í§w}¿\/×y±\N]yÎa½ÝÄé5»‰{uœŽ«8ÐZù|7Ì^QÒé:Ft²z•af±:[ﳜo7I­mbʉNÝÌR„È7cLÔ›î{9Ò'Ô¢SÍà±jcÞaw©7ŽË´z÷º[ßÙ§îùË~ñÆïyÂs¯ÝŸÏ~«„Ú‹¶„ïxŠÖXsJ¨û¨«‰à.rAÙžU=ÍIe¡Û(‡PvÏ›zÆFÊ_,-´aG3’o¦ÈÊñŠÝÆ]^Y&À¨ÿæO&¬öû ½¼Øn'EWÙ³1Îrõ4+r¶-Ôâ:¾œiºBÎÙš`c¸`BÆÝ:.Ù$1AßÓäìp€ÃuA�ÞWã´Æm¤iÔà6ú>©Æ[Ãc·°!›ì­6N¨ñæi;¼èLPm™Zã›C\B >ί*>ž+#¢· ¦1Ð/æS!Ûp’šòôå¹av¨Fg_Ì£ÑD5tlã8³£jiÿÓMÔã6 h©)çÙ†Í5Ë‹‰Ës«owí1dü.Šÿ桟ö�ßøàûn¿všoÈÛ¡†ás[Û@×çhž³Yëq¤Â¡¯Ú'НíöŠ'¡ºúÛ[#ÀajçIZåy;9–0¹ëº‹ÌÖ ÄÙÆn³™T7“ï’2!3å™ûä¥$¿HDêHÒÆÝ&åݵ]{×Ñâø%¼é!?uÓ•¿ó{ÿUWGÇõ{ýÐnKwýü]òêæêcNwg_³ÇÏ7t¶Z�‹ÕÊ –rÎfyÚ*�¬æÈ´"\4 ¥û l@&}£ sÜFx´�)%Z»]Hþ.­±Û‘|M_â2†„º˜Ãc.C0,Yh’,®,¨|æ&¸^;ÍbLÚ˜GóÐ%ËÛU·øÀº[ݱîŽ^Hò5ßó„ç^½ÿÏ/´¡Šj"$¾3f¢2¤RóÁFzÑüäjGÒ3ª•lTî?lár Ù =x~¾ ºH@ŒÜÉ&šêi >ÅŠá!ì½ÞNM4‚�*#Õ“+,®Mþ€îÚy‹ÅFZ 4‡§KÙÄ͈ÔW+¦Æt³%»_ËœS° ò_t�¾Seëíàx‘¯/èb÷ÿS³‡Îi‡à,’ÆãHk2º3t}c‚Â�³ *Ö/Tÿî,@\ë�€ÆiCµM r¤Ê£ðòÚX°ºú0²�‹x±IºƒêÔ/(P^èŠÁ‰v¬;Uªµ®ÃþRíT7mæ¸WHÝgÛOÛŠ61bpèH6´(½Ð8«)vU”Ç’t§M$ôª‡Sié|ɲDêZÏ8Ç"0lDºÿ꨿üÜ7œè¯Ÿ÷ä‡}¿üàÉÉ¥çu�=?aüµÝæÚén{JZ&R"�;”–&u &¾=!�Ò>Á2XJwž.¬A'.Ã�Ñ‹I¶»öO÷1•!`[r{Pø6 ZWó´¡ï'p£øH:ÓÚ7–¨µCÑÑ 8@U‘Õ° Å7Éÿ3¡©K–úŽÛÍUn7ßu‰¿~rtéÇtÓŸøSê~†k‡sãú½þömÿ¸í^ûÀ«›«�>Ýž=}·Ž®ãÉ¥ÆÅr�hÖå<–…šÌ�àk#ËŠQ-Wh±%)Ñš%*Þ´TNĘ5 xúW“#£aåïAY¸r˜ÆÇsÁÉ0»µvr8ý8‰Åa”8„hàZ¥å`W¤æÝÏ$þÏÌøÉÉò°ì¿~´8yù²_ÿ�?o÷#í¿-j“%KôŸ4¦¾­W…-Ò»1‡±ºFÆ9nâ–ë5ÏHõlå8¬¶ím aÕ[¤�ÈÕÜB=X «Ž¤> ùNE3…‹ÐÿS6üTUŽð3¥ß4kúÒ׳Ñ�f ·_BàjºxדçÞPc2 Ž�¦€�I uÕDDþF{R9ÞGõê·«Á™È4dÍR¶Ö„Ç,-»ûþF2/��wüõO»¸@fOw…-…‚•·¸ï¯v:Œy˜8È–éñ7š‰ëÇÓ›#PÇY•È ¶ª”:ðÜîa¶Þ=[,€à—–›+¤IÖw]/úÆ?·79»ó›±yÒóÞó�³³«?M’Üå¯ã¸ýïÇm‡nyL¤T4¤Y ZäÂ[Õ7Û)ÁŒŒpË`Em‚‹(„×b0HµÖŽÍ!"†œÑ¿Ïx¶ðg@¨ZýÞ¹„*²¬/zVôÀ|2“V-b’$&4¦B.²í†3Îκ¼Ý gzóÑúè'NŽ.ßþ©Ÿúÿù_<âK6‡3ãú¾vãpùCwÿÎWowÛ§ìÆáa©_-–«1õ‹dÉiì,Ö5YÁ!]€Êû¤qI²lààvò*%§R¥Ìä$n™ëjÔ‹ÐÀ ÒéõG—k�Nmdz!g‰DÎRØ,7er-°aØ!çmßwyX¥Åû–Ýê•}êrÑ­Þø}OüÊþ÷;¾éèŸ>îî70 Diõ!ûC,5NMxlÒÙ›áû´ëĬbÚXÂñFhN“�¤Í]dšýæ@ÑWÉuå9<‚ˆ4ÕPW�P­Ï#û~‹l°45£%óÔRâaÎkÖ7ÕWÆR})|¶T l´s~¢”>M^Q=Œ=¤*Èy"GaÕeÊ¡X_OʺŒ|äˆ U›ÏÈû$æ,ϧÔr‚&Vƾ°à…Þ!ír4Dçì!V½ ¥Ï'pU˜µ ¶d§’šö=‡!ˆÆ�7FŒ¦fàn@$ÛykÅ\69(Bʨ°÷‰Šj¦4íòý¥ ÈCõöYxÖ4EJ›= +æ ȱ]š»öûV NÉ„s<ÜS¢%ƒÈ:0k wØÌÚZ™ i85V2u¦%á‘ñ¤×O>å¿Ý=ìsþΓK—oíûî…�ñMÜm¯åÝÆ8ް”|ÒŽÙ�áCh¼<ý6I»!´Žù~µ'ŠÊÖ=•š¬=Jo�U°6r 3*Oõúó5Gk uýí»3†!�†ÆmÛ"½øŸ¦)ò ä0l±Ù\ëvgW‡”í­«þè¶Þð©·<ô¡Ÿý«‡æÿú¾^Æ7áI?þôOù��|äË6›Ý“†1?ʺnµX®Æ~±lγ2~Ÿ&i�–Å-%‰v#kz~7ÿ¯Š`êŸ#â¾Û# žWÁª8øüýÖÔQ&®�îGׄ¥HÖí'™ƒüh~S± �÷`Îy´œw€åí:-Þ¿îV¯\u«ÂøKß÷Äù¨~ñÚüÿ³;žvé~:Áæ >=yä6Ì~@7ü¯„¦%¨;i¡'Φ÷r‡»ÉÆ6Ãsޤ€kHÍ]AÛg:±DÀùbk°Ÿ‚³JÒ¡Ï£Ü_4Çœ¦õ9Öìpwó``çø Sß“ÀÝ^æ¡VF­Ÿ¨õ•‰ Ö?­Ž'°_I Q'¸#^%‘LÕ½™î "ÀẰ€¢Î^jK%“ØÿS픥�Îfn7�M©²½ü¯ýxn–RræµX~•ae¥M²8Ñ,‹Úª³ÌÌRýuòII|«Ürï&ÃDyâ t»«†'üÛ÷^XjU1Y"Ì’ž lÒçýÙr¾ºX½§@¶ªôrøT•©µ²õ"Pq#¶²Y7wfD˜rGT¥|8èNÃ}˜6¬Jœ~•B KIÞ¾¯Ç=û®ßó›üØ4ô}ÿë—NŽt¹èÿM¾sÜ\½6lO'O³éÖ˜°‰ ®S}DÄ z¥;I…ÅXt:MðT=€¬Íu³‰Ôpi\ªµ–®îÙâôøÏx–ðR+XÖþ$ #a ®1pOÊ6BÍÜhÂü0Íí&j‡Á,s7n7×ò¸Ýl)ýÚñúèGtãCþmJÝúU¿;×ïõ /üGý�ßú¼›O·›Çn†Ý3†!¾Y×­WÇìˉ[[(ԉο©üÚi² 7CÍP3û„S²� ¨Ó¨{+Ìš`%ƒFåÐu§ [ÍBÚÖì ³§ÔÔŽ–À^Œ0sUôdÕ¿Õ÷-EvÌ"¤ªè¦ÀdC3�²kpdæv·¡YVÝòG‹+¯Xõ'?afwšÙ¹™§Ýú•éŸ<î9÷˜™=ë®o:¹�l?0¤Mä“r~¹óC…bJïæ½�ŽÜ|FVãd«·Ÿ»øŽŠâÈ’k*VJN¨l§(µ”6FR‹Âú‘1Ó¨{:=xéÀô640Jªç»é3ÍÜ«2ëtl6¬’dÛëaÖ8pП›¤ª]€èèP¯(� 'ù8ÕW'F‚«¢-Îõ ¹z„Š˜©Xîp]Äë ¸à˜¨l"�c­BX§SQT¤f­§Ÿ+î+fêî·“@Mò*6Öøð@ò"¼¼;L-‡"+ƹÎÞR^–·�VsÄÊwªlbLɸô‡j,6 “—ùÅ]ÕD6U£ã`SSn„…”°×j÷>q\1:Zä×øó²l×%6)ÖnÏåÇx4e‚5²{¢k–²7T|ç­}·/ pY1©’53ɺ¯¯;žñèß×ÂûÙ§}ÁæoþÌoÿú¯¼ñ-/Îy{w�á¯�Ãé_Ü1Ÿô«5º~QкlÌDXÞAù1íìņ‚<ýõ$Œ4öšÆv²¢æ¢BÀÜTt¶Á bYåG»œÇÅ®?2å¨Ïµ ¡_’à,›Ò`HÉ2G»��»k]¢åE·~ãj‘þýñúäeûŒÏ}ÿ?ý¼Gšÿëøú®ÿøÃݯ¼ã]üÐG?ú¤Í°ýš]Ö-GýbÉÔ÷Â/ÂþH8ΫF‡â hØïKjWÅ“Ü6bO$`‹Ëøç­¶ã3Ï ��GpcLÅQòÞx¼%2:n>�ÛŒ^³ ħüà }: ¦¼WËc,�cJ–ò²[¾kµX¾¢KˬúÕ›þå~èþ=ç¼­fsÚ·=ú®š™}ÇËŸ¾øŽÇÿ½ÿ~j*ÔìT&à Ú§YÊÙenœM·}Þ†Íu~Å ¯ä¬<}ï´)��J«¯……1 ]iØÛ^›¨Îýˆí"�ä>äÇXˆŠ*Ò¡;'ºQ�+ÃwR��²êïO_£Ãu×õÕÿç6Ø�óòª8‚XöG^›Äµú¦̹×-¬ˆÏçS—PDÀ’O+�² 4ŸC‚Ñê‡p« ¢[-LåÆ&y;e÷Ì£]hb”ÃÌ2M� 1TÞ•vJÌc²æ«¢i*)é;õßw¡ø<¼)Då:õo¿.-&pr¢M\eÃBˆm½ýA%ÁîÞ¸·_þÜ7¿ô?÷^1’ûÑ/}Ðhf¿öçžõÂ�¦ÇvÌ»ü†d—i†®ë‹=ДqÁ"ùs›ÍÂçd70›mN8‹Ë�[ct*’%)[Îþ~Ê–ì�÷±V¼þP0o¯ö¿µykˆ˜eÅÑrlp…ÒBŽ6ìΰÛmhãxÏ¢ïß¼\¬nyà ~þ§?ô³~óŸ~Þ#ÆÃ!q}_¯{ë[¼Ý OØ»'™�´¾·nµÌ}¿œFÝÅòÚšÌïìä¬�B.�™˜1¬+ͭ׸¤ê Òí:]ªÁwÃìÝÏ¿@d[:=SÃmuï�ø™Öˆd«ÛQMvRD@zõýàh9� äYŸ–Xu«—/G·�f¯ý—Oø¡?ðžvŸ4ÿ²‡×«nó¹ÍÞ3‡�ÀÜC <º¦�aš{^‚HèðÑ,02ÌD»ùäâìɹ~zÖãÜXN˜Sy£®8‡½­”CG^  Ò¢@î%®²0A(Ø^Wd,9S¥ð¥ªÿ>—ÜÉy”­óÕ°#TmV©’(lÇÐÑD…”oª1@v`†€ÃuQ€‘´¬áÛµ ¯Ô¹T­Öfý dmÕ•jšTÚ0;,�=.´Å‹§Êòi�‹tWÖÐ×ÿ);mŽZ‚ˆ=m* -±üÅi—œ~ –'JpÊÃx¿¾]‡Ge¸íûâ(§ DNJ$]D¯ñ P|Hü‘ê3ƒÄNzWÞ„6›ó˜µ%T IR°ÍÝî¿ Nö”|…PWŒ½!&ueìL�ÀÚ&á|}Åsß‚㟥™Ù½ÕüÏž×Ýfö]ºÚÑNÎ6gŸ¹òe.×Öu}9R®ñn¨PgnDÉ‘ð©²ûÊ ™ ö2ÚúÄ Ìª(| 4bHìU`¾LÉ…QŠvˆ…¿SÓÊ ï¨ÆASùɲÔð“lï¹&ªdÎvÃ5ÛnN Ú=‹~õ6¤ô}€½œäµív“Äõ{}ù¿ù{0KË{ÎN??g~ÓŽãgæ”lµ:¶¾«þîn3-/–l;+£ŸŸŽ´Âå�1Ú}±·3ð‚ZÈWN°4”yìd$âgYÕjO‘(4fåò×öj$¬õúe/ Ãô=뎧¯¿íqßÿ‡úz¡®Çæ#£(Âèf´®„Z`V€S©\Æ™cŸ`àMÕT•PZjÑÁ·Ô‘Z IDATÄÅÚ¤–¥) Ó¿šMSÈ!�´=BŠKK.€afÍópd‰ yAYºrŠ•m�€øÐq+"åÅ-bX±°.£„ÎÃ)yq‚Edd1¾–£”ª|ÑíÍÿT,YØ�‡ë®‹ˆ83‰œôü™éáa\ëš³b¤,§H*�o]•ÏV{¶P5Õ=8fï{‰ï TãÜÀËÑrƒanPª†rÒnϨâöT5æ_OèÆq“x�!óìöRêaã9EšÓPKêpE ;m9†œ8çRJ‹v¯fJz’dDÕí—àÖÔT^ }’hw ÉKœ(oÛ/Æf…Ô„¼Æï“»jó_]oø¶¯Ìfö±?ÿ¬ß�”Æ£®{òn±;½ç�\­S¿X唺Rf€Ùûe+ë@#æŒÞ yJH„3d0E™Õ� Ed˜;îC-f9Ë´ ÙÌèÎìÑÇTžk ?e”¸‘,ÿv±AL{‡ag»Ýiò&¯‹�ô]ÿªœñH{ÕË¿ñÜ}8þ+8¹˜—)ákv»üÔÍnûgÐ÷ÇËå*÷}Öm(U”˜f†\77ÖÝ®¶È�öÞÝøê¿ì‹Ø’1¸¸…žêª/’î:4N^7µâ§ñ¥ÿ�]áðòÁ£S”úDÙ¼$ί&¬ÒdléóëªÀ¢¦ÛÃÓ+רr4W ßhÌ;�Ù–iýþeZßÕ§þ–e׿ù¿üGîU@óÛüÇŽ;­Ùðç¢"½çþ8¦'ŸMYŒ~È a© ¦¹Åà¤5IUâŒ�P3JæòPÖ¤³Œ…ó€–àá…?v_be\‹‡’À6Ûƒs"?%õȸ‡_³l ò Z+t­ç&‚¿CÿbšìlL�d=•ŘÐö]IÄ%¹Ù¹š!û†cR‡Ã¸¸×aW8 &•<ø«ñv?up¯´ Üq}ÓÖá8¦¹Eß�XéLl¼|…ƒÐ8kóßnR[´î¤D)rý1r¾àš¹P˜Šï¾‰±-t¬"6·h’i¢ÆÚ‹Ù£Àízæv°ÇÁm?÷Ë_7šÔ¯ ìáEõ7)@½'@Çcâsàw õ�¼ñè�ú©½îÛ¾âƒëãã-rÙÛ+»¼}Ÿm¯îòöj—‡­�y²¾Ëli‚ÁÒÄ”)¿O6‰S,¶9h ô�n¡Æø}×ÝûïY„]k•ZQ>w«r+gáØt_mß!"? õVò5ši–™só�w»-·›Ó”‡ÝÝ Ko[¯Žn?9¹ôÿ]¹réůú_þÁoŽ„ëûzö¯¼ }íOþÇôÝò‰ÛÝîë¶Ãø˜‘8N‹eîËŠ.×´Zº]ìt&%ªH7ˆÉ<-v•ǘ4”2啬¹‰v[ý(ådu$“.Orm÷|€'Éôá…!ÇfX(læØæ8¬û›F¤¸â%ôQw¹$¶ÚÓœ´VAl´,]|b¦û[l%P�ZLŒ(–ÿÂ‘ÉÆx2&Ÿì´a¥À5�×ÎÓÈcVàaz™cÈñÌÆÝ†Ã8Œ`ÞõË·Þxr㋺E÷Š 7ïL–1×ùõ·^øÌþWÞùælwÛ'䜟~¶Ýý™]—GGÇÖwËd2³cN£)þ'J�à[‡†Ì˜§�~ް�ÿ‡æ¿¼¦6oæò^Ô°¼i²˜*Ò]rÇ�kó¯.¹@ün5ÂÔ€ðé,żYTC^þ…ìB&XcˆR­VÝå?9ú>ݧé×™93[^`ñ¡£ný‹}êo1ã�fø#Ùï¾õÑß÷qýõ3_ñw@,ŽÿÉã~À 3s9 rBª™~îëû–Ÿ%¬æÂ ®àä¡vé•z”ÔQÁ‰ùlªšÂX¢[ª8{_[7BÌŽ‚ïAlhê$ŠJê£bé„+Ižl¬d”ì!ÌûÌ`9”ǘ(òÖšYe“ Tskáú5�_}<Š$Ž=÷#Ž•B5­¦®)ƒ=�˜žj ´HW ’±Á«hÄQZ ûˆå",1ñЀÃu!€_Ê{VÒŒ,?«g¦(ºƒRèµ|¥NÒíq…“Ôš|µy·,n+J.ö°¦’Èdœ£§BO‰qãl‚<óMvK Ÿ @�r3sî Ú>/»Ô²™DÖ™¬<Áê3 Íp„ÔX%!†‹Q�¯«ÅöÌa/B°Å´§å­Á\gSN•YEúa'm§Æ~:߯yC:˘2Or¥hó=]¯þæGg3ûø£ŸóÊ×)ŸïHÛáKÆ|öEÃéö²�KK«uFêó”óaÉM¢\�J±vÏF-{„Ð`Ÿ¸N èͽ[2õ9.@‹éL¶òqjgbæ–"ØË@öI�¦ì²é�ç<ذ»†<œv‰–Wiñ[0¾hÙ/î8ZýÇKÇ7¼÷‡¿ê¯žNƒëûúáþ<~á—îxÀG®~äÉg›Í“ζÛϲ”ŽÖë5ËÕ´HríhCÒ&½­¬¥IÌG‰,z:8­)ÂdŒ�Ð —É;ðeÖ°rÝÍQ75p�E€U¢œ©£E¡0�†—ýŽ»™­ÀÌ¿NÝkf�ÊèÈÛ@2Xš¸�2¹@ÿKô?ß¡ÿ‰ýk~è+ôêõ°&¾ù¶¯Æ·É¿¦™]m·{€Ž,(½:ö újpË8´VSº ª•B4vt“HØ’âw¬òs¡´½Ô› “[�{˜f·Xc7WSl§ N^ΣñÐÿK°E±©:à ØÁ¹2jé‰Ñ2­²&fƒ”Ý#tMÀ‘HÄ@ßXÜy‡ZÕª‡µ¾¶†ÿ©ÜXû!Æ!ÌNÒẠ×�r¸àdE©ªÁý¿$ʧê#ÝörgôD›M1<ÜšÊßB´g&Ø3Ãtƒxà4†î �XŒëÂhB£3#™‹yï[��ô|%Øþ¯!E Þ¶M¥Äûù×sñGý‹á³Í˜5ó)€ž€ÊŠ%„vÿ¾í¹Ð5-�œ°.AÏÍÿ¸gßuÝ.’»žö˜�ÜøÇüÚ›ÿħ<}¼ú÷]Ê? Û½ÓÆíµ¼=Kã°EÎ͘ ÁãoÌ3*‰<ÏyÜÓÑ0 u�Hhxd%+Ò“ÖÖÄ¿‰¢Kñ¾sfá3Öš°nôŸ!¥É ”£ Ã5 Ûk��;ö†__vÝk׋åm—�oøñOÿ“Ÿý’ç=õÞqhþ¯ÿëÇï~-^ös/þÔÝýá'žnΞ¼w_0W‹åŠ«ÕÚº®³ÖÛKùϾ­kS,5}ñ!¶Ö]²éýïKñXTÓ/Ø Œ®–'æÆtÕ@žƒ*;«x�9Û·Už³õ‡SÄÝÌ� YΔ�W¼í<Úp˜‡ÞÒo®lñs+,_€lwýÐ_ùÑëF&ó=_y‹?òo~éW%3³§¿ø«á÷?2A‰†æßT*ç�kTÓ˜yÔB›Ñ×àÓt³â‰ œÇ#-PÌLê‡HÖ¨›pfuå™ Sj¸I|Gɽ8X½E#áÕeЧ!x·5Ó¦z©C[Q¢GÜj_ã?)üg ™(êKJ4Å7€†Ð±Wu¡MÕͥ­�êmõÛ«ÇĺÈ×�pÁ1ÑiCLÕÊ¿‘Å!† >“õ``FSMÉZv¦”¹ÝP#šŒùðî&±âÉ$ç±ç,CUWðoéÐ(ÃúW€XDI’{HÈö0†HB/ð�IË%-Á=¬iQ³¶e‡´Ô�¿ä�×T^ZE»}ìB�Ôý8ƒL°âiç:N•¬‚da”áº5nÐës–'›ŸÃ- +�$‹`vZ/É0×ËÝñŒG_ׇg‡‘ä1Ú‹Vëõ›ûåòk7ÛÝ—žn¶ÿÝ8 ÇèWè«Ü÷]JH!ã¨o¼6ex—$ƪµv»p�ð¨­JDª;I:ü8vªZ¼ CÝfš¯ :m¹Ó�5‹€ÿŸ½7¶5»êÃÖog¸÷u  ØF€$&å˜2ÁÊ@ª°,@�Y´%°Û8xH O»*U©Lå8ec¶€H! $&“ ÖÔh HBÂB2’úõ¨×ïÝwï=çÛ¿üñí½Öo}ç¶&~}¾M‰î~ïÞsνgŸ½×ú­ßÀbFÖº³ÝåMÛ]Þ´Bî·ëÓëw]{ÂÏn·ÛŸ¹8?kÇöãþr9þÿí_î§þÖêµÿâgŸtvqû«Ï/ÏÿêùþòKm(8}Âê€ÕDû¯#»¶g ³”Ùö3"hÝo(D~¶Oq{ë_ÿš(î1‚0m›¶8Â#¾Óôûã%?23�&üöb"~0X|:è÷Ýôˆô$Óˆëiº-#£{û©ÛÏäÜé¶©mYm´Z/‰Êq…áúÉjõ¦¡”²jo4³³[÷Éw~ý«ª™Ù ÿÓã×¼øËŒf,Ö]IJÓ}°PÑ£™¢\;M.d6F!Ó.‘DFT<‡í,lz$ †`F|Ty ’´þöY7h6!7z¯YÌÂZÙzñDE³§W4”¤Ö:^`Ö‰ëŒÎAQ•^¨@³:-ã! P‹ªéÿW%t˜Züg:�ù¥ˆ®32IºŠ-àI4˜U™ŒtJšÁ,èMÈr³7¶æ„¸¬XÖ¶z…˜ñz›ì6 áAŠ'ªú�Ó,›ªÇìÖŒBr2;$ˆ  ‰‘§dP3%v—n\L…q>Õc¦p*Xd0àc‰}ª•Ã:¥û!`>ÆÂde¤º5“ÛLJYÓÌÔ�Y’u`Ó`Ú-ºµò~�&ävŽœNë;¨äº+Ô®ýfÕ÷þ 2‚+„]UGÔ{Waw–3ä?ûÓ_I3Û›ÙÍoxé»>tvãÓ¯0+2þýóÝþÙûÝùS÷»sÛ¯¶uXo8 «}V¥…uMà:%N07ðž áEh²?êE4:§C/wgÎ Óh+™2Öi£¥XHî9î/¹»<³q>´»OŸpc=¬Þi•?½Ùlßy÷žø¡ŸøSñ¾åÜ¿3Ö÷?ôæò–·¼áÉ×¹ÿy·/nÿ±Ëq÷¥eµ¾¶ÞlÇÕ°n¶• Ûé¶²Y_Ï« 2�«Âi1Š çI˜»¾93�l�ÜKs™ø‹É{—m»ë^Ôj]ltßJáÀÈùVGÎWq$�æ¾ØuÔ X“4a¬{Ôº+ƒUnÊú_mÊê�C)/¼ãûŸ÷Ò›wʾ�XÂ6;GÒÛ:÷9î$žX’"�¤h›±QLÄ}9äD�Ò±&fçþvÂÕ>�†·¹—£¢?°œÛ¢éƒVçÄÉðDµÚ¼W–I/ŠÙÌÓPÐýû‘’ ”ZÑÿ³º�žøfÍ+Û®éAª[‚�Äl/ì�ÅŽ!ý¿Q’³gl ¼µ:ø$Ï«4”椓�ªe-À²Ž±Ó Ê›³³c~ Oi¹ÿ‰žÞo:nÁ}¡o¤ç‰KáD¹æ˜l<_Þ™NÏs³œÐ;žàÜ…ˆ§ó¬È)_œb ÙMãë¾õiÇ{2ö4¬©K.Ö�¼íUíŒîú[¯[˜ïEzeøÕü‰ÐC8wUv%¹I^Ÿ<³jÞf(F‹Ù¹â/S¾`KÿvQ‰ÓÎ=špç‚B?ý§¾bof¿øM/ÿ¥�ßøôÿ²øá›µîŸaãø{ÆKû¼q¿?-ëu]¯O8”a* PP¬ "$6ÔÉYNÖ¢R“ÁC1ÍÁ)áªç z©­¥+RŽ¡k`@™ œö=ã~oãþûým°ž³p¼¾Z­?|íô 9½v÷¿8]¯úÉw?ñú?xÖ׎ˡg¬tß½åg_ó“¿çìüì«Ï/Î_°¯ãˆ2¬7ë“q½ÚØdüèûpËW¡ñg�àšú¶÷Úɹ$lLŘ=†wé¡1ÓÆI‰ßgmYßÝ9J  s�¬H£¦“Ú j Í,Sš‡éd‘‹™|OïU:pפ L.œ¬VÇ]A­ãfµº;¬ß´-ëWÁð¦ü�/¾ygížÞü§$-Q”%h yÎemAÖE¶Ù*.qG† y¤zKæÿ¢q¹ŸÄ<àŠ›­ã]?θÊ:¹²¼§\‡¥Ü�>³5Ú�RQï3ïàõ÷/\ʼnB¦±V�ŠOiìWžC{b’Ôô÷ èÌTJñ ¦¦4C1)Ò<±Âú¡E©õ-Ûl/k–uŒ�^íÌAdo¯n�Ò(t­{£¤p[˜(ýÙ o©Æü&vƒ%$¤C<¢ß€1Èí!à@¨ìôL­Áã”Îtê<ªùkèêà7¨ã`Ã_³½áY/þ¼æ[Ÿzœ‡cx»Ñ õ |¹Ý.}Ô‰‘O£ûD´wЇóÝZåÒ6oª¾ŠÊh%}xËÁgD_œnôiÐ_;2´K¦<ºEy§1®,‚X5Ú{ŒüÐg>鉿Ÿä×Ý|ôÖל_^9½›CY��²UŠç.æÁÔò4 Éý´Å}AF("j÷v/G¸æS‰Ä¹†…�7IÑÔ£âbñֳƻ܎�0åy¹qð ¯<þ[$ÂìœTÿÜ(ýan^»J!˜=+( UÛï/Xê¸ßbuýÚpú¶U^iÆ×ÑxvÇ�q®ó÷JHL>‡eLÚæ¨¨f-š8ÚÉö�ß2Éÿ) >”è¯ >–ˆ÷+ª"7€@ª�¾B U¤}]±lÐTM&cIñ.Ç L¿"ò|Øßæj½Î͆è�‘LB-#ÔÏhŠ3²�Û$ï ?&L¸†ìt=b²PfMfÔ^0Nż5ˬn Ç•ç—XmB]Ì̹—µË:ªVÏ jÈpKïÚH‡1{*¼ŽýBo–"N´cŒ~LÉU9NèKaŽˆï!≮mØJÀR¯«Ô�œ »1¡H!@+ñÃñ¹8šK·+®õå:/+bñû©[=d l¯oCÄ í eO„.Ä«ŠÒ ίuÚ\N§šÌ4¥arIî–r)årÎ(pÝã@òª?þeÕÌn›ÙíçüÐÏ¿ëÖ�G:»uöÖk'›?TJùê‹ýøeûýÙ/ö°ÕneÖVÖ+–2Dò„”:½©ar~':�£BZ›`M54c§êQB³JÚhãxQŒ;+¨6î/Ë8î²Új°Ëk›Í׫՛ʪ¼½^¿ï3Ÿôä|É—ü;þõ§>u™úßAëïüü«‡|ô?ç�ן¾»¸çr¿ûÒa½9]­·Vʪʔ�Ý÷¾ÓÄÐÑeJpMÀ¼}“¿“NDæfâÌæ ó�˜fó‚„ûaçΔÌ&(q&…BÊù¾�ÎY|ôhñd?n3Ê•ÍÉÝ3Ì îrÁ¿§'/Æ:V«;¬H®Ëæ£ÛaûÆV¯Zcõöï~î‹nÞ‘›¨Cµa}˜ÔÛmkäS²Œ2�üR¶—ëÝ®ô;n&HqˆÐ|·V ùCºy€û¥TàVJ„kF:r»¥#æ®ÌÇ\îNPžó+¼�2ÍfCßÅsjd–râ/-·ùH~�þ¥ñ£ô43ŸôOntЭ°RÅM¢vׯi 3šÕ ãÞȽ�ûób¶3” ÖýÇz?À�oÖ›ëw_;y÷“?ó³_{íô®÷ýã¯}ö�ål¿óÖ÷|ôŸ—7½ëMŸëüìYç»ËoÞÕñ6¬¸^ŸpµÞ´É�³Ç�ö a)·C÷Uót�¡Eí£{Ò�/£UŒ@Ád M7gO›GÊð€Úá«7 (Ç&0Ë€YEŽðî>`4áMo•µ^¢Œãåº ŸÜ®¶¯?Y_{5`oøîçüã[wìFê!4 "…Ìäµ�¢Ë + µ�µëà,\l•£Çä·>$Cg3Îgw>›:ÉcnM8ÚöIè#0Kˆ8æ²&R«(™ Ôú †7Z29¢Ç7Ò ‚U¾ê@ 6ü©¬ '3Eð,'VPÀK^½¿1«­„)³—„MÌ'rîg±0ã`YÇz$:i»ÑÓ³Ú�@çær~5Rû@fØ”Ì@BZ)Ö}]Y'Ô'zž·6�Òä :Ëðr¥È9õv,�Ñɘ�7/¤„[ Àå~_j9ބ̲r¡Fsp/N6›\g ,ôzwÒ«¹Ø‘“œ½ö(öÖZaÏ#·àfX�žIg�„—Cßµð¼e"qíç�Ð……ôûx¥ä�DÞtÙXùñ{|ØŒ/¡Ùöw<é3¾ϼ8?ÖååÅÓwûó“ýþbM+«RVCVV†µ•ÕÊP QzÍÁuŽ©™ïÍÆVÞ,Éu°ÚeVÛ¤­ÖÊ‘¬µÔºG­—à~gV÷Œ{c=·ÂZ\œœ^ûÄv½~ófþYåþ—iãFÞ&ëÅr®ßyëÛ~â[¿ã½ïzòÍó³gÞÞ�ÿå‹ýî÷;9½Ë¬Œµ�7à T§s¶Ö^óJØŒ³¯ÝÔ2@íàicYöË‘l)t35Y·¸iÁÔöO…ܤ¢£=*À€â4”‰bʤw¾�6{ž ›3�èOÍOI:ÌX­Ž°qW‹•OnW'¯] ëW˜ÙÏí�ÆŒ³š�ÑÙ‡XbJ.jÌ4¶>Ȩ"Hp.å¸bÆ:ÜEú’ÀÜ… ™>„V£½�H=*ü]aW»‚±NŒ†R�9×8¿ëÞø7A+TY“¦t5O(Wû ˜Hµ€¼ýý�›5‡G�z)KŇŒiøÖqEë¼U�2¡Å$5€âV€É :zðŽÑ¦Í± °¬c=¥õ�Q‚‚—^H¹‡H›÷—VUº©uIÏ#=¿©Æ —8��·8wÅÀS¤Æ?×`²5dv 4L"; Ò&'GíŽZÊjz¯áJ vø`�r‡©R«…ȽÑFFX�µãr,°Ñ€j¸[mÊý›ÕêWJÁ‡ª�¿º·ñ�Õ0\ßl¶}ò“žôáÿøYßðð_8ŽëºþÎ~lø…_zßgßÿÈCß|±¿¸gW÷O/ÃædµÙ° k71ïSöˆ÷è}[ºÍ|¶/ܸˆ ݬB�ÒS5Ç‹S¹küg·¹Ý?ÔÂ=ºOf{¸(Ó›sIWâ#…‡…êÔ4ÈÏ'õ”åü2‡6íP¬Öü~ZNǬ»ÂñrÜ–òáíjóºa^¹VïþGwòäßÛòœÈ`‚ðÍÐ+s·fÁ½öygçgÏ>ß�ûùîâ©4Úݧwaµ¦BºŠ§¨UJ—Í~ÎPšÿé” �•*]<"­_-J§o¬€‡7ézÞ…?Y×%!:ñD¿íj(+’’•ƒL•$ÜÎ@S·G âô»1~X˜±¹géU«ì¯�VÇJ3î×>qº:}ݪ¬~Ôl¼×ÌÎ/û �0‚f0Êp®eÊM£¨1R¼Æžøç6®hºô,p]IÊÔGŒvÕéQãÜÎ Â-¡ö„Ѳ��Õ~5ª"–¶ûKYr¬×� ,è�í£Z�SèÉ¿ÃQ÷�EÓëÊàµ6Á¬sqy‡JH’ãeº=OUf?³8§”x̵#EQ?YA’Cüå—vå ÆP÷¶]n¢XÖq®®•-aËeb¢g‰:KÛæ‰à¢Ît|E¹Ó ä=J¥óÙ"°HðJtJUÌçÎF‚Ò1r\Û»¨(]úSkêdXr²£•B;bÄ|ur2ívf„f½‰A¢¤'_‘Ÿ3ôØ‚‰aý~r]$Â�ó|ßV}_Pö˜& ÄF�¢Þër‰í™°¥Y$çÞ¿ëŒÐ _ÏùÃÏù}4³]ûŸ»‚ÿ™W¿åáGoð9÷=rß n]Üúc·/ÏŸ^†Õz³ÝÖÕzÝhö4k,2� Â,Ú3&þ�4ÞÔyn„Rcäs *"blsÓ[@/$w,UŠB»ìd̯SÞü4(äùb'ùAVûáH +�f–ý� 0aÀ`#GTŽ¥�u]†�o†ÕëWeýò¶ïþÞ¯ÿî³Ç݃2*’¢¾í–½÷ÐÇ}̱ȷ… ø”˜Ý‰?¹8’bäÀ€ÅÍŸKãlÝìá>àÌæ½#& ”"“á}å"õö®9¹K× ‰vºM§íOoùÌ©_JÁ{R,@Dg­£wÛ¢ðZkäEП̬-¢­ML�:àCγ�¦çZløbQU’R4s‰\€ekÿïÈå$’ô#³ìÐžŠ¯líf^Nõj(‡0i!ÓÚI�7ŠPÕp²±pΉES aFNŌΜ½G»2ÝÖ¢t[{I³ZÖ�™õŠg®øÕ/z�t£ ’u[¾r`´ŠðLRù¿bQàøuê†�mFã·”ÐÛba= 7ÎM|’”7©yì™,¢™ÄëÁðGtŽhX�%K©¯—üÑÿèÌÌ>Üþ—Ö·¿æý呇ᅴï2ÖÍä"9†¨\”óÓkO¸õßðKLß‘­ÿ彯^ýüßó…�ž=úGnÞ¾õÇ.ö—¨<ÙœÖÍfk(4N ë’©ëñÓ¿X†ø nX&ìS 6#r{. �bÖ- ÜQDøðVG´ˆ¬.Pzr½ãúa'wbxx³½¥<Ø\+¥I;æ�j³/ÑkÛ<#ž“½&‹±îVŸÜ«×oW›7ã[¿ïyß}óñ¶¿T©/ÓwdLÄASÎ4D£QÝú5|gã~ˆ_µ3Ñ,I¹½¦I ¢ß;¦cýìvÔ7ýüí €Y:’H ê„À…ÐÁ�N íw|/þà~سI”åó�ÂÏôkONñÅMÒè� ô`ö´ßùõ”¤‡,màOú œ¦OGìfÕ²`YÇ´JéV‘8qt傊0di®!]ã– ^µŸd¢ `'´ :ßMpI˜²=,Ù«9x|{Øô¸¦æHlÃã;)³� ;´CÄ —«mñ°ž£½,=&§¥ÒöÜ\š�=$ú†!¸`¢×éŒLjsv@BÆ=¦Z¦uÐ\Zê˜+»$‘ì`“3W&³ùn\¦™Ð!„†#u³Ê€ÍDk¹.ë>ëËêŸxÅëoyfÑÕ˜É/—6ÖË‹³å÷ydëÏÿôw®?ö¯~ås½}óknžßúKgççO³aàÝw?ÑVÃz¢ãŽÕ™¬ ⥓§�d‰³ªÛù7Ëôœ`ÂO¢ªð)ã/¤“¦ŸÀLÙ– ÙûƒÇˆá1J•ë÷ î&£ j¯ó|�3ÑL@ sí�ó¨¦~ ÒÌÆ±Òê8®‹}òt½}ýzXýˆÑî5³³Çã+Nß÷1l�T÷¬µY‡å qž i£¢6!€ËRðÆHòo�£`�Ê=ÄÖo>µH«z#me §šñhíQÉžÀb˜:Ü% �ØíwY=»OÄ>=$(Š ö¬Ÿ¼w&¬è:Âݸ¶áå1/íî Aåoú%GÐ+Xƒ‘%§/Ç�äULûØ;Æ8í’nÃM»2—pɇ\€e)"ê““ IËüó¨›.v*€.ðSÐL¡pZ™åM˜Ps—hÙó´«6õf'T_!Â|0ÃEܯfub–O÷r�™Õã¥üñ7÷ýËš±«›a6BÒ£hïµ[O;ñýwÏlXM5fŽ;“Âskî>Ø=2²ÝÃáÉ“òw˜ “Í’?¡JZ(Ä‘^+æ|è>“k(šËײ~}ë‡^ð‡«Ù’1¼¬X÷—_;¼ï—Þó;¯?|ßóÏnßzþùÅùÓ‡õv³ÙžÖaµ `¥Ä�öÙlœÖæiø\³ÃÜZÅiühûÓ"£¸Þ~¥ÃA&›|LØ� nø-\9ßILh9wýc$ÄyéÈA7(�ÄÜø™­?é`:m´2ެ6Žûbã~<)ÃǶ«õëWÃê«ax×÷=çûn>^÷Ak¦¶@iW@k�ö&MÊBvi®"bĶ Úš\+=çyëHx\ëÖ<×&8ü^`1då½R—¸p%ì�³��_n3Ñæq/5fì#ñä¯ á­6*0jLÍqœYóãÀ‘ØŸ§(?Ì/À4Q”ÝV¹[œzÑêÆD^•@žDA¨*».fjrùkÄœ!³¬XÖq�ˆ~qu³$ˆö:ÛÔ*ó›682½¸âñ¥ýo³™<áH0ÀL2Žìé×Û¿¹F’I@HlRÀù"Ý3IMmp,Í5ùá�s�ã®ßŠèoCBv$‰ ]½�s’âlh.EN„ÒZéRw…¸âºÿmÂuf.;Ï4³-0»JDbâÎä„A¹é±ŒQ–µ¬ßÔú_ß÷Ã;þ-_pëìæ3ÏÎÏž¹Û?ÃÊ€íöZ]o¶]æÕû4¦Í)· [ô¦�Íí‰WÈÊÿ^û'í¸y„�Ô‚0›]ìn^bïŽY=ЉY36uŸ\ʹd³ùnçM…à »1áae\Á,<èÌêX‹íÇ‹ ðÉ“aýúkë»^mf÷¾è9ß{ëñ¾ß8SŒÐ­dõ7©`xE–ðáÍÙª£w�¼J[µŒüiny¹’N0ye”RED ÇÎ [sÃLQpÄ+ì?mÊõ SH„+Q-�žÎ€,Î@ôÛ³ÔiŠðÞò.šö^i%{jV® @~ÍÚT'víõÖ§€¨ºFˆdš»-{b–u¤§¡&µ9A²ˆ½id�t‚“œIm" P3Œ dþÞx3¬I ʱ¢š¸#³ÊõÃ왳V0Ñ%ç1<ñ.@~2¤Ìf ‡—›Irê®:v¹¨ŽÍ©kíâŸ~Ű_+Íè/2#LÒãf#¹Íl÷”›+Í@P�wK¹Í�éÔ½ÐÙ5Zdg§Ö§)ÈFòò jÂÐÍ1–µ¬eýÖ·ýÔß[ä#þ�·nß|Ö­ó³¿|~~ñt”×îþ êӖ=æÃ�Îî·˜A£’ÙÌ-Mûž:¶Þc¡•ÆÎ52i§zù-¾ñ�­-£XèW¨äL4m€SÒ¶¡¬æA%á« Å%Ý)°'¯Fda=]îtTN6ã8Z+7X}ê‰Ûk¯[«WÐx¯™Ý~Ü7ÿ­Cêw…z#ÝÈCÛ56ÁתÀ€d î/ çj„×gøœSÄéTð.#Qp^mQt”�ÉÙÏhJS°y·£Iµ)Nã¸WLFHÒ�«MGצN‘¦~¤,¤ß?®ðžlC|I„!„€2�BbF6¯ÑÄŒ…z Ð!çÄD–eª±Ë:b zû¸î”¨dš¦‡p\Cž’‹,Z±õÝÜÄ,ÓŽ$p@ÜûåâŠÄ&Ð…¿§xy-¹]Wt2i>‰L@šÙ”qWÊqŸ‹ûÝe³rSzîï½kÉ~ßê=T›å.ºÆÎ§hTÿ¨£`݈‘µ6l»<3áqÎîRs@¼oãŒ�¥f; F 䲺´ÿËZÖolýÏïyåêW>ö+ŸûÀ§zÁÙùí{Îw¿wج·ëÍ)‡a wÞð»B€ծ�wËtó¡ktÕ�͹6 )›:‚S¬˜%(_Aünäß(óÎlú-3o2;œÎ¡ê ;$ 0±"UBƒÊ)äáNïÓwNéwVY­ØÞ¸-Ã'¶CyãjXýÈéúô]/ü†ï¼u›®÷ºuÊ’èN¿L¹h©¾‰&¬•ÝÎ(B#ƒu�Ë,|!dFºª[(úP†5‘H&ŒaA(1ƒ€Éû@(ÔµQ(Æ6‹  +¨= �óÁUK�¡š©ŽdžB¯&3)ê!¾û Aø¤8„Hª£º(3Ä —.@ÝGús$Cã,tgˆç·‰É÷"Ó[€eiÿÏ.8'¸õvßã…l ¡lj„kq›¥·ŸjÌ8mS8Òkìe¸(wÚ[wò1d<¦üdŒaOÇqÅŠ4²NÖÓÅŽ9Ð8VÝ’L“$l)R§@¿€W€G.»RRoy÷¤ôÜLc$®’¯QsÔÙ[ lrö„p C{ †#4Pl©¡–µ¬ßØzÿ‡?ø¹_w~yþüÝ8>ÃÊÀõö”ëõFŒµâP ,Sé;gPñ;ãÃiªfâ�ÙQppÔ°¡‰Qk[:g8ç…OÏ…”vÓMN„~«6¶–/í!û�ùÕ9äš*'š3ç$¾·5 u4p¬»�|hƒò¦ízøñ/î}á7|ïÍ£ÙtœßT˜Mt[3÷wo˜%þ5à¦qT:.cWÁ͉ê“lˆc®ø7Ì6&ÿ~¦q㡃AçüµöÇuyiµëB>} @‰+j2[pÜŽâP˜N FV–ðL}ûÀ+(0—Þæ5¬¼r÷'ô#RË䣃b É9 ZfRP-UÍ,ëHW5÷é£ã¤°š C¢’ï¹k`ÌLóð^YŠí[MÔÔ‘µæ$Hw E›çJÆ›wùót·ˆ]jU%¨YêÂØ¹bkØ‚a€~aí*Vz,ŽôÍaâß(û¿�*w²1CéšÝÈÉN7V²‹œ;M̪rö‰ ›o�•γs×î‰üHªÌ‚Vµׂ»œý’¬Ã™/U¬V–(åe-ë×·žýFÛÞ¸uóµŽß~±Û}éãÉÉg°”ÆSou­3ï›ñ!}0«{ܨiHZ÷åFÇöZ{òt›ÈaNEÒð.ÅuxÖnVcìF ½–ާsvâ:L@<¦Edͼãkîîˆ)¤ÄEÈDŸKS§†­L?ü8Žä¾Z©öðfàÛaõÀêµ$ÏŽk÷EÁ.�æ,O-(!èúމ8A2écjÆe“˜¼YaÔæ4‘¤Sº ºÙcg®°‘^Db6IÊôúݳ C*âÊœv6åk§;±ZYÌÞ%�È�¥—…P¢ãÄE¢¼yÊtö>0K‹�”H&-Ä» ÷ðƒI8•GC@ìD㌚Ü�É€{õå$ù¨ƒš%A¤{ÂÊ´Ñ«Í,––µË:¦k²šŠ UOFX�ö@q0M2ÆÆH›ÙC;n7M‚hÇÅÞ�� Ö˜Qvf›±1_¡æÜ®ª$Ê\Y SgGìw]p¤ûHH· *Ú%œ{8(ïUrâ·™çcO¾ño6³”Ä,7)3J0äõKÖ]nDeˆ@P$““ˆ·W”jCXìèy!ËZÖ¯�£miãó÷·wr_w_Œ¡œlÖÛqV^�¸çf­-®ÍŠ»†8:ëGd˜J'uŒ˜ÊÓEÁZ2€qÜñ¹vrxã‚ÓŠ¥^Ί>{&ƒ$E*®I3²ÝiÈÑE¦žzoéž‚-ðÎXGÖ:¢Ž£­�GÖ+¼½À^ «÷¾ø�þÀÍcÛ{¯_�n3Ó+B¬Ï¤5DŒ{É(Žœ û š;û Ê:ª *îçᣉ-¤ì èþAŒ|UâVÛÏX ³wÿ¨Z5 ¶´P¡I #ÃTS²B· u ¤&0Uo=2ëdr�Y›/°R6 l6T”ÍQ“ã€N<Üà‚Ž<4Ù€e3 8.c–u¤€&ly8„f¨Ñ¸ó±Ï÷ËŸøü-AŽ•óŒz%žl¶ðK/<¸"uÉá?ö¡<ö‡¸yõßN®6§ã,¦iY °¬#: §&¨©¼Ñ­ÎÙµc¤Ø³›&§¡¸�»Å^ÿ2&R›(™z‘Ô½p ¤X5a¦n³^t±™k˜JÈ·®{î¦$× ƒ•�ÔBVÔJ«Glš»=ÝØä¾e ­T3 VЪ_‚lc÷ð;î~3 ˆ^×Z^¹Ï±%D€â&*B’³š—�R@;^Qõy.s¶ çôÒ\ç_Ú·©˜F8Eó, `YËz¬uëÑ›±Ö§ìvûç�õÛ.vû/Â0¬NïºËV«õ¤±²ÐÑÔ^�vcÐpÜŒjYȹpz™IJà «}PÛQï2¥&Ü÷Ò¼ÐSµaÁØÈ@-Àf€ȱqò�!ljvy/Åd¬“§Ìÿ�è‘ÛÕÒKö©¢¯‰°ASŠJ3v­¬uðõg·Ÿw9Ž_^†uÙœœr³ÙN%hµ9SYzjMC“ÛF¦oþ׳þ BÁÎEþü´Ê· ¥þFj¬úÑPR›&¬{)òx�€ªý‚ÞoùZ…°ÈŘ6Úÿž+€F¶"9¹’Ö ì¡-ʽ›R^MÛ¿öûïùîëËÍåÍ�¢ýZ`¾+Â$’–듸úÀƒ^*btgæìø>˜ ÿâNØv~cø#;ÿÏ€Î%˜¦!òwS)Ò¯w-Tà‘]A€\ B˃+€Z6 ê g ç0H#ÿ„£„Wª ô é_œÞú¾k”XI9Õ~\Qs/ë¸ÖÂ8ö3fVÀRЦ¥Ê?Sá�VI½ƒÙ¸Ô¥iN wó£ÇÛ�Ï–wÛX›ÎO­~ƒÕ¥ZË™: œ¥K�¢y&WiC¢tÇÙ Z±‰÷ 'Õ± ‰=pœ~!r¢¬¿Iú[Õß „k„;õ[—·Šq×Ä[µ`ú¦€ˆ$r…»0ræäOv〠8Ï6‘µ… §ð¯ž¸{!ó×™ *妗^Tà -kYºþìOþýÍõëŸüÝ7oÝüÚ›g7ÿË‹qÿEÃfkwÝ}·Ác¥USWÿ6£ÉúñGþ (t×MÔÚ4ï�[ ’œ'Qê„x¬»·:Ôš?ëq›êLBmⵕ8‰\¬ë£=o�*³Å»Ë¯!®Ué/ ͆?!Æ^ƺg±‘›‚‡O‡Í; ð_cGLû×U‚¡›¦³X!­·FO¨ÉnM.`µÉ§ÛUHÈŸô÷˜ÓÙ¹ñ‘(è –)•æàþa7ƒè{ iš hA¾:Ã;'Ù-�^Â;8G�´ÇO®ØIç¡ó� ¡Ú>3—¡G”Vf �ðÔ4>ÕèÚ¨rA<±» Ûb÷Õ]GØt›SÀ²1`YǸª¹(ÊÛŽî¾iØ$· ØÝŒ‰<8`‰pq’‹wFUx·3ìØ´HÉXbÈéz'ÙÌÞ¦ê ‡o)*Eúý±Äà¾ABX`ÝžZ}ÍŸ~êQ7{‘˜ã¿)�fu¹3F¦/-�nµ´¥Îýg”w¸ ù5Ö;Ûg!CÛ–+o0¹Ûr¾Þ̡ˇ%þ—ò˜0ÃrU.kY¾þûwÿØúã¿ú‘ßuýÁûžûüü›vc}êf{m³ÙžÔ)B¦›rÈ„­S·O®XžGTµZ™õ;¡&W�j“ véô§uå MÞ¢�sÞ�›qS¶�wD�…²)bnê]Jõñ63–Nw@Óç““[I3Ô©iÜ•R÷¶)«‡Öe¸·¼t ¼ùîù¾ËŽì¿ü(Šf�}ijYÉ@²¡‚�Ã,šùsq »n6Ø# D¼µ ]ñ€`u÷Ü]‰ªUåA/¢ZöídYkÓ/AhqËÆ0Çå²9b/KÙO¸«€¢*‰}ß7‰‚â]d!Ar­|^õ7�V]2©d¤Dþï3lsp2¨š=ÇÒÜVÀØxÊP-3�XÖñˆˆtЈm{Œä59ádÐrhLêÆ{É(—©Ë”ÍÃÛ‘›c’8óFÖGð/¤Œ{ˆTjiS ñ~fB2ÊÒèEà L#«q{R/ÄX͆ú7 IDATm¥W™ä¡�Ï]š°ßmý|xÂäœä\mˆ$‘Õ®ât¥ZþQ½Áë·\–ËZ–™Ùß|×­ù—ßÿÔ›·n=ëìüâž}­_YÖ[ÛlOÇÕjmc ˜ƒ¡M…eOØ|´ÏC˜Æ)º9‘ôAnç}âZf(B`|pîHñ©0fWL‡à�„vhV�“HÛÉ Ùd4ðHdÜ2üɺ٠+ë¸/…ã¸)ÃÛ²ú¹Õ°þ13{ÍÜó½Kó?«RÔ6ŸêH×›øö‰Ô^³ÈO[×»¥ë!’”q}ô‹X”ŠéX–°g-quùGJçË(±³7»4¤¢a†ØiéõíÑŠ2*ÉÉ{ýà@Dd{€rÜGc£ÉªgbžÅ5‰*üMèºÃiwTsßn$¼iæì@Ì.çhÜK(/¬èü~¸ˆ݇·õÿÝËRÌz(îmþô—Iú0ý?Ò&»rÚb¤¼¬e™Ù·þÄwn?ùkŸúÝ7Ïn=ûÖùÙ_¹Ü�_^†5Nïº ¥ Ç``m÷K5·b�üæÄÝh·]K7|MX/51MV¯>úecùT«9ÝÐ ü4i’¦iÌÖâ~$ÑÿY:}¸óy§£§£hzƒî¦Ó§µM7•ÝÅH¿}Õ'E�(sÿ«¶ß_ÒöûºâððÉúîwmV§?hf?n íÿ±º=PÌR[—î5@9Ø“P[ì¶?õjB‚•û¬‚ê·Þ¹Œ�¤È‘ÆÚ•F²RBã©tú_\gÓp—à?]§ŽwŠÍ¶)®µKà¼wG”¹)რî~'÷S�“g;ƒJ«@PTÚ)`ž2åõp8$W¨Ÿ1Á88ú×ûÎðŠ«ÿ5)Ü1ƒ�sGL&Ûö'€Åòˆ×Â8î³°ôNŽæ H¤F1!8p1­u¢þ•þ¢�/U’@0ò; Rt-ïf‘ðd’Ën><„fí±ï:x6OïK×ÊÁ3¡Œãá?®õÍ?[qý#¿l‰q»RJþ¬‘�{ÒæÆ}d(Ø]±-ÿK¢@0ŒÃB ÛîBˆs„#;ôK§uæø7$¢`Ú „ŠÔ„|)¡–uäë¿û¹—m>ùÉO~þ}<ð‚Û—çÏÛ³>u½Ý¬6› ŽNMMÔ[Nø>hr4“‘ô¸°s¶QØ�d—<ðNK'õ€}Yf:uç÷8M‚Àµ­m&3zhˆc]ð¯¯a,0ëNã;øZëžu¼ëˆÍ°¾3lî-XýÐjX¿ùûŸû]Ëäÿªª¦"@ú¯V,‰2[ƒîÆïð’lº¶¯:NsCr‚‡BšÏ’¤[v�™6ˤm´F!PXã=ãXÛyÀë4 ¦‰X‡ÎÇÂkŒß��“Ìß:3Xí¡P ["6�¡ƒ· þFS<±d¯Ù4‰ «0ͪ%%Å9úCB�ƒ#Duƒ7b’S/Ž ~î°¬ZœÓËZ€eåiØ&1bËnÒôQÚ(4n6›nö´ÝH!É_¤¾¶8dÿ Ü©OojŒÔ¯jHœôÿ% {K,¸ÙQk޵�d�æ1®ZkØ)}‘�îiŽé÷­¹á!É„õÌ*Xf§Í(¾ð$ �Ðn7å°qîÒdW´Ê�Ì“M@ÂŒ°0å–uôëo¼ù7ûø¯>ýѳ³¯¹½»¼gOþÁ²ÚئEýµ©”‰�kœ«sr5ÒçoòåÓcþ°±ñÏúD¡%ç]Ñô•Åf¼]v¬ |ù ¹ƒ].í%6ßpÈû<)~þ²‹¾Õ»KؽñGfÉÔÄ‚L»X÷÷—ÅÆý~UÊ#ëa}ïz³ýÑÑìŸÿs¿ãÑeG>v“gsYcâúû"‚í$iŸèß"÷Råa‡UN•ˆËÕ â™ }TÝ"‘‚ý_M DH½�7!Vé´›£ß�‘i$úŽ�’4 ÊFA†ÁDü—Cк5$,YWõ-€Nç32U2÷å«*›žÙŒ‹gñY¸ò¢{yY °¬£ëõ$ª”ñGs”Zœo]dÆ™˜q&Âd¾Õš‡¦g`œg"8€:Ý8‡Šº{X+äh&Õ @Ùå¦ðyž;QQët&W³æwÄŽoê˜YeT ô)=Ùhf2½ ¨ú'¥‰9¿Û#‚#JgG@#SLø4ûÀLË'Å©×ZÛ°E:}*Æe†Ú„#$`f%½Š™­°àË:Òõ­¯úŽíõû¯þͳ³gß:?û {¿ ¬×õôä.”6 ¥PP%Ü#þ¿5ùXSõ¸ã«ÓéÅ 1ÐÈ×o!ª\(SúqÒ8²¥‘¤) Úžµ‡^nçÀ!üÇÞ’ðÎ8ǺÝ÷=7J_<$çZ€NUEGOÔBŒôµc{§Jkø[Ž;|ýˆ'Ûa“I(¡�yè"€ÐJ™ùpMÏÀäe5¹e¿B÷Uʿͬ!–šf–u¤¢hê§{g:lj 1“G€Ž¥‹…á²Ú›{ÑtšgEv‰ÉáåÇX ~Vc9Ù€ÝNZM™Äéߘwjfáôª‘… YÌÆqÄ1ó½ËFbSõÃn ÑB‰fÖ[‘÷ç7ö�$7¼Á!óÃf6ÜLñó!•™qŠ=$Ñ<ÊÞ›ÞõÚ®,�2i2­££ÎY@+V—ÐÜeßúo_÷n?õÀ}_xß#¾à|wùÜ‘öE›Ív½Zo+ fó¤n5fóFSK|®Ì¼îSϪÆV~ÇD„€“½˜‡±¹›’~ÖnµPZ=¿z$�»'D±7îV#}`óa°^U˜5a3 9…p^h$ǺǸ¿,u¿ãvµº¾YmÞ<ØðòÁ†·¼ìy¡ýÿÕ5 ÉÿQoá{tŸZÕR<Ý\…ØÇ ÈÉ6݇^ƒÂb¤XÊgR#E·mnHÙ1j‡T'ÖoÓ—L¹ôÛZΘi®ÓP°ôyþÁs¥¿Ž(z®„þö&d(bÆˆŽ»ƒ/Žú4I¿E4xÉ7=Ò‘³�ml¢ûË�ºB©RFáaR”íäcX ÒóD­m¿œ °¬£Ú—ÝI ÷¨ZVñ§‚Ï/Ëì«jªÏV˜RÊ/› Äâ”Ò7—šÇ1 w;…[š �{nÈJ3 ²¹@ÁÇÑÝ÷'àZiÂÜPØÙ³GÉ&z�Pt“¤O½Œ¨.&³º?zÄäH€+¹œ×FSãR“`p³Um'ùw:Ûa“¬#9Ž{pÜïÃý›ÕæÍw�œ¾Ú€Ÿý'ÏýÎ…öÿëªk4¶(Ìr³VÊÐÕ FѲE:Û,Ìàp3yåÌüF püŠÆTr"d«!îê}ja�œ+/´l»î8WÐÃãŽð'þnƒ'^ î¤A Bù ®GJý³48ò½–Øöb&ɃØ�p�fT®^(ã«\„û©©à’0˜™¥Nÿ(Õ8,c–uŒç!P§�çäˆ +ŽqmiÚ¬ 5SÜE{{=yÇýF9¾è,�MɲÄ�O ¿BS  ûìô¯šçhÔ_ä’`�·ªÁëGiNã$ï+ÝÊyúm”ljwdkyáU¤ar/f6]LÒ $ÇƠ£t9+Ђ†&º€ŽSx“]¼ëZYBrzB²`AùIæCA¢öfʦâŽLÖËÆVc岎h}úÖƒ[Òžzëüì97/nÿç—ãø¶Ún  mT– i^5¡ˆs/¨Ú¬ óyÐË{Ëîlfw1g ôCÓôNá°Ö¤øqˆ´k¢º1Aq«ßFÓ«¨‹swçõ÷»ˆµÿœÔÂÜiüŒlÝ Vç´\â&ãÆ&çîÆðuÜW°Úº ×ïZ­ß¼.ÃðF3[hÿ¿Þº¦ý¢ €R¦�Ö,ôÛÔ5äðSièQ}wQ°,’Â?/¶Ëeiì¡È� ‚î ÑJßWn¹DQÅò²p|G™Î2à€ÁX&] Xë4â%¸€×fµ˜‘Võ�’º ÛFK[©(1ÀmDa)P˜IJvR„Pà‰ Èì©V´àèOËm%O¤÷u×ÑFÇœÊÕï-úùÓÕ(Ýà˜%ÊðÕhv²ìŒXÖq"¢¥±´díÞü#zfPr~­ b=Rz‡¤i‰%NwoÞç�Œ6•z† 顺LÔÑÑ5×�·™n�¤¦È¦î– L²o¼¢£C†<:LC‚p—ånoäŠ\fG"ÂPúô‹P~šå ¦¶ÿ¢�Ê}óÀÐý¨ÓŸè5€ †tZ]$1'×.%€ôh À\�eÃú¯ßð’Ózði÷?üà7Ÿ�ßþÆóËË/ܬ·Ãz»‡Í 4X­Ì´jé_ÔÖº3i”‰¥vër'èh °¬ ¯_ ¤Zµ‘øb=⃑KDöÕïFHÖ–Z$#Zý™ýë&»7Ë`¢ É8_�­�ks¹Rë¸3îw¥ÔÊõ€Ol†áM«axùjÞ¶LþÃuMü®Å:¦ë©¥¢C÷œuœ×ÜAhôl•W€uÞ¹ £ 9ê:½;ý BLêßt_Ô~žtJ·hކŠBøßY`3øHœhÃzÐ}Þ̺`näÈý~W޶.åúézóæ¡”—ÓÆ7šÙÙ²#w»£;šî¢Ôvé—Ð=™ù†>œ‡Ep€$SLß8Ý¥oç>Íï£Ý&û÷i8?©ó»ôQF!ˆŒ7†se×× «¤7tß¿Ci4N%ɦ˜u¶G]íJ)8½‹áŸHmä£\p7ëîÓѪ"DŒ¤ÆWCH=‰r`Åĺ%Fº“©$ «À"aÕc¯û*Gt¥œk`¦xe(¡¦MºlŒXÖ‘¢Q~ATHÈõ––X€åΚ÷.'TD-Ë%$^µNMrT¼úÔ¦0EªÊ`½Ã$dÈÌ4°I9­HX è6Â�y•WAãÊÌʳ½ÇËË~Wƒ•F+ƒ¼æZL¹ÎLó„eú�Ò.TÏïâ ¢^~á´[¶y9·-nUHòòôΪûÒÌŽóÌ嘵 ‚©;–8ਙ“ËZÖãmý7÷¾l{ýúý_xÿÃóÙí³ç^îοp»^¯6ÛÓúР•3^sP ‘>gI7 ‰óh6}†êå«�õ?œ%{XÄ£U³5Ya%,Á5I …w’*„3­Ný Hñ$ä vuxvß’™/i H…±Ø”£bÓ¿ÃhÔ^ ÀjÝÇ}êÈíjõ©íjxã0 ?¼.«·¿ôžxsÙ‘¿ÙåT”ðGg‡n(Ì4…�À™Ä‹óÒ'Äß&ÌHÔC(Ë=¶BFLƒx„òœSÅㆴ‡,Š[:­[èŸ0·ÜÑ›ÔJA­\8‰°ßv¤ÄtSÀo¨Õ7‘øÛ¬é“ oòMiªà˜kfÆqœ*›é6+†dÞ•—½.bÒÝjz£O3$—ÈV½ïîWb6ŕݢ~M Ú4Š)¬IгTÄë°ÙëÈá`]¬”–õx]ý ?¼þØÇ?ö´³óÛϾ}~ûy»qÿå(…›íɸZoØè/*÷q'¿dåçW†Ð¹„g&ixÔv³Ì¯ñO%S÷Ǽi(Z}Â|ž0óˆÚ!×QÆÜ˜Y€›”›I}¼½Ÿ¿0£šõ¤˜Y êq¿–ª‘{Ž—ë¡Ü·]­Þ¸Ù¬ÜÌÞðÒoúûKóÿ[ÕïùöKŠi �öqXÿäœã08ÔÐYˆNi‹ ±s®S®œl,B]1‘K/Ixk¯¤³XàNÐ<É5‘ ‘Žw;þ {’[¥*‘&az~0+””bÐi¥óàÈx2MÐ’‡à¨o¥˜›00žT …qAnöú[�º»O)%0k‘5.À²Žõ@,rì‰X1³îwtÜTŽ­0‰×ëý“¨'UßAëÖ&&ðXvB„œÝ‘°_ánßÎPö<ùƘ› ÿÄ(Nr[2uGHCºð‘5®‡àõ •>./`Ä8"¢:W¸Ë ØÛó~;º=‚3€Ø:$±x PßÉpñï½HSL†MÐÈ$‡H›ò!šm’Å’d~n±¬e=.Ö·¾ê…ÛûºÿwÝ:;ûÚ[çgÿÅÅåþ Ê0ðôÚ],ÃÊÆfå°1EH·i|'úw»i�ækPAŸUuŸ<…ä0 {éê0Øa›/=MX ±›±uP—¹‡ë,ýF0ð”/?–(ÀpÒ0])mˆ)¶ÀD÷ª¾Å°:×gÆä(“ƒ{÷´:ںྻ7§¯_ å‡G«÷ÚBûÿ-ìüû¬|Ú"í*ƒf5¢ÓÿÔm/è)æw•ð§¡ðT3…Ës @{p¥ÂÅgHÒf³g ôgÝå(@á¯Íy‡AZrØ=ö�Ñ YX˜^|ŸP!¤j2@—ìhêµ.bPŒfl‚Â>ÉL ¯àhŠ–{2è¶ü'Q–T‚‚|C¤«²k^ÈÒh•‹ Ü,ëX[½ôoE¨P‚�Ò¥­€¢ÈÿyŽ› RÏ3¥4• E…ŸÃ” SŽ]†k>-`ñ§‰?çÇ¡÷’I†@ˆF|¤•«Ì�gÕýYH®—ðxõÁiBËüîGŠCÜ¿dPrÿ2QŸvþmÇÁ1vä‰br!k—ìÀ”¬—%ÒG¼Ð‡8ñó´Ú�vhÝ´¬eÝñë¿ú/Þ>ðàCOyð‘GžvyñÜË}ý‚Õz½Yo7µ¬ÖžŽZ„5Õ'ß.ëm1Íø0 üìG·Îôg÷qÅE"¦1Fýü J­v—vsâÐTÒl™™Mú8ý¿û«+©@º„Å亡X VëÈZ÷0Ž\•Õ§ÖexË0 /?]oÞñ¢oüÛ‹ÛÿoEUø�ÒÙÌùi}A¿�ÄO­Äî›`e «�eD0n;I¦¢tóˆéHë[”<¦Þ·w•y"žCÇÔ®‹c�R-º1;‰�]aC.ÄFW%QŒ §w¬ºã¾L Â3Êÿ©á Á�Ç�g’È%˜y”¸êòÖNdM;Ìç ³hWb{Êl¿%qËðÊI¿˜2ÎpÇÕÅðˆ×ÿwÿ/&ËÏøoÚØ+O?5„©…7 î¥óO^çÆí‰`Õs£0G0 „ ^·Ð»¦ •¦ºtç�d™:=TÝw§×"ƒz[ç½—>‘©`¦<¤ôGn¥ûý©8™ê/w=—‡V¡Æ•¶ï#©Aíª×™š}£*ò`ÿ=‡ñ—µ¬;|}×GßU>uÿýO¹qûær{ùM»Z¿ÒÊjXo·uµÚ »aBNQoŒýC¬"Üùƒæ¦ë™}J�{í²mP5ï¹pÅçPäýç-Oš^¤Ù«I V:„(Q…2&Î$Ü|aZÊŠ¡LÖµîQë~„á¡V÷®†Í�_Žö–}ãß~hÙ‘¿…… ûÕ.‚h$‰Çïù¶•¨GŠ5¬Ü a¾¿û“%”ãÐ ØúO5(B †ÏY—nä‡ô)êZ—ÎÜ9]ØXĽÒ*ã(·Å¬€rQ>4R–(ˆ«>ÜÿšózDÀ) ±‰òœÍËQM ”d@ˆ;×A(Ö\&©‚GZäDÒ(Çiⶬã[ àˆºåº×D•C) m6ÐU}}@ÕL)Èq":u*UǨÑQ{¤I�úú*;qp(Þ�NÂIå�'l«NIo¿�j¨†û‹ñ¨åÞ¥L9ÕÍ•»cÇ­õ‘{¤)w¦kãöc–QŸ…GQs<–Ø=çÐy¬öH~;zæQðqÅ5€ÂÐS•€,±§@ ϸ×ûHHÔâ ±¬ÇáúÓ?öÂá�?ÿsŸyóöÙW�ï.þÜeŸÆu»9±‚Òî�~ö¶ö¨vB Ê4Cr‚óÄð«}¶š2Ú©Š9cŠÈ–ªuª}ôÜ®²¬ ùݰ½ …çš[7”e3ãïÚ&(­ aèW ƒ!DêÕÑŽv+ñÙ„8¬à`,C)$m7^ÒêÞ³O¯PÞCãËüs’·–ù[Ýé‰WpÏx“)nT#$g­Ûæ#«¶IÕ´¨ó1Êì Ñ É¯À˜{† Ršaœ_<x‡œÀdà–²¡Bƒ’bt1ùPp‘¯MvªÐh†â€ §ø*ý}vÉYÇ-�5‘(™}ž€¼úa¡’#*ý0;‹Æ3õº¼Ÿ_‰Öªs­Iœe†£”]h�N>ø%sÈXÖqß”¡në hê|£› A¯½�z»@¿óíÂô8‰ý\‡à“¤±˜Ó™?5mÀ#¥%ÅÕq':?-6¥oí�×ÜSQØ‚ˆ‚Âñ²õuÙ«yW²¢wâ!¬íí?äÝ$•w/&9Z–÷ѾbÓR˜õXÇ™gN¤sQ¢{Ä(’}GÍÎz4`V�44ÊY'1¦é;©šMú^W Ò†¹ùಖu§®gŸ>=;¿ýÜÝ8þñ]Ÿ†au²Zmj)«¡3ß‹Iæ�fö¶?:a¶`*çÂCc:(vÔóÛÇOšäc6OœQsõ;¡T/²vóRר‰HW0D /�QœlHžß½D"z°› ÓÌñÉîyÃiòO«uÏqÜ£Ž{ÛÜX—òv3¼ÄÈ·¼âùß±Ðþ«‹ô4ô4%u­3ö)o\o£"#�¤ˆð¸ú9«ÙÈ—’”º›Nº¿ÌLþ;#`ú×"‰zóË+|1á¶ÇQMqÐ@+eéò$n�ݲd²iÇ^?„£ƒf^2'ÓéƒûÍ­ZqÛc3³~Š0=ÊŠVéã5…;¾Q7“ÿ¨Y,iý€î¹¤\$ °ü ޼û�;®�@(^6é‹ÂÀÆ’ÓU³4ˆˆŠá(Ÿ”mfДw;0zŸ�yÙ$Wû~÷ÑU¤|vñÒ-œ+é�Œj°�·ÿïÒA'ÒÓ]"ÝBËí�â £Zr ±˜iš$a˜ ê"Ú'l$ú=‘J]‘Ì]jbP1cá⤴¬;|ýOïø™á=ï×çܸuó»q÷‚‘üªŠ²Þ®Ö\­Ö¥y¼ÐQÖÊdmï€gm³i&gÿ,Z>ú…'±Z€ê�b ý·› ÀýÜ$»MRJMUaî~&PFàqò+Ü%x˽åÑ9s1ìÙ7F›BØ1�xI3Û�û¡îwûÁìáÊ;7Cy•™ý߯ü–ïúô²#ÿ Õ5ú,KTÙ IDATÔ™šÈXds÷ä]à€CïY�)ß¡�ôåß3A$#Ññ”›‚–LÌnIs.$ F{SŠSnA�‹@£‡›D¤öZG ™¶ ²¯±/.€ °¬c]­ÏíîFAbhħÁ§~‚¡3¾!¶$AïÝVX�"ù9[0)Ðà™qÉõ]_ÜýXšT]*O×,8§¡9ú”ž6P{90Õk‚u¬V�u¼ÀhiazµµfeÚÕ¡s#é.`ÓoT<'Ëåé�ªQ+ûíɯÍð p)]áU5–“yÔô�G©f>ö4¸]Ñ&fMg§ýºù%XÞL­É©jûê .r¹eÝÁëϾê®?ò«þ¬‹ýå×�ãøí»ñ÷² ëíÉ PVž•Ò@5Œ”×ΟEÂãúÉïÈкߎåº-�¯r쎺Ã+£>ÖÈ+JºäHjéb’HQ©µ‹ˆ[†§Ðú�3KL×H?© »uŒ;‡3¼dIZ­f¥ÀjSRq_Q*:Y¯ß>¼f¯5³eòÿoÁvËF-”ƒ¦ª÷Å®a–„ßUáÐ4’6ÆPaÚZEr/¥¹ƒœ¾¢º—Ülºab˜íÉÛDÐÁ ÆIʳk%ë‚ ô tk¨&„Ø¿Å:$Òl3À‚Ú¦í¨Ýà8¦N)b÷3…CNL©Ix§‚xlÖÌ‘Г·ë¬”ÕÚê§\ Û«¥ÂRP&ŽcáÒ.À²ŽrõF.Õ@›:iqw":;Žš‘c‚!F\#v:µWØTyAçٸϕ™¬4› ‡ß2„pv?¯õ‹´› Ê3šPM›l® „ËQ�z‡õÆj£ÊM9Øl3Î=t Y‚ÙøûÂ0>Æ|jÈ~'‡n@ %ukò"°H— dåBæ9¾õ0¯íÑôwîPèÏZZQUÛ” �‹“ò²îØõ>þ¶áïxëgâÁûžqyyÏ¾Ž¿oµÞl‡õfVëi^� :ôÃ+Ù~Bªöy­F@_¤£5p¶¸ŒNËü‘“¾0‘C: l؈D L¡rk«³ÈY–~›qÊ:1O¹e  OC$š®ê¦ ƒ�VXбÀÈq�qwŽ�õÆPÊ; ðâUÞüO¿åÿX&ÿÿ†ûËÃ�æªÈ"äéñ+q‚䀅 j­;p¼´2îo o[—òjÖñ5ÿô[¾ëƲ#»J ~ ÷õð­5‚¢¼»rí¤üÈ †�mÞ—£dH»ràÁívEæ‘ÉÒÑY§ý37mÝ}·t6J·ÇéÖHìü¼åòJ¦DÐ8¼ƒ7H¤úó÷AÔjÔbrŸ¼#Ê(õCÎU ù#Õb9ÏTÿ¦„º½;¦‘¬¡ Ý8òávY °¬#\eš»·££Êd¥+põ$Dy�kAŠï;�¢RA9“ÊŸ2W‚cÕGqcÏs×Äi•ÚýQCZSöi{tÆ�Ù¹êôä#‡-ˆ�Ǽ/¦_yAÓˆ4¨e ÍuªY‘Þw‰;éwwÄ�'¬Fqýs͆ﱴAÚöé1¾ Kpõ¨Ž¡×}~ËÁÍ)]&ÐE! ÂGé¯öâþ‹XnYwÚú³¯þžÕ>ø¾ßñèÙÍg�]œÿ•]Ÿ>¬×åôÚÝ, ²k3Ê+2>¨tá?BS5ñXá5¯›¼€œ�® Xë"ÍßRJLpÔ,ÀwomoÙÄð\ÚÍÏùa,xhîÓW™\^®Uó«e²ü›F±L¹Z1¦¥³¼¥X‹Ù¸Û]6î=]¯þŸüÿ/3»¹ìÈߎ6OQëÞµQª³?„ã8ßq4áv¸á›‡Cbf§«®Ï[ UÞÇ¥¶{¢±ë}ºÎ�‹tˆÍ’2Ä•9ÂÄãîv=~Nænɳ’ËíUèdSNRЮ�¥ \Ëc"o¥1f*’ ÖXOkìç“à†^“íh,Î�ÚAÄÄKÃ÷s;Ä€L’uEé¾ÊʤÌ8ç²`YG·4›–nð„v 6‹´6ÖoT§Ì±O!¹‘rBÎ .Ÿ%Ñ™K~¾j×/£z±TÜ´apÎþM!Û`†Æ¢Í/¸’¬DÙØ1û½�cíW!�ðsëë�›è#ð‹È¥cor�.ß/:Lƒ»”Iï7ÄBŒÕSœ" Y“˜Í-Zu óÀú c¥�åÿ³¬eý[¸^vù±ò3?ùãŸußC<ÿüâöówãþ‹×Û“íz³­˜ç\wª!™|£\Ež:¶©7æs$Oü ¤¯}ÖC=‹V…ç�½Ü,n#È ¢H�7÷b?ØFù–™˜àý�ƒ^Ý4á§Á¢Â„€–祹ƒ“(­r¿Û¶ßÙÀúȪ o0üð0”7¾òO¾p¡ýÿ¶•5Ê1Q›¡@{Ä„°<¶w-HrOKÌ€: ­ÍM„Rʺ·‹¹d0Õp@…£ˆè,1ìú@7¤tAƒaïDÝ?ÃØ�HwôÀ�©ï"­¶C¬Éü�.ÕœÂ$ Æ–(i¦•RÒýê!ªÿx©–)½�§ø+¯µçe‡™#4糬‚Åbj¦D„5òB8fPlùóE‰P@kFÚ¡ðþÊ´Ðiä‚€“‡ÖÐòXHô#κuKÙ„Zn%èÁ) ò:9x’« ¿la™æŠYˆ‹W»µsŽØí­PËÛ7W=z„è›3Ç×4ø€Š(s÷pPu…¿§þA.s/ªxÅmϰpÖ?º'®¨èn@6ѺUв–u¬ïøè[Ë�þÈË?ÿþ‡üºó‹óìYÿƒ²Z­7›“q½Ú�•F%§jú܆¥ù¡mzæâÆ“OrÐ⣛>ó~~C4aD„ëQ5ºý¦�P$’ š˜?Ô®…†Íì ý•¸4Û2¢BîÒîJÊìLÜD'ÛíZÇ=êþ²Úþò‘µñçNVëPþÙ+ÿä ?¹ìÈ߯º¦ÿ¯�Mã²`¿«f!™Dí’( ÅøÃa/D·ž/;¿£GÚ~ÉA …²‰«ñUŸ5ýÏ ÕAÑ÷À½ ±©é¤ˆ# RDöt´´9”·ƒŒüI0èç%M‚yPÍêÞ÷'½ˆ5õêOÕKg‹D½=òkÒ$!|µçv c©jŽy- €ã¾*eì–#2øeJ\ž¥š„ j4å�öɦÈw™ê¨BSÇ%ÍôêS±ó¢ˆ�ªÎq„s Ð~î� ?Ÿ¶j%@õ#Þã®ÓT �ÙÛ£"a:jú¬éì-”ö�8G¬�ÛJÌnWpfâ”Bþè5äÞë¢9zõÓPæ˜'¯ÂÔÔGF(¥;9ÕeŒ²¬;a}뫾gýÞw¿û3oÞ>û#·/ÎÿênÜ?}µ^ãäÚ5 Ʊ&&�grR»åðSÁíÒ!qÍè h˜&åÚÎ ’¼Ìv/õfWÝÁ…D¥nwA/°ÅŒ?¦¥LN\H [)ð/”g=<€žýí°@ò áX÷fûÑÖ†‡¯m·ï€—’ö[hÿÿ?tzÑݵx#±E— nA*Q]>T$^ÙM Ýv˜‰áP“¢b}@È�ä” 9}˜J2g“Ðo.!Í9õ?‚6…©Ò®P5Ømð¶¿LŠ€#_MK8þ¿ì½{´­ëYöüÞoεÖÞ'$Ô–Úá•Qoc«£ ¨°* ­€�‹#ÖÑz¡Úzí £Xm­ŒÂ°CFÑBä’D䢢!äBnAh HBHHÎɹì½×šó{ýã{Ÿçù=ß\‘@n'™ß ;眽×^k®5ßï}Ÿç÷ü.°f@JD£c&n!V¥8A_Â$” Š8 é,JÃF®¦4k$:P2”ÒÔ2ˆTÄÐc©ÏHŽë‚F²æm±Ho£hòcqoÀ¶Îôž\|‘T p"à¬yÇ)0¬�—,{ò`ñŸÜ9ð$µ¤^"3W,¥–gi&hâ(_éyæ±Ð·2ÓëK@Ó­0ã|`6Á¬�1À¾¶zdÒÒo|Ô0€âˆ“wLˆøBÚ|¨A Ì©´�Ôí‡}ÿFÚ 2 &Jm$™ß€" ¬³|¸‚²¹¥òÀ+fr¶õä^å‡þñî'ßü“¿òçÞý Ÿÿàææ ŽœÃÅååÕþâ‚­M2ºjb<žO—¼'N{1jjP:MÄŠû©–²£�W*±É*�Ó¤S‡¸Á®n0Ë�ÖÍ#IÝØÖ#Fm¦\¡[N ZÞ;laeà°3GÀ['ÙgX?Øö®=Úkw­½àbj¯ù–gÿõ�öÿaX�VÂÂÄ«Kq¦5[mŸâáçþ3Љ�øŽ ÛË�9Èýå"ð'k®RQI19¦ÏsAa뫬¹Jag·XW›Ü3^h>ÅKhU˜'°Ô“H!>Ô$ÌC´©F9=øÈú! ˆby'ŘO¸U¸• å&ÏŠÌBÇ«.5&Ì-ND¸€Åw³É7`[gÚéÝÂÛ_N¢Vzú¨èPmsâÓXFÓ,ÁiÙí©š€zvÂp Á „Î�òdKò�¥5kLÿˆ!9—ÉîM+÷ÛCª|8œžQËËêçMŒjÓÎßÖøåo«)x¢>¨Ë*èNÔ4ŠHßÒrH¼ƒ\Îy]ê‘ §ŠÜŠJÓ´¤«p4õ¡�1à¤ÀÒ‹vãOnëÉ¿¾üõ/ŸþåOüèôÄý{Ÿu}<8¿ðÐû¯ŸöûËÝn¿hþEiåÝ †·0ôÑUmùTäIàBfƒ†lJz,R@[�d½õÇéÃ]BD{œØQ�§Œ 8ÎĈPj±ì.Š&Ÿ‹�Õ.ÝE¿5üݯ¬…nÖÌÈ™œ�@?Ú®Ù»w­½®¡}Ë4í^÷âg}ÕFûÿp×5pƒZ[Ô,™ëb‚¡JÏÔƒ¯ÎVÃÊÅÖÒ"üüŽI5ŒIš@í u¾ìÒsJQ¸'ŠKù'…Ôn ecIÈo fÛ ·9Ctªã‡Èä•ÛoúOê@_�DÆ{›4Å ’Œ½ŒÁf)]Y€+C½îñ/…Ša‚ õX½âˆ8’(ïÜs ,Öi�ÛÆØ€m�ãêqW؈ UW[¤ ¢’w­´â’ íSX¡hܨ¨ïVhD~"@ŒtËõKqø+ži:+x¼:Âëù(ñ­fÖ=m§5vâœ2Ü9]ýO(ðÚª¬Uƒ-î#ûëÀn¸»¡ýÔWJ—;D²NÑuBÓs«–+kƒÑzTû Ynÿxy�†‰Ü"s¶õäZÿã÷ÿ£Ýwß?ü¤Çï?þ;ï__?óÐûfÓd»ýÞvÓ½‹ß‰F´ºZj�·�îp�‚¹þØ•ÀÆ’Q“þ Q?s•¦çƒL[�ÍÁ­i~"±�;ÊKoïüëøŒâNëSÙµ¹w(fƒÏ]¸�8ÈÈnèýôÃagö΋ÖÞ°›¦—™õW¼øYíÑmG~øÚh”D4H»E|y{/þ..q[Dƒ£UV�u¨FõÂpÉ,n˜²±ëvç™2jVC¤u�…û Ðòÿ¿�1†mioÐÀ m$Šy«¿kÕ¨ö£§tİڇ­NÉA=r…åƒj>ò-öGҳ燉?å)xA'2Hù³Tå#ÇtfŸ¶c¶uŽ"¬1Ï­¡?‹l”´èóû¤pjO^š Sf öƒT68@ïðÂ’:¯µ!Údôr�«Õ¼%jšslÞsy 5XÇÂìn4³‰$zŸ{_‹3Ö|ûçÞáñu?JöžnÜÁ°t@YŒâ»0†fYšÓ­È_$4G”fÜ-£ZvJÀ¥îÜ6¥ˆÄ&{(–?ìr±«(‹Áú�ˆ´67ì0m4Êm=yÖ}é×îßþöŸùÄûîÿÞë››?y}8þ:íÎåÞ`�=©¿ƒËÞ#eœÏ¬¯ œÃ2NGšŠÑº½¹jY‹ ;\cèl*;¿'À7ˆ©Ñ®HžP‘(ßN$d' ‡Á|öËÀݰÙóvqŸÉAúìË7Û{Ÿí8aóŒ}³w\^î_=5<ߌ¯±ÍíÿI³Ú´7ÑÚ„@=óiÆVfºPf|0T@=‚F‰Er)õ/„HÕür J«á¶•Kž-¤ÒX›UÄ%…ΰ|ñ ,h#¼²K!uÆëh‡1ë™îBõ4j0$MŹØkšÀ‹ 'Yô,ïs/P"�uÎ@(üƒ ú©Á7ñrdáXÂ0ˆ…©G1]uk£eƒ$ù¥šĬo:úåvblÀ¶Îp… I“ž‹9M¸Ýtdv‚zcbdŽÐmãsô(Ê$ÕhGA�7]å®PTè!⬠Úi”@:ú§†„¤Ðy[ä�GÑh�˜ö}“Ìõ…îK·ÒóÆ¿¸3˜VC…v1؉R�eÈ/Æ{ÃPYS™¥òÑ&$Ž×ÃÀ=s2]š ñvJœ\ZôIŽ›© þá‰îs«¢¶õ¤Xí_¿zúÑõÏ?ñ�¿óYn®ÿàÍñøÉÓn¹»¸èÓnB¦µ¤}ji>Š-ªÔ½I%ôùËã80à°1ƒU³*OW§nK‰µFV '€pBïã5"Ùᙯá¯�rY¦3 ÉY~5dH¡5ƒÍâL²JÚ†¨Üä€ë}F?�ù¦_4{ûEkß7¡½`¿›^ÿ­_ôíÿIUצ,i‘«ûF†ì¤8 #¥6ëbà <ŠY…*Ž1(ϧ«É&4#Ç�­$ÁÐ*ð�ÐÅ�9J! «ïFãÆô¶Þƒ%1~VÎòä­ÖüÎ £ˆ*l4³ð$E%vð4DYϼq2V»ÇÈ-�/¥ §• ›¤œÚŠ¢—R²fòD°yCnÀ¶Î÷¢$2 O„ô–!#ª}Z1Ý⺉>K¤š…â´²u2ª¿i¬€™óf­ŒzÖ-~‰nVU°œr@IŽ"<ÍÉ'B€ê¬L c߸í 1Ÿ±õû.m‚¦äh „#=XÐ1¨�ú‰I.JyÃâ¶4Ø@gÙ,MHª7}¨ -ÿN/EžIÓêj)¥ú¥´­'ÃúKÿêÓÿÈÕ½ûO|öý›Ï<Ìóo'¯.¯æéb¿àt=Üý•{ªFûÙê NÆÛÃS�£Q,ã”eh XBª’ëМºž—h�õWZ5kX™›¯5a»®R^+‰:à ÿÍ&¨AŠ´“8pì“ý87ëÇãú;®¦öêËÝô2ëýUßúE_¹MþŸlw×0„C&q’²ýÓ>–…Ö¯¨’¢M²WÕWÂåh´õl§vðÊB3­”´²‰éLéòõ¦:5ËÉÃÀ r¾íê’3"(»ñ¶‹�Pl…Rq ” R[PÙªa!+.¿©ù‰ X4cÕ0›a©�¢€Z•ÃN¼*sg†yÀâm)°­ó=È‚(“uÕ¶‰ª¢íëi™Ó:ßÔÿŽc’1g*ù5µDÃhÛ–Ãp�ôޤèË µn‚Ãr‡ÇÎÈ p 7£à—‚» W�ïÎ@s¦ý’`õI-B Ž÷KÕÕäÈÄÆØ½Æýox™‹-‘¶�d¶úÒí;Øo>”F ¹NÏ™uJàà "„›‹^�Ö ÖÆ‹´n°ã–™»­÷zÞËþŸýOýäO~Üã÷Ÿø]÷¯ü™Çã¯mû=zè)½¡¡“ƒµ‚`íÑ*ƒ/Ç �ŠÂ~*Ôg�Íh6ÌÑ\Pà?ç/}sŽÙ‡5ôûtG#ø�¨F&ˆ%».Vƒ‰U›6o´ddû}2>qa÷�°ÞB‰ë$ûL²úú;îî÷¯Ù5<fßG³{ÛŽ|Ò® ¬�ާQÜѬÌ9¸på‘ñ>[O+À’c ³KfÌ%ïfhC@«£ûüê®M¬]}XÔ9)M$ñDÇGÊ£‘v9¬ÞlÚRªôã³"šÏ�HjÄ< c‰ã£P;ÝýN>m �šòYátXA�ÆK¡ä%ð)¦W)•b–ÁH&%*èS.æ›6d¶u¶M8Ú$†ñã,$Q§:éËLS›>˜ŒMNR™éߪW1›.¨fñ”ö*‡\â#“b §‰nêçÉ×j3ÓÞöp}~ë‹_C¼íÇ~V*qÁŒÂ\:|wå«Kײ¼÷(ŸQ­À¨Èµø�¯ 2­‘ÏZÈ›ƒç?©‰×jv“™(A…@�nÞ€m}øÖW½ù íG~ø>þy×=¸¾þƒ‡ùðë÷WûýååŒÖ@&C~Mý´Û¦•ãéPÊŒž… ™�-Í}—#»ðbu¦‰«½Ô§�ÌJzÞ(uª “V'pÒæ!²¯3·vň‹©qQE³&ØêËÆ´`Ÿ½wöùØú<Ï—Í~örÚ½j×ð¢ý„7¼ð9_ùض#Ÿ¬…Mþ µô>ö÷I†r¿¤>…ÊiLë X¯žÄÉ\SŸ·T3®‰ÊHéY+ÇåÂa|Ez'@;Kƒ ·ÿ)¯]«Ÿu±i,‡nÙd´rŠò?Þé V�öð[Z�Ñ�Ç¢”j~R4ÿĉ*Nõ¨Ã臣[[-6jÈlë\—U„Ün�ó�Ò×Å”6{@3õøG^£jÖÌtŒæS9‡SxjëйյŽ%Ò*$ bz"] êÌYó~†÷à Y;§©´¼g·Ž‡Y®¶EO»~«Ç¿æ*?ùg«Ûu¥»åɵÖ�ú7!-×|Ú8 ® µ ýV�¹ŽeH!KÇQÀ}FÉ·µÿÛúp­ÿéõzý÷¿úWÝ»ÿ3¯¯ožuìýw`ÚÙååÕqÚï­÷¹iZŸà³.•GÈÌÒ_•’·͈ƖвhÊ5!5ñ @‚ÐpAóÝ'Œç,›u 擬ƒk9HN™ÐƒãZýÏcL&›åéo˜†«ú<7›�7{ðÓôª«ýþ%fö½/|ÎW<±íÈ�¤*‡bWé[~hú‰ ž@ºJ–í ½ªOB7vòaÖ–’3)žniGUÜÏ¢l‘‚j•¶ÌŒcÊG�ëGÝÒ5ƒEÓvÖý? ÅXq�ÏÀu©Bšˆº¯¨ì¸\Ec‹ÒŽFÿ IDATU!Y¬2)�B²›`ä;†C*Åá/Nì¤ïZ|Œ0w‡™@¼‹–K·µÛ:¿{ÑØÆØ,e˜lðôfŸî� ³x°å•˜A69Qi?„%|-~èü°U5'^Z²t�gàju)¢G"ÈniàÀ?ÃÙmæ–—×ëdèÜÖápˆô-——ÿqžòè.âê fopÜm^ŒˆÓï$ål>cn6)= †Ð ™Ã åÃÂOŽÀ„å2´Ë1ï�„È�ª%`-¶µ­Ýúâÿ­ý[ßú³ÏxâþýßýàúÁŸ¾™�¿vÚííòî�´Öç>N0g»W'Uæ!üwÙÖ "š- $Dcº.jMCÁg�,íB ô¢8�ÒöN(æÿ\‡‹ 7g|’aO›î1n˜µb…!¤/B¸ŒL7?jü°¢!vZŸ�àñÈ ³wܽ¼|Õ4µùZ3Üßv䓼ѓ®ÉÓÔ_„Zød 0ÏÜ, X{VsÀ4`ZE �"Y–ôrfPX3‘B§®8Êmä Ïë¢ææÁ¨áê�Þ=ìk°™ZЇïLÍQÇûWù¦±#Ü{Ï„%J*)O«V¨d☠ÈRx%‘µ=*ŽɉE[ÓMÂÕ¡~Bn°:óÝÝ©¿·)6`[ç �.?[Ù§WÃÒl€t.�AhuãØtºKQ!·'¾‚Vír±ºÓýchY²VgzÉ'ºp?㜄U#ºñ—°T©àœŸä, ¨6ÉÏYÞþ‘«jƒ¥>×Ò}ñß/ ÆÀ’Ì4×6êùê1îï?Æ¥WÃ@ŽŠH?^ª{5/°gÆSN Š€È33°$n·å¶>¤ëËÞð�»Ÿ~ËOÿÊw=òð|p¸þ‚cï¿awqq±Û_t µ°­€xœ§Û…¶¥mgXðK6µL\ŸÛ¦L°x8[9šYüÕS,ÆÒ,)çµ./Ÿc®GxXuÈ+BZ ÀO�|ä‘öZùÅÅ<$tËéÂÅî¿Ï3ú|àxÛÅ4}ï~š^x¹ßýà7}á_Ù ÿ>êO{_�Òû\#‹N¡QQåû–škëÌâ;îð%ÅO 3† +O÷@°]:!im‘‰HÝøv@Tì­Xux× ÛÜkóÌ*yMÀÒ=(„ ¬ëáâÇ›”ŸêÂ#/ÑRÏ(:ùx?Ó3PɰÅ÷R"u�³Ò ˈ1#XÍ€YòT‰ :oPlûœûe©ŽHƒPÃû[<¡K/ˆôÚÕ³‘¥®Šó’,ߺ,•Hi—èË'.‰¸U ^�æ,Ó­!X®ã¾y43Lÿjµ ÎfçLšÛí÷ÞQ³zÇžxýZN[Z÷ÑQ‰%WÖRñÄ[ŽÅ‚"µÁ¹ÑXé‘â<ÞM,ÉTäa,…•(}E&*ë‹ÚÐòm}(×ÿò†W´Ÿøé7ÿªGï?ñ{®çÃ3�ä§Ú´Ûï..ûn¿¹¨Eãg’³‚í¤§¬žµÉ}ÊV«i~þ9Ãì/L7Bc ¢ê%õþ(ñ²¤ª´áF}A\°jÿ çSJö–¾~‰”•¿BùYm~étZ?ÎàñxlìïØOxõÅÅþe³Ù«¿é ÿÊ»¶ù‘RÓ¬%ÛŽ-'<%;eÕÈŸ@_iõÎÚI3«œK H¼W•Ði˜Es’)²V™Y {~øí:}³c»»(—y¯uÒ?Î<Ç(u¿r‹lh9tK ^†^—÷’a5‚Zš©v*³ºý·‡Î¤Á±™²6’ˆ®×~ÜZÞok¶uo~‹š*éúNìÑ0á™2%<™¶Š[›ð?:}:§|0ï«~sX/§j¸C[—N�«t’9â‰Ë¯ŒŒ†¶�ãÑå®d z·³6G}ág€,}8~z5Åoü%§ ñ%ÄH)¢¿T¼Çš™5+p½´÷�$­�_ù–£ü©6cˆ…W™CÌÅ-·Å€´¦ ”o”pô¿€­ûßÖ‡pýáý­ÝOýÛŸ|Æ÷ï}æý›ë?uäü[°›py÷!›¦]c÷°¸PË Üqºâ¤IÃE¶å�ô“F?bIãøÌ€ÖŠË0ìV[to¾½ÉIŸ>ëðIêx4sn/Ö-Òô¤¤+“B¼wÉXueø÷‘çƒÌ·ß$„@d¶¢ÐDͬ÷~ìó|„Yøb?½¾5û{¾Û6·ÿ�¬…@•Ô‘lâ! WƦş‡rºC)(ÞTS¾KÃ0FÞ<¾&9eŒ¹D¶k™q;‚ ÕË¿WŽ…ãf.ÈëÃî–Œ4�ñ7Úvy-‘Ÿ´nÝ‚&ÄQ—R¬.�+(‰’Š�Ì‘v§ ._„Q“0Ìö›×«YÄ.ìŽ*úL å+ ‘‰ À§X€k¢¬JH4�D‹³V‚·}Z¶g¼6 ÀyŸˆ¡hâ�U‹o>ꌞ…�ﶦ(œ(¡O™9úhr_¥U5†ºèáÖq»ñûHcø’2 )Õ€’Ó%ÅËIùxÆù»üÕ‰­óá€sFŸóâç~ìÇcƒ”¼¡xo¤“Â[Âj¬daÑ¡©á¨<¢®åŒï4”BDn„�ÚÚ¤{eXŠÛÊÈ’ª@cB*7¨|[²uïþ=~}ïóóñYóÜ?¹í÷—»ý[k--Âjè‰@²Tv°¥ü>y,Ô e¨ÖÌ—ø´+3 1�ŠßLõ2Ra .d”Ü+[Ѷj(@þ2²Ëz8пµ1 r¾)¡Eúzü«™±wö~h}>pßøè®á‡¦†oF³×¿èÙusûÿH+kú<úà®…7ÞÙ{h�¾jàz÷æv¾Ã–+m@̪›É0LH1¾8Âýך4ÍLÏ[ ´ÌZ‰ñ阑_ÅDcÃÔ3‘³Æ…Zâ%1ïO FˆEj»¨•‰ý¹ÅC ­`‹=RÎÀ2ÛO‚“Gâdî‡>-̓:…<íX«ÞÐ…  ¼² N•K˜!‰7�e"‡©ö¶6`[g·:;YXE°f{»JÚ+¡nf…’ŸÌÍ S*¶p眥8ù\a´+í;j¹‰Ô©®ØxéÁ«ÎIø.9rŒáRÊ‚‹0Ï8gÕÜáþý¡‰d£·öá6Û½óFBJj­:‘Ëäœj¶oéŸã%L8&‡cMU‹7ÚâhVìHó!†Ñs@S®J®¸%­W—fØ €m}°×ÿü†ï™~ô'Þô‰�ßâSÜ\?sîýÓ ˜.w;NÓddGÎÚÝ�0‰ÖCUË §µÜvò.³Ëf’.V­ÉMlÊ ¾«iH]LÏ#½ CoåËj}M ÷ôÏÜ�<¥‰+&2(Õ½�ùˆ4j×ÒØ¬/ ±>Ï­ÏÇÞØÛíÛ/öíeföO^ú‡¾êÑmG~DÖ5˵±‹§c!–% k¡‡Y½°J˜�lб‹‹ÆM÷8³Í«jÿÓOÕ’‚æí¢ýÎǶ4¥W8©¹Xì—”^Ùšm@¾ÇJ ´È3­Tzz\ÕvDÞ–^PŒM¥öìzµ¶çU´Šµ–%n’yˆùæR„´’IªnzYV*EýH3cöF߀m�ëyØ­G$¾lã&ru¯ûȘ°{¸hú-S{/Mc·LÛu&]M|Ê�Öúî]&°Œ†Î�¢eÐËìô²,öC²# W³Ü!¸óF¶ZoÖ}ÔÛ;;h\œµÏsÍ×7X³>7öÞŸÍÚÔ–w¼ÏƒNçwJ±’×L×DcqN”@7^¦‡×Ÿÿ8hÀ4!„"ôzk”€)J&\ÿÞã<ÿ©ëãñ“i¶»suØû¬ƒFø$ˆVüTÃM:†äE�ŸÒ&T@¸ÐK�RT>@öÙ^kÏÏ…;z,Æ@‹ê§—Êp‰g-K\¢(gÕ®€a'š…9 ë,Ô¢ë] ÌøŠƒ%ÝØ&9w6âñ‹iÿ£í¾œf›áßGj]Ó§Ñöc±=C÷FǷʎ䊓í %ãðÍÌÍ6>¶¯;LhŒ-‡ÀÐAíDà Y·™868¨ôF‡÷$š'£ ‹ªÎyŽ0HZëCåsî¸PŸ¥;ÐŒ‹*FÐ –9iBWÃÌ'f,þÈRÐЩ±aL4þ~à¶D¸Et˜Hò™9(Ý~)\e¼ kf2â7ùßEè@.¶�} l¦i;16`[ç¹PŽ2&Éjæs± 9¥å+4š‘ëPÇgµ/-·µ´�8�Åt¾bç §”¬u«ظ_¢ð´¿ø´ƒ«Ðr®Lb¹Õg‹ …×�ê¬lâÃV³RET1W‘ä–ÛÂÖáÞ«6Æ••‹ÏDz‰`Á%¤“¬Öj,w�K�Eg`ble|¹|YµOÞ†ÿÛú ¯{èÑ{�þÍáðì›ãü›v»ýÕn·ï»ýnìÉ®¶˜ÕJ±¨Èk Æ@Ëêqtë,�†ÙÚsŠ*áa™ñ[Žî=šÏa»úÐ'<Œ³uc™²VñA�ÝfîYd Þç¯o8j<¾ÁeàÚ9}nûý øÁfíñ½/yÎW<²íÆ�ä¢F\b_ oZ'ß/U%ŽHGþðv½ÀSµ0ÎÙÛö£ë¿cÎ�Ú*"ðÑ´`Ålt|‚rI¦�qé5{ÚˆÌE|yÈú0ž-0„(rG�•�Ô˜IB4‹`=³L(^|©PsŠÊQY"X˜Ÿql…8¤¡ CS† É€¾jfÇ£%Ó"s���ˆH„®mk[¸õ9ßð˜Útñ؃'>½÷ù/ÞçßÔÛ‚]AoFñ½‘¾Q848¯i´Ýb|˜o¯o³¾?Ax¼¼ï¡�wñDŒ 9J!áRáz²”¦IáW¦:£FYL:5 Íó”%_U––Wܕ͒_É¥®Cˆå~XPºö&kÜ€m�)"šÿ §¹eÿŠ‚ïôX¤¨™ê&•B=tIÈ(µRžŽb1_j…âIqù1ùXjjºšËjé«IOÉ›cU¬;ÚctÄÞ/®ÐÏYîݽ\°%‚Eତüai ©ÒÁI8B Ó - ­Yƒ'–=ÇâÝSý�M§,… Í€¶òÈ ½<‘»3^Q»…`¼­m½_ëØçËÃ|ü|öù9‡ãá·î÷w÷ûËÞÚ£µµU2¸ntus�ê�rŒ™‰�x8½Ž?n¬îþ~£Z÷¹“šËù­˜W;9•e4ø¡8œ{ JK«é+щ‘vBÕl´X´9ÜÜЬs¶>çÎúc;Ø'à›v°W½øy_ùð¶?º:½tyPÏÈØ°JW„³ç£=c6þãó‰NÌÄhÂái+0røŒÃJ܆?~�%NUc0 ¶„bž Þæ›ÜóeÀÓ/ifmóJ c vËi=¬‡BsJB©*Ÿêqƒ*··Âø/ðNrE$ •²Yác‡H['º˜ä ~ IkJÊ&‹Y¤ÖO–fÛ:ë£r[g|"®+I “>8gµK1èþ&Ùêz†�¬&�¨*(f–Ši£‰5ÛcyOh a�S³êa–ãìºÂú÷C›F^Ü1û'_òëÎödd ñp‹ñ�¨ãtØOß;+/×NËã_V¹~Ìw?Ðq¬7E¼©ƒNÒï´_„-2*—(BîvñÀ�Ûñ¶[ÅøLˆÈ[ÿ¿­Üú]_÷¿}ì|8~ÖápxnïüìÖ¦;—}¿¿ {ê™êe=³ Ö�?ƒÕ³™©)Jp*�£W»ž‚]g89%;¨�0…ý�TP­T±ãF�UüÚ9¼hjêik¢u‰¼¯¸YÎRE¦Z ±s>¬o8ñøèÞøÆ=Ú‹Éöò?ï+ß¾íÆ�¢µ0½�%uó¿eþ�•-͉(f%pæ4ŠIT•ÆügniHðFF׬T�¶öÛXm÷µú%¢DœIîÞ·P øEʇ 0˜¹ñŸ–#•ÓQþ@ýSålŒû�}Þ¬sÛNwŒë‘<£ˆê1ÛÚ‘Û, &Àú¢ÇòýðJòRÇ;Nu8wÓ²ÑZ´”œ$ÜO ™ÑÒ–Ð#™ç5|8ÐÒø³NÃÑ ›•ò¶ÞïõE/ø¿Û÷îíïFgÿ‹77׿©í¦Ë«;±-ò£ZÀØ-¸2�wJ—Q¼¦ÊÊ�Üá^NÅû'&ö–²)íä)î.1}b8ë;éë(Dº‰§+"kñ¦ZiPò-gˆ%¾;8üc"&íH{·TJtІ¡Öq¾a?Þpg|äî~÷¦Öð ½ó»lsûÿ軿ÀL¬1®¬2lWªPü^ÄäŠÇÞe$³CŒýÌ¥,E› ¡ëÓÅÝ—8%ƒ‹±ûŠi¶”`ÌH£e¼ïMOs8D`0kîm‡ÍpÁ Ç{Ұصà9ºI$˜ã§§j™I$.IŒc§E|EhŸW)pªáÕÕ%‹Åï‚!u ÃcuØ2°Ô-Ò5ScÔØSeÓB …mmÀ¶ÎòªÔƒA<¢aëÑï’�£ y�¯ƒß ƒu…WFq „œ®ìýÃx½X¿Y!>™ö€Â´sTé†j³B¨¯|‰Qqé�™˜Ö�r8\>ûï¾ÿä�þš³¼5ÙûâÀœ¸Éû’ýø¹«Œ±±¦0œ‘Å8T“,¹’R±±$#i™¸ôQvr\—AFÙßù”Ž’ÃKÄ&Íï Es�X¾­÷s}Óý·ã;_úws<ü¾Ãqþ¢#�¿uÚïïîö—œ°sU0OØNŠŒÒí9Äa*OÔˆ÷C÷s7h§2=7�ߤ jE]ˆ°b1æí rÀ¤.°–|á’¦W§š�ïÊÒXy™A:¶<Š ‚Ô@k Ù9Ï7˜�×ýrjo»œöß¿köÒð}/zÞÿ±¹ýTÞ_.ÅŽ=œ„ìA®–À?hìÔäЉûîWŠ[ì6]ÂTDÂý‰r£J¸Eáasu¹ª}»#m ƒµL³yÔGseÿìäæ^cC^�¨[ÄËqN!ŽX¢Ø2„ƒh•éG–¶†féj‰R�aÐE|ÔOÏ5eIVL†C±l㨉]n•;,™ZI‡ExHì¶-6`[g ‰RܤMpEñú÷³"„ô,#Ÿ[çç®óJ³4„ö¹I-¿Õ,/F;�$¬P[5�.L©(^Pz•fE\êl°6ßœ÷±è‰á Þ3:ËÖ²V*ZJ>,¯%i¸!äºè¬té¨â¹‘'Ý;‚1 5Ä­ˆ’þdùö‡Wäh¥Š»oó±(œë- p[ï÷zñ‹¾õnןyìÇ?Ò�Ÿj­M»‹Ë¾Û]À:¤ÿ€ÎÒÍÜMHØJaR…·X‰xâ-�SÐÌ•�˜­Å¬b*åÏnÀŽ+TM¯WË"µ¤`%ŽÛ+ºö>\‡ˆ–×a}°hà_6ÏGô~cnâøra˜ì¤År®z¥Í·¬¤‘l»b¶uÎga·aÀïÃÒhõRÿ,]Zz·ClÚ³– o‰<Õ‹\ŽY¶NÂQèR8ÝÞ²9ØÍpN5ÓÛš AQ9u'2¸w5‚ÿ-ݾ ŒàÂv3€G;k íw¦L.DÚ(Q†™wÄçy3¯×�7ï ÅÅh”­¯„©æSšn¢-–ˆÁ…ßÜe¿� ªŸeVEŽI)ÕÜÔwùNÜÃ7Š/º±³ÅŸ4؆—oë—·þË¿ùe0vOÜüS;ùgóñ7bjÓÝ;wK7ÉAIšÍ˜Ý5Šl>@Ó<cÆÎÐÿÓ/âé‹PÙ÷ñÈ!ÓÏKN™!]ý%ˆé-‚. zæÐt�AT’�?ÊòÍJQ�¤ZE‚Bß7-î<ïÏ,c&U@•ðx 2ž0“xÜÈš4V?­)— 8‡vΧ"î6zã†Y’ö–û�I¾åšeiBq-Üuž/H’Gé î»õ§D@%N‹C">*°NëH‰ž:ˆ{ ³Â%n}„)õí²ÜÖ/Tãñ’Øÿþ››{Ï>¿qº¸xÊþb¡ý÷ÞÃÑÂC-#ž,Â43Ð$à®Â‰ò>&9 «£!ÝÙ¥a’x*=Éó‘VÑ+e¸_¶„ Pù`ÌøX'çÔ¹ëhªVð�Ù© iz^ûßvC‚Ä™;g;Îôã¡_Lö΋izÍ~š^0MÓë_ðÌ/ߢþ>Ú—ûÕ,û¼§·~ŒÉ!Tíh•JÈd±\³ð²AÆ£½*J·[leÇöô�ÌkxUÚ„œÍœ@žÓ…¨³bÄø7€<ݽŽf°ÖÚYÆߊK…S€�4)Iâ�Ù%ãÍN›â”T•õ(k†CÙž²±b°eB�%C5L¯´N–*J(V,´¬@n‹¡ÖÀ´Ø Ü|�6`[gº¦tÈÍ“°ª›pøVh�ãhŒRO/›Ê˜óik([¦î¦”Nͯ±Ža!nåÕù<\„U5YÇs{ �,Õ|<ópÔ>›éÏÀï(¬{Ž,¢Ô—ZýõrZáÖ‹O€%Áq ïðpûú~l–›*H)^ëNÆ bf®*µd.X’Wè�ì[µ­_ÒúòzeûÁ7ýàÇ?xðÄÚçÏ=öþ³íºØí9M;ë�™b¿Î~f “ªš+é%²(­î)¥¿'OÔ÷«ç�kkiQú(VuȦf½ ÉeŽVD8¸MÛ_fŸõz¨?DN‚ Žì$æù0õùpœÈw]îv¯½ºÜ½ÄŒ¯øŽgÿ¯[ó.}žo™% &DÐ…9ŸÍTш:WðŽ+è‰$¡#Ô±Ò@Æ¢G)$×ÚAÍt£˜YÀéœy)8 K>_`H’ÄX¿š˜ ˜°¥¬ÓDŠ– så”ZTQp R…ƒ¿0˜hf9Hб˜¯ŒIl…S�iI™´XAZ�àœ*’ÖmK‡Ø€m�ï�(uš[=æAÝÌZ•n2á„‚Õ$h9î¢l5,^4îô/ÉO~¤ÁMk¢ã[¹Í�sÎÖ®ž7VüýOÏ1" wÜr,Îð�°ÅlÛ:‰³³ÎÞ÷ûÛ93£š#ÞÍÀ>lûË¥4D‹=ݱ Z˜ò[ë˸b%*vÂ?2ó+pwñEbôÔÑÈ2©�ÜÙbOéÎäþ›Ôè\÷#÷b+“Å‘ÙzîËe/6À&kݸï½o±©ÛzŸ×~Ñ×Nÿß›ÿͯ˜�‡ßÛi_z=Ï¿ž†‡...›™Ù<ÏËñè}첑CÐéÀ…ùË¿ IDAT¥¤’I–Ô™q‘'§ýÁ[ÐBÁ ¤íkÐù#Â<Û Ê€Úuß@,`––ÆŽéˆc‹ÉkJµ,É\ŒˆX¦µçbé)kò½d3k4d'çyîóq¶ì]]\¼q×ð-€½ÒÌžØvä¹ÞFu°ÏÃ&ÝÔo’uz;L(-bþŽá§ðS¨š…O0¼AÃGy\e*LhBÅ�™ÉêçFoÁ ‚Óܹ.Ü䨭[gl¾ó^}[çÞ[C7W~švûý�yº¸0ú(’nW®fPËD þÁM�ô¯ÌŽ’öX#¥å,æ pL<Ñš»—f¦Êd 0�îJUºó“˜k)RWŠ›ü&\YªÂŒ&)…EÌåò�Öûq>‚ý¦ïm~ø¢M¯»˜¦—ôÞ¿çÛÿðÿ¾Ñþψî-³`Ç#N;qqSóÇÚØ¯˜7’ö~J‹Q¬*à(PjM\=½îbcäV¹@ÕÆä`§^õL‘ÙÓ±ùÌ÷EúùTÙÕº8Ö2%¸üJW´´š.Ê÷ÖBYi cÆN�¼Mh»J´*ºN$x #,?¾BÝì§ßô¶Îlm”Öó¾&5èl²aS0I�‘XR“�&p¡qFs.Wâ×*5×èY¬ÁIu«Ýeà´@« zLžL�±™³%Æ !í7û´&á,¹¸}¡;´¤®*±«`ÆÙáBhÖZ³¶°Õ:ÍzŒÍk•øùG€ÌsdÊͤ ð·¸-§ŽÇëh(× +Ä ‡®ÑÅÞa–Gú_r•W¡Ýƒ(%ÇËpŸËþÇ£Ñǯe³Àæ -ßÖû²þä?zi{póà·7_z}}ï·wö‹»Où˜¾»¸¤Y™mü"²r>):ØÜüËÂþtí¨ï4dŽ”êfîý ät žÐò÷|ëqî6²Z WEŽÉ-ÀTœ´öÎ+(D» jK ø¸m‰mm €3?ųT篨T Oêô°qduò.n‚îð.“á”Tå•Y©Þšma'e˜/ìV1p0â\ÂCPcÑõA>I$,§0÷—Æïù#¿ú|›½.¥¹€ÛYÛ S>ìqîÜýEÙo™Fù=¯aN"› ŸÙ*J®Æã쬋d…&±º…ÄzAAI#§A�[2ƒam»1·õ‹¬g¿ðk/yÏ;?Ùzÿô×÷~KÛퟺ»¼ÛÛîÒ§qKì$k†’é1ín¬4�sV† «[؈ú«›¡� ,Ud8p"´b²ìiÅ¢Ú¦«q1މð`ëÔØ‚ÊBÉ^E PÙNƒ�½wŽ7íx¸æeûîìö¯ÝMÓ /vÓë¾í9íÿ\Û¨VäxÇHy4YTÆ(�YqW>—ϽÏý[¯.ŸòÎÖ××­ÏÇå!j�†FgÄ#³îirx�KüÓÆô›n�LƤ íUJ¨²©NŒA‰^Ì·2‡½s‰(?,ûiË¿-'¹Æ�oAœÆìS @ÂBÌ Á–nmz®gŠ5Iöy>°Ï7}ßìÝO{èÎ]^^<†ï„a£ýŸ{]3D*‘¯9vXƒtÝL<ŽaRtVXÄ?­s�ÚèÝ©ÀvP YX\kÌšš!ÒQ›e2At¤ã]Á™}ݰôhË5Ö–çi„ÇmíbBéžYùã„ú™…·1˰A PÑŠHá )žÁ¢Œ¥ºh­U½²xTA”r¤±É§`ø#�s½p`S/Ü’»­óZ›à¬Wñ•xÒj)ãæÎЦÚÿ£Ëi¬˜©s§äO•äxVŸK~SŒb´/,<±éaWûÙ �’7µm(TÃÖ D?š�³Ü{ž�y9‰ ¾eo>4÷Ù8û(~¸�ù®bÝi<5ûƒI(~“± Ô»�‹Š\uäŠáS}w4—jKPø*¬c°F HýÆí®ÜÖ/z¢’Gß²ß]¼†�¡]ÿ¾#ù«çÃñ€ Ú΂�òxŒ®»i¾åˆVÇðIMk±Íó!uk "¥Púè N²ÏIûâårË3t‹ák:a™U5•iŽFüK“bšò¼×É~�€Í‹r@î£å0èó�õù†wv»Ÿ¿Üï_³ßáEÓÔ^û¢g}ùFûß–±{¤”hç”Ê>UáXç¥Jî§Ô1™Ï®ŸZn“TyÀ%†PZ¢YŸõá º#DI•óéoµŸN9„U¾!¸ez/凨H ¨=5o±³éÕÁæVƒz˜%Sfš¯¤Ó)NÆ6h�ÈÖhÚé–€A£ ä/#ºC:«škÉYÙâ!6`[gz$Ò¸¦/©‰Ú’?…5`P|S)fªk]¨¢¨¢œBÎÜÓZ k[^š ëêPiB-,‡ÝÛ‰jŽ©†E¼Ÿô8ç&fvÃTv¡•÷x6F¶—†b�,Ÿ‚‰ÔH|¹ü”~ÜݾÒjBßjà6óÜ’ÝÄb h%^É),9éËV«±´ÿÙÖ¶Þûúöç~élfïþ£/úú¼÷àÞq6~ŽóS½?­÷n­qp¦š±Ñc§‹d†Â;Y�¨4§áœ¡É-B%°PìÂô“'=ù*[Ð,í8RŽ Ù~þÈSÞL‰å¤hœóf`É—Ye³ 0ƒìǃõùpœÐß}uqñê�¹ó1/¡ñ¿à ÿÂãÛîÛÖª³ßž«&èÕY·U8sƒÞÌS=‰£]m ÉJóæI…ÄU°²¥ó¼ãlaa[•"3C^&˜½ªšnao·ì JÐiúWG*ný¹•=�ÅÐOÞ+-¤’«X2Pôl„éðM¹`6¨;�ÈzI5*ˆÄkÓœe–’}­Ìd'¶|È ØÖ¹ˆ¤e.i\ŒM/¼„¼#‚W$Hc}XÒ�ÞeÒ%"(L9Óõñ<3×$…æôÙ,ÃZºl\]�‹ûµ4Œ&w+lñc]a)åÁž¯:¦ ±E}:!¯2FŽn©8gM”‘þneòÙàÞ‹¥XöîÝèÑÆþåF~m©Î´¯ ÑÊ L“µ „`Ù€‘ ÍÚÑd4 ØB·õ¾®OøØg¼çÍo}Ë¿Üï._NÞÜé<~FïóCœÍ&4 )€³‘éRê§#=ï”´aê5Z/ïHõæcÔ}Èc˜.<¥ÎA1Y‚+¥9ZŽ”Ì|¨XÊ^�ÅðÍè¶èŒ×!~V1¯žšµgæpvöù†ýxƒÉìÝw¯®^ßž�†W�¸·í¸mÅ™½ìÁ±ÿÑ þmY³¸#\`SN¾‡uTû6ȸ8ÞPC+ep‚b)»Š&N³¶áÅ©Q‚Œ°Ü!XC†é£—Ê£M5cVÑùvyu†¿_j`²þ–Ó·A¯È,“ÓŸ¹E‘0)­ÿó³ÿ+þþ¯ÿï¦ý÷]M}·ƒ]>v¸ùm77×Ϙh}º¸`Ûí„Ox©2õSà[•¢«çCC9 Ù%5 9q¶õñ£Ú‹™xö«Y–ðjXêÕª.ÔM³bG1-RØøˆ¸Aª@MÖ"gÎÇCã|èûÖ¹˜¦7ìÚôÍ­Ùë¿å þÜ£ÛnÛÖª®ñ‡ƒÔÚCjFÌRÅÐN½f åM(Õ‘=ììA@ÐN†ù8bUÕX�èÜGqÅ8PgVÓï#¡¿¾).vÇ“sê´mv_ž�àVnt’äx®üH“³Áœe-oý¿ƒH¼ñ“s�`%$Kj*ÿAȸ‚kn”ªP�“þ< 2 5åkëþ7`[狈Z¡cbMUC”hk4êRÿ´æ?™Þƒ4$’-‡(Ó‡€"—Ï/¿µÕ “Òì%F0ŽÍ”Ã¥#8ØåƒÃµæã§çãÓ—pn°í÷bÑGйl{jmo�éµ[”•´•ìŸå?j-jÒM˜d]1¼¸JÇJ—AØ*ʰšÄA›ù ƒZÅDc+{TÛã|霭àñ0ï`_îv¯¿¼¸x™™½âÅÏùK�m»l[悔½±´Å£—Z5ûLXJ š%¬§¢T©¨œ¸À Kbf½¾4Të* j FH»iš‡U¬æ¯¦º*¸�QB'”¹Öª"°$k�Àh!ïú°B¸¶ø«o Es…¸˜™K+3,«‚íV’`YÐ\£Ø,¿7dh¶u– Ö3l¤5é?ÃðLCR´càS§¡Þ-u¬“ö–hŒSÕ÷ÄÝ®$Ù’eÌ»hä*uëÕFõåžÏùRa,Õèõ»V6ÎÝx¤õãK£vͯ±fäDÚ…Ò¹˜E ËPr‹¢¼Y™ 4ÇçiúÍ4tsr1N*ôÌ2µbHý&ñ¿yK/=Ž‚=e š±ûllèÖÐmÚ ©mý2'àgûû]]ÝŸvíÁƒÃÍgôΧôùh˜v°Ö–P€å<63C_6}K’‹;U{ÜŸÓCuÐ)4öÒƒ]ciÐ Ð43X-™ÕV ÅhŒ…ÓEGzdž�ð—Áv."l¤nÒß�ËÉcœ9¯m>ÜØí‘»WW?2µé›ûÒ6·ÿmÝ^Ö û�ÐÌURÕ5,ù(§�Ô¬xmÃM?¢8C ïÊrSÆcjð!ÜÊmQ¢2‰Ô^¢¸ØèSõQ p„¡'”ïVõz约i©3<šq‘ôt9aÔ«á;â™+Å 5 !ê’V€ÌR,KÌP²épZÆmnIDú±vÌ¿–?!; !˜ ˆ¶ÞÜüºõÙ¦íÄØ€m�éU)Œ}Ò1ñ195OƒixÅÚ™x±„Ž0ÿ…yû�®:½…Cj@ö˜ÁmJtdŸY®Éf-YñŽ×.Cj’ìØ_ösùN»˜8¨—Ð`#B4þ–8µ™•ð Ú²èéÜ²Þ &= %ÜAP(QÅÙÚ”ðÄG‰'ú‘à#‹)°FOæ÷ÃôIë tß\¶õËYçýwÇÏû–ÿë箦镜0ajÝ¿wÿSæãáca˜wW@k‹âAòÔÅ…òƒœƒ*Ô-®‚cæØ‘ÅõLû ×±œå<ŒV 8ŠåÙv€.RµÆ‘!;Ý„:©Ñž¡íÚ|¼¶ãázb?ð²í~ábwñº©í¾m¿ß½ú;žóe�l»j[ïm1÷¼ˆ[T«_`ç‘MìeBFi�éO[hµ°/0t½éÊ $) ζɄc•À䣬…hŠr{¾†b!+@²“ϼÚ-;ÄÄ÷ÊU‡Â–Šù�’©„hÚ‰û˜A¬‡¢å×{…+*õ?ÌÌ�ùýH<}ýZES^ˆÇBp…x­>‰ªe·l£³^ýã¼D‰µâåpFñI±p›5çj«?Ÿ�Pô5kÔ½Wôðå{éõˆÍßAµ’÷/PUz”d7¼× ZÖ“Ìj¶ýDkçûhü½ß‰‘¡Lµ(÷i]þ䊚,‡ˆ•±¦dÊf«F{�˜Ef:ƒÀ@¼í.“Üfd ¡n"cò†»%ª“¥ìÄšef§YÛÚÖ/e½ô¹ÿCÿÖçþ÷o¹¼¼ó½Wû«—í§Ý4öẇkÎǰÏÎ"Æ"`íi! žÎéêÄÂδsizÀ´ÓH±[ÊKòäQ£åAk5ilűŠ{¥¹¾6 ¶ÀµDÚO ÌG­÷Ù‡›©oŽ{Ú[¯vûï»sqù�xùw<çËÞ¾í¦mý‥-ú:Ã=¯´Õ4 >œ� ­¸HÉXžòëg O�sÉÌ›¹%ÌCÊ®b/ùÔ'YòÛÜÓøm»½ê;î|q²‡äOr²J �ªFÎÅuhpe0Ò˜¬êö‰0eBœW$ •*‘“�N[!Q¥é?Ð92†­ª9ëµ1Îý<–²’Kö9Úr2ô|ÿêf2ð뱉7Å]É“c¨ù%J¼X™óèDhé)9Èœ)¦au(†¨M—6ðf[nn¤AŒcmÐiUaÜ,¨$cÌ>Tý¢ŒSQÚ Ï1¹ŠÞ"ñ-Š¡°>2¥3KkŽðC¿<‘fXH'`•ŽœÃ7ÓfÐ[¬lž9Ûz¿ ПimzÉÇ<å©?þÄc�>~ïÞïšÜ{Úþ²ÛÅå•{“sñ ¦EmÓ­¤£@Ù¿N´iëB(Þ±»ç÷`·ˆQ*W+Cö5ÊÖ–´Ôåxͪ…æß·š‰?è¨9û’ëÁ¾Ü@m24ëÇã�÷ïß³ÆC¿Úïö©wî~Ï4M/žgû³�ö¿­÷á[™øè#Ž"ç¹Á°ÎÊ’ôŠTQ#A¶Å/8ïH÷–b”Êî^ƒrê¼1.,ŠˆAƒÞ…l§sß0�ïfh†¥|4ššm39†\B,9,Z.úÜy ›D¦–H$'æƒÎÖ;„€Ž¦fDЀd¯OEÂTA@·.?! ûV6PZ´¤á¥ËS�e-ó�Gßjš ØÖÙvy1ƒAož;Ç]¥½Su[;IIÉèƒÞBÕ¥iÆïä¹^lÜ“ë:µæBëEËôÍIŸqËRrúrÇŠ÷6rÔMÒ:§Ý˜£Á¹ÆMYo9É`É^D/ÅN1[hžÔeÞ ,<ã¸4Qr ÃÅ„¬´?1‹�L‡¹'ó¥.S î™Ð�ØZ’gì¶d1m'ƶޯõ¢g}éáK^ú ?ws¼yÕñxx0Ïý±ûׇß}sÿÁ'ñ8sy§·Ýdh{·NÚH2 &Ëô1¦F2(’QeN ©Rdð†U¯M¨µç"Á]zX¤�a·W€ôÃb>ˆ®.ê‚f˜šÆ›Ã=®L�ýpw¿{ÓCW—¯¸º¼ü®Ë‹‹ö�_ðçß³ížm½ow—­Œ×dÛIö¬Ü"Äm>¯^? wlÝ1Ž4MzJMŽ…i½ú yã˜Y�T©K e”$\ ÉDIå@ö:¥}IyÏzkôÔ2N¨ýÅ…U’UÜ[Ÿ9[™é×zƒ!¥*¥ˆ1åÁ˜J£É´V¾j4ñé(˜>*I÷Z ]‚`›ã9ßÕh’¸­ ØÖY^•ÌV| ãËü–ÞçáÈr+yNu*E!üm¨}®eU¹‰+%@ݨrUÁòÎŽ/c¥=U%ðvéuö-~»@áü-¿;)ê~†ëÙ¯èøù7ÿx™BÎi–\Ž�rÅ~ãê ~&„­ï˜{[KìND!ȹ …#™Q»§ç–—ÆtШ3øå�œfJùv[nëý^ßðy_ÒÍìgŸ÷²¯¿qñø£Çw¾«_ßÜ|Ö¡_ÿ‡Fìv—ûf٠ДÄ?–,±UÜkÌX"·×Æ85øCJ»èô�Óß`]yžzm¶Œ&G²Ê` R+òp¼Æáæ~³~xüj¿ÿ‰§Ü½úΧÌS_Nò_üÝÏÿó¶]³­÷¹ªI½™oÕV)}„ËJ¬mü©”ž¡o¨Ã±¡‡u wó§@’ÜJè,²úáÏWCˆÓ|Î’qr/ês?Ì‘¶¬÷º3œÎˆuþ#Ê¿,Ö}C i™¥ZÏËSS€ô’t¢cý£¥ˆ�"£ÿ}w©�Äpû×Ó¹¸-K¨5”É•ª+ël� ´MÙ¸Û:Ï•f·ËàÕ5×aŠ7´�¸[±åÇÚ�=¸¶}éúæÁîâÎ]^\^Sm6ë‹Ké’ùîyIÑ!•@b1øsË‹(+¥.4`Œ™¦R.Ó¬|iª?§~m˜Ú£‰ÞzŸ¶Ö@²ßÜ<°ëû�ñbj7W—wßô1Ww^pµ¿ø^?àzÛ)Ûú%Õ5”õ°œ�€>—æ`ª¹Qÿè¯Ýi黀b\lƒ»¢ÓZ¿‚^í…Ó ¢©Om¶�ɘ Þ@hî2�(ižãYEäqZC¼à ÿZÐå°™½Ecm|½nÑT¾µN¥Èq°¨@!õ@É,'(ÿ–%s%¤È@ÞOdd­TȱR¥FEq-2‹‰t- 42Á‰ê½3Ë{l6p°­s¾)Qg „:2,wœN”^­p¥õXsEšÂí@î²xþ�8Ä7 Càp(xËd-yŸ_-©tÀ”ѽŘGr84\ÊûnhÇ9õçg ÄÜîH¿)Ãxƒ$_ÏÛëd �'(8PúJŸWâqC©Éœò»KÎ‚Ð§È Do²;žc IDAT–a°¤5Š0€,“¦d°C©]вm޲­àúúß÷¼ÙÌÞó^û²û×?úc‡y>>|u±ö±ÏŸróàñ«¹Ï¸¸ºì»‹E“Ĺ£� fâj…•ãjàhëkÓ>b%¶…ëÅ\V-Ò Á߇¡ã?ôLæF³ÖzÃdf´Ãñš‡›ç#/¦Ý».v»ï¾Ü_¼ü)Wwßø´»OùÙ¯þÜ?±Mþ·õ˨kd›Æ½„*âŽ)m¡-u8ÝRÆï Þ`ùD…A0ú¸ÎÒô NW"šdÖª"ÒBB©¨N:Þ5ºóm�ÖN€¤æl·—µEÎGTã*†9iþÜLçðJÊLUGÇÏJ%Ç …ÀúÐó©�޼œÏņ&Ü*·¨P;$«¡0XaˆQÌ ¶}±Û:OD”)(åª/Ò»tåß–í¢òt]÷êÞ í*ÝJø§\ù¼ÛXó .Z+1UÉt•Ôi5 xu'hìJ¸­À0÷ç¬ðË¡wDŠ{¬\‰TÖyZ�þοã¦ÑEõqñf�ôpÉ Ó¯ƒ5Ç?9ʵB+ «¾#߬›Z9Q{"r#l뿾êÓþÀ�™ýëÏùº¿ú63k7‡ë»~ðnî=ãÆŽûÖîÎmÚ­ _ï®zQ&”›¹æÃ;eGQóɈv¨gk¯Ë1¿š2ˆ[Ÿp @�Q$‘C«eZÕÙÑçC;ÜÜëóñæÝ;´·^]Þ}ÓÕÅå7âÇ?ã5óñøà«?÷Oômglëý– ×L�iJ8†_fàÚE_b¢@ ×w�Klj‡¯|ñàØ[º¡¯*R\ÑÓƒW9¢·¬©ÉP?æ³ß�´A¿ ŸV|ýǘŸ�4rTƒmœ°.~Å ßàìY@úû[r%U›iZ ÷šÊøWçºÁ/Ž/áɪ '|Á�Z°mÀ¶Î´Ósr|µUˆ„—ÏÀ¤…àMhgoÒ†É�5K?b•Þø¨hJ#<º&ØbÊ£‡a&VGo�5¸sKAÙÃ7Î¥Ízz?ÚyézLdöŸ¿9ãZ»ä~Iú_øÓHpò’M $ÝnAºƒùèÁç3Iê-­ý Šçt[„Wïºhaåî”™=±8¨ Ï p ¶dˆm}PWkxlî|þSzè-ݹzÎÃ�<ò©×žø•76O—w9í/Ùv;ô>·Þ;‚Ë<4Êr¡ÏøÕ30Gý¬Æ(ÎZ�8ª‘ò)™Ÿb(�8«÷ôÉ q×r”š™±c¤žÑhól‡ë6¯ ðѧ\Ý}Ã�Ë;/Ÿçù$öââòÁ×|ÎÖüoëýèóÆnÓh¾ÚF‡ÉhÜ 3*Àw…ɦÈFÛÙ-©¿±´ËcY$ é—aïYFz²ÊË——ئ½hsîÇ6ÌÇ.¾kÖ°ILkΑ;Ê0Ôó !¡ß“·Î2X-IÔÖ2Žà”/"³(!’ŸÃÇÖ‚1�³¬Z\Kz1†`ÒJ˜„Zö!ÙDîVDÉmä† mÀ¶Î÷ Ô+*{¸Š+«à»¸«9Yn¥ŒfI õÁÑ|3×âÕ”ø´ZËòµéõ— &‘ŸAɪT# €SÏ^ИÖs Q+~˯söAks»¾µÓŸÓ˜ö é2öÖ‚ J°ãÀ‘–K«Ddf‰+d­-£êÎ*˜Õ-Ѽð°BñYŠ{µ0�P@¶¶d[Äõÿø—u3{÷yñ×¼îÁýº¼úáÖðésïŸ~¸ïiÇû‹+kÓdSƒ2ïíd(Y-+S“Oé"|­ð."'%T3‚ Áe™×l’ÌŒœ�cæv<Þ°Ï;&Ãáòbÿcð�ï\^½á¡‡zÓøk~õ›¿ò?ù¼­ÝÖI­X£O(îê6!M/JææºNŠ]ž:H¿¢n¡&b<*Ñ Â¤ ²H“ilI¢$è¢$æp,�iÈñF/Rõ~î+sSÉÎÅìJ«Qš&_õý×\TQE�ke[I:„�AÖ–ŒªšÒqC*ƒYBw}X ¸YÆ&9)ɸ֥~ÉѼfuwÙ6Ælël�DÏœwP9\ H$Í �iWÜr[J€J–Š”øøªÓF�NKãwBt3 ¹WɃò"`’à…i»eš!™ù¨f}98íŒéÞýpH312 ("4¶¾øù±T$¸•0lE€aA…“Krs�–×$ÄL\Zý¸IÕêJY/Í1衾¼å>mˆqËVGmëC°¾é þô/üñ—þ�úô§>ã_üÜÏ¿íg»÷ø|8~[¿éÿÞ¡÷ýîâÓnßZœPNÁà–RŬ<4Nãâ‰)PÂ-Ú7LωV@h™ [⥞¿ÍóÁz? w¢Ï7´~|bBûù‹Ë«Ÿ¹¸¸zåÇ=íW|ûÇ>ýcú«?ã¹›Ö[àNϓں49iã/IQŒ­ÝJF˧¶jö™6‰Xð‰q0 PôòV·wqi#ùº,šÌñu˜i¸½vuƒd[Ü›û ‡�JW¥ö¡A}¹ Ll§Ìè˜U®#©?ìL èY }Ú&žj �jbŠÄ‘�“Ü slÎÈâ êzÝàÒ¬ßÂÍ`¶uÆe¯ rhöJ÷¥ã÷³M›1dÕ.-¹‚LŠœŸƒXɘPˆ„æK ª·ê`—#°„ì¸/nV©¢Ê#aì9@Æ©¶Gôy×÷m‚M½Ï­ÏÎþC§æI] ³dB�Ÿ`¾zz“9ïHû Ô¸€ïX\Ç27ÈLS Nú8é×U~É"U¦Dÿ ÀN»dmâòk[Ûú¬¿ýyÿõñOÿ£¼óòòÎ?ífoŸçãߎŸu}sóñ×óýËݾÛÅå%[Ë“{ù¿6˜+Ai ûŒ¡ß.Òÿ46÷óDRtÆD29W–�˜ZUú™Û­µå¤'Ñû¡÷0îwXŸ§†ë;—?þÔ»OûnkÓ+îçÕZ{ÏC=åf{··õ�½Àöã¢hÃÕb6bx,YÔ!2K½§;<Õ}Ú—G×±$ “b‹Ï0C¹|‡ÈŸy{"~Hõ¥T‰VNüoHsQ£AÏ|[�Ĥ›µ�YkCûÙhÕäØK{E ÊÊõЉj3¬ 8EMs™XIÅ"ì#�*žÖ!ÀÊ̺(Û@�iO“· „Ä´ Ž´r1PàÕ¬vh5é/Nh<™¨”�<ñ'Ë´{DnwWwä’´¶H#Â¥Ô�Áÿú ¥£Ì-×)>Ä@5œ¼ jÔâ"å¶f†å0e‰À?™J¡âP¦ãºf‰_„è5Óœ{†%'wa[°­s[ÄÊEŸÖ�wïd&iÙïp.5ó–”Üv8"ÚÖgN%fgߎJF…�é ·ýÝS �­CpÖ±XåÜ^¾«ÉÎÚpºÜ…“Òà-JÂNæ ÄêG¾–ÝÅ[Þ¤ bøøH#@vT$G�ÊÌ•îÌj>yÚÐGŽsF æ&Þúÿm}XÖ·|Ñ󨙽ú�½äë~äÞýû¿îÑÇÿ…ë~ÇõáúͦObçÓûÓƒ¿Ó9ÓxDŸ�èǹõ>óMÇ|ó.›oŸ&{÷ÕåÝŸxúS?îµ—¯üÆ/øs?µ½›Ûúà#„&én O aöG֌ꕸ’ÍžNûC@3ê¡צo ¥,Ý(™~¬)µN@zÇ…àúçöŽtaÿ$�çÜ«]�d_s3Vf ïT2öÓv–õO¤| «pd«à01¹ :I‰Âx¸ `øh±¢'•­ËX|^Q$¾»íŒ ØÖ™Þ“ãl Lf«Þñÿ³÷¶Á¶¦iYØ}=ïZkï}Îéîa†ù¢`fRhБaø¬è€!`iB%„`b ªŒ)+‰”)“)‰&cŒ©+AS$©DH j¢…QL4(VP�è™é�é>}ÎþZë}®üxŸû¾¯ç]›äŸìîõÜLÓÝçì½Ö:û}ú¹¿®)çÊþèÉú�IîÞ;¦RKÉ®ÖWÜ×ÍLrû$Ý\T£�ô[Ž�ý÷úÖM-Ž�òïªÓ„³‚.–<ï¹ÐXN÷^¼z展‚É&+6§B±+ÑľÄy¿!‹Ì�6 4}'IØG<ºjg­õÚ¶ñMÌ Ï‚ì¤î+}á©$Ì…RËœµâ¥œÓôÅÆ°|įdœŸ�]^__ÿ´™=q~ñC�<|÷\ëo¿Ùß~éÕÍå§ÏûzaÀæ°¹Å4�Ûf³å´­LØétݨQµÖDk9E«¥ ýbÖF‚Õæ™FVƒUÖý¾ö×8ÌW¨ólfvØ–r{qqþêùîáOlÊôÃûýõßÙ®Ÿð´”éÉx‚#þñÕ5­ (¿ÆÉ Ñ©V}ĀȽ5|fjï¬ÁBK”X/ãÜÕ˜™³°­×|C%fÓ�_Á4²�‡ïûs¤€1»î»vÇÁ35{Y(Åî¯0‡ŠHì%L]‘VUÉ™E`òUÔ�Hzm¾»È·0xY¦ÕMohªÑío€k¶«”Ñ8#Æà´£™‚†"ZÉæºEÕ+%Ñö:Ï\iIYšÏ õ‘Ͻ²%ª)—ºoFoÙiùáøR‡òÃ5 #[Uôó}e¯¶¿ýų8átÉQ(›ðº]Ú…¶IPÙ䩺ƒŽº�òÌrÔ˜^âb´4Êðg’“Ev[G8*k/Ä�œÂÙùëÊ»)Ð/:{w�ÒI€‰!–‘;“rįd|ÿoþ¶jfWí¯O|ÇŸÿ�ç_zé…׿yÿcÛR>ã|»{JyßlöÙó|ûÌ|{»�÷fV&¦EÜ´ ¢‹ —û¶Ö^_u&+«UÖ2ϲΰ:£Ú¼´G•Î6Áæóít¹9;û˜UþÝÛýÍßž >µÛí~éÙGoú©·¿ó³ŸÿÃ_ø¡Áññ�7 Î?”Ј´uËý'Ø/¬ƒXàõÓÑv¥“Ù¿§pÌ$=¡M“™ÞnÞ †1AP1…] iø¾QuÝÑÆ¡÷=Vç·2 >5)–ÖV€reYÁ䣢_òç¯ÞåcL“ÍW–l†Äˆ:ÇÖ…th^­°‰!íÇN[")(�=E‚fÛ )ÖbC“v7ywÄŒ8©1Mh=Y ÍåÝ>„b­gJæn&Ï”Ö ]M)@qôLp'0ÅPt½»‡�âÖ‚�izü �=ehfw—­a&hiúX¹™Œñw½ûd3ætvÞFËhšË$ÈWâ�¦9=c"HiZféèHVž‡•5Ž‚B ><Ô£ÓµóN»Œ£Î«CØ9§A³´â(H>Œ;cÄ}‰?õõßöŠ™ýØwþðñׯ®®ŸÝï_p³¿ý¢›Û›÷]__¾e¿¿}Æ 1MϦgÍpA” �‰f¥6+láºÀXAVÖ:Û<¬Öƒ±ÖŒ·(xbVŸÖy~j¬�7gg—çg?¼xô3g»³¿Vký«?ø-¿ïr<™¿âUMOFó®m5æe‚Î\�aó¦ ‰+æEdÆçÕAU Ì·Ô&f+ÿ�VϤàf—ÿ’™ „ÔM&ÌÒb: o‚8!F[鑺–B, ‘ÚÐñpCGfžA(d_#ä/«îâz ãªÎ0�h óÿ§ñîu{7S£‚�±«±�_´Óð–w.c0âDÃ¥C\ú�JNbçéÜ2Z̯]=€0A&-£Eå?-;|ú¼ÛuÛÁ4H xSfeŠÊ{ª¼È;¯Oç�ý.KûXºi®7•ñÑ 9³X®z`ÂþÖðÿ«�à/ý ï9ÍËqZ”øŠ•6-†MŠçbƹ×(BO¨ÇZ ¥d¨éÌ®µU;n 1sªEäˆvº8è‘(lB™%GÛ[%œS¸Å!b¸‘Z<ãÎqïâO~è_šÿåÿñO?>æ¿ àïx°Ûž=¼8¿xóvšÞU€Ï?̇÷í÷ûÏžçúܾÖóC�·ä\ævÒç:ë\È £±Àj™Ê¼ÝL·›éüén»{a»Ù~x;m?lÄÏ]^=ùð“›Ç/bq'¿)¥<¹xððj<�÷b 23±}—µ­ˆØ†…ž H±õà´r$MhbXÜÊ"çÒÐ+&¢Šj ‚œ¨R€Š¾‘²'« -Öšvmj+özš»Š'\k™\ï–ó�ÛÕ§?Q/hB¨‚‹Ô}¬`°Ý’‚Þ¯UÄ*�M‘¾9k¥Jê~‚F@]ÏÖı ¤*&¤¤EÉrf Æ`ĉNj{ƒm jî7ƒàO7Ú(ŽûjÃl­¶'—Œ6ZæT×&M6´†]œÎ5µÙk¨ƒNŽk9ÁnÍkñÇqVÂbã—:X ¬Àf;iÀ÷|}iX4õ]´!½"ÒãX)û¨@÷óO(ÄÂgïKóA©�Úf£ó¿íìô ¾_�)>#3"ãõûiã'`�WÛæ¥q8h”#îsüç¿õÛg3{Òþ23³ßó£?xqõôñ‡÷7×ÿàúúêÇê|ø4V^Ö�qž¬Ö Àb g›—m?Í8W –iS ¦y³™n·ÛÝ“‹³ó/μxqöÌKoûg¿øï|áWîÇO~Ľ‹šŽg᎙àÁ65fŸHÊù&0;=U˜Ivˆc@_ýˆr[µvu ºž}iÛ‘�›òÀÝ,É‘«¸¦‹}`ÁÐÛÒ¥U" Z…[�Vá�Å�¹«©|Ä+¾b²ŽŠì FP ˆËw7ûÕ‚ØÞ¯µ$ÜËA(•æ(@…":)vr�èå³E‡€±_KXÌÝz’#Æ`Ä¿ý_2e ­izÉt2îšV\/GV&GÙO°sL„Ÿ[Ís’YÎt6É¡èú»ô½Ä|~™ªçÄ“ý=Èž›~„�GË|â)ó0GÓÞê’Æ$ }ªN÷p¨‰)ñ”½Lл8Ò#gýäæHu¢¬!²ä Å „±¤èU°×èÈ%8ÒÊѸ5F¼^â�Ýïp½€�›™}è?ý^˜™íçÙž}æ{æÑÃi;m¦©”è)æZç››«ú‘�}„[!�’ÕþÜïüžqþG¼~Ê›ŽHÝFÏDXºÄ›ªÍÇ^J}e2ä25â|”©/ˆˆÔÂWEKÇ'P�ciýt6ò]!a �›÷SmPÐùS€D‚Je‘.ÑÉÜwaF8@ƒ«Y�?¤PHû+„–‚bb؉Q÷Ýwl‰·Õób®ÑÚyb§@?R¢[]¥`YV£‚c0â´b¹YHçû·�zbÆ  m[~½ ]YCF�h\š´…žJ&äõÂ_Zð@Nµ\èø*áPå_Ç D?Íù½¯…Wé êKc0ÔÓ>ÓîÜh…¤U£U+Åý�ª-L1 ·diäéÈ ¸“äš'qn$N1¶}[¿@1³¡|ê B9âHÐò*Vå_1›Mº �G-ä2�7ö m`F¼®ã‡÷÷®Oðá÷ÿØ;ó°8cíÎÎíÿ†ß6Nùˆ×w£ç­ïÂö–Õ„¸P¼ï ý(rl-ÑÆÔ„{b"†™w £¬ÇÈᡉÜ,WŸO@µ ‚%Gÿ˰:xà Dϼƒv’£÷÷ðuW5Ci�yiµŸ+ñòA³ç²»A†Q¶¨Cæ¢Ák… ¢V�J@ñrXž²�zdOÑ “ Ë••£+h+Ñ5_&KùÚˆ h§4$*S2NÆŒ8Õ@êÓ°9¥®ÿl2LÃÁÈ{ë0ÉÈÊÏkÜçë„Uƒ•�ræÚÜõ¤¢l·æ‚ˆÌÔS]byÐÅV�&†{ºà÷„˜‚z Ñ­Ðÿ(~ Ýêk·æõK5—™£…;ð–î ,Ÿ±Í­Ð è0‚­Áê0ñÆŠÿàËþ¹QŽxƒ5&úFí6ŽÄÙ¯Ùæ‰jÛ^ÐÍ2U‘ÿhÙß“±oOÈÖW¤g;9Z «¶†IoßJ©Tîqx^Tr›l@ô’.½T0˜ÞZhz»�`ÀhG³”tªŠ'›}¸`P¬@vJ}aõŽM��=aèv¢mÕ¹úŒGÚþÐQH!ÝŠ`“-’W‰:NÆéF?‚“¾—}?skë]<îÊ® ^âÓùþhˤLé ù‡j‡Î[ONê‘á@ NîÐ]éÌâÒë?-e2pï*b*vÊ3²’¬0«%f:GùeƒÜFß©$›-ý!%Q®y#«çNÍÉ6åyzÔc>ãÎÔÂַά©[Žt§ƒae &VÛp FŒ1âu0úJ·§°;‡û+põõ=ìÚbÅa’^t— á� ­²ÃZƒëDªòl}^ô7Z÷b¥“&qŠFˆ¨}^s¼nÅLµ˜ôwZû\&+Q–JÙ"EŒèY-”��µòÓ¯L_pÐÖî{I<ôß÷ºÅgB9.·ì~)]–úEüšºñó'°³!0#NôB Ŭ¿c“»˜¤F—.w\Ìß5DÚ_ùõ +ž“ï…"éÓ:sžð6¡ÜžÙò‡ª»Ð3¾XÙYlº» £UÁ–“dhµÉA 1ƒ†“š³ÕZ­ì`VN÷?�ÿúƒ`­u$6F™µ,WA«ò(ðrùÑôkÒ·`Ôc¬pþÆrl|œƒ°b õè”´oH[{– RVšÈoœË$û¯«ªpCdõIÃ’¹‹ÑŠM3y~¨œÆ­1bĈ÷¹ª-fS13¢¶º£‰¿#»¬ÈÎ{lÅÑjŽBï±Ìh¨XàãÎe„°ùá©Ndn¼s,däH¯€GÓqùýVå…Ñ?w4û�4¡0ܲC¬f\+!wÏ:³rç3Ì…¨Å`ÆâZDè·VaEDó/úm'ѪÞêØÌ¨M„tï ØŽ‡Š¨»våR%TÀ‹•ü@lÚÒWÕËÛ•�Ò “W˜Yi‡¿µV+J­¶ãtcPÆ:ptq}u Í|”7¨¥­É|0µO§6è¾ÉÍñwb”:úå›™sëñÞIí–7C(Î3Ûÿ6ûD?îŒ,›©ÕI}'/�Ò$�[B C¥¬7"“康Nnœ� úþ�|£|³øïŠE¾ŒPED’9tKé“®öñì‰Du’¬]!×ÌqhI¾,›V^Ð#FŒ1â¾å®‚0ö抲ꔵFbó…ŽpÅL¡Ç»u 5·'6¥  [5´N}åêGtUKôx}?*ªq*¹Ó;UÿåÖ±FDÏž«L�¿¶%è<�Ø?UOˆUX›Ý€� Ù‹è5úMPÕÀê@:õQÜ%|[‘ºÉÈâÅU·š¤@ÏodªféÙU¤h†b,5N¼q¢³’X&áù ™LED#ßäPºÓNëÕRX°›«šõültF}w}F"�KŠì·"è�85¥ A9�Am0üîÊñ§z6,ÇÓzDx4@ÑçwÌÛpûÀL¥IØ8þZÓ¡�1*šãljÉûÖ]…û7ëþ‚3èÔþIñÆÇbĈ#^C€U.C̨;5µVOÐI�òù}JCÔw¤®Ô“é9m3ó¡wãÄá8EÕ@Áþ¶»“%Ö•лö†Õ-† ‰ÖU8S…ÁpTäùÛ:_-%{)V¾ÔIFeúN}—×ÏÝ΄j§E©YÖ¥soUÄž¹”³Ð¥UeãµdÚJÃbÄŒ8¥§ÏkÆl\õì¶nñÛÜ¥¹´h³PY¬V�¾T¼±+4+  ¼út]°*–SÚ G$�Ψ ÷Sºz®/ÏH DïA_(÷|»þ󢯥—-8µøæÝ((E„o˜¨|æ3_œm%°`ÝMÙFÝq J>ì–u㵘T•-r<œ°<�� IKj1ÕñAˆBà Ëb ìv‚rˆÔÝl&Ü£S21bĈ÷3Zöq2t5 ¥ZÈì…o»/v}³Ž™ÃáÛÍ“FŒ=‘x#äÖ9.:ò4ÔfŠ+¶TZZËXô™šÈÈ(@–_/ ]³,¹³UWþùÎë—œ Ys ô„d�q‡ý”qa7’b–wä-åz~J”Eá—l K»j1( b^u5‚¨M–c["œ,Òè(¢eET³åc; ×ù–ìÇZhïK,ÌØqN7à”£3FmóOñJ7šœ˜"äýa�]|os›#ÌÔÁåZHÏš IDATž†âª±€÷±fÈèö©÷Ž9êÖ¿dÌæ`Ïf�`/o“H‡ÊU’•Ûí"pÚùÑ3Ä~xÑÑïÖ>îq~@w*ÌmHMcõ×SÕä¨cxdmdš©ÕqI�{)ìœß»ü˜îé¶”å]~j¦FAä`Œ1bÄ=O_�rHýG«¹(‡mºMq•Y’WhÁvjÁM|¦ß3-ÙÑùÇV˜ÑóK Pº)1¡y¹!³SG®U^æþAjÂlj;¼‘Nô`t‹ ­'|©¬¼ú§¯:¢JBw8ZµÙlåÕõPE= ¶Âb©€“ἂ¶ÃLÜ�š'²îKùÙ)dI÷äê�sqÂ1§|Zˆˆê4™µÖóh“oBhƒÓ¾!:a[è°r‰:KImEÛ6$ý:Á]^ˆÌ ç;lh?ë2(N&0÷ª‹/¹)Æý¶wŸìÍX67Bjc €`@~’KÁáä qL‰ãÂ#œsä‡Ö4µLf¢§ÛMœw Åî–J�¢é£L?%±ˆPÓlF¶1bĈû]× × @ñUT›Ì ²7o¢69&±ÖoO¹cjUÄE5‡ y‹ ƒÉMKDù]Ð|ª ±“Ú,ÞŠ}ÝdÇ)lU)ÁRÕv ¬kæEÜ }î“®ÉÇ+/ù'ׇL„+Twn:Ô+zR€”; }¥äÞÆ(¹’ WTV¬ë#нÁ �ÀˆS˜ ë“}ªn£‹ê_¤︉hi@§¥hq¤3�uéBjŽën.‘/óúM«[ÂXÛÊ9…M޻ݹþ>Ø]} =^o=P±c0�0óû!´$²˜ú :*”Ú¤ÄFŒ1bĽ®knè}›»Â$½ÍÒÜ)�^%·Ð:ùt™°ñ#}Ð(dKQÔ\á�°°Ð …Š›ÖtŠñâNÃE¤ñI!ŸhE®4Ò•ä�·lBTÛptyf+â¤Ð»B ó{D(¥¼ _£¦QÕj_šÚ7"¹ së¤(†ëv%¸˜ˆ�½õ«WˆH ‰40”]P€TDްߣø'©CJyĈ#î{]S�¨¡¼Gö:²b‘ŽÕJ–ì ØÍUø¢°X1ÇãeèJ(³—9jƒÆp|eßh‰ˆBÉ-ýüÍŽA(è ²ÐŠ[,ÞÜ÷£Ô‡ôÍ–‹+-4�ùgÈåCH»m™!%Ž„ÆtÛ³ŽA" ÿ ceˆW“D§æ(Ü'Aè¦CÝ’ ‚Q´ º}‡~ßÝ aã1q™’© �i)r¥~ƒ �M¨öa —·nz«�ªkÑ: U§Ï¡Ÿ ¨~‰öîŠÃH–½‡˜*ßÀ’�Ðð0óI¾ë<›·íŸ@—à 3dQ  [$Sj¨UæÌ½>-µk �8vý¼Œ:¹Ýv¼ :®“gž ôÒ\ÖRÿ[XÆ A곘9´¯¬6æå#FŒq¿ËVc­‹p&1 D/�éÓ³û&?ÖüÖ¯X×û‹ÞI˜”½ÈûÚÃôc‰ ÁÊ«¹M ik•–€µ¸ÛJñ”'f%­ƒîú¹ä’\ÊtzFS‚*°.R»\¿óî7ÄÊ{2©µ¦*ؽðd÷„•c {:3êºËu OÒ€˜#N5†àiÇ Z�óDW·É�&`†[ÆÜÞäûÈLãY©$•Ë®–´è¼ÝØöÅKÙìÿD=%²xÞÌtï[Øq¢èʬ1‹Ñ•eŠZÚ-[+­Öd5¢‚¬,‹ŽÏÉŠÝnkÅ*9–Þ¼ÇPFÓ©1,O/„!›€­T Ìâ¥å6ÂÐyzŽ´e¸C_òW£X 1ý ™Ãv«¬EÒÉ™y(ÑÌ.ŒFý+- ÇBŒ1bĈû;¨ÕÈ c&J?¸MÁa¦ø³$é7Â�XÆ&+ë= #qˆF1Ss6$Þ^À¶haΩö�§I� çÒ Bf0|”zµÿVØ”°"p:6bi’ÈÆÙ0+I6]NFn•ˆ¨q½E×eS´®B|`ÎoØOgh¶¶ŒÈcX¬,ß’®eˆVÊ~í%eYÇÕ×`…–¥nÌ0Šm)åkCeNµÖÝ8§£¦=á@@‡ŒVÃ…ÂÀFHœ¤Œ¿Ó¸3uH:ª½Æ–úq9AÍ kð¬dÕJk>¸+‹[¸q`˾ŽïÎI=Å8éT^‘à•+·Í#¦rÒ"?ø5¹xŪ1©ù™Ó²H±j¼C£\–1h+ˆ�>é7=*.Í’|÷ï°“š£$QÍžT^�"ƒ¢P‘6]KY¦ù#FŒ1â~G­Õj­RmÐ̪ûÂp½Â?Úø2Ä_S¶_ôÚL´h“`ÝyÔ°cäT�S{ºÆ‘ÝÚd¨%=l;ã¹À°Xº@Uñ„Ïë‚‘þ¼“ª¢ìïÙÕ²taj?¤W”",”´(‘ײ|yÌ|½Õ‰òQªèöÛIk¬ŒªR¢B¶&þf�ŸDÁ{Œ1qÒÏ=œº5û\V¿½”²]OÍÜD‡÷À3A¿×æ§Bÿ½Ý"¤ûc"æ:DsêS:Bôðâ§³öyÕ‰…¿hõ/-Ö «ÒŒ¶Mðà©«<Þ1:Ò¿¯gÞacòíPwäD«‰×—O¬²¦Ó4:¯ãÕÇáêšTcQ‘­É!:þQ¶óøÑÐëúŽ1bĈ{š»ÔÏ=ˆÙT›½ÔZæ/SŠZ6P" œ€é¸t˜¼k°%­Qq窠#‰ ”þ/s•Їñ|'äöË$ÌVqqè×úØDX¡²h�Ø¢Ô]µ°âåýS Gvsh9Ñ—0Z6ßñ’L‰"ÿàɯåŠD›n’½¥ÒqÁ–Õ ÁaxÊ1(§|!–e÷Záò/":îíiQB½r (mÑ4�NŸc`‰)5„¿¢¸‹ë©¢c(-ßÊŽïKäØ8·á6|¹Ÿv€âò‹†¯Šn�¡K9�4«D­•u{füËßöîÓžŒÂ`E$eéšø®>Û‰0=‡Áœ¾È!ÐÕÚ¯s�A›C2¸ óÈ®^énKn‚¶FµŽl LȉdØøø6ȤÈí?�#FŒq¯½jde,Д÷YK@ÛÜ99‰„«Ñ@û,/| €…d½¼LÉ©óZ$guCÏ»w|šÑ¤1›IÙRƒ©Ø Ϻǀ 'Âi ¥^Öj¬wI.Ÿp´r@!€�~^~œ=ª‰#¢¼Xöα�9‚KM/5¿ÞJä8Où¼ V“0)¾�(Ý^¤IDú9­ ·Q·PVÿíÝjÎ(ïD•v¦Ê°€'ÚãQAð”6�’oSBó^keCtk’.�;,Ss,iêÁ#µ­os{DÊ4iÝœt.~¶M±=…ÛE�À—7)zƒ:ÂXùà™øn®MÈÿ˜˜b3!}s.ž‹aÛÇ”û³ä~ÄsqÉeæ ÉCD›OŸA0}�îL0Ê<¼PvßåG‘ÇŽÐIö(’#FŒq½©X bQH«Ô:Åû&·²tE¶`ð7Q£dƒë`�3%ùuòqèÅä„äF« B  x*ò×ò&×z:Ñ´ÒÌŠ8 vz†Œ<9"ªIצ—8Y=  ¬Àò¯Ëϳ˜Ù�ú�¹AhEÆÑ?„¶š™£Nš:”#]iË:~A¼›4T÷ù? ‘ U/€YU ¹ñćb#N7ºåìš;8A ©Cy÷°G¹u ¿¼ˆò­âߪd0„ |Júaf%¬SƒkÇôœïðßGø¬X9Cz9 —¥7S#8òá§�K1HP‹›ü™¢û™wrú8úg`MXé.‹u$aL f÷§VÁ5Ì_6%ÄÚðF‡=p#e»C¿+@(�zm()�1bÄ}Ï\V#v�XV jaÓ¹ÍäÚ€)9Ôüf]sHœaÔ_Pë–ÆÏo“l¹–¹YOtó¿®�¨ˆã|MÉÜ‹²®w´�òé–»-�ç��Ú5›Ø£«`™C©'ÔJYo@ ),~ä»§f…ºü¹ÚU§‡´bçâèO’Û^-ÏžbË3âtc N»ÿ_Œ«CÚ–�­ëÚB„g»YA“-Íáx\Bªèf$MU Æ ‰Ò'V4ò€0FánE~…-53ÜRžnއëZNŸ%´ë´±Ì8 –òmÆÍ£Ó>ßú—‰Oüì?€u Dqèc(,Q~Œ½)Qû{-t@¬Yo*gÓÖ1�둚I"’ã…°©�TØÛJT°áòÂ\i i¸ãC'`¤˜�2ª¨#FŒ¸Ïáèÿ•;»K ¶ïÿ#Åξ^�c!Ë\�¾ƒušyî a6êÚÂm’5ç€G»¥ ›¤ò÷cZÁ®ôü½iv“PÍ�“/x…ô™нó‰e±�6C^ZT¯[«Œ˜òñk¥!”Yc¸àBSÐOaa«uÐI§’ŸW=íy3 ¹D]¹U89 ¥-ŽcqÚ1'¢.ö„Cuý8‚ºæj¸| q\MP9zlŠý#@'Á�NzMˆÛ‘¾Úå–Í&5Çn�߯™ì׸tiU¨K`›�ûÍäÀÌûÓ>ökÊ·9*1$b̳œÿ¬KLŸjz©©EæH¾)IÈ�ËQ®×ô¹Qé@"ùäçgµ—é&«Â +3ö3ô6ñ"f·¥1bĈ÷µÑk8/BÄù»š¦Ç>¶ÄÒ´Õ[ÿÖ3¾åF£t²„î[ÿzN%ÓJ1ßVÁÜp,Ò¦ YÛÂIÐÂfP�z¹:çªÇ"xúf°ÂÅ"Ï¢Ž1�\òÁê—MGK¥ ,� !!6.šIUD† "–Na¡îXÔœ)™Hpu*¨Q ÅW9ŠhÅø$†ÀŒ8Õ+±¶KçÈ\vîgZã$8]· õžÉ�F£[½t(” %rôö| Ú ½~´~:œÅ#ÍŽÙ ZPWª€”מsQcÓRj…”­8†i~Ó¡üc‰!–:TkH[× ÍØVPS#ï8 ú‰–ô«¹Øµ Mç>‘(}BGd1·††mFŒ1âuÐêÉv]kt\úÌ)Ž×OT¢{H³g)Ò‡ÿæ02+7i ½ù×–u³Ùþ2YáÖ åèKAsÞH^Òî…miåõJ›ÍÄøGuóiê rÒýü%÷ uk2%‹ú*Ô¬[>45‚8S픆æ?;g ¹Iˆ äÑì«;Y�smÚ´Ì%† ÀŒ8Í5ciGèÍi-¤׿ܪ2°±/ƒJ �¾ ˜{$ܹǑ’Ý&ź½ M‹½npN�dAL�F²1bĈûÞçÅ•.ûƒ^ø�ª6lGúkTƒ Ô¿ø6A%ƒIÉÞ äÕ}6‹'³ÎÉ�–5XýÙ –ƒP[ùãÒ‚·|ø‘¹ZiØ7Õ+¯Y{�¡†4µý^Î:�±Û3]64Uhî~‰¡>F‘ùCÈ  i„�‘õ�7êr¬€ Ž�÷@oØ>­Ð!{ñï§pâ#€´ÊS˜·@¹õþl¼üvÿ · è†�Ðë�ï°iï›êþ�έ¾ÜJk^ÌMщ©æöˆú�ã^OXvÉCkÅÉ“��ù*qõª ‰NƒºE„«£¨.h%%ý÷¶\£°­ D ù-tã„\àw¦Î–n�¹N ,à PsI¢Sc1bĈ÷/u•b˜Jgᮘ.®J D’µ}v�øJE�à¿ÍZ‡L‰š°k_+ÅÏ(Ìæ¸f*&�Ž+§& oÝÈbP@e³QB±‚Qê#Mÿl�˜ªŽ§ï68–R ~÷ezLºõ’âÁ;‰#Éu:[`e*�‹A»Áª€=R9.No¨Æ“Ž�8åéÏ4íK)µL0›ÌPÌl¶RÒ±½Œúú¶ÛÔß3¦£¬œ#œÅZùN©ÚNÇs{î*®BÏNµX‡[ `:›Å©pØh]kåÿ…YÖ6<(€•e�œ÷zÚ÷"kå\�$+Ys(�3²Ñ¡FÐéë»Î"Û$=qÍñìÌ©¼~„ÚM ºdÝ m¾d- »à u$V9!‹Öѳ°†f“™Y)f¥€Vá‹”RÉÝÌ:ª¨#FŒ¸ÏuÍf³Üýe‚ÑPQ-¹ÖÛ"ñ§ÈÚF� È6¾º‰M½á; �ÀÙy"%ˆ±(m¡Ïîû_,(6˜U£vh”á€(ä.fL/×Ô]¼k J1”‰CÀ ecÆJ  ¨(¶ ñëÇ߸ˆ\û‹‰\�GC•(BÑv²oÏã€8 Àà RŠ—«A¸ÔA’é Ò”ñö ×»IÃÈ–š7ÓEyDÒó§+cT+†ÞoHöB˜ÚzŸc?ƒi’„`Û.«)W�0göSaÂ1=%WW¬/€Á¸�‡ÀŒ8ÕDéWD/ÊGt‚!+ˆP» �œ ¨,-Ë´…ó-æ{)!Omø»ÿ|]«µ[ÌBÆD)z�€ì/7Õ¸ùz²��7B €µÖùÁ›�éËß}Òã«/¼@«5�ð@>Jƒ.ùÇt.6»1T—™’ùcdšæÈoÒ róy"ö*Ð&=“h'†Œ€CšÎƒOÏÒ ]€eʨN½ðˆ#FŒ¸¿€ðAã¢üÞ ]âìÞgsTÌßû®÷VkMÖbŸÜË0šDßX°[Û*·ôHtâ¸;ëˆ'RK±®÷ï¸ '_ðš±6 `䔨ûq˜¤ë´©–~~#º.Hy Õ´O—)“Rȇ+ ÊsÌÃåXÙu÷«ù„ªf�””¨±lØŽÀˆ“ Xas¿]z»Éß©ºQÜf“û͘šÆXM9­õó†ºæñ#,KÝÈ=»9BzHø­ÛxkÌÞ]¾�Ù:BîÝøÈÌ©­y«ÿþå7Y¿ª ìeµÖOÿÕãR,Ód¬•f6[ˆÒˆ¤1Ȳ}È9Ø–Í º<Äœ™xôPI_ú3�‚ȼ�eh%ˆÿE¸Ç*U5¡ *%a†dAaµCÎXó,¯6ʨ#FŒ¸Ï¹+{pvË�pp£ !¬Øè»/@QÛ@ ?7¡ÎV&v&/å�#+�õ—ª| +×øî¹m�±2ýBdÐ)—ü¼(ô2„ ÜãÎX†  ­d0;çÚp¤í¹²3êS‰£V8öÕ`Aº`)ŠŸMR¨Qbá�ÖüÿA…úÛ[ Þ’^ƒ¦Ã&ÿ7€Yë$~·ó dº2/Ç2¾mÄ ß•#Nõ>\ÙÅŠ_s¤AîcE=Qú�«cbŸ‚ioH]•ÚAˆâ´60!Þ­×$Ì\e:ιç\'xb�à ÷ôI7ý3¯\G¬ƒ`­fÕM\iÏmƼüÑ›>­ãÂ%pØÙ ‹‚žð$\Y¯™³Ô5+ &!Ò-N:1. ?ßþeS+0?B”q^‘Yç»ÓŠ´å¯^Ä·pW�z„IÚi¬ ¢FŒ1bĽ,lêbkÔHñžúc¬+‰€Òü§ˆm�½f—óÑvcÈ aqÐM•ܰôëÚP¨ß»šǶ£¬ÅâÐw|þúŽ of9™Þ²H¢a`ØT©(ÓºK#¶äÁ�4$M$¥¤¼ÞIƒìv@`iŒ¬æ×ëÚÛܲj�äÅp³oôý'!‡ÒB#0l—,þñôÝÆI¨´Í cÙ5#NuÐ8Þâ•Ó9dÂŒy© –˜çÊö•IZ‰›ˆÌº º­Ö¾v$;ßšòœpÜH™¹æ7�kÅ Ýùø�ÅÿЬª[�]®·mv[ÿi•ÕOƒm.�Œñ±ð¤£œ6Ÿ%°Öm&žÂK*mãi�„áÓ¨*¨ømT{©:ÈUÅÍ‘=}ðäÖ!SA/³F5bĈ÷:–œ.ƒh¬¡aßfÖ»ËòÀ´ «¶b¡ERŠÅ 'Ò¦Bì*ˆ{NT7qxb�ûrÊÄaÇÖ#tJu­£d›ÞÜ Á:3bŒvçº=w­¹OŽ<¹es�ßÂ{#`e!`è&YÞÚ¶¿ªà�GNW‚sÈ#v¿ºˆ9-¯18å:üNø>„ÝlnwTë–P– 6#ó f¿"Ýwú&ÖÛ›:Ê›Ú ÊX¼5e¾Ýuâ$�ÑŠ€Ès6i´Í|¶‹€› /æ±16G¬„ÛÍ]Ęxíùq6Üø@í†æ!�¯íë!òŒ±$鄠ɉJ IºÒ\¢ýFéìjÑy5K¿_ÚD»áOªh4!¬~c¡ã&¾à�zÖF…¨µÍ5ÈÎzĈ#FÜßö_\üb8 tyD@‹�šC�úJÁä¼ ´ IDAT¥ØXÒÉ"ç‹Øe’My›öûìüpØšë35.›ú€� Ì„f‡P¯ËJ¬¡ët¯ óñ^—ŠÐMAÖµ!X�ø~/¬3=ZJÕP¢Jõ!æ/@ÙúÍ«=õh„€àFº·6c¢€µo¥È"¥œV¼^ž/?�¹õGK$¦´¢i^�ÀˆS�.ïìš Æ¸+Ý=“¿…@`h«º5 !£ôØ3²[Âw³5„»Ë°ÂÇŠD(-dô–¡�“]Æè¿I. £"–5t)†«WG²,Ó&*!g‹AYô¢�Û='Rìn;¶¢NÓáÙÌGIÚÐI9�I’YʲmÌøH)t Q›X¶xü¹ŠsŒÊò+hðJVÎ4îÇÉ8Ý€S¾Y™EÐõÎušåH�z_&ÛÝ­¡b¢¯Å7n¤ãÑ4=QÌN){Ü€UÅœ>QY Ê¸È§ëô é<¹N¥I¡�$&+Ê´Ù\=¾žÈ:&£ÆB³"ÊÇ1²¡ƒÍÚób7§éyú&üÅc^‡‰ÿmgZ³«–,–£ÚJÓHpäÍì-…ì¸neã; † ` ÁÈ)ˆlŠÆ`Â!žŸ0@}RQuE²ë¤°TÈOø;Ü?˜ûHúýŠÃÄ}‚.*‘<}½p ÒH�Lx$ÃÌ [ʘE˜€¬fpÊ1§œ( $j“.MÓÈ+½ó9]œ$XD&È�»Ú»NŠt-¼n Ê‚éx»b†ªßž€ãIgè—[Çï-ë I˜‚1(J™ç�ói§JúÏ…¥ú…T޾ç›öÐ*رò¥—ï ]:ÐÖâ-m%Ž+¶fÚá€(À¢Þó#Šãµ=%ucE°ì° 1×¢¡’Ë*fĈ#FÜß˜ÊÆ¦ik¥Àh•žT¨FÇkÛ£VZt›®øQ©ò¿©Êž''ðXžÈÔS°ŸVÀ¸¿(Æ)€»[ƒ4S?ª//™ž±¬5`6•‰›2�z×Ë5y�Ì~°CØÑY]QØ™Ld £TS(©&_WývZ-‡\Äj­ÿ`¶šɹ¤|þŽù‘êðÝlu6Üp À)'ÊÍîÚ`{š¡”eÕZYÍ¥òD2 *—²Èé �[v§dÚÛ¸’i.uCƒ_n.êm0þ¸¾’l—2­‘jWv¬‰Œ@'/Ÿê>‹w]p±j4™J»0äh ¹Ö6Yç‹G�ê+8mÆ÷'~éùðâ†RJ)VÐê’ž‘YÍSãú‰º±SwâY‡ƒò7K’ZÒC[g3ÉõwwÕRLŠV£yZêXº¡…h@/�?9ň˜1bĈû]×L± Šœ‡l°%ÁPm‹ºW!?YÆ »ßâ›)Ö0цÞ]*Ç‘ªŸk±* Vú2,÷Æ�‹±¥Ù3ß1:Dÿ²|9�̵†Î;õH®¨3ç•ø-º^±¯"½�^µó<È]Z î]íœ $ç±ýBç/àœåÖ¶šº’ƒõä]$õ@½”i"Eà†­bæ<Ëí¸1Nø®?‚¾ÁWX×´š¼'¬±Ù äE“†<±h« ª„¹�$Òllj4¤TRÅM?M:>¿ ó›+ˆy'ä¶¼±¾^äÿͬV8ÛÒðžp|æg¾ d-ÆZJ)@)?\‘Õï,Ù)(ç¨SÞï«iA÷¸ÁÞxBçäúæAXÖù@¿û—³�¥�O�ì õ§DÁ\Ê@Œ1bÄý®kÚÀz1Is Ûa÷®¯.[ý.­²�·j ýgŸ“doï©§’—"jmGw¬üO!IZWIÙJ±0VÊ$”bÚ\eQ<í Vø˜Äa‡+•?Z÷ÓvŠ=û:g}Nü-äåè@&H\²Zšt´�xª½�'B`5€"ލ+Ôº†î®„Zçj"€§pÒ7¢=­3omŽ\ÒnE¢÷Mclç‘‹Ò•µZt‹K¼«œšÌÅi¢K·ŸË²±ß5Tr´Ñþµ=_èú©.kúD—Ä& ý†´ Xb«jâŸ]I»R6¡i©2}ÓŸX‘„¾Ö Òl¶Ã¡r€Ž�8í Àãyž¯Sà�jŽâ¦}\›È2eŒ<{ݼ1\ÍJ3ákß¼)@)Ú*è­YËbr9ÇP!|ýR3 ÀUHëz!4,žsY’©5›¦ÍôÌÍõÕÅ)+¾ý¶ÿîù‚©ìì ¶±©8uÑañd§—¿šQ¥“ƒ4—ÈüΞÏ,py×–Ý4]dŽòÍU|`ºµ£ÊÌ %Z®pœjMŸ3°¶/×Ó„:îŒ#FŒ¸Ç€ic›is(˜öd5« À T�ˆZ§ékwvKŽ’«Ù†7c÷‹±‹ ög¹¨]–a;c*+À´–s/¿�P ]YDë yvŒmF+(,(¶)»³·>óö·ÿ‡÷÷=:ÙJ—¯a²íÅ\[#m²’.~Rˆ7U ±sH‰›õ«åö!‹”^è/á€3 ;÷ª;0‘.lìæ‚fI$‰J<õÿ,…šâ 2ñ/4«d¥Áu¿¿¼}útÜc0â£Öù¥Ã|¸4Vê GSø¤?Ê»°Kœ]uÇ?æ/Á|q»6v³#@�àÜඇ�#Œ]!TîLæ½³Tå€q‘e(`V°Ã4½óúÉÓ·ìonO2÷ôµ'Ó\ù¶Ó# |ŒÓÎ25Ù]bÉè<�;}R¦ÝQüXŠÜ�èH&ñnµC'¡‹ÀFÒXÍeszÍɘai–à¦B:kCðv®6e FŒ1â>ÇvÚÙvÚ¦i³7’•5¹ÛÞ‘G5‡î-x䓵J4æÚêÀD¾=ÌýÚŽ¾Ø�θ�.ŽÖ/¾�µ€@¤°ÖðÑMiVl² “í¦Ý£í´ùÕŸ|õÅ·žâyøCå»ñýë��Ovöh®óf6¹+)§zF¢P y�z�½RTÊ™Œ7U*­ìôÑ� ¸.²!Xö’€wœh‡Fª2wû8àÌzø©Oý_0#N1^{üäÅÛý|¹ ‚jh¡5¹‘&†¾Ì¾S0±JÜÙ¤ýª`±ýû­Êt©É;•†%/óN�墭v¬¶“…àÒ„m ê|ðæ_¯&tÙ ¡6Ä:QŠ•ió€Ä¯½¾¼z÷íõÍÉþ·qs}³Ýæw•Íî­œ¦’?J'b´qõaYh’0¹ s~Ãyã?Bˆý¯˜ûnîG!¸QGH*àì,ßøpÖ;l@{¯jñâ^®Õ¦¢K²Xåä“2˜¬Ô ¶:ð1#N)ÞúèÈj¥À¬Î°Zͦ [gÅì¤}1Š^–4¾„9¾dw·uiŽ)»»º0W�æiŒ¸îKC{%}{ÑÝr¸r^÷–Œ Òg½@)Ä´Ýî÷ûwíoo?ýl·�Ìì$¾Û›ës3û<ÒÞSÊLS ãsÄp™IÇ$×D-%–"…v­~ÂõA¨îC–ÌÀˆiQκ»Žþèè4ÉA4Ë<”®»¡Ü”XÑÄx¿òÆÌ^+›Í@Œ1bÄ=Ž [Âp]ípe†çr�+uŠŒ™SüõDº3벉f«U‰Òe3ö]¼¾zWÖ öö:mHÇwsÉ¥Øgtðpx–DÖ] MeS ÊÅõþégUÖ7ÿùOþäÉ�‡ëù ·õömßc°óR66• ªoþÅ8õ«ÙŽpAòé³ Qu¬ÈÞk–EÊS¥#e¿—�À8•®¸¨Nú¾ëØå8ñ”Ý„(�kl_r*Óa[¶óœv À Çv³µÝfW§2UãLc•‹�.HÓ;�ø&wÙWˆwJƒVÓsÊ"¦ž*}�Ƽ–®šÇ¢‹GzíÄFWðãŠ/��Ê:9òlì9:œ<03 L§Í„ù0?œ÷ûg=xxvªçâv??¸¹Ù¿{®õm˜ JA›f3ÄoÛ`%äé½~0çBÖHluVFøp!RrP5½Íÿ¦Ùˆ#"¤9a%�v®¦Ór8¤«„ð6%C7B¥-ô˜k²¾¶Ýn`Ĉ#îs]S6Ü–Ík¦WH›+YbÿJ�L³+u¸0Ä�âÇ-3T‚ì*TªЌ½ã‹Yf,ëäúR>¾WÕA”UN®,ð)xÊÃW�Ëö4m�c?ãŒ6Leâ¦l°?Ü>¼Ý_Ÿç{¿~:µóp¹Zžî_{ï�û_�b Š+Ëó¯ Ö©ª*ÒNߎHÈZ X ~}åM-+}tM9šzdÅ…9™‚ôÉAÕwë<ºƒ•%®€ºè”+YY­òP§is½Ûžï·›³qaŒÀˆSŒÍöÌ6Û³Ã4moŒ¬¬µµÇž¶ù,´Ú�^ªågÙÙqEæwZxqÀ5BÜ]â”nÊ·ýbÑ) ¦Ÿ{r¦âS´Oâþ.µÆZÚ\…ešÌ`Ûífû¶‹‡Ï¼çëÿÌǜڙøMæÞüðá£_Còí$ÏQÊâröªÃ ~óMy/FkXcëÚ,wËýwÆË�É»74 eÎäýDn‚\Äú!§ÈE#Ò+Yß×¹}ià³§%ÉWÞr®OÏÎÏ`Ĉ#îqì¦w›Ý+S™^2Ú\kµÊ(yd ×5K´(v¢–ɺ)€­¾¿Ó†h9;�ÙÆ²RQã9;—’ªiß6G¸þCxóIƒU6`²±’“m¦Ìlû`óìg>{ñ¦÷þ�¿ò/žT×÷ÑWþ>Ÿ\½úŽ›ýåçÀl,ËG1tÚÆ«§I‘Ù[–ðºò÷gçzGRl†üÕb3Ÿ&°©˜[g3L¸¨*�Nµtò�{^¥Ó¢ÚJ󬄷Ô0„p…Òæ:£Ö¹žMg�ì\>Ø=à¸1N¸?‚Ó�³³sv9W{åæ`9×�m)¶´h#š}M¦,r%aÚ1·ã¶¤ –ˆo_7_�ö­TìUò±Ð9¶eâ¤Ð¶¤g´#$y¾iÍ‘|Ã3´�PP̦‰VJ1àsž<~üÁË'O?af—§t&^}é…÷·ÃWšÙg Áÿ}Ò“º¯£~�“d€8;wƒÒß:¸c 6š4ÈÎ])5zYÃ6×1æî4Ôn&Äþ“%‹�Ο£ãòZÚ™)f6M…Vq{Øž¾ã�oŠ9#FŒq�c;�Õ‚òâ•]~œäaiÆ+KŒ““�Öé¥#×�¹L_Rƒpm�&)ÅÑú;:›�•Rä´Vá0vÊÈ=E¿»?#T¢Ia˜ªâTi(JÙÚn³›vÓî×>¾þÔ—Áð¢™�„úû÷þØwí^¹üÔ»>þê/|öÌ›·LÛM&Ö”»†>¥°Xè´)ºE+=¿ÿ˜Ù±i0í.ˤ&f¤ZV­0]d&ƒ a? çßn° urqiFÖZX9ï6g¯nËîò5!FŒÀ3{æÑCðÒÍÍþc·û«·çŒué©JÖÒ&’Ì„Æ}’‹²mçq>Ð\¾¨6^vÞŽˆª]��«à’¤CÄDïZj3ãÎ^4'/VÏä€ S¡ µ›,ŬLfÜÞÞ~ÞËŸúÔo.À_3³_:•óð%ß÷7¦W_ýÔçÓì·°”·a³ƒM»i6—ÏϤÔ¹ £µf_J+xf‹’ªuë\†Ù©Ì$&·4Ö¹µÒ‹Šóò8 ¡PaM�·¹õ,ïQ3Q“�©I×HDµ¥ð¡”ÅF¢ÔºÙmªU»z|yõôßûu¨ãÖ1bĈû;œq*›OÚŒ�ÕZ÷(°²)³•Êê†7€®6ƒÎl síE0&yÚ�”_+V„ÂíÈoK×™¥B2ã€àwGæD'6—�I¬ ™µ™4]{u,ŠõVÊd»‹2×ý~êê“/Lÿ»™½t gáéÍ“O‡Ù7+¿þz¾Ýœ]<‡R¶aÿ”%h³XL]ÚIw€òÔÌ¢Œˆ�Ž/IŠ [–i|l©‹¼òòãÚÓz™JùÄ©áJ|!'º‘£%t¤’ö«Åv”Ãg¯mËÅ­Ž À Ç œpl7wÛÍ'§ ?GÎ×äŒÅ¤æÅ<´èÕ²ÃÎÙ"\mqƒ¦ÒñÞ;6°]k …Ɔ+Xq×<º ©Ò3NÅX¬t@ðØÌW±Fƒ•iwN–òÌaóYg›w}ëÿôâÃßò~Ã+¥|íŸü»»óó³÷Öòp8¼‹e{†iÛžR¥óÿÙÑ÷©ž„ðGª "Ò$ÓÐÆ†�a£ÄæÀg:Õ ž�Ÿ“@ Ðv ›t;ÉÈÜÓ¢ùÏùPgrÑ3Ðô€f-Yk­ešöÓv·¿:pÀÿGŒ1âžÇ»z6�bžç_´j‡FO+:–óûþÎ÷œ½ñ¥§ÏÚË—ŸøŠÙn?g»ÙÚ¦lÚPfFR«‘+6«%ÿØŽXž1»Ú%„�@­q O·ÁúåyöjZAEAP,¹æ†Ä?û˜Bx±²‰×¹Í–¹ÚíT¶ÏŸmÎ_ÙMCà¤ïÊñ#8ݘ–‚ŒóÏ›Õr6Öj†"ì’Ý×$RVxô<þN¯�Ló4[\¦=3Ö*ØAèŽìs"·é%(zÿ` š`\ÿÝç ð?žTàƒM»s–ý­Íû›ç°)_ôüG?úQ²þ¤Ù+õôñãgçyþr3þ:CÙ–ÍŽV6NN‹“@³5SºG l‚ußå@­³à0²Yñ)¸$3*cR®4yyËS�²ºèEƒYö5³ãOI@{Y«Õyæf[.7Ótm*7bĈ÷¿®™6õáÅ3/íç›OþÝå˜ÊD•®u$43u—a×lj¸,Dâß:;¹%7µ- º %hp4¢Ÿ#,YÐ?U9áÁt§ï�Y{1ªMÓòk›iË‚�Áo&íKþÑ'~î“föSoÔ3ð?òñ¦ó_õiõ—Þwyûäs§iûæ³íƒ¹”‚hç{Î(ÛVhÙ]0 ŒááçNXHÏé6?³ë(†h�¹„Šiw*ÈþijâMOÀ(}£ºéÑ'H $ô�ü$²4Њÿ)¬V¢²^”t¶;{a®ó(lN8à¤åÄÝv÷¢UþX¯±\ÖøÏlºy©´âN¤dRå’kÔÆØ†BCá0m[SÕNqd“ãÖlñÎ:Pí¹FoÞæ7rµ†™–�vטG ï±™lÚ�±ìÎß¼Ÿë7>~üøË.Ÿ^¿¡Ç¤ßü?||ºº¼|çk�_û†CµL»‹©,Ö-ÿ„¾ðÒ-7Ç|À>|ôòa¿ÿX1»imÕÒ:骴8B¬oÓn‰�Ê¡âwÒ3 YÛ(e­óaM´¸âñh%½s¨ž;êÖë›~Cˆæ¶+ Šô[1ŠSÁ̳Óvg›³‹³Û}}ÏíÍáK6ÛÝ>øÇ~âÙ7ê9øùŸú~-Éßq¨õý³•g°9[2N32ºÁžNƒ–bI it¡Ú¤hd³”(‘ѨbJío!|äé,¿õØÊdž•ð‹&ß‹/AZ ø3§êN³CIÉjužÊGw»ÝÇwÛÝàÿ�1bÄë$¦©Üî¦Ýž¤æ}OHSx¾n9Ðãû³ùnßÉCMõ&ø�þµ�$3Cq xZâ½ÚRKˆñ£†bmž ]÷!9�PâÖ IDATðF $Yá s3m8M›‹«ýÓâP_³™¶_ñÝé[½ÑžûÿÛ`ûÜù›ßúäúµ/¼Ü?ýâ²Ù>š6+øó CUr†^ªGÔ[šIÉé?x¤ Q0PŒ¬?nØ_ÞŠÉ• ×…ŽÚÌ©tu´Ò$-†>ÊÜ5›9šYA¹Þ×›�¾éÁ›^ÜLÓ¸(N8à„ãG¾óý4³«÷ÿÁÿåå‚r[�V9‡±)«O™»‹ÉÁûÉQÒh{BDJ¨^myE�Šw‘â‹äÂe¦LÇcÙѬ"« * s �ZܯMï «ÕÊ4™íÎq}s}nu~ÿÍÕå‡l·}á[ÿûçÿþŸýgßþ†Q‚ÿ²?ú×7s­ï¸zrùusåo·iûØìˆic ß ‘åX-üf:Hd4ÿ1(Št¤ùÈ”X¦ÅˆF°Ëój¿‹ ~P—e|•Af’iW�PT©3C›}Ò�ÙþX•ƹr¾ìîvg­µ€#FŒx�ăݣCe}²Ÿ‡ýá0Uú®ß„2ß�SÓ-kкº‹WëÉb!êž,·�KêLj`k–T1ž½À`&;ë9 ¶veZÚB2(“Me²C½ÝÍu÷®n._9ŸÎñ�üøïýð¿ñ�ï{ÃhÜüÌ'êÙÛùöË.O¿ø–·ï¸8¶”iÃN…ª6¥ŸE�1šÖ:(êÑâs¥Ö{aSZüMdÊD¿£DÅI¯<Ð?tÂ}ŠÖIL’‘Þýãv_ë´ÝÆbU0×Å`Ó´½½�¯_þî/ú÷¯Æ-qÚ1#¬ 6Ó´/³¹JËf?Òfg½ó²á- 0Z8ÜúH2°á NrVw¶a�B[·—Š�ä²ÏW¶Sd\ä[¦Ú ­¬{RƒnY1»k»v‹L|Iëò‡,›©Ngçv0{ï“§¯}õþöæŸzé“/¼ík¾ÿï¼aF¦‡¹¾••ß4Ó>t3ó�ÓÙƒívwÑàcTRZ$§¥õ^FE9¸o2þXûÂî“åÈ�ª¯äÂŒ ¹ŒëSÞ¨aô š¶m;<%æ0 Dj:Á}ve” V9•µJ­�õ¦ÖÃGÎ.vÛî¦�1bĈ×I<<{ÓõÅîÙç'lWÎV­ÚZi­mä3gxµ"l¨¸‘C—ô¤£eym¸Ümþ»è(AW!ðõ1Ãl é]äËÞË!At1ÅÀÂÅ+V¤¤%$pÏ�Ú<é¦icg»3ìëÕg=~úÒæÃþ‹_|úò;¿ç/~Û¦øø“_xïKWÏûÁ_:mαݜׂ‰´ê¬c‰ Dgì‡@4 UŠ óJQDR„ºUFµïÝÑÛ]C¿f  Ñ}l”f6C �mKÒx$ÉÒTËBg¹¶�ŠÖ×_è,9#ŠÒ‡ŽKKj�¦G*Ù1Е ^à„J¯R²�¬œÍ6ÓÖÎvç‚ÏÝòúËqÀþå«2?<;ÿ?þÝÿW~ñßþÀvóz{ֿ뇾úÁßø¹¿ùù3ÿ<�ožÊùÅn{ÁÝæ¬ÕBÆ8z"Ö»:ô[Œ¤áÃuƒÓ–(ËÓ|–.O4^¨=¦r€jÐ’:„£uMj«n â‡.ôÃÒJ™^=›Î?”ÛqCŒ€¶½8Rçú“¸¼üV~:kmN4…Ö`s4ªˆ·ùM¹¦–Þ-§ O÷e¤¦:’©3ÈmÖ-‡-zó¦0ç Nü\Öem,¤/K„8iò@÷®ðF5LÓÆ6çv]Yö‡Û¯˜/¯æùög~â'ü+þ£ÿûÉ_ý®/x]LR¿îOý=ØÕ%^¾¼zG%çíÍþ7ï÷óçbsþ`s~Q7Ûfëâ�ëc$›,íˆi° '›µÍ?Ò ÂI–&ËNlóuKØï¥.r“â�‡­ÈŽ dVGI&ÚÒ[ýUbOœIïè¥ÕjÕÁr"êá#m³ÝÞ˜qLÊGŒ1âu»On×?;s~™4;n­–-6e“‰…�Ù”,*ún™Á\êèíÜe àkWiÚa0–4Ÿ!d�Fb²•«1¬¤¿n+] 1Àv…ÛÌeF‡^`[^¶ÛËTìzy~sxúU¼9¼e»yËsO¯žþåïú ¿õîׇ?ñ¡ÿõÞ/8þÍ¿òíeûÂ5zþÈçšñß:Øþƒ(¸xxñ,¦iÇ`t4h(*|)IÒ:ü9'ƒÆÆì¨ö0+aÊ—ô_YdÅ#Í?Ó ²É%+ße6àc#µ¨¦3¾³ò ¸aj×ut/`Ñø±•V9V>v±}ðS¥Lc©1bPF˜ív»§›ÍæïUò£fFγY­”ëÁ_Û,öÂzÙ«;L®Û»D-ÇW°s´˜½Ÿr¦|m çþƒl‚¨¦£ÈÏáî>0h¬ðj _¿ÝçÕ`sqaØnŸÛÏõ .¯®¾ãÅ^ü¿æŸùÓ?ýº°|øàüüµ§O?Xoo~ÏÍÕÍ7îg|¶Ïíþ_öÞ<ø¶ì*[ß>çN¿á ýº[­îF’ 9€0 �IL0ÄÆ„9Ná`‡ÇP)ˆÊÆ®²S…]€m.CÅÅ(! Ð $ÐØš‡ôzzóïw‡sÎþòÇÙ{­µÏ}*KH HÚK´D¿w§sνgMß°}øo?zýÁoáÎVÙ¯ï‹×Ï óvqÛûøÀ×Äa÷]¶_fáÜ|¾D͈Bt5ƒD=éÚCœßžè–žZ¨æ± €‚ÖO€QÄYak§Ÿ­¨µÈЋâ EÁÂÑ£J…½ä€³.vüI3Ï2ª�+©ÕÂrDþGéc’dxgÛÌ_³h—×ë¢FEÔ�ù|¾úþ1H‰=JpJ¤Y4Õ7ÿz“ô$m?§Ö"ÝÅ jée©È»‰ ЍJ‹GŽ—Bª%«æÐ3 ž©>AhWšaUt“V"çÚÜÙF�šùLf\Ã0œ‰qø›Ýï¸qãÆ¹õzý»_ø£ôöÛï¾ûÊ/íé¶Å_ðco>îºÍï}à¡'Å>þ­8ÈÿÐ3œc3oÚÅŠM;@0$<ßékïŸì´@‡�¢é]•¨È8j§ï8v¦™ì„ŠÒ6 ·AA~¦)&Ó’tþN9ÍçÔ'Þ·büf‘ð‡5’òôÛ;Îü“<åÈ•6ÈCËåâ-!45QÖ¨Q£ÆGY|Ó3¾«ÿÆ_ü’‡Û0»A×ÅmCF«V”2†"ùL0×¹Ã.Eâs{¯~ntø4NêŠÃmïGⲯ ‹}³XÞcñr‚V‰dŠ·µ7€ºNÚÇÿ‰d!pÖ,$ÌÐo¹>Üt§ŸGò(rÇi3 ßù›÷��;s×£ß÷9ÿú/Ýü»^úU·½èwþ㓺žŸÒ±û»y.4³ù".še’Oˆ 4ï&%~žã·æ¤’I/ÿt½P\�Ÿ]®wˆ5jÔøè‹Õì�@8ÙöëkÝns(@€€&iÁS"&„l·�(…j’!M†¦‘EW™ÿ]œ ‘dSd?5°VÏ€Ž,å•rËyI™Š*ö.f™“Gå%çŸRÀðÄÌ�²9|¤0„¶YóFDˆM·¾s»¯<\žû´aè~åÆéÕ_û?^ö ï¾zõþ“»nÿÔøC_ôauÍ÷ýîß ëõ¶¹±½zÐÃswÃîk®m®}ê Ã]¡�…ÕlÁ6ÌG!ÄåÇIEˆRJQ²Àž¹*c¢=�égjÄ€¨€\2Šã÷"Z,FžkßÕq(WcÎFЗg0+‰¬ Á‚HŒä.n®][_}ä_üõŸ®.5ê Æ\|h»Z,NDpÚÇáX8�ÂAÌ…Î÷Ælú©IK„D1±$’Œ‰½aÎJ`Rp¤Z®„Ò•zâ] ü¢WJá§—C–6ìSñÁ4d P$‚@f3¢m‰&ÝæÉ›n8Ün¯ßäÚ§Ÿ=ûªãsçîY<("a«ÅruËÉvû)'''ÏŽCøo(á‘òiËZif3‘Ð8oaºœ£úE…ØLŽh<§M3‘—~ÌÅθ÷‘¬8Ú<Â’)œ×NÞ�d$�Í´¼R¾�Ã|ÐL�ÄC?&ÃsÂDxG¶A 2�ˆq�>v€ñµGuP£F�…q0?Š$ã}âSû¡Ÿ cQ£]žŠ°; "eóûÆ, °Q á7ÍXðâEbV˜°„$uöX‰\røÌë5n`ã[\À«Éå�GP}yؤ q"F BDh‚,‡ Í|Þ÷ýmëíÉùíö´½~ý‘§Î$¼ç`qöU«ÅÁkEä‘¿¨k9oçO¾ÎëÏzôäág4�|^Û¶Ï M{¡m—h›Y MÈTz8W_¶Ml�^r!]¸òÝÆtüsLVHÿ�‰T� ¯ïhæÃÅJ‹“aƒ“¥. ªqâJ®WýA溦¡`Èk°‘d÷®ëZkÔ@ ‹³Çg�+Ýß¿ÛöKÆa� ±7¬4\¹é$‰OîÝ~ÅåJ)  ±xkÃQò*ºß­qÝ­]ïåîö îQùlý,¶vÃ(ê/ãÔ�Q(�´!Ëe�¶ Ýz}'ãöñ�ðÓ7ëõ'î¶Û?êv»w>ó‡~çâ|±|äèìñ•³n½ñ+ûq�=à+îþùÕG>ÞžžÞ²;]ŸôÞ÷=E€g}ÿåC ŸH™µhfÒ¶-CÛ&�=Û=äk *å^eqlvÍ T+ç,T›$u«B_Òõ˪7p#wètÀN}7>0UÛ}5Èòj¢MÌïÂb¨ã×'¤}OÅÜ*ǯU‡®{ôý|Ïo׳7õîP£F�}±œ­†Â;×ÛÓ7Ç(Oì†xØCT¶6g¯yäíßY$»BPJjÛ8ÑöúðûÙjò|¨‚ :`¤7•+*7Ų̀Åñ�QŠ9wJ†,qدÓR³œ-•Úf.M˜³CÇõözÛ»Ï$|Ãòû“'¿óâ[oý¦_ü’÷.ç‹GΟ¿rvuîÊ÷}Þ�?fŽÿúUß½zèÆÃ篭¯œ¿¾¹|üÀ#÷^»çÃçîÏ‹ÎgKi›9ƒ‰2Œ'Ãv€aóqÓ;C¹ë]`ðm‰`fQŠX¯˜Í`°ÿ} Ÿì0‰O¥uY,†J¢Š~ãñ#­™Õ‹ÙÕEyƒQ0@üÊ,�‘q˜5óØ.g+yG½9Ô¨€c0„pïf³~Ãz½¹]†¸d…�yü‰h \âm§›LvHwÕ@¿�…““#‹Æ}ÏG„’µo}ߟŸêÊÙ¤.�é}à¨P=±5s¢´gí€Ä¶C6âMŸ.8m; 9��Œƒ Q€„¶ÅâðX†Ý ýv}ÛµÓõW²ïÿZ¹ºX¼72¾z·ÙüÁC÷½ïÍÏüÁ߸¼Ýîâ|¹âòà .V±�µ M+A /ûŸžö¡u_þÓ÷ 2Ê#úžè»»í6ôÛ5ËÅâú#ß:tÝgÅŸ3ÄøYÛë›;)ñ(4³sa~0Ç|)@“‘ƒ4Á¡b:â„>‰d!]…OdõDÛ?ØÔFéøŸtÅ&2Ù pâss´ïOþÒ1IMqž¸Ù;�P_Â$ @ý�š;t!�Cé;¶� Úv“Á(5jÔ¨Qã£/íb˜µ³7?2Ä?Û/â ç†!ÊlÖŠÁÅ”D]l"tñ:&¸äáN‚Y'±2Ñöÿtî}ާ¥’$ÓÐÙ£0I“”Õ:PB€¸ñ€í2ÌY!WcÁ‰ æÁ@²PE_ªêòÀ^ �Ì›¹Ì/ÄmŠmw:Ûpsá´[ÿw2„¿:óË ÎÞÐõÝ+.]¿ôßù«_óþK›‡vóCÎgKÎÚy\4œ5s¶¡‘øÂwÓºæ_ñAcD$AvØõœîNpéä¹ëÌ“®œ^ù„nèž…_8pxʃ×î½]Àsí¢=Z̤mæB‘A¢ éʈQ" %‰VЀÓe HŒp<}”Ct”(Ò)ýt”àG e*]R ø‡jÄËN¯@«­¤àÀäe=!cZ­�K:›jŸ‹Qvݰ>³8zß"Ì¥°ÞjÔ@ ‹ùbΦiÞ½Ûn^Û€Ÿ#.0ö4I‘–!wiMw²”d§8H¹ÛÜv%tÃËrB^L¨!åÃ][™ZMLÑrYbÎeGõï±Dà6Â&g(ºÐVº§“nú1}ŠÇlæsiB˜¡™]àÐ_ywÞ}zrýîk—ýŒ®ëÈÕÅ|vÀ£@x_Ó¶ï�¯^m–«Ã^Dn Ëú9Ï{Ñ¥ÅÉõk‡»nwŽì/ îà®ã…«�>z‡‡Ï†¦}BhÛO4w‡ùb‰¤™-ÈfN†¦À®Ñ— ÙýŽ…•­…gÞ[gŸzn�Åé(™7®®¡p­Õ ºyòˆŸ…Ÿ®¯¡ öÈD''»ßÂåäélž0�BfÞ % ú±ÇÐo‡EnÛù%‘š)kÔ¨Q㣶®iæñ™ ÷¿óýïx׬YnâÐI×ïd±XD2B8ްE%â[«¬$Gs—uµK‰Ù7HŠnO%áM.^tœ]d8¸=½ö‘©#¹ Mߪ1'SÄBÑÛêñ(îÁj³„H@#óÙJšf&CÜ5±é/ Ãp!ƾ¿Þ]{üµ+מ¼Ûn>?¹´ZÜ£¸¿Aó@ÛÌ.¯fWn=sẈÜ!p×-wÏ.߸´Úv›sÝÐ=.2ž ç!áÎE³:¾÷Ê»Ž(¸­iÚ§òIƒôšYÛ„¦áb±�&Ì’9ºº@Q‹üOÃÊ.D®¦q�„*P‰˜²Ç糬ËbÇ> ’œÑ8”).’G2Hh¦R[¯3<ÛDlYB¯~;ì<@@ŒCúþZ»˜½â`vüÖ‡ºØ¨Q5,š¸»øöm¿}ǵ͵‹Cz˃›K_û‹ÏºÖ ]/½èQæ³ÕìåoéÑ",�çaqk‹Ù' âm=»;vÃö)½ô"úU»™ôš¦‘YÓr1;èÆ­Ó‰³�h`Èdùk˜5ï‹7fHW={ëÔ¹¤È’ÆvÕ “¸D¨SŸQfµ3OŽÆÅ”È–)*?,Œ$àñ"æD¡�É Jϱu%«=/Ï;ÄØ Èk¤üÁùà o]ïÖu±Q£jX¼ìï?‹"rí¯üðo\lg³“>2Æ® ¡™!Hfn«‹-MSª ­sïg� õö!ƒ´G˜Lg>·áL£Q½…¢t"4A¶o£àäe°w̱553à_H“K�8ý–bŒI0¦™|ú@ÁO r"‡@š4lÚ™Ì+‰q�!!öÃ*öÃrÓuç¹Ý>E†á‹cv†B„`‡€A‘êÂfˆ±‰QBß �`ÓR0bNb!!,›¶™7Ë£ÐÎZ MK ˆ ‡Øƒ1ŸýÀ´Y,„oàup©©†£œ� C¡•˜¥‘én 餛ÀÌi×âdi>–J�ú…ó¾Fh)“Ëfš>â uàõ{E A@FBúìûuÀü5‡ÇGo†¡¯w†5jÔøèŽ³«3'ýпo³»þ„íÐ]ˆ½HhÆÆÑfá%èÐñ~¤-^Á8 Ð*)š×ÒÁg<è[x(q «ÃÁáÇ@}Nzv×ý©•ýØ�çíáãçM²öjÂ3ž 5ŽQ"ã(Å„ 9\,ˆùXŸõC »~3ï†ÍÙ“þúA�p7…Ÿ×q×1�=€>„&22 ¢ 4¸kNv—Û5š&°iA,£°À¹Ú¦mÂ* AClC  D@Œc—Ÿ‘™\j‚ `!¶r®t"ç”®bÝx¯+}Q˜è”0åïÌ¥µ` '+Ð÷ôz¥ŠIPÞçS %A¥ŒÓ�BÌ)8z<’$7ý:DÐÎÚëáú{þés~ü‘z7¨Q5nþ…hç7š†ãv{½ëwÇ­¬(h„&ÜçœÕÄqè\î"Êí¿8òÿ$s•9•N÷”ˆŸ¢Ã¥0]ý€l&LzUîWI}¥Ï¯ÝA3¾°#¤¿?Št7jÏbL¤éÿBËZ€‘lb;„fèfŒÃ!‡x!Æ^÷éa|&Ó³5áÝÏC")� �  lš†h¢ šKèd ƒøjÃ7è—=¼CN °(Î!³Â ò€F/ò0Nç�îénKÂÉ;e̼‡€‡[ªÛC!�”Ýn�&IºÉ)…ÿé¿³=.}º^dè%·}ß½åèܹwmNN†zG¨Q£F��î8Z?ºí6 ŸÀÈ ýб 342¢¬§/3ÈÞÖ® ÓM/œ¸»¨ÿ-rbõ"rc«kþcFƒOºz“³5/ù�ßÄù d�Ÿ§IW¢iî=Õ|åYŽUE€ hC„%[6ˆŒsŠ,㹬¤„ ÅXdLo<­Û(A‚A !Hƒ€ �A A‚Œh�‘°ÓŠÝã9qÖ± €=Õ??“)aÉ–Ùé IDATApÔrßC#z+í!¥Qƒy/FPÅ)´BDûy˜@+5ýWÑá/¡ ø:Nã…²ëw"›åbqID®×;A�:¨ñc¾Xž0Æ×o¶Û§DŸ’ 1)Ž“Ûù‹ ¿�‰e*¬¢U÷öó2�Ámç_îpáÛTG({~QñUÿG¾�Uõ9µˆ/aâónÁ#+”UKܼ9Ř›�š…«H#Ò4 …md,Ä8HŒq|Bþ€A7ÖJDÊ8Am À6åQb #$Ž«ìñ4Ž/2h‚ò[ú1…¦ÖÝÐE™p3¤)ü»„ª××xöÞ)]ú”T‰8?cBázé{”Q#f›ƒ›11ù`KâH#?DY–Î= ¦Š$"C¿ƒÄa˜5¸ºÛíxþ×?õZ½Ô¨Q£ÆGœ;¸å‘Ë7.ý¾ˆ<; B�€�>AV$6ð�Lyë0Eš(¨¥Ë…:½v"I‘hgqùYHw­`#�ÜÇÚÞ^²Óƒ\%T¡ÝðÞÄÛeNŸ_é}]t,¬/Rl— #`§«ù3™ºö i)æjÃë€ì«3[,À°ƒâEg1ŠéÄÉ”B p’c$ùÁ‚:�£ÉF:ÌÎzþÀ]¾rœL¡0•>S7ÖB‰R¸ôiÒûT,Œz=Ä&Þˆ'LôÑW]NKGD8DJŒC×!Èðîåòàåm®w‚5jÔøØ‰ëÝ哣噇7ÝúÑ«›‡ÏwÃ6Ì8£Ã1Jâ“M%âo²’÷e’­î|­£÷�·½­µÀ’ŽÞˆÐ«Û€H£‘ÛÔ"g?ƒª[¡c›%�ÓâËÛ#�¥l.\µ•‡ž7Ÿ;rN ¦Ü±z&ݸßD ´RÒó¥ËnõÕë2±’²/·8Y쩼„À¤¨2Z!Àh [3L}©¸17îéÂÓÖ ZÆê0 ¥¶[èÓYØ8ĘÐ:škEµ�-P‚°�»¡— ¡gŒïš‡åëÎ,ÏÖÅF�"B=5|<ÿž4\¾üèå&àá6àJìûž}gÃÕ’ZŸ„Ûh÷o*ÜÙˈMÊýb;�ÀéFÀÅø³hÚ5y �¡ÏbvÖf–¡Ö°å°5ß-‘æÀâ²;­…æÔ·¥LÄIVgÆàèF’õŸŒwIþ޳ðѦ…#ÁÓsÑ^$ŒóòüšéTGis£8_~Mog8Ni(îhlþ�ŽÛeì’'oÚÂi²ž¦ý,®YžuÐÎ-!yª\ºÆW Èdò®Blìoaÿò6JêÎFœÒM=Y`Œ»íVÀA‚È»W‹åïž?KÊ©Q£F��¡8wp!­ÎÞ3o—BÆm×oB7l“¬“.2�ÛÕBÍmÚv)7:Ï%Gxͺ\3ḧ½ts�§èîÍY`J’#KÉ:m›]f̲qyŸ¯»}Š%nÂ%gͨÐċÇ\:�£…’ë2"RB%—T� %¨Ó0#$F«·R¿›·!Ú+S‚:“2ÒU‚…Ÿ³²áE±�ôM­Q \`9hɲ{u„¤ñ Q¾eñ/y:$ʇ…+’ÊåþäKgó =.HQÄ#“:)ûØsˆ}¿ó+mÀý]{ßû¿ÿ ´«w�>* Æ^Ìšç³öýÝ®Çv»9†Ù™&y”À‹’æž‘h#ZrpšY�=«Ã�%\>M–ƆypêÙp@eU­QÌö« ÉE¯&�_2§Åô÷P U± Y±ŒÉ˯å9 Šá(vãÛë}³àŒˆƒCê‹0”úÂ9ÝÂíX »íM­¦`‘=Š‘òX D'çýø˜™‘Scæo8Ëϼ@9é1[ÁB,A2/‚S9À1[Ñslòã–!&®lWå"†“ÍHB^2$‘BUžª1bC#C·E·½*«ëYhß¿Ûvïzá·>ã¤ÞjÔ¨Qãc'–ͪ›·ó—_¾öй ø´ØïŽºÝ†Íü‚&çL�µ7–[±ñ:ÆŽÓˆÜÕ‘NÙ-Û%7ØKuAP×%æôžÈÞ“•³{m]LS(‰/*#g«cÕÔÍ⃉_î Z™’dQê&½§s Q¶æã¾€§¬ïéÙËèFäz\x1)–‡Ïýcü‡ P=j?Þy4«òŒ©¨ +J�”óŽãŸd9a”Ø +݈0>ZÙÎY°¨ú§�ÑÝ­?ÐøR”¥r­Ú{]5¶-púMÇâ(¤êÅß&÷% -àiçp/œï¾Þ¡U2vμUòX�eG¼Ê�‰¥!�÷†á”Ni,”º½w·â*~$~„… ú‘ ˜Ïɪh¡€±ë»N0ð¤ á÷ŽŽ_{|æ¨NÊkÔ¨Qãc0€;¸˜¯9œŸy Ø>Ò=Òf_bðµ(Ik¹º £–$â÷š �¢&šÍ²yðÄ©¬!X$yŒëм6Á½L½÷Q,5kÎ÷âÁ*8”÷Þ}Ùó-EI^ê>-{hOT<¿8õþüÍðd1Æ0å L'ª˜Ï¥íê“bQ±®w2‡ÊMÞH WfЭ~ ¦äÔ @}Ó`ŸzJ_¥ê‡fþŠ+�ró%R0p�»'Õ¬¥6D"#vÃC¤ˆ4—‡_uÇÑíï8œÖ@�½¨€{ñÒïølŠÈúY?øâWËåÅ]ÇÓØmWA„¡I8¬�ÖªRªå[È h§9¶$IºLQ.¸}O—oúÖ9ÝøUþÞ9Ø9½@Ms–i‹~4kÒÅD$@s‹ [®Ó4ñUé°ß‘b~@K «›Æ°ó¦ƒƒ½åäo:?ÞËΟF$bBZ·�¼JŠÐa«…úæ%MNO}�Ä;Mç$ž$hŽp’™c`ˆ}À˜pö®%¸/;ÂÌ|܉3Ù^E[" !ÏÈaœ£A¿Ù ö[�ÈÕ“õú•OxÒ“ÞpíÊ•¾ÞjÔ¨Qãc3n=¾ã¾ÍöôyWO/Ÿò‹½p¤ÈèPçz[¯Ï'®V°q¿ˆì/¸¡)”ºeS �‘Ý"‚®š‚ß($íùÄU‡µ Ú¿Ã¦Î:™ŽE ûEˆè+½rg®Èïê£Û&Ñ�ÔÕÃWi&6”«(­ºçs¨” f…¼¬@�ý¡üò?ŠU#NŠÁ€o @AHªÑ2Á†Ò d* ΀[%äÍ> Øû:Ä»X¥³“˜N‰ ºÖ H˜°!“»@:`xSÿ§J:ª8@”>v<ÝmÙÄöƲ]>8Èpñ{žóoO믾FÔø�b±\<4‹ñÅýîäÌnŸ=ô=mÒ—KÓSˆH„Ý!¥¼×¹SJ%W7F/¥è,S¢Ô¤¥—¾Éæ¨yš@:K ™Þ‰õ¨{Z?Ž�€iž(†bqBŒ—F”[¦‡ÌÒ‚7+Å JSCß§›‚¸s6rH>¹™ïAy„…]q¡K@²‰ö¡áÊd]dõœLyŒÅKÙ”£`jä¼Èé|Äñ ¥ð`¹B±ç8¯Z.-!¼´Nv�§œºñE‡n'�<],WïáÅ_þ¦OÚÖ_}�5j|ìÆo{Ò¥w_|ç«!á¹�3Ùl¶²Z¶lÃL†jx3‡u)Èzpn}4·8×;Ze``½½e¯¤Å¼xjxÖ0çß2[ë¡ýS�}¯+¯àCìU˜–]âÇü*Þ“­�aòËîp�vXœ ÅãÑkšOYù¨Ô‘¾/¼8”L¶%ŽÔ`úþ®«'(!ɲ(¼ÊqÒ*´KÆ›xê%+¤ñ“û–RY IZ™ŒéÉIÞgФŸ&%¢ÜÌk *ØlHKlŽäÿCß¡Ûíоþ`~ø’ á¡ú‹¯ñ�¢Rj|À¸ýŽÛ/Ÿ={æ%ÂþµÂ~·Ýl¥ï{�÷÷l/ì›ÈÓéÁ9MÕlë…jm@À=D?½�|±Á‡Ý‰#d*ÜË©l¢×cžWôô‡\aA&‹ ÉæÕNð(ÁeÕ ÊsüË=I:ú¡`"Á. I¶ÅGJ@åƒÐBñ:®ÏV@ù3PF(¦ÂMB „À8 ú]ˆ±»"ì_xæøðå‡Ë®þÒkÔ¨Qãã+n?¾óÑ[ïøÃÀöÞu·–ݰePš<›ff<:<ÒÛÄÙêºç•,nGŒ^uÜ ë¶1búµRÊ[Œ% ƒ%B!±˜L”‡ÉK™4ËÕIPy¾‘ªó20¤±”µŒäê* $æS�‘ýèK7> ë×TȘé�“³–�öYk¦ ÄHaôÛwdˆDjôÝ$S¨NˆfD�§QÈ‘a<¸`àUgm@Bv€\oEΤùD‚)(ôÀf:Ê*ŦF6Q—ãè ’-š ‘íæD@ìÇnãú�Ïyú_»ÿŸûuP£j|xñýgÁ&„ûV‹Cø'}·‰±ïÆ^,@áb>cødabm0áöÉ>v#´�þ&¿”³f#ò —R¥ÚŠÌô*[—&¹!½´ºùíY­N|éJ©B˜yõ)çC‰t×®r�7àÒ7Ä;ä” …âÌŒ ¢rðÒ…¾ÀØ!Çñp¦Ð󜻌͚Ǔ8Iüy7oõPž…ä … "A!ˆŠ±Kÿ“pã^8Õ~7åvSˆq­”Ê/öŸ?�N“‚ ÒoÖA†ÝÉrÙ¾�oüì/øÌûn½p.Ö_y�5j||Åñêì³fñÂ�Ã[â0Èf{*ÃÐ3$W±„ ª°Ã}k»˜4g“O]™+Ê xA^ªª=JI}UËõï¼ðHÞ€ð)· :Ýß®z ÞNܤaÌŠ|¾àÑÔŸExtù29ÆQ (5¾0Å:zƒ’u!%i¶I²}‡ã"fÝÊÈÍ—(î¨õmý@% üR†ÐšROY^A¸¢$8Ã/|Ã'ÕIy�5j|œÅ?ý’wåÁ÷¿² Íayi»9ú¡“¼pÇ8m' ‰":K::ßÚÂn“ð‰·œ˜`ß{¦ýÈŸ§áðîƒHÿ–hˆ`ia·Gi¥›×û‰ï+NJ w<(àâ¯öÖ9Õûžûȉ:"ÍȪEN§%°}?J"‚a÷.ˆÈt©BÞd,ãG(�©1[&ø¡àÅ”G÷ µ«‰ÊÁT?Û¹¸±‘Š=ƒNò qè{Ùív œmfañš[�nÉ�ç?áJýeר€±øµ¿÷Ìí0ÄûÛ¦½1k¯Ê0ìØ÷ÈŒ_¤@'wK»‘ŠI¾7B7‡N6–Nhäsíˆã8 ¥Û¨k2Ês×9dK_'¦§°9ý¸Ïüî•vE�ΟG”»/š²ñLLø>ªæO‰ й´2!ãXrípȼÓÏ›ø˜]v !@RýtôÅ­ß0jUŒȄUL >ÔGPCWpó@·›·AO1Ï@æ�ÄâB9¹¢¬&Œ¤~¨¢ ´!�~àQk74dÖΈØs·¾B ›Ab÷ê‡ÿÔÎgï©¿ì5jÔøø�ó·twœ¹ëÍgç_+‘Û~Ø6dÏC#D C€ A“ÊšQëßöÆÂÀ"ñ;å7’£\<­c×:A s!‚ór¥Rê²=;ýÀ/�‹ÜšGßLï˜pçž›‡Éˆ‰¡—zÿ‘Àl´7ÙˆH¡9[÷isoTHêÉ5Hb.& éô(LoS2 ¢�½Ó�/‚ ¶º © €ä£”kC"€2þ“«”À@˜‡õÍ”Ÿ2xTG,él27ø©ôк*‚�ã?*@ ¤ H:þÒÉ”˜u�Íž HÈÏ 1ñt»áéæt{4?{ßáüè�¤ÜsáÌ­§õW]ド¶ž‚lÜwñÑ͹ãƒWu»þ§ëõßàŽÐ´ƒ„àúzÚIû¸©þI¦œ+Ù ©ðLÇés)'ÃÔ$6ê²Ü³¹„…®±7š€AÛ yß^8™BÑE #œ’ ‘ÿŸò”8ÒiòwR©Sáñ–<ôèèxê“îäžx÷Ï‚<±»ŸÝ.Æn@ê~\¥o2¬­pÎ1[>»Ã;™Ø�¾oŽçØX^ºâ¥Þý&ÞeÏ’ŸÈ²–ª~d© k̰ wN­ú %Ü)šŒû7}§`ì§JKpo.p“¡GÉâ++2O�{.Fzi‰Ÿ1€–cıî&€;ø �Ç‹GZúÆ(à{JbéÜí²çÄ{ûÜÑÌá �Ká¸æ@ºn‹n»� Ãõårù;ç/\xí¹[o­I²F�5>ÎãG¾ì? ?üÅ?õNöÃ+gÇod�këÍ1R !í’³ä.s¥ãe|¨}µ®à3¨)Æ9%ä4À¤×/þ±_°Ô$@é"d¥Pižãs2K.¿û…š²ò¤eWŒ�aùÒ,Jó�ÂaX»o–>¢dB§±ït ÅCì :D©‘Åq€@­DµŽÜËý~ISþ%¦6Ò,ÿΕ(tÈÖ¼²‘©$Å!lßBrÏ+Ò½y÷Œ{³Qøo³;…ĸY5«w ¿ö‰·=ù /øÖÚüר€�A¼äÛŸÅçý�O»�€÷®î î¶'"2ä|XßÑaþ�“Š£Ÿ'øT$ÉLˆ—‚e�Î7Š�2×¾¤[�¤ŸîÉ> *rÞiÛóÕDÝë£$‚¾C”î=Èã})¤yÒôPטü¿2Jñ)†-O/œä�cÅç!ƒæ’A5ô³$­ËäéÐs�@;daÂÙf8½@$ÐYç¢à¢™ ÅJƒññÈøº4@ #HwÔk”òt� ó!¯ œ¿1Ìê90›I <Ø‘^×Át�»1Œ³;½vÛ~¹X\ì‡ø[«ÃÃ×…úú‹®Q£F�""çŽ÷ž£å-ÿŸ°}]ßõ\o7#Ù„V�Kå ÂóY >"ŠÒ€ªÐRBÊ–â$xQº—®Á‰õmÝ­JFˆÄìëCÝ™dv"TÉocBÎæNF¢vGIö.{ÔûF] �RÍ’µ„‘íÔƒ›RÚÇ“äû`ÇžÀ¹õÍäHêQˆã?Rx©· ûC嘪¾L-0Usp«QÂè¦Ç ÊE¹ÂT‘hQ‘% Ps”�ĽÊB®¹FŒéø\�çüŸD˜…‹¼@v:'éÄ#¥ë;n6kÎeñ®ÛoÕáüà}ÿÛçþȦþŠk|(Q)5>äÂm‹Ÿçf{9|UßíB‹ ë)Q÷4°<ýÌX•MQÈÝŠÃ�;¯{Çb3Fy�PÏÐ,R+:`[zßêûþòY“½I0½¶a>Òo·QØàftWaÒ uÛËÇk£÷¬ÉgÙWÄe)1mV,L„öè,œµž�4f!š…ƒby�SJ…M°‡LÍ?aÏc9.·Ï—'E¶Àoûóz/e�°Ó ¹zš8*  )ýv‹~s*!ö÷,�ŸBxã¯~Û§®ë¯¸F�5jäxÜ-w_zèÊÅß?XNèšgžÞ89‚«Ø „±ïŽ®×§Š÷çÔ†)¾¤ä›fhUC:1ïyãê$ñzùR2åÌ\ b/çaô�4? ôÚĹPó:‚^Óßï ü€Í<Ê.Pì:©/ÄzÇá'‚ ±t/ë cîÉüÑ ®ö@a©`äÒñº!5êÆÓ(éÎPT0damWÃÞŒqa$�Bžyüô;“ÑZ;'««áxºÚf&Ûn‡õú­„¾^»š­^4kfÕ_p�5* Æ‡¯þ¿¾ôÊv³yY�ø»³ ôÛÍ0ô€ =5Šÿ÷sbîë’©* NS#î=ëw_5wø2¥s©fޏ?U‘Ï¢O“gZªT"–Íäé½}KOÜLy@&©ÉÕó#05M¢ úpÂE è»-Jò¡f ˆ‚bÀ¬6IGJ@8 �ìN¯GÄáFÛàÕÇg�žÇîºXÁ5jÔ¨QÃÇ?~ö?Û�ì®Ýw´:þÃe{ðGývØl6ìv]r£ Žd6aŸk´,Šbß‘wÜâùùR6ÿ(,�ŠæœXyk\_rx³žq÷ÂTP©âï$cBS/‹£Rh°(ßlÿíÌŽob¢< n0¿bÃW)í•áëÄ‚èlj�Ó8°C·…-²´ŠžÔEÓOqv ¥Œ¿6þ±ï`¯bšÒP:*9Gì'[H_aeÜul7'»ƒvõžY;{åÕÍ•WýÈ—ÿÌ�ú ®ñ¡FEÔø3ʳ«žrðÆÍºûí+×Ö_Ñ7ííí|1 „Œ"Œ°-tfè�€ó÷èpÞHÞ&¬p2âV¿i*³ œ¿ÝæMiá—è:’MÿT¨¹™Ì£HšËèîàÑ¥¯„zÎ^ùËó�¼F§iö hÝÅ„făÐʺC‚Ñîo‘eflÆ gok Ý ³ÇÎ_K§à@‰ªû�Í D<1IúèŒ]tÆÅ öG·*È"…*PÕ×Aýy²€a.ˆÆô$„q±0lסÛÜØ­o^.¯Ê{^ô�O«Ûÿ5jÔ¨±]ÜmWóƒÅ8ô«ÅÁ“ºa÷Ô“õihxŽ¡Ío¤"E’†(´='@@ ‘s4ð[ÖÈ…DAI4ÌF²ÐÍãhƒ£z¾xçvØÖf{΢”‚@, v¹ÈˆBŽPöÔcÓy"�ØÒ+ú:ÿTé-aìmÓªFk/x€ 8ð@„QG¿XRú�é¡Ñà›ï FÁÉü¡,ÆÆCbþ˜¥ ¢*2�6Ey»àf´ Çr"£‚ Ùâü ‚M‡ÞWs)*’QØ„VÆuwCÖÛ-<|f~þçÏ¿¦†Jg¬Q5þüb±\±�µo컫/]ÌðŒ¡ßÝÒm6˜¯‰CT’41S)úûRD_ödô¼ ¬¢}€×¢_l‹÷c…#¶;_¿¦†1¾ Ÿoƒd¸¡C�Tg‰Èwp7°8Žºï”u¨©Ø×"îèõ‘4)„BíŠ|ÃDí^~xòdã(ëžwPœ�¼×@9 ¡¾¥ŽâMË×um¢>q È›Ò äì�HœC´ÞCB�Ýé úÍ:4"×ðk‹Õê·×'ë:%¯Q£F�7�ÿÕ/ ˆ\þŽ_þš×.g¿yéôáv»Ù>©kwqZ !``,Zí}¥7:¡?5÷<8µ—ó¢I—•Å7"®ìð¨¸w—L:ÄMÊ-¯9¼'f§Ëk©µÞÁMë5Ù—”‚4Xz SE=-òÔ`8“øÇɬ$Hjf®æbñ– dP·}ŒR9�¹P` 'ã«àQ2F!¦§úÕ=‹gJ!Éh '}4e�ð‰$NOo”Ýñêøþy»xùgÿ¶“íIýáÖ¨€~ñÿë_¥ˆ\üœ~É«–ËÙﭷÙn}ú¤fÖJhç"!Œ Rox(˜p˜téHzvÖ+RLX̰Gº¹ó0j€Œ0…^? ×e4œV¡ã¸é±YÓ:½@Çu(iüªÂcÚºË'�ÿJ*}¤ÛÛ'…[3X^´n;oô“1¡IëyöB–'àôü¦&¶«gŒN½!ÏC²Í#òìb`;tÍÿ¤€ßƒ¤óFŠAóÖA)(öSmIçÓ#‰}'ÛÓͰÛ]š·³W÷ÝðâßûGŸ÷¦ú«­Q£F�ÿµ¸ëö'>t²¾ñ“íÉãcãñÛÝ:„fÚÐJž9›nÙ«N­!çŠ.—êàntº$õô›hÿ�RU¹ ìOºpÅÇIÁ?×t[¸ÔÉDžNÙ(/ð]åÐÁÀŽÐ™\œ… wó+k?. lœ»p’5(ׄ—ƒ²‚åůrá6-03Z’Th¹¯ðˆ…ô+ÂÒ'bSÏ�—\(­,«aè·‰$ŒŒ²Ûm¥Ûö\¶‹w¾bë7ýïÏþ—W믵Ɵ5ª@�+VËÅ‹Ùü§DøR‰ÝfwrCb·•2°ß¹Þé½ÓPö#=L5L‰/SÜ‘¼U¯5éÁ'éc°™ç¼ÁãŒN?Î 5¾|Ÿ.dz^¬ÆHZÈ´ÉÈiùäÿ‰›L"¶éç«NHþˆ9~Ö˜Ïb¤H¤¿Æ"ÙÌæ Ûîäôú5‰]×·¿{t¸úÑsg�ßV©5jÔ¨QドÛ/Üq%2¾öÌÁ™×ŸYž½¸íÖÜî¶2DFf`j6Ë^¶)%•¹5uÙ”lt�l’mM¶×!²ÊMÒ0]g8Do0iég óZTw`ì~ãøȘj�äc”Š€”E“’/‘BFq˜A¨÷lÔ@úñ?òØ€ÍxKy¾ñt€‘Âhš÷LEJ¢ û:år/KeåDpÏÏâôùMxˆb"þú×”�@Џ'ýr‚ÀèR Îß*dP¨îJœh3#Gçf¼(Ó>©@ d$\5f�Ç8 #0_E†€¸éÖ¼¾¾Î9æë&¶/hÿCÛΨ¿ÔuPã/,^þ=_¼¹í¶ÛÞºZÎ_ºœ…—Ån{¥ÛlÂÐõcéÖ=þ'¦3½o¬À ¹Oµ÷³JŸ3Ýu£eúõ}Jj·+>1M¸p4ÁI³=fP  àëÿp¢ŠOïöj ³dÌÅìM°Ô“Í43sÿqv8y@g@x3šRß&#)í¦ÉüÄØZÿLÔÕP…V޽_)whŽƒ„cáAk™Ì1 µE;”DÒPïdk4¤œ•¥ÕrAâ0°Û¬Ãn}º™ÏÂ+�~ýÂm·üñßøÆ/¼V©5jÔ¨Qドoúÿ¯ž<üèÁâà7gmûâ¶ 7vݺYon€˜ýô¢ë�þï(qÜFŠÓýiìú”Û\­DSîÙ“N*õŠK}­š$Ûgq8„¨ôƒÌ)DÞN±mEšH>>¯ù«u�&m1ÓB:éçÉS\¡–\ËJƒV—‰ß¸8>ú ˆêlÕ‚ ™{ñ¸Q‹`&&kâR²üôt‚‚Ö½«pt)s<-ûh†ÅSõe¨½“SŒ°�Wâ@Dã ëîTN¶7š~Ø]YµG/>žŸ{ÙSfŸóŽýŠ_ÙÕ_j�'* Æ‡›Ý¦{Üã.¼æò¥«Çýµõ†nwÜcæ€�n'OOqÔå;�ƒ^tˆîùÞ‘Žþµk—U[¦3ZÞÍîx“nØá½œe!I^»Z4˜&âŸÖÚ¥‚@¡N ^/Ñ’¤’˜§äy*à÷›úÊÿá<ÑÈ‚N�…4m4r £Žá%­#ŠgјqŽí/FÄÃÄÒ¦Å`”…“  «Òu‘è&}·‘¸Ût-‡û_tËí·¾|†ß{'X¥5jÔ¨Qãƒ�ÛÏ>n8\½ædwi¹œ-Ÿrcsã³»ÍîlÓ†ØÎc‡™ìÙhí¦xò}i 'žáîÈy>»’š}jÕ—Sã”{�/Jìi%Â(Ì]& U±L+ƒ‰Ýaª· Ÿ ‚&kì—6J½Ì©?ƒû1YN8þD;€nÿSbKeÂî6Œ}7€ò”9AÀ€<ºM(¶˜4T¨:p¿ 7ÈIïògÙ1½�`àØŽþ�ô^}HjsdHÖ€žg“n£‡±tñ“©›Œ:ÁЀêØkÍS®3ÅK\,í{$š$aæBHNÙ°fØ|yܲ éy `o@=N0ê!‡Å¦Ä¸+D`¤�L\_?JWPgç%¤ ;Ú‰…KÜþÐ3 dü'†Ð0 D‰Cì7'l¥{ÿÙ£ƒ?œ¼ruöÌ»Ñ6Cý…Ö¨Q£F�%~èK’Ÿü´OÞÏÎýÉ™öü�5²x% ›õ ‡®“ �V‚"ÁhÄT¤† �ÔZÂ6#O/¡µ$ )É ŒjŤgSGõácÌ/L)tˆ¨Ô¿´ê·¹»Òß3� %ˆHð†ƒcŧßCøöœZ¬åÕ@oî7Ò²9‚­@²i³=�´«K�1çÃðy€¼>’=ûAUoÎ$ ’qŸÞÃ̦3ŒÃ@ t™ '0�:¨uFõ"+Ž<þ"½¯^Õñjƒ¹(N|džÆ~d؈Ä3ï½°¸ý•-foü+OûÌGþï/ý‰ºÔ¨Q5þrÄO}ÙQb|߬ Ï �WÛ~{Š¡ß)Á?§ ßqû& ™æµu¦•d2W.ÝäÍSÈ*w•ÀySÞi¶[Zè–r5‰&7©WÚ¾1ì­çIîØãø·GilCK¬©p(FøHFP63k: )²`ÆíyøÊy¼*×nK´dç‘.q—’ÎÑVëó½‘ÉDßPq™A‘&)Š�L£³žûqØí¤»q cß„ð§óyû‹mÞúü¯}B÷Òoûôš(kÔ¨Q£Æ‡_}Ûÿ§ßòôGÏ/nýÃ3ó3/=šý‘DÙuý&ôÃŽAõçÐMÍ|uÑk¨þ�k¤ÅÄ‘Ôp„ù%©�40�� LyŒ¹‰žÖ&æm? ðpý´(Ö¦º”v¸>Û¼ú¼) �Þ`Eˆ«wlàï*µbkîUšKÂ¥G,r*-Í=r&éÖRT@(k1ïä÷ìB¿Ùñ/mnã$F/‹ ‡bE¤w·×1ý) Œ¾ˆ»n‹Ýn#«vucÕ¬þ`ÕüJ#Í}_úøo©5M��H4õÔøHŽ¿õ3»ÛŸó�÷äLÀÇÇ¡»+4m’t÷·Ýý9}.¢ÕºÔ j)Ö<'± hsj{Å~ÙÔ›y›LoJWº½ä,›ˆé£6-‚~ú˜ÓÉ�ñá,OgPüQÃëêjjC‚Äyl] 2ôt|hîFù>éŒäŠB-‰PžPLœö È�å�F¬¶àÍìÕ—:™ö¢¸Œ(R»L”²Îq•pºÊaÔ+zé×7Bwzc=oÃÛÙì—‡Èç½êŸ|qåýרQ£F�+^ðÿþ6¿àž¾9^žBúŸ<°?&bhÛ¹• ù¢ò}®Î¯Ø…ëäVIX³kØöIº-“fP¼$<=pºyÀ”Áh8 ý{oÏÅÔÓ/Ï ŒÆà^eüœQ´òò'æ/œýÄEQŸ•7ÿœú?9kÁ¢xò5azõ,wà‹%º‚,—_åõBéH]ÌNP˜%¢°qvÆVp×PËEŒÃÕ‹@ú¡Ãf»±ï¯/Ž_½œ-~!Jü�óÕ¿¸©¿È©¨€Ñøãxn'À¯Cø¯Zðé¶ý°]�x°&äô‘nƒe‚ìûfÈvGÍ2)@h/êÄÕÙÓÒ:mŒýÈA zºrNX”šs.KຄÑóò…ÌæÙ\8ÿW*$½YÁ,¯Cjâφ4ù˜àÖâôp‚�ÊmqîÞ Eú&‚ æ:#?gÌÂ6… SZ$&Y�œÊá¤�¾98*DÎÎÝè©�Ó>4éÔˆáŸÎm+Iv…¡‰hC„Dno\ýî4Ζ|�4ñGÂÏŸl‡uý%Ö¨Q£F��D ‰Ãr6»g6[ýÖ™Õ…W¶²|°Ûuèú�dÓ´‚ªÅ+<Žn?Ÿµ…š� ¢P†„�OÚ÷ÂB:(7›a¤Dº´›épÆcôªrðªûŠßøÅ¹øÜ­d�B’9Õ_tÔxªÕ_@ЖT0&Ì�ˆ¡ñ½¬r.¢èéõ()�~ú :óYôünzakût®Lœqß‹©ð8T¹ao ž V‡ÒÆ*ã+FoG-’ý!ŠÊ2sYó©f¢¬‚‘ƒœ¬¯BÈn5?ºG ÿ¦ íKüoýJW‰5>¢÷µz j<ñÙ?ø’Û"åë·Ýðu=fŸÛžA˜ÏÇïÜà0õfJ uºåäîé¼S‹o, ¨–1Wpž®²'ÔWhÅó�ÿ@? À龿þÆÏ}÷ÞXoø9å¨bŽiïN~ÞEÝYêíûK{ˆ-„�óiZÎ-Û«äË|Ú«Xì´~&OþòÓ¸¾þâ%HÖÇi›É¢‡†=™f›3�!E–nò ½t—’fŽ� ,Ï=诔b8´Ž»KÓ¨Ñ8è8ApܳÛ+6þ /ÚðlNrHE¥]‚8ér%„¦i´^×maåÝóbë]¶sÙŸOæ·óððØÿ&+‹…sî#[Û³7ÌæÕë-Ô÷׫#©WKUq®�!ž5>Èššˆ³”y›õ¿ëCÌ¢ "$ÕŒµtù\[³þ9›`]R@ÐÑBÒýɬJ?.ª:̇•B¨C‡›‰™9-Ò²žuÜ ½^Ý'f,½Í°^ïß4¦åZ~Â�•še {4ªÅ‰C^ÐX»n} ¿åg Ãq�eI»CCžÅÝC¿¿Ò¸à÷K¼eµ�ñS�8s9Vïk@a1ÕÙ ƒ úE}ØGu7ý1îÉú¬€þ˜cè³Lƒ†ÒqD¼÷±ÚO 6Ú=û/m‘ ÝƦËêÓ’\¿g³ô…²~«f¡¯H5Ë®dÒpjÉ·Z–]F Ç ÷›¶1ôxØÄ1'fÂryh«åB$¸û÷§ÇÿðØÖ‰7•Ey묚2ÉïhÀÃæÅ¿ú�‹ÃÅ5Ëåú›×Mxq+îªjº%ådÔ9 ýR7Ž_MùËÊ4{ÖQ=[þ]­Y|Üpv0ðjy?d ô�0ñ_óê;7¼“,77oŽ�eh£t‚á|}hÇ×<5 Õ¨ ïÒÓ¶Žâlûš2˲vuô uã`>n1d#G8¾S†ä-Yï�Æ´sù4Üxž2[tkµåÙ¶åeÿ+vêÅe<Å'tÆuE!f||½6«W^­½©*ä�v¶çô¼k_pë¯_·ÕòSx¤üöû~©üàýïý¬£öà¥GõÁ7Õaý)ÕfÕܪbÒ]iwÍ–ÖeËÊûUò»ì "nØ2tyuÈôÉþ6ž,5_¼Sº �VýQÔO¶ko†ÇúY×ß›ˆépi˜Ý hžÅ4<º[þ #†6j4¯”ýFV«�ö,–oÒFIC|ˆ×Qɧ¥´€|ÌB>è ô¡ .}MÌR>”¥]Õ¨V2«d°‡È?بØüR;3)DBh­©kmÖµ6¹}^ì¾mo¾ÿÚã;Çnü™ë~í ?Ux8| ðp¹óM¿±|æ7üà™Ùtz¾^¯gM³¾ÌûvKUʲ,C?%7>ö‹Äg—GÆ9øùH™¸ø©ºlô\¾Ê¥,[Í‚a²ƒæü¡¾ËÎIcï†W£Ym�æYõ±b> Ïë–8§YƒB_u¦±úM³ðŠòR>¯‹Ós‡ES³ñ}£DćÇV»¬ÊM5ÅÙô¥þq8Pþ¾óÞþ�Ç“Í&-ªj~í Ù¯F_Zµa&²j><@UÓ߆S'®ÿ‚‡¶¶¶^[//”NnžNª×^zbÿ÷/=yü¯úÆ'óðxD½á7ß®ÿ¾¯<_hygêYá‰Ëõb§ ¾QQ§âœ3uY¶P¶8æ‘áÑYSô‘K èh¯ldèwc†³ƒÍCþ³ÈxTOºHÅiV®¯šOº×ÍÝOÜ‚ #{ò‰@y{�¥�•jöö–mFã FÁMãÂþøÀ {²>äY³ó�>Üoü©æÌÚÅñ�u3»ãø$~¾qsGCé¸i5;œq}§§ó¾Õu½Öz½^:_ܱSíýéeû—ÿá´š½ÿç^ü$þãaÃ<¬ªÉä ©ë÷ílÍšÒÉÁábõR¿”ÏhMm2Ÿ›©SS˦­¦¾�õö‹‚Å›þ¾�Íõåe:*)Ó®iÝF'Ò£Gþ¡m•—e¹hšÛ¿}dÛÅêgÿ–ߥg!ÿš öÓdÍæd‡bqaZ•,«Æ“4÷FÒò¤ù,�ÑꜿYw50¬´!•ò廉þsÌ�í-Ï2ÈÚ#Ìò#Ó~EY¨Ÿ¥VCÍ uû U3“ ÎÔ¹ >˜¯WR¯�´²öülªïÑW˜è»f³é™?úΫ~’�—î=¡^µË{fåü7›ºùø¶Ê�\XÏthÓK%¦ù]@|ª×üâßbõû°‰PžÍ5åôõ{!.²¿lŸ“M%NÁùÙ/ÔRÅ~…¤CuƒØ8Ù8å@¹þö%M#ÎcŽ$ö]æÃœÒÃ(ø/;€�Ñôg1š1îÚ4 M�=lîÄò‘†.~å‡Á‹'1Jè#�3U3ßx;¼p ¾m¥ÒêÎÝéîÞŸí¿£tåÝeYò“„‡-xD|ݯðØùs®><:ú†º•¯6W>§šÍM«i0Whè@]ªÇÒÑTûÔ§ÞÿWn°ã ?ÍÃú»�ºl8Küýlª@–í?:›7Û8o¿x¦o¾ˆYžNÓGêIj”eÔ§ýoèF\o¼O7Ëûûe¼n¦ÅIÄe3üâêuÑ»ä£ü\³Ña‹o–ÇÞJ –ôŽâpÜ!˜ÑâÍB L':®ïùÁ{k×Kõ«¥–ÎêªÐ?ŸUö»e!oy÷O¼ä4?9€G«òš¯{ÊÒ/®_4«—¶Ò\«U;›Mg6�l…²˜¸.p'HÊßÉÇÔ‰†`Ù&Á 'ó2NÅ×ѳsßp/©ø>FÒ5ùfHc3e< èTãÞ"í¥Í—eÛ€4ßwøFôCØòð¦uñ)×(�FÎË û³” Ù6ÃFÇñ«ÒÉÂð%‘l>³ÓÑ °‹G0Å«•,ù¡�º÷âòO0›�CTƒ8±¦^K½Z¹vU{Ü{gåüõ—î\öƯ}þKîzÉß˨?<ìhÀ#â¶ÿñk«g^ÿ}§gÓÉ}MÛVÞû'úvL´RWX¬ì’Í*}��³ªyh|*sï. m8(ïËÏÓ·íÙ`Öø/ïX–&ÙØ®‡O³W24’ ãð†á¶:šr/Wo•“éÅíb©øÞÒ¹µf+ršR£Ãø^@ÐÔm§1Ä_TÂß°Ê�:Ôb²B^˜Ð7dÄU-è�_ÈôËÑýE_)¡’7t¨æ¡‰iU5U5ó&íz¥~½l‹Ðœ™O§™Lf¯)þÛ_ýä‹.ðSx4ûÀko»ðüoyæG·¦[®*ªÞûÒ‡¦2 eY–Y'¿ ti=MÆÒOдðw£àŸØø—ö5iBPV˜7·§-O_3`Àã¡ n–âh»4*8¬šô7†¯!ÿ`’Ÿd Ó†ÆÛ»8‹i¨��q¿v•žÃÖ#hw”ç =›.5‘n¼ÿüY>¶3ÿI/ÑbCeø4tXZÞxÙeL«æ–»(ßÖZ¯W®­›£‰VÚžì¾êª“ÏxÍɽ“÷}ûgÿ$ÿxDЀGÌt:YÔusËö|ö_‹¢>½jÛïöíêADÊÙÜ\áÔºxz“lÌ|zÎ4‹�ô]1Üh.«eEùQq_ÿn’¥ÚÅÑ/éD ¯ïÎÖ->a§nú¸ÐäOê"!0}x¹¨ ÚhzΰÀ¤é³¦£ýõcš�ƒX,Ù�16Ãkï[$¤ÆÃ´ôiö%̦ ™é=}GC˜Ê â �t‘eûЉX—sÔ}¤àŠ"´u£õâÈ…fm³RïÛÚÞz·jñfî)æ$â¶·÷ËåáëvgûwîÎ�_nqêE‹Õ…«‚¿ óù–Mʉxß�9J‘÷fñ9»;D×a]Öì^ßò-ÐèÁÚò*¼î]g|©{^Søž¥HÀ´�¶Tq‚�ŽŽ÷cYÜ5ñIv=0ºùïoæ-=n[Ühõùûý§hiãaùcxìzè¶„éFÓD&‹ÛŒ” Ü?’�j8S^q¬Ínll8|ب*T³-—ª˜:F[.SçÄ©/^›v¥«Å¡Vúùdë£ìßêþòØö±s?ôÅ¿@–1´à÷M¿{ÛìÔ©ûŸ~´Xüõwßà¥x¾›LKWMÌ…uùºA8é»¶¯»h€ärééVU7NÃÓ�®Ü‡'W±0œÑKz&Î?Èx­..[�dtÖ�=ÇÇ%ÆûkZ’»ßuéCYº·ÏÂqÕ¤!ß^†Â~‹ùÿY Á0moXú²Ãê¸OHÁ¹éá?Þ Ä’{ˆØÛaS¡£,ƒ,ŒHÌ©Æ)�fÁÚ¦¶fµšH³^M yßl6yç|kþβ*ÿêÏ~àó Å<æ¼ìÝ?²{¸<¸æô…S_~¸>{]Ž^àJ·UMfmUÍÄ©ë§âÚ0H§[V7ççuóÙ“zõwY׺ÚÅ»}Mã‹Ò À¬£_7ž ²êÅ8)/{HÏ*GmþCkÿF†¶ñêG ¡ú}‹à¸XÒRm‚È0N1Ž?’¬Tsœ„¤rQÇ„ÆNéóøè¸·KýéÇhô€Å®H‰CUUÌ9í&'‡>*Ù9'¡ AÖõ²lëÚŠàÎZ¾«,«×iáÞø;ÿèÍgùéÀ#�<âþú�þcûìëÿéùªªîZ×­÷ÁNúàwÄlªâœ:'ÙhXÓa¢Ëh‘þí­š5¤©Žëå!zéÆ e6W@c>}}ë²®„ñ<‰‡æ’ÝòÇ^ƒ�r½|t^vÛ/KùK�ãõdT·—Ÿ³ÿã°ßøŸ ›ewCo–T›•ôÇ]Äœ¨ãy¼²91ad(éa— Nòk�îKêœö‡ AB[k³8’P¯Î–ÎnÜßÙúïÇ�ï½AÌ>ðg?x킟ÀcÑÛë¯ê~çó?ylëø=æm±®—'Ú¶Ýo}˜IÑM¼QGýeÁñÏÒ5U�~±L?ËþÓ¸'±X3èF7©OÓ‘þÞ5ß9hvà0ÊÔ�Aù›»|³ËåóíRö*¬/é�ïfœõŸ¶.}7¢eýqˆb×ð˜5?äM�q@êˆ ù뉟Ê8“PÓH%Ëú0†Ý�Šº,ù¿ßªóº®WÚ¬×KõúÉ­jïý³jë•&öºßù¦7ñ“€Þç¼ôG‚÷¶X,×·›ÈÇœÓ+BÛžl›ºRqÎN ç†ûh éá^cš�Žžžó5­»ÿNÉvšþd–Æ×�´Ó´æ +K¾®hh›õ§‰ÈøCk�ŒÊü$o!–Õ8?ÆÔŨÜ<ˆV³Â:µÑ/-Q&ºy"\>µFc{¡dUÙÁx·\ö Ú0Àeg#ÙK³l½Ö¸”Z6ŸÑ¹þá¿NÍû¦•zy¨õò0Tަeñ'óéä—çóÉ»æ[óOþé÷^ÍOà±ì¯ü@øšïý²£º©ïQ+o)d²§Á]¹XÞVÎ9ÑÂêº$¾�Öò>2@­ÏÄ·ü±¼ßÑHž•Ÿ."†"ú!Š'ßÙ dý :M4? È2ò³¡wNe”�í¾LG»×–zòŽzMS óªû¸‘Ñá‰Wé5õcR*Ñð…H!IýM¾ŽÓes´’ËZ'óC–þ™ÞÒ´ä˜\”MÿsΉ+œH|ݬd¹8R¿nÛ™›ß¼7=öÆÂ•¿¥êÞû_¾éM<üãQƒ<ê<ïeïØ÷ÞUðíK,ØqW¹ÉtZMf¡(«®B.×—�åA7ºY&£½¸Fö=^¦š•ȧwƒûþ€XI¯Á:i‰”T¡f£ß¶|mܘ  2nkÈøfcÆf¶ñ³{QÃE“Ư'þb4×6åäMY2pÖû—Å ˆÚÆ×[%Î&ênúÕ9Q§‚‰ùÖÄךui¾yÐIøh¡òžª(Þòä'_þž?þžçrëxÜyÙÛ~t÷îïøÂU»üúÆê¯®eñV4“Édje9ÕÂU] ½ ‰–ž\ƒtï1Â?FäYœw<ªˆL—<.`”}?4ömŒíLÒ6)Ë!ÌZ-î ²iÈÝ–%¤’{³ '£Çõ,Æè¢‡Í"/J2 ݈÷9}þ(óÙâ§à²‰~i¤`_GiquJ,°Ñ$ªa{×ÿ—S§ªeÑ�Î´ÖØªYj[·Îy°´êí[ÕÎ;÷æû7LËÉM?ÿ5¯\ñ€G*ð¨ó©·ÿöúò×­óé䔊h»^U!„-™;×WÕë…ßÿÿ(l6õsÅ òì.<żêhFmi‹¾†Î¯xzÞåæ…ð±\>;š4 ç—¼Èo<Ô0+Ÿ‹•uH—�!ˆ/76¤†Ý|èOÏó¦ã»l,n¶qPµf/Ùbñ]W… ãC†>z 9Nc= ™‰oñõR}½lÄ×÷L wÃîÎöO§Ó?¸á§®»ñÖ7þjÃw?àñè ¾õ³›ÿð�¿ÿ±/ýŽçß=­fÇ}+“¦©«6¬gÁÄ©RNT]6 @²u5ÑT‹.’ͲÏgôŒž±û¦ùôH캪‚¼Z`ãÎ_âf(mn†ÂDK;˜Qü`ÖØËç³â@¶Y§æ'£�JjÈ�û’‹Û†¦Õ‹sýÕ†YHH,Õ¬Áâ‡Ió£M/š>¥é`B�¨ª8±àC+u½¶åjµ6/Ÿœèô�ûóKûäþåoi}}Ç/~Ý«ØÛàQ‡ )„ö³ëö¥M°ëÕÛE5•b23WTýÜÜÐ?bÆÞµ°× ¥Œnõ”¬e.> [ÖF'¢n8€·ñ] ùÙ· géæÛº�Þ—Æ Y5é†ò‰˜S ýí,…Ù˜¦ÅõÙ]{^ Ã¶Úp`&&bÅ¿m'ä§19ÈòÕVl¸ñ×QñDìâì >‹0�þS§ÚmbDÍûÆÚf-¡©¥�ªBîª }å´,Þ^å�eY>øÿì,�€Ç½~÷Í,„+DôÚU{øU‡Íé¯^µ‹“âœÍ·w¤*§Aµ ¢Ö%‰õ)¯ï£ú‡@#%üMë£Jù8ñ×ÒÝDÜït ·mnö]ºÏ…‡ã~íBò‡øþn�Õ× „%?‡˜^Øm34ëˆSúlxÍf"bÅ“zQ°`¾“I{;íæðÙø�™åiÌñ@ ;NÉJ?ãh@‰Ž» Ž™‰­ùP‡¦iļ®&ÅÖ�*î5æë×›ŸüäS.½òè'¿øåŒùÀßÕ/Üoúçoüà±{î}às×�Iኯêž´Ø)Љ¹ª-‹þQÙR4k|çF•ô6NÑ&ÑÅQ·i=P—=‡,y6åß[:G°øhœÏLI9éàa8t±üL‡Ù|j:ÊljÅhq¹Ö»áÃ¥DÀô�.£�?‹Ukf£0À)¼Q÷××ÃegY.ïðŽ5Ä"Å~uÕÔ/LCðÚV,xQµ¦rr§S»Q-¼{{>û³Ë/Âí¯ûÖ§Qø´ó3oý‘ËÏ-xÞùå_܆ú+¼úÏö¥Ÿ«+¥tUÉ1Ú´X�úm‡Ë:éSã½dÛ‘˜<<4 äÛÿÔÄgÙ`ã4±(ÛP £–ó|ÀÔû80ˆK» É*4ŸL4~üØ($uˆh—gœ2⓼ˆ¸4ìxtD‘íË.šï”ÞTmc�“�¾|Cui c“`ÞZi½Wï[ f­ Å_2y落ÝX“?ÿÍo|ýGùîÆ£]É—�f?þDµÿÇ÷žûÐÏ|ÕÛ®ù×v›ˆ¬êõ—6õúi¦Íå…M·œNÕ¥8u–5Å¥�÷Ë\ºËïÊ5¯~ïšáFmñ©WÎDÆ'Æ.½£î®<ËóëwÒ*“>Ši<�èÈÚ(†¶�5ì˲õPò3ólÎÞñÛŸL«¤Q‰]YŸÅBÛ˜t8ÇK<·,]°?tσ|úÓûìK6Ì=pOîM%H0“Ð6ÚÖk±¶nœs§ËÙôö­íÙ Óiõ¿êÕú]îºgõ—ÿü �ïpÀ§££zyÿ±é%§çåìËö܃˰<•ák*}‘fÿ¸ïœ »2 ^‚ñæ�÷�… K3wVMî�•;o¾dvòM"òÑ_úÚß½Àw6 ¨ÀcÆç¿ì�Uþ …ú§xï?¿öö­¸gWL‹²ÔÉd*e9Õ ªÁúçä`¦f¡7ëúGX“8„Æœ��÷‡W‹ò„+¦¢e%ê +œ NÕ™™x b$˜Š…Ô•&"º(™nÑ ñç"5à§[ïTñ¶y¤<<Õ›�ª6îÝS!šåçè—¯˜Ñ×ßͧù±í?]h6ëpXä†SóXËgùbœ\týnùÚ.¡_úµŸ„Ó¿Â>x'ƆàÌ›…VBÛ¡iT̼†ðQ'þ=eán/œ{÷U—Uõêﻎ…€‡ðòwü«Éùå©§žYÜó9«æðÚ öüÖ­ž\{‰s•©+Lµ´¢¨ÚB�‘"ˆŠë÷.£gjMwš62jyòðhØPL”?'[êïÏsŠcs¢ ¹À±e ïH´a^³éæþh\å8jÌ4IC -u@j:IÈ‚ã$µÑ}F×*!1AãN»€‚lSw?œ3ß�¨3 Ú¶�¶m­mÛH!“u¥Õm&õ[·«cÚß:yóîtïÆŸ¾î——|÷‚àaðe¿ðv]4Vloo_¹Z¯¿äðhñõm�g‹+�»²:Q”eUU(‹JEU‚˜˜vwîÁT$˜YLk&.®a˜ùš ±Ok]º\�÷íCb_w&oãº�Çê.˜6 ’ 9:šÆèZW&0 ˆ±„1|'Î%�¾JAÕbS¾ ‚ª&¦ùàZÍg#¦ú¯úY ð�ÙÛ¿ˆá•ˆ†ÖÌךZCÛª÷§Ë¢85�ToÝÛÛ~]áôc·Ýq×Á�ÿᥔûðñÿó{Ü�§_eWï}Ãg _{auúË—þàêPÈeVØž+Š¢,gMUNU‹`…JÐø”�=¼ç¡C¡`bæt¨^Ìî&lŠ77i¢‘¦”Áîh^­˜fÅœâáTÀRe£å³ ,•Z Î6G)›˜ªöÙI]ád6Ȩ;HcB÷¢Í™ä“ SôAêŸyg¦x3ïƒkÛ•kš:ø6:q÷ïN�Ý»;Ù}�‰½âW®í]?ú?¿ÓýÒ×¼’‹ p<ܾò?}`zxx´wáðèÒÙdz�‰¼hU×/nƒ=I´(\9ѲšXYUâ §¢Nƒ©º¨º¾1¿{tV�ÿ̺+𸚆aýÉ2wTSy|ú‘ÒÑ ½Øÿ&Yd^„“Fë¤LÞ~Ø`_ˆoqJ®éh`ì2H¥)� Öß©õ û6z ªbt8Jè?£ ¦!&$¨ˆ‹gþªª‚ M+¾©E}#…µV8YW…{ß´,ÞÔ´þ}frÇ%—;sÙ“ž¸|å7>‰‡þ–~êO¾»ªýòĹÅ»æô¹E9ù–e{ð‚µ?z¢©åÔIY•"2'•ZŠÆFÆÐÍ©ÆõõqRQÜ=X,jù¥Ÿ ñ‰¹Ÿÿk1X`xG:ÕSÙÈPJÿXGó††IGYJ`ÿ2³¢Çál ¯é·<šhø3þËúQH–b† ËÖwIä'}w@7ÇOÕ‰S'Á‚kƒ‰ùº^K]¯� ³rë´ÜúßÎÜ«+7ùȤœKÄí»¢’¢,MŠÊÄæºø×þ²¿›xgbNû³´ÜdepÝÿ*)!/& ¦©T$»ßF‰²ùŸáÁÚdÜm0ôÞëF”oV]— Æ0[�u8§ÐìcÉÐÔ7 ÚT4¨JU'Ãx!“ Á$ïÌ7B(Ä‚ªy_I¸«rr“‰Ü<)‹îïmðÄ¥ÇîzõK¯ªùŽàÿÍ�ýÉw[·Ë/:XŸ¹jí—Ï*]õE^ë§¶Ú욢ZWT¡**qým—Г‡ zy�v·Fõ£ME·=Êfõ{Í꘼1ñò–IDATßb§dŸÏ?”3v[(Ëg%ÉxG’Rú5›=400³`±n2ˆ„t ‘�Qê¶4Nò6H³ >4·V½ï®} +–ÎÜ'$È “rvÛ|ºsóþtÿÝ?÷•¯¸OU¹ÐÀãSð¸Ñ¶þ”÷á/¦“ê]Ç�í>§®Û]8Z|YÝ4Om[Ì·Å%R´SWM´,œ¸Â‰ªS—¢bÍúö|íçï7ø:$Ëj:²ÎBÿLÕ4Ÿ+—Ę�ŸÂou4Ño”T›¯~âúÚ7(l´ÊI( NÌL³…¼?Îè7Ó‚»®<ß8¹÷gñLÍ5ïÅÚF¬]{1;«…ž®Jwn>)ß¿;Ÿý©Š¼ïö{O�Úٞɫ_z%qü°j—ç�ÈŸžØy›}Ó>ÓÿÀ…õÙÏkZÿduÅ~;æ‹õv(›¢t¥Z‰ºÒœ:sݤ¿Óê 7Ô7Gù©f·–½•‹#—7žó“Xl(¡k¤ªñðAGÛ£q` ©>Dl�Å‘CÖç(% w]35æŽÚ�¥<0³¼´¡ÖÆ/Õ‚´Ü�øð©i¹ûÉÝÙþ�[ÕÎnOv?zzùàÁªYyþñxB—¾úWß?_,VÇÎ/«êJ ò‚Õºýº î*-Š™¨ªâ\QŠVCp ëÖ¨Ð-N¡éblòå-–Û«ŒîeÈÒµX¯±à.Þëwï't‡ê¦Ýñ�m ¤Á¹²ññF§ݱú�Âëúãùþ K îÇ Ó³OEÕYߨßÕù©zñÁ·®õmÚF‚÷æÌBé¤. =[:÷®ª(þÄ›¿­(õSǶ·ÎnÍg¯ÿ®«=ßyüýøñ7}ÇlÕ.Ož]žÚž•»—ïÌö¯]5G/^´‡×,ýáNcMeªZ–¥TnjUQçºRw7äiËz-]ÄÇöü4 …¨Kû‡x‰?4'Žv'Ý–"ôõ”q×´9‹o;Ø¿Óþ©^,�$Иä/Zˆé�ñ¯ý™D_ª˜²ºÀ%qj…:sæLD¤•Öyk%´­5m­MÛ˜±ª(ý¬˜ŸžÓ÷¯¯)¤¸y:™œÙ›{ð©—^µøÇ×ü$—àx¬ù‡¿ó¡Ý³ž{ú¹s‹kDÝg”Uù$urµ÷þ*ì¤9§â*Ñbb®(ƒëúÆú´{ÑÐ7ÑÇè?“Ð h\=us;*ùÏŠÓ²i}ƒb ú7ü`ê0—@M³â‚®¦@-ž¦çS ]ÿ�‚qÒÏ2 i$Oœé3ä±àCW₈y±Ð:• …“•3¹]‚ÝÌn™LÊ ÓIyËþöÖ�Ï}ö³xù g,Œ<Ì^õá_™ÞýàÇŸvêð¾«Öçž±öË'±ç ŸÕX}ÂÄœv7¾(J+´�þ×êœS×ú†¾Æ¿œ·á`t“ž Óh¢¾´0v7v{•Jd1íï¡§kš·2)ð?¶`aªj¢ÅP°�¦¤´ ]g§3q]úqðæMBEk� Á‹z•¢vRÞíÌýµ‰ÿȬšÞ¿Umß¹79ñžŸ{É+à» �w´àqoµXzo7Î}øä¥û[Aäʶ ×-V«Ï_­ÖOu³oÒ—Âï[QUV”êœ-ŠX]fÝ仸ü.NDÂ(6ßâ1·“Íãèá;¥ÛËׇ¦!<ý�ùFg\> '�kYmÛp�ÕÍõo¯"âduÛ¿äÐ?ù›YÔ{/,Xðk Í¡X{®,ÝbZMœM«÷VEù–åª~ßѺ©'U!mëÃË_8£€GÀ·]ýCëŸ}Ûݲn×·œØ¾l[U®X5‹­ÚÅ—¬/Aɲa€Ù;…ï§Ã]HwÕÒÏK ±GÀºñF’�)æþIžŠÜU4˜y |�`A½Ô¼—B#" zÁYy~VÍÎìT»7íT;ïðÁ¿ãæso9ý´½/Òº]s©�O TàÓÊ÷¼é“ú‰OÜ?[­›cGGËïýñÙ´zZäË›&|YÓø'±¹:UQçĪE!â s®èƺ.EF³@Ýá˜À†i7ù£q¶6ZVe—~?eýõ‹XÚàL-v¨}|Ú—#d½C³�˧vu a¨ðrwCêÛZ}[k¨“L�kËÉäpVwOK½ÑûömmÛ~Ì•ÅÑ|:¹0�Tgßú×ðÀ£ËïÝüïõÎûnŸ^Xž=¶¨�öëƒù¼ÜzráÊk¼ùëV~ùŒÚ/�{iÊ6´E� Î•Z-‹J\QXéŠà´0Sçb¢¥Š|‹›Žø >ªAìn4² ~“‹7C199N8Òþ©X¤]:¿˜ëG§ÿ~œsÿRœõIÅfΛÞ·â}-MÛˆo}÷æNBáʦr³SóÉÎM…Vï1ï?Ôj^m�ÛŸìŸßžìœÿ—×ý2-Œàøtòõ¿{ËɳgÎ=k¹X=kµ\ŸP'O(«â }jìŠÖ䄨:U'ªNÄ9-DÔõÃfµûgãÁºÚ?µK^ûŸþ��O$•ÄÖçÆÈAë²m3ó?EôKå0×LB‘ÐN„ ¼øD̼S9(Õ>.!ÜB¸ËUÕéùlò©�yu×|6ýð›¾÷y”ÁðôËù/v8|ð©‡ëƒgÔ._ûÅ1UwÌiq…ˆ>=H¸Ò[»Ì«©‰S'Ú· ¨jPUÓ®‰ÀR‚‘±ûq¼ž �éjKMcˆ¿h–é7ìZ†þñ¦ûMíbˆu¸8±kþ­ßÚ˜™ˆ f,ˆ^Ä‚¨hë´8«¦“;BŠÈùI9}povâãÛ“½Û.™^öñŸxÑ¿=â;ŸÎhÀ§½z½~0{—ö—eYèÉKw/ÁžS×íç-Vë«}]_‚ÍTu¦®ØçöDŠ-­L´çD\_gßwÊ¥Â}'}…ݰÈÙ¨ÃÍâ`SÍ“þ»9»yw·êõ'èÃÜ`C€Ýxñ°Þ$8‘ÖIXYç}Û5M½6“¶,ªU5›�ÚÞžß4ŸOn˜rS]×gGû">íQl¸þ·oªV‹õöjÝì-WÛ«º™OœnÏgÓ'…{fëí Û¦ýMÓ\âƒß1±ÒDú©ND\ÿ(_¨ºRÔip…ëæÏ‰¸êº} Cú~PuÚOÈ�ÏûýdB5 ±ƒ@�ˆZæM|ëÕBpÁ{ Ö�Í‹wª�snµ5›œÞžMîpNß[7í‡Ï.?¹¬Û•+*?›ÍëÝÝí£í�ÙÁ‰½­ÃÿúÍŸÙò·ÀãÓÏ¿û§ªU{°½lw�ÖvŽVÕQ} !øò’ÙÉ+'nò¼6„ç5¾¾Ò»æ«ü¼ MU·M‚/CèîùM‚Hè®øU qΙërøLÕ™S'¦]-AŸg¬ý`% ÔÌ‚ŠXU¨sâ¬?Ð æ|Òúâdâ.›À )|éŠuUL'ÅüS•Îowânm|}냋Sw,üÁb{²k;³Ýõö|÷àØö±ƒy±·ºêò«Ûo¾ò;yè8þn~öµûÐGnÛ?\¬ž´X¬þÁzµzb½^ï6¾™‰ØÄ©ÎÔéŽÓâ¸hy‰ˆ\b¢ÇMtÇ›U¦ZЍ³`n¸ïúãb›?èÏÒˆ\')c°;{¢œJíT—Nô‚;cÁŸÞŸ1 >„3;rEQïmÏö÷¶>5›–·ooMîyÕ·}öþ6@îåñƒ'.,?óh½üŒU³¼¬–ÕN˜´“Ú¯«¦ñs'ž“ò¸ZqRÄ.Áï 3/aª"¥¨"Á‰'}pò0o¨+âïºú­‹LöNÄJ-ÔÕ¢Qu�ˆ®Åô0˜œÑ3&v&˜?¬½ –•+›i¹µšOvÎoUû÷o[÷m—óû~ô…ÿîSü {´ ?ýy“pýoÜxÎûpÞÌn6ëZÞœ:=yâøt:­öÕÉå­—+oÏð¾}fÛ¶W6mû„¦ »msó61ï]¦ÝA€8×™›ïùû^·ÐÍÅÑBÄ©8UsªÞ9 ¢L´ç–å¤:=›Nî™”å­eQÜâ w‡ªÞk!ÜêÔéó‹ºé†š˜fËUË 8¸ÈQ½8ëƒ?gn2³!@�UO(v·vwJW<)˜=µñí³›¶ùœÚ×OY‡õñÚ7;!ø¹I˜zk+“VûAGÝ�Fw»ÑýŸ¨8sÖík$8óæÔyçªUYLK-ÏR>P“O”®º½Ðêv'î.½÷Þ~κ¾ fB°V[[6Kö6<2žþìg)_À£Îÿ’!ü1ŒÜÊIEND®B`‚mergerfs-2.42.0/mkdocs/docs/media_and_publicity.md0000644000000000000000000002262315177346257020654 0ustar rootroot# Media and Publicity ## Tutorials / Articles * 2016-02-02 - [Linuxserver.io: The Perfect Media Server 2016](https://blog.linuxserver.io/2016/02/02/the-perfect-media-server-2016/) * 2016-08-31 - [ZackReed.me: Mergerfs – another good option to pool your SnapRAID disks](https://zackreed.me/mergerfs-another-good-option-to-pool-your-snapraid-disks/) * 2016-11-06 - [Linuxserver.io: Revisiting the HP ProLiant Gen8 G1610T Microserver](https://blog.linuxserver.io/2016/11/06/revisiting-the-hp-proliant-gen8-g1610t-microserver/) * 2017-01-17 - [Setting up mergerfs on JBOD's (or a poor mans storage array)](http://corywestropp.com/develop/articles/setting-up-mergerfs/) * 2017-06-24 - [Linuxserver.io: The Perfect Media Server 2017](https://blog.linuxserver.io/2017/06/24/the-perfect-media-server-2017/) * 2018-02-19 - [Teknophiles: Disk Pooling in Linux with mergerFS](https://web.archive.org/web/20210324184857/https://www.teknophiles.com/2018/02/19/disk-pooling-in-linux-with-mergerfs/) * 2018-02-20 - [Fortes.com: Using Rclone and MergerFS together across drives](https://fortes.com/2018/rclone-and-mergerfs/) * 2019-02-10 - [Medium: Migrating from ZFS to MergerFS and SnapRAID at home](https://medium.com/@pascal.brokmeier/migrating-from-zfs-to-mergerfs-and-snapraid-at-home-89c45fd5db02) * 2019-04-24 - [MichaelXander.com: DIY NAS with OMV, SnapRAID, MergerFS, and Disk Encryption](https://michaelxander.com/diy-nas/) * 2019-07-16 - [Linuxserver.io: The Perfect Media Server - 2019 Edition](https://blog.linuxserver.io/2019/07/16/perfect-media-server-2019/) * 2019-09-10 - [Rclone VFS and MergerFS Setup](https://docs.usbx.me/books/rclone/page/rclone-vfs-and-mergerfs-setup) * 2019-12-20 - [NetworkShinobi.com: SnapRAID and MergerFS on OpenMediaVault](https://www.networkshinobi.com/snapraid-and-mergerfs-on-openmediavault/) * 2020-01-14 - [Brandon Rozek's Blog](https://brandonrozek.com/blog/mergerfs/) * 2020-02-14 - [SelfHostedHome.com: Combining Different Sized Drives with mergerfs and SnapRAID](https://selfhostedhome.com/combining-different-sized-drives-with-mergerfs-and-snapraid/) * 2020-05-01 - [FedoraMagazine.org: Using mergerfs to increase your virtual storage](https://fedoramagazine.org/using-mergerfs-to-increase-your-virtual-storage/) * 2020-08-20 - [Setting up Rclone, Mergerfs and Crontab for automated cloud storage](https://bytesized-hosting.com/pages/setting-up-rclone-mergerfs-and-crontab-for-automated-cloud-storage) * 2020-11-22 - [Introducing… MergerFS – My FREE UNRAID alternative](https://supertechfreaks.com/introducing-mergerfs-free-unraid-alternative/) * 2020-12-30 - [Perfect Media Server](https://perfectmediaserver.com) (a new site with docs fully fleshing out the 'Perfect Media Server' blog series) * 2021-07-24 - [Building the Ultimate Linux Home Server - Part 1: Intro, MergerFS, and SnapRAID](https://blog.karaolidis.com/ultimate-home-server-part-1/) * 2021-10-31 - [Better Home Storage: MergerFS + SnapRAID on OpenMediaVault](https://blog.sakuragawa.moe/better-home-storage-mergerfs-snapraid-on-openmediavault/) * 2021-11-28 - [Linux Magazine: Come Together - Merging file systems for a simple NAS with MergerFS](https://www.linux-magazine.com/Issues/2022/254/MergerFS) * 2022-06-04 - [MergerFS + SnapRaid Study](https://crashlaker.github.io/2022/06/04/mergerfs_+_snapraid_study.html) * 2022-12-31 - [Merge Storages in CasaOS: A secret beta feature you know now](https://blog.casaos.io/blog/13.html) * 2023-02-03 - [(MergerFS + SnapRAID) is the new RAID 5](https://thenomadcode.tech/mergerfs-snapraid-is-the-new-raid-5) * 2024-02-07 - [Designing & Deploying MANS - A Hybrid NAS Approach with SnapRAID, MergerFS, and OpenZFS](https://blog.muffn.io/posts/part-3-mini-100tb-nas) * 2024-03-11 - [Using MergerFS to combine multiple hard drives into one unified media storage](https://fullmetalbrackets.com/blog/two-drives-mergerfs/) * 2024-12-20 - [Pooling multiple drives on my Raspberry Pi with mergerfs](https://sebi.io/posts/2024-12-20-pooling-multiple-drives-with-mergerfs/) * 2026-01-03 - [NAS-2026 | MergerFS and SnapRAID](https://github.com/DoTheEvo/NAS-MergerFS-SnapRAID) ## Videos * 2017-06-23 - [Alex Kretzschmar: Part 1 - Perfect Media Server 2017 - Introduction](https://www.youtube.com/watch?v=L5MH8q3lmmk) * 2017-06-24 - [Alex Kretzschmar: Part 2 - Perfect Media server 2017 - Installing Debian 9 Stretch](https://www.youtube.com/watch?v=YpVVYRN_L_A) * 2017-06-24 - [Alex Kretzschmar: Part 3 - Perfect Media Server 2017 - Install MergerFS and setting up your drives](https://www.youtube.com/watch?v=tbCMfm-jJ5Y) * 2017-06-24 - [Alex Kretzschmar: Part 4 - Perfect Media Server 2017 - Installing Docker](https://www.youtube.com/watch?v=WYI32kx4hPE) * 2017-06-24 - [Alex Kretzschmar: Part 5 - Perfect Media Server 2017 - Installing and Automating SnapRAID](https://www.youtube.com/watch?v=Ir5ZsUIbHXA) * 2017-06-24 - [Alex Kretzschmar: Part 6 - Perfect Media Server 2017 -Turning your server into a NAS with Samba and NFS](https://www.youtube.com/watch?v=1hVdWq758ZQ) * 2017-06-24 - [Alex Kretzschmar: Part 7 - Perfect Media Server 2017 - Managing your apps with docker-compose](https://www.youtube.com/watch?v=aI2rdw7_AmE) * 2017-06-24 - [Alex Kretzschmar: Part 8 - Perfect Media Server 2017 - Manging your server using a web UI (Cockpit and Portainer)](https://www.youtube.com/watch?v=aLyTWdzDiCg) * 2018-04-24 - [ElectronicsWizardy: How to setup a Linux Fileserver with Snapraid and Mergerfs Re-Export](https://www.youtube.com/watch?v=D2Klx-X7pFo) * 2019-03-01 - [Snapraid and Unionfs: Advanced Array Options on Openmediavault (Better than ZFS and Unraid)](https://www.youtube.com/watch?v=FYkdPyCt5FU) * 2019-03-22 - [Gamexplicit: The Perfect Plex Media Server 2019! Part 1 (Hardware)](https://www.youtube.com/watch?v=rJIRPhM2WcE) * 2019-05-13 - [Gamexplicit: The Perfect Plex Media Server 2019! Part 2 (Ubuntu Server 18.04.2 LTS)](https://www.youtube.com/watch?v=aLyTWdzDiCg) * 2019-05-20 - [Gamexplicit: The Perfect Plex Media Server 2019! Part 3 (SnapRaid, Samba, Plex)](https://www.youtube.com/watch?v=uW5y43XC-BI) * 2020-08-23 - [Installing OpenMediaVault and SnapRAID and UnionFS (mergerfs)](https://www.youtube.com/watch?v=nDvzXM8UjAI) * 2021-06-07 - [I ditched TrueNAS for MergerFS - Chia Plot Storage](https://www.youtube.com/watch?v=tpqFywkbZa4) * 2021-08-03 - [Install and configure mergerfs to merge more than one folder in the same place](https://www.youtube.com/watch?v=69zcqEy1674) * 2021-08-10 - [Instalando e configurando mergerfs para unir mais de uma pasta no mesmo lugar](https://www.youtube.com/watch?v=-RLxbBNBWhU) * 2021-08-13 - [Let's Convert an Old Laptop to a NAS - What you should do](https://www.youtube.com/watch?v=F1v-TSbOymI) * 2021-08-17 - [How to Combine Multiple Disks as One by using MergerFS | Ubuntu 20.04 LTS](https://www.youtube.com/watch?v=9e46pz5Seo4) * 2021-08-20 - [Vamos converter um Laptop antigo para um NAS – O que você deve fazer](https://www.youtube.com/watch?v=q8EK9vWCRTc) * 2021-10-29 - [Unlimited space for your Plex using Rclone to connect to your Cloud](https://www.youtube.com/watch?v=ghGconyrF3M) * 2022-12-01 - [Make Your Home Server Go FAST! SSD Caching, 10Gbit Networking, etc.](https://www.youtube.com/watch?v=eRfqC_q3lkM&t=784s) * 2022-12-07 - [Best RAID for mixed drive sizes. Unraid vs BTRFS vs Snapraid+Mergerfs vs Storage spaces.](https://www.youtube.com/watch?v=NQJkTiLXfgs) * 2023-02-21 - [MergerFS + SnapRAID : Forget about RAID 5 in your Home Server !](https://www.youtube.com/watch?v=tX5MA-c6Qq4) * 2023-06-26 - [How to install and setup MergerFS](https://www.youtube.com/watch?v=n7piuhTXeG4) * 2023-07-31 - [How to recover a dead drive using Snapraid](https://www.youtube.com/watch?v=fmuiRLPcuJE) * 2024-01-05 - [OpenMediaVault MergerFS Tutorial (Portuguese)](https://www.youtube.com/watch?v=V6Yw86dRUPQ) * 2024-02-19 - [Setup and Install MergerFS and SnapRAID (Part 1)](https://noted.lol/mergerfs-and-snapraid-setup-1/) * 2024-02-22 - [Setup and Install MergerFS and SnapRAID (Part 2)](https://noted.lol/mergerfs-and-snapraid-setup-part-2/) * 2024-05-29 - [Building a 26TB Offsite Backup Server! ft. Tailscale](https://www.youtube.com/watch?v=W_l82GF00UY) * 2024-11-15 - [Meu servidor NAS - Parte 18: Recuperando um HD, recuperando o MergerFS e os próximos passos do NAS!](https://www.youtube.com/watch?v=5fy98kPzE3s) * 2025-04-23 - [How to build the Perfect Media Server | Part 1 - The Tech Stack | mergerfs, SnapRAID, and docker.](https://www.youtube.com/watch?v=Yt67zz9p0FU) * 2025-06-12 - [DIY Unraid-like functionality](https://www.youtube.com/watch?v=fR0XhaWvR1E) * 2025-09-22 - [استÙ�اده از Snapraid Ùˆ MergerFS | جایگزین RAID5](https://www.youtube.com/watch?v=GA6OvaUBKXs) * 2026-02-10 - [Never run out of space again! Using MergerFS with Immich to expand your storage seamlessly](https://www.youtube.com/watch?v=Vbu4WzWUikQ) ## Podcasts * 2019-11-04 - [Jupiter Extras: A Chat with mergerfs Developer Antonio Musumeci | Jupiter Extras 28](https://www.youtube.com/watch?v=VmJUAyyhSPk) * 2019-11-07 - [Jupiter Broadcasting: ZFS Isn’t the Only Option | Self-Hosted 5](https://www.youtube.com/watch?v=JEW7UuKhMJ8) * 2023-10-08 - [Self Hosted Episode 105 - Sleeper Storage Technology](https://selfhosted.show/105) ## Social Media * [Reddit](https://www.reddit.com/search/?q=mergerfs&sort=new) * [X](https://x.com/search?q=mergerfs&src=spelling_expansion_revert_click&f=live) * [YouTube](https://www.youtube.com/results?search_query=mergerfs&sp=CAI%253D) * [ServeTheHome Forum](https://forums.servethehome.com/index.php?search/3105813/&q=mergerfs&o=date) mergerfs-2.42.0/mkdocs/docs/performance.md0000644000000000000000000000460715177346257017172 0ustar rootroot# Tweaking Performance **mergerfs** is effectively a filesystem proxy and therefore its theoretical max performance is that of the underlying devices (ignoring caching performed by the kernel.) However, given it is a FUSE based filesystem working from userspace and it must combine the behavior and information from multiple underlying branches there can be an increase in overhead relative to other solutions. That said the performance of certain functions, such as IO, can match the theoretical max but it depends greatly on the system's configuration. There are many things which can impact performance. Device speeds and latency, network speeds and latency, concurrency and parallel limits of the hardware, read/write sizes, the number of branches, etc. While some settings can impact performance they are all **functional** in nature. Meaning they change mergerfs' behavior in some way. As a result there is really no such thing as a "performance mode". If you're having performance concerns please read over the [benchmarking section](benchmarking.md) of these docs and then the details below. NOTE: Be sure to [read about available features](config/options.md) before changing them to understand how functionality will change. * test theoretical performance using `nullrw` or using a ram disk as a branch * enable [passthrough.io](config/passthrough.md) (likely to have the biggest impact) * change read or process [thread pools](config/threads.md) * change [func.readdir](config/func_readdir.md) * increase [readahead](config/readahead.md): `readahead=1024` * disable `security-capability` and/or [xattr](config/xattr.md) * increase cache timeouts [cache.attr](config/cache.md#cacheattr), [cache.entry](config/cache.md#cacheentry), [cache.negative-entry](config/cache.md#cachenegative-entry) * toggle [page caching](config/cache.md#cachefiles) * enable `parallel-direct-writes` * enable [cache.statfs](config/cache.md#cachestatfs) * enable [cache.symlinks](config/cache.md#cachesymlinks) * enable [cache.readdir](config/cache.md#cachereaddir) * disable `posix-acl` * disable `async-read` * use [symlinkify](config/symlinkify.md) if your data is largely static and read-only * use [tiered cache](extended_usage_patterns.md) devices * use LVM and LVM cache to place a SSD in front of your HDDs ## Additional Reading * [Benchmarking](benchmarking.md) * [Options](config/options.md) * [Tips and Notes](tips_notes.md) mergerfs-2.42.0/mkdocs/docs/project_comparisons.md0000644000000000000000000006371515177346257020761 0ustar rootroot# Project Comparisons There are no solutions, only trade-offs. ## mhddfs * [https://romanrm.net/mhddfs](https://romanrm.net/mhddfs) mhddfs is, like mergerfs, a FUSE-based filesystem which can pool multiple filesystems together. mhddfs had not been updated in over a decade and has known stability and security issues. mergerfs provides a superset of mhddfs' features and offers better performance. As of 2020, the author of mhddfs has [moved to using mergerfs.](https://romanrm.net/mhddfs#update) * **Better than mergerfs for:** legacy setups that already depend on mhddfs-specific behavior and do not need newer features. * **Worse than mergerfs for:** most modern deployments due to maintenance status, feature coverage, and reliability. Below is an example of mhddfs and mergerfs setup to work similarly. ``` mhddfs -o mlimit=4G,allow_other /mnt/drive1,/mnt/drive2 /mnt/pool mergerfs -o minfreespace=4G,category.create=ff /mnt/drive1:/mnt/drive2 /mnt/pool ``` ## aufs * [https://aufs.sourceforge.net](https://aufs.sourceforge.net) * [https://en.wikipedia.org/wiki/Aufs](https://en.wikipedia.org/wiki/Aufs) aufs, another union filesystem, is a kernel-based overlay filesystem with basic file creation placement policies. Compared with mergerfs, aufs focuses on kernel-level overlay and copy-on-write behavior, while mergerfs focuses on userspace pooling of existing filesystems with richer branch placement policies. aufs failed to be included in the mainline kernel and is no longer available in most Linux distros, making it harder to get installed for the average user. Development has been largely dormant for years. While aufs can often offer better peak performance due to being primarily kernel-based (at least when `passthrough.io` is disabled in mergerfs), mergerfs provides more configurability and is generally easier to use. mergerfs, however, does not offer the overlay / copy-on-write (CoW) features which aufs has. * **Better than mergerfs for:** kernel-level overlay/CoW workloads where that behavior is required. * **Worse than mergerfs for:** users needing a widely packaged, actively-maintained, easy-to-deploy pooling solution. ## unionfs * [https://unionfs.filesystems.org](https://unionfs.filesystems.org) unionfs for Linux is a "stackable unification file system" which functions like many other union filesystems. It was last released for Linux v3.14 back in 2014. Compared with mergerfs, unionfs is an older kernel union filesystem implementation while mergerfs is a modern, actively-maintained FUSE-based pooling filesystem with broader policy controls. Documentation is sparse so a comparison of features is not possible but given the lack of maintenance and support for modern kernels there is little reason to consider it as a solution. * **Better than mergerfs for:** historical or legacy environments that already depend on this specific kernel unionfs behavior. * **Worse than mergerfs for:** practical modern deployments due to limited maintenance, aging kernel support, and sparse documentation. ## unionfs-fuse * [https://github.com/rpodgorny/unionfs-fuse](https://github.com/rpodgorny/unionfs-fuse) unionfs-fuse is a FUSE-based union filesystem focused on overlay behavior, including copy-on-write (CoW) style layering of writable content over read-only content. Compared with mergerfs, unionfs-fuse's primary feature is overlay/CoW-style layering, while mergerfs' primary feature is policy-based pooling and placement across multiple regular writable filesystems. Since unionfs-fuse, as the name suggests, is a FUSE-based technology it can be used without elevated privileges that kernel solutions such as unionfs, aufs, and overlayfs require. * **Better than mergerfs for:** overlay-style unions with copy-on-write semantics in userspace. * **Worse than mergerfs for:** flexible create-policy-based pooling of many writable filesystems. ## overlayfs * [https://docs.kernel.org/filesystems/overlayfs.html](https://docs.kernel.org/filesystems/overlayfs.html) overlayfs is effectively the functional successor to unionfs, unionfs-fuse, and aufs and is widely used by Linux container platforms such as Docker and Podman. Both overlayfs and FUSE were originally created by Miklos Szeredi. If your use case is layering a writable filesystem on top of read-only filesystems then you should look first to overlayfs. Its feature set however is very different from mergerfs and solves different problems. * **Better than mergerfs for:** container and image-layering workflows where copy-on-write semantics are central. * **Worse than mergerfs for:** heterogeneous pooling use cases that need flexible branch selection policies across many existing filesystems. ## RAID0, JBOD, SPAN, drive concatenation, striping * [RAID0](https://en.wikipedia.org/wiki/Standard_RAID_levels#RAID_0) * [JBOD](https://en.wikipedia.org/wiki/Non-RAID_drive_architectures#JBOD) * [SPAN](https://en.wikipedia.org/wiki/Non-RAID_drive_architectures#Concatenation_(SPAN,_BIG)) * [striping](https://en.wikipedia.org/wiki/Data_striping) These are block device technologies which, in some form, aggregate devices into what appears to be a single device on which a traditional filesystem can be used. The filesystem has no understanding of the underlying block layout and, should one of those underlying devices fail or be removed, the filesystem will be missing that chunk, which could contain critical information, and the whole filesystem may become unrecoverable. Even if the data from the filesystem is recoverable, doing so may require specialized tooling. In contrast, with mergerfs you can format devices as you normally would, or take existing filesystems and combine them in a pool to aggregate their storage. The failure of any one device will have no impact on the other devices. The downside to mergerfs' approach is that you do not actually have contiguous space as large as you would with those other technologies. That means you cannot create a file larger than 1TB on a pool of two 1TB filesystems. * **Better than mergerfs for:** creating one contiguous block device and maximizing single-file size/performance characteristics. * **Worse than mergerfs for:** failure isolation and straightforward per-disk recovery when a device dies. ## RAID5, RAID6 * [RAID5](https://en.wikipedia.org/wiki/Standard_RAID_levels#RAID_5) * [RAID6](https://en.wikipedia.org/wiki/Standard_RAID_levels#RAID_6) RAID5, RAID6, and similar technologies aggregate multiple devices at the block level and provide one or more live parity schemes that can allow the pool to continue to run should one device fail and rebuild the data once the device is replaced. mergerfs offers no parity or redundancy features so in that regard the technologies are not comparable. [SnapRAID](https://www.snapraid.it) or [NonRAID](https://github.com/qvr/nonraid) can be used in combination with mergerfs to provide redundancy. Unlike traditional RAID5 or RAID6 SnapRAID works with drives of different sizes and can have more than 2 parity drives. Parity calculations with SnapRAID are not done in real-time but NonRAID's are. For more details and comparison of SnapRAID to related technologies see [https://www.snapraid.it/compare](https://www.snapraid.it/compare). * **Better than mergerfs for:** live parity protection and continued array operation through configured disk failures. * **Worse than mergerfs for:** incremental mixed-size pooling with simple per-filesystem independence. ## LVM * [https://en.wikipedia.org/wiki/Logical_Volume_Manager_(Linux)](https://en.wikipedia.org/wiki/Logical_Volume_Manager_(Linux)) * [https://sourceware.org/lvm2](https://sourceware.org/lvm2) LVM is a block-level volume management system for Linux. It combines physical devices into volume groups and creates logical volumes on top, with features like snapshots, resizing, and thin provisioning. Compared with mergerfs, LVM operates below the filesystem while mergerfs operates above filesystems. With LVM, filesystems are created on logical volumes and do not know about the underlying disks. If a linear or striped logical volume spans multiple disks and one disk fails, the filesystem can become unreadable. With mergerfs, each disk typically has its own independent filesystem, so a single disk failure affects only the data on that disk. * **Better than mergerfs for:** block-level features like thin provisioning, snapshots, and online resizing. * **Worse than mergerfs for:** incremental mixed-disk pooling where per-disk failure isolation and per-disk native access are priorities. ## mdadm * [https://en.wikipedia.org/wiki/Mdadm](https://en.wikipedia.org/wiki/Mdadm) * [https://raid.wiki.kernel.org/index.php/A_guide_to_mdadm](https://raid.wiki.kernel.org/index.php/A_guide_to_mdadm) `mdadm` is Linux userspace tooling for configuring and managing software RAID arrays provided by the kernel `md` driver. It can build RAID0/1/4/5/6/10 and related layouts, monitor arrays, and handle rebuild workflows. Like RAID technologies discussed above, `mdadm` arrays aggregate devices at the block layer and present one virtual device to a filesystem. That can provide performance and/or redundancy depending on RAID level, but it also means the filesystem depends on the array layout. mergerfs does not provide block-level RAID; it pools already-formatted filesystems and can be combined with tools like SnapRAID or NonRAID when redundancy is needed. * **Better than mergerfs for:** kernel software RAID with real-time redundancy and array-level performance tuning. * **Worse than mergerfs for:** flexible mixed-size drive pooling where per-filesystem independence and simple incremental expansion matter. ## device mapper * [https://en.wikipedia.org/wiki/Device_mapper](https://en.wikipedia.org/wiki/Device_mapper) * [https://docs.kernel.org/admin-guide/device-mapper](https://docs.kernel.org/admin-guide/device-mapper) Device mapper is a kernel framework for creating virtual block devices from one or more underlying devices. Technologies such as LVM, `dm-crypt`, `dm-cache`, `dm-thin`, and multipath are built on top of it. Because device mapper works at the block layer, it is not directly comparable to mergerfs. It is complementary: you can use device mapper for block-level functionality (encryption, caching, thin provisioning, etc.) and then place filesystems on those devices, which mergerfs can later pool if desired. * **Better than mergerfs for:** block-layer transformations such as transparent encryption, caching, and provisioning features. * **Worse than mergerfs for:** presenting one unified pathname-level view across many independent, already-formatted filesystems. ## UnRAID * [https://unraid.net](https://unraid.net) UnRAID is a full OS platform that offers pooled storage with integrated real-time parity. Compared with mergerfs, its main advantage is that it bundles pooling and parity in one product, while mergerfs is a standalone Linux pooling filesystem without built-in redundancy. For some users mergerfs' Linux distro-agnostic and fully open-source approach is also preferable. For semi-static data, mergerfs + [SnapRAID](https://www.snapraid.it) provides a similar, but not real-time, solution. [NonRAID](https://github.com/qvr/nonraid) (see below) is a fork of UnRAID's parity calculation solution and can also be used with mergerfs. * **Better than mergerfs for:** turnkey pooling plus integrated real-time parity in one product. * **Worse than mergerfs for:** users who prefer a Linux distro-agnostic, fully open-source component approach. ## NonRAID * [https://github.com/qvr/nonraid](https://github.com/qvr/nonraid) [NonRAID](https://github.com/qvr/nonraid#how-it-works) is a fork of UnRAID's storage array kernel driver. Effectively it is like RAID5 at the block device layer without treating the collection of devices as a single device. Each device gets a virtual block device associated with it which can be formatted with the filesystem of the user's choice and will be individually accessible. Similar to SnapRAID but real-time. Compared with mergerfs, NonRAID adds kernel-level real-time parity while still allowing per-disk filesystems, whereas mergerfs focuses on pooling views and placement policies without parity. Given each device has its own filesystem like a traditional setup it can be used with mergerfs for those looking for a unified view. * **Better than mergerfs for:** real-time parity protection without traditional RAID striping behavior. * **Worse than mergerfs for:** users who want the simplest setup and do not need parity, since it adds operational complexity. ## ZFS * [https://en.wikipedia.org/wiki/ZFS](https://en.wikipedia.org/wiki/ZFS) ZFS is an advanced filesystem that combines storage pooling, snapshots, data integrity checking, and built-in RAID-like redundancy all in one package. It offers features like transparent compression, encryption, and automatic data repair. Compared with mergerfs, ZFS is a full storage stack that manages disks directly with integrated integrity and redundancy features, while mergerfs is a lightweight FUSE layer that pools existing filesystems without built-in redundancy. * **Better than mergerfs for:** integrated data integrity, snapshots, checksumming, and built-in redundancy. * **Worse than mergerfs for:** low-overhead incremental pooling of existing filesystems with minimal planning. ## ZFS AnyRAID * [https://github.com/openzfs/zfs/discussions/16773](https://github.com/openzfs/zfs/discussions/16773) [ZFS AnyRAID](https://github.com/openzfs/zfs/discussions/16773) ([announcement](https://hexos.com/blog/introducing-zfs-anyraid-sponsored-by-eshtek)) is a feature under development for ZFS intended to provide more flexibility in pools by allowing mixed-capacity disks while maintaining live redundancy. If released, ZFS AnyRAID would offer some of the flexibility associated with mergerfs-style mixed-capacity expansion, but with built-in redundancy inside ZFS. mergerfs already provides that mixed-size, add-drives-anytime flexibility today, albeit without built-in redundancy. If you need redundancy with that flexibility, ZFS AnyRAID could become an option when available; until then, mergerfs remains the simpler currently available choice for mixed-capacity pooling, with redundancy and integrity available via SnapRAID and/or NonRAID. * **Better than mergerfs for:** users who want mixed-capacity flexibility and built-in live redundancy in one filesystem stack. * **Worse than mergerfs for:** users who need mature availability now and the simplest add-drives-anytime workflow without redundancy overhead. ## Bcachefs * [https://bcachefs.org](https://bcachefs.org) Bcachefs is a modern copy-on-write filesystem for Linux designed for multi-device storage aggregation. It includes integrated features such as checksumming, snapshots, compression, encryption, and redundancy. Compared with mergerfs, bcachefs is a full integrated filesystem with built-in checksumming, snapshots, compression, and redundancy, while mergerfs is a lightweight pooling layer over existing filesystems. Bcachefs is still evolving and should be evaluated carefully for production use. * **Better than mergerfs for:** integrated CoW filesystem features, checksumming, snapshots, compression, and built-in multi-device redundancy. * **Worse than mergerfs for:** conservative production setups prioritizing maturity, simplicity, and broad long-term deployment stability. ## Btrfs Single Data Profile * [https://btrfs.readthedocs.io](https://btrfs.readthedocs.io) [Btrfs'](https://btrfs.readthedocs.io) `single` data profile is a multi-device Btrfs mode that can spread data across drives without adding redundancy. Compared with mergerfs, Btrfs `single` is managed as one integrated filesystem, while mergerfs pools separate existing filesystems. In Btrfs `single`, losing one device can impact the whole filesystem; with mergerfs, loss is typically limited to data on the failed disk. * **Better than mergerfs for:** integrated multi-device management in one filesystem namespace. * **Worse than mergerfs for:** users who value per-disk failure isolation and easy independent recovery. ## StableBit's DrivePool * [https://stablebit.com](https://stablebit.com) DrivePool is a commercial storage pooling product for Windows that combines multiple drives into a single volume and includes balancing and optional duplication capabilities. Compared with mergerfs, DrivePool emphasizes integrated balancing and duplication features in a Windows-first product, while mergerfs emphasizes Linux FUSE pooling with policy-based create placement and external-tool composability. * **Better than mergerfs for:** Windows users needing built-in rebalancing and native file duplication features. * **Worse than mergerfs for:** Linux-native deployments and users who prefer open-source tooling and composable external utilities. ## Windows Storage Spaces * [https://learn.microsoft.com/en-us/windows-server/storage/storage-spaces/overview](https://learn.microsoft.com/en-us/windows-server/storage/storage-spaces/overview) Windows Storage Spaces is Microsoft's software-defined storage platform for Windows Server and Windows Pro. It aggregates multiple physical disks into logical storage pools with built-in redundancy options (mirroring, parity) and automatic performance optimization through tiered caching. Storage Spaces is Windows-only and requires more planning upfront due to redundancy options and RAID-like features. mergerfs is Linux-focused and takes a simpler approach, pooling existing filesystems without built-in redundancy. If you need a Windows solution with integrated data protection, Storage Spaces is a good choice. For Linux users seeking lightweight pooling without redundancy overhead, mergerfs is the better option. * **Better than mergerfs for:** Windows environments needing integrated pooling, resilience, and tiering in the platform stack. * **Worse than mergerfs for:** Linux hosts and lightweight pooling where minimal overhead and per-filesystem independence are preferred. ## Plan 9 binds * [https://en.wikipedia.org/wiki/Plan_9_from_Bell_Labs#Union_directories_and_namespaces](https://en.wikipedia.org/wiki/Plan_9_from_Bell_Labs#Union_directories_and_namespaces) Plan 9 has a native bind mechanism that can compose paths and filesystems into a single namespace view, including union-like directory behavior. Compared with mergerfs, Plan 9 binds are an OS-native namespace feature with simple ordered behavior, while mergerfs provides Linux-focused filesystem pooling with a larger set of configurable branch policies. Plan 9 isn't a widely used OS so this comparison is mostly academic. * **Better than mergerfs for:** native Plan 9 environments where namespace composition is a core OS feature. * **Worse than mergerfs for:** Linux users due to ecosystem relevance and practical deployment availability. ## SnapRAID pooling * [https://www.snapraid.it/manual](https://www.snapraid.it/manual) [SnapRAID](https://www.snapraid.it/manual) has a pooling feature which creates "a read-only virtual view of all the files in your array using symbolic links." Compared with mergerfs, SnapRAID pooling is a symlink-generated, read-only view refreshed by SnapRAID operations, while mergerfs is a live mounted filesystem that supports normal read/write behavior. As mentioned in the description, this "view" is just the creation of the same directory layout with symlinks to all files. This means that reads (and writes) to files are at native speeds, but it is not practical to use as a target for writing new files, and it is only updated when `snapraid pool` is run. Note that some software treats symlinks differently than regular files. For instance, some backup software will skip symlinks by default. mergerfs has the feature [symlinkify](config/symlinkify.md) which provides a similar behavior but is more flexible in that it is not read-only. That said there can still be some software that won't like that kind of setup. * **Better than mergerfs for:** read-only, native-speed directory views of SnapRAID-managed content. * **Worse than mergerfs for:** general read/write pooled filesystem use and always-live view updates. ## rclone union * [https://rclone.org/union](https://rclone.org/union) rclone's [union](https://rclone.org/union) backend allows you to create a union of multiple rclone backends and was inspired by [mergerfs](https://rclone.org/union/#behavior-policies). Because rclone knows more about the underlying backends than mergerfs can, it can be more efficient than creating a similar union with `rclone mount` and mergerfs. Compared with mergerfs, rclone union is backend-aware and optimized for cloud/remote storage abstractions, while mergerfs is optimized for local POSIX filesystem pooling and branch policies. However, it is not uncommon to see users set up rclone mounts and combine them with local or other remote filesystems using mergerfs given the differing feature sets and focuses of the two projects. * **Better than mergerfs for:** remote-backend-heavy workloads where backend-aware behavior improves cloud storage handling. * **Worse than mergerfs for:** local POSIX pooling scenarios where direct filesystem semantics and broad local tool compatibility matter. ## distributed filesystems * [AFS](https://www.openafs.org) * [Ceph/CephFS](https://ceph.io) * [GlusterFS](https://www.gluster.org) * [LizardFS](https://lizardfs.com) * [MooseFS](https://moosefs.com) * etc. Distributed remote filesystems come in many forms. Some offer POSIX filesystem compliance and some do not. Some provide remote block devices or object stores on which a POSIX or POSIX-like filesystem is built. Some are effectively distributed union filesystems with duplication. Compared with mergerfs, distributed filesystems focus on multi-node storage, replication, and cluster behavior, while mergerfs focuses on single-host local pooling of existing filesystems. * **Better than mergerfs for:** multi-node or geographically distributed workloads with built-in replication and high availability. * **Worse than mergerfs for:** single-host and homelab pooling where low overhead and operational simplicity are key. ## nofs * [https://github.com/chapmanjacobd/nofs](https://github.com/chapmanjacobd/nofs) nofs is a tool that provides mergerfs-like functionality for combining multiple filesystems/directories into a unified view but does so entirely through subcommands which replicate traditional POSIX commands rather than providing a proper filesystem. It takes a lot of inspiration from mergerfs in that it supports policy-based branch selection (mfs, ff, pfrd, epmfs, and others), read-only and no-create branch modes, and recreates POSIX-like commands such as `ls`, `find`, `which`, `cp`, `mv`, and `rm`. Compared with mergerfs, nofs is command-driven rather than a mounted filesystem, so mergerfs is the option for transparent system-wide pooling through normal POSIX filesystem calls. Given its design nofs is not suited for general usage as third-party applications will not be able to take advantage of the unioning behavior it offers. It is primarily for more simple situations where something like mergerfs is unable to be used. * **Better than mergerfs for:** constrained environments where a FUSE mount is not possible but command-style union behavior is acceptable. * **Worse than mergerfs for:** transparent system-wide filesystem pooling usable by arbitrary third-party applications. ## policyfs * [https://policyfs.org](https://policyfs.org) * [https://github.com/hieutdo/policyfs](https://github.com/hieutdo/policyfs) policyfs is a Linux FUSE storage daemon that unifies multiple storage paths under a single mountpoint, similarly to mergerfs. Its distinguishing features are explicit path-pattern-based routing rules for placement, and an optional SQLite metadata index that can serve `readdir` and `getattr` operations without spinning up HDDs. Compared with mergerfs, policyfs emphasizes explicit path-based routing and optional metadata indexing, while mergerfs emphasizes a broad, policy-driven pooling model with longer operational history and wider adoption. It doesn't try limiting spinup as doing so fundimentally is in [conflict with other features.](faq/limit_drive_spinup.md) Due to the nature of PolicyFS it can not really be used while changing files out-of-band and with the delayed writeback of metadata and unlinking there is a greater risk of inconsistancy in error conditions. * **Better than mergerfs for:** explicit path-based routing and optional metadata indexing to reduce HDD spin-ups. * **Worse than mergerfs for:** users prioritizing project maturity, adoption, performance, and long-established operational behavior. ## Greyhole * [https://www.greyhole.net](https://www.greyhole.net) * [https://github.com/gboudreau/Greyhole](https://github.com/gboudreau/Greyhole) Greyhole is an open-source storage pooling application that works via Samba. Rather than implementing a FUSE filesystem, it hooks into Samba VFS to intercept file operations and distribute files across multiple drives, with optional per-share redundancy. Compared with mergerfs, Greyhole is Samba-centric and includes integrated share-level redundancy, while mergerfs is a general-purpose Linux FUSE mount for local pooling via standard POSIX filesystem calls. * **Better than mergerfs for:** Samba-centric environments that need built-in per-share redundancy in the same tool. * **Worse than mergerfs for:** general-purpose local filesystem pooling outside Samba and heavy small-file churn workloads. ## 9P * [https://en.wikipedia.org/wiki/9P_(protocol)](https://en.wikipedia.org/wiki/9P_(protocol)) [9P](https://en.wikipedia.org/wiki/9P_(protocol)) is a filesystem protocol from the Plan 9 operating system used to access files over a network between systems. Compared with mergerfs, 9P is a network filesystem protocol, while mergerfs is a local Linux FUSE filesystem for pooling directories and filesystems under one mount with branch policies. * **Better than mergerfs for:** lightweight network filesystem protocol use between compatible systems. * **Worse than mergerfs for:** local Linux filesystem pooling because it does not provide mergerfs-like branch policies or pooling semantics. mergerfs-2.42.0/mkdocs/docs/quickstart.md0000644000000000000000000001157215177346257017062 0ustar rootroot# Quick Start ## Install First ensure you have the [latest version installed](setup/installation.md). ## Configuration mergerfs has many [options](config/options.md) and effectively all of them are functional in nature. What that means is that there is no "best" or "fastest" configuration. No "make faster" options. Everything changes behavior. Sometimes those changes in behavior affect performance. If you don't already know that you have special requirements then use one of the following option sets as it will cover the common use cases. ### You use Linux v6.6 or above * cache.files=off * category.create=pfrd * func.getattr=newest * dropcacheonclose=false See [Known Issues and Bugs#Software Using mmap](known_issues_bugs.md#software-using-mmap) for more details why the Linux and mergerfs version matter and its relation to `mmap`. **NOTE:** This "auto mmap" feature is only supported in mergerfs v2.41.0 and above. For older versions see below or the docs from that release. ### You use Linux v6.5 or below #### You need `mmap` To keep the details in a single location: see [Known Issues and Bugs#Software Using mmap](known_issues_bugs.md#software-using-mmap) for more details. * cache.files=auto-full * category.create=pfrd * func.getattr=newest * dropcacheonclose=true #### You don't need `mmap` * cache.files=off * category.create=pfrd * func.getattr=newest * dropcacheonclose=false ## Usage For some suggestions on branch setup see [the page on branches](config/branches.md#branch-setup). ### Command Line ``` # Two positional options: `:` colon separated branches and mountpoint mergerfs -o opt[,opt...] /branch0:/branch1 /mountpoint # or list of positional options where the last is the mountpoint mergerfs -o opt[,opt...] /branch0 /branch1 /mountpoint # or set mountpoint via -o mountpoint mergerfs -o mountpoint=/mountpoint /branch0 /branch1 ``` ``` mergerfs -o cache.files=off,category.create=pfrd,func.getattr=newest,dropcacheonclose=false /mnt/hdd0:/mnt/hdd1 /media ``` ### /etc/fstab ``` /mnt/hdd0:/mnt/hdd1 /media mergerfs cache.files=off,category.create=pfrd,func.getattr=newest,dropcacheonclose=false 0 0 ``` ### /etc/fstab w/ config file For more complex setups it can be useful to separate out the config. #### /etc/fstab ``` /etc/mergerfs/branches/media/* /media mergerfs config=/etc/mergerfs/config/media.ini ``` #### /etc/mergerfs/config/media.ini ```ini title="media.ini" linenums="1" cache.files=off category.create=pfrd func.getattr=newest dropcacheonclose=false # comments and empty lines are supported ``` #### /etc/mergerfs/branches/media/ Create a bunch of symlinks to point to the branch. mergerfs will resolve the symlinks and use the real path. `ls -lh /etc/mergerfs/branches/media/*` ```text lrwxrwxrwx 1 root root 21 Aug 4 2023 hdd00 -> /mnt/hdd/hdd00 lrwxrwxrwx 1 root root 21 Aug 4 2023 hdd01 -> /mnt/hdd/hdd01 lrwxrwxrwx 1 root root 21 Aug 4 2023 hdd02 -> /mnt/hdd/hdd02 lrwxrwxrwx 1 root root 21 Aug 4 2023 hdd03 -> /mnt/hdd/hdd03 ``` ### systemd (simple) `/etc/systemd/system/mergerfs-media.service` ```systemd title="mergerfs-media.service" linenums="1" [Unit] Description=mergerfs /media service After=local-fs.target network.target [Service] Type=simple KillMode=none ExecStart=/usr/bin/mergerfs \ -f \ -o cache.files=off \ -o category.create=pfrd \ -o func.getattr=newest \ -o dropcacheonclose=false \ /mnt/hdd0 \ /mnt/hdd1 \ /media ExecStop=/usr/bin/umount /media # Or if you need fusermount # ExecStop=/usr/bin/mergerfs-fusermount -u /media Restart=on-failure [Install] WantedBy=default.target ``` ### systemd (w/ setup script) Since it isn't well documented otherwise: if you wish to do some setup before you mount mergerfs follow this example. #### setup-for-mergerfs `/usr/local/bin/setup-for-mergerfs` ```shell title="setup-for-mergerfs" linenums="1" #!/usr/bin/env sh # Perform setup /bin/sleep 10 # Report back to systemd that things are ready /bin/systemd-notify --ready ``` #### setup-for-mergerfs.service `/etc/systemd/system/setup-for-mergerfs.service` ```systemd title="setup-for-mergerfs.service" linenums="1" [Unit] Description=mergerfs setup service [Service] Type=notify RemainAfterExit=yes ExecStart=/usr/local/bin/setup-for-mergerfs [Install] WantedBy=default.target ``` #### mergerfs-media.service `/etc/systemd/system/mergerfs-media.service` ```systemd title="mergerfs-media.service" linenums="1" [Unit] Description=mergerfs /media service Requires=setup-for-mergerfs.service After=local-fs.target network.target prepare-for-mergerfs.service [Service] Type=simple KillMode=none ExecStart=/usr/bin/mergerfs \ -f \ -o cache.files=off \ -o category.create=pfrd \ -o func.getattr=newest \ -o dropcacheonclose=false \ /mnt/hdd0 \ /mnt/hdd1 \ /media ExecStop=/usr/bin/umount /media # Or if you need fusermount # ExecStop=/usr/bin/mergerfs-fusermount -u /media Restart=on-failure [Install] WantedBy=default.target ``` mergerfs-2.42.0/mkdocs/docs/related_projects.md0000644000000000000000000001103315177346257020211 0ustar rootroot# Related Projects ## Projects using mergerfs * [Lakka.tv](https://lakka.tv): A turnkey software emulation Linux distribution. Used to pool user and local storage. Also includes my other project [Opera](https://retroarch.com). A 3DO emulator. * [OpenMediaVault](https://www.openmediavault.org): A network attached storage (NAS) solution based on Debian Linux. They provide plugins to manage mergerfs. * [CasaOS](https://casaos.io): "A simple, easy to use, elegant open source home cloud system." Has added initial integration with mergerfs to create pools from existing filesystems. * [ZimaOS](https://github.com/IceWhaleTech/zimaos-rauc): A more commercially focused NAS OS by the authors of CasaOS at [Ice Whale](https://www.zimaboard.com). * [Cosmos Cloud](https://cosmos-cloud.io): Cosmos "take the chore out of selfhosting, with automated maintenance and fully secured setup out of the box. It even integrates to your existing setup." * [MOS](https://mos-official.net): "Lightweight, modular server OS for NAS, Containers & VMs." ## Software and services commonly used with mergerfs * [snapraid](https://www.snapraid.it): a backup program designed for disk arrays, storing parity information for data recovery in the event of up to six disk failures. * [nonraid](https://github.com/qvr/nonraid): NonRAID is a fork of the unRAID system's open-source md_unraid kernel driver enabling UnRAID-style storage arrays with parity protection outside of the commercial UnRAID system. * [rclone](https://rclone.org): a command-line program to manage files on cloud storage. It is a feature-rich alternative to cloud vendors' web storage interfaces. rclone's [union](https://rclone.org/union) feature is based on mergerfs policies. * [ZFS](https://openzfs.org): A popular filesystem and volume management platform originally part of Sun Solaris and later ported to other operating systems. It is common to use ZFS with mergerfs. ZFS for important data and mergerfs pool for replacable media. * [Proxmox](https://www.proxmox.com): Proxmox is a popular, Debian based, virtualization platform. Users tend to install mergerfs on the host and pass the mount into containers. * [UnRAID](https://unraid.net): "Unraid is a powerful, easy-to-use operating system for self-hosted servers and network-attached storage." While UnRAID has its own union filesystem it isn't uncommon to see UnRAID users leverage mergerfs given the differences in the technologies. There is a [plugin available by Rysz](https://forums.unraid.net/topic/144999-plugin-mergerfs-for-unraid-support-topic) to ease installation and setup. * [TrueNAS SCALE](https://www.truenas.com/truenas-scale): An enterprise focused NAS operating system with OpenZFS support. A Some users are requesting mergerfs be [made part of](https://forums.truenas.com/t/add-unionfs-or-mergerfs-and-rdam-enhancement-then-beat-all-other-nas-systems/23218) TrueNAS. * For a time there were a number of Chia miners recommending mergerfs. * [cloudboxes.io](https://cloudboxes.io): VPS provider. Includes details [on their wiki](https://cloudboxes.io/wiki/how-to/apps/set-up-mergerfs-using-ssh): on how to setup mergerfs. * [QNAP](https://www.myqnap.org/product/mergerfs-apache83): A company known for their turnkey, consumer focused NAS devices. Someone has created builds of mergerfs for different QNAP devices. ## Distributions including mergerfs mergerfs can be found in the [repositories](https://pkgs.org/download/mergerfs) of [many Linux](https://repology.org/project/mergerfs/versions) distributions and FreeBSD. Note: Any non-rolling release based distro is likely to have out-of-date versions. `deb` and `rpm` based distro users should probably use the [mergerfs project's provided packages.](https://github.com/trapexit/mergerfs/releases) * [Debian](https://packages.debian.org/search?keywords=mergerfs&searchon=names&suite=all§ion=all) * [Ubuntu](https://launchpad.net/ubuntu/+source/mergerfs) * [Fedora](https://rpmsphere.github.io) * [T2](https://t2sde.org/packages/mergerfs) * [Alpine](https://pkgs.alpinelinux.org/packages?name=mergerfs&branch=edge&repo=&arch=&maintainer=) * [Gentoo](https://packages.gentoo.org/packages/sys-fs/mergerfs) * [Arch (AUR)](https://aur.archlinux.org/packages/mergerfs) * [Void](https://voidlinux.org/packages/?arch=x86_64&q=mergerfs) * [NixOS](https://search.nixos.org/packages?type=packages&query=mergerfs) * [Guix]() * [Slackware](https://slackbuilds.org/repository/15.0/system/mergerfs/?search=mergerfs) * [FreeBSD](https://www.freshports.org/filesystems/mergerfs) mergerfs-2.42.0/mkdocs/docs/remote_filesystems.md0000644000000000000000000001653015177346257020611 0ustar rootroot# Remote Filesystems This section is to describe any known issues or quirks when using mergerfs with common remote filesystems. There are two ways to use mergerfs with a network filesystem. One is to use it within the pool as a branch and one is the exporting of a mergerfs mount. ## General Notes ### Do not change things out-of-band Keep in mind that, like when using [caching](faq/usage_and_functionality.md#can-filesystems-still-be-used-directly-outside-of-mergerfs-while-pooled), it is **NOT** a good idea to change the contents of the remote filesystem [out-of-band](https://en.wikipedia.org/wiki/Out-of-band). Meaning that you should not change the contents of the underlying filesystems or mergerfs on the server hosting the remote filesystem. Files should exclusively be interacted with through the network filesystem. Doing otherwise can lead to weird behavior, inconsistency, errors, and even data corruption should multiple programs try to write or read the same data at the same time. This isn't to say you can't do it or that data corruption is likely but it _could_ happen. If you're only reading from those filesystems there is little risk but writing or modifying file layout will be a problem. Particularly with NFS. It is better to always use the remote filesystem. Even on the machine serving it. ## NFS [NFS](https://en.wikipedia.org/wiki/Network_File_System) is a common remote filesystem on Unix/POSIX systems. Due to how NFS works there are some settings which need to be set in order for mergerfs to work with it. ### NFS as branch mergerfs settings: * No special settings need to be set NFS export settings: * `no_root_squash`: mergerfs must be able to make requests that only root is permissioned to make. If any root squashing occurs, just as running mergerfs as a non-root user, there is no guarantee that mergerfs will be able to do what it needs to manage the underlying filesystem. * `softerr` or `soft`: A perhaps questionable choice but if NFS freezes up because the backend dies or the network goes down the default `hard` mount would cause mergerfs to block the same as any other software. By setting `softerr` or `soft` the NFS client will timeout eventually and return an error. * `softreval`: NFS client will serve up cached data after `retrans` attempts to revalidate the data. Helps with intermittent network issues. * `timeo=150`: Timeout till retrying request. * `retrans=3`: Number of retrying a request. * `rsize=131072`: Read size. * `wsize=131072`: Write size. `no_root_squash` is necessary but the others are just suggestions and you may want to alter based on your use case. The risk of using `hard` and other more strict behavior options is that should NFS completely lock up it will impact mergerfs negatively. ### NFS exporting mergerfs It should be noted that NFS and FUSE (the technology mergerfs uses) do not work perfectly with one another. They largely can be worked around but if you run into problems it may be worth trying Samba/SMB. **mergerfs settings:** * `never-forget-nodes=true` * `inodecalc=path-hash` * `lazy-umount-mountpoint=false` `never-forget-nodes=true` is needed because NFS uses the `name_to_handle_at` and `open_by_handle_at` functions which allow a program to keep a reference to a file without technically having it open in the typical sense. The problem is that FUSE has no way to know that NFS has a handle that it will later use to open the file again. As a result, it is possible for the kernel to tell mergerfs to forget about the file node and should NFS ever ask for that node's details in the future it would have nothing to respond with. Keeping nodes around until they are unlinked, removed, or replaced is not ideal but at the moment the only way to manage the situation. `inodecalc=path-hash` is needed because NFS is sensitive to out-of-band changes. FUSE doesn't care if a file's inode value changes but NFS, being stateful, does. So if you used the default inode calculation algorithm it is possible that if you changed a file or updated a directory the file mergerfs will use will be on a different branch and therefore the inode would change. This isn't an ideal solution and others are being considered but it works for most situations. `lazy-umount-mountpoint=false` is needed (or left unset) as lazy umount can cause problems with NFS. It won't impact the NFS export at first but followup mounts of mergerfs to the same mount point will lead to new remote mounts hanging till `exportfs` is run again. **NFS export settings:** * `fsid=UUID` * `no_root_squash` `fsid=UUID` is needed because FUSE filesystems don't have different `st_dev` values which can cause issues when exporting. The easiest thing to do is set each mergerfs export `fsid` to some random value. An easy way to generate a random value is to use the command line tool `uuid` or `uuidgen` or through a website such as [uuidgenerator.net](https://www.uuidgenerator.net/). `no_root_squash` is not *technically* required but suggested. If NFS is root squashing then any request that an app running as root makes will show up as a different user to mergerfs. This is perfectly fine so long as the client software using NFS are not running as root and expect to have root like privileges. ## SMB / CIFS [SMB](https://en.wikipedia.org/wiki/Server_Message_Block) is a protocol most used by Microsoft Windows systems to share file shares, printers, etc. However, due to the popularity of Windows, it is also supported on many other platforms including Linux. The most popular way of supporting SMB on Linux is via the software Samba. ### SMB as branch Using a SMB mount as a branch in mergerfs may result in problems (permission errors) since it is not POSIX compliant. This setup is not common and has not been extensively tested. ### SMB exporting mergerfs [Samba]() and other ways of serving Linux filesystems via SMB should work fine with mergerfs. The services do not tend to use the same technologies which NFS uses and therefore don't have the same issues. There should not be special settings required export mergerfs with Samba. However, [CIFSD](https://en.wikipedia.org/wiki/CIFSD) and other programs have not been extensively tested. If you use mergerfs with CIFSD or other SMB servers please submit your experiences so these docs can be updated. NOTE: Some users have reported that when deleting files from certain Android file managers they get errors from the app and Samba but the file gets removed. This is due to a bug in Samba which has been fixed in more recent releases such as 4.21. If using Debian you can enable [backports repo](https://backports.debian.org/Instructions). ## SSHFS [SSHFS](https://en.wikipedia.org/wiki/SSHFS) is a FUSE filesystem leveraging SSH as the connection and transport layer. While often simpler to setup when compared to NFS or Samba the performance can be lacking and the project is very much in maintenance mode. There are no known issues using sshfs with mergerfs. You may want to use the following arguments to improve performance but your millage may vary. * `-o Ciphers=arcfour` * `-o Compression=no` More info can be found [here](https://ideatrash.net/2016/08/odds-and-ends-optimizing-sshfs-moving.html). ## Other There are other remote filesystems but none popularly used to serve mergerfs. If you use something not listed above feel free to reach out and I will add it to the list. mergerfs-2.42.0/mkdocs/docs/resource_usage.md0000644000000000000000000000222115177346257017672 0ustar rootroot# Resource Usage and Management ## Usage * threads * configurable number of [threads](config/threads.md) * reading from kernel * processing messages from kernel * readdir concurrency * memory * 1MB+ pre reader thread + inflight processing for messages depending on [fuse-msg-size](config/fuse-msg-size.md) * buffers allocated temporarily for reading directories * FUSE nodes * never-forget-nodes=true retained nodes, until unlinked or removed ## Management * To limit the risk of the Linux kernel's OOM Killer targeting mergerfs it sets its [oom_score_adj](https://man7.org/linux/man-pages/man5/proc_pid_oom_score_adj.5.html) value to -990. * mergerfs increases [its available file descriptor and file size limit.](https://www.man7.org/linux/man-pages/man3/setrlimit.3p.html) * mergerfs sets its [scheduling priority](https://man7.org/linux/man-pages/man3/setpriority.3p.html) (nice value) to -10 ([by default](config/options.md)), raising its CPU scheduling priority above the default of 0. * The [readahead](config/readahead.md) values of mergerfs itself and managed filesystems can be modified. mergerfs-2.42.0/mkdocs/docs/runtime_interface.md0000644000000000000000000001452315177346257020372 0ustar rootroot# Runtime Interface `mergerfs` has runtime interfaces allowing users to query certain filesystem information, get and set config, and trigger certain activities while it is running. The interface is provided via the POSIX extended attributes filesystem API which is a namespaced `key=value` pair store associated with a file. Since `mergerfs` primarily uses `key=value` pairs for config it fits well and is a known and reasonably well supported API. There are two targets for `xattr` calls. One is a pseudo file used for getting and setting config and issuing certain commands. The other are files found on the filesystem for querying certain `mergerfs` specific information about them. ## .mergerfs pseudo file ``` /.mergerfs ``` `mergerfs` provides this pseudo file for the runtime modification of certain options and issuing commands. The file will not show up in `readdir` but can be `stat`'ed and viewed/manipulated via [listxattr](http://linux.die.net/man/2/listxattr), [getxattr](https://linux.die.net/man/2/getxattr), and [setxattr](https://linux.die.net/man/2/setxattr) calls. Any changes made at runtime are **NOT** persisted. If you wish for values to persist they must be included as options wherever you configure the mounting of mergerfs (/etc/fstab, systemd, etc.). ### Command Line Tooling Extended attributes are prevalent enough that there are common tools available for interacting with them. In Debian / Ubuntu distributions you can get the tools [getfattr](https://linux.die.net/man/1/getfattr) and [setfattr](https://linux.die.net/man/1/setfattr) from [attr](https://linux.die.net/man/5/attr) package. ``` $ sudo apt-get install attr ``` ### Config #### Keys Use `getfattr -d /mountpoint/.mergerfs` to see all supported configuration keys. It is effectively the same as the [options](config/options.md) prefixed with `user.mergerfs.`. Some are informational or only can be set at startup and therefore read-only. Example: option `cache.files` would be `user.mergerfs.cache.files`. #### Values Same as the [command line options](config/options.md). #### Getting `getfattr -n user.mergerfs.branches /mountpoint/.mergerfs` `ENOATTR` will be returned if the key doesn't exist as normal with [getxattr](https://linux.die.net/man/2/getxattr). #### Setting `setfattr -n user.mergerfs.branches -v VALUE /mountpoint/.mergerfs` [setxattr](https://linux.die.net/man/2/setxattr) will return `EROFS` (Read-only filesystem) on read-only keys. `ENOATTR` will be returned if the key does not exist. If the value attempting to be set is not valid `EINVAL` will be returned. #### user.mergerfs.branches `branches` has the ability to understand some simple instructions to make manipulation of the list easier. The `[list]` is simply what is described in the [branches](config/branches.md) docs. | Value | Description | | -------- | -------------------------- | | [list] | set | | +<[list] | prepend to existing list | | +>[list] | append to existing list | | -[list] | remove all values provided | | -< | remove first in list | | -> | remove last in list | **NOTE:** if the value of `branches` is set to something invalid / non-existant `mergerfs` will return a bogus entry when the mount point directory is `stat`'ed and create a fake file entry when listing the directory telling the user "error: no valid mergerfs branch found, check config". This is done to ensure the user understands the situation and continue to be able to access the xattr interface. #### Example ``` [trapexit:/mnt/mergerfs] $ getfattr -d .mergerfs user.mergerfs.branches="/mnt/a=RW:/mnt/b=RW" user.mergerfs.minfreespace="4294967295" user.mergerfs.moveonenospc="false" ... [trapexit:/mnt/mergerfs] $ getfattr -n user.mergerfs.category.create .mergerfs user.mergerfs.category.search="mfs" [trapexit:/mnt/mergerfs] $ setfattr -n user.mergerfs.category.create -v pfrd .mergerfs [trapexit:/mnt/mergerfs] $ getfattr -n user.mergerfs.category.create .mergerfs user.mergerfs.category.search="prfd" [trapexit:/mnt/mergerfs] $ setfattr -n user.mergerfs.branches -v '+/mergerfs-.tar.gz ``` ## Debian / Ubuntu ``` $ cd mergerfs $ sudo buildtools/install-build-pkgs $ make deb $ sudo dpkg -i ../mergerfs__.deb ``` ## RHEL / CentOS / Rocky / Fedora ``` $ su - # cd mergerfs # buildtools/install-build-pkgs # make rpm # rpm -i rpmbuild/RPMS//mergerfs-..rpm ``` ## Generic Linux Have git, g++ or clang, make, python installed. ``` $ cd mergerfs $ make $ sudo make install ``` ## FreeBSD Have git, g++ or clang, gmake, python installed. ``` $ cd mergerfs $ gmake $ gmake install # as root ``` ## Build options ``` $ make help usage: make make USE_XATTR=0 - build program without xattrs functionality make STATIC=1 - build static binary make LTO=1 - build with link time optimization ``` mergerfs-2.42.0/mkdocs/docs/setup/installation.md0000644000000000000000000001070315177346257020524 0ustar rootroot# Installation If you are using a non-rolling release Linux distro such as Debian or Ubuntu then you are almost certainly going to have an old version of mergerfs installed if you use the "official" package. For that reason we provide packages for major stable released distros. Before reporting issues or bugs please be sure to upgrade to the latest release to confirm they still exist. All provided packages can be found at [https://github.com/trapexit/mergerfs/releases](https://github.com/trapexit/mergerfs/releases) ## ArchLinux 1. Setup AUR 2. `pacman -S mergerfs` ## CentOS / Rocky Get the RPM from the [releases page](https://github.com/trapexit/mergerfs/releases). ``` wget https://github.com/trapexit/mergerfs/releases/download//mergerfs-.el..rpm sudo rpm -i mergerfs-.el..rpm ``` ## Debian based OS Debian/Ubuntu/Raspberry Pi Most Debian based OS installs are of a stable branch and therefore do not have the most up to date software. While mergerfs is available via `apt` it is suggested that users install the most recent version available from the [releases page](https://github.com/trapexit/mergerfs/releases). ### prebuilt deb #### Debian ``` wget https://github.com/trapexit/mergerfs/releases/download//mergerfs_.debian-_.deb sudo dpkg -i mergerfs_.debian-_.deb ``` #### Ubuntu Given non-LTS releases are rarely used for servers and only have [9 months of support](https://ubuntu.com/about/release-cycle) we do not build packages for them by default. It is recommended that you first try the `deb` file for the LTS release most closely related to your non-LTS release. If that does not work you can use the [static build](#static-linux-binaries) or [file a ticket](https://github.com/trapexit/mergerfs/issues) requesting a package built. ``` wget https://github.com/trapexit/mergerfs/releases/download//mergerfs_.ubuntu-_.deb sudo dpkg -i mergerfs_.ubuntu-_.deb ``` ### apt ``` sudo apt install -y mergerfs ``` ## Fedora Get the RPM from the [releases page](https://github.com/trapexit/mergerfs/releases). ``` wget https://github.com/trapexit/mergerfs/releases/download//mergerfs-.fc..rpm sudo rpm -i mergerfs-.fc..rpm ``` ## SUSE/OpenSUSE Available at [filesystems repo](https://build.opensuse.org/package/show/filesystems/mergerfs) if you have not added the repo (e.g. in case of OpenSUSE Tumbleweed, rel=openSUSE_Tumbleweed): ``` zypper addrepo https://download.opensuse.org/repositories/filesystems//filesystems.repo zypper refresh zypper install mergerfs ``` ## FreeBSD [https://www.freshports.org/filesystems/mergerfs](https://www.freshports.org/filesystems/mergerfs) ``` pkg install filesystems/mergerfs ``` ## NixOS [search.nixos.org](https://search.nixos.org/packages?channel=unstable&show=mergerfs&from=0&size=50&sort=relevance&type=packages&query=mergerfs) ``` nix-env -iA nixos.mergerfs ``` ## Other Linux Distros [Check your distro.](../related_projects.md#distributions-including-mergerfs) ## Static Linux Binaries If your distro does not package mergerfs there are static binaries provided. Get the tarball from the [releases page](https://github.com/trapexit/mergerfs/releases). ``` wget https://github.com/trapexit/mergerfs/releases/download//mergerfs-static-linux_.tar.gz sudo tar xvf mergerfs-static-linux_.tar.gz -C / ``` ## Podman, Docker, OCI Containers [https://github.com/trapexit/mergerfs/pkgs/container/mergerfs](https://github.com/trapexit/mergerfs/pkgs/container/mergerfs) ``` podman pull ghcr.io/trapexit/mergerfs:TAG # or docker pull ghcr.io/trapexit/mergerfs:TAG ``` ### rootful container runtimes ``` docker run --device=/dev/fuse --cap-add=SYS_ADMIN -v /mnt/to-merge:/mnt/to-merge:rshared -v /mnt/mergerfs:/mnt/mergerfs:z,shared ghcr.io/trapexit/mergerfs:TAG -f '/mnt/to-merge/*' '/mnt/mergerfs' ``` * `--device=/dev/fuse`: Pass in host FUSE device. * `--cap-add=SYS_ADMIN`: Give proper permissions to mount. * `-v /mnt/mergerfs:/mnt/mergerfs:z,shared`: `z` and `shared` will allow the mount to be shared between the container and host and therefore other containers. * `-v /mnt/to-merge:/mnt/to-merge:rshared`: The mounts from the host to merge within the container. ### rootless container runtimes Not possible? `:shared` is not rejected but won't work the same with rootless. Podman doesn't allow the creation of pods with shared mount namespace in rootless mode. mergerfs-2.42.0/mkdocs/docs/setup/upgrade.md0000644000000000000000000000246315177346257017456 0ustar rootroot# Upgrade mergerfs can be upgraded live by mounting on top of the previous instance. Simply install the new version of mergerfs and follow the instructions below. Run mergerfs again or if using `/etc/fstab` (or systemd mount file) call for it to mount again. Existing open files and directories will continue to work fine though they won't see any differences that the new version would provide since it is still using the previous instance. If you plan on changing settings with the new mount you should / could apply those before mounting the new version. ``` $ sudo mount /mnt/mergerfs $ mount | grep mergerfs media on /mnt/mergerfs type mergerfs (rw,relatime,user_id=0,group_id=0,default_permissions,allow_other) media on /mnt/mergerfs type mergerfs (rw,relatime,user_id=0,group_id=0,default_permissions,allow_other) ``` A problem with this approach is that the underlying instance will continue to run even if the software using it stop or are restarted. To work around this you can use a "lazy umount". Before mounting over top the mount point with the new instance of mergerfs issue: `umount -l `. Or you can let mergerfs do it by setting the option `lazy-umount-mountpoint=true`. If the intent is to change settings at runtime then the [runtime interface](../runtime_interface.md) should be used. mergerfs-2.42.0/mkdocs/docs/sponsorship_and_donations.md0000644000000000000000000000147415177346257022157 0ustar rootroot# Sponsorship, Donations, Support Contracts [https://github.com/trapexit/support](https://github.com/trapexit/support) Development and support of a project like mergerfs requires a significant amount of time and effort. The software is released under the very liberal [ISC](https://opensource.org/license/isc-license-txt) license and is therefore free to use for personal or commercial uses. If you are a non-commercial user and find mergerfs and its support valuable and would like to support the project financially it would be very much appreciated. If you are using mergerfs commercially please consider sponsoring the project or purchasing a support contract to ensure it continues to be maintained and receive updates. [Reach out for more details](mailto:support@spawn.link?subject=mergerfs+support+contract+inquiry). mergerfs-2.42.0/mkdocs/docs/support.md0000644000000000000000000000520615177346257016401 0ustar rootroot# Support Filesystems are complex, as are the interactions software have with them, and therefore difficult to debug. When reporting on a suspected issue **please** include as much of the below information as possible otherwise it will be difficult or impossible to diagnose. Also please read the documentation as it provides details on many previously encountered questions/issues. **Make sure you are using the [latest release](https://github.com/trapexit/mergerfs/releases) or have tried it in comparison. Old versions, which are often included in distros like Debian and Ubuntu, are not ever going to be updated and the issue you are encountering may have been addressed already.** **For commercial support or feature requests please [contact me directly.](mailto:support@spawn.link)** ### Information to include in bug reports * [Information about the broader problem along with any attempted solutions.](https://xyproblem.info) * Solution already ruled out and why. * The details from the output of the [mergerfs.collect-info](tooling.md#mergerfscollect-info) tool. * **All** information about the relevant paths and files: permissions, ownership, etc. Some of this is collected by the tool but only the branch root details. * **All** information about the application making the requests: version, uid/gid. Try though to replicate any issues with common core utilities. * Try to recreate the problem in the simplest way using standard programs: `ln`, `mv`, `cp`, `ls`, `dd`, etc. With the most simple mergerfs setup possible such as using only a single branch, well supported branch filesystem, maybe reduce to using a single thread, etc. * Runtime environment: * Is mergerfs running within a container? * Are the client apps using mergerfs running in a container? * A `strace` of the app having problems: * `strace -fvTtt -s 256 -o /tmp/app.strace.txt ` * A `strace` of mergerfs **before** and **while** the program is trying to do whatever it is failing to do: * `strace -fvTtt -s 256 -p -o /tmp/mergerfs.strace.txt` * If mergerfs is blocking or appears stuck: * `gdb -q --batch -ex "set pagination off" -ex "thread apply all bt full" -ex quit --pid > /tmp/mergerfs.stacktrace.txt` * **Precise** step-by-step directions on replicating the issue. Do not leave **anything** out. ### Contact / Issue submission In order of preference. * github.com: [https://github.com/trapexit/mergerfs/issues](https://github.com/trapexit/mergerfs/issues) * discord: [https://discord.gg/MpAr69V](https://discord.gg/MpAr69V) * reddit: [https://www.reddit.com/r/mergerfs](https://www.reddit.com/r/mergerfs) mergerfs-2.42.0/mkdocs/docs/terminology.md0000644000000000000000000000330115177346257017227 0ustar rootroot# Terminology * `disk`, `drive`, `disk drive`: A [physical data storage device](https://en.wikipedia.org/wiki/Disk_storage). Such as a hard drive or solid-state drive. Usually requires the use of a filesystem to be useful. mergerfs does not deal with disks. * `filesystem`: Lowlevel software which provides a way to organize data and provide access to said data in a standard way. A filesystem is a higher level abstraction that may or may not be stored on a disk. mergerfs deals exclusively with filesystems. * `path`: A location within a filesystem. mergerfs can work with any path within a filesystem and not simply the root. * `branch`: A base path used in a mergerfs pool. mergerfs can accommodate multiple paths pointing to the same filesystem. * `pool`: The mergerfs mount. The union of the branches. The instance of mergerfs. You can mount multiple mergerfs pools. Even with the same branches. * `relative path`: The path in the pool relative to the branch and mount. `foo/bar` is the relative path of mergerfs mount `/mnt/mergerfs/foo/bar`. * `function`: A filesystem call such as `open`, `unlink`, `create`, `getattr`, `rmdir`, etc. The requests your software make to the filesystem. * `category`: A collection of functions based on basic behavior (action, create, search). * `policy`: The algorithm used to select a file or files when performing a function. * `path preservation`: Aspect of some policies which includes checking the path for which a file would be created. * `out-of-band`: [out-of-band](https://en.wikipedia.org/wiki/Out-of-band) in our context refers to interacting with the underlying filesystem directly instead of going through mergerfs (or NFS or Samba). mergerfs-2.42.0/mkdocs/docs/tips_notes.md0000644000000000000000000000524615177346257017060 0ustar rootroot# Tips and Notes * The documentation is explicit, literal, and reasonably thorough. If a suspected feature is not mentioned it does not exist. Do not read into the wording. What is described is how it functions. If you feel like something is not explained sufficiently please [file a ticket.](https://github.com/trapexit/mergerfs/issues) * If a `libfuse` argument is not listed it probably shouldn't be used and is unsupported. * Ensure you're using the latest version. Especially before submitting bug reports. * Run mergerfs as `root`. mergerfs is designed and intended to be run as `root` and may exhibit incorrect behavior if run otherwise. * If you do not see some directories and files you expect, policies seem to skip branches, you get strange permission errors, etc. be sure the underlying filesystems' permissions are all the same. Use `mergerfs.fsck` to audit the filesystem for out of sync permissions. * If you still have permission issues be sure you are using POSIX compliant filesystems. mergerfs doesn't generally make exceptions for FAT, NTFS, or other non-POSIX filesystem. * Unless using Linux v6.6 or above do **not** use `cache.files=off` if you expect applications to use [mmap](http://linux.die.net/man/2/mmap). Enabling `dropcacheonclose` is recommended when `cache.files=auto-full`. See [quickstart](quickstart.md). * [Kodi](http://kodi.tv), [Plex](http://plex.tv), [Subsonic](http://subsonic.org), etc. can use directory [mtime](http://linux.die.net/man/2/stat) to more efficiently determine whether to scan for new content rather than simply performing a full scan. If using the default `getattr` policy of `ff` it's possible those programs will miss an update on account of it returning the first directory found's `stat` info and it is a later directory on another mount which had the `mtime` recently updated. To fix this you will want to set `func.getattr=newest`. Remember though that this is just `stat`. If the file is later `open`'ed or `unlink`'ed and the policy is different for those then a completely different file or directory could be acted on. * Some policies mixed with some functions may result in strange behaviors. Not that some of these behaviors and race conditions couldn't happen outside mergerfs but that they are far more likely to occur on account of the attempt to merge multiple sources of data which could be out of sync due to the different policies. * For consistency it's generally best to set `category` wide policies rather than individual `func`'s. This will help limit the confusion of tools such as [rsync](http://linux.die.net/man/1/rsync). However, the flexibility is there if needed. mergerfs-2.42.0/mkdocs/docs/tooling.md0000644000000000000000000001437215177346257016344 0ustar rootroot# Tooling ## mergerfs.collect-info A tool included in recent releases of `mergerfs` which collects details about your system and configuration to help providing [support](support.md). ```text $ mergerfs.collect-info * Please have mergerfs mounted before running this tool. * Upload the following file to your GitHub ticket or put on https://pastebin.com when requesting support. * /tmp/mergerfs.info.txt ``` ## fsck.mergerfs A tool to help diagnose and solve mergerfs pool issues. Primarily related to mismatched permissions and ownership. ```text $ fsck.mergerfs --help fsck.mergerfs: A tool to help diagnose and solve mergerfs pool issues USAGE: fsck.mergerfs [OPTIONS] path POSITIONALS: path TEXT:DIR REQUIRED mergerfs path OPTIONS: -h, --help Print this help message and exit --fix TEXT:{none,manual,newest,largest} [none] Will attempt to 'fix' the problem by chown+chmod or copying files based on a selected file. * none: Do nothing. Just print details. * manual: User selects source file. * newest: Use file with most recent mtime. * largest: Use file with largest size. --check-size BOOLEAN [false] Considers file size in calculating differences --copy-file BOOLEAN [false] Copy file rather than chown/chmod to fix ``` ## preload.so EXPERIMENTAL For some time there has been work to enable IO [passthrough](config/passthrough.md) in FUSE. IO Passthrough would allow for near native performance with regards to reads and writes (at the expense of certain mergerfs features.) In Linux v6.9 that feature made its way into the kernel however in a somewhat limited form which is incompatible with aspects of how mergerfs functions and took longer to implement as a result. This preloadable library was created as an alternative to the FUSE [passthrough](config/passthrough.md) integration. `/usr/lib/mergerfs/preload.so` This [preloadable library](https://man7.org/linux/man-pages/man8/ld.so.8.html#ENVIRONMENT) overrides the creation and opening of files in order to simulate passthrough file IO. It catches the open/creat/fopen calls, has mergerfs do the call, queries mergerfs for the branch the file exists on, reopens the file on the underlying filesystem and returns that instead. Meaning that you will get native read/write performance because mergerfs is no longer part of the workflow. Keep in mind that this also means certain mergerfs features that work by interrupting the read/write workflow, such as [moveonenospc](config/moveonenospc.md), will no longer work. Also, understand that this will only work on dynamically linked software (that is dynamically linked with the same general libc version as the software being used with it.) Anything statically compiled will not work. Many GoLang and Rust apps are statically compiled. The library will not interfere with non-mergerfs filesystems. The library is written to always fallback to returning the mergerfs opened file on error. While the library was written to account for a number of edge cases there could be some yet unaccounted for so please report any oddities. Thank you to [nohajc](https://github.com/nohajc/mergerfs-io-passthrough) for prototyping the idea. ### casual usage ```sh LD_PRELOAD=/usr/lib/mergerfs/preload.so touch /mnt/mergerfs/filename ``` Or run `export LD_PRELOAD=/usr/lib/mergerfs/preload.so` in your shell or place it in your shell config file to have it be picked up by all software ran from your shell. For instance, in `bash`, add the export to `.bashrc`. ### Docker and Podman usage Assume `/mnt/fs0` and `/mnt/fs1` are pooled with mergerfs at `/media`. All mergerfs branch paths _must_ be bind mounted into the container at the same path as found on the host so the preload library can see them. **NOTE:** Since a container can have its own OS setup there is no guarantee that `preload.so` from the host install will be compatible with the loader found in the container. If that is true it simply won't work and shouldn't cause any issues. ```sh docker run \ -e LD_PRELOAD=/usr/lib/mergerfs/preload.so \ -v /usr/lib/mergerfs/preload.so:/usr/lib/mergerfs/preload.so:ro \ -v /media:/media \ -v /mnt:/mnt \ ubuntu:latest \ bash ``` or more explicitly ```sh docker run \ -e LD_PRELOAD=/usr/lib/mergerfs/preload.so \ -v /usr/lib/mergerfs/preload.so:/usr/lib/mergerfs/preload.so:ro \ -v /media:/media \ -v /mnt/fs0:/mnt/fs0 \ -v /mnt/fs1:/mnt/fs1 \ ubuntu:latest \ bash ``` ### systemd unit Use the `Environment` option to set the LD_PRELOAD variable. * [https://www.freedesktop.org/software/systemd/man/latest/systemd.service.html#Command%20lines](https://www.freedesktop.org/software/systemd/man/latest/systemd.service.html#Command%20lines) * [https://serverfault.com/questions/413397/how-to-set-environment-variable-in-systemd-service](https://serverfault.com/questions/413397/how-to-set-environment-variable-in-systemd-service) ``` [Service] Environment=LD_PRELOAD=/usr/lib/mergerfs/preload.so ``` ## Misc * https://github.com/trapexit/mergerfs-tools * **Keep in mind these tools are more to provide examples of custom behaviors that can be build on top of mergerfs. They may not have all the features you are looking for.** * mergerfs.ctl: A tool to make it easier to query and configure mergerfs at runtime * mergerfs.fsck: Provides permissions and ownership auditing and the ability to fix them (should use `fsck.mergerfs` instead) * mergerfs.dedup: Will help identify and optionally remove duplicate files * mergerfs.dup: Ensure there are at least N copies of a file across the pool * mergerfs.balance: Rebalance files across filesystems by moving them from the most filled to the least filled * mergerfs.consolidate: move files within a single mergerfs directory to the filesystem with most free space * https://github.com/trapexit/scorch * scorch: A tool to help discover silent corruption of files and keep track of files * https://github.com/trapexit/bbf * bbf (bad block finder): a tool to scan for and 'fix' hard drive bad blocks and find the files using those blocks mergerfs-2.42.0/mkdocs/generate-and-push-docs0000755000000000000000000000142515177346257017575 0ustar rootroot#!/bin/sh set -x current_branch="$(git branch --show-current)" mike delete --all --push --allow-empty --ignore-remote-status git checkout "master" mike deploy --push "latest" "master" --ignore-remote-status for tag in $(git tag -l | sort --version-sort --reverse) do case "${tag}" in *-rc*) continue ;; esac if git ls-tree -r --name-only "${tag}" | grep -q 'mkdocs.yml'; then git checkout "${tag}" mike deploy --push "${tag}" --ignore-remote-status fi done #latest="$(git tag -l | sort --version-sort --reverse | head -n 1)" #git checkout "${latest}" #mike alias --push "${latest}" "latest" #mike alias --push "latest" "latest" mike set-default --push "latest" --ignore-remote-status git checkout "${current_branch}" mergerfs-2.42.0/mkdocs/mkdocs.yml0000644000000000000000000000642615177346257015423 0ustar rootrootsite_name: mergerfs site_description: mergerfs - a featureful union filesystem site_url: https://trapexit.github.io/mergerfs/ repo_name: mergerfs repo_url: https://github.com/trapexit/mergerfs edit_uri: edit/master/mkdocs/docs/ docs_dir: docs plugins: - search - mike extra: version: provider: mike theme: name: material logo: logo.png favicon: logo.png features: - content.action.edit - content.action.view - content.code.copy - content.code.select - navigation.footer - navigation.instant - navigation.instant.prefetch - navigation.path - navigation.top - navigation.tracking - optimize - search.share - search.suggest - toc.follow palette: - media: "(prefers-color-scheme)" toggle: icon: material/brightness-auto name: Switch to light mode - media: "(prefers-color-scheme: light)" scheme: default toggle: icon: material/brightness-7 name: Switch to dark mode - media: "(prefers-color-scheme: dark)" scheme: slate toggle: icon: material/brightness-4 name: Switch to system preference markdown_extensions: - footnotes - pymdownx.highlight: auto_title: false linenums_style: pymdownx-inline anchor_linenums: true line_spans: __span pygments_lang_class: true - pymdownx.inlinehilite - pymdownx.snippets - pymdownx.superfences nav: - Home: index.md - QuickStart: quickstart.md - Installation: - setup/installation.md - setup/upgrade.md - setup/build.md - Terminology: terminology.md - Intro to Filesystems: intro_to_filesystems.md - Config: - config/options.md - config/deprecated_options.md - config/branches.md - config/branches-mount-timeout.md - config/functions_categories_policies.md - config/minfreespace.md - config/func_readdir.md - config/rename_and_link.md - config/moveonenospc.md - config/cache.md - config/passthrough.md - config/readahead.md - config/inodecalc.md - config/threads.md - config/pin-threads.md - config/proxy-ioprio.md - config/link-cow.md - config/fuse-msg-size.md - config/follow-symlinks.md - config/link-exdev.md - config/rename-exdev.md - config/symlinkify.md - config/nullrw.md - config/xattr.md - config/nfsopenhack.md - config/statfs.md - config/flush-on-close.md - config/export-support.md - config/kernel-permissions-check.md - config/lazy-umount-mountpoint.md - Error Handling and Logging: error_handling_and_logging.md - Resource Usage: resource_usage.md - Runtime Interface: runtime_interface.md - Remote Filesystems: remote_filesystems.md - Tips and Notes: tips_notes.md - Known Issues and Bugs: known_issues_bugs.md - Project Comparisons: project_comparisons.md - Benchmarking: benchmarking.md - Performance: performance.md - Tooling: tooling.md - Extended Usage Patterns: extended_usage_patterns.md - FAQ: - faq/why_isnt_it_working.md - faq/configuration_and_policies.md - faq/usage_and_functionality.md - faq/reliability_and_scalability.md - faq/compatibility_and_integration.md - faq/technical_behavior_and_limitations.md - faq/have_you_considered.md - faq/limit_drive_spinup.md - Related Projects: related_projects.md - Media and Publicity: media_and_publicity.md - Support: support.md - Sponsorship and Donations: sponsorship_and_donations.md mergerfs-2.42.0/src/0000755000000000000000000000000015177346260012711 5ustar rootrootmergerfs-2.42.0/src/assert.hpp0000644000000000000000000000346615177346257014742 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #define STATIC_ASSERT(cond) assert::StaticAssert< (cond) >() #define STATIC_ARRAYLENGTH_ASSERT(array,size) STATIC_ASSERT(((sizeof(array)/sizeof(array[0]))==(size))) namespace assert { template struct StaticAssert; template<> struct StaticAssert {}; } #ifdef NDEBUG #define ASSERT_NOT_NULL(ptr) #else #include #include #define ASSERT_NOT_NULL(ptr) \ do { \ auto *_tmp = (ptr); \ if((_tmp) == nullptr) { \ std::cerr << "ASSERT_NOT_NULL failed\n" \ << " expression: \"" #ptr "\"\n" \ << " file: " << __FILE__ << "\n" \ << " line: " << __LINE__ << "\n" \ << " function: " << __func__ << "\n"; \ assert((_tmp) != nullptr); \ } \ } while (0) #endif mergerfs-2.42.0/src/branch.cpp0000644000000000000000000000410415177346257014657 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "branch.hpp" #include "num.hpp" Branch::Branch() : mode(Branch::Mode::RW) { } Branch::Branch(const Branch &branch_) : _minfreespace(branch_._minfreespace), mode(branch_.mode), path(branch_.path) { } Branch::Branch(const u64 &default_minfreespace_) : _minfreespace(&default_minfreespace_) { } std::string Branch::to_string(void) const { std::string rv; rv = path; rv += '='; switch(mode) { default: case Branch::Mode::RW: rv += "RW"; break; case Branch::Mode::RO: rv += "RO"; break; case Branch::Mode::NC: rv += "NC"; break; } if(std::holds_alternative(_minfreespace)) { rv += ','; rv += num::humanize(std::get(_minfreespace)); } return rv; } void Branch::set_minfreespace(const u64 minfreespace_) { _minfreespace = minfreespace_; } u64 Branch::minfreespace(void) const { if(std::holds_alternative(_minfreespace)) return *std::get(_minfreespace); return std::get(_minfreespace); } bool Branch::ro(void) const { return (mode == Branch::Mode::RO); } bool Branch::nc(void) const { return (mode == Branch::Mode::NC); } bool Branch::ro_or_nc(void) const { return ((mode == Branch::Mode::RO) || (mode == Branch::Mode::NC)); } mergerfs-2.42.0/src/branch.hpp0000644000000000000000000000276615177346257014700 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "base_types.h" #include "strvec.hpp" #include "fs_path.hpp" #include #include #include #include #include #include class Branch final { public: enum class Mode { RO, RW, NC }; public: std::variant _minfreespace; Mode mode; fs::path path; public: Branch(); Branch(const Branch&); Branch(const u64 &default_minfreespace); public: Branch& operator=(const Branch&) = default; public: bool ro(void) const; bool nc(void) const; bool ro_or_nc(void) const; public: std::string to_string(void) const; public: u64 minfreespace() const; void set_minfreespace(const u64); }; mergerfs-2.42.0/src/branches.cpp0000644000000000000000000002522615177346257015217 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "branches.hpp" #include "ef.hpp" #include "errno.hpp" #include "from_string.hpp" #include "fs_glob.hpp" #include "fs_is_rofs.hpp" #include "fs_realpathize.hpp" #include "base_types.h" #include "num.hpp" #include "str.hpp" #include "syslog.hpp" #include #include #include Branches::Impl::Impl(const u64 *default_minfreespace_) : _default_minfreespace(default_minfreespace_) { } Branches::Impl& Branches::Impl::operator=(Branches::Impl &rval_) { using type = std::vector; auto this_base = dynamic_cast(this); auto rval_base = dynamic_cast(&rval_); *this_base = *rval_base; // Branches using the default minfreespace hold a pointer to their // owning Impl's _default_minfreespace. After copy/move those // pointers still reference the source Impl, so re-link them to this // Impl's _default_minfreespace. for(auto &branch : *this) { if(std::holds_alternative(branch._minfreespace)) branch._minfreespace = _default_minfreespace; } return *this; } Branches::Impl& Branches::Impl::operator=(Branches::Impl &&rval_) { using type = std::vector; auto this_base = dynamic_cast(this); auto rval_base = dynamic_cast(&rval_); *this_base = std::move(*rval_base); // Branches using the default minfreespace hold a pointer to their // owning Impl's _default_minfreespace. After copy/move those // pointers still reference the source Impl, so re-link them to this // Impl's _default_minfreespace. for(auto &branch : *this) { if(std::holds_alternative(branch._minfreespace)) branch._minfreespace = _default_minfreespace; } return *this; } const u64& Branches::Impl::minfreespace(void) const { return *_default_minfreespace; } namespace l { static void split(const std::string_view s_, std::string *instr_, std::string *values_) { u64 offset; offset = s_.find_first_not_of("+<>-="); if(offset == std::string::npos) { *instr_ = s_.substr(0, std::min(s_.size(), (size_t)2)); return; } if(offset > 1) offset = 2; *instr_ = s_.substr(0,offset); *values_ = s_.substr(offset); } static int parse_mode(const std::string &str_, Branch::Mode *mode_) { if(str_ == "RW") *mode_ = Branch::Mode::RW; ef(str_ == "RO") *mode_ = Branch::Mode::RO; ef(str_ == "NC") *mode_ = Branch::Mode::NC; else return -EINVAL; return 0; } static int parse_minfreespace(const std::string &str_, std::optional *minfreespace_) { int rv; u64 uint64; rv = str::from(str_,&uint64); if(rv < 0) return rv; *minfreespace_ = uint64; return 0; } static int parse_branch(const std::string &str_, std::string *glob_, Branch::Mode *mode_, std::optional *minfreespace_) { int rv; std::string options; std::vector v; v = str::rsplit1(str_,'='); switch(v.size()) { case 1: *glob_ = v[0]; *mode_ = Branch::Mode::RW; break; case 2: *glob_ = v[0]; options = v[1]; v = str::split(options,','); switch(v.size()) { case 2: rv = l::parse_minfreespace(v[1],minfreespace_); if(rv < 0) return rv; [[fallthrough]]; case 1: rv = l::parse_mode(v[0],mode_); if(rv < 0) return rv; break; case 0: return -EINVAL; } break; default: return -EINVAL; } return 0; } static int parse(const std::string &str_, Branches::Impl *branches_) { int rv; std::string glob; StrVec paths; Branch branch; std::optional minfreespace; branch._minfreespace = &branches_->minfreespace(); rv = l::parse_branch(str_,&glob,&branch.mode,&minfreespace); if(rv < 0) return rv; if(minfreespace.has_value()) branch._minfreespace = minfreespace.value(); fs::glob(glob,&paths); if(paths.empty()) { SysLog::notice("branch glob `{}` found no matches," " adding the literal to branches",glob); paths.push_back(glob); } fs::realpathize(&paths); for(auto &path : paths) { std::error_code ec; if(!std::filesystem::exists(path,ec)) { SysLog::notice("branch `{}` does not currently exist",path); } else if(!std::filesystem::is_directory(path,ec)) { SysLog::warning("branch `{}` is not a directory, skipping",path); continue; } branch.path = path; branches_->emplace_back(branch); } return 0; } static int set(const std::string_view str_, Branches::Impl *branches_) { int rv; StrVec paths; Branches::Impl tmp_branches(&branches_->minfreespace()); paths = str::split(str_,':'); for(auto &path : paths) { rv = l::parse(path,&tmp_branches); if(rv < 0) return rv; } *branches_ = std::move(tmp_branches); return 0; } static int add_begin(const std::string_view str_, Branches::Impl *branches_) { int rv; std::vector paths; Branches::Impl tmp_branches(&branches_->minfreespace()); paths = str::split(str_,':'); for(auto &path : paths) { rv = l::parse(path,&tmp_branches); if(rv < 0) return rv; } branches_->insert(branches_->begin(), tmp_branches.begin(), tmp_branches.end()); return 0; } static int add_end(const std::string_view str_, Branches::Impl *branches_) { int rv; StrVec paths; Branches::Impl tmp_branches(&branches_->minfreespace()); paths = str::split(str_,':'); for(auto &path : paths) { rv = l::parse(path,&tmp_branches); if(rv < 0) return rv; } branches_->insert(branches_->end(), tmp_branches.begin(), tmp_branches.end()); return 0; } static int erase_begin(Branches::Impl *branches_) { if(branches_->empty()) return -ENOENT; branches_->erase(branches_->begin()); return 0; } static int erase_end(Branches::Impl *branches_) { if(branches_->empty()) return -ENOENT; branches_->pop_back(); return 0; } static int erase_fnmatch(const std::string_view str_, Branches::Impl *branches_) { StrVec patterns; patterns = str::split(str_,':'); for(auto i = branches_->begin(); i != branches_->end();) { int match = FNM_NOMATCH; Branch &branch = *i; for(auto pi = patterns.cbegin(); pi != patterns.cend() && match != 0; ++pi) { match = ::fnmatch(pi->c_str(), branch.path.c_str(), 0); } i = ((match == 0) ? branches_->erase(i) : (i+1)); } return 0; } } int Branches::Impl::from_string(const std::string_view s_) { std::string instr; std::string values; l::split(s_,&instr,&values); if(instr == "+") return l::add_end(values,this); if(instr == "+<") return l::add_begin(values,this); if(instr == "+>") return l::add_end(values,this); if(instr == "-") return l::erase_fnmatch(values,this); if(instr == "-<") return l::erase_begin(this); if(instr == "->") return l::erase_end(this); if(instr == "=") return l::set(values,this); if(instr.empty()) return l::set(values,this); return -EINVAL; } std::string Branches::Impl::to_string(void) const { std::string tmp; if(empty()) return tmp; for(auto &branch : *this) { tmp += branch.to_string(); tmp += ':'; } tmp.pop_back(); return tmp; } void Branches::Impl::to_paths(StrVec &paths_) const { for(auto &branch : *this) { paths_.push_back(branch.path); } } std::vector Branches::Impl::to_paths() const { std::vector vp; for(const auto &branch : *this) vp.emplace_back(branch.path); return vp; } int Branches::from_string(const std::string_view str_) { int rv; Branches::Ptr impl; Branches::Ptr new_impl; impl = std::atomic_load(&_impl); new_impl = std::make_shared(&minfreespace); *new_impl = *impl; rv = new_impl->from_string(str_); if(rv < 0) return rv; std::atomic_store(&_impl,new_impl); return 0; } std::string Branches::to_string(void) const { return std::atomic_load(&_impl)->to_string(); } void Branches::find_and_set_mode_ro() { Branches::Ptr impl; Branches::Ptr new_impl; impl = std::atomic_load(&_impl); new_impl = std::make_shared(&minfreespace); *new_impl = *impl; bool changed = false; for(auto &branch : *new_impl) { if(branch.mode != Branch::Mode::RW) continue; if(!fs::is_rofs_but_not_mounted_ro(branch.path)) continue; SysLog::warning("branch `{}` found to be readonly - setting its mode=RO", branch.path.string()); branch.mode = Branch::Mode::RO; changed = true; } if(not changed) return; std::atomic_store(&_impl,new_impl); } SrcMounts::SrcMounts(Branches &b_) : _branches(b_) { } int SrcMounts::from_string(const std::string_view s_) { // return _branches.from_string(s_); return 0; } std::string SrcMounts::to_string(void) const { std::string rv; Branches::Ptr branches = _branches; if(branches->empty()) return rv; for(const auto &branch : *branches) { rv += branch.path; rv += ':'; } rv.pop_back(); return rv; } mergerfs-2.42.0/src/branches.hpp0000644000000000000000000000455415177346257015225 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "branch.hpp" #include "fs_path.hpp" #include "strvec.hpp" #include "tofrom_string.hpp" #include #include #include #include #include #define MINFREESPACE_DEFAULT (4294967295ULL) class Branches final : public ToFromString { public: class Impl final : public ToFromString, public std::vector { private: const u64 *_default_minfreespace; public: using Ptr = std::shared_ptr; public: Impl(const u64 *default_minfreespace); public: int from_string(const std::string_view str) final; std::string to_string(void) const final; public: const u64 &minfreespace(void) const; void to_paths(StrVec &strvec) const; std::vector to_paths() const; public: Impl& operator=(Impl &impl_); Impl& operator=(Impl &&impl_); }; public: using Ptr = Branches::Impl::Ptr; public: u64 minfreespace = MINFREESPACE_DEFAULT; private: mutable std::shared_ptr _impl; public: Branches() : _impl(std::make_shared(&minfreespace)) { } public: int from_string(const std::string_view str) final; std::string to_string(void) const final; public: operator Ptr() const { return std::atomic_load(&_impl); } Ptr operator->() const { return std::atomic_load(&_impl); } public: void find_and_set_mode_ro(); }; class SrcMounts : public ToFromString { public: SrcMounts(Branches &b); public: int from_string(const std::string_view str) final; std::string to_string(void) const final; private: Branches &_branches; }; mergerfs-2.42.0/src/buildmap.hpp0000644000000000000000000000235515177346257015232 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include #include template class buildmap { public: buildmap(const K &key_, const V &val_) { _map.insert(std::make_pair(key_,val_)); } buildmap &operator()(const K &key_, const V &val_) { _map.insert(std::make_pair(key_,val_)); return *this; } operator std::map() { return _map; } private: std::map _map; }; mergerfs-2.42.0/src/buildvector.hpp0000644000000000000000000000235615177346257015760 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include #include template class buildvector { public: buildvector(const V &val_) { _vector.push_back(val_); } buildvector &operator()(const V &val_) { _vector.push_back(val_); return *this; } operator std::vector() { if(SORT == true) std::sort(_vector.begin(),_vector.end()); return _vector; } private: std::vector _vector; }; mergerfs-2.42.0/src/caps.cpp0000644000000000000000000000467315177346257014363 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "caps.hpp" #if defined __linux__ #include #include #include #include #include #include #include #include #include #include #include #include #include static int capset(cap_user_header_t header_, const cap_user_data_t data_) { return ::syscall(SYS_capset,header_,data_); } static int capget(cap_user_header_t header_, cap_user_data_t data_) { return ::syscall(SYS_capget,header_,data_); } static int capset(int cap_bit_) { int rv; struct __user_cap_header_struct header; struct __user_cap_data_struct data[2]; header.version = _LINUX_CAPABILITY_VERSION_3; header.pid = 0; rv = capget(&header,data); if(rv < 0) return rv; int word = cap_bit_ / 32; int bit = cap_bit_ % 32; data[word].permitted |= (1 << bit); data[word].effective |= (1 << bit); data[word].inheritable |= (1 << bit); rv = capset(&header,data); if(rv < 0) return rv; return 0; } int caps::setup() { int rv; rv = capset(CAP_DAC_OVERRIDE); if(rv < 0) return rv; rv = capset(CAP_DAC_READ_SEARCH); if(rv < 0) return rv; rv = capset(CAP_FOWNER); if(rv < 0) return rv; rv = capset(CAP_CHOWN); if(rv < 0) return rv; rv = capset(CAP_SETUID); if(rv < 0) return rv; rv = capset(CAP_SETGID); if(rv < 0) return rv; rv = prctl(PR_SET_SECUREBITS, SECBIT_KEEP_CAPS | SECBIT_NO_SETUID_FIXUP); if(rv < 0) return -errno; return 0; } #else #include int caps::setup() { return -ENOSYS; } #endif mergerfs-2.42.0/src/caps.hpp0000644000000000000000000000152515177346257014361 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once namespace caps { int setup(); } mergerfs-2.42.0/src/category.cpp0000644000000000000000000000235415177346257015244 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "category.hpp" #include "errno.hpp" #include "str.hpp" #include int Category::Base::from_string(const std::string_view s_) { int rv; for(auto func : funcs) { rv = func->from_string(s_); if(rv < 0) return rv; } return 0; } std::string Category::Base::to_string(void) const { std::set rv; for(const auto func : funcs) rv.insert(func->to_string()); return str::join(rv,','); } mergerfs-2.42.0/src/category.hpp0000644000000000000000000000474115177346257015253 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "tofrom_string.hpp" #include "funcs.hpp" #include "func.hpp" #include namespace Category { class Base : public ToFromString { public: int from_string(const std::string_view s) final; std::string to_string() const final; protected: std::vector funcs; }; class Action final : public Base { private: Action(); public: Action(Funcs &funcs_) { funcs.push_back(&funcs_.chmod); funcs.push_back(&funcs_.chown); funcs.push_back(&funcs_.link); funcs.push_back(&funcs_.removexattr); funcs.push_back(&funcs_.rename); funcs.push_back(&funcs_.rmdir); funcs.push_back(&funcs_.setxattr); funcs.push_back(&funcs_.truncate); funcs.push_back(&funcs_.unlink); funcs.push_back(&funcs_.utimens); } }; class Create final : public Base { private: Create(); public: Create(Funcs &funcs_) { funcs.push_back(&funcs_.create); funcs.push_back(&funcs_.mkdir); funcs.push_back(&funcs_.mknod); funcs.push_back(&funcs_.symlink); } }; class Search final : public Base { private: Search(); public: Search(Funcs &funcs_) { funcs.push_back(&funcs_.access); funcs.push_back(&funcs_.getattr); funcs.push_back(&funcs_.getxattr); funcs.push_back(&funcs_.listxattr); funcs.push_back(&funcs_.open); funcs.push_back(&funcs_.readlink); } }; } class Categories final { private: Categories(); public: Categories(Funcs &funcs_) : action(funcs_), create(funcs_), search(funcs_) {} public: Category::Action action; Category::Create create; Category::Search search; }; mergerfs-2.42.0/src/config.cpp0000644000000000000000000003466715177346257014710 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "config.hpp" #include "errno.hpp" #include "fmt/core.h" #include "fs_path.hpp" #include "nonstd/string.hpp" #include "str.hpp" #include "version.hpp" #include #include #include constexpr const char CACHE_FILES_PROCESS_NAMES_DEFAULT[] = "rtorrent|" "qbittorrent-nox"; Config cfg; thread_local int Config::CfgConfigFile::_depth = 0; Config::CfgConfigFile::CfgConfigFile() { } int Config::CfgConfigFile::from_string(const std::string_view s_) { int rv; fs::path cfg_file; if(_depth > 5) return -ELOOP; _depth++; struct DepthGuard { int &d; ~DepthGuard() { --d; } } guard{_depth}; cfg_file = (s_.empty() ? _cfg_file : s_); rv = cfg.from_file(cfg_file); if(rv == 0) _cfg_file = cfg_file; return rv; } std::string Config::CfgConfigFile::to_string() const { return _cfg_file; } Config::Config() : allow_idmap(true), async_read(true), branches(), branches_mount_timeout(0), branches_mount_timeout_fail(false), cache_attr(1), cache_entry(1), cache_files(CacheFiles::ENUM::OFF), cache_files_process_names(CACHE_FILES_PROCESS_NAMES_DEFAULT), cache_negative_entry(0), cache_readdir(false), cache_statfs(0), cache_symlinks(false), cache_writeback(false), category(func), config_file(), direct_io_allow_mmap(true), dropcacheonclose(false), export_support(true), flushonclose(FlushOnClose::ENUM::OPENED_FOR_WRITE), follow_symlinks(FollowSymlinks::ENUM::NEVER), fsname(), func(), fuse_msg_size("1M"), handle_killpriv(true), handle_killpriv_v2(true), ignorepponrename(false), inodecalc("hybrid-hash"), kernel_permissions_check(true), lazy_umount_mountpoint(false), link_cow(false), link_exdev(LinkEXDEV::ENUM::PASSTHROUGH), log_file({}), minfreespace(branches.minfreespace), mountpoint(), moveonenospc(true), nfsopenhack(NFSOpenHack::ENUM::OFF), nullrw(false), parallel_direct_writes(true), passthrough_io(PassthroughIO::ENUM::OFF), passthrough_max_stack_depth(fuse_cfg.passthrough_max_stack_depth), pin_threads(fuse_cfg.pin_threads), posix_acl(false), process_thread_count(fuse_cfg.process_thread_count), process_thread_queue_depth(fuse_cfg.process_thread_queue_depth), proxy_ioprio(false), read_thread_count(fuse_cfg.read_thread_count), readahead(0), readdir("seq"), rename_exdev(RenameEXDEV::ENUM::PASSTHROUGH), scheduling_priority(-10), security_capability(true), statfs(StatFS::ENUM::BASE), statfs_ignore(StatFSIgnore::ENUM::NONE), symlinkify(false), symlinkify_timeout(3600), xattr(XAttr::ENUM::PASSTHROUGH), _congestion_threshold(fuse_cfg.congestion_threshold), _debug(false), _gid(fuse_cfg.gid), _max_background(fuse_cfg.max_background), _mount(mountpoint), _mountpoint(mountpoint), _srcmounts(branches), _threads(fuse_cfg.read_thread_count), _uid(fuse_cfg.uid), _umask(fuse_cfg.umask), _version(MERGERFS_VERSION), _initialized(false) { _congestion_threshold.ro = _max_background.ro = _mount.ro = _mountpoint.ro = _never_forget_nodes.ro = _noforget.ro = _remember.ro = _remember_nodes.ro = _srcmounts.ro = _version.ro = allow_idmap.ro = async_read.ro = branches_mount_timeout.ro = branches_mount_timeout_fail.ro = cache_symlinks.ro = cache_writeback.ro = direct_io_allow_mmap.ro = export_support.ro = fsname.ro = fuse_msg_size.ro = handle_killpriv.ro = handle_killpriv_v2.ro = kernel_permissions_check.ro = nullrw.ro = pid.ro = pin_threads.ro = posix_acl.ro = process_thread_count.ro = process_thread_queue_depth.ro = read_thread_count.ro = scheduling_priority.ro = true; _congestion_threshold.display = _gid.display = _max_background.display = _mount.display = _noforget.display = _remember.display = _remember_nodes.display = _srcmounts.display = _threads.display = _uid.display = _umask.display = false; _map["allow-idmap"] = &allow_idmap; _map["async-read"] = &async_read; _map["atomic-o-trunc"] = &_dummy; _map["auto-cache"] = &_dummy; _map["big-writes"] = &_dummy; _map["branches"] = &branches; _map["branches-mount-timeout"] = &branches_mount_timeout; _map["branches-mount-timeout-fail"] = &branches_mount_timeout_fail; _map["cache.attr"] = &cache_attr; _map["cache.entry"] = &cache_entry; _map["cache.files"] = &cache_files; _map["cache.files.process-names"] = &cache_files_process_names; _map["cache.negative-entry"] = &cache_negative_entry; _map["cache.open"] = &_dummy; _map["cache.readdir"] = &cache_readdir; _map["cache.statfs"] = &cache_statfs; _map["cache.symlinks"] = &cache_symlinks; _map["cache.writeback"] = &cache_writeback; _map["category.action"] = &category.action; _map["category.create"] = &category.create; _map["category.search"] = &category.search; _map["config"] = &config_file; _map["debug"] = &_debug; _map["defaults"] = &_dummy; _map["direct-io"] = &_dummy; _map["direct-io-allow-mmap"] = &direct_io_allow_mmap; _map["dropcacheonclose"] = &dropcacheonclose; _map["export-support"] = &export_support; _map["flush-on-close"] = &flushonclose; _map["follow-symlinks"] = &follow_symlinks; _map["fsname"] = &fsname; _map["func.access"] = &func.access; _map["func.chmod"] = &func.chmod; _map["func.chown"] = &func.chown; _map["func.create"] = &func.create; _map["func.getattr"] = &func.getattr; _map["func.getxattr"] = &func.getxattr; _map["func.link"] = &func.link; _map["func.listxattr"] = &func.listxattr; _map["func.mkdir"] = &func.mkdir; _map["func.mknod"] = &func.mknod; _map["func.open"] = &func.open; _map["func.readdir"] = &readdir; _map["func.readlink"] = &func.readlink; _map["func.removexattr"] = &func.removexattr; _map["func.rename"] = &func.rename; _map["func.rmdir"] = &func.rmdir; _map["func.setxattr"] = &func.setxattr; _map["func.symlink"] = &func.symlink; _map["func.truncate"] = &func.truncate; _map["func.unlink"] = &func.unlink; _map["func.utimens"] = &func.utimens; _map["fuse-msg-size"] = &fuse_msg_size; _map["gid"] = &_gid; _map["gid-cache.expire-timeout"] = &_dummy; _map["gid-cache.remove-timeout"] = &_dummy; _map["handle-killpriv"] = &handle_killpriv; _map["handle-killpriv-v2"] = &handle_killpriv_v2; _map["hard-remove"] = &_dummy; _map["ignorepponrename"] = &ignorepponrename; _map["inodecalc"] = &inodecalc; _map["kernel-cache"] = &_dummy; _map["kernel-permissions-check"] = &kernel_permissions_check; _map["lazy-umount-mountpoint"] = &lazy_umount_mountpoint; _map["link-cow"] = &link_cow; _map["link-exdev"] = &link_exdev; _map["log.file"] = &log_file; _map["minfreespace"] = &minfreespace; _map["mount"] = &_mount; _map["mountpoint"] = &_mountpoint; _map["moveonenospc"] = &moveonenospc; _map["negative-entry"] = &_dummy; _map["never-forget-nodes"] = &_never_forget_nodes; _map["nfsopenhack"] = &nfsopenhack; _map["no-splice-move"] = &_dummy; _map["no-splice-read"] = &_dummy; _map["no-splice-write"] = &_dummy; _map["noforget"] = &_noforget; _map["nonempty"] = &_dummy; _map["nullrw"] = &nullrw; _map["parallel-direct-writes"] = ¶llel_direct_writes; _map["passthrough.io"] = &passthrough_io; _map["passthrough.max-stack-depth"] = &passthrough_max_stack_depth; _map["pid"] = &pid; _map["pin-threads"] = &pin_threads; _map["posix-acl"] = &posix_acl; _map["process-thread-count"] = &process_thread_count; _map["process-thread-queue-depth"] = &process_thread_queue_depth; _map["proxy-ioprio"] = &proxy_ioprio; _map["read-thread-count"] = &read_thread_count; _map["readahead"] = &readahead; _map["remember"] = &_remember; _map["remember-nodes"] = &_remember_nodes; _map["rename-exdev"] = &rename_exdev; _map["scheduling-priority"] = &scheduling_priority; _map["security-capability"] = &security_capability; _map["splice-move"] = &_dummy; _map["splice-read"] = &_dummy; _map["splice-write"] = &_dummy; _map["srcmounts"] = &_srcmounts; _map["statfs"] = &statfs; _map["statfs-ignore"] = &statfs_ignore; _map["symlinkify"] = &symlinkify; _map["symlinkify-timeout"] = &symlinkify_timeout; _map["threads"] = &_threads; _map["uid"] = &_uid; _map["umask"] = &_umask; _map["use-ino"] = &_dummy; _map["version"] = &_version; _map["xattr"] = &xattr; } bool Config::has_key(const std::string &key_) const { return _map.count(key_); } ssize_t Config::keys_listxattr_size() const { ssize_t rv; rv = 0; for(const auto &[key,val] : _map) { if(val->display == false) continue; rv += sizeof("user.mergerfs."); rv += key.size(); } return rv; } ssize_t Config::keys_listxattr(char *list_, size_t size_) const { char *list = list_; ssize_t size = size_; if(size_ == 0) return keys_listxattr_size(); for(const auto &[key,val] : _map) { if(val->display == false) continue; static constexpr std::string_view prefix = "user.mergerfs."; ssize_t entry_size = (ssize_t)(prefix.size() + key.size() + 1); if(entry_size > size) return -ERANGE; memcpy(list, prefix.data(), prefix.size()); list += prefix.size(); memcpy(list, key.data(), key.size()); list += key.size(); *list++ = '\0'; size -= entry_size; } return (list - list_); } int Config::get(const std::string &key_, std::string *val_) const { std::string key; Str2TFStrMap::const_iterator i; key = str::replace(key_,'_','-'); i = _map.find(key); if(i == _map.end()) return -ENOATTR; *val_ = i->second->to_string(); return 0; } int Config::set(const std::string &key_, const std::string &value_) { std::string key; Str2TFStrMap::iterator i; key = str::replace(key_,'_','-'); i = _map.find(key); if(i == _map.end()) return -ENOATTR; if(_initialized && i->second->ro) return -EROFS; return i->second->from_string(value_); } int Config::set(const std::string &kv_) { auto [key, val] = str::splitkv(kv_,'='); key = str::trim(key); val = str::trim(val); return set(key,val); } int Config::from_stream(std::istream &istrm_) { std::string line; Config::ErrVec new_errs; while(std::getline(istrm_,line,'\n')) { line = str::trim(line); if(line.empty() || (line[0] == '#')) continue; int rv = set(line); if(rv < 0) new_errs.push_back({-rv,line}); } errs.insert(errs.end(), new_errs.begin(), new_errs.end()); return (new_errs.empty() ? 0 : -EINVAL); } int Config::from_file(const std::string &filepath_) { std::ifstream ifstrm; errno = 0; ifstrm.open(filepath_); if(!ifstrm.good()) { errno = errno ? errno : EIO; errs.push_back({errno,filepath_}); return -errno; } return from_stream(ifstrm); } void Config::finish_initializing() { _initialized = true; } bool Config::is_rootdir(const fs::path &fusepath_) { return fusepath_.empty(); } bool Config::is_ctrl_file(const fs::path &fusepath_) { return (fusepath_ == ".mergerfs"); } bool Config::is_mergerfs_xattr(const char *attrname_) { return str::startswith(attrname_,"user.mergerfs."); } bool Config::is_cmd_xattr(const std::string_view &attrname_) { return nonstd::starts_with(attrname_,"user.mergerfs.cmd."); } std::string_view Config::prune_ctrl_xattr(const std::string_view s_) { constexpr size_t offset = (sizeof("user.mergerfs.") - 1); if(offset < s_.size()) return s_.substr(offset); return {}; } std::string_view Config::prune_cmd_xattr(const std::string_view &s_) { constexpr size_t offset = (sizeof("user.mergerfs.cmd.") - 1); if(offset < s_.size()) return s_.substr(offset); return {}; } std::string Config::Err::to_string() const { std::string s; switch(err) { case 0: break; case EINVAL: s = "invalid value"; break; case ENOATTR: s = "unknown option"; break; case EROFS: s = "read-only option"; break; case ELOOP: s = "too many levels of config"; break; case ENOENT: s = "no value set"; break; default: s = strerror(err); break; } return fmt::format("{} - {}",s,str); } mergerfs-2.42.0/src/config.hpp0000644000000000000000000001420715177346257014701 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "branches.hpp" #include "category.hpp" #include "config_cachefiles.hpp" #include "config_debug.hpp" #include "config_dummy.hpp" #include "config_flushonclose.hpp" #include "config_follow_symlinks.hpp" #include "config_inodecalc.hpp" #include "config_link_exdev.hpp" #include "config_log_file.hpp" #include "config_moveonenospc.hpp" #include "config_nfsopenhack.hpp" #include "config_noforget.hpp" #include "config_pagesize.hpp" #include "config_passthrough_io.hpp" #include "config_pid.hpp" #include "config_proxy_ioprio.hpp" #include "config_rename_exdev.hpp" #include "config_set.hpp" #include "config_statfs.hpp" #include "config_statfsignore.hpp" #include "config_xattr.hpp" #include "enum.hpp" #include "errno.hpp" #include "fs_path.hpp" #include "funcs.hpp" #include "fuse_cfg.hpp" #include "fuse_readdir.hpp" #include "policy.hpp" #include "tofrom_ref.hpp" #include "tofrom_wrapper.hpp" #include "syslog.hpp" #include "fuse.h" #include "base_types.h" #include #include #include #include #include typedef ToFromWrapper ConfigBOOL; typedef ToFromWrapper ConfigU64; typedef ToFromWrapper ConfigS64; typedef ToFromWrapper ConfigINT; typedef ToFromWrapper ConfigSTR; typedef ToFromWrapper ConfigPath; typedef std::map Str2TFStrMap; typedef ROToFromWrapper ConfigROSTR; class Config { public: struct Err { int err; std::string str; std::string to_string() const; }; typedef std::vector ErrVec; public: ErrVec errs; public: class CfgConfigFile : public ToFromString { private: fs::path _cfg_file; static thread_local int _depth; public: CfgConfigFile(); public: int from_string(const std::string_view s_) final; std::string to_string(void) const final; }; public: Config(); public: ConfigBOOL allow_idmap; ConfigBOOL async_read; Branches branches; ConfigU64 branches_mount_timeout; ConfigBOOL branches_mount_timeout_fail; ConfigU64 cache_attr; ConfigU64 cache_entry; CacheFiles cache_files; ConfigSet cache_files_process_names; ConfigU64 cache_negative_entry; ConfigBOOL cache_readdir; ConfigU64 cache_statfs; ConfigBOOL cache_symlinks; ConfigBOOL cache_writeback; Categories category; CfgConfigFile config_file; ConfigBOOL direct_io_allow_mmap; ConfigBOOL dropcacheonclose; ConfigBOOL export_support; FlushOnClose flushonclose; FollowSymlinks follow_symlinks; ConfigSTR fsname; Funcs func; ConfigPageSize fuse_msg_size; ConfigBOOL handle_killpriv; ConfigBOOL handle_killpriv_v2; ConfigBOOL ignorepponrename; InodeCalc inodecalc; ConfigBOOL kernel_permissions_check; ConfigBOOL lazy_umount_mountpoint; ConfigBOOL link_cow; LinkEXDEV link_exdev; LogFile log_file; TFSRef minfreespace; fs::path mountpoint; MoveOnENOSPC moveonenospc; NFSOpenHack nfsopenhack; ConfigBOOL nullrw; ConfigBOOL parallel_direct_writes; PassthroughIO passthrough_io; TFSRef passthrough_max_stack_depth; ConfigGetPid pid; TFSRef pin_threads; ConfigBOOL posix_acl; TFSRef process_thread_count; TFSRef process_thread_queue_depth; ProxyIOPrio proxy_ioprio; TFSRef read_thread_count; ConfigU64 readahead; FUSE::ReadDir readdir; RenameEXDEV rename_exdev; ConfigINT scheduling_priority; ConfigBOOL security_capability; StatFS statfs; StatFSIgnore statfs_ignore; ConfigBOOL symlinkify; ConfigS64 symlinkify_timeout; XAttr xattr; private: TFSRef _congestion_threshold; Debug _debug; CfgDummy _dummy; TFSRef _gid; TFSRef _max_background; TFSRef _mount; TFSRef _mountpoint; CfgNoforget _never_forget_nodes; CfgNoforget _noforget; CfgNoforget _remember; CfgNoforget _remember_nodes; SrcMounts _srcmounts; TFSRef _threads; TFSRef _uid; TFSRef _umask; ConfigROSTR _version; private: bool _initialized; public: void finish_initializing(); public: friend std::ostream& operator<<(std::ostream &s, const Config &c); public: bool has_key(const std::string &key) const; ssize_t keys_listxattr(char *list, size_t size) const; ssize_t keys_listxattr_size() const; const Str2TFStrMap& get_map() const { return _map; } public: int get(const std::string &key, std::string *val) const; int set(const std::string &key, const std::string &val); int set(const std::string &kv); public: int from_stream(std::istream &istrm); int from_file(const std::string &filepath); public: static bool is_rootdir(const fs::path &fusepath); static bool is_ctrl_file(const fs::path &fusepath); static bool is_mergerfs_xattr(const char *attrname); static bool is_cmd_xattr(const std::string_view &attrname); static std::string_view prune_ctrl_xattr(const std::string_view s); static std::string_view prune_cmd_xattr(const std::string_view &s); private: Str2TFStrMap _map; }; extern Config cfg; mergerfs-2.42.0/src/config_cachefiles.cpp0000644000000000000000000000323715177346257017043 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "config_cachefiles.hpp" #include "ef.hpp" #include "errno.hpp" template<> std::string CacheFiles::to_string() const { switch(_data) { case CacheFiles::ENUM::OFF: return "off"; case CacheFiles::ENUM::PARTIAL: return "partial"; case CacheFiles::ENUM::FULL: return "full"; case CacheFiles::ENUM::AUTO_FULL: return "auto-full"; case CacheFiles::ENUM::PER_PROCESS: return "per-process"; } return "invalid"; } template<> int CacheFiles::from_string(const std::string_view s_) { if(s_ == "off") _data = CacheFiles::ENUM::OFF; ef(s_ == "partial") _data = CacheFiles::ENUM::PARTIAL; ef(s_ == "full") _data = CacheFiles::ENUM::FULL; ef(s_ == "auto-full") _data = CacheFiles::ENUM::AUTO_FULL; ef(s_ == "per-process") _data = CacheFiles::ENUM::PER_PROCESS; else return -EINVAL; return 0; } mergerfs-2.42.0/src/config_cachefiles.hpp0000644000000000000000000000172415177346257017047 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "enum.hpp" enum class CacheFilesEnum { OFF, PARTIAL, FULL, AUTO_FULL, PER_PROCESS }; typedef Enum CacheFiles; mergerfs-2.42.0/src/config_debug.cpp0000644000000000000000000000303515177346257016037 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "config_debug.hpp" #include "debug.hpp" #include "from_string.hpp" #include "fuse_cfg.hpp" #include "to_string.hpp" #include #include Debug::Debug(const bool v_) { fuse_cfg.debug = v_; } std::string Debug::to_string(void) const { return str::to(fuse_cfg.debug); } int Debug::from_string(const std::string_view s_) { int rv; bool val; rv = str::from(s_,&val); if(rv < 0) return rv; fuse_cfg.debug = val; // If debug is being enabled, ensure output file is set if(val) { auto log_file_path = fuse_cfg.log_filepath(); if(log_file_path && !log_file_path->empty()) fuse_debug_set_output(*log_file_path); else fuse_debug_set_output({}); // Use stderr } return 0; } mergerfs-2.42.0/src/config_debug.hpp0000644000000000000000000000177115177346257016051 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "tofrom_string.hpp" class Debug : public ToFromString { public: Debug(const bool); public: std::string to_string(void) const final; int from_string(const std::string_view) final; }; mergerfs-2.42.0/src/config_dummy.hpp0000644000000000000000000000205215177346257016107 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "tofrom_string.hpp" class CfgDummy : public ToFromString { public: CfgDummy() { display = false; } std::string to_string() const { return {}; } int from_string(const std::string_view) { return 0; } }; mergerfs-2.42.0/src/config_flushonclose.cpp0000644000000000000000000000272415177346257017461 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "config_flushonclose.hpp" #include "ef.hpp" #include "errno.hpp" template<> std::string FlushOnClose::to_string() const { switch(_data) { case FlushOnClose::ENUM::NEVER: return "never"; case FlushOnClose::ENUM::OPENED_FOR_WRITE: return "opened-for-write"; case FlushOnClose::ENUM::ALWAYS: return "always"; } return {}; } template<> int FlushOnClose::from_string(const std::string_view s_) { if(s_ == "never") _data = FlushOnClose::ENUM::NEVER; ef(s_ == "opened-for-write") _data = FlushOnClose::ENUM::OPENED_FOR_WRITE; ef(s_ == "always") _data = FlushOnClose::ENUM::ALWAYS; else return -EINVAL; return 0; } mergerfs-2.42.0/src/config_flushonclose.hpp0000644000000000000000000000170715177346257017466 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "enum.hpp" enum class FlushOnCloseEnum { NEVER, OPENED_FOR_WRITE, ALWAYS }; typedef Enum FlushOnClose; mergerfs-2.42.0/src/config_follow_symlinks.cpp0000644000000000000000000000311315177346257020201 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "config_follow_symlinks.hpp" #include "ef.hpp" #include "errno.hpp" template<> std::string FollowSymlinks::to_string(void) const { switch(_data) { case FollowSymlinks::ENUM::NEVER: return "never"; case FollowSymlinks::ENUM::DIRECTORY: return "directory"; case FollowSymlinks::ENUM::REGULAR: return "regular"; case FollowSymlinks::ENUM::ALL: return "all"; } return "invalid"; } template<> int FollowSymlinks::from_string(const std::string_view s_) { if(s_ == "never") _data = FollowSymlinks::ENUM::NEVER; ef(s_ == "directory") _data = FollowSymlinks::ENUM::DIRECTORY; ef(s_ == "regular") _data = FollowSymlinks::ENUM::REGULAR; ef(s_ == "all") _data = FollowSymlinks::ENUM::ALL; else return -EINVAL; return 0; } mergerfs-2.42.0/src/config_follow_symlinks.hpp0000644000000000000000000000171615177346257020215 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "enum.hpp" enum class FollowSymlinksEnum { NEVER, DIRECTORY, REGULAR, ALL }; typedef Enum FollowSymlinks; mergerfs-2.42.0/src/config_inodecalc.cpp0000644000000000000000000000214515177346257016673 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "config_inodecalc.hpp" #include "fs_inode.hpp" InodeCalc::InodeCalc(const std::string &s_) { fs::inode::set_algo(s_); } std::string InodeCalc::to_string(void) const { return fs::inode::get_algo(); } int InodeCalc::from_string(const std::string_view s_) { return fs::inode::set_algo(std::string{s_}); } mergerfs-2.42.0/src/config_inodecalc.hpp0000644000000000000000000000201315177346257016672 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "tofrom_string.hpp" class InodeCalc : public ToFromString { public: InodeCalc(const std::string &); public: std::string to_string(void) const final; int from_string(const std::string_view) final; }; mergerfs-2.42.0/src/config_link_exdev.cpp0000644000000000000000000000321415177346257017100 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "config_link_exdev.hpp" #include "ef.hpp" #include "errno.hpp" template<> std::string LinkEXDEV::to_string(void) const { switch(_data) { case LinkEXDEV::ENUM::PASSTHROUGH: return "passthrough"; case LinkEXDEV::ENUM::REL_SYMLINK: return "rel-symlink"; case LinkEXDEV::ENUM::ABS_BASE_SYMLINK: return "abs-base-symlink"; case LinkEXDEV::ENUM::ABS_POOL_SYMLINK: return "abs-pool-symlink"; } return "invalid"; } template<> int LinkEXDEV::from_string(const std::string_view s_) { if(s_ == "passthrough") _data = LinkEXDEV::ENUM::PASSTHROUGH; ef(s_ == "rel-symlink") _data = LinkEXDEV::ENUM::REL_SYMLINK; ef(s_ == "abs-base-symlink") _data = LinkEXDEV::ENUM::ABS_BASE_SYMLINK; ef(s_ == "abs-pool-symlink") _data = LinkEXDEV::ENUM::ABS_POOL_SYMLINK; else return -EINVAL; return 0; } mergerfs-2.42.0/src/config_link_exdev.hpp0000644000000000000000000000173515177346257017113 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "enum.hpp" enum class LinkEXDEVEnum { PASSTHROUGH, REL_SYMLINK, ABS_BASE_SYMLINK, ABS_POOL_SYMLINK }; typedef Enum LinkEXDEV; mergerfs-2.42.0/src/config_log_file.cpp0000644000000000000000000000235615177346257016536 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "config_log_file.hpp" #include "debug.hpp" #include "fuse_cfg.hpp" #include #include LogFile::LogFile(const std::string &s_) { if(!s_.empty()) fuse_debug_set_output(s_); } std::string LogFile::to_string(void) const { auto filepath = fuse_cfg.log_filepath(); return (filepath ? *filepath : ""); } int LogFile::from_string(const std::string_view s_) { const std::string s{s_}; return fuse_debug_set_output(s); } mergerfs-2.42.0/src/config_log_file.hpp0000644000000000000000000000200615177346257016533 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "tofrom_string.hpp" class LogFile : public ToFromString { public: LogFile(const std::string &); public: std::string to_string(void) const final; int from_string(const std::string_view) final; }; mergerfs-2.42.0/src/config_moveonenospc.cpp0000644000000000000000000000267015177346257017470 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "config_moveonenospc.hpp" #include "ef.hpp" #include "errno.hpp" #include "from_string.hpp" int MoveOnENOSPC::from_string(const std::string_view s_) { int rv; std::string s; Policy::CreateImpl *tmp; rv = str::from(s_,&enabled); if((rv == 0) && (enabled == true)) s = "pfrd"; ef((rv == 0) && (enabled == false)) return (enabled = false,0); ef(rv != 0) s = s_; else return -EINVAL; tmp = Policies::Create::find(s); if(tmp == NULL) return -EINVAL; policy = tmp; enabled = true; return 0; } std::string MoveOnENOSPC::to_string(void) const { if(enabled) return policy.name(); return "false"; } mergerfs-2.42.0/src/config_moveonenospc.hpp0000644000000000000000000000231015177346257017464 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "policy.hpp" #include "policies.hpp" #include "tofrom_string.hpp" #include class MoveOnENOSPC : public ToFromString { public: MoveOnENOSPC(const bool enabled_) : enabled(enabled_), policy(&Policies::Create::pfrd) { } public: int from_string(const std::string_view s) final; std::string to_string() const final; public: bool enabled; Policy::Create policy; }; mergerfs-2.42.0/src/config_nfsopenhack.cpp0000644000000000000000000000262315177346257017252 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "config_nfsopenhack.hpp" #include "ef.hpp" #include "errno.hpp" template<> int NFSOpenHack::from_string(const std::string_view s_) { if(s_ == "off") _data = NFSOpenHack::ENUM::OFF; ef(s_ == "git") _data = NFSOpenHack::ENUM::GIT; ef(s_ == "all") _data = NFSOpenHack::ENUM::ALL; else return -EINVAL; return 0; } template<> std::string NFSOpenHack::to_string(void) const { switch(_data) { case NFSOpenHack::ENUM::OFF: return "off"; case NFSOpenHack::ENUM::GIT: return "git"; case NFSOpenHack::ENUM::ALL: return "all"; } return std::string(); } mergerfs-2.42.0/src/config_nfsopenhack.hpp0000644000000000000000000000166215177346257017261 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "enum.hpp" enum class NFSOpenHackEnum { OFF, GIT, ALL }; typedef Enum NFSOpenHack; mergerfs-2.42.0/src/config_noforget.hpp0000644000000000000000000000265115177346257016604 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "tofrom_string.hpp" #include "from_string.hpp" #include "fuse_cfg.hpp" class CfgNoforget : public ToFromString { public: int from_string(const std::string_view s_) { int rv; bool b = false; s64 i = 0; if(s_.empty()) { b = true; } else if((rv = str::from(s_,&i)) == 0) { b = (i != 0); } else { rv = str::from(s_,&b); if(rv) return rv; } fuse_cfg.remember_nodes = b; return 0; } std::string to_string() const { if(fuse_cfg.remember_nodes) return "true"; return "false"; } }; mergerfs-2.42.0/src/config_pagesize.cpp0000644000000000000000000000315315177346257016561 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "config_pagesize.hpp" #include "fatal.hpp" #include "from_string.hpp" #include #include #include #include #include ConfigPageSize::ConfigPageSize(cu64 v_) : _v(v_) { } ConfigPageSize::ConfigPageSize(const std::string &s_) { from_string(s_); } std::string ConfigPageSize::to_string(void) const { return std::to_string(_v); } int ConfigPageSize::from_string(const std::string_view s_) { int rv; u64 v; long tmp; u64 pagesize; if(s_.empty()) return -EINVAL; tmp = sysconf(_SC_PAGESIZE); if(tmp <= 0) fatal::abort("pagesize query failed - {}",strerror(errno)); pagesize = (u64)tmp; rv = str::from(s_,&v); if(rv < 0) return rv; if(!std::isalpha(s_.back())) v *= pagesize; _v = ((v + pagesize - 1) / pagesize); return 0; } mergerfs-2.42.0/src/config_pagesize.hpp0000644000000000000000000000233715177346257016571 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "base_types.h" #include "tofrom_string.hpp" class ConfigPageSize : public ToFromString { private: u64 _v; public: ConfigPageSize(cu64); ConfigPageSize(const std::string &); public: std::string to_string(void) const final; int from_string(const std::string_view) final; public: ConfigPageSize& operator=(cu64 v_) { _v = v_; return *this; } operator u64() const { return _v; } }; mergerfs-2.42.0/src/config_passthrough_io.cpp0000644000000000000000000000300015177346257017777 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "config_passthrough_io.hpp" #include "ef.hpp" #include "errno.hpp" template<> std::string PassthroughIO::to_string() const { switch(_data) { case PassthroughIO::ENUM::OFF: return "off"; case PassthroughIO::ENUM::RO: return "ro"; case PassthroughIO::ENUM::WO: return "wo"; case PassthroughIO::ENUM::RW: return "rw"; } return "invalid"; } template<> int PassthroughIO::from_string(const std::string_view s_) { if(s_ == "off") _data = PassthroughIO::ENUM::OFF; ef(s_ == "ro") _data = PassthroughIO::ENUM::RO; ef(s_ == "wo") _data = PassthroughIO::ENUM::WO; ef(s_ == "rw") _data = PassthroughIO::ENUM::RW; else return -EINVAL; return 0; } mergerfs-2.42.0/src/config_passthrough_io.hpp0000644000000000000000000000170215177346257020013 0ustar rootroot#pragma once /* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "enum.hpp" enum class PassthroughIOEnum { OFF = 0, RO, WO, RW }; typedef Enum PassthroughIO; mergerfs-2.42.0/src/config_pid.hpp0000644000000000000000000000216015177346257015530 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "tofrom_string.hpp" #include "fmt/core.h" #include #include class ConfigGetPid : public ToFromString { public: std::string to_string() const final { return fmt::format("{}",::getpid()); } int from_string(const std::string_view) final { return -EROFS; } }; mergerfs-2.42.0/src/config_proxy_ioprio.cpp0000644000000000000000000000234415177346257017515 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "config_proxy_ioprio.hpp" #include "ioprio.hpp" #include "from_string.hpp" ProxyIOPrio::ProxyIOPrio(const bool b_) { ioprio::enable(b_); } std::string ProxyIOPrio::to_string(void) const { if(ioprio::enabled()) return "true"; return "false"; } int ProxyIOPrio::from_string(const std::string_view s_) { int rv; bool enable; rv = str::from(s_,&enable); if(rv) return rv; ioprio::enable(enable); return 0; } mergerfs-2.42.0/src/config_proxy_ioprio.hpp0000644000000000000000000000200615177346257017515 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "tofrom_string.hpp" class ProxyIOPrio : public ToFromString { public: ProxyIOPrio(const bool); public: std::string to_string(void) const final; int from_string(const std::string_view) final; }; mergerfs-2.42.0/src/config_rename_exdev.cpp0000644000000000000000000000275715177346257017425 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "config_rename_exdev.hpp" #include "ef.hpp" #include "errno.hpp" template<> std::string RenameEXDEV::to_string(void) const { switch(_data) { case RenameEXDEV::ENUM::PASSTHROUGH: return "passthrough"; case RenameEXDEV::ENUM::REL_SYMLINK: return "rel-symlink"; case RenameEXDEV::ENUM::ABS_SYMLINK: return "abs-symlink"; } return "invalid"; } template<> int RenameEXDEV::from_string(const std::string_view s_) { if(s_ == "passthrough") _data = RenameEXDEV::ENUM::PASSTHROUGH; ef(s_ == "rel-symlink") _data = RenameEXDEV::ENUM::REL_SYMLINK; ef(s_ == "abs-symlink") _data = RenameEXDEV::ENUM::ABS_SYMLINK; else return -EINVAL; return 0; } mergerfs-2.42.0/src/config_rename_exdev.hpp0000644000000000000000000000171015177346257017416 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "enum.hpp" enum class RenameEXDEVEnum { PASSTHROUGH, REL_SYMLINK, ABS_SYMLINK }; typedef Enum RenameEXDEV; mergerfs-2.42.0/src/config_set.cpp0000644000000000000000000000223215177346257015542 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "config_set.hpp" #include "str.hpp" ConfigSet::ConfigSet(const std::string &str_) { from_string(str_); } std::string ConfigSet::to_string(void) const { return str::join(*this,'|'); } int ConfigSet::from_string(const std::string_view str_) { this->clear(); auto tmp = str::split_to_set(str_,'|'); this->insert(tmp.begin(), tmp.end()); return 0; } mergerfs-2.42.0/src/config_set.hpp0000644000000000000000000000211615177346257015550 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "tofrom_string.hpp" #include #include class ConfigSet : public std::set, public ToFromString { public: ConfigSet(const std::string &str); public: std::string to_string(void) const final; int from_string(const std::string_view) final; }; mergerfs-2.42.0/src/config_statfs.cpp0000644000000000000000000000240515177346257016255 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "config_statfs.hpp" #include "ef.hpp" #include "errno.hpp" template<> std::string StatFS::to_string() const { switch(_data) { case StatFS::ENUM::BASE: return "base"; case StatFS::ENUM::FULL: return "full"; } return "invalid"; } template<> int StatFS::from_string(const std::string_view s_) { if(s_ == "base") _data = StatFS::ENUM::BASE; ef(s_ == "full") _data = StatFS::ENUM::FULL; else return -EINVAL; return 0; } mergerfs-2.42.0/src/config_statfs.hpp0000644000000000000000000000163415177346257016265 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "enum.hpp" enum class StatFSEnum { BASE, FULL }; typedef Enum StatFS; mergerfs-2.42.0/src/config_statfsignore.cpp0000644000000000000000000000262015177346257017460 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "config_statfsignore.hpp" #include "ef.hpp" #include "errno.hpp" template<> std::string StatFSIgnore::to_string() const { switch(_data) { case StatFSIgnore::ENUM::NONE: return "none"; case StatFSIgnore::ENUM::RO: return "ro"; case StatFSIgnore::ENUM::NC: return "nc"; } return "invalid"; } template<> int StatFSIgnore::from_string(const std::string_view s_) { if(s_ == "none") _data = StatFSIgnore::ENUM::NONE; ef(s_ == "ro") _data = StatFSIgnore::ENUM::RO; ef(s_ == "nc") _data = StatFSIgnore::ENUM::NC; else return -EINVAL; return 0; } mergerfs-2.42.0/src/config_statfsignore.hpp0000644000000000000000000000166315177346257017473 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "enum.hpp" enum class StatFSIgnoreEnum { NONE, RO, NC }; typedef Enum StatFSIgnore; mergerfs-2.42.0/src/config_xattr.cpp0000644000000000000000000000261115177346257016112 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "config_xattr.hpp" #include "ef.hpp" #include "errno.hpp" template<> std::string XAttr::to_string() const { switch(_data) { case XAttr::ENUM::PASSTHROUGH: return "passthrough"; case XAttr::ENUM::NOSYS: return "nosys"; case XAttr::ENUM::NOATTR: return "noattr"; } return "invalid"; } template<> int XAttr::from_string(const std::string_view s_) { if(s_ == "passthrough") _data = XAttr::ENUM::PASSTHROUGH; ef(s_ == "nosys") _data = XAttr::ENUM::NOSYS; ef(s_ == "noattr") _data = XAttr::ENUM::NOATTR; else return -EINVAL; return 0; } mergerfs-2.42.0/src/config_xattr.hpp0000644000000000000000000000174415177346257016125 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "enum.hpp" #include "errno.hpp" enum class XAttrEnum { PASSTHROUGH = 0, NOSYS = ENOSYS, NOATTR = ENOATTR }; typedef Enum XAttr; mergerfs-2.42.0/src/dirinfo.hpp0000644000000000000000000000251215177346257015062 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "assert.hpp" #include "fh.hpp" #include "base_types.h" class DirInfo : public FH { public: static u64 to_fh(const DirInfo*); static DirInfo *from_fh(const u64 fh); public: u64 to_fh() const; public: DirInfo(const fs::path &fusepath_) : FH(fusepath_) { } }; inline u64 DirInfo::to_fh(const DirInfo *di_) { return reinterpret_cast(di_); } inline u64 DirInfo::to_fh() const { return to_fh(this); } inline DirInfo* DirInfo::from_fh(const u64 fh_) { return reinterpret_cast(fh_); } mergerfs-2.42.0/src/ef.hpp0000644000000000000000000000151315177346257014022 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #define ef(X) else if(X) mergerfs-2.42.0/src/endian.hpp0000644000000000000000000000174015177346257014670 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "base_types.h" namespace endian { static inline bool is_big(void) { const union { u32 i; char c[4]; } u = { 0x01000000 }; return u.c[0]; } }; mergerfs-2.42.0/src/enum.hpp0000644000000000000000000000302415177346257014373 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "tofrom_string.hpp" #include template class Enum : public ToFromString { public: typedef E ENUM; public: Enum() { } Enum(const ENUM data_) : _data(data_) { } public: Enum& operator=(const ENUM data_) { _data = data_; return *this; } Enum& operator=(const std::string &s_) { from_string(s_); return *this; } public: operator ENUM() const { return _data; } public: bool operator==(const ENUM data_) const { return (_data == data_); } public: std::string to_string() const final; int from_string(const std::string_view) final; public: int to_int() const { return (int)_data; } private: ENUM _data; }; mergerfs-2.42.0/src/errno.hpp0000644000000000000000000000216215177346257014556 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include #if defined(ENODATA) && !defined(ENOATTR) #define ENOATTR ENODATA #endif #if defined(ENOATTR) && !defined(ENODATA) #define ENODATA ENOATTR #endif #if !defined(ENOATTR) && !defined(ENODATA) #error "Neither ENOATTR or ENODATA defined: please contact mergerfs author with platform information" #endif mergerfs-2.42.0/src/error.hpp0000644000000000000000000000241215177346257014560 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "errno.hpp" #include struct Err { private: std::optional _err; public: Err() { } operator int() { return (_err.has_value() ? _err.value() : -ENOENT); } Err& operator=(int v_) { if(!_err.has_value()) _err = ((v_ >= 0) ? 0 : v_); else if(v_ >= 0) _err = 0; return *this; } bool operator==(int v_) { if(_err.has_value()) return (_err.value() == v_); return false; } }; mergerfs-2.42.0/src/fh.hpp0000644000000000000000000000170215177346257014025 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "fs_path.hpp" class FH { public: FH(const fs::path &fusepath_) : fusepath(fusepath_) { } public: fs::path fusepath; }; mergerfs-2.42.0/src/fileinfo.hpp0000644000000000000000000000551315177346257015227 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* FILEINFO - OPEN FILE METADATA ============================= This file defines the FileInfo class which stores metadata for an open file. Each create and opened file get its own instance while the first one of any set of concurrently open files will be stored in open_files map for reference but always pass around through fuse_file_info_t.fh. FUSE FILE HANDLE CONVERSION --------------------------- FUSE uses a 64-bit file handle (fuse_file_info_t.fh). We convert between FileInfo* and fh using simple pointer casting: - to_fh(FileInfo*): Casts pointer to uint64_t for FUSE - from_fh(uint64_t): Casts back to FileInfo pointer This is safe because FileInfo objects remain valid until the last close. See fuse_open.cpp and fuse_release.cpp for how FileInfo is used in the open/close flow. */ #pragma once #include "assert.hpp" #include "branch.hpp" #include "fh.hpp" #include "fs_path.hpp" #include "mutex.hpp" #include "base_types.h" class FileInfo : public FH { public: static FileInfo *from_fh(const u64); static u64 to_fh(const FileInfo*); public: FileInfo(const int fd_, const Branch *branch_, const fs::path &fusepath_, const bool direct_io_) : FH(fusepath_), fd(fd_), branch(*branch_), direct_io(direct_io_) { } FileInfo(const int fd_, const Branch &branch_, const fs::path &fusepath_, const bool direct_io_) : FH(fusepath_), fd(fd_), branch(branch_), direct_io(direct_io_) { } FileInfo(const FileInfo *fi_) : FH(fi_->fusepath), fd(fi_->fd), branch(fi_->branch), direct_io(fi_->direct_io) { } public: u64 to_fh() const; public: int fd; Branch branch; u32 direct_io:1; Mutex mutex; }; inline u64 FileInfo::to_fh(const FileInfo *fi_) { return reinterpret_cast(fi_); } inline u64 FileInfo::to_fh() const { return to_fh(this); } inline FileInfo* FileInfo::from_fh(const u64 fh_) { return reinterpret_cast(fh_); } mergerfs-2.42.0/src/from_string.cpp0000644000000000000000000001035215177346257015755 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "from_string.hpp" #include "ef.hpp" #include "errno.hpp" #include #include int str::from(const std::string_view value_, bool *bool_) { if((value_ == "true") || (value_ == "t") || (value_ == "1") || (value_ == "on") || (value_ == "yes")) *bool_ = true; ef((value_ == "false") || (value_ == "f") || (value_ == "0") || (value_ == "off") || (value_ == "no")) *bool_ = false; else return -EINVAL; return 0; } int str::from(const std::string_view val_, int *rv_) { int tmp; const int base = 10; auto [ptr,ec] = std::from_chars(val_.begin(), val_.end(), tmp, base); if(ec != std::errc{}) return -EINVAL; *rv_ = tmp; return 0; } int str::from(const std::string_view val_, s64 *rv_) { s64 tmp; const int base = 10; constexpr s64 K = 1024LL; constexpr s64 M = K * 1024LL; constexpr s64 G = M * 1024LL; constexpr s64 T = G * 1024LL; auto [ptr,ec] = std::from_chars(val_.begin(), val_.end(), tmp, base); if(ec != std::errc{}) return -EINVAL; if(ptr == val_.end()) { *rv_ = tmp; return 0; } switch(*ptr) { case 'b': case 'B': break; case 'k': case 'K': if(__builtin_mul_overflow(tmp,K,&tmp)) return -EOVERFLOW; break; case 'm': case 'M': if(__builtin_mul_overflow(tmp,M,&tmp)) return -EOVERFLOW; break; case 'g': case 'G': if(__builtin_mul_overflow(tmp,G,&tmp)) return -EOVERFLOW; break; case 't': case 'T': if(__builtin_mul_overflow(tmp,T,&tmp)) return -EOVERFLOW; break; default: return -EINVAL; } *rv_ = tmp; return 0; } int str::from(const std::string_view val_, u64 *rv_) { u64 tmp; const int base = 10; constexpr u64 K = 1024ULL; constexpr u64 M = K * 1024ULL; constexpr u64 G = M * 1024ULL; constexpr u64 T = G * 1024ULL; auto [ptr,ec] = std::from_chars(val_.begin(), val_.end(), tmp, base); if(ec != std::errc{}) return -EINVAL; if(ptr == val_.end()) { *rv_ = tmp; return 0; } switch(*ptr) { case 'b': case 'B': break; case 'k': case 'K': if(__builtin_mul_overflow(tmp,K,&tmp)) return -EOVERFLOW; break; case 'm': case 'M': if(__builtin_mul_overflow(tmp,M,&tmp)) return -EOVERFLOW; break; case 'g': case 'G': if(__builtin_mul_overflow(tmp,G,&tmp)) return -EOVERFLOW; break; case 't': case 'T': if(__builtin_mul_overflow(tmp,T,&tmp)) return -EOVERFLOW; break; default: return -EINVAL; } *rv_ = tmp; return 0; } int str::from(const std::string_view value_, std::string *str_) { *str_ = value_; return 0; } int str::from(const std::string_view value_, const std::string *key_) { return -EINVAL; } int str::from(const std::string_view value_, fs::path *path_) { *path_ = value_; return 0; } mergerfs-2.42.0/src/from_string.hpp0000644000000000000000000000235015177346257015761 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "base_types.h" #include "fs_path.hpp" #include #include namespace str { int from(const std::string_view, bool *); int from(const std::string_view, int *); int from(const std::string_view, u64 *); int from(const std::string_view, s64 *); int from(const std::string_view, std::string *); int from(const std::string_view, const std::string *); int from(const std::string_view, fs::path *); } mergerfs-2.42.0/src/fs_acl.cpp0000644000000000000000000000225315177346257014654 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fs_acl.hpp" #include "fs_lgetxattr.hpp" #include "fs_path.hpp" #include constexpr const char POSIX_ACL_DEFAULT_XATTR[] = "system.posix_acl_default"; bool fs::acl::dir_has_defaults(const fs::path &fullpath_) { int rv; fs::path dirpath; dirpath = fullpath_.parent_path(); rv = fs::lgetxattr(dirpath,POSIX_ACL_DEFAULT_XATTR,NULL,0); return (rv >= 0); } mergerfs-2.42.0/src/fs_acl.hpp0000644000000000000000000000165515177346257014666 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "fs_path.hpp" namespace fs { namespace acl { bool dir_has_defaults(const fs::path &fullpath); } } mergerfs-2.42.0/src/fs_attr.cpp0000644000000000000000000000174015177346257015067 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #ifdef __linux__ #pragma message "using fs_attr_linux.icpp" #include "fs_attr_linux.icpp" #else #pragma message "using fs_attr_unsupported.icpp" #include "fs_attr_unsupported.icpp" #endif mergerfs-2.42.0/src/fs_attr.hpp0000644000000000000000000000216315177346257015074 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include #include "base_types.h" #define FS_ATTR_NONE (0) #define FS_ATTR_CLEAR_IMMUTABLE (1 << 0) namespace fs { namespace attr { int copy(const int fdin, const int fdout, const u32 flags); int copy(const std::string &from, const std::string &to); } } mergerfs-2.42.0/src/fs_attr_linux.icpp0000644000000000000000000000506415177346257016462 0ustar rootroot/* Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fs_attr.hpp" #include "errno.hpp" #include "fs_close.hpp" #include "fs_open.hpp" #include "fs_ioctl.hpp" #include #include #include using std::string; static int _get_fs_ioc_flags(const int fd, int &flags) { int rv; rv = fs::ioctl(fd,FS_IOC_GETFLAGS,(void*)&flags); if(rv == -EINVAL) rv = -ENOTSUP; return rv; } static int _get_fs_ioc_flags(const string &file, int &flags) { int fd; int rv; const int openflags = O_RDONLY|O_NONBLOCK; fd = fs::open(file,openflags); if(fd < 0) return fd; rv = ::_get_fs_ioc_flags(fd,flags); if(rv < 0) { fs::close(fd); return rv; } return fs::close(fd); } static int _set_fs_ioc_flags(const int fd, const int flags) { int rv; rv = fs::ioctl(fd,FS_IOC_SETFLAGS,(void*)&flags); if(rv == -EINVAL) rv = -ENOTSUP; return rv; } static int _set_fs_ioc_flags(const string &file, const int flags) { int fd; int rv; const int openflags = O_RDONLY|O_NONBLOCK; fd = fs::open(file,openflags); if(fd < 0) return fd; rv = ::_set_fs_ioc_flags(fd,flags); if(rv < 0) { fs::close(fd); return rv; } return fs::close(fd); } int fs::attr::copy(const int fdin, const int fdout, const u32 flags_) { int rv; int flags; rv = ::_get_fs_ioc_flags(fdin,flags); if(rv < 0) return rv; if(flags_ & FS_ATTR_CLEAR_IMMUTABLE) flags = (flags & ~FS_IMMUTABLE_FL); return ::_set_fs_ioc_flags(fdout,flags); } int fs::attr::copy(const string &from, const string &to) { int rv; int flags; rv = ::_get_fs_ioc_flags(from,flags); if(rv < 0) return rv; return ::_set_fs_ioc_flags(to,flags); } mergerfs-2.42.0/src/fs_attr_unsupported.icpp0000644000000000000000000000205515177346257017710 0ustar rootroot/* Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fs_attr.hpp" #include "errno.hpp" int fs::attr::copy(const int fdin_, const int fdout_, const u32 flags_) { return -ENOTSUP; } int fs::attr::copy(const std::string &from_, const std::string &to_) { return -ENOTSUP; } mergerfs-2.42.0/src/fs_clonepath.cpp0000644000000000000000000001025215177346257016070 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fs_clonepath.hpp" #include "errno.h" #include "fs_attr.hpp" #include "fs_clonepath.hpp" #include "fs_lchown.hpp" #include "fs_lstat.hpp" #include "fs_lutimens.hpp" #include "fs_mkdir.hpp" #include "fs_path.hpp" #include "fs_xattr.hpp" #include "fs_close.hpp" #include "fs_fstat.hpp" #include "fs_mkdirat.hpp" #include "fs_openat.hpp" #include "fs_fchown.hpp" #include "fs_fchmod.hpp" #include "fs_futimens.hpp" #include "scope_guard/scope_guard.hpp" static bool _ignorable_error(const int err_) { switch(err_) { case ENOTTY: case ENOTSUP: #if ENOTSUP != EOPNOTSUPP case EOPNOTSUPP: #endif return true; } return false; } /* Attempts to clone a path. The directories which already exist are left alone. The new directories have metadata set to match the original if possible. Optionally ignore errors on metadata copies. */ int fs::clonepath(const fs::path &srcpath_, const fs::path &dstpath_, const fs::path &relpath_, const bool return_metadata_errors_) { int rv; struct stat st; fs::path dstpath; fs::path srcpath; fs::path dirname; if(relpath_.empty()) return 0; dirname = relpath_.parent_path(); if(!dirname.empty()) { rv = fs::clonepath(srcpath_,dstpath_,dirname,return_metadata_errors_); if(rv < 0) return rv; } srcpath = srcpath_ / relpath_; rv = fs::lstat(srcpath,&st); if(rv < 0) return rv; else if(!S_ISDIR(st.st_mode)) return -ENOTDIR; dstpath = dstpath_ / relpath_; rv = fs::mkdir(dstpath,st.st_mode); if(rv < 0) return ((rv == -EEXIST) ? 0 : rv); // it may not support it... it's fine... rv = fs::attr::copy(srcpath,dstpath); if(return_metadata_errors_ && (rv < 0) && !::_ignorable_error(-rv)) return rv; // it may not support it... it's fine... rv = fs::xattr::copy(srcpath,dstpath); if(return_metadata_errors_ && (rv < 0) && !::_ignorable_error(-rv)) return rv; rv = fs::lchown_check_on_error(dstpath,st); if(return_metadata_errors_ && (rv < 0)) return rv; rv = fs::lutimens(dstpath,st); if(return_metadata_errors_ && (rv < 0)) return rv; return 0; } // WORK IN PROGRESS static int _clonepath2(const int srcfd_, const int dstfd_, const fs::path &dirname_, const bool return_metadata_errors_) { int rv; int srcdirfd; int dstdirfd; struct stat st; if(dirname_.empty()) return 0; rv = fs::mkdirat(dstfd_,dirname_,0); if(rv < 0) return ((rv == -EEXIST) ? 0 : rv); srcdirfd = fs::openat(srcfd_,dirname_,O_DIRECTORY); if(srcdirfd < 0) return srcdirfd; DEFER { fs::close(srcdirfd); }; dstdirfd = fs::openat(dstfd_,dirname_,O_DIRECTORY); if(dstdirfd < 0) return dstdirfd; DEFER { fs::close(dstdirfd); }; rv = fs::attr::copy(srcdirfd,dstdirfd,FS_ATTR_CLEAR_IMMUTABLE); if(return_metadata_errors_ && (rv < 0) && !::_ignorable_error(-rv)) return rv; rv = fs::xattr::copy(srcdirfd,dstdirfd); if(return_metadata_errors_ && (rv < 0) && !::_ignorable_error(-rv)) return rv; rv = fs::fstat(srcdirfd,&st); if(rv < 0) return rv; if(!S_ISDIR(st.st_mode)) return -ENOTDIR; rv = fs::fchown_check_on_error(dstdirfd,st); if(rv < 0) return rv; rv = fs::fchmod_check_on_error(dstdirfd,st); if(rv < 0) return rv; rv = fs::futimens(dstdirfd,st); if(rv < 0) return rv; return 0; } mergerfs-2.42.0/src/fs_clonepath.hpp0000644000000000000000000000203015177346257016070 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "fs_path.hpp" namespace fs { int clonepath(const fs::path &srcpath, const fs::path &dstpath, const fs::path &relpath, const bool return_metadata_errors = false); } mergerfs-2.42.0/src/fs_close.hpp0000644000000000000000000000201515177346257015223 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "to_neg_errno.hpp" #include namespace fs { static inline int close(const int fd); } static inline int fs::close(const int fd_) { int rv; rv = ::close(fd_); return ::to_neg_errno(rv); } mergerfs-2.42.0/src/fs_closedir.hpp0000644000000000000000000000205115177346257015722 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "to_neg_errno.hpp" #include #include namespace fs { static inline int closedir(DIR *dirp); } static inline int fs::closedir(DIR *dirp_) { int rv; rv = ::closedir(dirp_); return ::to_neg_errno(rv); } mergerfs-2.42.0/src/fs_copy_file_range.cpp0000644000000000000000000000205715177346257017244 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fs_copy_file_range.hpp" #ifdef __linux__ #pragma message "using fs_copy_file_range_linux.icpp" #include "fs_copy_file_range_linux.icpp" #else #pragma message "using fs_copy_file_range_unsupported.icpp" #include "fs_copy_file_range_unsupported.icpp" #endif mergerfs-2.42.0/src/fs_copy_file_range.hpp0000644000000000000000000000224515177346257017250 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include #include #include namespace fs { ssize_t copy_file_range(const int src_fd_, off_t *src_off_, const int dst_fd_, off_t *dst_off_, const size_t len, const unsigned int flags); } mergerfs-2.42.0/src/fs_copy_file_range_linux.icpp0000644000000000000000000000511015177346257020625 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fs_copy_file_range.hpp" #ifndef _GNU_SOURCE # define _GNU_SOURCE #endif #include "to_neg_errno.hpp" #include #include #include #include #include #include static ssize_t _copy_file_range_(const int src_fd_, off_t *src_off_, const int dst_fd_, off_t *dst_off_, const size_t len_, const unsigned int flags_) { #ifdef SYS_copy_file_range int64_t rv; loff_t src_off; loff_t dst_off; loff_t *src_off_ptr; loff_t *dst_off_ptr; src_off = ((src_off_ == NULL) ? 0 : *src_off_); dst_off = ((dst_off_ == NULL) ? 0 : *dst_off_); src_off_ptr = ((src_off_ == NULL) ? NULL : &src_off); dst_off_ptr = ((dst_off_ == NULL) ? NULL : &dst_off); rv = ::syscall(SYS_copy_file_range, src_fd_, src_off_ptr, dst_fd_, dst_off_ptr, len_, flags_); if(rv != -1) { if(src_off_ != NULL) *src_off_ = src_off; if(dst_off_ != NULL) *dst_off_ = dst_off; } return ::to_neg_errno(rv); #else return -EOPNOTSUPP; #endif } ssize_t fs::copy_file_range(const int src_fd_, off_t *src_off_, const int dst_fd_, off_t *dst_off_, const size_t len_, const unsigned int flags_) { return ::_copy_file_range_(src_fd_, src_off_, dst_fd_, dst_off_, len_, flags_); } mergerfs-2.42.0/src/fs_copy_file_range_unsupported.icpp0000644000000000000000000000234215177346257022062 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fs_copy_file_range.hpp" #include "errno.hpp" #include #include #include ssize_t fs::copy_file_range(const int fd_in_, off_t *off_in_, const int fd_out_, off_t *off_out_, const size_t len_, const unsigned int flags_) { return -EOPNOTSUPP; } mergerfs-2.42.0/src/fs_copydata.cpp0000644000000000000000000000257615177346257015731 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fs_copydata.hpp" #include "fs_copydata_copy_file_range.hpp" #include "fs_copydata_readwrite.hpp" #include "fs_fadvise.hpp" #include "fs_ficlone.hpp" #include s64 fs::copydata(const int src_fd_, const int dst_fd_, const u64 count_) { s64 rv; rv = fs::ficlone(src_fd_,dst_fd_); if(rv >= 0) return count_; fs::fadvise_willneed(src_fd_,0,count_); fs::fadvise_sequential(src_fd_,0,count_); rv = fs::copydata_copy_file_range(src_fd_,dst_fd_,count_); if(rv >= 0) return rv; return fs::copydata_readwrite(src_fd_,dst_fd_,count_); } mergerfs-2.42.0/src/fs_copydata.hpp0000644000000000000000000000167215177346257015732 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "base_types.h" namespace fs { s64 copydata(const int src_fd, const int dst_fd, const u64 count); } mergerfs-2.42.0/src/fs_copydata_copy_file_range.cpp0000644000000000000000000000353015177346257021125 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fs_copydata_copy_file_range.hpp" #include "errno.hpp" #include "fs_copy_file_range.hpp" #include "fs_fstat.hpp" #include "base_types.h" static s64 _copydata_copy_file_range(const int src_fd_, const int dst_fd_, const u64 count_) { s64 rv; u64 nleft; s64 src_off; s64 dst_off; src_off = 0; dst_off = 0; nleft = count_; while(nleft > 0) { rv = fs::copy_file_range(src_fd_,&src_off,dst_fd_,&dst_off,nleft,0); switch(rv) { case -EINTR: case -EAGAIN: continue; case 0: return (count_ - nleft); default: if(rv < 0) return rv; break; } nleft -= rv; } return (count_ - nleft); } s64 fs::copydata_copy_file_range(const int src_fd_, const int dst_fd_, const u64 count_) { return ::_copydata_copy_file_range(src_fd_, dst_fd_, count_); } mergerfs-2.42.0/src/fs_copydata_copy_file_range.hpp0000644000000000000000000000175215177346257021136 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "base_types.h" namespace fs { s64 copydata_copy_file_range(const int src_fd, const int dst_fd, const u64 count); } mergerfs-2.42.0/src/fs_copydata_readwrite.cpp0000644000000000000000000000376215177346257017775 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fs_copydata_readwrite.hpp" #include "errno.hpp" #include "fs_pread.hpp" #include "fs_pwriten.hpp" #include static s64 _copydata_readwrite(const int src_fd_, const int dst_fd_, const u64 count_, const u64 bufsize_) { int err; s64 nr; s64 nw; s64 offset; std::vector buf; if(bufsize_ == 0) return -EINVAL; buf.resize(bufsize_); offset = 0; while(offset < (s64)count_) { nr = fs::pread(src_fd_,&buf[0],buf.size(),offset); switch(nr) { case -EINTR: case -EAGAIN: continue; case 0: return offset; default: if(nr < 0) return nr; break; } nw = fs::pwriten(dst_fd_,&buf[0],nr,offset,&err); if(err < 0) return err; offset += nw; } return offset; } #define BUF_SIZE (256 * 1024) s64 fs::copydata_readwrite(const int src_fd_, const int dst_fd_, const u64 count_) { return ::_copydata_readwrite(src_fd_, dst_fd_, count_, BUF_SIZE); } mergerfs-2.42.0/src/fs_copydata_readwrite.hpp0000644000000000000000000000172715177346257020001 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "base_types.h" namespace fs { s64 copydata_readwrite(const int src_fd, const int dst_fd, const u64 count); } mergerfs-2.42.0/src/fs_copyfile.cpp0000644000000000000000000001117515177346257015732 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fs_copyfile.hpp" #include "fs_attr.hpp" #include "fs_close.hpp" #include "fs_copydata.hpp" #include "fs_fchmod.hpp" #include "fs_fchown.hpp" #include "fs_fcntl.hpp" #include "fs_file_unchanged.hpp" #include "fs_fstat.hpp" #include "fs_futimens.hpp" #include "fs_mktemp.hpp" #include "fs_open.hpp" #include "fs_path.hpp" #include "fs_rename.hpp" #include "fs_unlink.hpp" #include "fs_xattr.hpp" #include "scope_guard/scope_guard.hpp" #include #include static bool _ignorable_error(const s64 err_) { switch(err_) { case ENOTTY: case ENOTSUP: #if ENOTSUP != EOPNOTSUPP case EOPNOTSUPP: #endif return true; } return false; } s64 fs::copyfile(const int src_fd_, const struct stat &src_st_, const int dst_fd_) { s64 rv; rv = fs::copydata(src_fd_,dst_fd_,src_st_.st_size); if(rv < 0) return rv; rv = fs::xattr::copy(src_fd_,dst_fd_); if((rv < 0) && !::_ignorable_error(-rv)) return rv; rv = fs::attr::copy(src_fd_,dst_fd_,FS_ATTR_CLEAR_IMMUTABLE); if((rv < 0) && !::_ignorable_error(-rv)) return rv; rv = fs::fchown_check_on_error(dst_fd_,src_st_); if(rv < 0) return rv; rv = fs::fchmod_check_on_error(dst_fd_,src_st_); if(rv < 0) return rv; rv = fs::futimens(dst_fd_,src_st_); if(rv < 0) return rv; return 0; } // Limitations: // * Doesn't handle immutable files well. Will ignore the flag on attr // copy. // * Does not handle non-regular files. s64 fs::copyfile(const int src_fd_, const fs::path &dst_filepath_, const fs::CopyFileFlags &flags_) { s64 rv; int dst_fd; struct stat src_st = {}; std::string dst_tmppath; struct sigaction old_act; struct sigaction new_act; // Done in case fcntl(F_SETLEASE) works. new_act.sa_handler = SIG_IGN; new_act.sa_flags = 0; sigemptyset(&new_act.sa_mask); sigaction(SIGIO,&new_act,&old_act); DEFER { sigaction(SIGIO,&old_act,NULL); }; while(true) { // For comparison after the copy to see if the file was // modified. This could be made more thorough by adding some // hashing but probably overkill. Also used to provide size and // other details for data copying. rv = fs::fstat(src_fd_,&src_st); if(rv < 0) return rv; if(!S_ISREG(src_st.st_mode)) return -EINVAL; std::tie(dst_fd,dst_tmppath) = fs::mktemp(dst_filepath_,O_RDWR); if(dst_fd < 0) return dst_fd; DEFER { fs::close(dst_fd); }; // If it fails or is unsupported... so be it. This will help // limit the possibility of the file being modified while the // copy happens. Opening read-only is fine but open for write or // truncate will block for others till this finishes or the // kernel wide timeout (/proc/sys/fs/lease-break-time). fs::fcntl_setlease_rdlck(src_fd_); DEFER { fs::fcntl_setlease_unlck(src_fd_); }; rv = fs::copyfile(src_fd_,src_st,dst_fd); if(rv < 0) { if(flags_.cleanup_failure) fs::unlink(dst_tmppath); return rv; } rv = fs::file_changed(src_fd_,src_st); if(rv != FS_FILE_UNCHANGED) { fs::unlink(dst_tmppath); continue; } rv = fs::rename(dst_tmppath,dst_filepath_); if((rv < 0) && (flags_.cleanup_failure)) fs::unlink(dst_tmppath); break; } return rv; } // For FreeBSD #ifndef O_NOATIME #define O_NOATIME 0 #endif s64 fs::copyfile(const fs::path &src_filepath_, const fs::path &dst_filepath_, const fs::CopyFileFlags &flags_) { int src_fd; src_fd = fs::open(src_filepath_,O_RDONLY|O_NOFOLLOW|O_NONBLOCK|O_NOATIME); if(src_fd < 0) return src_fd; DEFER { fs::close(src_fd); }; return fs::copyfile(src_fd,dst_filepath_,flags_); } mergerfs-2.42.0/src/fs_copyfile.hpp0000644000000000000000000000263315177346257015736 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "base_types.h" #include "fs_path.hpp" #include #define FS_COPYFILE_NONE (0) #define FS_COPYFILE_CLEANUP_FAILURE (1 << 0) namespace fs { struct CopyFileFlags { int cleanup_failure:1; }; s64 copyfile(const int src_fd, const struct stat &src_st, const int dst_fd); s64 copyfile(const int src_fd, const fs::path &dst_filepath, const CopyFileFlags &flags); s64 copyfile(const fs::path &src_filepath, const fs::path &dst_filepath, const CopyFileFlags &flags); } mergerfs-2.42.0/src/fs_cow.cpp0000644000000000000000000000354415177346257014711 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fs_cow.hpp" #include "errno.hpp" #include "fs_lstat.hpp" #include "fs_copyfile.hpp" #include #include #include #include bool fs::cow::is_eligible(const int flags_) { int accmode; accmode = (flags_ & O_ACCMODE); return ((accmode == O_RDWR) || (accmode == O_WRONLY)); } bool fs::cow::is_eligible(const struct stat &st_) { return ((S_ISREG(st_.st_mode)) && (st_.st_nlink > 1)); } bool fs::cow::is_eligible(const int flags_, const struct stat &st_) { return (is_eligible(flags_) && is_eligible(st_)); } bool fs::cow::is_eligible(const fs::path &fullpath_, const int flags_) { int rv; struct stat st; if(!fs::cow::is_eligible(flags_)) return false; rv = fs::lstat(fullpath_,&st); if(rv < 0) return false; return fs::cow::is_eligible(st); } int fs::cow::break_link(const fs::path &src_filepath_) { return fs::copyfile(src_filepath_, src_filepath_, { .cleanup_failure = true }); } mergerfs-2.42.0/src/fs_cow.hpp0000644000000000000000000000224615177346257014714 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "fs_path.hpp" #include #include namespace fs { namespace cow { bool is_eligible(const int flags); bool is_eligible(const struct stat &st); bool is_eligible(const int flags, const struct stat &st); bool is_eligible(const fs::path &fullpath, const int flags); int break_link(const fs::path &fullpath); } } mergerfs-2.42.0/src/fs_devid.hpp0000644000000000000000000000224215177346257015213 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "fs_fstat.hpp" #include "fs_dirfd.hpp" namespace fs { static inline dev_t devid(const int fd_) { int rv; struct stat st; rv = fs::fstat(fd_,&st); if(rv < 0) return rv; return st.st_dev; } static inline dev_t devid(DIR *dh_) { int dirfd; dirfd = fs::dirfd(dh_); return fs::devid(dirfd); } } mergerfs-2.42.0/src/fs_dirfd.hpp0000644000000000000000000000200315177346257015203 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "to_neg_errno.hpp" #include #include namespace fs { static inline int dirfd(DIR *dh_) { int rv; rv = ::dirfd(dh_); return ::to_neg_errno(rv); } } mergerfs-2.42.0/src/fs_dup.hpp0000644000000000000000000000175515177346257014720 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "to_neg_errno.hpp" #include namespace fs { static inline int dup(const int fd_) { int rv; rv = ::dup(fd_); return ::to_neg_errno(rv); } } mergerfs-2.42.0/src/fs_dup2.hpp0000644000000000000000000000202515177346257014771 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "to_neg_errno.hpp" #include namespace fs { static inline int dup2(int const oldfd_, int const newfd_) { int rv; rv = ::dup2(oldfd_,newfd_); return ::to_neg_errno(rv); } } mergerfs-2.42.0/src/fs_eaccess.hpp0000644000000000000000000000243415177346257015531 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "fs_faccessat.hpp" namespace fs { static inline int eaccess(const char *path_, const int mode_) { return fs::faccessat(AT_FDCWD,path_,mode_,AT_EACCESS); } static inline int eaccess(const std::string &path_, const int mode_) { return fs::eaccess(path_.c_str(),mode_); } static inline int eaccess(const fs::path &path_, const int mode_) { return fs::eaccess(path_.c_str(),mode_); } } mergerfs-2.42.0/src/fs_exists.hpp0000644000000000000000000000367515177346257015452 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "fs_lstat.hpp" #include "fs_path.hpp" namespace fs { static inline bool exists(const fs::path &path_, struct stat *st_) { int rv; rv = fs::lstat(path_,st_); return (rv == 0); } static inline bool exists(const fs::path &path_) { struct stat st; return fs::exists(path_,&st); } static inline bool exists(const fs::path &basepath_, const char *relpath_, struct stat *st_) { fs::path fullpath; fullpath = basepath_ / relpath_; return fs::exists(fullpath,st_); } static inline bool exists(const fs::path &basepath_, const fs::path &relpath_, struct stat *st_) { fs::path fullpath; fullpath = basepath_ / relpath_; return fs::exists(fullpath,st_); } static inline bool exists(const fs::path &basepath_, const char *relpath_) { struct stat st; return fs::exists(basepath_,relpath_,&st); } static inline bool exists(const fs::path &basepath_, const fs::path &relpath_) { struct stat st; return fs::exists(basepath_,relpath_,&st); } } mergerfs-2.42.0/src/fs_faccessat.hpp0000644000000000000000000000356115177346257016061 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "fs_path.hpp" #include "to_neg_errno.hpp" #include #include #include namespace fs { static inline int faccessat(const int dirfd_, const char *path_, const int mode_, const int flags_) { int rv; rv = ::faccessat(dirfd_, path_, mode_, flags_); return ::to_neg_errno(rv); } static inline int faccessat(const int dirfd_, const std::string &path_, const int mode_, const int flags_) { return fs::faccessat(dirfd_, path_.c_str(), mode_, flags_); } static inline int faccessat(const int dirfd_, const fs::path &path_, const int mode_, const int flags_) { return fs::faccessat(dirfd_, path_.c_str(), mode_, flags_); } } mergerfs-2.42.0/src/fs_fadvise.cpp0000644000000000000000000000400515177346257015533 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include #if _XOPEN_SOURCE >= 600 || _POSIX_C_SOURCE >= 200112L #pragma message "using fs_fadvise_posix.icpp" #include "fs_fadvise_posix.icpp" #else #pragma message "using fs_fadvise_unsupported.icpp" #include "fs_fadvise_unsupported.icpp" #endif #ifndef POSIX_FADV_NORMAL # define POSIX_FADV_NORMAL 0 #endif #ifndef POSIX_FADV_RANDOM # define POSIX_FADV_RANDOM 1 #endif #ifndef POSIX_FADV_SEQUENTIAL # define POSIX_FADV_SEQUENTIAL 2 #endif #ifndef POSIX_FADV_WILLNEED # define POSIX_FADV_WILLNEED 3 #endif #ifndef POSIX_FADV_DONTNEED # define POSIX_FADV_DONTNEED 4 #endif #ifndef POSIX_FADV_NOREUSE # define POSIX_FADV_NOREUSE 5 #endif namespace fs { int fadvise_dontneed(const int fd_, const off_t offset_, const off_t len_) { return fs::fadvise(fd_,offset_,len_,POSIX_FADV_DONTNEED); } int fadvise_willneed(const int fd_, const off_t offset_, const off_t len_) { return fs::fadvise(fd_,offset_,len_,POSIX_FADV_WILLNEED); } int fadvise_sequential(const int fd_, const off_t offset_, const off_t len_) { return fs::fadvise(fd_,offset_,len_,POSIX_FADV_SEQUENTIAL); } } mergerfs-2.42.0/src/fs_fadvise.hpp0000644000000000000000000000234415177346257015544 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include namespace fs { int fadvise_dontneed(const int fd, const off_t offset = 0, const off_t len = 0); int fadvise_willneed(const int fd, const off_t offset = 0, const off_t len = 0); int fadvise_sequential(const int fd, const off_t offset = 0, const off_t len = 0); } mergerfs-2.42.0/src/fs_fadvise_posix.icpp0000644000000000000000000000224215177346257017127 0ustar rootroot/* Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include namespace fs { static int fadvise(const int fd_, const off_t offset_, const off_t len_, const int advice_) { int rv; rv = ::posix_fadvise(fd_,offset_,len_,advice_); // On success, zero is returned. // On error, an error number is returned. // Return negative error number like other calls. return -rv; } } mergerfs-2.42.0/src/fs_fadvise_unsupported.icpp0000644000000000000000000000173615177346257020364 0ustar rootroot/* Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include namespace fs { static int fadvise(const int fd_, const off_t offset_, const off_t len_, const int advice_) { return -EOPNOTSUPP; } } mergerfs-2.42.0/src/fs_fallocate.cpp0000644000000000000000000000206315177346257016046 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include #ifdef __linux__ # include "fs_fallocate_linux.icpp" #elif _XOPEN_SOURCE >= 600 || _POSIX_C_SOURCE >= 200112L # include "fs_fallocate_posix.icpp" #elif __APPLE__ # include "fs_fallocate_osx.icpp" #else # include "fs_fallocate_unsupported.icpp" #endif mergerfs-2.42.0/src/fs_fallocate.hpp0000644000000000000000000000172615177346257016060 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include namespace fs { int fallocate(const int fd, const int mode, const off_t offset, const off_t len); } mergerfs-2.42.0/src/fs_fallocate_linux.icpp0000644000000000000000000000210015177346257017426 0ustar rootroot/* Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "to_neg_errno.hpp" #include namespace fs { int fallocate(const int fd_, const int mode_, const off_t offset_, const off_t len_) { int rv; rv = ::fallocate(fd_,mode_,offset_,len_); return ::to_neg_errno(rv); } } mergerfs-2.42.0/src/fs_fallocate_osx.icpp0000644000000000000000000000276515177346257017121 0ustar rootroot/* Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fs_fcntl.hpp" #include "fs_ftruncate.hpp" #include static int _fallocate_core(const int fd_, const off_t offset_, const off_t len_) { int rv; fstore_t store = {F_ALLOCATECONTIG,F_PEOFPOSMODE,offset,len,0}; rv = fs::fcntl(fd_,F_PREALLOCATE,&store); if(rv < 0) { store.fst_flags = F_ALLOCATEALL; rv = fs::fcntl(fd_,F_PREALLOCATE,&store); } if(rv < 0) return rv; rv = fs::ftruncate(fd_,(offset_+len_)); return rv; } int fs::fallocate(const int fd_, const int mode_, const off_t offset_, const off_t len_) { if(mode_) return -EOPNOTSUPP; return ::_fallocate_core(fd_,offset_,len_); } mergerfs-2.42.0/src/fs_fallocate_posix.icpp0000644000000000000000000000224515177346257017443 0ustar rootroot/* Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "errno.hpp" #include namespace fs { int fallocate(const int fd_, const int mode_, const off_t offset_, const off_t len_) { int rv; if(mode_) return -EOPNOTSUPP; rv = ::posix_fallocate(fd_,offset_,len_); // Returns zero on success. // Error number on failure. // Return -errno. return -rv; } } mergerfs-2.42.0/src/fs_fallocate_unsupported.icpp0000644000000000000000000000176615177346257020700 0ustar rootroot/* Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "errno.hpp" #include namespace fs { int fallocate(const int fd_, const int mode_, const off_t offset_, const off_t len_) { return -EOPNOTSUPP; } } mergerfs-2.42.0/src/fs_fchmod.hpp0000644000000000000000000000330515177346257015361 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "fs_fstat.hpp" #include "to_neg_errno.hpp" #include #define MODE_BITS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO) namespace fs { static inline int fchmod(const int fd_, const mode_t mode_) { int rv; rv = ::fchmod(fd_,mode_); return ::to_neg_errno(rv); } static inline int fchmod(const int fd_, const struct stat &st_) { return fs::fchmod(fd_,st_.st_mode); } static inline int fchmod_check_on_error(const int fd_, const struct stat &st_) { int rv; rv = fs::fchmod(fd_,st_); if(rv < 0) { int err; struct stat tmpst; err = rv; rv = fs::fstat(fd_,&tmpst); if(rv < 0) return rv; if((st_.st_mode & MODE_BITS) != (tmpst.st_mode & MODE_BITS)) return err; } return rv; } } mergerfs-2.42.0/src/fs_fchmodat.hpp0000644000000000000000000000362715177346257015715 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "fs_fchmodat.hpp" #include "fs_path.hpp" #include "to_neg_errno.hpp" #include #include #include namespace fs { static inline int fchmodat(const int dirfd_, const char *pathname_, const mode_t mode_, const int flags_) { int rv; rv = ::fchmodat(dirfd_, pathname_, mode_, flags_); return ::to_neg_errno(rv); } static inline int fchmodat(const int dirfd_, const std::string &pathname_, const mode_t mode_, const int flags_) { return fs::fchmodat(dirfd_, pathname_.c_str(), mode_, flags_); } static inline int fchmodat(const int dirfd_, const fs::path &pathname_, const mode_t mode_, const int flags_) { return fs::fchmodat(dirfd_, pathname_.c_str(), mode_, flags_); } } mergerfs-2.42.0/src/fs_fchown.hpp0000644000000000000000000000334015177346257015404 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "to_neg_errno.hpp" #include "fs_fstat.hpp" #include #include #include namespace fs { static inline int fchown(const int fd_, const uid_t uid_, const gid_t gid_) { int rv; rv = ::fchown(fd_,uid_,gid_); return ::to_neg_errno(rv); } static inline int fchown(const int fd_, const struct stat &st_) { return fs::fchown(fd_,st_.st_uid,st_.st_gid); } static inline int fchown_check_on_error(const int fd_, const struct stat &st_) { int rv; rv = fs::fchown(fd_,st_); if(rv < 0) { int err; struct stat tmpst; err = rv; rv = fs::fstat(fd_,&tmpst); if(rv < 0) return err; if((st_.st_uid != tmpst.st_uid) || (st_.st_gid != tmpst.st_gid)) return err; } return 0; } } mergerfs-2.42.0/src/fs_fcntl.hpp0000644000000000000000000000310415177346257015224 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "to_neg_errno.hpp" #include namespace fs { static inline int fcntl(const int fd_, const int op_) { int rv; rv = ::fcntl(fd_,op_); return ::to_neg_errno(rv); } static inline int fcntl(const int fd_, const int op_, const int arg_) { int rv; rv = ::fcntl(fd_,op_,arg_); return ::to_neg_errno(rv); } static inline int fcntl_setlease_rdlck(const int fd_) { #if defined(F_SETLEASE) && defined(F_RDLCK) return fs::fcntl(fd_,F_SETLEASE,F_RDLCK); #else return -ENOTSUP; #endif } static inline int fcntl_setlease_unlck(const int fd_) { #if defined(F_SETLEASE) && defined(F_UNLCK) return fs::fcntl(fd_,F_SETLEASE,F_UNLCK); #else return -ENOTSUP; #endif } } mergerfs-2.42.0/src/fs_fdatasync.hpp0000644000000000000000000000215115177346257016073 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif #include "to_neg_errno.hpp" #include namespace fs { static inline int fdatasync(const int fd_) { #if _POSIX_SYNCHRONIZED_IO > 0 int rv; rv = ::fdatasync(fd_); return ::to_neg_errno(rv); #else return -ENOSYS; #endif } } mergerfs-2.42.0/src/fs_fgetxattr.hpp0000644000000000000000000000317215177346257016133 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "to_neg_errno.hpp" #include "xattr.hpp" #include #include #include namespace fs { static inline int fgetxattr(const int fd_, const char *attrname_, void *value_, const size_t size_) { #ifdef USE_XATTR int rv; rv = ::fgetxattr(fd_, attrname_, value_, size_); return ::to_neg_errno(rv); #else return -ENOTSUP; #endif } static inline int fgetxattr(const int fd_, const std::string &attrname_, void *value_, const size_t size_) { return fs::fgetxattr(fd_, attrname_.c_str(), value_, size_); } } mergerfs-2.42.0/src/fs_ficlone.cpp0000644000000000000000000000175415177346257015541 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #ifdef __linux__ #pragma message "using fs_ficlone_linux.icpp" #include "fs_ficlone_linux.icpp" #else #pragma message "using fs_ficlone_unsupported.icpp" #include "fs_ficlone_unsupported.icpp" #endif mergerfs-2.42.0/src/fs_ficlone.hpp0000644000000000000000000000160315177346257015537 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once namespace fs { int ficlone(const int src_fd, const int dst_fd); } mergerfs-2.42.0/src/fs_ficlone_linux.icpp0000644000000000000000000000204615177346257017124 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "errno.hpp" #include "fs_ioctl.hpp" #include namespace fs { int ficlone(const int src_fd_, const int dst_fd_) { #ifdef FICLONE return fs::ioctl(dst_fd_,FICLONE,src_fd_); #else return -EOPNOTSUPP; #endif } } mergerfs-2.42.0/src/fs_ficlone_unsupported.icpp0000644000000000000000000000165415177346257020361 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "errno.hpp" namespace fs { int ficlone(const int src_fd_, const int dst_fd_) { return -EOPNOTSUPP; } } mergerfs-2.42.0/src/fs_file_size.cpp0000644000000000000000000000201315177346257016060 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fs_file_size.hpp" #include "fs_fstat.hpp" namespace fs { s64 file_size(const int fd_) { int rv; struct stat st; rv = fs::fstat(fd_,&st); if(rv < 0) return rv; return st.st_size; } } mergerfs-2.42.0/src/fs_file_size.hpp0000644000000000000000000000157615177346257016102 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "base_types.h" namespace fs { s64 file_size(const int fd); } mergerfs-2.42.0/src/fs_file_unchanged.hpp0000644000000000000000000000302515177346257017053 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "fs_fstat.hpp" #define FS_FILE_CHANGED 0 #define FS_FILE_UNCHANGED 1 namespace fs { static inline int file_changed(const int fd_, const struct stat &orig_st_) { int rv; struct stat new_st; rv = fs::fstat(fd_,&new_st); if(rv < 0) return rv; if(orig_st_.st_ino != new_st.st_ino) return FS_FILE_CHANGED; if(orig_st_.st_dev != new_st.st_dev) return FS_FILE_CHANGED; if(orig_st_.st_size != new_st.st_size) return FS_FILE_CHANGED; if(orig_st_.st_mtim.tv_sec != new_st.st_mtim.tv_sec) return FS_FILE_CHANGED; if(orig_st_.st_mtim.tv_nsec != new_st.st_mtim.tv_nsec) return FS_FILE_CHANGED; return FS_FILE_UNCHANGED; } } mergerfs-2.42.0/src/fs_findallfiles.cpp0000644000000000000000000000243715177346257016555 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fs_findallfiles.hpp" #include "fs_exists.hpp" #include "fs_path.hpp" #include #include void fs::findallfiles(const std::vector &basepaths_, const fs::path &fusepath_, std::vector *paths_) { fs::path fullpath; for(const auto &basepath : basepaths_) { fullpath = basepath / fusepath_; if(!fs::exists(fullpath)) continue; paths_->push_back(fullpath); } } mergerfs-2.42.0/src/fs_findallfiles.hpp0000644000000000000000000000206215177346257016554 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "fs_path.hpp" #include #include namespace fs { void findallfiles(const std::vector &basepaths, const fs::path &fusepath, std::vector *paths); } mergerfs-2.42.0/src/fs_findonfs.cpp0000644000000000000000000000341515177346257015724 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fs_findonfs.hpp" #include "branches.hpp" #include "errno.hpp" #include "fs_fstat.hpp" #include "fs_lstat.hpp" #include "fs_path.hpp" #include static int _findonfs(const Branches::Ptr &branches_, const fs::path &fusepath_, const int fd_, std::string *basepath_) { int rv; dev_t dev; struct stat st; fs::path fullpath; rv = fs::fstat(fd_,&st); if(rv < 0) return rv; dev = st.st_dev; for(const auto &branch : *branches_) { fullpath = branch.path / fusepath_; rv = fs::lstat(fullpath,&st); if(rv < 0) continue; if(st.st_dev != dev) continue; *basepath_ = branch.path; return 0; } return -ENOENT; } int fs::findonfs(const Branches::Ptr &branches_, const std::string &fusepath_, const int fd_, std::string *basepath_) { return ::_findonfs(branches_,fusepath_,fd_,basepath_); } mergerfs-2.42.0/src/fs_findonfs.hpp0000644000000000000000000000203115177346257015722 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "branches.hpp" #include namespace fs { int findonfs(const Branches::Ptr &branches, const std::string &fusepath, const int fd, std::string *basepath); } mergerfs-2.42.0/src/fs_flistxattr.hpp0000644000000000000000000000223215177346257016323 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "to_neg_errno.hpp" #include "xattr.hpp" #include namespace fs { static inline int flistxattr(const int fd_, char *list_, const size_t size_) { #ifdef USE_XATTR int rv; rv = ::flistxattr(fd_,list_,size_); return ::to_neg_errno(rv); #else return -ENOTSUP; #endif } } mergerfs-2.42.0/src/fs_fsetxattr.hpp0000644000000000000000000000320315177346257016142 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "to_neg_errno.hpp" #include "xattr.hpp" #include #include namespace fs { static inline int fsetxattr(const int fd_, const char *name_, const void *value_, const size_t size_, const int flags_) { #ifdef USE_XATTR int rv; rv = ::fsetxattr(fd_,name_,value_,size_,flags_); return ::to_neg_errno(rv); #else return -ENOTSUP; #endif } static inline int fsetxattr(const int fd_, const std::string &name_, const void *value_, const size_t size_, const int flags_) { return fs::fsetxattr(fd_, name_.c_str(), value_, size_, flags_); } } mergerfs-2.42.0/src/fs_fstat.hpp0000644000000000000000000000210015177346257015232 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "to_neg_errno.hpp" #include #include #include namespace fs { static inline int fstat(const int fd_, struct stat *st_) { int rv; rv = ::fstat(fd_,st_); return ::to_neg_errno(rv); } } mergerfs-2.42.0/src/fs_fstatat.hpp0000644000000000000000000000415215177346257015570 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "fs_path.hpp" #include "to_neg_errno.hpp" #include namespace fs { static inline int fstatat(const int dirfd_, const char *pathname_, struct stat *statbuf_, const int flags_) { int rv; rv = ::fstatat(dirfd_, pathname_, statbuf_, flags_); return ::to_neg_errno(rv); } static inline int fstatat(const int dirfd_, const fs::path &pathname_, struct stat *statbuf_, const int flags_) { return fs::fstatat(dirfd_, pathname_.c_str(), statbuf_, flags_); } static inline int fstatat_nofollow(const int dirfd_, const char *pathname_, struct stat *statbuf_) { return fs::fstatat(dirfd_, pathname_, statbuf_, AT_SYMLINK_NOFOLLOW); } static inline int fstatat_nofollow(const int dirfd_, const fs::path &pathname_, struct stat *statbuf_) { return fs::fstatat(dirfd_, pathname_, statbuf_, AT_SYMLINK_NOFOLLOW); } } mergerfs-2.42.0/src/fs_fstatvfs.hpp0000644000000000000000000000204615177346257015762 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "to_neg_errno.hpp" #include namespace fs { static inline int fstatvfs(const int fd_, struct statvfs *st_) { int rv; rv = ::fstatvfs(fd_,st_); return ::to_neg_errno(rv); } } mergerfs-2.42.0/src/fs_fsync.hpp0000644000000000000000000000176115177346257015247 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "to_neg_errno.hpp" #include namespace fs { static inline int fsync(const int fd_) { int rv; rv = ::fsync(fd_); return ::to_neg_errno(rv); } } mergerfs-2.42.0/src/fs_ftruncate.hpp0000644000000000000000000000204015177346257016107 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "to_neg_errno.hpp" #include namespace fs { static inline int ftruncate(const int fd_, const off_t size_) { int rv; rv = ::ftruncate(fd_,size_); return ::to_neg_errno(rv); } } mergerfs-2.42.0/src/fs_futimens.hpp0000644000000000000000000000262515177346257015757 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "fs_stat_utils.hpp" #include #ifdef __linux__ #pragma message "using fs_futimens_linux.hpp" #include "fs_futimens_linux.hpp" #elif __FreeBSD__ >= 11 #pragma message "using fs_futimens_freebsd_11.hpp" #include "fs_futimens_freebsd_11.hpp" #else #pragma message "using fs_futimens_generic.hpp" #include "fs_futimens_generic.hpp" #endif namespace fs { static inline int futimens(const int fd_, const struct stat &st_) { struct timespec ts[2]; ts[0] = *fs::stat_atime(&st_); ts[1] = *fs::stat_mtime(&st_); return fs::futimens(fd_,ts); } } mergerfs-2.42.0/src/fs_futimens_freebsd_11.hpp0000644000000000000000000000206215177346257017745 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "to_neg_errno.hpp" #include namespace fs { static inline int futimens(const int fd_, const struct timespec ts_[2]) { int rv; rv = ::futimens(fd_,ts_); return ::to_neg_errno(rv); } } mergerfs-2.42.0/src/fs_futimens_generic.hpp0000644000000000000000000001372515177346257017456 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fs_futimesat.hpp" #include "fs_stat_utils.hpp" #include #include #include #include #ifndef UTIME_NOW # define UTIME_NOW ((1l << 30) - 1l) #endif #ifndef UTIME_OMIT # define UTIME_OMIT ((1l << 30) - 2l) #endif static inline bool _can_call_lutimes(const int dirfd_, const std::string &path_, const int flags_) { return ((flags_ == AT_SYMLINK_NOFOLLOW) && ((dirfd_ == AT_FDCWD) || (path_[0] == '/'))); } static inline bool _should_ignore(const struct timespec ts_[2]) { return ((ts_ != NULL) && (ts_[0].tv_nsec == UTIME_OMIT) && (ts_[1].tv_nsec == UTIME_OMIT)); } static inline bool _should_be_set_to_now(const struct timespec ts_[2]) { return ((ts_ == NULL) || ((ts_[0].tv_nsec == UTIME_NOW) && (ts_[1].tv_nsec == UTIME_NOW))); } static inline bool _timespec_invalid(const struct timespec &ts_) { return (((ts_.tv_nsec < 0) || (ts_.tv_nsec > 999999999)) && ((ts_.tv_nsec != UTIME_NOW) && (ts_.tv_nsec != UTIME_OMIT))); } static inline bool _timespec_invalid(const struct timespec ts_[2]) { return ((ts_ != NULL) && (::_timespec_invalid(ts_[0]) || ::_timespec_invalid(ts_[1]))); } static inline bool _flags_invalid(const int flags_) { return ((flags_ & ~AT_SYMLINK_NOFOLLOW) != 0); } static inline bool _any_timespec_is_utime_omit(const struct timespec ts_[2]) { return ((ts_[0].tv_nsec == UTIME_OMIT) || (ts_[1].tv_nsec == UTIME_OMIT)); } static inline bool _any_timespec_is_utime_now(const struct timespec ts_[2]) { return ((ts_[0].tv_nsec == UTIME_NOW) || (ts_[1].tv_nsec == UTIME_NOW)); } static inline int _set_utime_omit_to_current_value(const int dirfd_, const std::string &path_, const struct timespec ts_[2], struct timeval tv_[2], const int flags_) { int rv; struct stat st; timespec *atime; timespec *mtime; if(!::_any_timespec_is_utime_omit(ts_)) return 0; rv = fs::fstatat(dirfd_,path_,&st,flags_); if(rv < 0) return rv; atime = fs::stat_atime(&st); mtime = fs::stat_mtime(&st); if(ts_[0].tv_nsec == UTIME_OMIT) TIMESPEC_TO_TIMEVAL(&tv_[0],atime); if(ts_[1].tv_nsec == UTIME_OMIT) TIMESPEC_TO_TIMEVAL(&tv_[1],mtime); return 0; } static inline int _set_utime_omit_to_current_value(const int fd_, const struct timespec ts_[2], struct timeval tv_[2]) { int rv; struct stat st; timespec *atime; timespec *mtime; if(!::_any_timespec_is_utime_omit(ts_)) return 0; rv = fs::fstat(fd_,&st); if(rv < 0) return rv; atime = fs::stat_atime(&st); mtime = fs::stat_mtime(&st); if(ts_[0].tv_nsec == UTIME_OMIT) TIMESPEC_TO_TIMEVAL(&tv_[0],atime); if(ts_[1].tv_nsec == UTIME_OMIT) TIMESPEC_TO_TIMEVAL(&tv_[1],mtime); return 0; } static inline int _set_utime_now_to_now(const struct timespec ts_[2], struct timeval tv_[2]) { int rv; struct timeval now; if(!::_any_timespec_is_utime_now(ts_)) return 0; rv = time::gettimeofday(&now,NULL); if(rv < 0) return rv; if(ts_[0].tv_nsec == UTIME_NOW) tv_[0] = now; if(ts_[1].tv_nsec == UTIME_NOW) tv_[1] = now; return 0; } static inline int _convert_timespec_to_timeval(const int dirfd_, const std::string &path_, const struct timespec ts_[2], struct timeval tv_[2], struct timeval **tvp_, const int flags_) { int rv; if(::_should_be_set_to_now(ts_)) return (*tvp_=NULL,0); TIMESPEC_TO_TIMEVAL(&tv_[0],&ts_[0]); TIMESPEC_TO_TIMEVAL(&tv_[1],&ts_[1]); rv = ::_set_utime_omit_to_current_value(dirfd_,path_,ts_,tv_,flags_); if(rv < 0) return rv; rv = ::_set_utime_now_to_now(ts_,tv_); if(rv < 0) return rv; return (*tvp_=tv_,0); } static inline int _convert_timespec_to_timeval(const int fd_, const struct timespec ts_[2], struct timeval tv_[2], struct timeval **tvp_) { int rv; if(::_should_be_set_to_now(ts_)) return (*tvp_=NULL,0); TIMESPEC_TO_TIMEVAL(&tv_[0],&ts_[0]); TIMESPEC_TO_TIMEVAL(&tv_[1],&ts_[1]); rv = ::_set_utime_omit_to_current_value(fd_,ts_,tv_); if(rv < 0) return rv; rv = ::_set_utime_now_to_now(ts_,tv_); if(rv < 0) return rv; return (*tvp_=tv_,0); } namespace fs { static inline int futimens(const int fd_, const struct timespec ts_[2]) { int rv; struct timeval tv[2]; struct timeval *tvp; if(::_timespec_invalid(ts_)) return -EINVAL; if(::_should_ignore(ts_)) return 0; rv = ::_convert_timespec_to_timeval(fd_,ts_,tv,&tvp); if(rv < 0) return rv; return fs::futimes(fd_,tvp); } } mergerfs-2.42.0/src/fs_futimens_linux.hpp0000644000000000000000000000206215177346257017171 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "to_neg_errno.hpp" #include namespace fs { static inline int futimens(const int fd_, const struct timespec ts_[2]) { int rv; rv = ::futimens(fd_,ts_); return ::to_neg_errno(rv); } } mergerfs-2.42.0/src/fs_futimesat.cpp0000644000000000000000000000174515177346257016123 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #if __APPLE__ #pragma message "using fs_futimesat_osx.icpp" #include "fs_futimesat_osx.icpp" #else #pragma message "using fs_futimesat_generic.icpp" #include "fs_futimesat_generic.icpp" #endif mergerfs-2.42.0/src/fs_futimesat.hpp0000644000000000000000000000174315177346257016126 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include namespace fs { int futimesat(const int dirfd, const char *pathname, const struct timeval times[2]); } mergerfs-2.42.0/src/fs_futimesat_generic.icpp0000644000000000000000000000215315177346257017762 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "to_neg_errno.hpp" #include #include namespace fs { int futimesat(const int dirfd_, const char *pathname_, const struct timeval times_[2]) { int rv; rv = ::futimesat(dirfd_,pathname_,times_); return ::to_neg_errno(rv); } } mergerfs-2.42.0/src/fs_futimesat_osx.icpp0000644000000000000000000000414515177346257017162 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fs_fstat.hpp" #include "fs_fcntl.hpp" #include "fs_utimes.hpp" #include #include #include #include #include #include #include #include #include namespace l { static int getpath(const int dirfd_, const char *path_, char *fullpath_) { int rv; struct stat st; rv = fs::fstat(dirfd_,&st); if(rv < 0) return rv; if(!S_ISDIR(st.st_mode)) return -ENOTDIR; rv = fs::fcntl(dirfd_,F_GETPATH,fullpath); if(rv < 0) return rv; rv = ::strlcat(fullpath_,"/",MAXPATHLEN); if(rv > MAXPATHLEN) return -ENAMETOOLONG; rv = ::strlcat(fullpath_,path_,MAXPATHLEN); if(rv > MAXPATHLEN) return -ENAMETOOLONG; return 0; } } namespace fs { int futimesat(const int dirfd_, const char *pathname_, const struct timeval times_[2]) { int rv; char fullpath[MAXPATHLEN]; if((dirfd_ == AT_FDCWD) || ((pathname_ != NULL) && (pathname_[0] == '/'))) return fs::utimes(pathname_,times_); if(dirfd_ < 0) return -EBADF; rv = l::getpath(dirfd_,pathname_,fullpath); if(rv < 0) return rv; return fs::utimes(fullpath,times_); } } mergerfs-2.42.0/src/fs_getdents64.cpp0000644000000000000000000000232015177346257016077 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "to_neg_errno.hpp" #include #if defined __linux__ #include #include #endif namespace fs { ssize_t getdents64(const int fd_, void *dirp_, const size_t count_) { #if defined SYS_getdents64 ssize_t rv; rv = ::syscall(SYS_getdents64,fd_,dirp_,count_); return ::to_neg_errno(rv); #else return -ENOTSUP; #endif } } mergerfs-2.42.0/src/fs_getdents64.hpp0000644000000000000000000000171115177346257016107 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include namespace fs { ssize_t getdents64(const int fd, void *dirp, const size_t count); } mergerfs-2.42.0/src/fs_getfl.cpp0000644000000000000000000000163115177346257015215 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fs_fcntl.hpp" namespace fs { int getfl(const int fd_) { return fs::fcntl(fd_,F_GETFL,0); } } mergerfs-2.42.0/src/fs_getfl.hpp0000644000000000000000000000153715177346257015227 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once namespace fs { int getfl(const int fd); } mergerfs-2.42.0/src/fs_glob.cpp0000644000000000000000000000247515177346257015046 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fs_glob.hpp" #include #include #include #include using std::string; using std::vector; #ifndef GLOB_BRACE #define GLOB_BRACE 0 #endif #ifndef GLOB_ONLYDIR #define GLOB_ONLYDIR 0 #endif void fs::glob(const string &pattern_, vector *strs_) { int flags; glob_t gbuf = {}; flags = (GLOB_BRACE|GLOB_ONLYDIR); ::glob(pattern_.c_str(),flags,NULL,&gbuf); for(size_t i = 0; i < gbuf.gl_pathc; i++) strs_->push_back(gbuf.gl_pathv[i]); ::globfree(&gbuf); } mergerfs-2.42.0/src/fs_glob.hpp0000644000000000000000000000170215177346257015043 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include #include namespace fs { void glob(const std::string &pattern, std::vector *strs); } mergerfs-2.42.0/src/fs_has_space.cpp0000644000000000000000000000215715177346257016046 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fs_has_space.hpp" #include "fs_statvfs.hpp" #include "statvfs_util.hpp" #include bool fs::has_space(const std::string &str_, cs64 size_) { int rv; struct statvfs st; rv = fs::statvfs(str_,&st); if(rv < 0) return false; return (StatVFS::spaceavail(st) > size_); } mergerfs-2.42.0/src/fs_has_space.hpp0000644000000000000000000000170315177346257016047 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "base_types.h" #include namespace fs { bool has_space(const std::string &str, cs64 size); } mergerfs-2.42.0/src/fs_info.cpp0000644000000000000000000000254415177346257015053 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fs_info.hpp" #include "fs_info_t.hpp" #include "fs_path.hpp" #include "fs_stat.hpp" #include "fs_statvfs.hpp" #include "fs_statvfs_cache.hpp" #include "statvfs_util.hpp" #include #include using std::string; int fs::info(const string &path_, fs::info_t *info_) { int rv; struct statvfs st; rv = fs::statvfs_cache(path_.c_str(),&st); if(rv == 0) { info_->readonly = StatVFS::readonly(st); info_->spaceavail = StatVFS::spaceavail(st); info_->spaceused = StatVFS::spaceused(st); } return rv; } mergerfs-2.42.0/src/fs_info.hpp0000644000000000000000000000167015177346257015057 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "fs_info_t.hpp" #include namespace fs { int info(const std::string &path, fs::info_t *info); } mergerfs-2.42.0/src/fs_info_t.hpp0000644000000000000000000000166215177346257015403 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "base_types.h" namespace fs { struct info_t { bool readonly; u64 spaceavail; u64 spaceused; }; } mergerfs-2.42.0/src/fs_inode.cpp0000644000000000000000000002444715177346257015224 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fs_inode.hpp" #include "rapidhash/rapidhash.h" #include #include typedef u64 (*inodefunc_t)(const std::string_view, const std::string_view, const mode_t, const ino_t); static u64 _hybrid_hash(const std::string_view, const std::string_view, const mode_t, const ino_t); static std::atomic g_func{::_hybrid_hash}; static const void* _data(const std::string_view s_) { return (s_.empty() ? "" : s_.data()); } static u32 _h64_to_h32(u64 h_) { h_ ^= (h_ >> 32); h_ *= 0x9E3779B9; return h_; } static u64 _hash(const std::string_view s_) { return rapidhash(::_data(s_), s_.size()); } static u64 _branch_seed(const std::string_view branch_path_) { return ::_hash(branch_path_); } static u64 _devino_hash_from_seed(const u64 branch_seed_, const ino_t ino_) { return rapidhash_withSeed(&ino_, sizeof(ino_), branch_seed_); } static u64 _path_hash_value(const std::string_view fusepath_) { return ::_hash(fusepath_); } static u64 _path_hash32_value(const std::string_view fusepath_) { return ::_h64_to_h32(::_path_hash_value(fusepath_)); } static u64 _devino_hash_value(const std::string_view branch_path_, const ino_t ino_) { return ::_devino_hash_from_seed(::_branch_seed(branch_path_), ino_); } static u64 _devino_hash32_value(const std::string_view branch_path_, const ino_t ino_) { return ::_h64_to_h32(::_devino_hash_value(branch_path_,ino_)); } static u64 _passthrough(const std::string_view branch_path_, const std::string_view fusepath_, const mode_t mode_, const ino_t ino_) { return ino_; } static u64 _path_hash(const std::string_view branch_path_, const std::string_view fusepath_, const mode_t mode_, const ino_t ino_) { return ::_path_hash_value(fusepath_); } static u64 _path_hash32(const std::string_view branch_path_, const std::string_view fusepath_, const mode_t mode_, const ino_t ino_) { return ::_path_hash32_value(fusepath_); } static u64 _devino_hash(const std::string_view branch_path_, const std::string_view fusepath_, const mode_t mode_, const ino_t ino_) { return ::_devino_hash_value(branch_path_,ino_); } static u64 _devino_hash32(const std::string_view branch_path_, const std::string_view fusepath_, const mode_t mode_, const ino_t ino_) { return ::_devino_hash32_value(branch_path_,ino_); } static u64 _hybrid_hash(const std::string_view branch_path_, const std::string_view fusepath_, const mode_t mode_, const ino_t ino_) { return (S_ISDIR(mode_) ? ::_path_hash(branch_path_,fusepath_,mode_,ino_) : ::_devino_hash(branch_path_,fusepath_,mode_,ino_)); } static u64 _hybrid_hash32(const std::string_view branch_path_, const std::string_view fusepath_, const mode_t mode_, const ino_t ino_) { return (S_ISDIR(mode_) ? ::_path_hash32(branch_path_,fusepath_,mode_,ino_) : ::_devino_hash32(branch_path_,fusepath_,mode_,ino_)); } static fs::inode::Algo _algo_from_func(const inodefunc_t func_) { if(func_ == ::_passthrough) return fs::inode::Algo::PASSTHROUGH; if(func_ == ::_path_hash) return fs::inode::Algo::PATH_HASH; if(func_ == ::_path_hash32) return fs::inode::Algo::PATH_HASH32; if(func_ == ::_devino_hash) return fs::inode::Algo::DEVINO_HASH; if(func_ == ::_devino_hash32) return fs::inode::Algo::DEVINO_HASH32; if(func_ == ::_hybrid_hash) return fs::inode::Algo::HYBRID_HASH; if(func_ == ::_hybrid_hash32) return fs::inode::Algo::HYBRID_HASH32; return fs::inode::Algo::HYBRID_HASH; } static u64 _calc_with_algo(const fs::inode::Algo algo_, const u64 branch_seed_, const std::string_view fusepath_, const mode_t mode_, const ino_t ino_) { switch(algo_) { case fs::inode::Algo::PASSTHROUGH: return ino_; case fs::inode::Algo::PATH_HASH: return ::_path_hash_value(fusepath_); case fs::inode::Algo::PATH_HASH32: return ::_path_hash32_value(fusepath_); case fs::inode::Algo::DEVINO_HASH: return ::_devino_hash_from_seed(branch_seed_,ino_); case fs::inode::Algo::DEVINO_HASH32: return ::_h64_to_h32(::_devino_hash_from_seed(branch_seed_,ino_)); case fs::inode::Algo::HYBRID_HASH: return (S_ISDIR(mode_) ? ::_path_hash_value(fusepath_) : ::_devino_hash_from_seed(branch_seed_,ino_)); case fs::inode::Algo::HYBRID_HASH32: return (S_ISDIR(mode_) ? ::_path_hash32_value(fusepath_) : ::_h64_to_h32(::_devino_hash_from_seed(branch_seed_,ino_))); } return ino_; } int fs::inode::set_algo(const std::string &algo_) { inodefunc_t func = nullptr; if(algo_ == "passthrough") func = ::_passthrough; else if(algo_ == "path-hash") func = ::_path_hash; else if(algo_ == "path-hash32") func = ::_path_hash32; else if(algo_ == "devino-hash") func = ::_devino_hash; else if(algo_ == "devino-hash32") func = ::_devino_hash32; else if(algo_ == "hybrid-hash") func = ::_hybrid_hash; else if(algo_ == "hybrid-hash32") func = ::_hybrid_hash32; else return -EINVAL; g_func.store(func); return 0; } std::string fs::inode::get_algo(void) { switch(::_algo_from_func(g_func.load())) { case fs::inode::Algo::PASSTHROUGH: return "passthrough"; case fs::inode::Algo::PATH_HASH: return "path-hash"; case fs::inode::Algo::PATH_HASH32: return "path-hash32"; case fs::inode::Algo::DEVINO_HASH: return "devino-hash"; case fs::inode::Algo::DEVINO_HASH32: return "devino-hash32"; case fs::inode::Algo::HYBRID_HASH: return "hybrid-hash"; case fs::inode::Algo::HYBRID_HASH32: return "hybrid-hash32"; } return {}; } fs::inode::ReaddirCalc::ReaddirCalc(const fs::path &branch_path_, const fs::path &dirpath_) : _algo(::_algo_from_func(g_func.load())), _branch_seed(::_branch_seed(branch_path_.native())), _fusepath((dirpath_ / "__mergerfs__").native()), _filename_offset(_fusepath.size() - std::string_view("__mergerfs__").size()) { } u64 fs::inode::ReaddirCalc::calc(const char *name_, const std::size_t namelen_, const mode_t mode_, const ino_t ino_) { switch(_algo) { case Algo::PASSTHROUGH: return ino_; case Algo::DEVINO_HASH: return ::_devino_hash_from_seed(_branch_seed,ino_); case Algo::DEVINO_HASH32: return ::_h64_to_h32(::_devino_hash_from_seed(_branch_seed,ino_)); case Algo::HYBRID_HASH: if(!S_ISDIR(mode_)) return ::_devino_hash_from_seed(_branch_seed,ino_); break; case Algo::HYBRID_HASH32: if(!S_ISDIR(mode_)) return ::_h64_to_h32(::_devino_hash_from_seed(_branch_seed,ino_)); break; case Algo::PATH_HASH: case Algo::PATH_HASH32: break; } _fusepath.resize(_filename_offset); _fusepath.append(name_,namelen_); return ::_calc_with_algo(_algo, _branch_seed, _fusepath, mode_, ino_); } u64 fs::inode::calc(const std::string &branch_path_, const std::string &fusepath_, const mode_t mode_, const ino_t ino_) { return g_func.load()(branch_path_, fusepath_, mode_, ino_); } u64 fs::inode::calc(const fs::path &branch_path_, const fs::path &fusepath_, const mode_t mode_, const ino_t ino_) { return g_func.load()(branch_path_.native(), fusepath_.native(), mode_, ino_); } void fs::inode::calc(const std::string &branch_path_, const std::string &fusepath_, struct stat *st_) { st_->st_ino = calc(branch_path_, fusepath_, st_->st_mode, st_->st_ino); } void fs::inode::calc(const fs::path &branch_path_, const fs::path &fusepath_, struct stat *st_) { st_->st_ino = calc(branch_path_, fusepath_, st_->st_mode, st_->st_ino); } void fs::inode::calc(const std::string &branch_path_, const std::string &fusepath_, struct fuse_statx *st_) { st_->ino = calc(branch_path_, fusepath_, st_->mode, st_->ino); } void fs::inode::calc(const fs::path &branch_path_, const fs::path &fusepath_, struct fuse_statx *st_) { st_->ino = calc(branch_path_, fusepath_, st_->mode, st_->ino); } mergerfs-2.42.0/src/fs_inode.hpp0000644000000000000000000000473215177346257015224 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "base_types.h" #include "fs_path.hpp" #include "fuse_kernel.h" #include #include #include #include namespace fs { namespace inode { enum class Algo { PASSTHROUGH, PATH_HASH, PATH_HASH32, DEVINO_HASH, DEVINO_HASH32, HYBRID_HASH, HYBRID_HASH32, }; class ReaddirCalc { public: ReaddirCalc(const fs::path &branch_path, const fs::path &dirpath); public: u64 calc(const char *name, const size_t namelen, const mode_t mode, const ino_t ino); private: Algo _algo; u64 _branch_seed; std::string _fusepath; std::size_t _filename_offset; }; int set_algo(const std::string &s); std::string get_algo(void); u64 calc(const std::string &basepath, const std::string &fusepath, const mode_t mode, const ino_t ino); u64 calc(const fs::path &basepath, const fs::path &fusepath, const mode_t mode, const ino_t ino); void calc(const std::string &basepath, const std::string &fusepath, struct stat *st); void calc(const fs::path &basepath, const fs::path &fusepath, struct stat *st); void calc(const std::string &basepath, const std::string &fusepath, struct fuse_statx *st); void calc(const fs::path &basepath, const fs::path &fusepath, struct fuse_statx *st); } } mergerfs-2.42.0/src/fs_ioctl.hpp0000644000000000000000000000275215177346257015240 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "to_neg_errno.hpp" #include namespace fs { static inline int ioctl(const int fd_, const unsigned long request_) { int rv; rv = ::ioctl(fd_,request_); return ::to_neg_errno(rv); } static inline int ioctl(const int fd_, const unsigned long request_, void *data_) { int rv; rv = ::ioctl(fd_,request_,data_); return ::to_neg_errno(rv); } static inline int ioctl(const int fd_, const unsigned long request_, const int int_) { int rv; rv = ::ioctl(fd_,request_,int_); return ::to_neg_errno(rv); } } mergerfs-2.42.0/src/fs_is_rofs.hpp0000644000000000000000000000321215177346257015562 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "fs_close.hpp" #include "fs_mktemp.hpp" #include "fs_path.hpp" #include "fs_statvfs.hpp" #include "fs_unlink.hpp" #include "statvfs_util.hpp" #include namespace fs { static inline bool is_mounted_rofs(const fs::path &path_) { int rv; struct statvfs st; rv = fs::statvfs(path_,&st); return ((rv == 0) ? StatVFS::readonly(st) : false); } static inline bool is_rofs(const fs::path &path_) { int fd; std::string tmp_filepath; std::tie(fd,tmp_filepath) = fs::mktemp_in_dir(path_,"",O_WRONLY); if(fd < 0) return (fd == -EROFS); fs::close(fd); fs::unlink(tmp_filepath); return false; } static inline bool is_rofs_but_not_mounted_ro(const fs::path &path_) { if(fs::is_mounted_rofs(path_)) return false; return fs::is_rofs(path_); } } mergerfs-2.42.0/src/fs_is_same_file.hpp0000644000000000000000000000272315177346257016543 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "to_neg_errno.hpp" #include #include #include namespace fs { static inline int is_same_file(const char *a_, const char *b_) { int rv_a; int rv_b; struct stat st_a; struct stat st_b; rv_a = ::lstat(a_,&st_a); rv_b = ::lstat(b_,&st_b); if(rv_a < 0 || rv_b < 0) return -errno; if(st_a.st_dev != st_b.st_dev || st_a.st_ino != st_b.st_ino) return 0; return 1; } static inline int is_same_file(const std::string &a_, const std::string &b_) { return fs::is_same_file(a_.c_str(), b_.c_str()); } } mergerfs-2.42.0/src/fs_lchmod.hpp0000644000000000000000000000374715177346257015401 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "fs_lstat.hpp" #include "to_neg_errno.hpp" #include #include #if defined __linux__ #include #include #endif #define MODE_BITS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO) namespace fs { static inline int lchmod(const char *pathname_, const mode_t mode_) { #if defined __linux__ int rv; const int flags = AT_SYMLINK_NOFOLLOW; rv = ::fchmodat(AT_FDCWD,pathname_,mode_,flags); return ::to_neg_errno(rv); #else int rv; rv = ::lchmod(pathname_,mode_); return ::to_neg_errno(rv); #endif } static inline int lchmod(const std::string &pathname_, const mode_t mode_) { return fs::lchmod(pathname_.c_str(),mode_); } static inline int lchmod_check_on_error(const std::string &path_, const mode_t mode_) { int rv; rv = fs::lchmod(path_,mode_); if(rv < 0) { int err; struct stat st; err = rv; rv = fs::lstat(path_,&st); if(rv < 0) return rv; if((st.st_mode & MODE_BITS) != (mode_ & MODE_BITS)) return err; } return 0; } } mergerfs-2.42.0/src/fs_lchown.hpp0000644000000000000000000000405315177346257015414 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "fs_lstat.hpp" #include "to_neg_errno.hpp" #include namespace fs { static inline int lchown(const char *pathname_, const uid_t uid_, const gid_t gid_) { int rv; rv = ::lchown(pathname_,uid_,gid_); return ::to_neg_errno(rv); } static inline int lchown(const std::string &pathname_, const uid_t uid_, const gid_t gid_) { return fs::lchown(pathname_.c_str(),uid_,gid_); } static inline int lchown(const char *pathname_, const struct stat &st_) { return fs::lchown(pathname_,st_.st_uid,st_.st_gid); } static inline int lchown(const std::string &pathname_, const struct stat &st_) { return fs::lchown(pathname_.c_str(),st_); } static inline int lchown_check_on_error(const std::string &path_, const struct stat &st_) { int rv; rv = fs::lchown(path_,st_); if(rv < 0) { int err; struct stat tmpst; err = rv; rv = fs::lstat(path_,&tmpst); if(rv < 0) return err; if((st_.st_uid != tmpst.st_uid) || (st_.st_gid != tmpst.st_gid)) return err; } return 0; } } mergerfs-2.42.0/src/fs_lgetxattr.hpp0000644000000000000000000000370015177346257016136 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "to_neg_errno.hpp" #include "xattr.hpp" #include #include namespace fs { static inline int lgetxattr(const char *path_, const char *attrname_, void *value_, const size_t size_) { #ifdef USE_XATTR int rv; rv = ::lgetxattr(path_, attrname_, value_, size_); return ::to_neg_errno(rv); #else return -ENOTSUP; #endif } static inline int lgetxattr(const std::string &path_, const char *attrname_, void *value_, const size_t size_) { return fs::lgetxattr(path_.c_str(), attrname_, value_, size_); } static inline int lgetxattr(const std::string &path_, const std::string &attrname_, void *value_, const size_t size_) { return fs::lgetxattr(path_.c_str(), attrname_.c_str(), value_, size_); } } mergerfs-2.42.0/src/fs_link.hpp0000644000000000000000000000214315177346257015055 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "to_neg_errno.hpp" #include #include namespace fs { static inline int link(const std::string &oldpath_, const std::string &newpath_) { int rv; rv = ::link(oldpath_.c_str(), newpath_.c_str()); return ::to_neg_errno(rv); } } mergerfs-2.42.0/src/fs_llistxattr.hpp0000644000000000000000000000261115177346257016332 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "to_neg_errno.hpp" #include "xattr.hpp" #include #include namespace fs { static inline ssize_t llistxattr(const char *path_, char *list_, const size_t size_) { #ifdef USE_XATTR ssize_t rv; rv = ::llistxattr(path_,list_,size_); return ::to_neg_errno(rv); #else return -ENOTSUP; #endif } static inline ssize_t llistxattr(const std::string &path_, char *list_, const size_t size_) { return fs::llistxattr(path_.c_str(),list_,size_); } } mergerfs-2.42.0/src/fs_lremovexattr.hpp0000644000000000000000000000222615177346257016656 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "to_neg_errno.hpp" #include "xattr.hpp" #include namespace fs { static inline int lremovexattr(const std::string &path_, const char *attrname_) { #ifdef USE_XATTR int rv; rv = ::lremovexattr(path_.c_str(),attrname_); return ::to_neg_errno(rv); #else return -ENOTSUP; #endif } } mergerfs-2.42.0/src/fs_lseek.hpp0000644000000000000000000000213015177346257015217 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "to_neg_errno.hpp" #include #include namespace fs { static inline off_t lseek(const int fd_, const off_t offset_, const int whence_) { off_t rv; rv = ::lseek(fd_,offset_,whence_); return ::to_neg_errno(rv); } } mergerfs-2.42.0/src/fs_lsetxattr.hpp0000644000000000000000000000335315177346257016156 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "to_neg_errno.hpp" #include "xattr.hpp" #include #include namespace fs { static inline int lsetxattr(const char *path_, const char *name_, const void *value_, const size_t size_, const int flags_) { #ifdef USE_XATTR int rv; rv = ::lsetxattr(path_, name_, value_, size_, flags_); return ::to_neg_errno(rv); #else return -ENOTSUP; #endif } static inline int lsetxattr(const std::string &path_, const std::string &name_, const void *value_, const size_t size_, const int flags_) { return fs::lsetxattr(path_.c_str(), name_.c_str(), value_, size_, flags_); } } mergerfs-2.42.0/src/fs_lstat.hpp0000644000000000000000000000234215177346257015250 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "to_neg_errno.hpp" #include #include #include #include namespace fs { static inline int lstat(const char *path_, struct stat *st_) { int rv; rv = ::lstat(path_,st_); return ::to_neg_errno(rv); } static inline int lstat(const std::string &path_, struct stat *st_) { return fs::lstat(path_.c_str(),st_); } } mergerfs-2.42.0/src/fs_lstatvfs.hpp0000644000000000000000000000241515177346257015770 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "errno.hpp" #include "fs_close.hpp" #include "fs_open.hpp" #include "fs_fstatvfs.hpp" #include #include #ifndef O_PATH # define O_PATH 0 #endif namespace fs { static inline int lstatvfs(const std::string &path_, struct statvfs *st_) { int fd; int rv; fd = fs::open(path_,O_RDONLY|O_NOFOLLOW|O_PATH); if(fd < 0) return fd; rv = fs::fstatvfs(fd,st_); fs::close(fd); return rv; } } mergerfs-2.42.0/src/fs_lutimens.hpp0000644000000000000000000000244215177346257015762 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "fs_utimensat.hpp" #include "fs_stat_utils.hpp" namespace fs { static inline int lutimens(const std::string &path_, const struct timespec ts_[2]) { return fs::utimensat(AT_FDCWD,path_,ts_,AT_SYMLINK_NOFOLLOW); } static inline int lutimens(const std::string &path_, const struct stat &st_) { struct timespec ts[2]; ts[0] = *fs::stat_atime(&st_); ts[1] = *fs::stat_mtime(&st_); return fs::lutimens(path_,ts); } } mergerfs-2.42.0/src/fs_mkdir.hpp0000644000000000000000000000267015177346257015233 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "to_neg_errno.hpp" #include "fs_path.hpp" #include #include #include namespace fs { static inline int mkdir(const char *path_, const mode_t mode_) { int rv; rv = ::mkdir(path_, mode_); return ::to_neg_errno(rv); } static inline int mkdir(const std::string &path_, const mode_t mode_) { return fs::mkdir(path_.c_str(), mode_); } static inline int mkdir(const fs::path &path_, const mode_t mode_) { return fs::mkdir(path_.c_str(), mode_); } } mergerfs-2.42.0/src/fs_mkdir_as.hpp0000644000000000000000000000275715177346257015724 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "fs_mkdir.hpp" #include "ugid.hpp" #if defined __linux__ namespace fs { template static inline int mkdir_as(const ugid_t ugid_, const T &path_, const mode_t mode_) { const ugid::SetGuard _(ugid_); return fs::mkdir(path_,mode_); } } #elif defined __FreeBSD__ #include "fs_lchown.hpp" namespace fs { template static inline int mkdir_as(const ugid_t ugid_, const T &path_, const mode_t mode_) { int rv; rv = fs::mkdir(path_,mode_); if(rv < 0) return rv; fs::lchown(path_,ugid_.uid,ugid_.gid); return 0; } } #else #error "Not Supported" #endif mergerfs-2.42.0/src/fs_mkdirat.hpp0000644000000000000000000000315015177346257015552 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "to_neg_errno.hpp" #include "fs_path.hpp" #include #include namespace fs { static inline int mkdirat(const int dirfd_, const char *pathname_, const mode_t mode_) { int rv; rv = ::mkdirat(dirfd_,pathname_,mode_); return ::to_neg_errno(rv); } static inline int mkdirat(const int dirfd_, const std::string &pathname_, const mode_t mode_) { return fs::mkdirat(dirfd_, pathname_.c_str(), mode_); } static inline int mkdirat(const int dirfd_, const fs::path &pathname_, const mode_t mode_) { return fs::mkdirat(dirfd_, pathname_.c_str(), mode_); } } mergerfs-2.42.0/src/fs_mknod.hpp0000644000000000000000000000243715177346257015236 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "to_neg_errno.hpp" #include #include #include namespace fs { static inline int mknod(const char *path_, const mode_t mode_, const dev_t dev_) { int rv; rv = ::mknod(path_,mode_,dev_); return ::to_neg_errno(rv); } static inline int mknod(const std::string &path_, const mode_t mode_, const dev_t dev_) { return fs::mknod(path_.c_str(),mode_,dev_); } } mergerfs-2.42.0/src/fs_mknod_as.hpp0000644000000000000000000000303115177346257015710 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "fs_mknod.hpp" #include "ugid.hpp" #if defined __linux__ namespace fs { template static inline int mknod_as(const ugid_t ugid_, const T &path_, const mode_t mode_, const dev_t dev_) { const ugid::SetGuard _(ugid_); return fs::mknod(path_,mode_,dev_); } } #elif defined __FreeBSD__ #include "fs_lchown.hpp" namespace fs { template static inline int mknod_as(const ugid_t ugid_, const T &path_, const mode_t mode_, const dev_t dev_) { int rv; rv = fs::mknod(path_,mode_,dev_); fs::lchown(path_,ugid_.uid,ugid_.gid); return rv; } } #else #error "Not Supported!" #endif mergerfs-2.42.0/src/fs_mktemp.cpp0000644000000000000000000000532615177346257015416 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fs_mktemp.hpp" #include "errno.hpp" #include "fs_open.hpp" #include "fs_path.hpp" #include "rnd.hpp" #include #include #include #include #include #include #include #define PAD_LEN 6ULL #define MAX_ATTEMPTS 3 static char const CHARS[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; static size_t const CHARS_SIZE = (sizeof(CHARS) - 1); static fs::path _generate_tmp_path(const fs::path &dirpath_, const std::string &src_filename_) { long name_max; size_t substr_len; std::string tmp_filename; name_max = ::pathconf(dirpath_.c_str(),_PC_NAME_MAX); if(name_max == -1) name_max = NAME_MAX; substr_len = std::min(src_filename_.size(), (size_t)(name_max - PAD_LEN - 2ULL)); tmp_filename = '.'; tmp_filename += src_filename_.substr(0,substr_len); tmp_filename += '_'; for(size_t i = 0; i < PAD_LEN; i++) tmp_filename += CHARS[RND::rand64(CHARS_SIZE)]; return dirpath_ / tmp_filename; } std::tuple fs::mktemp_in_dir(const fs::path &dirpath_, const fs::path &filename_, const int flags_) { int fd; int count; int flags; fs::path tmp_filepath; count = MAX_ATTEMPTS; flags = (flags_ | O_EXCL | O_CREAT); while(count-- > 0) { tmp_filepath = ::_generate_tmp_path(dirpath_,filename_); fd = fs::open(tmp_filepath,flags,S_IRUSR|S_IWUSR); if(fd == -EEXIST) continue; if(fd < 0) return std::make_tuple(fd,fs::path()); return std::make_tuple(fd,tmp_filepath); } return std::make_tuple(-EEXIST,fs::path()); } std::tuple fs::mktemp(const fs::path &filepath_, const int flags_) { return fs::mktemp_in_dir(filepath_.parent_path(), filepath_.filename(), flags_); } mergerfs-2.42.0/src/fs_mktemp.hpp0000644000000000000000000000216615177346257015422 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "fs_path.hpp" #include #include namespace fs { std::tuple mktemp_in_dir(const fs::path &dirpath, const fs::path &filename, int const flags); std::tuple mktemp(const fs::path &filepath, const int flags); } mergerfs-2.42.0/src/fs_mount.cpp0000644000000000000000000000167315177346257015264 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fs_mount.hpp" #include "subprocess/subprocess.hpp" int fs::mount(const std::string &tgt_) { return subprocess::call({"mount",tgt_}); } mergerfs-2.42.0/src/fs_mount.hpp0000644000000000000000000000157415177346257015271 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include namespace fs { int mount(const std::string &tgt); } mergerfs-2.42.0/src/fs_mounts.cpp0000644000000000000000000000252715177346257015446 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fs_mounts.hpp" #include #ifdef __linux__ #include void fs::mounts(fs::MountVec &mounts_) { FILE *f; f = ::setmntent("/proc/mounts","r"); if(f == NULL) return; struct mntent *entry; while((entry = ::getmntent(f)) != NULL) { fs::Mount m; m.dir = entry->mnt_dir; m.fsname = entry->mnt_fsname; m.type = entry->mnt_type; m.opts = entry->mnt_opts; mounts_.emplace_back(std::move(m)); } ::endmntent(f); } #else void fs::mounts(fs::MountVec &mounts_) { } #endif mergerfs-2.42.0/src/fs_mounts.hpp0000644000000000000000000000206315177346257015446 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "fs_path.hpp" #include namespace fs { struct Mount { fs::path dir; std::string fsname; std::string type; std::string opts; }; typedef std::vector MountVec; void mounts(fs::MountVec &mounts); } mergerfs-2.42.0/src/fs_movefile_and_open.cpp0000644000000000000000000000753215177346257017573 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fs_movefile_and_open.hpp" #include "base_types.h" #include "errno.hpp" #include "fs_clonepath.hpp" #include "fs_close.hpp" #include "fs_copyfile.hpp" #include "fs_file_size.hpp" #include "fs_findonfs.hpp" #include "fs_getfl.hpp" #include "fs_has_space.hpp" #include "fs_mktemp.hpp" #include "fs_open.hpp" #include "fs_path.hpp" #include "fs_rename.hpp" #include "fs_stat.hpp" #include "fs_unlink.hpp" #include "policy.hpp" #include #include #include #include #include #include #include static int _cleanup_flags(const int flags_) { int rv; rv = flags_; rv = (rv & ~O_TRUNC); rv = (rv & ~O_CREAT); rv = (rv & ~O_EXCL); return rv; } static int _movefile_and_open(const Policy::Create &createFunc_, const Branches::Ptr &branches_, const fs::path &branchpath_, const fs::path &fusepath_, int origfd_) { int rv; int dstfd_flags; int origfd_flags; s64 src_size; fs::path fusedir; fs::path src_branch; fs::path src_filepath; fs::path dst_filepath; std::vector dst_branch; src_branch = branchpath_; rv = createFunc_(branches_,fusepath_,dst_branch); if(rv < 0) return rv; if(dst_branch.empty()) return -ENOSPC; origfd_flags = fs::getfl(origfd_); if(origfd_flags < 0) return origfd_flags; src_size = fs::file_size(origfd_); if(src_size < 0) return src_size; if(fs::has_space(dst_branch[0]->path,src_size) == false) return -ENOSPC; fusedir = fusepath_.parent_path(); rv = fs::clonepath(src_branch,dst_branch[0]->path,fusedir); if(rv < 0) return -ENOSPC; src_filepath = src_branch / fusepath_; dst_filepath = dst_branch[0]->path / fusepath_; rv = fs::copyfile(src_filepath,dst_filepath,{.cleanup_failure = true}); if(rv < 0) return -ENOSPC; dstfd_flags = ::_cleanup_flags(origfd_flags); rv = fs::open(dst_filepath,dstfd_flags); if(rv < 0) return -ENOSPC; fs::unlink(src_filepath); return rv; } int fs::movefile_and_open(const Policy::Create &policy_, const Branches::Ptr &branches_, const fs::path &branchpath_, const fs::path &fusepath_, const int origfd_) { return ::_movefile_and_open(policy_, branches_, branchpath_, fusepath_, origfd_); } int fs::movefile_and_open_as_root(const Policy::Create &policy_, const Branches::Ptr &branches_, const fs::path &branchpath_, const fs::path &fusepath_, const int origfd_) { return fs::movefile_and_open(policy_, branches_, branchpath_, fusepath_, origfd_); } mergerfs-2.42.0/src/fs_movefile_and_open.hpp0000644000000000000000000000273215177346257017575 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "branches.hpp" #include "fs_path.hpp" #include "policy.hpp" #include namespace fs { int movefile_and_open(const Policy::Create &policy, const Branches::Ptr &branches_, const fs::path &branchpath, const fs::path &fusepath, const int origfd); int movefile_and_open_as_root(const Policy::Create &policy, const Branches::Ptr &branches_, const fs::path &branchpath, const fs::path &fusepath, int origfd); } mergerfs-2.42.0/src/fs_open.hpp0000644000000000000000000000333515177346257015065 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "to_neg_errno.hpp" #include #include #include #include namespace fs { static inline int open(const char *path_, const int flags_) { int rv; rv = ::open(path_,flags_); return ::to_neg_errno(rv); } static inline int open(const char *path_, const int flags_, const mode_t mode_) { int rv; rv = ::open(path_,flags_,mode_); return ::to_neg_errno(rv); } static inline int open(const std::string &path_, const int flags_) { return fs::open(path_.c_str(),flags_); } static inline int open(const std::string &path_, const int flags_, const mode_t mode_) { return fs::open(path_.c_str(),flags_,mode_); } static inline int open_dir_ro(const std::string &path_) { return fs::open(path_,O_RDONLY|O_DIRECTORY); } } mergerfs-2.42.0/src/fs_open_as.hpp0000644000000000000000000000362515177346257015552 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "fs_open.hpp" #include "ugid.hpp" // Linux can set ugid because it allows for credentials per // thread. FreeBSD however does not and must create as root then // chown. Another option for both platforms would be to create a temp // file, chown, then rename to target. Unfortunately, depending on if // the target filesystem is POSIX compliant or uses POSIX / extended // ACLs it is not possible to know what is best. #if defined __linux__ namespace fs { static inline int open_as(const ugid_t ugid_, const fs::path &path_, const int flags_, const mode_t mode_) { const ugid::SetGuard _(ugid_); return fs::open(path_,flags_,mode_); } } #elif defined __FreeBSD__ #include "fs_fchown.hpp" namespace fs { static inline int open_as(const ugid_t ugid_, const fs::path &path_, const int flags_, const mode_t mode_) { int rv; rv = fs::open(path_,flags_,mode_); if(rv < 0) return rv; fs::fchown(rv,ugid_.uid,ugid_.gid); return rv; } } #else #error "Not Supported!" #endif mergerfs-2.42.0/src/fs_open_fd.cpp0000644000000000000000000000300615177346257015524 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fs_open_fd.hpp" #if defined(__linux__) #include "fmt/core.h" #include "fs_openat.hpp" #include "fatal.hpp" #include "procfs.hpp" int fs::open_fd(const int fd_, const int flags_) { if(procfs::PROC_SELF_FD_FD <= 0) fatal::abort("procfs::PROC_SELF_FD_FD must be > 0"); const int flags = (flags_ & ~O_NOFOLLOW); return fs::openat(procfs::PROC_SELF_FD_FD, fmt::format("{}",fd_), flags); } #elif defined(__FreeBSD__) #include "fs_openat.hpp" int fs::open_fd(const int fd_, const int flags_) { const int flags = ((flags_ | O_EMPTY_PATH) & ~O_NOFOLLOW); return fs::openat(fd_,"",flags); } #else #error "fs::open_fd() not supported on platform" #endif mergerfs-2.42.0/src/fs_open_fd.hpp0000644000000000000000000000156215177346257015536 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once namespace fs { int open_fd(const int fd, const int flags); } mergerfs-2.42.0/src/fs_openat.hpp0000644000000000000000000000346415177346257015415 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "fs_path.hpp" #include "to_neg_errno.hpp" #include #include #include #include namespace fs { static inline int openat(const int dirfd_, const char *pathname_, const int flags_, const mode_t mode_ = 0) { int rv; rv = ::openat(dirfd_,pathname_,flags_,mode_); return ::to_neg_errno(rv); } static inline int openat(const int dirfd_, const std::string &pathname_, const int flags_, const mode_t mode_ = 0) { return fs::openat(dirfd_, pathname_.c_str(), flags_, mode_); } static inline int openat(const int dirfd_, const fs::path &pathname_, const int flags_, const mode_t mode_ = 0) { return fs::openat(dirfd_, pathname_.c_str(), flags_, mode_); } } mergerfs-2.42.0/src/fs_opendir.hpp0000644000000000000000000000211515177346257015557 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include #include #include namespace fs { static inline DIR * opendir(const char *name_) { return ::opendir(name_); } static inline DIR * opendir(const std::string &name_) { return fs::opendir(name_.c_str()); } } mergerfs-2.42.0/src/fs_path.cpp0000644000000000000000000000147315177346257015054 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fs_path.hpp" mergerfs-2.42.0/src/fs_path.hpp0000644000000000000000000000160115177346257015052 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include namespace fs { using path = std::filesystem::path; } mergerfs-2.42.0/src/fs_pread.hpp0000644000000000000000000000214415177346257015214 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "base_types.h" #include "to_neg_errno.hpp" #include namespace fs { static s64 pread(const int fd_, void *buf_, const u64 count_, const s64 offset_) { s64 rv; rv = ::pread(fd_,buf_,count_,offset_); return ::to_neg_errno(rv); } } mergerfs-2.42.0/src/fs_preadn.hpp0000644000000000000000000000315515177346257015375 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "fs_pread.hpp" namespace fs { static inline s64 preadn(const int fd_, void *buf_, const u64 count_, const s64 offset_, int *err_) { s64 rv; s64 nleft = count_; s64 offset = offset_; const char *buf = (const char*)buf_; *err_ = 0; while(nleft > 0) { rv = fs::pread(fd_,buf,nleft,offset); switch(rv) { case -EINTR: case -EAGAIN: continue; case 0: return (count_ - nleft); default: if(rv < 0) { *err_ = rv; return (count_ - nleft); } break; } buf += rv; nleft -= rv; offset += rv; } return count_; } } mergerfs-2.42.0/src/fs_pwrite.hpp0000644000000000000000000000215715177346257015437 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "to_neg_errno.hpp" #include namespace fs { static inline ssize_t pwrite(int const fd_, void const *buf_, size_t const count_, off_t const offset_) { ssize_t rv; rv = ::pwrite(fd_,buf_,count_,offset_); return ::to_neg_errno(rv); } } mergerfs-2.42.0/src/fs_pwriten.hpp0000644000000000000000000000322515177346257015612 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "fs_pwrite.hpp" namespace fs { static inline ssize_t pwriten(const int fd_, const void *buf_, const size_t count_, const off_t offset_, int *err_) { ssize_t rv; ssize_t count = count_; off_t offset = offset_; char const *buf = (char const *)buf_; *err_ = 0; while(count > 0) { rv = fs::pwrite(fd_,buf,count,offset); switch(rv) { case -EINTR: case -EAGAIN: continue; case 0: return (count_ - count); default: if(rv < 0) { *err_ = rv; return (count_ - count); } break; } buf += rv; count -= rv; offset += rv; } return count_; } } mergerfs-2.42.0/src/fs_read.hpp0000644000000000000000000000207715177346257015041 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "to_neg_errno.hpp" #include namespace fs { static inline ssize_t read(const int fd_, void *buf_, const size_t count_) { ssize_t rv; rv = ::read(fd_,buf_,count_); return ::to_neg_errno(rv); } } mergerfs-2.42.0/src/fs_readahead.cpp0000644000000000000000000000365315177346257016020 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fs_readahead.hpp" #include "fmt/core.h" #include "fs_lstat.hpp" #include #include #ifdef __FreeBSD__ # include #else # include #endif static std::string _generate_readahead_sys_path(cu64 major_, cu64 minor_) { return fmt::format("/sys/class/bdi/{}:{}/read_ahead_kb",major_,minor_); } int fs::readahead(cu64 major_dev_, cu64 minor_dev_, cu64 size_in_kb_) { std::string syspath; std::ofstream ofs; syspath = ::_generate_readahead_sys_path(major_dev_,minor_dev_); ofs.open(syspath); if(ofs) { ofs << fmt::format("{}\n",size_in_kb_); ofs.close(); } return 0; } int fs::readahead(cu64 dev_, cu64 size_in_kb_) { u32 major_dev; u32 minor_dev; major_dev = major(dev_); minor_dev = minor(dev_); return fs::readahead(major_dev,minor_dev,size_in_kb_); } int fs::readahead(const std::string path_, cu64 size_in_kb_) { int rv; struct stat st; rv = fs::lstat(path_,&st); if(rv < 0) return rv; return fs::readahead(st.st_dev,size_in_kb_); } mergerfs-2.42.0/src/fs_readahead.hpp0000644000000000000000000000213615177346257016020 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "base_types.h" #include namespace fs { int readahead(cu64 major_dev, cu64 minor_dev, cu64 size_in_kb); int readahead(cu64 dev, cu64 size_in_kb); int readahead(const std::string path, cu64 size_in_kb); } mergerfs-2.42.0/src/fs_readdir.hpp0000644000000000000000000000167015177346257015536 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include namespace fs { static inline struct dirent * readdir(DIR *dirp_) { return ::readdir(dirp_); } } mergerfs-2.42.0/src/fs_readlink.hpp0000644000000000000000000000217715177346257015720 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "to_neg_errno.hpp" #include #include namespace fs { static inline ssize_t readlink(const std::string &path_, char *buf_, const size_t bufsiz_) { ssize_t rv; rv = ::readlink(path_.c_str(),buf_,bufsiz_); return ::to_neg_errno(rv); } } mergerfs-2.42.0/src/fs_realpath.hpp0000644000000000000000000000223115177346257015716 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include #include #include namespace fs { static inline char * realpath(const std::string &path_, char *resolved_path_) { return ::realpath(path_.c_str(),resolved_path_); } static inline char * realpath(const std::string &path_) { return fs::realpath(path_,NULL); } } mergerfs-2.42.0/src/fs_realpathize.cpp0000644000000000000000000000223015177346257016420 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fs_realpathize.hpp" #include "fs_realpath.hpp" #include #include void fs::realpathize(std::vector *strs_) { char *rv; char resolved_path[PATH_MAX]; for(size_t i = 0; i < strs_->size(); i++) { rv = fs::realpath((*strs_)[i],resolved_path); if(rv == NULL) continue; (*strs_)[i] = rv; } } mergerfs-2.42.0/src/fs_realpathize.hpp0000644000000000000000000000163715177346257016437 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include #include namespace fs { void realpathize(std::vector *strs); } mergerfs-2.42.0/src/fs_remove.hpp0000644000000000000000000000220515177346257015414 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "to_neg_errno.hpp" #include #include namespace fs { static inline int remove(const char *pathname_) { int rv; rv = ::remove(pathname_); return ::to_neg_errno(rv); } static inline int remove(const std::string &pathname_) { return fs::remove(pathname_.c_str()); } } mergerfs-2.42.0/src/fs_rename.hpp0000644000000000000000000000231515177346257015370 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "to_neg_errno.hpp" #include namespace fs { static inline int rename(const char *oldpath_, const char *newpath_) { int rv; rv = ::rename(oldpath_,newpath_); return ::to_neg_errno(rv); } static inline int rename(const std::string &oldpath_, const std::string &newpath_) { return fs::rename(oldpath_.c_str(),newpath_.c_str()); } } mergerfs-2.42.0/src/fs_rmdir.hpp0000644000000000000000000000216215177346257015236 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "to_neg_errno.hpp" #include #include namespace fs { static inline int rmdir(const char *path_) { int rv; rv = ::rmdir(path_); return ::to_neg_errno(rv); } static inline int rmdir(const std::string &path_) { return fs::rmdir(path_.c_str()); } } mergerfs-2.42.0/src/fs_sendfile.cpp0000644000000000000000000000176015177346257015710 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #ifdef __linux__ #pragma message "using fs_sendfile_linux.icpp" #include "fs_sendfile_linux.icpp" #else #pragma message "using fs_sendfile_unsupported.icpp" #include "fs_sendfile_unsupported.icpp" #endif mergerfs-2.42.0/src/fs_sendfile.hpp0000644000000000000000000000170315177346257015712 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include namespace fs { ssize_t sendfile(const int fdin, const int fdout, const size_t count); } mergerfs-2.42.0/src/fs_sendfile_linux.icpp0000644000000000000000000000210315177346257017270 0ustar rootroot/* Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "to_neg_errno.hpp" #include namespace fs { ssize_t sendfile(const int fdin, const int fdout, const size_t count) { ssize_t rv; off_t offset = 0; rv = ::sendfile(fdout,fdin,&offset,count); return ::to_neg_errno(rv); } } mergerfs-2.42.0/src/fs_sendfile_unsupported.icpp0000644000000000000000000000174015177346257020527 0ustar rootroot/* Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fs_sendfile.hpp" #include "errno.hpp" #include ssize_t fs::sendfile(const int fdin, const int fdout, const size_t count) { return -EINVAL; } mergerfs-2.42.0/src/fs_setfl.cpp0000644000000000000000000000170015177346257015226 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fs_setfl.hpp" #include "fs_fcntl.hpp" int fs::setfl(const int fd_, const mode_t mode_) { return fs::fcntl(fd_,F_SETFL,mode_); } mergerfs-2.42.0/src/fs_setfl.hpp0000644000000000000000000000162315177346257015237 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include namespace fs { int setfl(const int fd, const mode_t mode); } mergerfs-2.42.0/src/fs_stat.hpp0000644000000000000000000000233415177346257015075 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "to_neg_errno.hpp" #include #include #include #include namespace fs { static inline int stat(const char *path_, struct stat *st_) { int rv; rv = ::stat(path_,st_); return ::to_neg_errno(rv); } static inline int stat(const std::string &path_, struct stat *st_) { return fs::stat(path_.c_str(),st_); } } mergerfs-2.42.0/src/fs_stat_utils.hpp0000644000000000000000000000304015177346257016310 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include #include #include #include namespace fs { static inline timespec * stat_atime(struct stat *st_) { #if __APPLE__ return &st_->st_atimespec; #else return &st_->st_atim; #endif } static inline const timespec * stat_atime(const struct stat *st_) { #if __APPLE__ return &st_->st_atimespec; #else return &st_->st_atim; #endif } static inline timespec * stat_mtime(struct stat *st_) { #if __APPLE__ return &st_->st_mtimespec; #else return &st_->st_mtim; #endif } static inline const timespec * stat_mtime(const struct stat *st_) { #if __APPLE__ return &st_->st_mtimespec; #else return &st_->st_mtim; #endif } } mergerfs-2.42.0/src/fs_statvfs.hpp0000644000000000000000000000231415177346257015612 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "to_neg_errno.hpp" #include #include namespace fs { static inline int statvfs(const char *path_, struct statvfs *st_) { int rv; rv = ::statvfs(path_,st_); return ::to_neg_errno(rv); } static inline int statvfs(const std::string &path_, struct statvfs *st_) { return fs::statvfs(path_.c_str(),st_); } } mergerfs-2.42.0/src/fs_statvfs_cache.cpp0000644000000000000000000000516115177346257016733 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fs_statvfs_cache.hpp" #include "fs_statvfs.hpp" #include "statvfs_util.hpp" #include "mutex.hpp" #include #include #include #include struct Element { u64 time; struct statvfs st; }; typedef std::unordered_map statvfs_cache; static u64 g_timeout = 0; static statvfs_cache g_cache; static Mutex g_cache_lock; static u64 _get_time(void) { u64 rv; rv = ::time(NULL); return rv; } u64 fs::statvfs_cache_timeout(void) { return g_timeout; } void fs::statvfs_cache_timeout(cu64 timeout_) { g_timeout = timeout_; } int fs::statvfs_cache(const std::string &path_, struct statvfs *st_) { int rv; Element *e; u64 now; if(g_timeout == 0) return fs::statvfs(path_,st_); rv = 0; now = ::_get_time(); mutex_lock(g_cache_lock); e = &g_cache[path_]; if((now - e->time) > g_timeout) { e->time = now; rv = fs::statvfs(path_,&e->st); } *st_ = e->st; mutex_unlock(g_cache_lock); return rv; } int fs::statvfs_cache_readonly(const std::string &path_, bool *readonly_) { int rv; struct statvfs st; rv = fs::statvfs_cache(path_,&st); if(rv == 0) *readonly_ = StatVFS::readonly(st); return rv; } int fs::statvfs_cache_spaceavail(const std::string &path_, u64 *spaceavail_) { int rv; struct statvfs st; rv = fs::statvfs_cache(path_,&st); if(rv == 0) *spaceavail_ = StatVFS::spaceavail(st); return rv; } int fs::statvfs_cache_spaceused(const std::string &path_, u64 *spaceused_) { int rv; struct statvfs st; rv = fs::statvfs_cache(path_,&st); if(rv == 0) *spaceused_ = StatVFS::spaceused(st); return rv; } mergerfs-2.42.0/src/fs_statvfs_cache.hpp0000644000000000000000000000261615177346257016742 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "base_types.h" #include #include namespace fs { u64 statvfs_cache_timeout(void); void statvfs_cache_timeout(cu64 timeout); int statvfs_cache(const std::string &path, struct statvfs *st); int statvfs_cache_readonly(const std::string &path, bool *readonly); int statvfs_cache_spaceavail(const std::string &path, u64 *spaceavail); int statvfs_cache_spaceused(const std::string &path, u64 *spaceused); } mergerfs-2.42.0/src/fs_statx.hpp0000644000000000000000000000350215177346257015263 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "to_neg_errno.hpp" #include "fuse_kernel.h" #include #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif #include #include #include "supported_statx.hpp" namespace fs { static inline int statx(const int dirfd_, const char *pathname_, const int flags_, const unsigned int mask_, struct fuse_statx *st_) { #ifdef MERGERFS_SUPPORTED_STATX int rv; rv = ::statx(dirfd_, pathname_, flags_, mask_, (struct statx*)st_); return ::to_neg_errno(rv); #else return -ENOSYS; #endif } static inline int statx(const int dirfd_, const std::string &pathname_, const int flags_, const unsigned int mask_, struct fuse_statx *st_) { return fs::statx(dirfd_, pathname_.c_str(), flags_, mask_, st_); } } mergerfs-2.42.0/src/fs_symlink.hpp0000644000000000000000000000267115177346257015614 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "to_neg_errno.hpp" #include #include namespace fs { static inline int symlink(const char *target_, const char *linkpath_) { int rv; rv = ::symlink(target_,linkpath_); return ::to_neg_errno(rv); } static inline int symlink(const std::string &target_, const std::string &linkpath_) { return fs::symlink(target_.c_str(), linkpath_.c_str()); } static inline int symlink(const char *target_, const std::string &linkpath_) { return fs::symlink(target_, linkpath_.c_str()); } } mergerfs-2.42.0/src/fs_symlink_as.hpp0000644000000000000000000000303615177346257016273 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "fs_symlink.hpp" #include "ugid.hpp" #if defined __linux__ namespace fs { template static inline int symlink_as(const ugid_t ugid_, const char *target_, const T &linkpath_) { const ugid::SetGuard _(ugid_); return fs::symlink(target_,linkpath_); } } #elif defined __FreeBSD__ #include "fs_lchown.hpp" namespace fs { template static inline int symlink_as(const ugid_t ugid_, const char *target_, const T &linkpath_) { int rv; rv = fs::symlink(target_,linkpath_); if(rv < 0) return rv; fs::lchown(linkpath_,ugid_.uid,ugid_.gid); return 0; } } #else #error "Not Supported!" #endif mergerfs-2.42.0/src/fs_truncate.hpp0000644000000000000000000000235615177346257015753 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "to_neg_errno.hpp" #include #include #include namespace fs { static inline int truncate(const char *path_, const off_t length_) { int rv; rv = ::truncate(path_,length_); return ::to_neg_errno(rv); } static inline int truncate(const std::string &path_, const off_t length_) { return fs::truncate(path_.c_str(),length_); } } mergerfs-2.42.0/src/fs_umount2.hpp0000644000000000000000000000261015177346257015530 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "errno.hpp" #include "to_neg_errno.hpp" #ifdef __FreeBSD__ # include # include # define umount2(target,flags) unmount(target,flags) # define MNT_DETACH 0 #else # include #endif #include namespace fs { static inline int umount2(const std::string target_, const int flags_) { int rv; rv = ::umount2(target_.c_str(), flags_); return ::to_neg_errno(rv); } static inline int umount_lazy(const std::string target_) { return fs::umount2(target_,MNT_DETACH); } } mergerfs-2.42.0/src/fs_unlink.hpp0000644000000000000000000000216615177346257015425 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "to_neg_errno.hpp" #include #include namespace fs { static inline int unlink(const char *path_) { int rv; rv = ::unlink(path_); return ::to_neg_errno(rv); } static inline int unlink(const std::string &path_) { return fs::unlink(path_.c_str()); } } mergerfs-2.42.0/src/fs_utimensat.hpp0000644000000000000000000000213515177346257016132 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #ifdef __linux__ #pragma message "using fs_utimensat_linux.hpp" #include "fs_utimensat_linux.hpp" #elif __FreeBSD__ #pragma message "using fs_utimensat_freebsd.hpp" #include "fs_utimensat_freebsd.hpp" #else #pragma message "using fs_utimensat_generic.hpp" #include "fs_utimensat_generic.hpp" #endif mergerfs-2.42.0/src/fs_utimensat_freebsd.hpp0000644000000000000000000000275015177346257017627 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "to_neg_errno.hpp" #include #include #include namespace fs { static inline int utimensat(const int dirfd_, const char *pathname_, const struct timespec times_[2], const int flags_) { int rv; rv = ::utimensat(dirfd_,pathname_,times_,flags_); return ::to_neg_errno(rv); } static inline int utimensat(const int dirfd_, const std::string &pathname_, const struct timespec times_[2], const int flags_) { return fs::utimensat(dirfd_,pathname_.c_str(),times_,flags_); } } mergerfs-2.42.0/src/fs_utimensat_generic.hpp0000644000000000000000000001453615177346257017636 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fs_fstat.hpp" #include "fs_fstatat.hpp" #include "fs_futimesat.hpp" #include "fs_lutimens.hpp" #include "fs_stat_utils.hpp" #include #include #include #include #ifndef UTIME_NOW # define UTIME_NOW ((1l << 30) - 1l) #endif #ifndef UTIME_OMIT # define UTIME_OMIT ((1l << 30) - 2l) #endif static inline bool _can_call_lutimes(const int dirfd_, const std::string &path_, const int flags_) { return ((flags_ == AT_SYMLINK_NOFOLLOW) && ((dirfd_ == AT_FDCWD) || (path_[0] == '/'))); } static inline bool _should_ignore(const struct timespec ts_[2]) { return ((ts_ != NULL) && (ts_[0].tv_nsec == UTIME_OMIT) && (ts_[1].tv_nsec == UTIME_OMIT)); } static inline bool _should_be_set_to_now(const struct timespec ts_[2]) { return ((ts_ == NULL) || ((ts_[0].tv_nsec == UTIME_NOW) && (ts_[1].tv_nsec == UTIME_NOW))); } static inline bool _timespec_invalid(const struct timespec &ts_) { return (((ts_.tv_nsec < 0) || (ts_.tv_nsec > 999999999)) && ((ts_.tv_nsec != UTIME_NOW) && (ts_.tv_nsec != UTIME_OMIT))); } static inline bool _timespec_invalid(const struct timespec ts_[2]) { return ((ts_ != NULL) && (::_timespec_invalid(ts_[0]) || ::_timespec_invalid(ts_[1]))); } static inline bool _flags_invalid(const int flags_) { return ((flags_ & ~AT_SYMLINK_NOFOLLOW) != 0); } static inline bool _any_timespec_is_utime_omit(const struct timespec ts_[2]) { return ((ts_[0].tv_nsec == UTIME_OMIT) || (ts_[1].tv_nsec == UTIME_OMIT)); } static inline bool _any_timespec_is_utime_now(const struct timespec ts_[2]) { return ((ts_[0].tv_nsec == UTIME_NOW) || (ts_[1].tv_nsec == UTIME_NOW)); } static inline int _set_utime_omit_to_current_value(const int dirfd_, const std::string &path_, const struct timespec ts_[2], struct timeval tv_[2], const int flags_) { int rv; struct stat st; timespec *atime; timespec *mtime; if(!::_any_timespec_is_utime_omit(ts_)) return 0; rv = fs::fstatat(dirfd_,path_,&st,flags_); if(rv < 0) return rv; atime = fs::stat_atime(st); mtime = fs::stat_mtime(st); if(ts_[0].tv_nsec == UTIME_OMIT) TIMESPEC_TO_TIMEVAL(&tv[0],atime); if(ts_[1].tv_nsec == UTIME_OMIT) TIMESPEC_TO_TIMEVAL(&tv[1],mtime); return 0; } static inline int _set_utime_omit_to_current_value(const int fd_, const struct timespec ts_[2], struct timeval tv_[2]) { int rv; struct stat st; timespec *atime; timespec *mtime; if(!::_any_timespec_is_utime_omit(ts_)) return 0; rv = fs::fstat(fd_,&st); if(rv < 0) return rv; atime = fs::stat_atime(st); mtime = fs::stat_mtime(st); if(ts_[0].tv_nsec == UTIME_OMIT) TIMESPEC_TO_TIMEVAL(&tv_[0],atime); if(ts_[1].tv_nsec == UTIME_OMIT) TIMESPEC_TO_TIMEVAL(&tv_[1],mtime); return 0; } static inline int _set_utime_now_to_now(const struct timespec ts_[2], struct timeval tv_[2]) { int rv; struct timeval now; if(::_any_timespec_is_utime_now(ts_)) return 0; rv = time::gettimeofday(&now,NULL); if(rv < 0) return rv; if(ts_[0].tv_nsec == UTIME_NOW) tv_[0] = now; if(ts_[1].tv_nsec == UTIME_NOW) tv_[1] = now; return 0; } static inline int _convert_timespec_to_timeval(const int dirfd_, const std::string &path_, const struct timespec ts_[2], struct timeval tv_[2], struct timeval **tvp_, const int flags_) { int rv; if(::_should_be_set_to_now(ts_)) return (tvp=NULL,0); TIMESPEC_TO_TIMEVAL(&tv_[0],&ts_[0]); TIMESPEC_TO_TIMEVAL(&tv_[1],&ts_[1]); rv = ::_set_utime_omit_to_current_value(dirfd_,path_,ts_,tv_,flags_); if(rv < 0) return rv; rv = ::_set_utime_now_to_now(ts_,tv_); if(rv < 0) return rv; return (*tvp_=tv_,0); } static inline int _convert_timespec_to_timeval(const int fd_, const struct timespec ts_[2], struct timeval tv_[2], struct timeval **tvp_) { int rv; if(::_should_be_set_to_now(ts_)) return (*tvp=NULL,0); TIMESPEC_TO_TIMEVAL(&tv_[0],&ts_[0]); TIMESPEC_TO_TIMEVAL(&tv_[1],&ts_[1]); rv = ::_set_utime_omit_to_current_value(fd_,ts_,tv_); if(rv < 0) return rv; rv = ::_set_utime_now_to_now(ts_,tv_); if(rv < 0) return rv; return (*tvp=tv,0); } } namespace fs { static inline int utimensat(const int dirfd_, const std::string &path_, const struct timespec ts_[2], const int flags_) { int rv; struct timeval tv[2]; struct timeval *tvp; if(::_flags_invalid(flags)) return -EINVAL; if(::_timespec_invalid(ts_)) return -EINVAL; if(::_should_ignore(ts_)) return 0; rv = ::_convert_timespec_to_timeval(dirfd_,path_,ts_,tv,&tvp,flags_); if(rv < 0) return rv; if((flags_ & AT_SYMLINK_NOFOLLOW) == 0) return fs::futimesat(dirfd_,path_,tvp); if(::_can_call_lutimes(dirfd_,path_,flags)) return fs::lutimes(path_,tvp); return -ENOTSUP; } } mergerfs-2.42.0/src/fs_utimensat_linux.hpp0000644000000000000000000000275015177346257017354 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "to_neg_errno.hpp" #include #include #include namespace fs { static inline int utimensat(const int dirfd_, const char *pathname_, const struct timespec times_[2], const int flags_) { int rv; rv = ::utimensat(dirfd_,pathname_,times_,flags_); return ::to_neg_errno(rv); } static inline int utimensat(const int dirfd_, const std::string &pathname_, const struct timespec times_[2], const int flags_) { return fs::utimensat(dirfd_,pathname_.c_str(),times_,flags_); } } mergerfs-2.42.0/src/fs_wait_for_mount.cpp0000644000000000000000000001071315177346257017151 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fs_wait_for_mount.hpp" #include "syslog.hpp" #include "fs_mount.hpp" #include "fs_exists.hpp" #include "fs_lgetxattr.hpp" #include "fs_lstat.hpp" #include "fs_stat.hpp" #include #include #include #include constexpr std::chrono::milliseconds SLEEP_DURATION = std::chrono::milliseconds(333); static bool _branch_is_mounted(const struct stat &src_st_, const fs::path &branch_path_) { int rv; struct stat st; fs::path filepath; rv = fs::lgetxattr(branch_path_,"user.mergerfs.branch",NULL,0); if(rv >= 0) return true; filepath = branch_path_ / ".mergerfs.branch"; rv = fs::exists(filepath); if(rv) return true; rv = fs::lgetxattr(branch_path_,"user.mergerfs.branch_mounts_here",NULL,0); if(rv >= 0) return false; filepath = branch_path_ / ".mergerfs.branch_mounts_here"; rv = fs::exists(filepath); if(rv) return false; rv = fs::lstat(branch_path_,&st); if(rv == 0) return (st.st_dev != src_st_.st_dev); return false; } static void _check_mounted(const struct stat &src_st_, const std::set &tgt_paths_, std::vector *successes_, std::vector *failures_) { std::vector &successes = *successes_; std::vector &failures = *failures_; for(auto const &tgt_path : tgt_paths_) { bool mounted; mounted = ::_branch_is_mounted(src_st_,tgt_path); if(mounted) successes.push_back(tgt_path); else failures.push_back(tgt_path); } } static int _wait_for_mount(const struct stat &src_st_, const std::vector &tgt_paths_, const std::chrono::milliseconds &timeout_) { bool first_loop; std::vector successes; std::vector failures; std::set tgt_paths; std::chrono::time_point now; std::chrono::time_point deadline; tgt_paths.insert(tgt_paths_.begin(),tgt_paths_.end()); now = std::chrono::steady_clock::now(); deadline = now + timeout_; first_loop = true; while(true) { if(tgt_paths.empty()) break; if(now >= deadline) break; successes.clear(); failures.clear(); ::_check_mounted(src_st_,tgt_paths,&successes,&failures); for(const auto &path : successes) { tgt_paths.erase(path); SysLog::info("{} is ready",path.string()); } if(first_loop) { for(const auto &path : failures) SysLog::notice("{} is not ready, waiting",path.string()); first_loop = false; } std::this_thread::sleep_for(SLEEP_DURATION); now = std::chrono::steady_clock::now(); } for(const auto &path : failures) SysLog::notice("{} not ready within timeout",path.string()); return failures.size(); } int fs::wait_for_mount(const fs::path &src_path_, const std::vector &tgt_paths_, const std::chrono::milliseconds &timeout_) { int rv; struct stat src_st = {}; rv = fs::stat(src_path_,&src_st); if(rv < 0) SysLog::error("Error stat'ing mount path: {} ({})", src_path_.string(), ::strerror(-rv)); for(auto &tgt_path : tgt_paths_) { int rv; if(::_branch_is_mounted(src_st,tgt_path)) continue; rv = fs::mount(tgt_path); SysLog::notice("mount {}: {}", tgt_path.string(), ((rv == 0) ? "success" : "fail")); } return ::_wait_for_mount(src_st,tgt_paths_,timeout_); } mergerfs-2.42.0/src/fs_wait_for_mount.hpp0000644000000000000000000000207115177346257017154 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "fs_path.hpp" #include #include namespace fs { int wait_for_mount(const fs::path &srcpath, const std::vector &tgtpaths, const std::chrono::milliseconds &timeout); } mergerfs-2.42.0/src/fs_write.hpp0000644000000000000000000000210315177346257015246 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "to_neg_errno.hpp" #include namespace fs { static inline ssize_t write(const int fd_, const void *buf_, const size_t count_) { ssize_t rv; rv = ::write(fd_,buf_,count_); return ::to_neg_errno(rv); } } mergerfs-2.42.0/src/fs_xattr.cpp0000644000000000000000000001476715177346257015274 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fs_xattr.hpp" #include "errno.hpp" #include "fs_close.hpp" #include "fs_fgetxattr.hpp" #include "fs_flistxattr.hpp" #include "fs_fsetxattr.hpp" #include "fs_lgetxattr.hpp" #include "fs_llistxattr.hpp" #include "fs_lremovexattr.hpp" #include "fs_lsetxattr.hpp" #include "fs_open.hpp" #include "str.hpp" #include #include #include #include using std::istringstream; int fs::xattr::list(const int fd_, vector *attrs_) { ssize_t rv; rv = -ERANGE; while(rv == -ERANGE) { rv = fs::flistxattr(fd_,NULL,0); if(rv <= 0) return rv; attrs_->resize(rv); rv = fs::flistxattr(fd_,&(*attrs_)[0],rv); } return rv; } int fs::xattr::list(const string &path_, vector *attrs_) { ssize_t rv; rv = -ERANGE; while(rv == -ERANGE) { rv = fs::llistxattr(path_,NULL,0); if(rv <= 0) return rv; attrs_->resize(rv); rv = fs::llistxattr(path_,&(*attrs_)[0],rv); } return rv; } int fs::xattr::list(const int fd_, vector *attrvector_) { int rv; vector attrs; rv = fs::xattr::list(fd_,&attrs); if(rv > 0) { string tmp(attrs.begin(),attrs.end()); *attrvector_ = str::split(tmp,'\0'); } return rv; } int fs::xattr::list(const string &path_, vector *attrvector_) { int rv; vector attrs; rv = fs::xattr::list(path_,&attrs); if(rv > 0) { string tmp(attrs.begin(),attrs.end()); *attrvector_ = str::split(tmp,'\0'); } return rv; } int fs::xattr::list(const int fd_, string *attrstr_) { int rv; vector attrs; rv = fs::xattr::list(fd_,&attrs); if(rv > 0) *attrstr_ = string{attrs.begin(),attrs.end()}; return rv; } int fs::xattr::list(const string &path_, string *attrstr_) { int rv; vector attrs; rv = fs::xattr::list(path_,&attrs); if(rv > 0) *attrstr_ = string{attrs.begin(),attrs.end()}; return rv; } int fs::xattr::get(const int fd_, const string &attr_, vector *value_) { ssize_t rv; rv = -ERANGE; while(rv == -ERANGE) { rv = fs::fgetxattr(fd_,attr_,NULL,0); if(rv <= 0) return rv; value_->resize(rv); rv = fs::fgetxattr(fd_,attr_,&(*value_)[0],rv); } return rv; } int fs::xattr::get(const string &path_, const string &attr_, vector *value_) { ssize_t rv; rv = -ERANGE; while(rv == -ERANGE) { rv = fs::lgetxattr(path_,attr_,NULL,0); if(rv <= 0) return rv; value_->resize(rv); rv = fs::lgetxattr(path_,attr_,&(*value_)[0],rv); } return rv; } int fs::xattr::get(const int fd_, const string &attr_, string *value_) { int rv; vector tmpvalue; rv = fs::xattr::get(fd_,attr_,&tmpvalue); if(rv > 0) *value_ = string{tmpvalue.begin(),tmpvalue.end()}; return rv; } int fs::xattr::get(const string &path_, const string &attr_, string *value_) { int rv; vector tmpvalue; rv = fs::xattr::get(path_,attr_,&tmpvalue); if(rv > 0) *value_ = string{tmpvalue.begin(),tmpvalue.end()}; return rv; } int fs::xattr::get(const int fd_, map *attrs_) { int rv; string attrstr; rv = fs::xattr::list(fd_,&attrstr); if(rv < 0) return rv; { string key; std::istringstream ss(attrstr); while(getline(ss,key,'\0')) { string value; rv = fs::xattr::get(fd_,key,&value); if(rv >= 0) (*attrs_)[key] = value; } } return 0; } int fs::xattr::get(const string &path_, map *attrs_) { int rv; string attrstr; rv = fs::xattr::list(path_,&attrstr); if(rv < 0) return rv; { string key; std::istringstream ss(attrstr); while(getline(ss,key,'\0')) { string value; rv = fs::xattr::get(path_,key,&value); if(rv >= 0) (*attrs_)[key] = value; } } return 0; } int fs::xattr::set(const int fd_, const string &key_, const string &value_, const int flags_) { return fs::fsetxattr(fd_, key_, value_.data(), value_.size(), flags_); } int fs::xattr::set(const string &path_, const string &key_, const string &value_, const int flags_) { return fs::lsetxattr(path_, key_, value_.data(), value_.size(), flags_); } int fs::xattr::set(const int fd_, const map &attrs_) { int rv; for(const auto &[key,val] : attrs_) { rv = fs::xattr::set(fd_,key,val,0); if(rv < 0) return rv; } return 0; } int fs::xattr::set(const string &path_, const map &attrs_) { int fd; int rv; fd = fs::open(path_,O_RDONLY|O_NONBLOCK); if(fd < 0) return fd; rv = fs::xattr::set(fd,attrs_); fs::close(fd); return rv; } int fs::xattr::copy(const int fdin_, const int fdout_) { int rv; map attrs; rv = fs::xattr::get(fdin_,&attrs); if(rv < 0) return rv; return fs::xattr::set(fdout_,attrs); } int fs::xattr::copy(const string &from_, const string &to_) { int rv; map attrs; rv = fs::xattr::get(from_,&attrs); if(rv < 0) return rv; return fs::xattr::set(to_,attrs); } mergerfs-2.42.0/src/fs_xattr.hpp0000644000000000000000000000467515177346257015276 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include #include #include namespace fs { namespace xattr { using std::map; using std::string; using std::vector; int list(const int fd, vector *attrs); int list(const int fd, vector *attrvec); int list(const int fd, string *attrstr); int list(const string &path, vector *attrs); int list(const string &path, string *attrs); int list(const string &path, vector *attrs); int get(const int fd, const string &attr_, vector *val_); int get(const int fd, const string &attr, string *val); int get(const int fd, map *attrs); int get(const string &path, const string &attr, vector *value); int get(const string &path, const string &attr, string *value); int get(const string &path, map *attrs); int set(const int fd, const string &key, const string &value, const int flags); int set(const int fd, const map &attrs); int set(const string &path, const string &key, const string &value, const int flags); int set(const string &path, const map &attrs); int copy(const int fdin, const int fdout); int copy(const string &from, const string &to); } } mergerfs-2.42.0/src/func.cpp0000644000000000000000000000316515177346257014363 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "func.hpp" int Func::Base::Action::from_string(const std::string_view policyname_) { auto *tmp = Policies::Action::find(policyname_); if(not tmp) return -EINVAL; policy = tmp; return 0; } std::string Func::Base::Action::to_string(void) const { return policy.name(); } int Func::Base::Create::from_string(const std::string_view policyname_) { auto *tmp = Policies::Create::find(policyname_); if(not tmp) return -EINVAL; policy = tmp; return 0; } std::string Func::Base::Create::to_string(void) const { return policy.name(); } int Func::Base::Search::from_string(const std::string_view policyname_) { auto *tmp = Policies::Search::find(policyname_); if(not tmp) return -EINVAL; policy = tmp; return 0; } std::string Func::Base::Search::to_string(void) const { return policy.name(); } mergerfs-2.42.0/src/func.hpp0000644000000000000000000000670515177346257014373 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "policy.hpp" #include "policies.hpp" #include "tofrom_string.hpp" #include namespace Func { namespace Base { class Action : public ToFromString { public: Action(Policy::ActionImpl *policy_) : policy(policy_) {} public: int from_string(const std::string_view s) final; std::string to_string() const final; public: Policy::Action policy; }; class Create : public ToFromString { public: Create(Policy::CreateImpl *policy_) : policy(policy_) {} public: int from_string(const std::string_view s) final; std::string to_string() const final; public: Policy::Create policy; }; class Search : public ToFromString { public: Search(Policy::SearchImpl *policy_) : policy(policy_) {} public: int from_string(const std::string_view s) final; std::string to_string() const final; public: Policy::Search policy; }; class ActionDefault : public Action { public: ActionDefault() : Func::Base::Action(&Policies::Action::epall) { } }; class CreateDefault : public Create { public: CreateDefault() : Func::Base::Create(&Policies::Create::pfrd) { } }; class SearchDefault : public Search { public: SearchDefault() : Func::Base::Search(&Policies::Search::ff) { } }; } class Access final : public Base::SearchDefault { }; class Chmod final : public Base::ActionDefault { }; class Chown final : public Base::ActionDefault { }; class Create final : public Base::CreateDefault { }; class GetAttr final : public Base::SearchDefault { }; class GetXAttr final : public Base::SearchDefault { }; class Link final : public Base::ActionDefault { }; class ListXAttr final : public Base::SearchDefault { }; class Mkdir final : public Base::CreateDefault { }; class Mknod final : public Base::CreateDefault { }; class Open final : public Base::SearchDefault { }; class Readlink final : public Base::SearchDefault { }; class RemoveXAttr final : public Base::ActionDefault { }; class Rename final : public Base::ActionDefault { }; class Rmdir final : public Base::ActionDefault { }; class SetXAttr final : public Base::ActionDefault { }; class Symlink final : public Base::CreateDefault { }; class Truncate final : public Base::ActionDefault { }; class Unlink final : public Base::ActionDefault { }; class Utimens final : public Base::ActionDefault { }; } mergerfs-2.42.0/src/funcs.hpp0000644000000000000000000000262415177346257014552 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "func.hpp" struct Funcs { Func::Access access; Func::Chmod chmod; Func::Chown chown; Func::Create create; Func::GetAttr getattr; Func::GetXAttr getxattr; Func::Link link; Func::ListXAttr listxattr; Func::Mkdir mkdir; Func::Mknod mknod; Func::Open open; Func::Readlink readlink; Func::RemoveXAttr removexattr; Func::Rename rename; Func::Rmdir rmdir; Func::SetXAttr setxattr; Func::Symlink symlink; Func::Truncate truncate; Func::Unlink unlink; Func::Utimens utimens; }; mergerfs-2.42.0/src/fuse_access.cpp0000644000000000000000000000332715177346257015713 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fuse_access.hpp" #include "config.hpp" #include "errno.hpp" #include "fs_eaccess.hpp" #include "fs_path.hpp" #include #include static int _access(const Policy::Search &searchFunc_, const Branches::Ptr branches_, const fs::path &fusepath_, const int mask_) { int rv; StrVec basepaths; fs::path fullpath; std::vector branches; rv = searchFunc_(branches_,fusepath_,branches); if(rv < 0) return rv; if(branches.empty()) return -ENOENT; fullpath = branches[0]->path / fusepath_; rv = fs::eaccess(fullpath,mask_); return rv; } int FUSE::access(const fuse_req_ctx_t *ctx_, const char *fusepath_, int mask_) { const fs::path fusepath{fusepath_}; return ::_access(cfg.func.access.policy, cfg.branches, fusepath, mask_); } mergerfs-2.42.0/src/fuse_access.hpp0000644000000000000000000000173115177346257015715 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "fuse_req_ctx.h" namespace FUSE { int access(const fuse_req_ctx_t *ctx, const char *fusepath, int mask); } mergerfs-2.42.0/src/fuse_bmap.cpp0000644000000000000000000000213215177346257015362 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fuse_bmap.hpp" #include "errno.hpp" int FUSE::bmap(const fuse_req_ctx_t *ctx_, const char *fusepath_, size_t blocksize_, u64 *idx_) { (void)ctx_; (void)fusepath_; (void)blocksize_; (void)idx_; return -ENOSYS; } mergerfs-2.42.0/src/fuse_bmap.hpp0000644000000000000000000000204715177346257015374 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "base_types.h" #include "fuse_req_ctx.h" #include namespace FUSE { int bmap(const fuse_req_ctx_t *ctx, const char *fusepath, size_t blocksize, u64 *idx); } mergerfs-2.42.0/src/fuse_chmod.cpp0000644000000000000000000000543215177346257015543 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fuse_chmod.hpp" #include "config.hpp" #include "errno.hpp" #include "fs_lchmod.hpp" #include "fs_path.hpp" #include "policy_rv.hpp" #include "fuse.h" #include #include static void _chmod_loop_core(const std::string &basepath_, const fs::path &fusepath_, const mode_t mode_, PolicyRV *prv_) { int rv; fs::path fullpath; fullpath = basepath_ / fusepath_; rv = fs::lchmod(fullpath,mode_); prv_->insert(rv,basepath_); } static void _chmod_loop(const std::vector &branches_, const fs::path &fusepath_, const mode_t mode_, PolicyRV *prv_) { for(auto &branch : branches_) { ::_chmod_loop_core(branch->path,fusepath_,mode_,prv_); } } static int _chmod(const Policy::Action &actionFunc_, const Policy::Search &searchFunc_, const Branches::Ptr branches_, const fs::path &fusepath_, const mode_t mode_) { int rv; PolicyRV prv; std::vector branches; rv = actionFunc_(branches_,fusepath_,branches); if(rv < 0) return rv; if(branches.empty()) return -ENOENT; ::_chmod_loop(branches,fusepath_,mode_,&prv); if(prv.errors.empty()) return 0; if(prv.successes.empty()) return prv.errors[0].rv; branches.clear(); rv = searchFunc_(branches_,fusepath_,branches); if(rv < 0) return rv; if(branches.empty()) return -ENOENT; return prv.get_error(branches[0]->path); } static int _chmod(const fs::path &fusepath_, const mode_t mode_) { return ::_chmod(cfg.func.chmod.policy, cfg.func.getattr.policy, cfg.branches, fusepath_, mode_); } int FUSE::chmod(const fuse_req_ctx_t *ctx_, const char *fusepath_, mode_t mode_) { const fs::path fusepath{fusepath_}; return ::_chmod(fusepath,mode_); } mergerfs-2.42.0/src/fuse_chmod.hpp0000644000000000000000000000175615177346257015555 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "fuse_req_ctx.h" #include namespace FUSE { int chmod(const fuse_req_ctx_t *ctx, const char *fusepath, mode_t mode); } mergerfs-2.42.0/src/fuse_chown.cpp0000644000000000000000000000553615177346257015574 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fuse_chown.hpp" #include "config.hpp" #include "errno.hpp" #include "fs_lchown.hpp" #include "fs_path.hpp" #include "policy_rv.hpp" #include "fuse.h" #include #include static void _chown_loop_core(const fs::path &basepath_, const fs::path &fusepath_, const uid_t uid_, const gid_t gid_, PolicyRV *prv_) { int rv; fs::path fullpath; fullpath = basepath_ / fusepath_; rv = fs::lchown(fullpath,uid_,gid_); prv_->insert(rv,basepath_); } static void _chown_loop(const std::vector &branches_, const fs::path &fusepath_, const uid_t uid_, const gid_t gid_, PolicyRV *prv_) { for(const auto &branch : branches_) { ::_chown_loop_core(branch->path,fusepath_,uid_,gid_,prv_); } } static int _chown(const Policy::Action &actionFunc_, const Policy::Search &searchFunc_, const Branches::Ptr branches_, const fs::path &fusepath_, const uid_t uid_, const gid_t gid_) { int rv; PolicyRV prv; std::vector branches; rv = actionFunc_(branches_,fusepath_,branches); if(rv < 0) return rv; if(branches.empty()) return -ENOENT; ::_chown_loop(branches,fusepath_,uid_,gid_,&prv); if(prv.errors.empty()) return 0; if(prv.successes.empty()) return prv.errors[0].rv; branches.clear(); rv = searchFunc_(branches_,fusepath_,branches); if(rv < 0) return rv; if(branches.empty()) return -ENOENT; return prv.get_error(branches[0]->path); } int FUSE::chown(const fuse_req_ctx_t *ctx_, const char *fusepath_, uid_t uid_, gid_t gid_) { const fs::path fusepath{fusepath_}; return ::_chown(cfg.func.chown.policy, cfg.func.getattr.policy, cfg.branches, fusepath, uid_, gid_); } mergerfs-2.42.0/src/fuse_chown.hpp0000644000000000000000000000201615177346257015567 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "fuse_req_ctx.h" #include namespace FUSE { int chown(const fuse_req_ctx_t *ctx, const char *fusepath, uid_t uid, gid_t gid); } mergerfs-2.42.0/src/fuse_copy_file_range.cpp0000644000000000000000000000436215177346257017577 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fuse_copy_file_range.hpp" #include "errno.hpp" #include "fileinfo.hpp" #include "fs_copy_file_range.hpp" #include "state.hpp" #include "fuse.h" #include static ssize_t _copy_file_range(const int src_fd_, off_t src_off_, const int dst_fd_, off_t dst_off_, size_t size_, int flags_) { ssize_t rv; rv = fs::copy_file_range(src_fd_, &src_off_, dst_fd_, &dst_off_, size_, flags_); return rv; } ssize_t FUSE::copy_file_range(const fuse_req_ctx_t *ctx_, const fuse_file_info_t *src_ffi_, off_t src_off_, const fuse_file_info_t *dst_ffi_, off_t dst_off_, const size_t size_, const unsigned int flags_) { FileInfo *src_fi; FileInfo *dst_fi; src_fi = state.get_fi(ctx_,src_ffi_->fh); if(not src_fi) return -EBADF; dst_fi = state.get_fi(ctx_,dst_ffi_->fh); if(not dst_fi) return -EBADF; return ::_copy_file_range(src_fi->fd, src_off_, dst_fi->fd, dst_off_, size_, flags_); } mergerfs-2.42.0/src/fuse_copy_file_range.hpp0000644000000000000000000000253215177346257017601 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "fuse.h" #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif #ifndef _FILE_OFFSET_BITS #define _FILE_OFFSET_BITS 64 #endif #include "fuse.h" #include namespace FUSE { ssize_t copy_file_range(const fuse_req_ctx_t *ctx_, const fuse_file_info_t *ffi_in, off_t offset_in, const fuse_file_info_t *ffi_out, off_t offset_out, const size_t size, const unsigned int flags); } mergerfs-2.42.0/src/fuse_create.cpp0000644000000000000000000002165315177346257015717 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* FILE CREATION WITH FUSE PASSTHROUGH SUPPORT =========================================== This file implements FUSE create() which creates a new file and opens it. Unlike fuse_open.cpp, this file does NOT use a retry loop because the kernel guarantees serialization of create operations. WHY NO RETRY LOOP? ------------------ The fuse_open.cpp retry loop handles the case where multiple threads race to open an EXISTING file. With create(), the kernel serializes namespace operations at the VFS layer - only one create for a given path can succeed. Additionally, when a file is created, FUSE allocates a completely new nodeid (inode number). Since mergerfs never reuses nodeids, there should never be a collision in the open_files map. PASSTHROUGH MODE ---------------- Like fuse_open.cpp, this file supports FUSE passthrough mode for improved I/O performance. The backing_id is obtained from fuse_passthrough_open() and stored in the OpenFile entry. */ #include "fuse_create.hpp" #include "state.hpp" #include "config.hpp" #include "fs_readlink.hpp" #include "errno.hpp" #include "fileinfo.hpp" #include "fs_acl.hpp" #include "fs_close.hpp" #include "fs_clonepath.hpp" #include "fs_open.hpp" #include "fs_open_as.hpp" #include "fs_openat.hpp" #include "fs_path.hpp" #include "fuse_passthrough.hpp" #include "procfs.hpp" #include "syslog.hpp" #include "ugid.hpp" #include "fuse.h" #include #include /* The kernel expects being able to issue read requests when running with writeback caching enabled so we must change O_WRONLY to O_RDWR. With writeback caching enabled the kernel handles O_APPEND. Could be an issue if the underlying file changes out of band but that is true of any caching. */ static void _tweak_flags_cache_writeback(int *flags_) { if((*flags_ & O_ACCMODE) == O_WRONLY) *flags_ = ((*flags_ & ~O_ACCMODE) | O_RDWR); if(*flags_ & O_APPEND) *flags_ &= ~O_APPEND; } static bool _rdonly(const int flags_) { return ((flags_ & O_ACCMODE) == O_RDONLY); } static bool _calculate_flush(FlushOnClose const flushonclose_, int const flags_) { switch(flushonclose_) { case FlushOnCloseEnum::NEVER: return false; case FlushOnCloseEnum::OPENED_FOR_WRITE: return !::_rdonly(flags_); case FlushOnCloseEnum::ALWAYS: return true; } return true; } static void _config_to_ffi_flags(const int tid_, fuse_file_info_t *ffi_) { switch(cfg.cache_files) { case CacheFiles::ENUM::OFF: ffi_->direct_io = 1; ffi_->keep_cache = 0; ffi_->auto_cache = 0; break; case CacheFiles::ENUM::PARTIAL: ffi_->direct_io = 0; ffi_->keep_cache = 0; ffi_->auto_cache = 0; break; case CacheFiles::ENUM::FULL: ffi_->direct_io = 0; ffi_->keep_cache = 1; ffi_->auto_cache = 0; break; case CacheFiles::ENUM::AUTO_FULL: ffi_->direct_io = 0; ffi_->keep_cache = 0; ffi_->auto_cache = 1; break; case CacheFiles::ENUM::PER_PROCESS: std::string proc_name; proc_name = procfs::get_name(tid_); if(cfg.cache_files_process_names.count(proc_name) == 0) { ffi_->direct_io = 1; ffi_->keep_cache = 0; ffi_->auto_cache = 0; } else { ffi_->direct_io = 0; ffi_->keep_cache = 0; ffi_->auto_cache = 0; } break; } if(cfg.parallel_direct_writes == true) ffi_->parallel_direct_writes = ffi_->direct_io; } static int _create_core(const ugid_t ugid_, const fs::path &fullpath_, mode_t mode_, const mode_t umask_, const int flags_) { if(!fs::acl::dir_has_defaults(fullpath_)) mode_ &= ~umask_; return fs::open_as(ugid_,fullpath_,flags_,mode_); } static int _create_core(const ugid_t ugid_, const Branch *branch_, const fs::path &fusepath_, fuse_file_info_t *ffi_, const mode_t mode_, const mode_t umask_) { int rv; FileInfo *fi; fs::path fullpath; fullpath = branch_->path / fusepath_; rv = ::_create_core(ugid_,fullpath,mode_,umask_,ffi_->flags); if(rv < 0) return rv; fi = new FileInfo(rv,*branch_,fusepath_,ffi_->direct_io); ffi_->fh = fi->to_fh(); return 0; } static int _create(const ugid_t ugid_, const Policy::Search &searchFunc_, const Policy::Create &createFunc_, const Branches::Ptr branches_, const fs::path &fusepath_, fuse_file_info_t *ffi_, const mode_t mode_, const mode_t umask_) { int rv; fs::path fullpath; fs::path fusedirpath; std::vector createpaths; std::vector existingpaths; fusedirpath = fusepath_.parent_path(); rv = searchFunc_(branches_,fusedirpath,existingpaths); if(rv < 0) return rv; if(existingpaths.empty()) return -ENOENT; rv = createFunc_(branches_,fusedirpath,createpaths); if(rv < 0) return rv; if(createpaths.empty()) return -ENOENT; rv = fs::clonepath(existingpaths[0]->path, createpaths[0]->path, fusedirpath); if(rv < 0) return rv; return ::_create_core(ugid_, createpaths[0], fusepath_, ffi_, mode_, umask_); } constexpr u64 _(const PassthroughIOEnum e_, cu64 m_) { return ((((u64)e_) << 32) | (m_ & O_ACCMODE)); } static int _create(const fuse_req_ctx_t *ctx_, const fs::path &fusepath_, mode_t mode_, fuse_file_info_t *ffi_) { auto &of = state.open_files; ::_config_to_ffi_flags(ctx_->pid,ffi_); if(cfg.cache_writeback) ::_tweak_flags_cache_writeback(&ffi_->flags); ffi_->noflush = !::_calculate_flush(cfg.flushonclose,ffi_->flags); int rv = ::_create(ctx_, cfg.func.getattr.policy, cfg.func.create.policy, cfg.branches, fusepath_, ffi_, mode_, ctx_->umask); if(rv == -EROFS) { cfg.branches.find_and_set_mode_ro(); rv = ::_create(ctx_, cfg.func.getattr.policy, cfg.func.create.policy, cfg.branches, fusepath_, ffi_, mode_, ctx_->umask); } if(rv < 0) return rv; FileInfo *fi = FileInfo::from_fh(ffi_->fh); int backing_id = INVALID_BACKING_ID; if(not fi) return -EBADF; switch(_(cfg.passthrough_io,ffi_->flags)) { case _(PassthroughIO::ENUM::RO,O_RDONLY): case _(PassthroughIO::ENUM::WO,O_WRONLY): case _(PassthroughIO::ENUM::RW,O_RDONLY): case _(PassthroughIO::ENUM::RW,O_WRONLY): case _(PassthroughIO::ENUM::RW,O_RDWR): backing_id = FUSE::passthrough_open(fi->fd); if(fuse_backing_id_is_valid(backing_id)) { ffi_->backing_id = backing_id; ffi_->passthrough = true; ffi_->keep_cache = false; } break; default: break; } bool inserted = of.try_emplace(ctx_->nodeid, backing_id, fi); // Really. This should never happen. FUSE should not be allowing a // create for an existing nodeid. mergerfs doesn't reuse nodeids. It // always uses a fixed generation value and always uses new nodeids. if(not inserted) { const char *msg = "nodeid already exists in open_files map"; FUSE::passthrough_close(backing_id); fs::close(fi->fd); delete fi; ffi_->fh = 0; SysLog::crit(msg); fmt::println(stderr,"{}",msg); return -EIO; } return 0; } int FUSE::create(const fuse_req_ctx_t *ctx_, const char *fusepath_, mode_t mode_, fuse_file_info_t *ffi_) { const fs::path fusepath{fusepath_}; return ::_create(ctx_,fusepath,mode_,ffi_); } mergerfs-2.42.0/src/fuse_create.hpp0000644000000000000000000000201615177346257015714 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "fuse.h" #include namespace FUSE { int create(const fuse_req_ctx_t *ctx, const char *fusepath, mode_t mode, fuse_file_info_t *ffi); } mergerfs-2.42.0/src/fuse_destroy.cpp0000644000000000000000000000153715177346257016144 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fuse_destroy.hpp" void FUSE::destroy(void) { } mergerfs-2.42.0/src/fuse_destroy.hpp0000644000000000000000000000153615177346257016150 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once namespace FUSE { void destroy(void); } mergerfs-2.42.0/src/fuse_fallocate.cpp0000644000000000000000000000373615177346257016410 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fuse_fallocate.hpp" #include "state.hpp" #include "errno.hpp" #include "fileinfo.hpp" #include "fs_fallocate.hpp" #include "fuse.h" static int _fallocate(const int fd_, const int mode_, const off_t offset_, const off_t len_) { int rv; rv = fs::fallocate(fd_,mode_,offset_,len_); return rv; } // In cases where the node was opened but unlinked there will be no // path and no guarentee of a `fh`. It could always do the lookup but // why bother if the kernel has provided it to us? The reason the // function doesn't need to run within the visit lambda is because // since the request is outstanding the kernel won't be releasing the // node and therefore the entry will be valid over the lifetime of // this function. int FUSE::fallocate(const fuse_req_ctx_t *ctx_, cu64 fh_, int mode_, off_t offset_, off_t len_) { FileInfo *fi; fi = state.get_fi(ctx_,fh_); if(not fi) return -EBADF; return ::_fallocate(fi->fd, mode_, offset_, len_); } mergerfs-2.42.0/src/fuse_fallocate.hpp0000644000000000000000000000210215177346257016377 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "base_types.h" #include "fuse.h" namespace FUSE { int fallocate(const fuse_req_ctx_t *ctx, cu64 fh, int mode, off_t offset, off_t len); } mergerfs-2.42.0/src/fuse_fchmod.cpp0000644000000000000000000000331515177346257015707 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fuse_fchmod.hpp" #include "errno.hpp" #include "fileinfo.hpp" #include "fs_fchmod.hpp" #include "state.hpp" #include "fuse.h" static int _fchmod(const int fd_, const mode_t mode_) { int rv; rv = fs::fchmod(fd_,mode_); return rv; } // In cases where the node was opened but unlinked there will be no // path and no guarentee of a `fh`. It could always do the lookup but // why bother if the kernel has provided it to us? The reason the // function doesn't need to run within the visit lambda is because // since the request is outstanding the kernel won't be releasing the // node and therefore the entry will be valid over the lifetime of // this function. int FUSE::fchmod(const fuse_req_ctx_t *ctx_, cu64 fh_, const mode_t mode_) { FileInfo *fi; fi = state.get_fi(ctx_,fh_); if(not fi) return -EBADF; return ::_fchmod(fi->fd,mode_); } mergerfs-2.42.0/src/fuse_fchmod.hpp0000644000000000000000000000203015177346257015705 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "base_types.h" #include "fuse.h" #include "fuse_req_ctx.h" #include namespace FUSE { int fchmod(const fuse_req_ctx_t *ctx, cu64 fh, const mode_t mode); } mergerfs-2.42.0/src/fuse_fchown.cpp0000644000000000000000000000345115177346257015734 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fuse_fchown.hpp" #include "errno.hpp" #include "fileinfo.hpp" #include "fs_fchown.hpp" #include "state.hpp" #include "fuse.h" #include static int _fchown(const int fd_, const uid_t uid_, const gid_t gid_) { int rv; rv = fs::fchown(fd_,uid_,gid_); return rv; } // In cases where the node was opened but unlinked there will be no // path and no guarentee of a `fh`. It could always do the lookup but // why bother if the kernel has provided it to us? The reason the // function doesn't need to run within the visit lambda is because // since the request is outstanding the kernel won't be releasing the // node and therefore the entry will be valid over the lifetime of // this function. int FUSE::fchown(const fuse_req_ctx_t *ctx_, cu64 fh_, const uid_t uid_, const gid_t gid_) { FileInfo *fi; fi = state.get_fi(ctx_,fh_); if(not fi) return -EBADF; return ::_fchown(fi->fd,uid_,gid_); } mergerfs-2.42.0/src/fuse_fchown.hpp0000644000000000000000000000201215177346257015731 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "base_types.h" #include "fuse.h" namespace FUSE { int fchown(const fuse_req_ctx_t *ctx, cu64 fh, uid_t uid, gid_t gid); } mergerfs-2.42.0/src/fuse_fgetattr.cpp0000644000000000000000000000414315177346257016267 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fuse_fgetattr.hpp" #include "config.hpp" #include "errno.hpp" #include "fileinfo.hpp" #include "fs_fstat.hpp" #include "fs_inode.hpp" #include "state.hpp" #include "fuse.h" static int _fgetattr(const FileInfo *fi_, struct stat *st_) { int rv; rv = fs::fstat(fi_->fd,st_); if(rv < 0) return rv; fs::inode::calc(fi_->branch.path, fi_->fusepath, st_); return rv; } // In cases where the node was opened but unlinked there will be no // path and no guarentee of a `fh`. It could always do the lookup but // why bother if the kernel has provided it to us? The reason the // function doesn't need to run within the visit lambda is because // since the request is outstanding the kernel won't be releasing the // node and therefore the entry will be valid over the lifetime of // this function. int FUSE::fgetattr(const fuse_req_ctx_t *ctx_, cu64 fh_, struct stat *st_, fuse_timeouts_t *timeout_) { int rv; FileInfo *fi; fi = state.get_fi(ctx_,fh_); if(not fi) return -EBADF; rv = ::_fgetattr(fi,st_); timeout_->entry = ((rv >= 0) ? cfg.cache_entry : cfg.cache_negative_entry); timeout_->attr = cfg.cache_attr; return rv; } mergerfs-2.42.0/src/fuse_fgetattr.hpp0000644000000000000000000000212715177346257016274 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "base_types.h" #include "fuse.h" #include #include #include namespace FUSE { int fgetattr(const fuse_req_ctx_t *ctx, cu64 fh, struct stat *st, fuse_timeouts_t *timeout); } mergerfs-2.42.0/src/fuse_flush.cpp0000644000000000000000000000327015177346257015570 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fuse_flush.hpp" #include "errno.hpp" #include "fileinfo.hpp" #include "fs_close.hpp" #include "fs_dup.hpp" #include "state.hpp" #include "fuse.h" static int _flush(const int fd_) { int rv; rv = fs::dup(fd_); if(rv < 0) return -EIO; return fs::close(rv); } // In cases where the node was opened but unlinked there will be no // path and no guarentee of a `fh`. It could always do the lookup but // why bother if the kernel has provided it to us? The reason the // function doesn't need to run within the visit lambda is because // since the request is outstanding the kernel won't be releasing the // node and therefore the entry will be valid over the lifetime of // this function. int FUSE::flush(const fuse_req_ctx_t *ctx_, const fuse_file_info_t *ffi_) { FileInfo *fi; fi = state.get_fi(ctx_,ffi_->fh); if(not fi) return -EBADF; return ::_flush(fi->fd); } mergerfs-2.42.0/src/fuse_flush.hpp0000644000000000000000000000165215177346257015577 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "fuse.h" namespace FUSE { int flush(const fuse_req_ctx_t *ctx, const fuse_file_info_t *ffi); } mergerfs-2.42.0/src/fuse_fsync.cpp0000644000000000000000000000355415177346257015576 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fuse_fsync.hpp" #include "errno.hpp" #include "fileinfo.hpp" #include "fs_fdatasync.hpp" #include "fs_fsync.hpp" #include "state.hpp" #include "to_neg_errno.hpp" #include "fuse.h" #include #include static int _fsync(const int fd_, const int isdatasync_) { int rv; rv = (isdatasync_ ? fs::fdatasync(fd_) : fs::fsync(fd_)); return ::to_neg_errno(rv); } // In cases where the node was opened but unlinked there will be no // path and no guarentee of a `fh`. It could always do the lookup but // why bother if the kernel has provided it to us? The reason the // function doesn't need to run within the visit lambda is because // since the request is outstanding the kernel won't be releasing the // node and therefore the entry will be valid over the lifetime of // this function. int FUSE::fsync(const fuse_req_ctx_t *ctx_, cu64 fh_, int isdatasync_) { FileInfo *fi; fi = state.get_fi(ctx_,fh_); if(not fi) return -EBADF; return ::_fsync(fi->fd,isdatasync_); } mergerfs-2.42.0/src/fuse_fsync.hpp0000644000000000000000000000175215177346257015601 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "base_types.h" #include "fuse.h" namespace FUSE { int fsync(const fuse_req_ctx_t *ctx, cu64 fh, int isdatasync); } mergerfs-2.42.0/src/fuse_fsyncdir.cpp0000644000000000000000000000246015177346257016270 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fuse_fsyncdir.hpp" #include "errno.hpp" #include "dirinfo.hpp" #include "fs_fsync.hpp" #include "fuse.h" #include #include static int _fsyncdir(const DirInfo *di_, const int isdatasync_) { return -ENOSYS; } int FUSE::fsyncdir(const fuse_req_ctx_t *ctx_, const fuse_file_info_t *ffi_, int isdatasync_) { DirInfo *di = DirInfo::from_fh(ffi_->fh); if(not di) return -EBADF; return ::_fsyncdir(di,isdatasync_); } mergerfs-2.42.0/src/fuse_fsyncdir.hpp0000644000000000000000000000173715177346257016303 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "fuse.h" namespace FUSE { int fsyncdir(const fuse_req_ctx_t *ctx, const fuse_file_info_t *ffi, int isdatasync); } mergerfs-2.42.0/src/fuse_ftruncate.cpp0000644000000000000000000000334615177346257016446 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fuse_ftruncate.hpp" #include "errno.hpp" #include "fileinfo.hpp" #include "fs_ftruncate.hpp" #include "state.hpp" #include "fuse.h" static int _ftruncate(const int fd_, const off_t size_) { int rv; rv = fs::ftruncate(fd_,size_); return rv; } // In cases where the node was opened but unlinked there will be no // path and no guarentee of a `fh`. It could always do the lookup but // why bother if the kernel has provided it to us? The reason the // function doesn't need to run within the visit lambda is because // since the request is outstanding the kernel won't be releasing the // node and therefore the entry will be valid over the lifetime of // this function. int FUSE::ftruncate(const fuse_req_ctx_t *ctx_, cu64 fh_, off_t size_) { FileInfo *fi; fi = state.get_fi(ctx_,fh_); if(not fi) return -EBADF; return ::_ftruncate(fi->fd,size_); } mergerfs-2.42.0/src/fuse_ftruncate.hpp0000644000000000000000000000203315177346257016443 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "base_types.h" #include "fuse.h" #include #include namespace FUSE { int ftruncate(const fuse_req_ctx_t *ctx, cu64 fh, off_t size); } mergerfs-2.42.0/src/fuse_futimens.cpp0000644000000000000000000000341115177346257016276 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fuse_futimens.hpp" #include "errno.hpp" #include "fileinfo.hpp" #include "fs_futimens.hpp" #include "state.hpp" #include "fuse.h" #include static int _futimens(const int fd_, const struct timespec ts_[2]) { int rv; rv = fs::futimens(fd_,ts_); return rv; } // In cases where the node was opened but unlinked there will be no // path and no guarentee of a `fh`. It could always do the lookup but // why bother if the kernel has provided it to us? The reason the // function doesn't need to run within the visit lambda is because // since the request is outstanding the kernel won't be releasing the // node and therefore the entry will be valid over the lifetime of // this function. int FUSE::futimens(const fuse_req_ctx_t *ctx_, cu64 fh_, const struct timespec ts_[2]) { FileInfo *fi; fi = state.get_fi(ctx_,fh_); if(not fi) return -EBADF; return ::_futimens(fi->fd,ts_); } mergerfs-2.42.0/src/fuse_futimens.hpp0000644000000000000000000000200415177346257016300 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "base_types.h" #include "fuse.h" #include namespace FUSE { int futimens(const fuse_req_ctx_t *ctx, cu64 fh, const timespec ts[2]); } mergerfs-2.42.0/src/fuse_getattr.cpp0000644000000000000000000001306115177346257016120 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fuse_getattr.hpp" #include "config.hpp" #include "errno.hpp" #include "fs_fstat.hpp" #include "fs_inode.hpp" #include "fs_lstat.hpp" #include "fs_path.hpp" #include "fs_stat.hpp" #include "fuse_fgetattr.hpp" #include "state.hpp" #include "str.hpp" #include "symlinkify.hpp" #include "fuse.h" #include static void _set_stat_if_leads_to_dir(const fs::path &path_, struct stat *st_) { int rv; struct stat st; rv = fs::stat(path_,&st); if(rv < 0) return; if(S_ISDIR(st.st_mode)) *st_ = st; return; } static void _set_stat_if_leads_to_reg(const fs::path &path_, struct stat *st_) { int rv; struct stat st; rv = fs::stat(path_,&st); if(rv < 0) return; if(S_ISREG(st.st_mode)) *st_ = st; return; } static int _getattr_fake_root(struct stat *st_, fuse_timeouts_t *timeout_) { st_->st_dev = 0; st_->st_ino = 0; st_->st_mode = (S_IFDIR|S_IRWXU|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH); st_->st_nlink = 2; st_->st_uid = 0; st_->st_gid = 0; st_->st_rdev = 0; st_->st_size = 0; st_->st_blksize = 512; st_->st_blocks = 0; st_->st_atime = 0; st_->st_mtime = 0; st_->st_ctime = 0; timeout_->entry = cfg.cache_entry; timeout_->attr = cfg.cache_attr; return 0; } static int _getattr_controlfile(struct stat *st_, fuse_timeouts_t *timeout_) { static const uid_t uid = ::getuid(); static const gid_t gid = ::getgid(); static const time_t now = ::time(NULL); st_->st_dev = 0; st_->st_ino = 0; st_->st_mode = (S_IFREG|S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH); st_->st_nlink = 1; st_->st_uid = uid; st_->st_gid = gid; st_->st_rdev = 0; st_->st_size = 0; st_->st_blksize = 512; st_->st_blocks = 0; st_->st_atime = now; st_->st_mtime = now; st_->st_ctime = now; timeout_->entry = cfg.cache_entry; timeout_->attr = cfg.cache_attr; return 0; } static int _getattr(const Policy::Search &searchFunc_, const Branches::Ptr branches_, const fs::path &fusepath_, struct stat *st_, const bool symlinkify_, const time_t symlinkify_timeout_, FollowSymlinks followsymlinks_) { int rv; fs::path fullpath; std::vector branches; rv = searchFunc_(branches_,fusepath_,branches); if(rv < 0) return rv; if(branches.empty()) return -ENOENT; fullpath = branches[0]->path / fusepath_; switch(followsymlinks_) { case FollowSymlinks::ENUM::NEVER: rv = fs::lstat(fullpath,st_); break; case FollowSymlinks::ENUM::DIRECTORY: rv = fs::lstat(fullpath,st_); if((rv >= 0) && S_ISLNK(st_->st_mode)) ::_set_stat_if_leads_to_dir(fullpath,st_); break; case FollowSymlinks::ENUM::REGULAR: rv = fs::lstat(fullpath,st_); if((rv >= 0) && S_ISLNK(st_->st_mode)) ::_set_stat_if_leads_to_reg(fullpath,st_); break; case FollowSymlinks::ENUM::ALL: rv = fs::stat(fullpath,st_); if(rv < 0) rv = fs::lstat(fullpath,st_); break; } if(rv < 0) return rv; if(symlinkify_ && symlinkify::can_be_symlink(*st_,symlinkify_timeout_)) symlinkify::convert(fullpath,st_); fs::inode::calc(branches[0]->path, fusepath_, st_); return 0; } int _getattr(const fs::path &fusepath_, struct stat *st_, fuse_timeouts_t *timeout_) { int rv; rv = ::_getattr(cfg.func.getattr.policy, cfg.branches, fusepath_, st_, cfg.symlinkify, cfg.symlinkify_timeout, cfg.follow_symlinks); if((rv < 0) && Config::is_rootdir(fusepath_)) return ::_getattr_fake_root(st_,timeout_); timeout_->entry = ((rv >= 0) ? cfg.cache_entry : cfg.cache_negative_entry); timeout_->attr = cfg.cache_attr; return rv; } int FUSE::getattr(const fuse_req_ctx_t *ctx_, const char *fusepath_, struct stat *st_, fuse_timeouts_t *timeout_) { const fs::path fusepath{fusepath_}; return FUSE::getattr(ctx_,fusepath,st_,timeout_); } int FUSE::getattr(const fuse_req_ctx_t *ctx_, const fs::path &fusepath_, struct stat *st_, fuse_timeouts_t *timeout_) { return FUSE::getattr(fusepath_,st_,timeout_); } int FUSE::getattr(const fs::path &fusepath_, struct stat *st_, fuse_timeouts_t *timeout_) { if(Config::is_ctrl_file(fusepath_)) return ::_getattr_controlfile(st_,timeout_); return ::_getattr(fusepath_,st_,timeout_); } mergerfs-2.42.0/src/fuse_getattr.hpp0000644000000000000000000000255615177346257016134 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "fuse.h" #include "fs_path.hpp" #include #include #include namespace FUSE { int getattr(const fuse_req_ctx_t *ctx, const char *fusepath, struct stat *buf, fuse_timeouts_t *timeout); int getattr(const fuse_req_ctx_t *ctx, const fs::path &fusepath, struct stat *buf, fuse_timeouts_t *timeout); int getattr(const fs::path &fusepath, struct stat *buf, fuse_timeouts_t *timeout); } mergerfs-2.42.0/src/fuse_getxattr.cpp0000644000000000000000000001250515177346257016312 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fuse_getxattr.hpp" #include "config.hpp" #include "errno.hpp" #include "fs_findallfiles.hpp" #include "fs_lgetxattr.hpp" #include "fs_path.hpp" #include "fs_statvfs_cache.hpp" #include "str.hpp" #include "version.hpp" #include "fuse.h" #include #include #include #include #include static const char SECURITY_CAPABILITY[] = "security.capability"; static bool _is_attrname_security_capability(const char *attrname_) { return str::eq(attrname_,SECURITY_CAPABILITY); } static int _getxattr_ctrl_file(Config &cfg_, const char *attrname_, char *buf_, const size_t count_) { int rv; std::string key; std::string val; if(!Config::is_mergerfs_xattr(attrname_)) return -ENOATTR; key = Config::prune_ctrl_xattr(attrname_); rv = cfg_.get(key,&val); if(rv < 0) return rv; if(count_ == 0) return val.size(); if(count_ < val.size()) return -ERANGE; memcpy(buf_,val.c_str(),val.size()); return (int)val.size(); } static int _getxattr_from_string(char *destbuf_, const size_t destbufsize_, const std::string &src_) { const size_t srcbufsize = src_.size(); if(destbufsize_ == 0) return srcbufsize; if(srcbufsize > destbufsize_) return -ERANGE; memcpy(destbuf_,src_.data(),srcbufsize); return srcbufsize; } static int _getxattr_user_mergerfs_allpaths(const Branches::Ptr branches_, const fs::path &fusepath_, char *buf_, const size_t count_) { std::string concated; StrVec paths; StrVec branches; branches_->to_paths(branches); fs::findallfiles(branches,fusepath_,&paths); concated = str::join(paths,'\0'); return ::_getxattr_from_string(buf_,count_,concated); } static int _getxattr_user_mergerfs(const fs::path &basepath_, const fs::path &fusepath_, const fs::path &fullpath_, const Branches::Ptr branches_, const char *attrname_, char *buf_, const size_t count_) { std::string key; key = Config::prune_ctrl_xattr(attrname_); if(key == "basepath") return ::_getxattr_from_string(buf_,count_,basepath_); if(key == "relpath") return ::_getxattr_from_string(buf_,count_,fusepath_); if(key == "fullpath") return ::_getxattr_from_string(buf_,count_,fullpath_); if(key == "allpaths") return ::_getxattr_user_mergerfs_allpaths(branches_,fusepath_,buf_,count_); return -ENOATTR; } static int _getxattr(const Policy::Search &searchFunc_, const Branches::Ptr branches_, const fs::path &fusepath_, const char *attrname_, char *buf_, const size_t count_) { int rv; fs::path fullpath; std::vector branches; rv = searchFunc_(branches_,fusepath_,branches); if(rv < 0) return rv; if(branches.empty()) return -ENOENT; fullpath = branches[0]->path / fusepath_; if(Config::is_mergerfs_xattr(attrname_)) return ::_getxattr_user_mergerfs(branches[0]->path, fusepath_, fullpath, branches_, attrname_, buf_, count_); return fs::lgetxattr(fullpath,attrname_,buf_,count_); } int FUSE::getxattr(const fuse_req_ctx_t *ctx_, const char *fusepath_, const char *attrname_, char *attrvalue_, size_t attrvalue_size_) { const fs::path fusepath{fusepath_}; if(Config::is_ctrl_file(fusepath)) return ::_getxattr_ctrl_file(cfg, attrname_, attrvalue_, attrvalue_size_); if((cfg.security_capability == false) && ::_is_attrname_security_capability(attrname_)) return -ENOATTR; if(cfg.xattr.to_int()) return -cfg.xattr.to_int(); return ::_getxattr(cfg.func.getxattr.policy, cfg.branches, fusepath, attrname_, attrvalue_, attrvalue_size_); } mergerfs-2.42.0/src/fuse_getxattr.hpp0000644000000000000000000000212515177346257016314 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "fuse_req_ctx.h" #include namespace FUSE { int getxattr(const fuse_req_ctx_t *ctx, const char *fusepath, const char *attrname, char *attrvalue, size_t attrvalue_size); } mergerfs-2.42.0/src/fuse_init.cpp0000644000000000000000000001547315177346257015422 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fuse_init.hpp" #include "config.hpp" #include "fs_readahead.hpp" #include "procfs.hpp" #include "state.hpp" #include "syslog.hpp" #include "fs_path.hpp" #include "fs_exists.hpp" #include "fuse.h" #include #include #include static void _want(fuse_conn_info_t *conn_, const int flag_) { conn_->want |= flag_; } static bool _capable(fuse_conn_info_t *conn_, const int flag_) { return !!(conn_->capable & flag_); } static void _want_if_capable(fuse_conn_info_t *conn_, const int flag_) { if(::_capable(conn_,flag_)) ::_want(conn_,flag_); } static void _want_if_capable(fuse_conn_info_t *conn_, const int flag_, ConfigBOOL *want_) { if(*want_ && ::_capable(conn_,flag_)) { ::_want(conn_,flag_); return; } *want_ = false; } #define MAX_FUSE_MSG_SIZE 65535 static const char MAX_PAGES_LIMIT_FILEPATH[] = "/proc/sys/fs/fuse/max_pages_limit"; static void _want_if_capable_max_pages(fuse_conn_info_t *conn_, Config &cfg_) { std::fstream f; u64 max_pages_limit; if(fs::exists(MAX_PAGES_LIMIT_FILEPATH)) { if(cfg_.fuse_msg_size > MAX_FUSE_MSG_SIZE) SysLog::info("fuse_msg_size > {}: setting it to {}", MAX_FUSE_MSG_SIZE, MAX_FUSE_MSG_SIZE); cfg_.fuse_msg_size = std::min((u64)cfg_.fuse_msg_size, (u64)MAX_FUSE_MSG_SIZE); f.open(MAX_PAGES_LIMIT_FILEPATH,f.in|f.out); if(f.is_open()) { f >> max_pages_limit; SysLog::info("{} currently set to {}", MAX_PAGES_LIMIT_FILEPATH, max_pages_limit); if(cfg_.fuse_msg_size > max_pages_limit) { f.seekp(0); f << (u64)cfg_.fuse_msg_size; f.flush(); SysLog::info("{} changed to {}", MAX_PAGES_LIMIT_FILEPATH, (u64)cfg_.fuse_msg_size); } f.close(); } else { if(cfg_.fuse_msg_size != FUSE_DEFAULT_MAX_MAX_PAGES) SysLog::info("unable to open {}",MAX_PAGES_LIMIT_FILEPATH); } } else { if(cfg_.fuse_msg_size > FUSE_DEFAULT_MAX_MAX_PAGES) SysLog::info("fuse_msg_size request {} > {}: setting it to {}", (u64)cfg_.fuse_msg_size, FUSE_DEFAULT_MAX_MAX_PAGES, FUSE_DEFAULT_MAX_MAX_PAGES); cfg_.fuse_msg_size = std::min((u64)cfg_.fuse_msg_size, (u64)FUSE_DEFAULT_MAX_MAX_PAGES); } if(::_capable(conn_,FUSE_CAP_MAX_PAGES)) { ::_want(conn_,FUSE_CAP_MAX_PAGES); fuse_cfg.max_pages = cfg_.fuse_msg_size; SysLog::info("requesting max pages size of {}", (u64)cfg_.fuse_msg_size); } else { cfg_.fuse_msg_size = FUSE_DEFAULT_MAX_PAGES_PER_REQ; } } static void _readahead(const fs::path &path_, const int readahead_) { int rv; rv = fs::readahead(path_,readahead_); if(rv == 0) SysLog::info("{} - readahead set to {}",path_.string(),readahead_); else SysLog::error("{} - unable to set readahead",path_.string()); } static void _set_readahead_on_mount_and_branches() { Branches::Ptr branches; if((u64)cfg.readahead == 0) return; ::_readahead(cfg.mountpoint,cfg.readahead); branches = cfg.branches; for(auto const &branch : *branches) ::_readahead(branch.path,cfg.readahead); } // Spawn a thread to do this because before init returns calls to // set the value will block leading to a deadlock. This is just // easier. static void _spawn_thread_to_set_readahead() { std::thread readahead_thread(::_set_readahead_on_mount_and_branches); readahead_thread.detach(); } void * FUSE::init(fuse_conn_info_t *conn_) { procfs::init(); cfg.readdir.initialize(); ::_want_if_capable(conn_,FUSE_CAP_ASYNC_DIO); ::_want_if_capable(conn_,FUSE_CAP_ASYNC_READ,&cfg.async_read); ::_want_if_capable(conn_,FUSE_CAP_ATOMIC_O_TRUNC); ::_want_if_capable(conn_,FUSE_CAP_BIG_WRITES); ::_want_if_capable(conn_,FUSE_CAP_CACHE_SYMLINKS,&cfg.cache_symlinks); ::_want_if_capable(conn_,FUSE_CAP_DIRECT_IO_ALLOW_MMAP,&cfg.direct_io_allow_mmap); ::_want_if_capable(conn_,FUSE_CAP_DONT_MASK); ::_want_if_capable(conn_,FUSE_CAP_EXPORT_SUPPORT,&cfg.export_support); ::_want_if_capable(conn_,FUSE_CAP_HANDLE_KILLPRIV,&cfg.handle_killpriv); ::_want_if_capable(conn_,FUSE_CAP_HANDLE_KILLPRIV_V2,&cfg.handle_killpriv_v2); ::_want_if_capable(conn_,FUSE_CAP_IOCTL_DIR); ::_want_if_capable(conn_,FUSE_CAP_PARALLEL_DIROPS); ::_want_if_capable(conn_,FUSE_CAP_PASSTHROUGH); ::_want_if_capable(conn_,FUSE_CAP_POSIX_ACL,&cfg.posix_acl); // ::_want_if_capable(conn_,FUSE_CAP_READDIR_PLUS,&cfg.readdirplus); ::_want_if_capable(conn_,FUSE_CAP_WRITEBACK_CACHE,&cfg.cache_writeback); ::_want_if_capable(conn_,FUSE_CAP_ALLOW_IDMAP,&cfg.allow_idmap); // ::_want_if_capable(conn_,FUSE_CAP_READDIR_PLUS_AUTO); ::_want_if_capable_max_pages(conn_,cfg); ::_spawn_thread_to_set_readahead(); if(!(conn_->capable & FUSE_CAP_PASSTHROUGH) && (cfg.passthrough_io != PassthroughIO::ENUM::OFF)) { SysLog::warning("passthrough enabled but not supported by kernel. disabling."); cfg.passthrough_io = PassthroughIO::ENUM::OFF; } if((cfg.passthrough_io != PassthroughIO::ENUM::OFF) && (cfg.cache_files == CacheFiles::ENUM::OFF)) { SysLog::warning("passthrough enabled and cache.files disabled:" " passthrough will not function"); } if((cfg.passthrough_io != PassthroughIO::ENUM::OFF) && (cfg.cache_writeback == true)) { SysLog::warning("passthrough and cache.writeback are incompatible."); } SysLog::info("Config:"); for(const auto &kv : cfg.get_map()) { if(not kv.second->display) continue; SysLog::info("{}={}",kv.first,kv.second->to_string()); } return NULL; } mergerfs-2.42.0/src/fuse_init.hpp0000644000000000000000000000160215177346257015414 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "fuse.h" namespace FUSE { void * init(fuse_conn_info_t *conn); } mergerfs-2.42.0/src/fuse_ioctl.cpp0000644000000000000000000001230215177346257015555 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fuse_ioctl.hpp" #include "fuse_getxattr.hpp" #include "fuse_setxattr.hpp" #include "config.hpp" #include "dirinfo.hpp" #include "endian.hpp" #include "errno.hpp" #include "fileinfo.hpp" #include "fs_close.hpp" #include "fs_findallfiles.hpp" #include "fs_ioctl.hpp" #include "fs_open.hpp" #include "fs_path.hpp" #include "mergerfs_ioctl.hpp" #include "state.hpp" #include "str.hpp" #include #include #include #include // From linux/btrfs.h #define BTRFS_IOCTL_MAGIC 0x94 #ifndef FS_IOC_GETFLAGS # define FS_IOC_GETFLAGS _IOR('f',1,long) #endif #ifndef FS_IOC_SETFLAGS # define FS_IOC_SETFLAGS _IOW('f',2,long) #endif #ifndef FS_IOC_GETVERSION # define FS_IOC_GETVERSION _IOR('v',1,long) #endif #ifndef FS_IOC_SETVERSION # define FS_IOC_SETVERSION _IOW('v',2,long) #endif /* There is a bug with FUSE and these ioctl commands. The regular libfuse high level API assumes the output buffer size based on the command and gives no control over this. FS_IOC_GETFLAGS and FS_IOC_SETFLAGS however are defined as `long` when in fact it is an `int`. On 64bit systems where long is 8 bytes this can lead to libfuse telling the kernel to write 8 bytes and if the user only allocated an integer then it will overwrite the 4 bytes after the variable which could result in data corruption and/or crashes. I've modified the API to allow changing of the output buffer size. This fixes the issue on little endian systems because the lower 4 bytes are the same regardless of what the user allocated. However, on big endian systems that's not the case and it is not possible to safely handle the situation. https://lwn.net/Articles/575846/ */ static int _ioctl(const int fd_, const u32 cmd_, void *data_, u32 *out_bufsz_) { int rv; switch(cmd_) { case FS_IOC_GETFLAGS: case FS_IOC_SETFLAGS: case FS_IOC_GETVERSION: case FS_IOC_SETVERSION: if(endian::is_big() && (sizeof(long) != sizeof(int))) return -ENOTTY; if((data_ != NULL) && (*out_bufsz_ > 4)) *out_bufsz_ = 4; break; } rv = fs::ioctl(fd_,cmd_,data_); return rv; } static int _ioctl_file(const fuse_req_ctx_t *ctx_, const fuse_file_info_t *ffi_, const u32 cmd_, void *data_, u32 *out_bufsz_) { FileInfo *fi; fi = state.get_fi(ctx_,ffi_->fh); if(not fi) return -EBADF; return ::_ioctl(fi->fd,cmd_,data_,out_bufsz_); } #ifndef O_NOATIME #define O_NOATIME 0 #endif static int _ioctl_dir_base(const Policy::Search &searchFunc_, const Branches::Ptr branches_, const fs::path &fusepath_, const u32 cmd_, void *data_, u32 *out_bufsz_) { int fd; int rv; fs::path fullpath; std::vector branches; rv = searchFunc_(branches_,fusepath_,branches); if(rv < 0) return rv; if(branches.empty()) return -ENOENT; fullpath = branches[0]->path / fusepath_; fd = fs::open(fullpath,O_RDONLY|O_NOATIME|O_NONBLOCK); if(fd < 0) return fd; rv = ::_ioctl(fd,cmd_,data_,out_bufsz_); fs::close(fd); return rv; } static int _ioctl_dir(const fuse_req_ctx_t *ctx_, const fuse_file_info_t *ffi_, const u32 cmd_, void *data_, u32 *out_bufsz_) { DirInfo *di = DirInfo::from_fh(ffi_->fh); if(not di) return -EBADF; return ::_ioctl_dir_base(cfg.func.open.policy, cfg.branches, di->fusepath.c_str(), cmd_, data_, out_bufsz_); } static bool _is_btrfs_ioctl_cmd(const unsigned long cmd_) { return (_IOC_TYPE(cmd_) == BTRFS_IOCTL_MAGIC); } int FUSE::ioctl(const fuse_req_ctx_t *ctx_, const fuse_file_info_t *ffi_, unsigned long cmd_, void *arg_, unsigned int flags_, void *data_, u32 *out_bufsz_) { if(::_is_btrfs_ioctl_cmd(cmd_)) return -ENOTTY; if(flags_ & FUSE_IOCTL_DIR) return ::_ioctl_dir(ctx_,ffi_,cmd_,data_,out_bufsz_); return ::_ioctl_file(ctx_,ffi_,cmd_,data_,out_bufsz_); } mergerfs-2.42.0/src/fuse_ioctl.hpp0000644000000000000000000000220415177346257015562 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "base_types.h" #include "fuse.h" namespace FUSE { int ioctl(const fuse_req_ctx_t *ctx, const fuse_file_info_t *ffi, unsigned long cmd, void *arg, unsigned int flags, void *data, u32 *out_bufsz); } mergerfs-2.42.0/src/fuse_link.cpp0000644000000000000000000002323515177346257015407 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fuse_link.hpp" #include "config.hpp" #include "errno.hpp" #include "fs_clonepath.hpp" #include "fs_link.hpp" #include "fs_lstat.hpp" #include "fs_path.hpp" #include "fuse_getattr.hpp" #include "fuse_symlink.hpp" #include "fuse.h" #include #include #include static int _link_create_path_loop(const std::vector &oldbranches_, const Branch *newbranch_, const fs::path &oldfusepath_, const fs::path &newfusepath_, const fs::path &newfusedirpath_) { int rv; int err; fs::path oldfullpath; fs::path newfullpath; err = -ENOENT; for(const auto &oldbranch : oldbranches_) { oldfullpath = oldbranch->path / oldfusepath_; newfullpath = oldbranch->path / newfusepath_; rv = fs::link(oldfullpath,newfullpath); if(rv == -ENOENT) { rv = fs::clonepath(newbranch_->path, oldbranch->path, newfusedirpath_); if(rv == 0) rv = fs::link(oldfullpath,newfullpath); } if(err < 0) err = rv; } return err; } static int _link_create_path(const Policy::Search &searchFunc_, const Policy::Action &actionFunc_, const Branches::Ptr ibranches_, const fs::path &oldfusepath_, const fs::path &newfusepath_) { int rv; fs::path newfusedirpath; std::vector oldbranches; std::vector newbranches; rv = actionFunc_(ibranches_,oldfusepath_,oldbranches); if(rv < 0) return rv; if(oldbranches.empty()) return -ENOENT; newfusedirpath = newfusepath_.parent_path(); rv = searchFunc_(ibranches_,newfusedirpath,newbranches); if(rv < 0) return rv; if(newbranches.empty()) return -ENOENT; return ::_link_create_path_loop(oldbranches,newbranches[0], oldfusepath_,newfusepath_, newfusedirpath); } static int _link_preserve_path_core(const fs::path &oldbasepath_, const fs::path &oldfusepath_, const fs::path &newfusepath_, struct stat *st_) { int rv; fs::path oldfullpath; fs::path newfullpath; oldfullpath = oldbasepath_ / oldfusepath_; newfullpath = oldbasepath_ / newfusepath_; rv = fs::link(oldfullpath,newfullpath); if(rv == -ENOENT) rv = -EXDEV; if((rv == 0) && (st_->st_ino == 0)) rv = fs::lstat(oldfullpath,st_); return rv; } static int _link_preserve_path_loop(const std::vector &oldbranches_, const fs::path &oldfusepath_, const fs::path &newfusepath_, struct stat *st_) { int rv; int err; err = -ENOENT; for(const auto &oldbranch : oldbranches_) { rv = ::_link_preserve_path_core(oldbranch->path, oldfusepath_, newfusepath_, st_); if(err < 0) err = rv; } return err; } static int _link_preserve_path(const Policy::Action &actionFunc_, const Branches::Ptr branches_, const fs::path &oldfusepath_, const fs::path &newfusepath_, struct stat *st_) { int rv; std::vector oldbranches; rv = actionFunc_(branches_,oldfusepath_,oldbranches); if(rv < 0) return rv; if(oldbranches.empty()) return -ENOENT; return ::_link_preserve_path_loop(oldbranches, oldfusepath_, newfusepath_, st_); } static int _link(const fs::path &oldpath_, const fs::path &newpath_, struct stat *st_) { if(cfg.func.create.policy.path_preserving() && !cfg.ignorepponrename) return ::_link_preserve_path(cfg.func.link.policy, cfg.branches, oldpath_, newpath_, st_); return ::_link_create_path(cfg.func.getattr.policy, cfg.func.link.policy, cfg.branches, oldpath_, newpath_); } static int _link(const fuse_req_ctx_t *ctx_, const fs::path &oldpath_, const fs::path &newpath_, struct stat *st_, fuse_timeouts_t *timeouts_) { int rv; rv = ::_link(oldpath_,newpath_,st_); if(rv < 0) return rv; return FUSE::getattr(newpath_,st_,timeouts_); } static int _link_exdev_rel_symlink(const fuse_req_ctx_t *ctx_, const fs::path &oldpath_, const fs::path &newpath_, struct stat *st_, fuse_timeouts_t *timeouts_) { int rv; fs::path target(oldpath_); fs::path linkpath(newpath_); target = target.lexically_relative(linkpath.parent_path()); rv = FUSE::symlink(ctx_,target.c_str(),linkpath); if(rv == 0) rv = FUSE::getattr(ctx_,oldpath_,st_,timeouts_); // Disable caching since we created a symlink but should be a regular. timeouts_->attr = 0; timeouts_->entry = 0; return rv; } static int _link_exdev_abs_base_symlink(const fuse_req_ctx_t *ctx_, const Policy::Search &openPolicy_, const Branches::Ptr ibranches_, const fs::path &oldpath_, const fs::path &newpath_, struct stat *st_, fuse_timeouts_t *timeouts_) { int rv; fs::path target; std::vector obranches; rv = openPolicy_(ibranches_,oldpath_,obranches); if(rv < 0) return rv; if(obranches.empty()) return -ENOENT; target = obranches[0]->path / oldpath_; rv = FUSE::symlink(ctx_,target.c_str(),newpath_); if(rv == 0) rv = FUSE::getattr(ctx_,oldpath_,st_,timeouts_); // Disable caching since we created a symlink but should be a regular. timeouts_->attr = 0; timeouts_->entry = 0; return rv; } static int _link_exdev_abs_pool_symlink(const fuse_req_ctx_t *ctx_, const fs::path &mount_, const fs::path &oldpath_, const fs::path &newpath_, struct stat *st_, fuse_timeouts_t *timeouts_) { int rv; StrVec basepaths; fs::path target; target = mount_ / oldpath_; rv = FUSE::symlink(ctx_,target.c_str(),newpath_); if(rv == 0) rv = FUSE::getattr(ctx_,oldpath_,st_,timeouts_); // Disable caching since we created a symlink but should be a regular. timeouts_->attr = 0; timeouts_->entry = 0; return rv; } static int _link_exdev(const fuse_req_ctx_t *ctx_, const fs::path &oldpath_, const fs::path &newpath_, struct stat *st_, fuse_timeouts_t *timeouts_) { switch(cfg.link_exdev) { case LinkEXDEV::ENUM::PASSTHROUGH: return -EXDEV; case LinkEXDEV::ENUM::REL_SYMLINK: return ::_link_exdev_rel_symlink(ctx_, oldpath_, newpath_, st_, timeouts_); case LinkEXDEV::ENUM::ABS_BASE_SYMLINK: return ::_link_exdev_abs_base_symlink(ctx_, cfg.func.open.policy, cfg.branches, oldpath_, newpath_, st_, timeouts_); case LinkEXDEV::ENUM::ABS_POOL_SYMLINK: return ::_link_exdev_abs_pool_symlink(ctx_, cfg.mountpoint, oldpath_, newpath_, st_, timeouts_); } return -EXDEV; } int FUSE::link(const fuse_req_ctx_t *ctx_, const char *oldpath_, const char *newpath_, struct stat *st_, fuse_timeouts_t *timeouts_) { int rv; const fs::path oldpath{oldpath_}; const fs::path newpath{newpath_}; rv = ::_link(ctx_,oldpath,newpath,st_,timeouts_); if(rv == -EXDEV) rv = ::_link_exdev(ctx_,oldpath,newpath,st_,timeouts_); return rv; } mergerfs-2.42.0/src/fuse_link.hpp0000644000000000000000000000202615177346257015407 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "fuse.h" namespace FUSE { int link(const fuse_req_ctx_t *ctx, const char *oldpath, const char *newpath, struct stat *st, fuse_timeouts_t *timeouts); } mergerfs-2.42.0/src/fuse_listxattr.cpp0000644000000000000000000000722415177346257016510 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fuse_listxattr.hpp" #include "config.hpp" #include "errno.hpp" #include "fs_llistxattr.hpp" #include "xattr.hpp" #include "fuse.h" #include #include #include static ssize_t _listxattr_size(const std::vector &branches_, const fs::path &fusepath_) { ssize_t size; ssize_t err; bool success; fs::path fullpath; if(branches_.empty()) return -ENOENT; size = 0; err = -ENOENT; success = false; for(const auto branch : branches_) { ssize_t rv; fullpath = branch->path / fusepath_; rv = fs::llistxattr(fullpath,NULL,0); if(rv < 0) { if(err == -ENOENT) err = rv; continue; } success = true; size += rv; } if(success == false) return err; return size; } static ssize_t _listxattr(const std::vector &branches_, const fs::path &fusepath_, char *list_, size_t size_) { ssize_t rv; ssize_t size; ssize_t err; bool success; fs::path fullpath; if(size_ == 0) return ::_listxattr_size(branches_,fusepath_); size = 0; err = -ENOENT; success = false; for(const auto branch : branches_) { fullpath = branch->path / fusepath_; rv = fs::llistxattr(fullpath,list_,size_); if(rv < 0) { if(rv == -ERANGE) return -ERANGE; if(err == -ENOENT) err = rv; continue; } if((size_t)rv > size_) return -ERANGE; success = true; list_ += rv; size_ -= rv; size += rv; } if(success == false) return err; return size; } static int _listxattr(const Policy::Search &searchFunc_, const Branches::Ptr ibranches_, const fs::path &fusepath_, char *list_, const size_t size_) { int rv; std::vector obranches; rv = searchFunc_(ibranches_,fusepath_,obranches); if(rv < 0) return rv; if(size_ == 0) return ::_listxattr_size(obranches,fusepath_); return ::_listxattr(obranches,fusepath_,list_,size_); } int FUSE::listxattr(const fuse_req_ctx_t *ctx_, const char *fusepath_, char *list_, size_t size_) { const fs::path fusepath{fusepath_}; if(Config::is_ctrl_file(fusepath)) return cfg.keys_listxattr(list_,size_); switch(cfg.xattr) { case XAttr::ENUM::PASSTHROUGH: break; case XAttr::ENUM::NOATTR: return 0; case XAttr::ENUM::NOSYS: return -ENOSYS; } return ::_listxattr(cfg.func.listxattr.policy, cfg.branches, fusepath, list_, size_); } mergerfs-2.42.0/src/fuse_listxattr.hpp0000644000000000000000000000203615177346257016511 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "fuse_req_ctx.h" #include namespace FUSE { int listxattr(const fuse_req_ctx_t *ctx, const char *fusepath, char *buf, size_t count); } mergerfs-2.42.0/src/fuse_mkdir.cpp0000644000000000000000000001032215177346257015551 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fuse_mkdir.hpp" #include "config.hpp" #include "errno.hpp" #include "error.hpp" #include "fs_acl.hpp" #include "fs_clonepath.hpp" #include "fs_mkdir_as.hpp" #include "fs_path.hpp" #include "policy.hpp" #include "ugid.hpp" #include "fuse.h" #include static int _mkdir_core(const ugid_t ugid_, const fs::path &fullpath_, mode_t mode_, const mode_t umask_) { if(!fs::acl::dir_has_defaults(fullpath_)) mode_ &= ~umask_; return fs::mkdir_as(ugid_,fullpath_,mode_); } static int _mkdir_loop_core(const ugid_t ugid_, const fs::path &createpath_, const fs::path &fusepath_, const mode_t mode_, const mode_t umask_) { int rv; fs::path fullpath; fullpath = createpath_ / fusepath_; rv = ::_mkdir_core(ugid_,fullpath,mode_,umask_); return rv; } static int _mkdir_loop(const ugid_t ugid_, const Branch *existingbranch_, const std::vector &createbranches_, const fs::path &fusepath_, const fs::path &fusedirpath_, const mode_t mode_, const mode_t umask_) { int rv; Err err; for(const auto &createbranch : createbranches_) { rv = fs::clonepath(existingbranch_->path, createbranch->path, fusedirpath_); if(rv < 0) { err = rv; continue; } err = ::_mkdir_loop_core(ugid_, createbranch->path, fusepath_, mode_, umask_); } return err; } static int _mkdir(const ugid_t ugid_, const Policy::Search &getattrPolicy_, const Policy::Create &mkdirPolicy_, const Branches::Ptr branches_, const fs::path &fusepath_, const mode_t mode_, const mode_t umask_) { int rv; fs::path fusedirpath; std::vector createbranches; std::vector existingbranches; fusedirpath = fusepath_.parent_path(); rv = getattrPolicy_(branches_,fusedirpath,existingbranches); if(rv < 0) return rv; if(existingbranches.empty()) return -ENOENT; rv = mkdirPolicy_(branches_,fusedirpath,createbranches); if(rv < 0) return rv; if(createbranches.empty()) return -ENOENT; return ::_mkdir_loop(ugid_, existingbranches[0], createbranches, fusepath_, fusedirpath, mode_, umask_); } int FUSE::mkdir(const fuse_req_ctx_t *ctx_, const char *fusepath_, mode_t mode_) { int rv; const fs::path fusepath{fusepath_}; rv = ::_mkdir(ctx_, cfg.func.getattr.policy, cfg.func.mkdir.policy, cfg.branches, fusepath, mode_, ctx_->umask); if(rv == -EROFS) { cfg.branches.find_and_set_mode_ro(); rv = ::_mkdir(ctx_, cfg.func.getattr.policy, cfg.func.mkdir.policy, cfg.branches, fusepath, mode_, ctx_->umask); } return rv; } mergerfs-2.42.0/src/fuse_mkdir.hpp0000644000000000000000000000175615177346257015571 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "fuse_req_ctx.h" #include namespace FUSE { int mkdir(const fuse_req_ctx_t *ctx, const char *fusepath, mode_t mode); } mergerfs-2.42.0/src/fuse_mknod.cpp0000644000000000000000000001102215177346257015551 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fuse_mknod.hpp" #include "config.hpp" #include "errno.hpp" #include "error.hpp" #include "fs_acl.hpp" #include "fs_mknod_as.hpp" #include "fs_clonepath.hpp" #include "fs_path.hpp" #include "ugid.hpp" #include "fuse.h" #include #include static inline int _mknod_core(const ugid_t ugid_, const fs::path &fullpath_, mode_t mode_, const mode_t umask_, const dev_t dev_) { if(!fs::acl::dir_has_defaults(fullpath_)) mode_ &= ~umask_; return fs::mknod_as(ugid_,fullpath_,mode_,dev_); } static int _mknod_loop_core(const ugid_t ugid_, const fs::path &createbranch_, const fs::path &fusepath_, const mode_t mode_, const mode_t umask_, const dev_t dev_) { int rv; fs::path fullpath; fullpath = createbranch_ / fusepath_; rv = ::_mknod_core(ugid_,fullpath,mode_,umask_,dev_); return rv; } static int _mknod_loop(const ugid_t ugid_, const fs::path &existingbranch_, const std::vector &createbranches_, const fs::path &fusepath_, const fs::path &fusedirpath_, const mode_t mode_, const mode_t umask_, const dev_t dev_) { int rv; Err err; for(const auto &createbranch : createbranches_) { rv = fs::clonepath(existingbranch_, createbranch->path, fusedirpath_); if(rv < 0) { err = rv; continue; } err = ::_mknod_loop_core(ugid_, createbranch->path, fusepath_, mode_, umask_, dev_); } return err; } static int _mknod(const ugid_t ugid_, const Policy::Search &searchFunc_, const Policy::Create &createFunc_, const Branches::Ptr branches_, const fs::path &fusepath_, const mode_t mode_, const mode_t umask_, const dev_t dev_) { int rv; fs::path fusedirpath; std::vector createbranches; std::vector existingbranches; fusedirpath = fusepath_.parent_path(); rv = searchFunc_(branches_,fusedirpath,existingbranches); if(rv < 0) return rv; if(existingbranches.empty()) return -ENOENT; rv = createFunc_(branches_,fusedirpath,createbranches); if(rv < 0) return rv; if(createbranches.empty()) return -ENOENT; return ::_mknod_loop(ugid_, existingbranches[0]->path, createbranches, fusepath_, fusedirpath, mode_, umask_, dev_); } int FUSE::mknod(const fuse_req_ctx_t *ctx_, const char *fusepath_, mode_t mode_, dev_t rdev_) { int rv; const fs::path fusepath{fusepath_}; rv = ::_mknod(ctx_, cfg.func.getattr.policy, cfg.func.mknod.policy, cfg.branches, fusepath, mode_, ctx_->umask, rdev_); if(rv == -EROFS) { cfg.branches.find_and_set_mode_ro(); rv = ::_mknod(ctx_, cfg.func.getattr.policy, cfg.func.mknod.policy, cfg.branches, fusepath, mode_, ctx_->umask, rdev_); } return rv; } mergerfs-2.42.0/src/fuse_mknod.hpp0000644000000000000000000000202315177346257015557 0ustar rootroot /* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "fuse_req_ctx.h" #include namespace FUSE { int mknod(const fuse_req_ctx_t *ctx, const char *fusepath, mode_t mode, dev_t rdev); } mergerfs-2.42.0/src/fuse_open.cpp0000644000000000000000000003207015177346257015410 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* OPEN FILE MANAGEMENT AND SHARED HANDLE TRACKING =============================================== This file implements FUSE open() with handling for concurrent access to the same file. The key challenge is that multiple threads may simultaneously attempt to open the same file (same nodeid), and we need to: 1. Share a single canonical FileInfo entry in the open_files map for all opens of the same file while still giving each FUSE handle its own FileInfo object and file descriptor 2. Properly reference count to know when to release resources 3. Handle race conditions without deadlocks or resource leaks 4. Support FUSE passthrough mode for performance CONCURRENCY MODEL ----------------- The open_files map (in state.hpp) tracks all currently open files: - Key: nodeid (FUSE inode number) - Value: OpenFile struct { ref_count, backing_id, fi } When a file is opened: 1. First, we check if an entry already exists (using visit()) 2. If it exists, we increment ref_count and create a new per-handle FileInfo by re-opening the canonical file descriptor 3. If it doesn't exist, we create a new FileInfo and try to insert it 4. If insertion fails (another thread inserted first), we clean up and retry (because to use passthrough it MUST be the same underlying file as the backing id was created) THE RETRY LOOP -------------- The MAX_OPEN_RETRIES loop (lines ~294-380) handles the race where multiple threads try to open the same file simultaneously: Thread A: visit() -> no entry -> open file -> try_emplace() -> SUCCESS Thread B: visit() -> no entry -> open file -> try_emplace() -> FAIL Thread B: (cleans up, retries) -> visit() -> found Thread A's entry -> share it This ensures that all threads eventually succeed while sharing the same underlying file resources. The alternative is to not use passthrough on failure but this race should be rare. RELEASE INTERACTION ------------------- release() erases the map entry on the final close. Until then, the canonical FileInfo in the map remains valid and overlapping opens can bump ref_count and duplicate its fd. Secondary handles own their own FileInfo objects and are freed independently during release(). PASSTHROUGH MODE ---------------- FUSE passthrough (Linux 6.9+) allows the kernel to bypass mergerfs for I/O: - We request a backing_id from the kernel via fuse_passthrough_open() - If successful, subsequent reads/writes go directly to the backing file - This achieves near native performance The backing_id is stored in the OpenFile entry so all overlapping open requests share the same passthrough handle. */ #include "fuse_open.hpp" #include "state.hpp" #include "config.hpp" #include "errno.hpp" #include "fileinfo.hpp" #include "fuse_release.hpp" #include "fs_close.hpp" #include "fs_cow.hpp" #include "fs_fchmod.hpp" #include "fs_lchmod.hpp" #include "fs_open.hpp" #include "fs_open_fd.hpp" #include "fs_openat.hpp" #include "fs_path.hpp" #include "fs_stat.hpp" #include "fuse_passthrough.hpp" #include "procfs.hpp" #include "stat_util.hpp" #include "fuse.h" #include #include #include #include #define MAX_OPEN_RETRIES 64 static bool _rdonly(const int flags_) { return ((flags_ & O_ACCMODE) == O_RDONLY); } static int _lchmod_and_open_if_not_writable_and_empty(const fs::path &fullpath_, const int flags_) { int rv; struct stat st; rv = fs::lstat(fullpath_,&st); if(rv < 0) return -EACCES; if(StatUtil::writable(st)) return -EACCES; rv = fs::lchmod(fullpath_,(st.st_mode|S_IWUSR|S_IWGRP)); if(rv < 0) return -EACCES; rv = fs::open(fullpath_,flags_); if(rv < 0) return -EACCES; fs::fchmod(rv,st.st_mode); return rv; } static int _nfsopenhack(const fs::path &fullpath_, const int flags_, const NFSOpenHack nfsopenhack_) { switch(nfsopenhack_) { default: case NFSOpenHack::ENUM::OFF: return -EACCES; case NFSOpenHack::ENUM::GIT: if(::_rdonly(flags_)) return -EACCES; if(fullpath_.string().find("/.git/") == std::string::npos) return -EACCES; return ::_lchmod_and_open_if_not_writable_and_empty(fullpath_,flags_); case NFSOpenHack::ENUM::ALL: if(::_rdonly(flags_)) return -EACCES; return ::_lchmod_and_open_if_not_writable_and_empty(fullpath_,flags_); } } /* The kernel expects being able to issue read requests when running with writeback caching enabled so we must change O_WRONLY to O_RDWR. With writeback caching enabled the kernel handles O_APPEND. Could be an issue if the underlying file changes out of band but that is true of any caching. */ static void _tweak_flags_cache_writeback(int *flags_) { if((*flags_ & O_ACCMODE) == O_WRONLY) *flags_ = ((*flags_ & ~O_ACCMODE) | O_RDWR); if(*flags_ & O_APPEND) *flags_ &= ~O_APPEND; } static bool _calculate_flush(FlushOnClose const flushonclose_, int const flags_) { switch(flushonclose_) { case FlushOnCloseEnum::NEVER: return false; case FlushOnCloseEnum::OPENED_FOR_WRITE: return !::_rdonly(flags_); case FlushOnCloseEnum::ALWAYS: return true; } return true; } static void _config_to_ffi_flags(const int tid_, fuse_file_info_t *ffi_) { switch(cfg.cache_files) { case CacheFiles::ENUM::OFF: ffi_->direct_io = 1; ffi_->keep_cache = 0; ffi_->auto_cache = 0; break; case CacheFiles::ENUM::PARTIAL: ffi_->direct_io = 0; ffi_->keep_cache = 0; ffi_->auto_cache = 0; break; case CacheFiles::ENUM::FULL: ffi_->direct_io = 0; ffi_->keep_cache = 1; ffi_->auto_cache = 0; break; case CacheFiles::ENUM::AUTO_FULL: ffi_->direct_io = 0; ffi_->keep_cache = 0; ffi_->auto_cache = 1; break; case CacheFiles::ENUM::PER_PROCESS: std::string proc_name; proc_name = procfs::get_name(tid_); if(cfg.cache_files_process_names.count(proc_name) == 0) { ffi_->direct_io = 1; ffi_->keep_cache = 0; ffi_->auto_cache = 0; } else { ffi_->direct_io = 0; ffi_->keep_cache = 0; ffi_->auto_cache = 0; } break; } if(cfg.parallel_direct_writes == true) ffi_->parallel_direct_writes = ffi_->direct_io; } static int _open_path(const fs::path &filepath_, const Branch *branch_, const fs::path &fusepath_, fuse_file_info_t *ffi_, const NFSOpenHack nfsopenhack_) { int fd; FileInfo *fi; fd = fs::openat(AT_FDCWD,filepath_,ffi_->flags); if(fd == -EACCES) fd = ::_nfsopenhack(filepath_,ffi_->flags,nfsopenhack_); if(fd < 0) return fd; fi = new FileInfo(fd,branch_,fusepath_,ffi_->direct_io); ffi_->fh = fi->to_fh(); return 0; } static int _open_fd(const int fd_, const Branch *branch_, const fs::path &fusepath_, fuse_file_info_t *ffi_) { int fd; FileInfo *fi; fd = fs::open_fd(fd_,ffi_->flags); if(fd < 0) return fd; fi = new FileInfo(fd,branch_,fusepath_,ffi_->direct_io); ffi_->fh = fi->to_fh(); return 0; } static int _open(const Policy::Search &searchFunc_, const Branches::Ptr ibranches_, const fs::path &fusepath_, fuse_file_info_t *ffi_, const bool link_cow_, const NFSOpenHack nfsopenhack_) { int rv; fs::path filepath; std::vector obranches; rv = searchFunc_(ibranches_,fusepath_,obranches); if(rv < 0) return rv; if(obranches.empty()) return -ENOENT; filepath = obranches[0]->path / fusepath_; if(link_cow_ && fs::cow::is_eligible(filepath,ffi_->flags)) fs::cow::break_link(filepath); rv = ::_open_path(filepath, obranches[0], fusepath_, ffi_, nfsopenhack_); return rv; } constexpr u64 _(const PassthroughIOEnum e_, const u64 m_) { return ((((u64)e_) << 32) | (m_ & O_ACCMODE)); } static int _open(const fuse_req_ctx_t *ctx_, const fs::path &fusepath_, fuse_file_info_t *ffi_) { int rv; auto &of = state.open_files; ::_config_to_ffi_flags(ctx_->pid,ffi_); if(cfg.cache_writeback) ::_tweak_flags_cache_writeback(&ffi_->flags); ffi_->noflush = !::_calculate_flush(cfg.flushonclose,ffi_->flags); for(int i = 0; i < MAX_OPEN_RETRIES; i++) { FileInfo *fi = nullptr; int backing_id = INVALID_BACKING_ID; // The ref increment keeps fuse_release.cpp from erasing and // freeing the canonical entry while we duplicate its fd. of.visit(ctx_->nodeid, [&](auto &v_) { v_.second.ref_count++; fi = v_.second.fi; backing_id = v_.second.backing_id; }); // If the file is already open... if(fi) { rv = ::_open_fd(fi->fd, &fi->branch, fusepath_, ffi_); // If we fail to reopen the already open file we need to // treat it similarly to fuse_release. Since we increased // the ref count without an actual new fileinfo obj we call // FUSE::release() without an obj. Nothing was allocated // into ffi_->fh. _open_fd() failing should really never // happen hence no retries. Just being careful. if(rv < 0) { FUSE::release(ctx_->nodeid); return rv; } switch(_(cfg.passthrough_io,ffi_->flags)) { case _(PassthroughIO::ENUM::RO,O_RDONLY): case _(PassthroughIO::ENUM::WO,O_WRONLY): case _(PassthroughIO::ENUM::RW,O_RDONLY): case _(PassthroughIO::ENUM::RW,O_WRONLY): case _(PassthroughIO::ENUM::RW,O_RDWR): if(not fuse_backing_id_is_valid(backing_id)) return 0; ffi_->backing_id = backing_id; ffi_->passthrough = true; ffi_->keep_cache = false; return 0; } return 0; } // Was not open, do first open, try to insert, if someone beat us // to it in another thread then throw it away and try again. rv = ::_open(cfg.func.open.policy, cfg.branches, fusepath_, ffi_, cfg.link_cow, cfg.nfsopenhack); if(rv < 0) return rv; fi = FileInfo::from_fh(ffi_->fh); if(not fi) return -EBADF; switch(_(cfg.passthrough_io,ffi_->flags)) { case _(PassthroughIO::ENUM::RO,O_RDONLY): case _(PassthroughIO::ENUM::WO,O_WRONLY): case _(PassthroughIO::ENUM::RW,O_RDONLY): case _(PassthroughIO::ENUM::RW,O_WRONLY): case _(PassthroughIO::ENUM::RW,O_RDWR): backing_id = FUSE::passthrough_open(fi->fd); if(fuse_backing_id_is_valid(backing_id)) { ffi_->backing_id = backing_id; ffi_->passthrough = true; ffi_->keep_cache = false; } break; default: break; } bool inserted = of.try_emplace(ctx_->nodeid, backing_id, fi); if(inserted) return 0; // Failed to insert because another thread beat us to // it. Cleanup the resources and try it all again. FUSE::passthrough_close(backing_id); fs::close(fi->fd); delete fi; ffi_->fh = 0; struct timespec duration = {0,((i+1)*1000)}; ::nanosleep(&duration,NULL); } // Perhaps not the best error to return but it is EXTREMELY unlikely // to be hit and if so the system is probably under a lot of // stress. Give the app the opportunity to try it again. If it can't // it'll error probably similarly as having had returned EIO or // similar. return -EINTR; } int FUSE::open(const fuse_req_ctx_t *ctx_, const char *fusepath_, fuse_file_info_t *ffi_) { const fs::path fusepath{fusepath_}; return ::_open(ctx_,fusepath,ffi_); } mergerfs-2.42.0/src/fuse_open.hpp0000644000000000000000000000171315177346257015415 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "fuse.h" namespace FUSE { int open(const fuse_req_ctx_t *ctx, const char *fusepath, fuse_file_info_t *ffi); } mergerfs-2.42.0/src/fuse_opendir.cpp0000644000000000000000000000234715177346257016113 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fuse_opendir.hpp" #include "config.hpp" #include "dirinfo.hpp" #include "fuse.h" int FUSE::opendir(const fuse_req_ctx_t *ctx_, const char *fusepath_, fuse_file_info_t *ffi_) { DirInfo *di; di = new DirInfo(fusepath_); ffi_->fh = di->to_fh(); ffi_->noflush = true; if(cfg.cache_readdir) { ffi_->keep_cache = true; ffi_->cache_readdir = true; } return 0; } mergerfs-2.42.0/src/fuse_opendir.hpp0000644000000000000000000000172415177346257016116 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "fuse.h" namespace FUSE { int opendir(const fuse_req_ctx_t *ctx, const char *fusepath, fuse_file_info_t *ffi); } mergerfs-2.42.0/src/fuse_passthrough.hpp0000644000000000000000000000230115177346257017015 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "fuse.h" // Becoming root is required due to current security policies within // the kernel. This may be able to be changed in the future. namespace FUSE { static inline int passthrough_open(const int fd_) { return fuse_passthrough_open(fd_); } static inline int passthrough_close(const int backing_id_) { return fuse_passthrough_close(backing_id_); } } mergerfs-2.42.0/src/fuse_poll.cpp0000644000000000000000000000214715177346257015417 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fuse_poll.hpp" #include "errno.hpp" #include "fuse.h" int FUSE::poll(const fuse_req_ctx_t *ctx_, const fuse_file_info_t *ffi_, fuse_pollhandle_t *ph_, unsigned *reventsp_) { (void)ctx_; (void)ffi_; (void)ph_; (void)reventsp_; return -ENOSYS; } mergerfs-2.42.0/src/fuse_poll.hpp0000644000000000000000000000176415177346257015430 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "fuse.h" namespace FUSE { int poll(const fuse_req_ctx_t *ctx, const fuse_file_info_t *ffi, fuse_pollhandle_t *ph, unsigned *reventsp); } mergerfs-2.42.0/src/fuse_read.cpp0000644000000000000000000000420215177346257015356 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fuse_read.hpp" #include "errno.hpp" #include "fileinfo.hpp" #include "fs_pread.hpp" #include "ioprio.hpp" #include "state.hpp" #include "fuse.h" #include #include static int _read_direct_io(const int fd_, char *buf_, const size_t size_, const off_t offset_) { int rv; rv = fs::pread(fd_,buf_,size_,offset_); return rv; } static int _read_cached(const int fd_, char *buf_, const size_t size_, const off_t offset_) { int rv; rv = fs::pread(fd_,buf_,size_,offset_); return rv; } int FUSE::read(const fuse_req_ctx_t *ctx_, const fuse_file_info_t *ffi_, char *buf_, size_t size_, off_t offset_) { ioprio::SetFrom iop(ctx_->pid); FileInfo *fi; fi = state.get_fi(ctx_,ffi_->fh); if(not fi) return -EBADF; if(fi->direct_io) return ::_read_direct_io(fi->fd,buf_,size_,offset_); return ::_read_cached(fi->fd,buf_,size_,offset_); } int FUSE::read_null(const fuse_req_ctx_t *ctx_, const fuse_file_info_t *ffi_, char *buf_, size_t size_, off_t offset_) { return size_; } mergerfs-2.42.0/src/fuse_read.hpp0000644000000000000000000000241115177346257015363 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "fuse.h" #include namespace FUSE { int read(const fuse_req_ctx_t *ctx, const fuse_file_info_t *ffi, char *buf, size_t size, off_t offset); int read_null(const fuse_req_ctx_t *ctx, const fuse_file_info_t *ffi, char *buf, size_t size, off_t offset); } mergerfs-2.42.0/src/fuse_readdir.cpp0000644000000000000000000000563315177346257016066 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fuse_readdir.hpp" #include "fuse_readdir_factory.hpp" #include "dirinfo.hpp" #include "fatal.hpp" #include "fuse_dirents.hpp" #include "config.hpp" #include #include int FUSE::readdir(const fuse_req_ctx_t *ctx_, const fuse_file_info_t *ffi_, fuse_dirents_t *buf_) { return cfg.readdir(ctx_,ffi_,buf_); } FUSE::ReadDir::ReadDir(const std::string_view s_) : _str() { from_string(s_); } std::string FUSE::ReadDir::to_string() const { std::shared_ptr str; str = std::atomic_load(&_str); return (*str); } int FUSE::ReadDir::from_string(const std::string_view str_) { std::shared_ptr tmp_str; std::shared_ptr tmp_readdir; tmp_readdir = FUSE::ReadDirFactory::make(str_); if(!tmp_readdir) return -EINVAL; tmp_str = std::make_shared(str_); std::atomic_store(&_str,tmp_str); if(_initialized == false) return 0; std::atomic_store(&_impl,tmp_readdir); return 0; } static int _handle_ENOENT(const fuse_file_info_t *ffi_, fuse_dirents_t *buf_) { dirent de; DirInfo *di = DirInfo::from_fh(ffi_->fh); if(not di) return -EBADF; if(!di->fusepath.empty()) return -ENOENT; constexpr const char msg[] = "error: no valid mergerfs branch found, check config"; de = {}; de.d_ino = 0; de.d_off = 0; de.d_type = DT_UNKNOWN; strncpy(de.d_name,msg,(sizeof(msg) - 1)); de.d_reclen = sizeof(de); fuse_dirents_add(buf_,&de,(sizeof(msg) - 1)); return 0; } int FUSE::ReadDir::operator()(const fuse_req_ctx_t *ctx_, const fuse_file_info_t *ffi_, fuse_dirents_t *buf_) { int rv; std::shared_ptr readdir; readdir = std::atomic_load(&_impl); if(!readdir) fatal::abort("readdir impl is null"); rv = (*readdir)(ctx_,ffi_,buf_); if(rv == -ENOENT) return ::_handle_ENOENT(ffi_,buf_); return rv; } void FUSE::ReadDir::initialize() { std::shared_ptr str; str = std::atomic_load(&_str); _initialized = true; from_string(*str); } mergerfs-2.42.0/src/fuse_readdir.hpp0000644000000000000000000000364515177346257016074 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "fuse.h" #include "tofrom_string.hpp" #include "fuse_readdir_base.hpp" #include #include #include namespace FUSE { int readdir(const fuse_req_ctx_t *ctx, fuse_file_info_t const *ffi, fuse_dirents_t *buf); } // The 'initialize' feature is ugly but required currently as when // using mount.mergerfs the process will fork so if readdir needs to // spawn threads it needs to do so after the fork. Longer term need to // do argument/config file validation in main() and actual resource // initialization in fuse_init(). namespace FUSE { class ReadDir : public ToFromString { public: ReadDir(const std::string_view s_); public: std::string to_string() const; int from_string(const std::string_view); public: int operator()(const fuse_req_ctx_t *ctx, fuse_file_info_t const *ffi, fuse_dirents_t *buf); public: void initialize(); private: std::atomic _initialized = false; std::shared_ptr _str; std::shared_ptr _impl; }; } mergerfs-2.42.0/src/fuse_readdir_base.hpp0000644000000000000000000000220515177346257017055 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "fuse.h" #include namespace FUSE { class ReadDirBase { public: ReadDirBase() {}; virtual ~ReadDirBase() {}; public: virtual int operator()(const fuse_req_ctx_t *ctx, const fuse_file_info_t *ffi, fuse_dirents_t *buf) = 0; }; } mergerfs-2.42.0/src/fuse_readdir_cor.cpp0000644000000000000000000000501315177346257016721 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fuse_readdir_cor.hpp" #include "supported_getdents64.hpp" #include "config.hpp" #include "dirinfo.hpp" #include "error.hpp" FUSE::ReadDirCOR::ReadDirCOR(unsigned concurrency_, unsigned max_queue_depth_) : _tp(concurrency_,max_queue_depth_,"readdir.cor") { } FUSE::ReadDirCOR::~ReadDirCOR() { } #ifdef MERGERFS_SUPPORTED_GETDENTS64 #include "fuse_readdir_cor_getdents.icpp" #else #include "fuse_readdir_cor_readdir.icpp" #endif static inline int _concurrent_readdir(ThreadPool &tp_, const Branches::Ptr branches_, const fs::path &rel_dirpath_, fuse_dirents_t *dirents_) { HashSet names; Mutex mutex; std::vector> futures; fuse_dirents_reset(dirents_); futures.reserve(branches_->size()); for(const auto &branch : *branches_) { auto func = [&,dirents_]() { return ::_readdir(branch.path, rel_dirpath_, names, dirents_, mutex); }; auto rv = tp_.enqueue_task(std::move(func)); futures.emplace_back(std::move(rv)); } Err err; for(auto &future : futures) err = future.get(); return err; } int FUSE::ReadDirCOR::operator()(const fuse_req_ctx_t *ctx_, const fuse_file_info_t *ffi_, fuse_dirents_t *dirents_) { DirInfo *di = DirInfo::from_fh(ffi_->fh); if(not di) return -EBADF; return ::_concurrent_readdir(_tp, cfg.branches, di->fusepath, dirents_); } mergerfs-2.42.0/src/fuse_readdir_cor.hpp0000644000000000000000000000240115177346257016724 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "fuse_readdir_base.hpp" #include "thread_pool.hpp" // concurrent open & read namespace FUSE { class ReadDirCOR final : public FUSE::ReadDirBase { public: ReadDirCOR(unsigned concurrency, unsigned max_queue_depth); ~ReadDirCOR(); int operator()(const fuse_req_ctx_t *ctx, const fuse_file_info_t *ffi, fuse_dirents_t *buf); private: mutable ThreadPool _tp; }; } mergerfs-2.42.0/src/fuse_readdir_cor_getdents.icpp0000644000000000000000000000454615177346257021001 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma message "using getdents" #include "fs_close.hpp" #include "fs_getdents64.hpp" #include "fs_inode.hpp" #include "fs_open.hpp" #include "fs_path.hpp" #include "hashset.hpp" #include "mutex.hpp" #include "scope_guard/scope_guard.hpp" #include "fuse_msgbuf.hpp" #include "fuse_dirents.hpp" static inline int _readdir(const fs::path &branch_path_, const fs::path &rel_dirpath_, HashSet &names_, fuse_dirents_t *dirents_, mutex_t &mutex_) { int fd; fuse_msgbuf_t *buf; fs::path abs_dirpath; abs_dirpath = branch_path_ / rel_dirpath_; fd = fs::open_dir_ro(abs_dirpath); if(fd < 0) return fd; DEFER{ fs::close(fd); }; buf = msgbuf_alloc(); if(not buf) return -ENOMEM; DEFER{ msgbuf_free(buf); }; fs::inode::ReaddirCalc inodecalc(branch_path_,rel_dirpath_); while(true) { ssize_t nread; nread = fs::getdents64(fd,buf->mem,buf->size); if(nread <= 0) return nread; LockGuard lk(mutex_); for(ssize_t pos = 0; pos < nread;) { int rv; int namelen; fs::dirent64 *d = reinterpret_cast(&buf->mem[pos]); pos += d->reclen; namelen = d->namelen(); rv = names_.put(d->name,namelen); if(rv == 0) continue; d->ino = inodecalc.calc(d->name, namelen, DTTOIF(d->type), d->ino); fuse_dirents_add(dirents_,d,namelen); } } return 0; } mergerfs-2.42.0/src/fuse_readdir_cor_readdir.icpp0000644000000000000000000000467715177346257020603 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma message "using readdir" #define MAX_ENTRIES_PER_LOOP 64 #include "fs_opendir.hpp" #include "fs_closedir.hpp" #include "hashset.hpp" #include "scope_guard/scope_guard.hpp" #include "fs_readdir.hpp" #include "fs_inode.hpp" #include "fuse_dirents.hpp" #include #include static u64 _dirent_exact_namelen(const struct dirent *d_) { #ifdef _D_EXACT_NAMLEN return _D_EXACT_NAMLEN(d_); #elif defined _DIRENT_HAVE_D_NAMLEN return d_->d_namlen; #else return strlen(d_->d_name); #endif } static inline int _readdir(const fs::path &branch_path_, const fs::path &rel_dirpath_, HashSet &names_, fuse_dirents_t *dirents_, mutex_t &mutex_) { DIR *dir; fs::path abs_dirpath; abs_dirpath = branch_path_ / rel_dirpath_; errno = 0; dir = fs::opendir(abs_dirpath); if(dir == NULL) return -errno; DEFER{ fs::closedir(dir); }; fs::inode::ReaddirCalc inodecalc(branch_path_,rel_dirpath_); while(true) { LockGuard lk(mutex_); for(int i = 0; i < MAX_ENTRIES_PER_LOOP; i++) { int rv; int namelen; dirent *de; errno = 0; de = fs::readdir(dir); if(de == NULL) return -errno; namelen = ::_dirent_exact_namelen(de); rv = names_.put(de->d_name,namelen); if(rv == 0) continue; de->d_ino = inodecalc.calc(de->d_name, namelen, DTTOIF(de->d_type), de->d_ino); fuse_dirents_add(dirents_,de,namelen); } } return 0; } mergerfs-2.42.0/src/fuse_readdir_cosr.cpp0000644000000000000000000000400715177346257017106 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fuse_readdir_cosr.hpp" #include "config.hpp" #include "dirinfo.hpp" #include "supported_getdents64.hpp" FUSE::ReadDirCOSR::ReadDirCOSR(unsigned concurrency_, unsigned max_queue_depth_) : _tp(concurrency_,max_queue_depth_,"readdir.cosr") { } FUSE::ReadDirCOSR::~ReadDirCOSR() { } #ifdef MERGERFS_SUPPORTED_GETDENTS64 #include "fuse_readdir_cosr_getdents.icpp" #else #include "fuse_readdir_cosr_readdir.icpp" #endif static inline int _readdir(ThreadPool &tp_, const Branches::Ptr branches_, const fs::path &rel_dirpath_, fuse_dirents_t *dirents_) { int rv; std::vector> futures; fuse_dirents_reset(dirents_); futures = ::_opendir(tp_,branches_,rel_dirpath_); rv = ::_readdir(futures,rel_dirpath_,dirents_); return rv; } int FUSE::ReadDirCOSR::operator()(const fuse_req_ctx_t *ctx_, fuse_file_info_t const *ffi_, fuse_dirents_t *dirents_) { DirInfo *di = DirInfo::from_fh(ffi_->fh); if(not di) return -EBADF; return ::_readdir(_tp, cfg.branches, di->fusepath, dirents_); } mergerfs-2.42.0/src/fuse_readdir_cosr.hpp0000644000000000000000000000240615177346257017114 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "fuse_readdir_base.hpp" #include "thread_pool.hpp" // concurrent open, sequential read namespace FUSE { class ReadDirCOSR final : public FUSE::ReadDirBase { public: ReadDirCOSR(unsigned concurrency, unsigned max_queue_depth); ~ReadDirCOSR(); int operator()(const fuse_req_ctx_t *ctx, fuse_file_info_t const *ffi, fuse_dirents_t *buf); private: ThreadPool _tp; }; } mergerfs-2.42.0/src/fuse_readdir_cosr_getdents.icpp0000644000000000000000000000640215177346257021155 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma message "using getdents" #include "fs_inode.hpp" #include "fs_getdents64.hpp" #include "hashset.hpp" #include "branches.hpp" #include "error.hpp" #include "fs_close.hpp" #include "fs_open.hpp" #include "fs_path.hpp" #include "ugid.hpp" #include "scope_guard/scope_guard.hpp" #include "fuse_msgbuf.hpp" #include "fuse_dirents.hpp" #include struct DirRV { const fs::path *branch_path; int fd; }; static inline std::vector> _opendir(ThreadPool &tp_, const Branches::Ptr &branches_, const fs::path &rel_dirpath_) { std::vector> futures; futures.reserve(branches_->size()); for(const auto &branch : *branches_) { auto func = [&branch,&rel_dirpath_]() { int fd; fs::path abs_dirpath; abs_dirpath = branch.path / rel_dirpath_; fd = fs::open_dir_ro(abs_dirpath); return DirRV{&branch.path,fd}; }; auto rv = tp_.enqueue_task(std::move(func)); futures.emplace_back(std::move(rv)); } return futures; } static inline int _readdir(std::vector> &dh_futures_, const fs::path &rel_dirpath_, fuse_dirents_t *dirents_) { Err err; HashSet names; fuse_msgbuf_t *buf; buf = msgbuf_alloc(); if(not buf) return -ENOMEM; DEFER { msgbuf_free(buf); }; for(auto &dh_future : dh_futures_) { DirRV dirrv; dirrv = dh_future.get(); err = dirrv.fd; if(dirrv.fd < 0) continue; DEFER { fs::close(dirrv.fd); }; fs::inode::ReaddirCalc inodecalc(*dirrv.branch_path,rel_dirpath_); while(true) { ssize_t nread; nread = fs::getdents64(dirrv.fd,buf->mem,buf->size); if(nread <= 0) break; for(ssize_t pos = 0; pos < nread;) { int rv; int namelen; fs::dirent64 *d = reinterpret_cast(&buf->mem[pos]); pos += d->reclen; namelen = d->namelen(); rv = names.put(d->name,namelen); if(rv == 0) continue; d->ino = inodecalc.calc(d->name, namelen, DTTOIF(d->type), d->ino); fuse_dirents_add(dirents_,d,namelen); } } } return err; } mergerfs-2.42.0/src/fuse_readdir_cosr_readdir.icpp0000644000000000000000000000612415177346257020753 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma message "using readdir" #include "error.hpp" #include "fs_closedir.hpp" #include "fs_inode.hpp" #include "fs_opendir.hpp" #include "fs_readdir.hpp" #include "hashset.hpp" #include "scope_guard/scope_guard.hpp" #include "ugid.hpp" #include "fuse_dirents.hpp" struct DirRV { const fs::path *branch_path; DIR *dir; int err; }; static uint64_t _dirent_exact_namelen(const struct dirent *d_) { #ifdef _D_EXACT_NAMLEN return _D_EXACT_NAMLEN(d_); #elif defined _DIRENT_HAVE_D_NAMLEN return d_->d_namlen; #else return strlen(d_->d_name); #endif } static inline std::vector> _opendir(ThreadPool &tp_, const Branches::Ptr &branches_, const fs::path &rel_dirpath_) { std::vector> futures; futures.reserve(branches_->size()); for(const auto &branch : *branches_) { auto func = [&branch,&rel_dirpath_]() { DIR *dir; fs::path abs_dirpath; abs_dirpath = branch.path / rel_dirpath_; errno = 0; dir = fs::opendir(abs_dirpath); return DirRV{&branch.path,dir,-errno}; }; auto rv = tp_.enqueue_task(std::move(func)); futures.emplace_back(std::move(rv)); } return futures; } static inline int _readdir(std::vector> &dh_futures_, const fs::path &rel_dirpath_, fuse_dirents_t *dirents_) { Err err; HashSet names; for(auto &dh_future : dh_futures_) { DirRV dirrv; dirrv = dh_future.get(); err = dirrv.err; if(dirrv.dir == NULL) continue; DEFER { fs::closedir(dirrv.dir); }; fs::inode::ReaddirCalc inodecalc(*dirrv.branch_path,rel_dirpath_); for(dirent *de = fs::readdir(dirrv.dir); de; de = fs::readdir(dirrv.dir)) { int rv; int namelen; namelen = ::_dirent_exact_namelen(de); rv = names.put(de->d_name,namelen); if(rv == 0) continue; de->d_ino = inodecalc.calc(de->d_name, namelen, DTTOIF(de->d_type), de->d_ino); fuse_dirents_add(dirents_,de,namelen); } } return err; } mergerfs-2.42.0/src/fuse_readdir_factory.cpp0000644000000000000000000000625415177346257017615 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fuse_readdir_factory.hpp" #include "fuse_readdir_cor.hpp" #include "fuse_readdir_cosr.hpp" #include "fuse_readdir_seq.hpp" #include #include #include #include #include #include // Regex: // ^([a-z]{1,15}) -> required type // (?::(\d+))? -> optional colon + concurrency // (?::(\d+))? -> optional colon + max_queue_depth // $ -> end of string static void _read_cfg(const std::string_view str_, std::string &type_, int &concurrency_, int &max_queue_depth_) { std::string type; int concurrency; int max_queue_depth; bool matched; std::cmatch match; std::regex re(R"(^([a-z]{1,15})(?::(\d+))?(?::(\d+))?$)"); concurrency = 0; max_queue_depth = 0; matched = std::regex_match(str_.begin(), str_.end(), match, re); if(matched) { type = match[1]; if(match[2].matched) concurrency = std::stoi(match[2]); if(match[3].matched) max_queue_depth = std::stoi(match[3]); } if(concurrency == 0) { concurrency = std::thread::hardware_concurrency(); if(concurrency > 8) concurrency = 8; } else if(concurrency < 0) { concurrency = (std::thread::hardware_concurrency() / std::abs(concurrency)); } if(concurrency <= 0) concurrency = 1; if(max_queue_depth <= 0) max_queue_depth = 2; max_queue_depth *= concurrency; type_ = type; concurrency_ = concurrency; max_queue_depth_ = max_queue_depth; } bool FUSE::ReadDirFactory::valid(const std::string_view str_) { int concurrency; int max_queue_depth; std::string type; ::_read_cfg(str_,type,concurrency,max_queue_depth); return ((type == "seq") || (type == "cosr") || (type == "cor")); } std::shared_ptr FUSE::ReadDirFactory::make(const std::string_view str_) { int concurrency; int max_queue_depth; std::string type; ::_read_cfg(str_,type,concurrency,max_queue_depth); if(type == "seq") return std::make_shared(); if(type == "cosr") return std::make_shared(concurrency,max_queue_depth); if(type == "cor") return std::make_shared(concurrency,max_queue_depth); return {}; } mergerfs-2.42.0/src/fuse_readdir_factory.hpp0000644000000000000000000000206415177346257017615 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "fuse_readdir_base.hpp" #include #include namespace FUSE { class ReadDirFactory { public: static bool valid(const std::string_view str); static std::shared_ptr make(const std::string_view str); }; } mergerfs-2.42.0/src/fuse_readdir_plus.cpp0000644000000000000000000000201115177346257017114 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fuse_readdir_plus.hpp" #include int FUSE::readdir_plus(const fuse_req_ctx_t *ctx_, const fuse_file_info_t *ffi_, fuse_dirents_t *buf_) { return -ENOTSUP; } mergerfs-2.42.0/src/fuse_readdir_plus.hpp0000644000000000000000000000175215177346257017134 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "fuse.h" namespace FUSE { int readdir_plus(const fuse_req_ctx_t *ctx, const fuse_file_info_t *ffi, fuse_dirents_t *buf); } mergerfs-2.42.0/src/fuse_readdir_seq.cpp0000644000000000000000000000261515177346257016733 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #define _DEFAULT_SOURCE #include "fuse_readdir_seq.hpp" #include "config.hpp" #include "supported_getdents64.hpp" #ifdef MERGERFS_SUPPORTED_GETDENTS64 #include "fuse_readdir_seq_getdents.icpp" #else #include "fuse_readdir_seq_readdir.icpp" #endif int FUSE::ReadDirSeq::operator()(const fuse_req_ctx_t *ctx_, const fuse_file_info_t *ffi_, fuse_dirents_t *dirents_) { DirInfo *di = DirInfo::from_fh(ffi_->fh); if(not di) return -EBADF; return ::_readdir(cfg.branches, di->fusepath, dirents_); } mergerfs-2.42.0/src/fuse_readdir_seq.hpp0000644000000000000000000000215215177346257016734 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "fuse_readdir_base.hpp" namespace FUSE { class ReadDirSeq final : public FUSE::ReadDirBase { public: ReadDirSeq() {} ~ReadDirSeq() {} int operator()(const fuse_req_ctx_t *ctx, const fuse_file_info_t *ffi, fuse_dirents_t *buf); }; } mergerfs-2.42.0/src/fuse_readdir_seq_getdents.icpp0000644000000000000000000000477415177346257021011 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma message "using getdents" #include "dirinfo.hpp" #include "error.hpp" #include "fs_close.hpp" #include "fs_getdents64.hpp" #include "fs_inode.hpp" #include "fs_open.hpp" #include "hashset.hpp" #include "scope_guard/scope_guard.hpp" #include "fuse_dirents.hpp" #include "fuse_msgbuf.hpp" static int _readdir(const Branches::Ptr &branches_, const fs::path &rel_dirpath_, fuse_dirents_t *dirents_) { Err err; HashSet names; fs::path abs_dirpath; fuse_msgbuf_t *buf; fuse_dirents_reset(dirents_); buf = msgbuf_alloc(); if(not buf) return -ENOMEM; DEFER { msgbuf_free(buf); }; for(const auto &branch : *branches_) { int fd; fs::inode::ReaddirCalc inodecalc(branch.path,rel_dirpath_); abs_dirpath = branch.path / rel_dirpath_; fd = fs::open_dir_ro(abs_dirpath); err = fd; if(fd < 0) continue; DEFER{ fs::close(fd); }; while(true) { ssize_t nread; nread = fs::getdents64(fd,buf->mem,buf->size); if(nread <= 0) break; for(ssize_t pos = 0; pos < nread;) { int rv; int namelen; fs::dirent64 *d = reinterpret_cast(&buf->mem[pos]); pos += d->reclen; namelen = d->namelen(); rv = names.put(d->name,namelen); if(rv == 0) continue; d->ino = inodecalc.calc(d->name, namelen, DTTOIF(d->type), d->ino); fuse_dirents_add(dirents_,d,namelen); } } } return err; } mergerfs-2.42.0/src/fuse_readdir_seq_readdir.icpp0000644000000000000000000000457315177346257020603 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma message "using readdir" #include "fs_opendir.hpp" #include "fs_closedir.hpp" #include "fs_readdir.hpp" #include "error.hpp" #include "hashset.hpp" #include "scope_guard/scope_guard.hpp" #include "fs_inode.hpp" #include "dirinfo.hpp" #include "fuse_dirents.hpp" #include static uint64_t _dirent_exact_namelen(const struct dirent *d_) { #ifdef _D_EXACT_NAMLEN return _D_EXACT_NAMLEN(d_); #elif defined _DIRENT_HAVE_D_NAMLEN return d_->d_namlen; #else return strlen(d_->d_name); #endif } static int _readdir(const Branches::Ptr &branches_, const fs::path &rel_dirpath_, fuse_dirents_t *dirents_) { Err err; HashSet names; fs::path abs_dirpath; fuse_dirents_reset(dirents_); for(const auto &branch : *branches_) { DIR *dh; fs::inode::ReaddirCalc inodecalc(branch.path,rel_dirpath_); abs_dirpath = branch.path / rel_dirpath_; errno = 0; dh = fs::opendir(abs_dirpath); err = -errno; if(!dh) continue; DEFER{ fs::closedir(dh); }; for(dirent *de = fs::readdir(dh); de; de = fs::readdir(dh)) { int rv; int namelen; namelen = ::_dirent_exact_namelen(de); rv = names.put(de->d_name,namelen); if(rv == 0) continue; de->d_ino = inodecalc.calc(de->d_name, namelen, DTTOIF(de->d_type), de->d_ino); fuse_dirents_add(dirents_,de,namelen); } } return err; } mergerfs-2.42.0/src/fuse_readlink.cpp0000644000000000000000000000650715177346257016246 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fuse_readlink.hpp" #include "config.hpp" #include "errno.hpp" #include "fs_lstat.hpp" #include "fs_path.hpp" #include "fs_readlink.hpp" #include "symlinkify.hpp" #include "fuse.h" #include #include static ssize_t _readlink_core_symlinkify(const fs::path &fullpath_, char *buf_, const size_t bufsize_, const time_t symlinkify_timeout_) { ssize_t rv; struct stat st; std::string fullpath_str; fullpath_str = fullpath_.string(); rv = fs::lstat(fullpath_str,&st); if(rv < 0) return rv; if(!symlinkify::can_be_symlink(st,symlinkify_timeout_)) return fs::readlink(fullpath_,buf_,bufsize_); rv = std::min(fullpath_str.size(),bufsize_); memcpy(buf_,fullpath_str.c_str(),rv); return rv; } static ssize_t _readlink_core(const fs::path &basepath_, const fs::path &fusepath_, char *buf_, const size_t bufsize_, const bool symlinkify_, const time_t symlinkify_timeout_) { fs::path fullpath; fullpath = basepath_ / fusepath_; if(symlinkify_) return ::_readlink_core_symlinkify(fullpath,buf_,bufsize_,symlinkify_timeout_); return fs::readlink(fullpath,buf_,bufsize_); } static ssize_t _readlink(const Policy::Search &searchFunc_, const Branches::Ptr ibranches_, const fs::path &fusepath_, char *buf_, const size_t bufsize_, const bool symlinkify_, const time_t symlinkify_timeout_) { ssize_t rv; std::vector obranches; rv = searchFunc_(ibranches_,fusepath_,obranches); if(rv < 0) return rv; if(obranches.empty()) return -ENOENT; return ::_readlink_core(obranches[0]->path, fusepath_, buf_, bufsize_, symlinkify_, symlinkify_timeout_); } ssize_t FUSE::readlink(const fuse_req_ctx_t *ctx_, const char *fusepath_, char *buf_, size_t bufsize_) { if(bufsize_ == 0) return 0; const fs::path fusepath{fusepath_}; return ::_readlink(cfg.func.readlink.policy, cfg.branches, fusepath, buf_, bufsize_, cfg.symlinkify, cfg.symlinkify_timeout); } mergerfs-2.42.0/src/fuse_readlink.hpp0000644000000000000000000000203715177346257016245 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "fuse_req_ctx.h" #include namespace FUSE { ssize_t readlink(const fuse_req_ctx_t *ctx, const char *fusepath, char *buf, size_t size); } mergerfs-2.42.0/src/fuse_release.cpp0000644000000000000000000000731615177346257016074 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* RELEASE OF SHARED AND PER-HANDLE FILEINFO OBJECTS ================================================= The open_files map stores one canonical FileInfo per nodeid together with a ref_count and optional passthrough backing_id. Overlapping opens of the same file increment that ref_count but still allocate their own FileInfo objects with duplicated file descriptors for the individual FUSE handles. That means release() must handle two ownership cases: - the canonical FileInfo stored in open_files - a per-handle FileInfo that exists only in fuse_file_info_t.fh On non-final closes, secondary handle FileInfo objects are freed immediately after the ref_count decrement while the canonical map entry stays alive. On the final close, the map entry is erased atomically and cleanup happens after the erase_if() callback returns so close() and delete do not execute while the map bucket is locked. If the final handle is different from the canonical map-owned FileInfo, both objects must be released. */ #include "fuse_release.hpp" #include "state.hpp" #include "config.hpp" #include "fileinfo.hpp" #include "fs_close.hpp" #include "fs_fadvise.hpp" #include "fuse_passthrough.hpp" #include "fuse.h" static int _release(cu64 nodeid_, FileInfo *fi_, const bool dropcacheonclose_) { // The double fadvise is necessary insofar as according to nocache // author (https://github.com/Feh/nocache#limitations) the first one // doesn't always work due to timing issues. if(dropcacheonclose_) { fs::fadvise_dontneed(fi_->fd); fs::fadvise_dontneed(fi_->fd); } FUSE::release(nodeid_,fi_); return 0; } void FUSE::release(cu64 nodeid_, FileInfo * const fi_) { auto &of = state.open_files; int backing_id = INVALID_BACKING_ID; FileInfo *canonical_fi = nullptr; FileInfo *fh_fi_to_free = nullptr; of.erase_if(nodeid_, [&](auto &v_) { v_.second.ref_count--; if(v_.second.ref_count > 0) { if(fi_ != v_.second.fi) fh_fi_to_free = fi_; return false; } canonical_fi = v_.second.fi; backing_id = v_.second.backing_id; if(fi_ != canonical_fi) fh_fi_to_free = fi_; return true; }); FUSE::passthrough_close(backing_id); if(fh_fi_to_free) { fs::close(fh_fi_to_free->fd); delete fh_fi_to_free; } if(canonical_fi) { fs::close(canonical_fi->fd); delete canonical_fi; } } int FUSE::release(const fuse_req_ctx_t *ctx_, const fuse_file_info_t *ffi_) { FileInfo *fi = FileInfo::from_fh(ffi_->fh); if(not fi) return -EBADF; return ::_release(ctx_->nodeid, fi, cfg.dropcacheonclose); } mergerfs-2.42.0/src/fuse_release.hpp0000644000000000000000000000403715177346257016076 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* FUSE RELEASE INTERFACE ====================== This header defines the two release() function overloads used for closing open files. There are two variants because release can be initiated from different contexts: 1. release(ctx, ffi) - Standard FUSE release callback Called by libfuse when a file is closed. Extracts the FileInfo from the fuse_file_info_t handle and calls the internal release function. 2. release(nodeid, fi) - Internal release function Called internally when we need to release a file that failed to open properly (e.g., in fuse_open.cpp when _open_fd fails after finding an existing open). This allows the same cleanup logic to be used for both normal closes and error cleanup. The two-phase cleanup mechanism is implemented in fuse_release.cpp. See that file for detailed documentation on the reference counting and canonical vs per-handle ownership rules. See commit 446e9a7b for the complete rationale behind this design. */ #pragma once #include "base_types.h" #include "fuse.h" class FileInfo; namespace FUSE { int release(const fuse_req_ctx_t *ctx_, const fuse_file_info_t *ffi_); void release(cu64 nodeid, FileInfo * const fi = nullptr); } mergerfs-2.42.0/src/fuse_releasedir.cpp0000644000000000000000000000223315177346257016564 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fuse_releasedir.hpp" #include "config.hpp" #include "dirinfo.hpp" #include "fuse.h" static int _releasedir(DirInfo *di_) { delete di_; return 0; } int FUSE::releasedir(const fuse_req_ctx_t *ctx_, const fuse_file_info_t *ffi_) { DirInfo *di = DirInfo::from_fh(ffi_->fh); if(not di) return -EBADF; return ::_releasedir(di); } mergerfs-2.42.0/src/fuse_releasedir.hpp0000644000000000000000000000166415177346257016600 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "fuse.h" namespace FUSE { int releasedir(const fuse_req_ctx_t *ctx, const fuse_file_info_t *ffi); } mergerfs-2.42.0/src/fuse_removemapping.cpp0000644000000000000000000000164515177346257017324 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fuse_removemapping.hpp" #include int FUSE::removemapping(const fuse_req_ctx_t *ctx) { return -ENOSYS; } mergerfs-2.42.0/src/fuse_removemapping.hpp0000644000000000000000000000161115177346257017322 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "fuse.h" namespace FUSE { int removemapping(const fuse_req_ctx_t *ctx); } mergerfs-2.42.0/src/fuse_removexattr.cpp0000644000000000000000000000571115177346257017031 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fuse_removexattr.hpp" #include "config.hpp" #include "errno.hpp" #include "fs_lremovexattr.hpp" #include "fs_path.hpp" #include "policy_rv.hpp" #include "fuse.h" #include static void _removexattr_loop_core(const fs::path &basepath_, const fs::path &fusepath_, const char *attrname_, PolicyRV *prv_) { int rv; fs::path fullpath; fullpath = basepath_ / fusepath_; rv = fs::lremovexattr(fullpath,attrname_); prv_->insert(rv,basepath_); } static void _removexattr_loop(const std::vector &branches_, const fs::path &fusepath_, const char *attrname_, PolicyRV *prv_) { for(auto &branch : branches_) { ::_removexattr_loop_core(branch->path,fusepath_,attrname_,prv_); } } static int _removexattr(const Policy::Action &actionFunc_, const Policy::Search &searchFunc_, const Branches::Ptr ibranches_, const fs::path &fusepath_, const char *attrname_) { int rv; PolicyRV prv; std::vector obranches; rv = actionFunc_(ibranches_,fusepath_,obranches); if(rv < 0) return rv; if(obranches.empty()) return -ENOENT; ::_removexattr_loop(obranches,fusepath_,attrname_,&prv); if(prv.errors.empty()) return 0; if(prv.successes.empty()) return prv.errors[0].rv; obranches.clear(); rv = searchFunc_(ibranches_,fusepath_,obranches); if(rv < 0) return rv; if(obranches.empty()) return -ENOENT; return prv.get_error(obranches[0]->path); } int FUSE::removexattr(const fuse_req_ctx_t *ctx_, const char *fusepath_, const char *attrname_) { const fs::path fusepath{fusepath_}; if(Config::is_ctrl_file(fusepath)) return -ENOATTR; if(cfg.xattr.to_int()) return -cfg.xattr.to_int(); return ::_removexattr(cfg.func.removexattr.policy, cfg.func.getxattr.policy, cfg.branches, fusepath, attrname_); } mergerfs-2.42.0/src/fuse_removexattr.hpp0000644000000000000000000000175515177346257017042 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "fuse_req_ctx.h" namespace FUSE { int removexattr(const fuse_req_ctx_t *ctx, const char *fusepath, const char *attrname); } mergerfs-2.42.0/src/fuse_rename.cpp0000644000000000000000000002213415177346257015716 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fuse_rename.hpp" #include "config.hpp" #include "error.hpp" #include "errno.hpp" #include "fs_clonepath.hpp" #include "fs_link.hpp" #include "fs_mkdir_as.hpp" #include "fs_path.hpp" #include "fs_remove.hpp" #include "fs_rename.hpp" #include "fs_symlink.hpp" #include "fs_unlink.hpp" #include "fuse_symlink.hpp" #include #include #include #include static bool _contains(const std::vector &haystack_, const char *needle_) { for(auto &hay : haystack_) { if(hay->path == needle_) return true; } return false; } static bool _contains(const std::vector &haystack_, const std::string &needle_) { return ::_contains(haystack_,needle_.c_str()); } static void _remove(const StrVec &toremove_) { for(auto &path : toremove_) fs::remove(path); } static int _rename_create_path(const Policy::Search &searchPolicy_, const Policy::Action &actionPolicy_, const Branches::Ptr branches_, const fs::path &oldfusepath_, const fs::path &newfusepath_) { int rv; Err err; StrVec toremove; std::vector newbranches; std::vector oldbranches; fs::path oldfullpath; fs::path newfullpath; rv = actionPolicy_(branches_,oldfusepath_,oldbranches); if(rv < 0) return rv; if(oldbranches.empty()) return -ENOENT; rv = searchPolicy_(branches_,newfusepath_.parent_path(),newbranches); if(rv < 0) return rv; if(newbranches.empty()) return -ENOENT; for(auto &branch : *branches_) { newfullpath = branch.path / newfusepath_; if(!::_contains(oldbranches,branch.path)) { toremove.push_back(newfullpath); continue; } oldfullpath = branch.path / oldfusepath_; rv = fs::rename(oldfullpath,newfullpath); if(rv < 0) { rv = fs::clonepath(newbranches[0]->path, branch.path, newfusepath_.parent_path()); if(rv >= 0) rv = fs::rename(oldfullpath,newfullpath); } err = rv; if(rv < 0) toremove.push_back(oldfullpath); } if(err == 0) ::_remove(toremove); return err; } static int _rename_preserve_path(const Policy::Action &actionPolicy_, const Branches::Ptr branches_, const fs::path &oldfusepath_, const fs::path &newfusepath_) { int rv; bool success; StrVec toremove; std::vector oldbranches; fs::path oldfullpath; fs::path newfullpath; rv = actionPolicy_(branches_,oldfusepath_,oldbranches); if(rv < 0) return rv; success = false; for(auto &branch : *branches_) { newfullpath = branch.path / newfusepath_; if(!::_contains(oldbranches,branch.path)) { toremove.push_back(newfullpath); continue; } oldfullpath = branch.path / oldfusepath_; rv = fs::rename(oldfullpath,newfullpath); if(rv < 0) { toremove.push_back(oldfullpath); continue; } success = true; } // TODO: probably should try to be nuanced here. if(success == false) return -EXDEV; ::_remove(toremove); return 0; } static void _rename_exdev_rename_back(const std::vector &branches_, const fs::path &oldfusepath_) { fs::path oldpath; fs::path newpath; for(auto &branch : branches_) { oldpath = branch->path; oldpath /= ".mergerfs_rename_exdev"; oldpath /= oldfusepath_; newpath = branch->path; newpath /= oldfusepath_; fs::rename(oldpath,newpath); } } static int _rename_exdev_rename_target(const Policy::Action &actionPolicy_, const Branches::Ptr ibranches_, const fs::path &oldfusepath_, std::vector &obranches_) { int rv; fs::path clonesrc; fs::path clonedst; rv = actionPolicy_(ibranches_,oldfusepath_,obranches_); if(rv < 0) return rv; for(auto &branch : obranches_) { clonesrc = branch->path; clonedst = branch->path; clonedst /= ".mergerfs_rename_exdev"; rv = fs::clonepath(clonesrc,clonedst,oldfusepath_.parent_path()); if(rv == -ENOENT) { fs::mkdir_as({0,0},clonedst,01777); rv = fs::clonepath(clonesrc,clonedst,oldfusepath_.parent_path()); } if(rv < 0) goto error; clonesrc /= oldfusepath_; clonedst /= oldfusepath_; rv = fs::rename(clonesrc,clonedst); if(rv < 0) goto error; } return 0; error: ::_rename_exdev_rename_back(obranches_,oldfusepath_); return -EXDEV; } static int _rename_exdev_rel_symlink(const fuse_req_ctx_t *ctx_, const Policy::Action &actionPolicy_, const Branches::Ptr branches_, const fs::path &oldfusepath_, const fs::path &newfusepath_) { int rv; fs::path target; fs::path linkpath; std::vector branches; rv = ::_rename_exdev_rename_target(actionPolicy_,branches_,oldfusepath_,branches); if(rv < 0) return rv; linkpath = newfusepath_; target = "/.mergerfs_rename_exdev"; target /= oldfusepath_; target = target.lexically_relative(linkpath.parent_path()); rv = FUSE::symlink(ctx_,target.c_str(),linkpath); if(rv < 0) ::_rename_exdev_rename_back(branches,oldfusepath_); return rv; } static int _rename_exdev_abs_symlink(const fuse_req_ctx_t *ctx_, const Policy::Action &actionPolicy_, const Branches::Ptr branches_, const fs::path &mount_, const fs::path &oldfusepath_, const fs::path &newfusepath_) { int rv; fs::path target; fs::path linkpath; std::vector branches; rv = ::_rename_exdev_rename_target(actionPolicy_,branches_,oldfusepath_,branches); if(rv < 0) return rv; linkpath = newfusepath_; target = mount_; target /= ".mergerfs_rename_exdev"; target /= oldfusepath_; rv = FUSE::symlink(ctx_,target.c_str(),linkpath); if(rv < 0) ::_rename_exdev_rename_back(branches,oldfusepath_); return rv; } static int _rename_exdev(const fuse_req_ctx_t *ctx_, const fs::path &oldfusepath_, const fs::path &newfusepath_) { switch(cfg.rename_exdev) { case RenameEXDEV::ENUM::PASSTHROUGH: return -EXDEV; case RenameEXDEV::ENUM::REL_SYMLINK: return ::_rename_exdev_rel_symlink(ctx_, cfg.func.rename.policy, cfg.branches, oldfusepath_, newfusepath_); case RenameEXDEV::ENUM::ABS_SYMLINK: return ::_rename_exdev_abs_symlink(ctx_, cfg.func.rename.policy, cfg.branches, cfg.mountpoint, oldfusepath_, newfusepath_); } return -EXDEV; } static int _rename(const fs::path &oldpath_, const fs::path &newpath_) { if(cfg.func.create.policy.path_preserving() && !cfg.ignorepponrename) return ::_rename_preserve_path(cfg.func.rename.policy, cfg.branches, oldpath_, newpath_); return ::_rename_create_path(cfg.func.getattr.policy, cfg.func.rename.policy, cfg.branches, oldpath_, newpath_); } int FUSE::rename(const fuse_req_ctx_t *ctx_, const char *oldfusepath_, const char *newfusepath_) { int rv; const fs::path oldfusepath{oldfusepath_}; const fs::path newfusepath{newfusepath_}; rv = ::_rename(oldfusepath,newfusepath); if(rv == -EXDEV) return ::_rename_exdev(ctx_,oldfusepath,newfusepath); return rv; } mergerfs-2.42.0/src/fuse_rename.hpp0000644000000000000000000000172415177346257015725 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "fuse_req_ctx.h" namespace FUSE { int rename(const fuse_req_ctx_t *ctx, const char *from, const char *to); } mergerfs-2.42.0/src/fuse_rmdir.cpp0000644000000000000000000000656315177346257015574 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fuse_rmdir.hpp" #include "config.hpp" #include "errno.hpp" #include "fs_path.hpp" #include "fs_rmdir.hpp" #include "fs_unlink.hpp" #include "fuse.h" #include #include // 1. First error sets the initial value // 2. If we get -EEXIST or -ENOTEMPTY, it takes priority (overwrites anything) // 3. If we already have -EEXIST or -ENOTEMPTY, keep them (don't overwrite) // 4. Success (>= 0) only sets to 0 if we don't have a priority error // 5. Any other error only overwrites if we don't have a priority error struct RmdirErr { private: std::optional _err; public: RmdirErr() { } operator int() { return (_err.has_value() ? _err.value() : -ENOENT); } RmdirErr& operator=(int v_) { if(!_err.has_value()) _err = ((v_ >= 0) ? 0 : v_); else if((v_ == -EEXIST) || (v_ == -ENOTEMPTY)) _err = v_; else if((*_err == -EEXIST) || (*_err == -ENOTEMPTY)) ; else if(v_ >= 0) _err = 0; else _err = v_; return *this; } bool operator==(int v_) { if(_err.has_value()) return (_err.value() == v_); return false; } }; static int _should_unlink(int rv_, FollowSymlinks followsymlinks_) { return ((rv_ == -ENOTDIR) && (followsymlinks_ != FollowSymlinks::ENUM::NEVER)); } static int _rmdir_core(const fs::path &basepath_, const fs::path &fusepath_, const FollowSymlinks followsymlinks_) { int rv; fs::path fullpath; fullpath = basepath_ / fusepath_; rv = fs::rmdir(fullpath); if(::_should_unlink(rv,followsymlinks_)) rv = fs::unlink(fullpath); return rv; } static int _rmdir_loop(const std::vector &branches_, const fs::path &fusepath_, const FollowSymlinks followsymlinks_) { RmdirErr err; for(const auto &branch : branches_) { err = ::_rmdir_core(branch->path,fusepath_,followsymlinks_); } return err; } static int _rmdir(const Policy::Action &actionFunc_, const Branches::Ptr branches_, const FollowSymlinks followsymlinks_, const fs::path &fusepath_) { int rv; std::vector branches; rv = actionFunc_(branches_,fusepath_,branches); if(rv < 0) return rv; return ::_rmdir_loop(branches,fusepath_,followsymlinks_); } int FUSE::rmdir(const fuse_req_ctx_t *ctx_, const char *fusepath_) { const fs::path fusepath{fusepath_}; return ::_rmdir(cfg.func.rmdir.policy, cfg.branches, cfg.follow_symlinks, fusepath); } mergerfs-2.42.0/src/fuse_rmdir.hpp0000644000000000000000000000166315177346257015575 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "fuse_req_ctx.h" namespace FUSE { int rmdir(const fuse_req_ctx_t *ctx, const char *fusepath); } mergerfs-2.42.0/src/fuse_setupmapping.cpp0000644000000000000000000000226715177346257017170 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fuse_setupmapping.hpp" #include #include ssize_t FUSE::setupmapping(const fuse_req_ctx_t *ctx_, u64 *fh_, cu64 foffset_, cu64 len_, cu64 flags_, cu64 moffset_) { return -ENOSYS; } mergerfs-2.42.0/src/fuse_setupmapping.hpp0000644000000000000000000000226015177346257017166 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "base_types.h" #include "fuse.h" namespace FUSE { ssize_t setupmapping(const fuse_req_ctx_t *ctx, u64 *fh_, cu64 foffset_, cu64 len_, cu64 flags_, cu64 moffset_); } mergerfs-2.42.0/src/fuse_setxattr.cpp0000644000000000000000000001373115177346257016330 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fuse_setxattr.hpp" #include "config.hpp" #include "errno.hpp" #include "fs_glob.hpp" #include "fs_lsetxattr.hpp" #include "fs_path.hpp" #include "fs_statvfs_cache.hpp" #include "num.hpp" #include "policy_rv.hpp" #include "str.hpp" #include "syslog.hpp" #include "fuse.h" #include #include #include static const char SECURITY_CAPABILITY[] = "security.capability"; static int _setxattr_cmd_xattr(const std::string_view &attrname_, const std::string_view &attrval_) { std::string_view cmd; cmd = Config::prune_cmd_xattr(attrname_); SysLog::info("command requested: {}={}",cmd,attrval_); if(cmd == "gc") return (fuse_gc(),0); if(cmd == "gc1") return (fuse_gc1(),0); if(cmd == "invalidate-all-nodes") return (fuse_invalidate_all_nodes(),0); return -ENOATTR; } static bool _is_attrname_security_capability(const char *attrname_) { return str::eq(attrname_,SECURITY_CAPABILITY); } static int _setxattr_ctrl_file(const char *attrname_, const char *attrval_, size_t attrvalsize_, const int flags_) { int rv; std::string key; if(!Config::is_mergerfs_xattr(attrname_)) return -ENOATTR; if(Config::is_cmd_xattr(attrname_)) return ::_setxattr_cmd_xattr(attrname_, std::string_view{attrval_,attrvalsize_}); key = Config::prune_ctrl_xattr(attrname_); if(cfg.has_key(key) == false) return -ENOATTR; if((flags_ & XATTR_CREATE) == XATTR_CREATE) return -EEXIST; rv = cfg.set(key,std::string{attrval_,attrvalsize_}); if(rv < 0) return rv; fs::statvfs_cache_timeout(cfg.cache_statfs); return rv; } static void _setxattr_loop_core(const fs::path &basepath_, const fs::path &fusepath_, const char *attrname_, const char *attrval_, const size_t attrvalsize_, const int flags_, PolicyRV *prv_) { int rv; fs::path fullpath; fullpath = basepath_ / fusepath_; rv = fs::lsetxattr(fullpath,attrname_,attrval_,attrvalsize_,flags_); prv_->insert(rv,basepath_); } static void _setxattr_loop(const std::vector &branches_, const fs::path &fusepath_, const char *attrname_, const char *attrval_, const size_t attrvalsize_, const int flags_, PolicyRV *prv_) { for(auto &branch : branches_) { ::_setxattr_loop_core(branch->path, fusepath_, attrname_, attrval_,attrvalsize_, flags_, prv_); } } static int _setxattr(const Policy::Action &setxattrPolicy_, const Policy::Search &getxattrPolicy_, const Branches::Ptr branches_, const fs::path &fusepath_, const char *attrname_, const char *attrval_, const size_t attrvalsize_, const int flags_) { int rv; PolicyRV prv; std::vector branches; rv = setxattrPolicy_(branches_,fusepath_,branches); if(rv < 0) return rv; if(branches.empty()) return -ENOENT; ::_setxattr_loop(branches,fusepath_,attrname_,attrval_,attrvalsize_,flags_,&prv); if(prv.errors.empty()) return 0; if(prv.successes.empty()) return prv.errors[0].rv; branches.clear(); rv = getxattrPolicy_(branches_,fusepath_,branches); if(rv < 0) return rv; if(branches.empty()) return -ENOENT; return prv.get_error(branches[0]->path); } static int _setxattr(const fuse_req_ctx_t *ctx_, const fs::path &fusepath_, const char *attrname_, const char *attrval_, size_t attrvalsize_, int flags_) { if((cfg.security_capability == false) && ::_is_attrname_security_capability(attrname_)) return -ENOATTR; if(cfg.xattr.to_int()) return -cfg.xattr.to_int(); return ::_setxattr(cfg.func.setxattr.policy, cfg.func.getxattr.policy, cfg.branches, fusepath_, attrname_, attrval_, attrvalsize_, flags_); } int FUSE::setxattr(const fuse_req_ctx_t *ctx_, const char *fusepath_, const char *attrname_, const char *attrval_, size_t attrvalsize_, int flags_) { const fs::path fusepath{fusepath_}; if(Config::is_ctrl_file(fusepath)) return ::_setxattr_ctrl_file(attrname_, attrval_, attrvalsize_, flags_); return ::_setxattr(ctx_, fusepath, attrname_, attrval_, attrvalsize_, flags_); } mergerfs-2.42.0/src/fuse_setxattr.hpp0000644000000000000000000000216715177346257016336 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include #include "fuse_req_ctx.h" namespace FUSE { int setxattr(const fuse_req_ctx_t *ctx, const char *fusepath, const char *attrname, const char *attrval, size_t attrvalize, int flags); } mergerfs-2.42.0/src/fuse_statfs.cpp0000644000000000000000000001074415177346257015757 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fuse_statfs.hpp" #include "config.hpp" #include "errno.hpp" #include "fs_lstat.hpp" #include "fs_path.hpp" #include "fs_lstatvfs.hpp" #include "statvfs_util.hpp" #include "fuse.h" #include #include #include #include #include static void _normalize_statvfs(struct statvfs *fsstat_, const unsigned long min_bsize_, const unsigned long min_frsize_, const unsigned long min_namemax_) { long double scale; scale = (((long double)fsstat_->f_frsize) / ((long double)min_frsize_)); fsstat_->f_blocks = (fsblkcnt_t)(fsstat_->f_blocks * scale); fsstat_->f_bfree = (fsblkcnt_t)(fsstat_->f_bfree * scale); fsstat_->f_bavail = (fsblkcnt_t)(fsstat_->f_bavail * scale); fsstat_->f_bsize = min_bsize_; fsstat_->f_frsize = min_frsize_; fsstat_->f_namemax = min_namemax_; } static void _merge_statvfs(struct statvfs * const out_, const struct statvfs * const in_) { out_->f_blocks += in_->f_blocks; out_->f_bfree += in_->f_bfree; out_->f_bavail += in_->f_bavail; out_->f_files += in_->f_files; out_->f_ffree += in_->f_ffree; out_->f_favail += in_->f_favail; } static bool _should_ignore(const StatFSIgnore ignore_, const Branch &branch_, const bool readonly_) { return ((((ignore_ == StatFSIgnore::ENUM::RO) || readonly_) && (branch_.ro_or_nc())) || ((ignore_ == StatFSIgnore::ENUM::NC) && (branch_.nc()))); } static int _statfs(const Branches::Ptr branches_, const fs::path &fusepath_, const StatFS mode_, const StatFSIgnore ignore_, struct statvfs *fsstat_) { int rv; struct stat st; struct statvfs stvfs; unsigned long min_bsize; unsigned long min_frsize; unsigned long min_namemax; std::map fsstats; fs::path fullpath; min_bsize = std::numeric_limits::max(); min_frsize = std::numeric_limits::max(); min_namemax = std::numeric_limits::max(); for(const auto &branch : *branches_) { if(mode_ == StatFS::ENUM::FULL) fullpath = branch.path / fusepath_; else fullpath = branch.path; rv = fs::lstat(fullpath,&st); if(rv < 0) continue; rv = fs::lstatvfs(fullpath,&stvfs); if(rv < 0) continue; if(stvfs.f_bsize && (min_bsize > stvfs.f_bsize)) min_bsize = stvfs.f_bsize; if(stvfs.f_frsize && (min_frsize > stvfs.f_frsize)) min_frsize = stvfs.f_frsize; if(stvfs.f_namemax && (min_namemax > stvfs.f_namemax)) min_namemax = stvfs.f_namemax; if(::_should_ignore(ignore_,branch,StatVFS::readonly(stvfs))) { stvfs.f_bavail = 0; stvfs.f_favail = 0; } fsstats.insert(std::make_pair(st.st_dev,stvfs)); } std::map::iterator iter = fsstats.begin(); std::map::iterator enditer = fsstats.end(); if(iter != enditer) { *fsstat_ = iter->second; ::_normalize_statvfs(fsstat_,min_bsize,min_frsize,min_namemax); for(++iter; iter != enditer; ++iter) { ::_normalize_statvfs(&iter->second,min_bsize,min_frsize,min_namemax); ::_merge_statvfs(fsstat_,&iter->second); } } return 0; } int FUSE::statfs(const fuse_req_ctx_t *ctx_, const char *fusepath_, struct statvfs *st_) { const fs::path fusepath{fusepath_}; return ::_statfs(cfg.branches, fusepath, cfg.statfs, cfg.statfs_ignore, st_); } mergerfs-2.42.0/src/fuse_statfs.hpp0000644000000000000000000000176615177346257015770 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "fuse_req_ctx.h" #include namespace FUSE { int statfs(const fuse_req_ctx_t *ctx, const char *fusepath, struct statvfs *fsstat); } mergerfs-2.42.0/src/fuse_statx.cpp0000644000000000000000000000200115177346257015601 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fs_statx.hpp" #ifdef MERGERFS_SUPPORTED_STATX #pragma message "statx supported" # include "fuse_statx_supported.icpp" #else #pragma message "statx NOT supported" # include "fuse_statx_unsupported.icpp" #endif mergerfs-2.42.0/src/fuse_statx.hpp0000644000000000000000000000260715177346257015622 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "base_types.h" #include "fuse.h" #include "fuse_kernel.h" namespace FUSE { int statx(const fuse_req_ctx_t *ctx, const char *fusepath, cu32 flags, cu32 mask, struct fuse_statx *st, fuse_timeouts_t *timeout); int statx_fh(const fuse_req_ctx_t *ctx, cu64 fh, cu32 flags, cu32 mask, struct fuse_statx *st, fuse_timeouts_t *timeout); } mergerfs-2.42.0/src/fuse_statx_supported.icpp0000644000000000000000000001521115177346257020066 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fuse_statx.hpp" #include "config.hpp" #include "errno.hpp" #include "fileinfo.hpp" #include "fs_inode.hpp" #include "fs_path.hpp" #include "fs_statx.hpp" #include "state.hpp" #include "str.hpp" #include "symlinkify.hpp" #include "ugid.hpp" #include "fmt/core.h" #include "fuse.h" #include static void _set_stat_if_leads_to_dir(const fs::path &path_, struct fuse_statx *st_) { int rv; struct fuse_statx st; rv = fs::statx(AT_FDCWD,path_,AT_SYMLINK_FOLLOW,STATX_TYPE,&st); if(rv < 0) return; if(S_ISDIR(st.mode)) *st_ = st; return; } static void _set_stat_if_leads_to_reg(const fs::path &path_, struct fuse_statx *st_) { int rv; struct fuse_statx st; rv = fs::statx(AT_FDCWD,path_,AT_SYMLINK_FOLLOW,STATX_TYPE,&st); if(rv < 0) return; if(S_ISREG(st.mode)) *st_ = st; return; } static int _statx_fake_root(struct fuse_statx *st_, fuse_timeouts_t *timeout_) { st_->ino = 0; st_->mode = (S_IFDIR|S_IRWXU|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH); st_->nlink = 2; st_->uid = 0; st_->gid = 0; st_->size = 0; st_->blocks = 0; st_->atime.tv_sec = 0; st_->mtime.tv_sec = 0; st_->ctime.tv_sec = 0; timeout_->entry = cfg.cache_entry; timeout_->attr = cfg.cache_attr; return 0; } static int _statx_controlfile(struct fuse_statx *st_, fuse_timeouts_t *timeout_) { static const uid_t uid = ::getuid(); static const gid_t gid = ::getgid(); static const time_t now = ::time(NULL); st_->ino = 0; st_->mode = (S_IFREG|S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH); st_->nlink = 1; st_->uid = uid; st_->gid = gid; st_->size = 0; st_->blocks = 0; st_->atime.tv_sec = now; st_->mtime.tv_sec = now; st_->ctime.tv_sec = now; timeout_->entry = cfg.cache_entry; timeout_->attr = cfg.cache_attr; return 0; } static int _statx(const Policy::Search &searchFunc_, const Branches::Ptr branches_, const fs::path &fusepath_, const uint32_t flags_, const uint32_t mask_, struct fuse_statx *st_, const bool symlinkify_, const time_t symlinkify_timeout_, FollowSymlinks followsymlinks_) { int rv; fs::path fullpath; std::vector branches; rv = searchFunc_(branches_,fusepath_,branches); if(rv < 0) return rv; if(branches.empty()) return -ENOENT; fullpath = branches[0]->path / fusepath_; switch(followsymlinks_) { case FollowSymlinks::ENUM::NEVER: rv = fs::statx(AT_FDCWD,fullpath,flags_|AT_SYMLINK_NOFOLLOW,mask_,st_); break; case FollowSymlinks::ENUM::DIRECTORY: rv = fs::statx(AT_FDCWD,fullpath,flags_|AT_SYMLINK_NOFOLLOW,mask_,st_); if((rv >= 0) && S_ISLNK(st_->mode)) ::_set_stat_if_leads_to_dir(fullpath,st_); break; case FollowSymlinks::ENUM::REGULAR: rv = fs::statx(AT_FDCWD,fullpath,flags_|AT_SYMLINK_NOFOLLOW,mask_,st_); if((rv >= 0) && S_ISLNK(st_->mode)) ::_set_stat_if_leads_to_reg(fullpath,st_); break; case FollowSymlinks::ENUM::ALL: rv = fs::statx(AT_FDCWD,fullpath,flags_|AT_SYMLINK_FOLLOW,mask_,st_); if(rv < 0) rv = fs::statx(AT_FDCWD,fullpath,flags_|AT_SYMLINK_NOFOLLOW,mask_,st_); break; } if(rv < 0) return rv; if(symlinkify_ && symlinkify::can_be_symlink(*st_,symlinkify_timeout_)) symlinkify::convert(fullpath,st_); fs::inode::calc(branches[0]->path, fusepath_, st_); return 0; } static int _statx(const fs::path &fusepath_, const uint32_t flags_, const uint32_t mask_, struct fuse_statx *st_, fuse_timeouts_t *timeout_) { int rv; rv = ::_statx(cfg.func.getattr.policy, cfg.branches, fusepath_, flags_, mask_, st_, cfg.symlinkify, cfg.symlinkify_timeout, cfg.follow_symlinks); if((rv < 0) && Config::is_rootdir(fusepath_)) return ::_statx_fake_root(st_,timeout_); timeout_->entry = ((rv >= 0) ? cfg.cache_entry : cfg.cache_negative_entry); timeout_->attr = cfg.cache_attr; return rv; } static int _statx(const FileInfo *fi_, const uint32_t flags_, const uint32_t mask_, struct fuse_statx *st_) { int rv; rv = fs::statx(fi_->fd, "", flags_|AT_EMPTY_PATH, mask_, st_); if(rv < 0) return rv; fs::inode::calc(fi_->branch.path, fi_->fusepath, st_); return rv; } int FUSE::statx(const fuse_req_ctx_t *ctx_, const char *fusepath_, const uint32_t flags_, const uint32_t mask_, struct fuse_statx *st_, fuse_timeouts_t *timeout_) { const fs::path fusepath{fusepath_}; if(Config::is_ctrl_file(fusepath)) return ::_statx_controlfile(st_,timeout_); return ::_statx(fusepath, flags_|AT_STATX_DONT_SYNC, mask_, st_, timeout_); } int FUSE::statx_fh(const fuse_req_ctx_t *ctx_, const uint64_t fh_, const uint32_t flags_, const uint32_t mask_, struct fuse_statx *st_, fuse_timeouts_t *timeout_) { int rv; FileInfo *fi; fi = state.get_fi(ctx_,fh_); if(not fi) return -EBADF; rv = ::_statx(fi, flags_|AT_STATX_DONT_SYNC, mask_, st_); timeout_->entry = ((rv >= 0) ? cfg.cache_entry : cfg.cache_negative_entry); timeout_->attr = cfg.cache_attr; return rv; } mergerfs-2.42.0/src/fuse_statx_unsupported.icpp0000644000000000000000000000256715177346257020443 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fuse_statx.hpp" int FUSE::statx(const fuse_req_ctx_t *ctx_, const char *fusepath_, const uint32_t flags_, const uint32_t mask_, struct fuse_statx *st_, fuse_timeouts_t *timeout_) { return -ENOSYS; } int FUSE::statx_fh(const fuse_req_ctx_t *ctx_, const uint64_t fh_, const uint32_t flags_, const uint32_t mask_, struct fuse_statx *st_, fuse_timeouts_t *timeout_) { return -ENOSYS; } mergerfs-2.42.0/src/fuse_symlink.cpp0000644000000000000000000001221215177346257016131 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fuse_symlink.hpp" #include "config.hpp" #include "errno.hpp" #include "error.hpp" #include "fs_clonepath.hpp" #include "fs_lstat.hpp" #include "fs_path.hpp" #include "fs_inode.hpp" #include "fs_symlink_as.hpp" #include "fuse_getattr.hpp" #include "ugid.hpp" #include "fuse.h" #include #include static int _symlink_loop_core(const ugid_t ugid_, const fs::path &newbranch_, const char *target_, const fs::path &linkpath_, struct stat *st_) { int rv; fs::path fullnewpath; fullnewpath = newbranch_ / linkpath_; rv = fs::symlink_as(ugid_,target_,fullnewpath); if((rv >= 0) && (st_ != NULL) && (st_->st_ino == 0)) { fs::lstat(fullnewpath,st_); if(st_->st_ino != 0) fs::inode::calc(newbranch_, linkpath_, st_); } return rv; } static int _symlink_loop(const ugid_t ugid_, const fs::path &existingbranch_, const std::vector &newbranches_, const char *target_, const fs::path &linkpath_, const fs::path &newdirpath_, struct stat *st_) { int rv; Err err; for(auto &newbranch :newbranches_) { rv = fs::clonepath(existingbranch_, newbranch->path, newdirpath_); if(rv < 0) err = rv; else err = ::_symlink_loop_core(ugid_, newbranch->path, target_, linkpath_, st_); } return err; } static int _symlink(const ugid_t ugid_, const Policy::Search &searchFunc_, const Policy::Create &createFunc_, const Branches::Ptr branches_, const char *target_, const fs::path &linkpath_, struct stat *st_) { int rv; fs::path newdirpath; std::vector newbranches; std::vector existingbranches; newdirpath = linkpath_.parent_path(); rv = searchFunc_(branches_,newdirpath,existingbranches); if(rv < 0) return rv; if(existingbranches.empty()) return -ENOENT; rv = createFunc_(branches_,newdirpath,newbranches); if(rv < 0) return rv; if(newbranches.empty()) return -ENOENT; return ::_symlink_loop(ugid_, existingbranches[0]->path, newbranches, target_, linkpath_, newdirpath, st_); } int FUSE::symlink(const fuse_req_ctx_t *ctx_, const char *target_, const fs::path &linkpath_, struct stat *st_, fuse_timeouts_t *timeouts_) { int rv; rv = ::_symlink(ctx_, cfg.func.getattr.policy, cfg.func.symlink.policy, cfg.branches, target_, linkpath_, st_); if(rv == -EROFS) { cfg.branches.find_and_set_mode_ro(); rv = ::_symlink(ctx_, cfg.func.getattr.policy, cfg.func.symlink.policy, cfg.branches, target_, linkpath_, st_); } if(timeouts_ != NULL) { switch(cfg.follow_symlinks) { case FollowSymlinks::ENUM::NEVER: timeouts_->entry = ((rv >= 0) ? cfg.cache_entry : cfg.cache_negative_entry); timeouts_->attr = cfg.cache_attr; break; default: timeouts_->entry = 0; timeouts_->attr = 0; break; } } return rv; } int FUSE::symlink(const fuse_req_ctx_t *ctx_, const char *target_, const char *linkpath_, struct stat *st_, fuse_timeouts_t *timeouts_) { const fs::path linkpath{linkpath_}; return FUSE::symlink(ctx_, target_, linkpath, st_, timeouts_); } mergerfs-2.42.0/src/fuse_symlink.hpp0000644000000000000000000000253315177346257016143 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "fuse.h" #include "fs_path.hpp" #include #include namespace FUSE { int symlink(const fuse_req_ctx_t *ctx, const char *target, const char *linkpath, struct stat *st = NULL, fuse_timeouts_t *timeouts = NULL); int symlink(const fuse_req_ctx_t *ctx, const char *target, const fs::path &linkpath, struct stat *st = NULL, fuse_timeouts_t *timeouts = NULL); } mergerfs-2.42.0/src/fuse_syncfs.cpp0000644000000000000000000000163015177346257015752 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fuse_syncfs.hpp" #include int FUSE::syncfs(const fuse_req_ctx_t *ctx_) { return -ENOSYS; } mergerfs-2.42.0/src/fuse_syncfs.hpp0000644000000000000000000000160215177346257015756 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "fuse.h" namespace FUSE { int syncfs(const fuse_req_ctx_t *ctx); } mergerfs-2.42.0/src/fuse_tmpfile.cpp0000644000000000000000000000211415177346257016103 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fuse_tmpfile.hpp" #include "fuse_create.hpp" #include #include int FUSE::tmpfile(const fuse_req_ctx_t *ctx_, const char *fusepath_, mode_t mode_, fuse_file_info_t *ffi_) { return -ENOSYS; } mergerfs-2.42.0/src/fuse_tmpfile.hpp0000644000000000000000000000202215177346257016106 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "fuse.h" #include namespace FUSE { int tmpfile(const fuse_req_ctx_t *ctx, const char *fusepath, mode_t mode, fuse_file_info_t *ffi); } mergerfs-2.42.0/src/fuse_truncate.cpp0000644000000000000000000000535615177346257016303 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fuse_truncate.hpp" #include "config.hpp" #include "errno.hpp" #include "fs_path.hpp" #include "fs_truncate.hpp" #include "policy_rv.hpp" #include "fuse.h" #include #include static void _truncate_loop_core(const fs::path &basepath_, const fs::path &fusepath_, const off_t size_, PolicyRV *prv_) { int rv; fs::path fullpath; fullpath = basepath_ / fusepath_; rv = fs::truncate(fullpath,size_); prv_->insert(rv,basepath_); } static void _truncate_loop(const std::vector &branches_, const fs::path &fusepath_, const off_t size_, PolicyRV *prv_) { for(auto &branch : branches_) { ::_truncate_loop_core(branch->path,fusepath_,size_,prv_); } } static int _truncate(const Policy::Action &actionFunc_, const Policy::Search &searchFunc_, const Branches::Ptr branches_, const fs::path &fusepath_, const off_t size_) { int rv; PolicyRV prv; std::vector branches; rv = actionFunc_(branches_,fusepath_,branches); if(rv < 0) return rv; if(branches.empty()) return -ENOENT; ::_truncate_loop(branches,fusepath_,size_,&prv); if(prv.errors.empty()) return 0; if(prv.successes.empty()) return prv.errors[0].rv; branches.clear(); rv = searchFunc_(branches_,fusepath_,branches); if(rv < 0) return rv; if(branches.empty()) return -ENOENT; return prv.get_error(branches[0]->path); } int FUSE::truncate(const fuse_req_ctx_t *ctx_, const char *fusepath_, off_t size_) { const fs::path fusepath{fusepath_}; return ::_truncate(cfg.func.truncate.policy, cfg.func.getattr.policy, cfg.branches, fusepath, size_); } mergerfs-2.42.0/src/fuse_truncate.hpp0000644000000000000000000000177015177346257016304 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "fuse_req_ctx.h" #include namespace FUSE { int truncate(const fuse_req_ctx_t *ctx, const char *fusepath, off_t size); } mergerfs-2.42.0/src/fuse_unlink.cpp0000644000000000000000000000347615177346257015757 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fuse_unlink.hpp" #include "config.hpp" #include "errno.hpp" #include "error.hpp" #include "fs_path.hpp" #include "fs_unlink.hpp" #include "fuse.h" #include #include static int _unlink_loop(const std::vector &branches_, const fs::path &fusepath_) { Err err; fs::path fullpath; for(const auto &branch : branches_) { fullpath = branch->path / fusepath_; err = fs::unlink(fullpath); } return err; } static int _unlink(const Policy::Action &unlinkPolicy_, const Branches::Ptr branches_, const fs::path &fusepath_) { int rv; std::vector branches; rv = unlinkPolicy_(branches_,fusepath_,branches); if(rv < 0) return rv; return ::_unlink_loop(branches,fusepath_); } int FUSE::unlink(const fuse_req_ctx_t *ctx_, const char *fusepath_) { const fs::path fusepath{fusepath_}; return ::_unlink(cfg.func.unlink.policy, cfg.branches, fusepath); } mergerfs-2.42.0/src/fuse_unlink.hpp0000644000000000000000000000166515177346257015762 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "fuse_req_ctx.h" namespace FUSE { int unlink(const fuse_req_ctx_t *ctx, const char *fusepath); } mergerfs-2.42.0/src/fuse_utimens.cpp0000644000000000000000000000530515177346257016134 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fuse_utimens.hpp" #include "config.hpp" #include "errno.hpp" #include "fs_lutimens.hpp" #include "fs_path.hpp" #include "policy_rv.hpp" #include "fuse.h" #include static void _utimens_loop_core(const fs::path &basepath_, const fs::path &fusepath_, const timespec ts_[2], PolicyRV *prv_) { int rv; fs::path fullpath; fullpath = basepath_ / fusepath_; rv = fs::lutimens(fullpath,ts_); prv_->insert(rv,basepath_); } static void _utimens_loop(const std::vector &branches_, const fs::path &fusepath_, const timespec ts_[2], PolicyRV *prv_) { for(auto &branch : branches_) { ::_utimens_loop_core(branch->path,fusepath_,ts_,prv_); } } static int _utimens(const Policy::Action &utimensPolicy_, const Policy::Search &getattrPolicy_, const Branches::Ptr branches_, const fs::path &fusepath_, const timespec ts_[2]) { int rv; PolicyRV prv; std::vector branches; rv = utimensPolicy_(branches_,fusepath_,branches); if(rv < 0) return rv; if(branches.empty()) return -ENOENT; ::_utimens_loop(branches,fusepath_,ts_,&prv); if(prv.errors.empty()) return 0; if(prv.successes.empty()) return prv.errors[0].rv; branches.clear(); rv = getattrPolicy_(branches_,fusepath_,branches); if(rv < 0) return rv; if(branches.empty()) return -ENOENT; return prv.get_error(branches[0]->path); } int FUSE::utimens(const fuse_req_ctx_t *ctx_, const char *fusepath_, const timespec ts_[2]) { const fs::path fusepath{fusepath_}; return ::_utimens(cfg.func.utimens.policy, cfg.func.getattr.policy, cfg.branches, fusepath, ts_); } mergerfs-2.42.0/src/fuse_utimens.hpp0000644000000000000000000000176515177346257016147 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "fuse_req_ctx.h" #include namespace FUSE { int utimens(const fuse_req_ctx_t *ctx, const char *fusepath, const timespec ts[2]); } mergerfs-2.42.0/src/fuse_write.cpp0000644000000000000000000001271715177346257015607 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fuse_write.hpp" #include "config.hpp" #include "errno.hpp" #include "fileinfo.hpp" #include "fs_close.hpp" #include "fs_dup2.hpp" #include "fs_movefile_and_open.hpp" #include "fs_pwrite.hpp" #include "fs_pwriten.hpp" #include "ioprio.hpp" #include "state.hpp" #include "scope_guard/scope_guard.hpp" #include "fuse.h" static bool _out_of_space(const ssize_t err_) { return ((err_ == -ENOSPC) || (err_ == -EDQUOT)); } static int _move_and_pwrite(const char *buf_, const size_t count_, const off_t offset_, FileInfo *fi_, int err_) { int err; ssize_t rv; if(cfg.moveonenospc.enabled == false) return err_; rv = fs::movefile_and_open_as_root(cfg.moveonenospc.policy, cfg.branches, fi_->branch.path, fi_->fusepath, fi_->fd); if(rv < 0) return err_; err = fs::dup2(rv,fi_->fd); fs::close(rv); if(err < 0) return err_; return fs::pwrite(fi_->fd,buf_,count_,offset_); } static int _move_and_pwriten(char const *buf_, size_t const count_, off_t const offset_, FileInfo *fi_, ssize_t const err_, ssize_t const written_) { int err; ssize_t rv; if(cfg.moveonenospc.enabled == false) return err_; rv = fs::movefile_and_open_as_root(cfg.moveonenospc.policy, cfg.branches, fi_->branch.path, fi_->fusepath, fi_->fd); if(rv < 0) return err_; err = fs::dup2(rv,fi_->fd); fs::close(rv); if(err < 0) return err_; rv = fs::pwriten(fi_->fd, buf_ + written_, count_ - written_, offset_ + written_, &err); if(err < 0) return err; return (written_ + rv); } // When in direct_io mode write's return value should match that of // the operation. // 0 on EOF // N bytes written (short writes included) // -errno on error // See libfuse/include/fuse.h for more details static int _write_direct_io(const char *buf_, const size_t count_, const off_t offset_, FileInfo *fi_) { ssize_t rv; rv = fs::pwrite(fi_->fd,buf_,count_,offset_); if(::_out_of_space(rv)) rv = ::_move_and_pwrite(buf_,count_,offset_,fi_,rv); return rv; } // When not in direct_io mode write's return value is more complex. // 0 or less than `count` on EOF // `count` on non-errors // -errno on error // See libfuse/include/fuse.h for more details static int _write_cached(const char *buf_, const size_t count_, const off_t offset_, FileInfo *fi_) { int err; ssize_t rv; rv = fs::pwriten(fi_->fd,buf_,count_,offset_,&err); if(err == 0) return rv; if(err && !::_out_of_space(err)) return err; rv = ::_move_and_pwriten(buf_,count_,offset_,fi_,err,rv); return rv; } static int _write(const fuse_req_ctx_t *ctx_, const fuse_file_info_t *ffi_, const char *buf_, const size_t count_, const off_t offset_) { FileInfo *fi; fi = state.get_fi(ctx_,ffi_->fh); if(not fi) return -EBADF; // Concurrent writes can only happen if: // 1) writeback-cache is enabled and using page caching // 2) parallel_direct_writes is enabled and file has `direct_io=true` // Will look into selectively locking in the future // A reader/writer lock would probably be the best option given // the expense of the write itself in comparison. Alternatively, // could change the move file behavior to use a known target file // and have threads use O_EXCL and back off and wait for the // transfer to complete before retrying. mutex_lockguard(fi->mutex); if(fi->direct_io) return ::_write_direct_io(buf_,count_,offset_,fi); return ::_write_cached(buf_,count_,offset_,fi); } int FUSE::write(const fuse_req_ctx_t *ctx_, const fuse_file_info_t *ffi_, const char *buf_, size_t count_, off_t offset_) { ioprio::SetFrom iop(ctx_->pid); return ::_write(ctx_,ffi_,buf_,count_,offset_); } int FUSE::write_null(const fuse_req_ctx_t *ctx_, const fuse_file_info_t *ffi_, const char *buf_, size_t count_, off_t offset_) { return count_; } mergerfs-2.42.0/src/fuse_write.hpp0000644000000000000000000000237515177346257015613 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "fuse.h" namespace FUSE { int write(const fuse_req_ctx_t *ctx, const fuse_file_info_t *ffi, const char *buf, size_t count, off_t offset); int write_null(const fuse_req_ctx_t *ctx, const fuse_file_info_t *ffi, const char *buf, size_t count, off_t offset); } mergerfs-2.42.0/src/hashset.hpp0000644000000000000000000000677615177346257015107 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "base_types.h" #include "rapidhash/rapidhash.h" #include // Stores 64-bit hashes only, not keys. Relies on collision // probability being extremely low at 64-bit width. class HashSet { private: static constexpr size_t INLINE_CAPACITY = 8; static constexpr size_t INITIAL_CAPACITY = 128; private: u64 _inline[INLINE_CAPACITY] = {}; u64 *_table = nullptr; size_t _size = 0; size_t _capacity = 0; size_t _mask = 0; public: HashSet() = default; ~HashSet() { delete[] _table; } HashSet(const HashSet&) = delete; HashSet& operator=(const HashSet&) = delete; inline int put(const char *str_, cu64 len_) { u64 h; h = rapidhash(str_,len_); if(h == 0) h = 1; return _put_hash(h); } inline int put(const char *str_) { return put(str_,strlen(str_)); } inline int size(void) const { return _size; } private: inline int _put_hash(const u64 h_) { if(_table == nullptr) { for(size_t i = 0; i < _size; ++i) { if(_inline[i] == h_) return 0; } if(_size < INLINE_CAPACITY) { _inline[_size++] = h_; return 1; } _grow(INITIAL_CAPACITY); } // 75% was benchmarked to be best generally if(((_size + 1) * 4) >= (_capacity * 3)) _grow(_capacity * 2); size_t idx = h_ & _mask; while(true) { const u64 cur = _table[idx]; if(cur == 0) { _table[idx] = h_; ++_size; return 1; } if(cur == h_) return 0; idx = ((idx + 1) & _mask); } } inline void _grow(size_t min_capacity_) { size_t cap = 1; u64 *table; size_t mask; while(cap < min_capacity_) cap <<= 1; table = new u64[cap](); mask = cap - 1; if(_table == nullptr) { for(size_t i = 0; i < _size; ++i) _insert_existing(table, mask, _inline[i]); } else { for(size_t i = 0; i < _capacity; ++i) { const u64 h = _table[i]; if(h == 0) continue; _insert_existing(table, mask, h); } delete[] _table; } _table = table; _capacity = cap; _mask = mask; } static inline void _insert_existing(u64 *table_, size_t mask_, u64 h_) { size_t idx = h_ & mask_; while(table_[idx] != 0) idx = ((idx + 1) & mask_); table_[idx] = h_; } }; mergerfs-2.42.0/src/hw_cpu.cpp0000644000000000000000000000200015177346257014700 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include namespace hw { namespace cpu { int logical_core_count(void) { #if defined _SC_NPROCESSORS_ONLN return ::sysconf(_SC_NPROCESSORS_ONLN); #else return 1; #endif } } } mergerfs-2.42.0/src/hw_cpu.hpp0000644000000000000000000000157615177346257014726 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once namespace hw { namespace cpu { int logical_core_count(void); } } mergerfs-2.42.0/src/ioprio.cpp0000644000000000000000000000366715177346257014740 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "ioprio.hpp" #include #ifdef __linux__ # include # include #else #pragma message "ioprio not supported on this platform" #endif enum { IOPRIO_WHO_PROCESS = 1 }; thread_local int ioprio::SetFrom::thread_prio = -1; bool _enabled = false; int ioprio::get(const int who_) { #ifdef SYS_ioprio_get int rv; const int which = IOPRIO_WHO_PROCESS; rv = syscall(SYS_ioprio_get,which,who_); return ((rv == -1) ? -errno : rv); #else return -EOPNOTSUPP; #endif } int ioprio::set(const int who_, const int ioprio_) { #ifdef SYS_ioprio_set int rv; const int which = IOPRIO_WHO_PROCESS; rv = syscall(SYS_ioprio_set,which,who_,ioprio_); return ((rv == -1) ? -errno : rv); #else return -EOPNOTSUPP; #endif } void ioprio::enable(const bool enable_) { _enabled = enable_; } bool ioprio::enabled() { return _enabled; } ioprio::SetFrom::SetFrom(const pid_t pid_) { int client_prio; if(!_enabled) return; client_prio = ioprio::get(pid_); if(client_prio < 0) return; if(client_prio == thread_prio) return; thread_prio = client_prio; ioprio::set(0,client_prio); } mergerfs-2.42.0/src/ioprio.hpp0000644000000000000000000000207115177346257014731 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include namespace ioprio { void enable(const bool); bool enabled(); int get(const int who); int set(const int who, const int ioprio); struct SetFrom { static thread_local int thread_prio; SetFrom(const pid_t pid); }; }; mergerfs-2.42.0/src/mergerfs.cpp0000644000000000000000000002311415177346257015236 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "mergerfs.hpp" #include "mergerfs_fsck.hpp" #include "mergerfs_collect_info.hpp" #include "caps.hpp" #include "config.hpp" #include "fs_path.hpp" #include "fs_readahead.hpp" #include "fs_umount2.hpp" #include "fs_wait_for_mount.hpp" #include "maintenance_thread.hpp" #include "oom.hpp" #include "option_parser.hpp" #include "procfs.hpp" #include "resources.hpp" #include "strvec.hpp" #include "syslog.hpp" #include "version.hpp" #include "fuse_access.hpp" #include "fuse_bmap.hpp" #include "fuse_chmod.hpp" #include "fuse_chown.hpp" #include "fuse_copy_file_range.hpp" #include "fuse_create.hpp" #include "fuse_destroy.hpp" #include "fuse_fallocate.hpp" #include "fuse_fchmod.hpp" #include "fuse_fchown.hpp" #include "fuse_fgetattr.hpp" #include "fuse_flush.hpp" #include "fuse_fsync.hpp" #include "fuse_fsyncdir.hpp" #include "fuse_ftruncate.hpp" #include "fuse_futimens.hpp" #include "fuse_getattr.hpp" #include "fuse_getxattr.hpp" #include "fuse_init.hpp" #include "fuse_ioctl.hpp" #include "fuse_link.hpp" #include "fuse_listxattr.hpp" #include "fuse_mkdir.hpp" #include "fuse_mknod.hpp" #include "fuse_open.hpp" #include "fuse_opendir.hpp" #include "fuse_poll.hpp" #include "fuse_read.hpp" #include "fuse_readdir.hpp" #include "fuse_readdir_plus.hpp" #include "fuse_readlink.hpp" #include "fuse_release.hpp" #include "fuse_releasedir.hpp" #include "fuse_removemapping.hpp" #include "fuse_removexattr.hpp" #include "fuse_rename.hpp" #include "fuse_rmdir.hpp" #include "fuse_setupmapping.hpp" #include "fuse_setxattr.hpp" #include "fuse_statfs.hpp" #include "fuse_statx.hpp" #include "fuse_symlink.hpp" #include "fuse_syncfs.hpp" #include "fuse_tmpfile.hpp" #include "fuse_truncate.hpp" #include "fuse_unlink.hpp" #include "fuse_utimens.hpp" #include "fuse_write.hpp" #include "fuse.h" #include #include #include #include #include static void _get_fuse_operations(struct fuse_operations &ops_, const bool nullrw_) { ops_.access = FUSE::access; ops_.bmap = FUSE::bmap; ops_.chmod = FUSE::chmod; ops_.chown = FUSE::chown; ops_.copy_file_range = FUSE::copy_file_range; ops_.create = FUSE::create; ops_.destroy = FUSE::destroy; ops_.fallocate = FUSE::fallocate; ops_.fchmod = FUSE::fchmod; ops_.fchown = FUSE::fchown; ops_.fgetattr = FUSE::fgetattr; ops_.flush = FUSE::flush; ops_.fsync = FUSE::fsync; ops_.fsyncdir = FUSE::fsyncdir; ops_.ftruncate = FUSE::ftruncate; ops_.futimens = FUSE::futimens; ops_.getattr = FUSE::getattr; ops_.getxattr = FUSE::getxattr; ops_.init = FUSE::init; ops_.ioctl = FUSE::ioctl; ops_.link = FUSE::link; ops_.listxattr = FUSE::listxattr; ops_.mkdir = FUSE::mkdir; ops_.mknod = FUSE::mknod; ops_.open = FUSE::open; ops_.opendir = FUSE::opendir; ops_.poll = FUSE::poll; ops_.read = (nullrw_ ? FUSE::read_null : FUSE::read); ops_.readdir = FUSE::readdir; ops_.readdir_plus = FUSE::readdir_plus; ops_.readlink = FUSE::readlink; ops_.release = FUSE::release; ops_.releasedir = FUSE::releasedir; ops_.removemapping = FUSE::removemapping; ops_.removexattr = FUSE::removexattr; ops_.rename = FUSE::rename; ops_.rmdir = FUSE::rmdir; ops_.setupmapping = FUSE::setupmapping; ops_.setxattr = FUSE::setxattr; ops_.statfs = FUSE::statfs; ops_.statx = FUSE::statx; ops_.statx_fh = FUSE::statx_fh; ops_.symlink = FUSE::symlink; ops_.syncfs = FUSE::syncfs; ops_.tmpfile = FUSE::tmpfile; ops_.truncate = FUSE::truncate; ops_.unlink = FUSE::unlink; ops_.utimens = FUSE::utimens; ops_.write = (nullrw_ ? FUSE::write_null : FUSE::write); return; } static void _setup_resources(const int scheduling_priority_) { std::srand(time(NULL)); resources::reset_umask(); resources::maxout_rlimit_nofile(); resources::maxout_rlimit_fsize(); resources::setpriority(scheduling_priority_); } static void _set_oom_score_adj() { int rv; int orig; int score; if(!oom::has_oom_score_adj()) return; score = -990; orig = oom::get_oom_score_adj(); rv = oom::set_oom_score_adj(score); (void)rv; SysLog::info("set oom_score_adj to {}, originally {}", score, orig); } static bool _wait_for_mount() { int failures; std::vector paths; std::chrono::milliseconds timeout; paths = cfg.branches->to_paths(); SysLog::info("Waiting {} seconds for {} branches to mount", (u64)cfg.branches_mount_timeout, paths.size()); timeout = std::chrono::milliseconds(cfg.branches_mount_timeout * 1000); failures = fs::wait_for_mount(cfg.mountpoint, paths, timeout); if(failures) { if(cfg.branches_mount_timeout_fail) { SysLog::error("{} of {} branches were not mounted" " within the timeout of {}s. Exiting", failures, paths.size(), (u64)cfg.branches_mount_timeout); return true; } SysLog::warning("Continuing to mount mergerfs despite {} branches not " "being different from the mountpoint filesystem", failures); } else { SysLog::info("All {} branches are mounted", paths.size()); } return false; } static void _lazy_umount(const fs::path &target_) { int rv; rv = fs::umount_lazy(target_); switch(rv) { case 0: SysLog::notice("{} has been successfully lazily unmounted", target_.string()); break; case -EINVAL: SysLog::notice("{} was not a mount point needing to be unmounted", target_.string()); break; default: SysLog::error("Error unmounting {}: {} - {}", target_.string(), -rv, strerror(-rv)); break; } } static void _usr1_signal_handler(int signal_) { (void)signal_; // SysLog::info("Received SIGUSR1 - invalidating all nodes"); // fuse_invalidate_all_nodes(); } static void _usr2_signal_handler(int signal_) { (void)signal_; // SysLog::info("Received SIGUSR2 - triggering thorough gc"); // fuse_gc(); } static void _hup_signal_handler(int signal_) { (void)signal_; } static void _setup_signal_handlers() { std::signal(SIGUSR1,::_usr1_signal_handler); std::signal(SIGUSR2,::_usr2_signal_handler); std::signal(SIGHUP,::_hup_signal_handler); } static void _warn_if_not_root() { uid_t uid; uid = geteuid(); if(uid == 0) return; constexpr const char *s = "mergerfs is not running as root" " and may not work correctly"; fmt::println(stderr,"* WARNING: {}",s); SysLog::warning(s); } int _main(int argc_, char **argv_) { int rv; fuse_args args; fuse_operations ops; SysLog::open(); memset(&ops,0,sizeof(fuse_operations)); args.argc = argc_; args.argv = argv_; args.allocated = false; SysLog::info("mergerfs v{} started",MERGERFS_VERSION); SysLog::info("Go to https://trapexit.github.io/mergerfs/latest/support for support"); for(int i = 0; i < argc_; i++) SysLog::info("argv[{}]: {}",i,argv_[i]); options::parse(&args); if(!cfg.errs.empty()) { for(auto &err : cfg.errs) { const std::string s = err.to_string(); SysLog::error("error: {}",s); fmt::println(stderr,"mergerfs: ERROR - {}",s); } return EXIT_FAILURE; } if(cfg.branches_mount_timeout > 0) { bool failure; failure = ::_wait_for_mount(); if(failure) return EXIT_FAILURE; } ::_warn_if_not_root(); ::_setup_resources(cfg.scheduling_priority); ::_setup_signal_handlers(); ::_set_oom_score_adj(); ::_get_fuse_operations(ops,cfg.nullrw); if(cfg.lazy_umount_mountpoint) ::_lazy_umount(cfg.mountpoint); caps::setup(); rv = fuse_main(args.argc, args.argv, &ops); SysLog::info("exiting main loop with return code {}",rv); SysLog::close(); return rv; } static int _pick_app_and_run(int argc_, char **argv_) { fs::path appname; appname = argv_[0]; appname = appname.filename(); if(appname == "fsck.mergerfs") return mergerfs::fsck::main(argc_,argv_); if(appname == "mergerfs.collect-info") return mergerfs::collect_info::main(argc_,argv_); return ::_main(argc_,argv_); } int main(int argc_, char **argv_) { return ::_pick_app_and_run(argc_,argv_); } mergerfs-2.42.0/src/mergerfs.hpp0000644000000000000000000000146115177346257015244 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once mergerfs-2.42.0/src/mergerfs_api.cpp0000644000000000000000000000531715177346257016074 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "mergerfs_api.hpp" #include "fs_xattr.hpp" #include "fs_exists.hpp" #include "fs_lgetxattr.hpp" #include "str.hpp" #include "scope_guard/scope_guard.hpp" #include #include typedef std::array mfs_api_buf_t; static int _lgetxattr(const std::string &input_path_, const std::string &key_, std::string &value_) { int rv; std::string key; mfs_api_buf_t buf; key = "user.mergerfs." + key_; rv = fs::lgetxattr(input_path_,key,buf.data(),buf.size()); if(rv < 0) return rv; value_.clear(); value_.reserve(rv); value_.append(buf.data(),(size_t)rv); return rv; } bool mergerfs::api::is_mergerfs(const fs::path &mountpoint_) { fs::path dot_mergerfs_filepath; dot_mergerfs_filepath = mountpoint_ / ".mergerfs"; return fs::exists(dot_mergerfs_filepath); } int mergerfs::api::get_kvs(const fs::path &mountpoint_, std::map *kvs_) { fs::path dot_mergerfs_filepath; dot_mergerfs_filepath = mountpoint_ / ".mergerfs"; return fs::xattr::get(dot_mergerfs_filepath,kvs_); } int mergerfs::api::allpaths(const std::string &input_path_, std::vector &output_paths_) { int rv; std::string val; rv = ::_lgetxattr(input_path_,"allpaths",val); if(rv < 0) return rv; output_paths_ = str::split_on_null(val); return 0; } int mergerfs::api::basepath(const std::string &input_path_, std::string &basepath_) { return ::_lgetxattr(input_path_,"basepath",basepath_); } int mergerfs::api::relpath(const std::string &input_path_, std::string &relpath_) { return ::_lgetxattr(input_path_,"relpath",relpath_); } int mergerfs::api::fullpath(const std::string &input_path_, std::string &fullpath_) { return ::_lgetxattr(input_path_,"fullpath",fullpath_); } mergerfs-2.42.0/src/mergerfs_api.hpp0000644000000000000000000000270515177346257016077 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "fs_path.hpp" #include #include #include namespace mergerfs { namespace api { bool is_mergerfs(const fs::path &path); int get_kvs(const fs::path &mountpoint, std::map *kvs); int basepath(const std::string &path, std::string &basepath); int relpath(const std::string &path, std::string &relpath); int fullpath(const std::string &path, std::string &fullpath); int allpaths(const std::string &path, std::vector &paths); } } mergerfs-2.42.0/src/mergerfs_collect_info.cpp0000644000000000000000000001202015177346257017750 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "mergerfs_collect_info.hpp" #include "mergerfs_api.hpp" #include "fs_mounts.hpp" #include "fs_unlink.hpp" #include "CLI11/CLI11.hpp" #include "fmt/core.h" #include "fmt/ranges.h" #include "scope_guard/scope_guard.hpp" #include "subprocess/subprocess.hpp" #include static void _write_str(const std::string &output_, const std::string &str_) { FILE *f; f = ::fopen(output_.c_str(),"a"); if(f == NULL) return; DEFER{ ::fclose(f); }; ::fwrite(str_.c_str(),1,str_.size(),f); } static void _run(const std::initializer_list &args_, const std::string &output_) { std::string hdr; hdr = fmt::format("=== {}\n",fmt::join(args_," ")); try { _write_str(output_,hdr); subprocess::call(args_, subprocess::output{output_.c_str()}); } catch(...) { ::_write_str(output_,"error: command failed to run\n"); } _write_str(output_,"\n\n"); } static void _lsblk(const std::string &output_) { auto args = { "lsblk", "--json", "-o","NAME,FSTYPE,FSSIZE,SIZE,MOUNTPOINTS,RM,RO,ROTA" }; ::_run(args,output_); } static void _mounts(const std::string &output_) { ::_run({"cat","/proc/mounts"},output_); } static void _mount_point_stats(const std::string &output_) { fs::MountVec mounts; fs::mounts(mounts); for(const auto &mount : mounts) { std::vector allpaths; mergerfs::api::allpaths(mount.dir.string(),allpaths); for(const auto &path : allpaths) { ::_run({"stat",path.c_str()},output_); } } } static void _mergerfs_version(const std::string &output_) { ::_run({"mergerfs","--version"},output_); } static void _mergerfs_settings(const std::string &output_) { fs::MountVec mounts; fs::mounts(mounts); for(const auto &mount : mounts) { int rv; std::map kvs; rv = mergerfs::api::get_kvs(mount.dir.string(),&kvs); if(rv < 0) continue; std::string output_str; output_str = fmt::format("=== {}/.mergerfs\n",mount.dir.string()); for(const auto &[k,v] : kvs) output_str += fmt::format("{}={}\n",k,v); output_str += "\n\n"; _write_str(output_,output_str); } } static void _uname(const std::string &output_) { ::_run({"uname","-a"},output_); } static void _lsb_release(const std::string &output_) { ::_run({"lsb_release","-a"},output_); } static void _df(const std::string &output_) { ::_run({"df","-h"},output_); } static void _fstab(const std::string &output_) { ::_run({"cat","/etc/fstab"},output_); } static void _software_versions(const std::string &output_) { ::_run({"docker","--version"},output_); ::_run({"docker","compose","--version"},output_); ::_run({"podman","--version"},output_); ::_run({"podman","compose","--version"},output_); ::_run({"smbd","--version"},output_); } static void _lshw(const std::string &output_) { ::_run({"lshw"},output_); } static void _journalctl(const std::string &output_) { ::_run({"journalctl","-t","mergerfs","--since","60 minutes ago"},output_); } int mergerfs::collect_info::main(int argc_, char **argv_) { CLI::App app; const char *output_filepath = "/tmp/mergerfs.info.txt"; app.description("mergerfs.collect-info:" " Collect info for support requests"); app.name("USAGE: mergerfs.collect-info"); try { app.parse(argc_,argv_); } catch(const CLI::ParseError &e) { return app.exit(e); } fmt::print("* Please have mergerfs mounted before running this tool.\n"); fs::unlink(output_filepath); ::_mergerfs_version(output_filepath); ::_uname(output_filepath); ::_lsb_release(output_filepath); ::_df(output_filepath); ::_lsblk(output_filepath); ::_mounts(output_filepath); ::_mount_point_stats(output_filepath); ::_mergerfs_settings(output_filepath); ::_fstab(output_filepath); ::_software_versions(output_filepath); ::_lshw(output_filepath); ::_journalctl(output_filepath); fmt::print("* Upload the following file to your" " GitHub ticket or put on https://pastebin.com" " when requesting support.\n* {}\n", output_filepath); return 0; } mergerfs-2.42.0/src/mergerfs_collect_info.hpp0000644000000000000000000000164015177346257017763 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once namespace mergerfs { namespace collect_info { int main(int argc, char **argv); } } mergerfs-2.42.0/src/mergerfs_fsck.cpp0000644000000000000000000002471115177346257016250 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "mergerfs_fsck.hpp" #include "fs_close.hpp" #include "fs_copyfile.hpp" #include "fs_is_same_file.hpp" #include "fs_lchmod.hpp" #include "fs_lchown.hpp" #include "fs_lgetxattr.hpp" #include "fs_lstat.hpp" #include "fs_open.hpp" #include "mergerfs_api.hpp" #include "str.hpp" #include "fmt/core.h" #include "fmt/chrono.h" #include "CLI11/CLI11.hpp" #include "base_types.h" #include namespace FS = std::filesystem; struct PathStat { PathStat(const std::string &path_) : path(path_), st{} { } std::string path; struct stat st; }; using PathStatVec = std::vector; using FixFunc = std::function; static bool _files_differ(const PathStatVec &paths_, const bool check_size_) { if(paths_.size() <= 1) return false; const struct stat &st0 = paths_[0].st; for(u64 i = 1; i < paths_.size(); i++) { const struct stat &st = paths_[i].st; if(st.st_mode != st0.st_mode) return true; if(st.st_uid != st0.st_uid) return true; if(st.st_gid != st0.st_gid) return true; if(check_size_ && S_ISREG(st0.st_mode) && (st.st_size != st0.st_size)) return true; } return false; } static bool _files_same_type(const PathStatVec &paths_) { mode_t type; if(paths_.size() <= 1) return true; type = (paths_[0].st.st_mode & S_IFMT); for(u64 i = 1; i < paths_.size(); i++) { if((paths_[i].st.st_mode & S_IFMT) != type) return false; } return true; } static const char* _file_type(const mode_t mode_) { switch(mode_ & S_IFMT) { case S_IFBLK: return "block dev"; case S_IFCHR: return "char dev"; case S_IFDIR: return "directory"; case S_IFIFO: return "fifo"; case S_IFLNK: return "symlink"; case S_IFSOCK: return "socket"; case S_IFREG: return "regular"; } return "unknown"; } static void _compare_files(const std::string &mergerfs_path_, PathStatVec &pathstats_, const FixFunc fix_func_, const bool check_size_, const bool copy_file_) { int rv; if(pathstats_.size() <= 1) return; for(auto &pathstat : pathstats_) { rv = fs::lstat(pathstat.path,&pathstat.st); if(rv < 0) pathstat.st.st_size = rv; } if(!::_files_differ(pathstats_,check_size_)) return; fmt::println("* {}",mergerfs_path_); for(u64 i = 0; i < pathstats_.size(); i++) { const auto &path = pathstats_[i].path; const auto &st = pathstats_[i].st; fmt::println(" {}: {}",i,path); if(st.st_size < 0) fmt::println(" - err: {}",strerror(-st.st_size)); time_t mtime = st.st_mtime; std::tm *mtime_tm = std::localtime(&mtime); fmt::println(" -" " uid: {};" " gid: {};" " mode: {:05o};" " type: {};" " size: {};" " mtime: {:%Y-%m-%dT%H:%M:%S%z}", st.st_uid, st.st_gid, st.st_mode, ::_file_type(st.st_mode), st.st_size, *mtime_tm); } if(!fix_func_) return; if(::_files_same_type(pathstats_)) fix_func_(pathstats_,copy_file_); else fmt::println(" X: WARNING - files are of different types." " Requires manual intervention."); } static int _get_allpaths(const std::string &mergerfs_path_, PathStatVec &pathstats_) { int rv; std::vector allpaths; rv = mergerfs::api::allpaths(mergerfs_path_,allpaths); if(rv < 0) return rv; for(const auto &path : allpaths) pathstats_.emplace_back(path); return 0; } static u64 _read_u64(const u64 min_, const u64 max_) { u64 rv; while(true) { fmt::print("Select correct file: "); std::cin >> rv; if((rv >= min_) && (rv <= max_)) return rv; std::cin.clear(); std::cin.ignore(100, '\n'); } } static void _setattr(const struct stat &st_, const PathStatVec &pathstats_) { int rv; for(const auto &path : pathstats_) { rv = fs::lchmod(path.path,st_.st_mode); rv |= fs::lchown(path.path,st_.st_uid,st_.st_gid); if(rv) fmt::println("ERROR: problem setting mode or owner - {}", strerror(errno)); } } static void _copy_files(const std::string &src_, const PathStatVec &dsts_) { for(const auto &dst : dsts_) { int rv; if(src_ == dst.path) continue; if(fs::is_same_file(src_,dst.path) == 1) continue; rv = fs::copyfile(src_,dst.path,{.cleanup_failure=false}); if(rv < 0) fmt::print(stderr, "ERROR: failed copying to {} - {}", dst.path, strerror(errno)); } } static bool _mtime_cmp(const struct stat &a_, const struct stat &b_) { if(a_.st_mtim.tv_sec == b_.st_mtim.tv_sec) return (a_.st_mtim.tv_nsec < b_.st_mtim.tv_nsec); return (a_.st_mtim.tv_sec < b_.st_mtim.tv_sec); } static bool _pathstat_cmp(const PathStatVec::value_type &a_, const PathStatVec::value_type &b_) { return ::_mtime_cmp(a_.st,b_.st); } static const PathStatVec::value_type* _find_latest_mtime(const PathStatVec &pathstats_) { PathStatVec::const_iterator i; i = std::max_element(pathstats_.begin(), pathstats_.end(), ::_pathstat_cmp); return &(*i); } static const PathStatVec::value_type* _find_largest(const PathStatVec &pathstats_) { PathStatVec::const_iterator i; i = std::max_element(pathstats_.begin(), pathstats_.end(), [](const PathStatVec::value_type &a_, const PathStatVec::value_type &b_) { return (a_.st.st_size < b_.st.st_size); }); return &(*i); } static void _fix_func_manual(const PathStatVec &pathstats_, const bool copy_file_) { u64 idx; idx = ::_read_u64(0ULL,pathstats_.size()-1); if(copy_file_ && S_ISREG(pathstats_[idx].st.st_mode)) ::_copy_files(pathstats_[idx].path,pathstats_); else ::_setattr(pathstats_[idx].st,pathstats_); } static void _fix_func_newest(const PathStatVec &pathstats_, const bool copy_file_) { const PathStatVec::value_type *pathst; pathst = _find_latest_mtime(pathstats_); if(!pathst) return; if(copy_file_ && S_ISREG(pathst->st.st_mode)) ::_copy_files(pathst->path,pathstats_); else ::_setattr(pathst->st,pathstats_); }; static void _fix_func_largest(const PathStatVec &pathstats_, const bool copy_file_) { const PathStatVec::value_type *pathst; pathst = ::_find_largest(pathstats_); if(!pathst) return; if(copy_file_ && S_ISREG(pathst->st.st_mode)) ::_copy_files(pathst->path,pathstats_); else ::_setattr(pathst->st,pathstats_); } static FixFunc _select_fix_func(const std::string &fix_) { if(fix_ == "none") return {}; else if(fix_ == "manual") return ::_fix_func_manual; else if(fix_ == "newest") return ::_fix_func_newest; else if(fix_ == "largest") return ::_fix_func_largest; else abort(); return {}; } static void _fsck(const FS::path &path_, const FixFunc fix_func_, const bool check_size_, const bool copy_file_) { int rv; PathStatVec paths; ::_get_allpaths(path_,paths); ::_compare_files(path_,paths,fix_func_,check_size_,copy_file_); auto opts = FS::directory_options::skip_permission_denied; auto rdi = FS::recursive_directory_iterator(path_,opts); for(const auto &de : rdi) { paths.clear(); rv = ::_get_allpaths(de.path(),paths); if(rv < 0) continue; ::_compare_files(de.path(), paths, fix_func_, check_size_, copy_file_); } } int mergerfs::fsck::main(int argc_, char **argv_) { CLI::App app; FS::path path; std::string fix; bool check_size; bool copy_file; FixFunc fix_func; app.description("fsck.mergerfs:" " A tool to help diagnose and solve mergerfs pool issues"); app.name("USAGE: fsck.mergerfs"); app.add_option("path",path) ->description("mergerfs path") ->check(CLI::ExistingDirectory) ->required(); app.add_option("--fix",fix) ->description("Will attempt to 'fix' the problem by chown+chmod or copying files based on a selected file.\n" " * none: Do nothing. Just print details.\n" " * manual: User selects source file.\n" " * newest: Use file with most recent mtime.\n" " * largest: Use file with largest size.") ->check(CLI::IsMember({"none","manual","newest","largest"})) ->default_val("none"); app.add_option("--check-size",check_size) ->description("Considers file size in calculating differences") ->default_val(false) ->default_str("false"); app.add_option("--copy-file",copy_file) ->description("Copy file rather than chown/chmod to fix") ->default_val(false) ->default_str("false"); try { app.parse(argc_,argv_); } catch(const CLI::ParseError &e) { return app.exit(e); } if((geteuid() != 0) && (fix != "none")) fmt::println(stderr,"WARNING: fsck.mergerfs should be run as root to apply fixes"); fix_func = ::_select_fix_func(fix); ::_fsck(path, fix_func, check_size, copy_file); return 0; } mergerfs-2.42.0/src/mergerfs_fsck.hpp0000644000000000000000000000161015177346257016246 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once namespace mergerfs { namespace fsck { int main(int argc, char **argv); } } mergerfs-2.42.0/src/mergerfs_ioctl.hpp0000644000000000000000000000254715177346257016444 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "base_types.h" #include #ifndef _IOC_TYPE #define _IOC_TYPE(X) (((X) >> 8) & 0xFF) #endif #ifndef _IOC_SIZEBITS #define _IOC_SIZEBITS 14 #endif #define MERGERFS_IOCTL_BUF_SIZE ((1 << _IOC_SIZEBITS) - 1) #pragma pack(push,1) struct mergerfs_ioctl_t { u32 size; char buf[MERGERFS_IOCTL_BUF_SIZE - sizeof(u32)]; }; #pragma pack(pop) #define MERGERFS_IOCTL_APP_TYPE 0xDF #define MERGERFS_IOCTL_GET _IOWR(MERGERFS_IOCTL_APP_TYPE,0,mergerfs_ioctl_t) #define MERGERFS_IOCTL_SET _IOWR(MERGERFS_IOCTL_APP_TYPE,1,mergerfs_ioctl_t) mergerfs-2.42.0/src/num.cpp0000644000000000000000000000301015177346257014214 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "ef.hpp" #include "num.hpp" #include "fmt/core.h" #include #include #include #include #define KB (1024ULL) #define MB (KB * 1024ULL) #define GB (MB * 1024ULL) #define TB (GB * 1024ULL) namespace num { std::string humanize(cu64 bytes_) { if(bytes_ < KB) return fmt::format("{}",bytes_); ef(((bytes_ / TB) * TB) == bytes_) return fmt::format("{}T",bytes_ / TB); ef(((bytes_ / GB) * GB) == bytes_) return fmt::format("{}G",bytes_ / GB); ef(((bytes_ / MB) * MB) == bytes_) return fmt::format("{}M",bytes_ / MB); ef(((bytes_ / KB) * KB) == bytes_) return fmt::format("{}K",bytes_ / KB); return fmt::format("{}",bytes_); } } mergerfs-2.42.0/src/num.hpp0000644000000000000000000000162515177346257014233 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "base_types.h" #include namespace num { std::string humanize(cu64 bytes); } mergerfs-2.42.0/src/oom.cpp0000644000000000000000000000262415177346257014221 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "oom.hpp" #include "fs_exists.hpp" #include "fmt/core.h" #include #include constexpr char SELF_OOM_SCORE_ADJ[] = "/proc/self/oom_score_adj"; bool oom::has_oom_score_adj() { return fs::exists(SELF_OOM_SCORE_ADJ); } int oom::get_oom_score_adj() { int score; std::ifstream ifs; ifs.open(SELF_OOM_SCORE_ADJ); if(!ifs) return 0; ifs >> score; ifs.close(); return score; } int oom::set_oom_score_adj(const int score_) { std::ofstream ofs; ofs.open(SELF_OOM_SCORE_ADJ); if(!ofs) return -errno; ofs << fmt::format("{}",score_); ofs.close(); return 0; } mergerfs-2.42.0/src/oom.hpp0000644000000000000000000000165115177346257014225 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once namespace oom { bool has_oom_score_adj(); int get_oom_score_adj(); int set_oom_score_adj(const int score); }; mergerfs-2.42.0/src/option_parser.cpp0000644000000000000000000002067315177346257016317 0ustar rootroot/* Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #define FMT_HEADER_ONLY #include "config.hpp" #include "ef.hpp" #include "errno.hpp" #include "fmt/core.h" #include "fs_glob.hpp" #include "fs_path.hpp" #include "fs_statvfs_cache.hpp" #include "hw_cpu.hpp" #include "num.hpp" #include "policy.hpp" #include "str.hpp" #include "syslog.hpp" #include "version.hpp" #include "fuse.h" #include #include #include #include #include #include #include #include #include #include #include #include enum { MERGERFS_OPT_DEBUG, MERGERFS_OPT_HELP, MERGERFS_OPT_VERSION }; enum { OPT_DISCARD = 0, OPT_KEEP = 1 }; static void _set_option(const std::string &option_, fuse_args *args_) { fuse_opt_add_arg(args_,"-o"); fuse_opt_add_arg(args_,option_.c_str()); } static void _set_kv_option(const std::string &key_, const std::string &val_, fuse_args *args_) { std::string option; option = key_ + '=' + val_; ::_set_option(option,args_); } static void _set_fsname(fuse_args *args_) { if(cfg.fsname->empty()) { std::vector paths; cfg.branches->to_paths(paths); if(paths.size() > 0) cfg.fsname = str::remove_common_prefix_and_join(paths,':'); } ::_set_kv_option("fsname",cfg.fsname,args_); } static void _set_subtype(fuse_args *args_) { ::_set_kv_option("subtype","mergerfs",args_); } static void _set_default_options(fuse_args *args_) { if(cfg.kernel_permissions_check) ::_set_option("default_permissions",args_); if(geteuid() == 0) ::_set_option("allow_other",args_); else SysLog::notice("not auto setting allow_other since not running as root"); } static int _process_opt(const std::string &arg_) { int rv; rv = cfg.set(arg_); if(rv == -ENOATTR) return OPT_KEEP; if(rv < 0) cfg.errs.push_back({-rv,arg_}); return OPT_DISCARD; } static void _usage(void) { fmt::print("Usage: mergerfs [options] \n" "\n" "Visit https://trapexit.github.io/mergerfs for options.\n\n"); } static void _version(void) { fmt::print("mergerfs v{}\n\n" "https://github.com/trapexit/mergerfs\n" "https://trapexit.github.io/mergerfs\n" "https://github.com/trapexit/support\n" "\n" "ISC License (ISC)\n" "\n" "Copyright 2025, Antonio SJ Musumeci \n" "\n" "Permission to use, copy, modify, and/or distribute this software for\n" "any purpose with or without fee is hereby granted, provided that the\n" "above copyright notice and this permission notice appear in all\n" "copies.\n" "\n" "THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL\n" "WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED\n" "WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE\n" "AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL\n" "DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR\n" "PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER\n" "TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\n" "PERFORMANCE OF THIS SOFTWARE.\n\n" , (MERGERFS_VERSION[0] ? MERGERFS_VERSION : "unknown")); } static int _option_processor(void *data_, const char *arg_, int key_, fuse_args *outargs_) { std::string &prev_nonopt = *reinterpret_cast(data_); switch(key_) { case FUSE_OPT_KEY_OPT: return ::_process_opt(arg_); case FUSE_OPT_KEY_NONOPT: { if(prev_nonopt.empty()) { prev_nonopt = arg_; } else { int rv; rv = cfg.branches.from_string("+>" + prev_nonopt); if(rv < 0) cfg.errs.push_back({-rv,prev_nonopt}); prev_nonopt = arg_; } } return OPT_DISCARD; case MERGERFS_OPT_DEBUG: fuse_cfg.debug = true; return OPT_DISCARD; case MERGERFS_OPT_HELP: ::_usage(); exit(0); case MERGERFS_OPT_VERSION: ::_version(); exit(0); default: break; } return 0; } static void _check_for_mount_loop() { fs::path mount; std::vector branches; std::error_code ec; mount = cfg.mountpoint; branches = cfg.branches->to_paths(); for(const auto &branch : branches) { if(std::filesystem::equivalent(branch,mount,ec)) { std::string errstr; errstr = fmt::format("branches can not include the mountpoint: {}", branch.string()); cfg.errs.push_back({0,errstr}); } } } static void _postprocess_and_print_warnings() { if(fuse_cfg.uid != FUSE_CFG_INVALID_ID) SysLog::warning("overwriting 'uid' is untested and unsupported," " use at your own risk"); if(fuse_cfg.gid != FUSE_CFG_INVALID_ID) SysLog::warning("overwriting 'gid' is untested and unsupported," " use at your own risk"); if(fuse_cfg.umask != FUSE_CFG_INVALID_UMASK) SysLog::warning("overwriting 'umask' is untested and unsupported," " use at your own risk"); if(cfg.passthrough_io != PassthroughIO::ENUM::OFF) { if(cfg.cache_files == CacheFiles::ENUM::OFF) { SysLog::warning("'cache.files' can not be 'off' when using 'passthrough'." " Setting 'cache.files=auto-full'"); cfg.cache_files = CacheFiles::ENUM::AUTO_FULL; } if(cfg.cache_writeback == true) { SysLog::warning("'cache.writeback' can not be enabled when using 'passthrough'." " Setting 'cache.writeback=false'"); cfg.cache_writeback = false; } if(cfg.moveonenospc.enabled == true) { SysLog::warning("'moveonenospc' will not function when 'passthrough' is enabled"); } } } static void _cleanup_options() { if(!cfg.symlinkify) cfg.symlinkify_timeout = -1; } namespace options { void parse(fuse_args *args_) { std::string prev_nonopt; const struct fuse_opt opts[] = { FUSE_OPT_KEY("-d",MERGERFS_OPT_DEBUG), FUSE_OPT_KEY("-h",MERGERFS_OPT_HELP), FUSE_OPT_KEY("--help",MERGERFS_OPT_HELP), FUSE_OPT_KEY("-v",MERGERFS_OPT_VERSION), FUSE_OPT_KEY("-V",MERGERFS_OPT_VERSION), FUSE_OPT_KEY("--version",MERGERFS_OPT_VERSION), {NULL,-1U,0} }; fuse_opt_parse(args_, &prev_nonopt, opts, ::_option_processor); if(!prev_nonopt.empty()) { if(cfg.mountpoint.empty()) { cfg.mountpoint = prev_nonopt; } else { int rv; rv = cfg.branches.from_string("+>" + prev_nonopt); if(rv < 0) cfg.errs.push_back({-rv,prev_nonopt}); } } if(cfg.branches->empty()) cfg.errs.push_back({ENOENT,"branches not set"}); if(cfg.mountpoint.empty()) cfg.errs.push_back({ENOENT,"mountpoint not set"}); if(!cfg.errs.empty()) return; fuse_opt_add_arg(args_,cfg.mountpoint.c_str()); ::_postprocess_and_print_warnings(); ::_check_for_mount_loop(); ::_set_default_options(args_); ::_set_fsname(args_); ::_set_subtype(args_); ::_cleanup_options(); cfg.finish_initializing(); } } mergerfs-2.42.0/src/option_parser.hpp0000644000000000000000000000157515177346257016324 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "fuse.h" namespace options { void parse(fuse_args *args); } mergerfs-2.42.0/src/policies.cpp0000644000000000000000000001255115177346257015236 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "policies.hpp" #define IFERTA(X) if(name_ == #X) return &Policies::Action::X; #define IFERTC(X) if(name_ == #X) return &Policies::Create::X; #define IFERTS(X) if(name_ == #X) return &Policies::Search::X; #define IFERT(FUNC) \ FUNC(all) \ FUNC(epall) \ FUNC(epff) \ FUNC(eplfs) \ FUNC(eplus) \ FUNC(epmfs) \ FUNC(eppfrd) \ FUNC(eprand) \ FUNC(erofs) \ FUNC(ff) \ FUNC(lfs) \ FUNC(lus) \ FUNC(lup) \ FUNC(mfs) \ FUNC(msplfs) \ FUNC(msplus) \ FUNC(mspmfs) \ FUNC(msppfrd) \ FUNC(newest) \ FUNC(pfrd) \ FUNC(rand) Policy::ActionImpl* Policies::Action::find(const std::string_view name_) { IFERT(IFERTA); return NULL; } Policy::CreateImpl* Policies::Create::find(const std::string_view name_) { IFERT(IFERTC); return NULL; } Policy::SearchImpl* Policies::Search::find(const std::string_view name_) { IFERT(IFERTS); return NULL; } Policy::All::Action Policies::Action::all; Policy::EPAll::Action Policies::Action::epall; Policy::EPFF::Action Policies::Action::epff; Policy::EPLFS::Action Policies::Action::eplfs; Policy::EPLUS::Action Policies::Action::eplus; Policy::EPMFS::Action Policies::Action::epmfs; Policy::EPPFRD::Action Policies::Action::eppfrd; Policy::EPRand::Action Policies::Action::eprand; Policy::ERoFS::Action Policies::Action::erofs; Policy::FF::Action Policies::Action::ff; Policy::LFS::Action Policies::Action::lfs; Policy::LUS::Action Policies::Action::lus; Policy::LUP::Action Policies::Action::lup; Policy::MFS::Action Policies::Action::mfs; Policy::MSPLFS::Action Policies::Action::msplfs; Policy::MSPLUS::Action Policies::Action::msplus; Policy::MSPMFS::Action Policies::Action::mspmfs; Policy::MSPPFRD::Action Policies::Action::msppfrd; Policy::Newest::Action Policies::Action::newest; Policy::PFRD::Action Policies::Action::pfrd; Policy::Rand::Action Policies::Action::rand; Policy::All::Create Policies::Create::all; Policy::EPAll::Create Policies::Create::epall; Policy::EPFF::Create Policies::Create::epff; Policy::EPLFS::Create Policies::Create::eplfs; Policy::EPLUS::Create Policies::Create::eplus; Policy::EPMFS::Create Policies::Create::epmfs; Policy::EPPFRD::Create Policies::Create::eppfrd; Policy::EPRand::Create Policies::Create::eprand; Policy::ERoFS::Create Policies::Create::erofs; Policy::FF::Create Policies::Create::ff; Policy::LFS::Create Policies::Create::lfs; Policy::LUS::Create Policies::Create::lus; Policy::LUP::Create Policies::Create::lup; Policy::MFS::Create Policies::Create::mfs; Policy::MSPLFS::Create Policies::Create::msplfs; Policy::MSPLUS::Create Policies::Create::msplus; Policy::MSPMFS::Create Policies::Create::mspmfs; Policy::MSPPFRD::Create Policies::Create::msppfrd; Policy::Newest::Create Policies::Create::newest; Policy::PFRD::Create Policies::Create::pfrd; Policy::Rand::Create Policies::Create::rand; Policy::All::Search Policies::Search::all; Policy::EPAll::Search Policies::Search::epall; Policy::EPFF::Search Policies::Search::epff; Policy::EPLFS::Search Policies::Search::eplfs; Policy::EPLUS::Search Policies::Search::eplus; Policy::EPMFS::Search Policies::Search::epmfs; Policy::EPPFRD::Search Policies::Search::eppfrd; Policy::EPRand::Search Policies::Search::eprand; Policy::ERoFS::Search Policies::Search::erofs; Policy::FF::Search Policies::Search::ff; Policy::LFS::Search Policies::Search::lfs; Policy::LUS::Search Policies::Search::lus; Policy::LUP::Search Policies::Search::lup; Policy::MFS::Search Policies::Search::mfs; Policy::MSPLFS::Search Policies::Search::msplfs; Policy::MSPLUS::Search Policies::Search::msplus; Policy::MSPMFS::Search Policies::Search::mspmfs; Policy::MSPPFRD::Search Policies::Search::msppfrd; Policy::Newest::Search Policies::Search::newest; Policy::PFRD::Search Policies::Search::pfrd; Policy::Rand::Search Policies::Search::rand; mergerfs-2.42.0/src/policies.hpp0000644000000000000000000001034015177346257015235 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "policy_all.hpp" #include "policy_epall.hpp" #include "policy_epff.hpp" #include "policy_eplfs.hpp" #include "policy_eplus.hpp" #include "policy_epmfs.hpp" #include "policy_eppfrd.hpp" #include "policy_eprand.hpp" #include "policy_erofs.hpp" #include "policy_ff.hpp" #include "policy_lfs.hpp" #include "policy_lus.hpp" #include "policy_lup.hpp" #include "policy_mfs.hpp" #include "policy_msplfs.hpp" #include "policy_msplus.hpp" #include "policy_mspmfs.hpp" #include "policy_msppfrd.hpp" #include "policy_newest.hpp" #include "policy_pfrd.hpp" #include "policy_rand.hpp" struct Policies { struct Action { static Policy::ActionImpl *find(const std::string_view name); static Policy::All::Action all; static Policy::EPAll::Action epall; static Policy::EPFF::Action epff; static Policy::EPLFS::Action eplfs; static Policy::EPLUS::Action eplus; static Policy::EPMFS::Action epmfs; static Policy::EPPFRD::Action eppfrd; static Policy::EPRand::Action eprand; static Policy::ERoFS::Action erofs; static Policy::FF::Action ff; static Policy::LFS::Action lfs; static Policy::LUP::Action lup; static Policy::LUS::Action lus; static Policy::MFS::Action mfs; static Policy::MSPLFS::Action msplfs; static Policy::MSPLUS::Action msplus; static Policy::MSPMFS::Action mspmfs; static Policy::MSPPFRD::Action msppfrd; static Policy::Newest::Action newest; static Policy::PFRD::Action pfrd; static Policy::Rand::Action rand; }; struct Create { static Policy::CreateImpl *find(const std::string_view name); static Policy::All::Create all; static Policy::EPAll::Create epall; static Policy::EPFF::Create epff; static Policy::EPLFS::Create eplfs; static Policy::EPLUS::Create eplus; static Policy::EPMFS::Create epmfs; static Policy::EPPFRD::Create eppfrd; static Policy::EPRand::Create eprand; static Policy::ERoFS::Create erofs; static Policy::FF::Create ff; static Policy::LFS::Create lfs; static Policy::LUP::Create lup; static Policy::LUS::Create lus; static Policy::MFS::Create mfs; static Policy::MSPLFS::Create msplfs; static Policy::MSPLUS::Create msplus; static Policy::MSPMFS::Create mspmfs; static Policy::MSPPFRD::Create msppfrd; static Policy::Newest::Create newest; static Policy::PFRD::Create pfrd; static Policy::Rand::Create rand; }; struct Search { static Policy::SearchImpl *find(const std::string_view name); static Policy::All::Search all; static Policy::EPAll::Search epall; static Policy::EPFF::Search epff; static Policy::EPLFS::Search eplfs; static Policy::EPLUS::Search eplus; static Policy::EPMFS::Search epmfs; static Policy::EPPFRD::Search eppfrd; static Policy::EPRand::Search eprand; static Policy::ERoFS::Search erofs; static Policy::FF::Search ff; static Policy::LFS::Search lfs; static Policy::LUP::Search lup; static Policy::LUS::Search lus; static Policy::MFS::Search mfs; static Policy::MSPLFS::Search msplfs; static Policy::MSPLUS::Search msplus; static Policy::MSPMFS::Search mspmfs; static Policy::MSPPFRD::Search msppfrd; static Policy::Newest::Search newest; static Policy::PFRD::Search pfrd; static Policy::Rand::Search rand; }; }; mergerfs-2.42.0/src/policy.hpp0000644000000000000000000000731115177346257014731 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "branches.hpp" #include "strvec.hpp" #include "fs_path.hpp" #include #include #include namespace Policy { class ActionImpl { public: ActionImpl(const std::string &name_) : name(name_) { } public: std::string name; virtual int operator()(const Branches::Ptr&, const fs::path&, std::vector&) const = 0; }; class Action { public: Action(ActionImpl *impl_) : impl(impl_) {} Action& operator=(ActionImpl *impl_) { impl = impl_; return *this; } const std::string& name(void) const { return impl->name; } int operator()(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &output_) const { return (*impl)(branches_,fusepath_,output_); } operator bool() const { return (bool)impl; } private: ActionImpl *impl; }; class CreateImpl { public: CreateImpl(const std::string &name_) : name(name_) { } public: std::string name; virtual bool path_preserving(void) const = 0; virtual int operator()(const Branches::Ptr&, const fs::path&, std::vector&) const = 0; }; class Create { public: Create(CreateImpl *impl_) : impl(impl_) {} Create& operator=(CreateImpl *impl_) { impl = impl_; return *this; } const std::string& name(void) const { return impl->name; } bool path_preserving(void) const { return impl->path_preserving(); } int operator()(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &output_) const { return (*impl)(branches_,fusepath_,output_); } operator bool() const { return (bool)impl; } private: CreateImpl *impl; }; class SearchImpl { public: SearchImpl(const std::string &name_) : name(name_) { } public: std::string name; virtual int operator()(const Branches::Ptr&, const fs::path&, std::vector&) const = 0; }; class Search { public: Search(SearchImpl *impl_) : impl(impl_) {} Search& operator=(SearchImpl *impl_) { impl = impl_; return *this; } const std::string& name(void) const { return impl->name; } int operator()(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &output_) const { return (*impl)(branches_,fusepath_,output_); } operator bool() const { return (bool)impl; } private: SearchImpl *impl; }; } mergerfs-2.42.0/src/policy_all.cpp0000644000000000000000000000466215177346257015562 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "policy_all.hpp" #include "errno.hpp" #include "fs_exists.hpp" #include "fs_info.hpp" #include "fs_path.hpp" #include "policy.hpp" #include "policies.hpp" #include "policy_error.hpp" #include "strvec.hpp" #include static int _create(const Branches::Ptr &ibranches_, std::vector &obranches_) { int rv; int error; fs::info_t info; error = ENOENT; for(auto &branch : *ibranches_) { if(branch.ro_or_nc()) error_and_continue(error,EROFS); rv = fs::info(branch.path,&info); if(rv < 0) error_and_continue(error,ENOENT); if(info.readonly) error_and_continue(error,EROFS); if(info.spaceavail < branch.minfreespace()) error_and_continue(error,ENOSPC); obranches_.emplace_back(&branch); } if(obranches_.empty()) return -error; return 0; } int Policy::All::Action::operator()(const Branches::Ptr &ibranches_, const fs::path &fusepath_, std::vector &obranches_) const { return Policies::Action::epall(ibranches_,fusepath_,obranches_); } int Policy::All::Create::operator()(const Branches::Ptr &ibranches_, const fs::path &fusepath_, std::vector &obranches_) const { return ::_create(ibranches_,obranches_); } int Policy::All::Search::operator()(const Branches::Ptr &ibranches_, const fs::path &fusepath_, std::vector &obranches_) const { return Policies::Search::epall(ibranches_,fusepath_,obranches_); } mergerfs-2.42.0/src/policy_all.hpp0000644000000000000000000000342415177346257015562 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "policy.hpp" namespace Policy { namespace All { class Action final : public Policy::ActionImpl { public: Action() : Policy::ActionImpl("all") {} public: int operator()(const Branches::Ptr&, const fs::path&, std::vector&) const final; }; class Create final : public Policy::CreateImpl { public: Create() : Policy::CreateImpl("all") {} public: int operator()(const Branches::Ptr&, const fs::path&, std::vector&) const final; bool path_preserving(void) const final { return false; } }; class Search final : public Policy::SearchImpl { public: Search() : Policy::SearchImpl("all") {} public: int operator()(const Branches::Ptr&, const fs::path&, std::vector&) const final; }; } } mergerfs-2.42.0/src/policy_epall.cpp0000644000000000000000000000702315177346257016101 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "policy_epall.hpp" #include "errno.hpp" #include "fs_exists.hpp" #include "fs_info.hpp" #include "fs_path.hpp" #include "fs_statvfs_cache.hpp" #include "policy.hpp" #include "policy_epall.hpp" #include "policy_error.hpp" #include "strvec.hpp" #include static int _create(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) { int rv; int error; fs::info_t info; error = ENOENT; for(auto &branch : *branches_) { if(branch.ro_or_nc()) error_and_continue(error,EROFS); if(!fs::exists(branch.path,fusepath_)) error_and_continue(error,ENOENT); rv = fs::info(branch.path,&info); if(rv < 0) error_and_continue(error,ENOENT); if(info.readonly) error_and_continue(error,EROFS); if(info.spaceavail < branch.minfreespace()) error_and_continue(error,ENOSPC); paths_.emplace_back(&branch); } if(paths_.empty()) return -error; return 0; } static int _action(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) { int rv; int error; bool readonly; error = ENOENT; for(auto &branch : *branches_) { if(branch.ro()) error_and_continue(error,EROFS); if(!fs::exists(branch.path,fusepath_)) error_and_continue(error,ENOENT); rv = fs::statvfs_cache_readonly(branch.path,&readonly); if(rv < 0) error_and_continue(error,ENOENT); if(readonly) error_and_continue(error,EROFS); paths_.emplace_back(&branch); } if(paths_.empty()) return -error; return 0; } static int _search(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) { for(auto &branch : *branches_) { if(!fs::exists(branch.path,fusepath_)) continue; paths_.emplace_back(&branch); } if(paths_.empty()) return -ENOENT; return 0; } int Policy::EPAll::Action::operator()(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) const { return ::_action(branches_,fusepath_,paths_); } int Policy::EPAll::Create::operator()(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) const { return ::_create(branches_,fusepath_,paths_); } int Policy::EPAll::Search::operator()(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) const { return ::_search(branches_,fusepath_,paths_); } mergerfs-2.42.0/src/policy_epall.hpp0000644000000000000000000000346015177346257016107 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "policy.hpp" namespace Policy { namespace EPAll { class Action final : public Policy::ActionImpl { public: Action() : Policy::ActionImpl("epall") { } public: int operator()(const Branches::Ptr&, const fs::path&, std::vector&) const final; }; class Create final : public Policy::CreateImpl { public: Create() : Policy::CreateImpl("epall") { } public: int operator()(const Branches::Ptr&, const fs::path&, std::vector&) const final; bool path_preserving(void) const final { return true; } }; class Search final : public Policy::SearchImpl { public: Search() : Policy::SearchImpl("epall") { } public: int operator()(const Branches::Ptr&, const fs::path&, std::vector&) const final; }; } } mergerfs-2.42.0/src/policy_epff.cpp0000644000000000000000000000673315177346257015733 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "policy_epff.hpp" #include "branches.hpp" #include "errno.hpp" #include "fs_exists.hpp" #include "fs_info.hpp" #include "fs_path.hpp" #include "fs_statvfs_cache.hpp" #include "policy.hpp" #include "policy_error.hpp" #include #include using std::vector; static int _create(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) { int rv; int error; fs::info_t info; error = ENOENT; for(auto &branch : *branches_) { if(branch.ro_or_nc()) error_and_continue(error,EROFS); if(!fs::exists(branch.path,fusepath_)) error_and_continue(error,ENOENT); rv = fs::info(branch.path,&info); if(rv < 0) error_and_continue(error,ENOENT); if(info.readonly) error_and_continue(error,EROFS); if(info.spaceavail < branch.minfreespace()) error_and_continue(error,ENOSPC); paths_.emplace_back(&branch); return 0; } return -error; } static int _action(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) { int rv; int error; bool readonly; error = ENOENT; for(auto &branch : *branches_) { if(branch.ro()) error_and_continue(error,EROFS); if(!fs::exists(branch.path,fusepath_)) error_and_continue(error,ENOENT); rv = fs::statvfs_cache_readonly(branch.path,&readonly); if(rv < 0) error_and_continue(error,ENOENT); if(readonly) error_and_continue(error,EROFS); paths_.emplace_back(&branch); return 0; } return -error; } static int _search(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) { for(auto &branch : *branches_) { if(!fs::exists(branch.path,fusepath_)) continue; paths_.emplace_back(&branch); return 0; } return -ENOENT; } int Policy::EPFF::Action::operator()(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) const { return ::_action(branches_,fusepath_,paths_); } int Policy::EPFF::Create::operator()(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) const { return ::_create(branches_,fusepath_,paths_); } int Policy::EPFF::Search::operator()(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) const { return ::_search(branches_,fusepath_,paths_); } mergerfs-2.42.0/src/policy_epff.hpp0000644000000000000000000000342715177346257015735 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "policy.hpp" namespace Policy { namespace EPFF { class Action final : public Policy::ActionImpl { public: Action() : Policy::ActionImpl("epff") {} public: int operator()(const Branches::Ptr&, const fs::path&, std::vector&) const final; }; class Create final : public Policy::CreateImpl { public: Create() : Policy::CreateImpl("epff") {} public: int operator()(const Branches::Ptr&, const fs::path&, std::vector&) const final; bool path_preserving(void) const final { return true; } }; class Search final : public Policy::SearchImpl { public: Search() : Policy::SearchImpl("epff") {} public: int operator()(const Branches::Ptr&, const fs::path&, std::vector&) const final; }; } } mergerfs-2.42.0/src/policy_eplfs.cpp0000644000000000000000000001033615177346257016116 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "policy_eplfs.hpp" #include "errno.hpp" #include "fs_exists.hpp" #include "fs_info.hpp" #include "fs_path.hpp" #include "fs_statvfs_cache.hpp" #include "policies.hpp" #include "policy.hpp" #include "policy_error.hpp" #include #include #include using std::vector; static int _create(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) { int rv; int error; u64 eplfs; Branch *obranch; fs::info_t info; obranch = nullptr; error = ENOENT; eplfs = std::numeric_limits::max(); for(auto &branch : *branches_) { if(branch.ro_or_nc()) error_and_continue(error,EROFS); if(!fs::exists(branch.path,fusepath_)) error_and_continue(error,ENOENT); rv = fs::info(branch.path,&info); if(rv < 0) error_and_continue(error,ENOENT); if(info.readonly) error_and_continue(error,EROFS); if(info.spaceavail < branch.minfreespace()) error_and_continue(error,ENOSPC); if(info.spaceavail > eplfs) continue; eplfs = info.spaceavail; obranch = &branch; } if(!obranch) return -error; paths_.emplace_back(obranch); return 0; } static int _action(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) { int rv; int error; u64 eplfs; Branch *obranch; fs::info_t info; obranch = nullptr; error = ENOENT; eplfs = std::numeric_limits::max(); for(auto &branch : *branches_) { if(branch.ro()) error_and_continue(error,EROFS); if(!fs::exists(branch.path,fusepath_)) error_and_continue(error,ENOENT); rv = fs::info(branch.path,&info); if(rv < 0) error_and_continue(error,ENOENT); if(info.readonly) error_and_continue(error,EROFS); if(info.spaceavail > eplfs) continue; eplfs = info.spaceavail; obranch = &branch; } if(!obranch) return -error; paths_.emplace_back(obranch); return 0; } static int _search(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) { int rv; u64 eplfs; u64 spaceavail; Branch *obranch; obranch = nullptr; eplfs = std::numeric_limits::max(); for(auto &branch : *branches_) { if(!fs::exists(branch.path,fusepath_)) continue; rv = fs::statvfs_cache_spaceavail(branch.path,&spaceavail); if(rv < 0) continue; if(spaceavail > eplfs) continue; eplfs = spaceavail; obranch = &branch; } if(!obranch) return -ENOENT; paths_.emplace_back(obranch); return 0; } int Policy::EPLFS::Action::operator()(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) const { return ::_action(branches_,fusepath_,paths_); } int Policy::EPLFS::Create::operator()(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) const { return ::_create(branches_,fusepath_,paths_); } int Policy::EPLFS::Search::operator()(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) const { return ::_search(branches_,fusepath_,paths_); } mergerfs-2.42.0/src/policy_eplfs.hpp0000644000000000000000000000343315177346257016123 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "policy.hpp" namespace Policy { namespace EPLFS { class Action final : public Policy::ActionImpl { public: Action() : Policy::ActionImpl("eplfs") {} public: int operator()(const Branches::Ptr&, const fs::path&, std::vector&) const final; }; class Create final : public Policy::CreateImpl { public: Create() : Policy::CreateImpl("eplfs") {} public: int operator()(const Branches::Ptr&, const fs::path&, std::vector&) const final; bool path_preserving(void) const final { return true; } }; class Search final : public Policy::SearchImpl { public: Search() : Policy::SearchImpl("eplfs") {} public: int operator()(const Branches::Ptr&, const fs::path&, std::vector&) const final; }; } } mergerfs-2.42.0/src/policy_eplus.cpp0000644000000000000000000001023015177346257016126 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "policy_eplus.hpp" #include "errno.hpp" #include "fs_exists.hpp" #include "fs_info.hpp" #include "fs_path.hpp" #include "fs_statvfs_cache.hpp" #include "policy.hpp" #include "policy_error.hpp" #include #include static int _create(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) { int rv; int error; u64 eplus; fs::info_t info; Branch *obranch; obranch = nullptr; error = ENOENT; eplus = std::numeric_limits::max(); for(auto &branch : *branches_) { if(branch.ro_or_nc()) error_and_continue(error,EROFS); if(!fs::exists(branch.path,fusepath_)) error_and_continue(error,ENOENT); rv = fs::info(branch.path,&info); if(rv < 0) error_and_continue(error,ENOENT); if(info.readonly) error_and_continue(error,EROFS); if(info.spaceavail < branch.minfreespace()) error_and_continue(error,ENOSPC); if(info.spaceused >= eplus) continue; eplus = info.spaceused; obranch = &branch; } if(!obranch) return -error; paths_.emplace_back(obranch); return 0; } static int _action(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) { int rv; int error; u64 eplus; fs::info_t info; Branch *obranch; obranch = nullptr; error = ENOENT; eplus = std::numeric_limits::max(); for(auto &branch : *branches_) { if(branch.ro()) error_and_continue(error,EROFS); if(!fs::exists(branch.path,fusepath_)) error_and_continue(error,ENOENT); rv = fs::info(branch.path,&info); if(rv < 0) error_and_continue(error,ENOENT); if(info.readonly) error_and_continue(error,EROFS); if(info.spaceused >= eplus) continue; eplus = info.spaceused; obranch = &branch; } if(!obranch) return -error; paths_.emplace_back(obranch); return 0; } static int _search(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) { int rv; u64 eplus; u64 spaceused; Branch *obranch; obranch = nullptr; eplus = std::numeric_limits::max(); for(auto &branch : *branches_) { if(!fs::exists(branch.path,fusepath_)) continue; rv = fs::statvfs_cache_spaceused(branch.path,&spaceused); if(rv < 0) continue; if(spaceused >= eplus) continue; eplus = spaceused; obranch = &branch; } if(!obranch) return -ENOENT; paths_.emplace_back(obranch); return 0; } int Policy::EPLUS::Action::operator()(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) const { return ::_action(branches_,fusepath_,paths_); } int Policy::EPLUS::Create::operator()(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) const { return ::_create(branches_,fusepath_,paths_); } int Policy::EPLUS::Search::operator()(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) const { return ::_search(branches_,fusepath_,paths_); } mergerfs-2.42.0/src/policy_eplus.hpp0000644000000000000000000000343315177346257016142 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "policy.hpp" namespace Policy { namespace EPLUS { class Action final : public Policy::ActionImpl { public: Action() : Policy::ActionImpl("eplus") {} public: int operator()(const Branches::Ptr&, const fs::path&, std::vector&) const final; }; class Create final : public Policy::CreateImpl { public: Create() : Policy::CreateImpl("eplus") {} public: int operator()(const Branches::Ptr&, const fs::path&, std::vector&) const final; bool path_preserving(void) const final { return true; } }; class Search final : public Policy::SearchImpl { public: Search() : Policy::SearchImpl("eplus") {} public: int operator()(const Branches::Ptr&, const fs::path&, std::vector&) const final; }; } } mergerfs-2.42.0/src/policy_epmfs.cpp0000644000000000000000000001024315177346257016114 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "policy_epmfs.hpp" #include "errno.hpp" #include "fs_exists.hpp" #include "fs_info.hpp" #include "fs_path.hpp" #include "fs_statvfs_cache.hpp" #include "policy.hpp" #include "policy_epmfs.hpp" #include "policy_error.hpp" #include #include static int _create(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) { int rv; int error; u64 epmfs; fs::info_t info; Branch *obranch; obranch = nullptr; error = ENOENT; epmfs = std::numeric_limits::min(); for(auto &branch : *branches_) { if(branch.ro_or_nc()) error_and_continue(error,EROFS); if(!fs::exists(branch.path,fusepath_)) error_and_continue(error,ENOENT); rv = fs::info(branch.path,&info); if(rv < 0) error_and_continue(error,ENOENT); if(info.readonly) error_and_continue(error,EROFS); if(info.spaceavail < branch.minfreespace()) error_and_continue(error,ENOSPC); if(info.spaceavail < epmfs) continue; epmfs = info.spaceavail; obranch = &branch; } if(!obranch) return -error; paths_.emplace_back(obranch); return 0; } static int _action(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) { int rv; int error; u64 epmfs; fs::info_t info; Branch *obranch; obranch = nullptr; error = ENOENT; epmfs = std::numeric_limits::min(); for(auto &branch : *branches_) { if(branch.ro()) error_and_continue(error,EROFS); if(!fs::exists(branch.path,fusepath_)) error_and_continue(error,ENOENT); rv = fs::info(branch.path,&info); if(rv < 0) error_and_continue(error,ENOENT); if(info.readonly) error_and_continue(error,EROFS); if(info.spaceavail < epmfs) continue; epmfs = info.spaceavail; obranch = &branch; } if(!obranch) return -error; paths_.emplace_back(obranch); return 0; } static int _search(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) { int rv; u64 epmfs; u64 spaceavail; Branch *obranch; obranch = nullptr; epmfs = 0; for(auto &branch : *branches_) { if(!fs::exists(branch.path,fusepath_)) continue; rv = fs::statvfs_cache_spaceavail(branch.path,&spaceavail); if(rv < 0) continue; if(spaceavail < epmfs) continue; epmfs = spaceavail; obranch = &branch; } if(!obranch) return -ENOENT; paths_.emplace_back(obranch); return 0; } int Policy::EPMFS::Action::operator()(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) const { return ::_action(branches_,fusepath_,paths_); } int Policy::EPMFS::Create::operator()(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) const { return ::_create(branches_,fusepath_,paths_); } int Policy::EPMFS::Search::operator()(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) const { return ::_search(branches_,fusepath_,paths_); } mergerfs-2.42.0/src/policy_epmfs.hpp0000644000000000000000000000346015177346257016124 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "policy.hpp" namespace Policy { namespace EPMFS { class Action final : public Policy::ActionImpl { public: Action() : Policy::ActionImpl("epmfs") { } public: int operator()(const Branches::Ptr&, const fs::path&, std::vector&) const final; }; class Create final : public Policy::CreateImpl { public: Create() : Policy::CreateImpl("epmfs") { } public: int operator()(const Branches::Ptr&, const fs::path&, std::vector&) const final; bool path_preserving(void) const final { return true; } }; class Search final : public Policy::SearchImpl { public: Search() : Policy::SearchImpl("epmfs") { } public: int operator()(const Branches::Ptr&, const fs::path&, std::vector&) const final; }; } } mergerfs-2.42.0/src/procfs.cpp0000644000000000000000000000531315177346257014721 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif #include "procfs.hpp" #include "fatal.hpp" #include "fs_close.hpp" #include "fs_open.hpp" #include "fs_openat.hpp" #include "fs_read.hpp" #include "fmt/core.h" #include "scope_guard/scope_guard.hpp" #include #include static int g_PROCFS_DIR_FD = -1; namespace procfs { int PROC_SELF_FD_FD = -1; } static constexpr const char PROCFS_PATH[] = "/proc"; void procfs::init() { if(g_PROCFS_DIR_FD >= 0) return; g_PROCFS_DIR_FD = fs::open(PROCFS_PATH,O_PATH|O_DIRECTORY); if(g_PROCFS_DIR_FD < 0) fatal::abort("failed to open {}: {}",PROCFS_PATH,strerror(-g_PROCFS_DIR_FD)); #if defined(__linux__) static constexpr const char PROC_SELF_FD[] = "/proc/self/fd"; procfs::PROC_SELF_FD_FD = fs::open(PROC_SELF_FD,O_PATH|O_DIRECTORY); if(procfs::PROC_SELF_FD_FD < 0) fatal::abort("failed to open /proc/self/fd: {}",strerror(-procfs::PROC_SELF_FD_FD)); #endif } void procfs::shutdown() { if(g_PROCFS_DIR_FD >= 0) { fs::close(g_PROCFS_DIR_FD); g_PROCFS_DIR_FD = -1; } #if defined(__linux__) if(procfs::PROC_SELF_FD_FD >= 0) { fs::close(procfs::PROC_SELF_FD_FD); procfs::PROC_SELF_FD_FD = -1; } #endif } std::string procfs::get_name(const int tid_) { int fd; int rv; std::array commpath; fmt::format_to_n_result frv; if(g_PROCFS_DIR_FD < 0) fatal::abort("procfs::get_name called before procfs::init()"); // Reserve 1 byte for the NUL terminator that format_to_n does not write. frv = fmt::format_to_n(commpath.data(),commpath.size()-1,"{}/comm",tid_); frv.out[0] = '\0'; fd = fs::openat(g_PROCFS_DIR_FD,commpath.data(),O_RDONLY); if(fd < 0) return {}; DEFER { fs::close(fd); }; rv = fs::read(fd,commpath.data(),commpath.size()-1); if(rv <= 0) return {}; if(commpath[rv-1] == '\n') commpath[rv-1] = '\0'; else commpath[rv] = '\0'; return commpath.data(); } mergerfs-2.42.0/src/policy_eppfrd.cpp0000644000000000000000000001335315177346257016267 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "policy_eppfrd.hpp" #include "errno.hpp" #include "fs_exists.hpp" #include "fs_info.hpp" #include "fs_path.hpp" #include "fs_statvfs_cache.hpp" #include "policy.hpp" #include "policy_error.hpp" #include "rnd.hpp" #include "strvec.hpp" #include #include struct BranchInfo { u64 spaceavail; Branch *branch; }; typedef std::vector BranchInfoVec; static int _get_branchinfo_create(const Branches::Ptr &branches_, const fs::path &fusepath_, BranchInfoVec *branchinfo_, u64 *sum_) { int rv; int error; fs::info_t info; *sum_ = 0; error = ENOENT; for(auto &branch : *branches_) { if(branch.ro_or_nc()) error_and_continue(error,EROFS); if(!fs::exists(branch.path,fusepath_)) error_and_continue(error,ENOENT); rv = fs::info(branch.path,&info); if(rv < 0) error_and_continue(error,ENOENT); if(info.readonly) error_and_continue(error,EROFS); if(info.spaceavail < branch.minfreespace()) error_and_continue(error,ENOSPC); *sum_ += info.spaceavail; branchinfo_->push_back({info.spaceavail,&branch}); } return -error; } static int _get_branchinfo_action(const Branches::Ptr &branches_, const fs::path &fusepath_, BranchInfoVec *branchinfo_, u64 *sum_) { int rv; int error; fs::info_t info; *sum_ = 0; error = ENOENT; for(auto &branch : *branches_) { if(branch.ro()) error_and_continue(error,EROFS); if(!fs::exists(branch.path,fusepath_)) error_and_continue(error,ENOENT); rv = fs::info(branch.path,&info); if(rv < 0) error_and_continue(error,ENOENT); if(info.readonly) error_and_continue(error,EROFS); *sum_ += info.spaceavail; branchinfo_->push_back({info.spaceavail,&branch}); } return -error; } static int _get_branchinfo_search(const Branches::Ptr &branches_, const fs::path &fusepath_, BranchInfoVec *branchinfo_, u64 *sum_) { int rv; u64 spaceavail; *sum_ = 0; for(auto &branch : *branches_) { if(!fs::exists(branch.path,fusepath_)) continue; rv = fs::statvfs_cache_spaceavail(branch.path,&spaceavail); if(rv < 0) continue; *sum_ += spaceavail; branchinfo_->push_back({spaceavail,&branch}); } if(branchinfo_->empty()) return -ENOENT; return 0; } static Branch* _get_branch(const BranchInfoVec &branchinfo_, cu64 sum_) { u64 idx; u64 threshold; if(sum_ == 0) return NULL; idx = 0; threshold = RND::rand64(sum_); for(size_t i = 0; i < branchinfo_.size(); i++) { idx += branchinfo_[i].spaceavail; if(idx < threshold) continue; return branchinfo_[i].branch; } return NULL; } static int _create(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) { int err; u64 sum; Branch *branch; BranchInfoVec branchinfo; err = ::_get_branchinfo_create(branches_,fusepath_,&branchinfo,&sum); branch = ::_get_branch(branchinfo,sum); if(!branch) return err; paths_.emplace_back(branch); return 0; } static int _action(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) { int err; u64 sum; Branch *branch; BranchInfoVec branchinfo; err = ::_get_branchinfo_action(branches_,fusepath_,&branchinfo,&sum); branch = ::_get_branch(branchinfo,sum); if(!branch) return err; paths_.emplace_back(branch); return 0; } static int _search(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) { int err; u64 sum; Branch *branch; BranchInfoVec branchinfo; err = ::_get_branchinfo_search(branches_,fusepath_,&branchinfo,&sum); branch = ::_get_branch(branchinfo,sum); if(!branch) return err; paths_.emplace_back(branch); return 0; } int Policy::EPPFRD::Action::operator()(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) const { return ::_action(branches_,fusepath_,paths_); } int Policy::EPPFRD::Create::operator()(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) const { return ::_create(branches_,fusepath_,paths_); } int Policy::EPPFRD::Search::operator()(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) const { return ::_search(branches_,fusepath_,paths_); } mergerfs-2.42.0/src/policy_eppfrd.hpp0000644000000000000000000000343715177346257016276 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "policy.hpp" namespace Policy { namespace EPPFRD { class Action final : public Policy::ActionImpl { public: Action() : Policy::ActionImpl("eppfrd") {} public: int operator()(const Branches::Ptr&, const fs::path&, std::vector&) const final; }; class Create final : public Policy::CreateImpl { public: Create() : Policy::CreateImpl("eppfrd") {} public: int operator()(const Branches::Ptr&, const fs::path&, std::vector&) const final; bool path_preserving(void) const final { return true; } }; class Search final : public Policy::SearchImpl { public: Search() : Policy::SearchImpl("eppfrd") {} public: int operator()(const Branches::Ptr&, const fs::path&, std::vector&) const final; }; } } mergerfs-2.42.0/src/policy_eprand.cpp0000644000000000000000000000373215177346257016260 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "policy_eprand.hpp" #include "errno.hpp" #include "policies.hpp" #include "policy.hpp" #include "policy_eprand.hpp" #include "rnd.hpp" int Policy::EPRand::Action::operator()(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) const { int rv; rv = Policies::Action::epall(branches_,fusepath_,paths_); if(rv == 0) RND::shrink_to_rand_elem(paths_); return rv; } int Policy::EPRand::Create::operator()(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) const { int rv; rv = Policies::Create::epall(branches_,fusepath_,paths_); if(rv == 0) RND::shrink_to_rand_elem(paths_); return rv; } int Policy::EPRand::Search::operator()(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) const { int rv; rv = Policies::Search::epall(branches_,fusepath_,paths_); if(rv == 0) RND::shrink_to_rand_elem(paths_); return rv; } mergerfs-2.42.0/src/policy_eprand.hpp0000644000000000000000000000343715177346257016267 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "policy.hpp" namespace Policy { namespace EPRand { class Action final : public Policy::ActionImpl { public: Action() : Policy::ActionImpl("eprand") {} public: int operator()(const Branches::Ptr&, const fs::path&, std::vector&) const final; }; class Create final : public Policy::CreateImpl { public: Create() : Policy::CreateImpl("eprand") {} public: int operator()(const Branches::Ptr&, const fs::path&, std::vector&) const final; bool path_preserving(void) const final { return true; } }; class Search final : public Policy::SearchImpl { public: Search() : Policy::SearchImpl("eprand") {} public: int operator()(const Branches::Ptr&, const fs::path&, std::vector&) const final; }; } } mergerfs-2.42.0/src/policy_erofs.cpp0000644000000000000000000000306215177346257016121 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "policy_erofs.hpp" #include "errno.hpp" #include "policy.hpp" #include int Policy::ERoFS::Action::operator()(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) const { return -EROFS; } int Policy::ERoFS::Create::operator()(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) const { return -EROFS; } int Policy::ERoFS::Search::operator()(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) const { return -EROFS; } mergerfs-2.42.0/src/policy_erofs.hpp0000644000000000000000000000343415177346257016131 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "policy.hpp" namespace Policy { namespace ERoFS { class Action final : public Policy::ActionImpl { public: Action() : Policy::ActionImpl("erofs") {} public: int operator()(const Branches::Ptr&, const fs::path&, std::vector&) const final; }; class Create final : public Policy::CreateImpl { public: Create() : Policy::CreateImpl("erofs") {} public: int operator()(const Branches::Ptr&, const fs::path&, std::vector&) const final; bool path_preserving(void) const final { return false; } }; class Search final : public Policy::SearchImpl { public: Search() : Policy::SearchImpl("erofs") {} public: int operator()(const Branches::Ptr&, const fs::path&, std::vector&) const final; }; } } mergerfs-2.42.0/src/policy_error.hpp0000644000000000000000000000261115177346257016140 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #define error_and_continue(CUR,ERR) \ { \ policy::calc_error(CUR,ERR); \ continue; \ } namespace policy { static inline void calc_error(int &cur_, int err_) { switch(cur_) { default: case ENOENT: cur_ = err_; break; case ENOSPC: if(err_ != ENOENT) cur_ = err_; break; case EROFS: if((err_ != ENOENT) && (err_ != ENOSPC)) cur_ = err_; break; } } } mergerfs-2.42.0/src/policy_ff.cpp0000644000000000000000000000472615177346257015406 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "policy_ff.hpp" #include "errno.hpp" #include "fs_exists.hpp" #include "fs_info.hpp" #include "fs_path.hpp" #include "policies.hpp" #include "policy.hpp" #include "policy_error.hpp" #include static int _create(const Branches::Ptr &ibranches_, std::vector &obranches_) { int rv; int error; fs::info_t info; error = ENOENT; for(auto &branch : *ibranches_) { if(branch.ro_or_nc()) error_and_continue(error,EROFS); rv = fs::info(branch.path,&info); if(rv < 0) error_and_continue(error,ENOENT); if(info.readonly) error_and_continue(error,EROFS); if(info.spaceavail < branch.minfreespace()) error_and_continue(error,ENOSPC); obranches_.emplace_back(&branch); return 0; } return -error; } int Policy::FF::Action::operator()(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) const { return Policies::Action::epff(branches_,fusepath_,paths_); } int Policy::FF::Create::operator()(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) const { return ::_create(branches_,paths_); } int Policy::FF::Search::operator()(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &output_) const { for(auto &branch : *branches_) { if(!fs::exists(branch.path,fusepath_)) continue; output_.emplace_back(&branch); return 0; } return -ENOENT; } mergerfs-2.42.0/src/policy_ff.hpp0000644000000000000000000000342115177346257015402 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "policy.hpp" namespace Policy { namespace FF { class Action final : public Policy::ActionImpl { public: Action() : Policy::ActionImpl("ff") {} public: int operator()(const Branches::Ptr&, const fs::path&, std::vector&) const final; }; class Create final : public Policy::CreateImpl { public: Create() : Policy::CreateImpl("ff") {} public: bool path_preserving(void) const final { return false; } int operator()(const Branches::Ptr&, const fs::path&, std::vector&) const final; }; class Search final : public Policy::SearchImpl { public: Search() : Policy::SearchImpl("ff") {} public: int operator()(const Branches::Ptr&, const fs::path&, std::vector&) const final; }; } } mergerfs-2.42.0/src/policy_lfs.cpp0000644000000000000000000000512415177346257015570 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "policy_lfs.hpp" #include "errno.hpp" #include "fs_exists.hpp" #include "fs_info.hpp" #include "fs_path.hpp" #include "policies.hpp" #include "policy.hpp" #include "policy_error.hpp" #include "strvec.hpp" #include #include static int _create(const Branches::Ptr &branches_, std::vector &paths_) { int rv; int error; u64 lfs; fs::info_t info; Branch *obranch; obranch = nullptr; error = ENOENT; lfs = std::numeric_limits::max(); for(auto &branch : *branches_) { if(branch.ro_or_nc()) error_and_continue(error,EROFS); rv = fs::info(branch.path,&info); if(rv < 0) error_and_continue(error,ENOENT); if(info.readonly) error_and_continue(error,EROFS); if(info.spaceavail < branch.minfreespace()) error_and_continue(error,ENOSPC); if(info.spaceavail > lfs) continue; lfs = info.spaceavail; obranch = &branch; } if(!obranch) return -error; paths_.emplace_back(obranch); return 0; } int Policy::LFS::Action::operator()(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) const { return Policies::Action::eplfs(branches_,fusepath_,paths_); } int Policy::LFS::Create::operator()(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) const { return ::_create(branches_,paths_); } int Policy::LFS::Search::operator()(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) const { return Policies::Search::eplfs(branches_,fusepath_,paths_); } mergerfs-2.42.0/src/policy_lfs.hpp0000644000000000000000000000342015177346257015572 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "policy.hpp" namespace Policy { namespace LFS { class Action final : public Policy::ActionImpl { public: Action() : Policy::ActionImpl("lfs") {} public: int operator()(const Branches::Ptr&, const fs::path&, std::vector&) const final; }; class Create final : public Policy::CreateImpl { public: Create() : Policy::CreateImpl("lfs") {} public: int operator()(const Branches::Ptr&, const fs::path&, std::vector&) const final; bool path_preserving() const final { return false; } }; class Search final : public Policy::SearchImpl { public: Search() : Policy::SearchImpl("lfs") {} public: int operator()(const Branches::Ptr&, const fs::path&, std::vector&) const final; }; } } mergerfs-2.42.0/src/policy_lup.cpp0000644000000000000000000001257215177346257015611 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci and contributors Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "policy_lup.hpp" #include "errno.hpp" #include "fs_exists.hpp" #include "fs_info.hpp" #include "fs_path.hpp" #include "policies.hpp" #include "fs_statvfs_cache.hpp" #include "policy.hpp" #include "policy_error.hpp" #include "base_types.h" #include #include static int _action(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) { int rv; int error; fs::info_t info; Branch *obranch; u64 best_used; u64 best_total; best_used = 0; best_total = 1; obranch = nullptr; error = ENOENT; for(auto &branch : *branches_) { if(branch.ro()) error_and_continue(error,EROFS); if(!fs::exists(branch.path,fusepath_)) error_and_continue(error,ENOENT); rv = fs::info(branch.path,&info); if(rv < 0) error_and_continue(error,ENOENT); if(info.readonly) error_and_continue(error,EROFS); u64 used = info.spaceused; u64 total = info.spaceused + info.spaceavail; if(total == 0) { used = 0; total = 1; } if(!obranch) { best_used = used; best_total = total; obranch = &branch; continue; } f80 lhs = (f80)used * (f80)best_total; f80 rhs = (f80)best_used * (f80)total; if(lhs >= rhs) continue; best_used = used; best_total = total; obranch = &branch; } if(!obranch) return -error; paths_.emplace_back(obranch); return 0; } static int _search(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) { int rv; u64 used; u64 avail; u64 best_used; u64 best_total; Branch *obranch; best_used = 0; best_total = 1; obranch = nullptr; for(auto &branch : *branches_) { if(!fs::exists(branch.path,fusepath_)) continue; rv = fs::statvfs_cache_spaceused(branch.path,&used); if(rv < 0) continue; rv = fs::statvfs_cache_spaceavail(branch.path,&avail); if(rv < 0) continue; u64 total = used + avail; if(total == 0) { used = 0; total = 1; } if(!obranch) { best_used = used; best_total = total; obranch = &branch; continue; } f80 lhs = (f80)used * (f80)best_total; f80 rhs = (f80)best_used * (f80)total; if(lhs >= rhs) continue; best_used = used; best_total = total; obranch = &branch; } if(!obranch) return -ENOENT; paths_.emplace_back(obranch); return 0; } static int _create(const Branches::Ptr &branches_, std::vector &paths_) { int rv; int error; u64 best_used; u64 best_total; fs::info_t info; Branch *obranch; best_used = 0; best_total = 1; obranch = nullptr; error = ENOENT; for(auto &branch : *branches_) { if(branch.ro_or_nc()) error_and_continue(error,EROFS); rv = fs::info(branch.path,&info); if(rv < 0) error_and_continue(error,ENOENT); if(info.readonly) error_and_continue(error,EROFS); if(info.spaceavail < branch.minfreespace()) error_and_continue(error,ENOSPC); u64 used = info.spaceused; u64 total = info.spaceused + info.spaceavail; if(total == 0) { used = 0; total = 1; } if(!obranch) { best_used = used; best_total = total; obranch = &branch; continue; } f80 lhs = (f80)used * (f80)best_total; f80 rhs = (f80)best_used * (f80)total; if(lhs >= rhs) continue; best_used = used; best_total = total; obranch = &branch; } if(!obranch) return -error; paths_.emplace_back(obranch); return 0; } int Policy::LUP::Action::operator()(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) const { return ::_action(branches_,fusepath_,paths_); } int Policy::LUP::Create::operator()(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) const { return ::_create(branches_,paths_); } int Policy::LUP::Search::operator()(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) const { return ::_search(branches_,fusepath_,paths_); } mergerfs-2.42.0/src/policy_lup.hpp0000644000000000000000000000346315177346257015615 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci and contributors Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "policy.hpp" namespace Policy { namespace LUP { class Action final : public Policy::ActionImpl { public: Action() : Policy::ActionImpl("lup") {} public: int operator()(const Branches::Ptr &, const fs::path &, std::vector &) const final; }; class Create final : public Policy::CreateImpl { public: Create() : Policy::CreateImpl("lup") {} public: int operator()(const Branches::Ptr &, const fs::path &, std::vector &) const final; bool path_preserving() const final { return false; } }; class Search final : public Policy::SearchImpl { public: Search() : Policy::SearchImpl("lup") {} public: int operator()(const Branches::Ptr &, const fs::path &, std::vector &) const final; }; } } mergerfs-2.42.0/src/policy_lus.cpp0000644000000000000000000000522215177346257015606 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "policy_lus.hpp" #include "errno.hpp" #include "fs_exists.hpp" #include "fs_info.hpp" #include "fs_path.hpp" #include "policies.hpp" #include "policy.hpp" #include "policy_error.hpp" #include "policy_lus.hpp" #include "strvec.hpp" #include #include #include using std::vector; static int _create(const Branches::Ptr &branches_, std::vector &paths_) { int rv; int error; u64 lus; fs::info_t info; Branch *obranch; obranch = nullptr; error = ENOENT; lus = std::numeric_limits::max(); for(auto &branch : *branches_) { if(branch.ro_or_nc()) error_and_continue(error,EROFS); rv = fs::info(branch.path,&info); if(rv < 0) error_and_continue(error,ENOENT); if(info.readonly) error_and_continue(error,EROFS); if(info.spaceavail < branch.minfreespace()) error_and_continue(error,ENOSPC); if(info.spaceused >= lus) continue; lus = info.spaceused; obranch = &branch; } if(!obranch) return -error; paths_.emplace_back(obranch); return 0; } int Policy::LUS::Action::operator()(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) const { return Policies::Action::eplus(branches_,fusepath_,paths_); } int Policy::LUS::Create::operator()(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) const { return ::_create(branches_,paths_); } int Policy::LUS::Search::operator()(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) const { return Policies::Search::eplus(branches_,fusepath_,paths_); } mergerfs-2.42.0/src/policy_lus.hpp0000644000000000000000000000342015177346257015611 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "policy.hpp" namespace Policy { namespace LUS { class Action final : public Policy::ActionImpl { public: Action() : Policy::ActionImpl("lus") {} public: int operator()(const Branches::Ptr&, const fs::path&, std::vector&) const final; }; class Create final : public Policy::CreateImpl { public: Create() : Policy::CreateImpl("lus") {} public: int operator()(const Branches::Ptr&, const fs::path&, std::vector&) const final; bool path_preserving() const final { return false; } }; class Search final : public Policy::SearchImpl { public: Search() : Policy::SearchImpl("lus") {} public: int operator()(const Branches::Ptr&, const fs::path&, std::vector&) const final; }; } } mergerfs-2.42.0/src/policy_mfs.cpp0000644000000000000000000000501615177346257015571 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "policy_mfs.hpp" #include "errno.hpp" #include "fs_exists.hpp" #include "fs_info.hpp" #include "fs_path.hpp" #include "policies.hpp" #include "policy.hpp" #include "policy_error.hpp" #include static int _create(const Branches::Ptr &branches_, std::vector &paths_) { int rv; int error; u64 mfs; fs::info_t info; Branch *obranch; obranch = nullptr; error = ENOENT; mfs = 0; for(auto &branch : *branches_) { if(branch.ro_or_nc()) error_and_continue(error,EROFS); rv = fs::info(branch.path,&info); if(rv < 0) error_and_continue(error,ENOENT); if(info.readonly) error_and_continue(error,EROFS); if(info.spaceavail < branch.minfreespace()) error_and_continue(error,ENOSPC); if(info.spaceavail < mfs) continue; mfs = info.spaceavail; obranch = &branch; } if(!obranch) return -error; paths_.emplace_back(obranch); return 0; } int Policy::MFS::Action::operator()(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) const { return Policies::Action::epmfs(branches_,fusepath_,paths_); } int Policy::MFS::Create::operator()(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) const { return ::_create(branches_,paths_); } int Policy::MFS::Search::operator()(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) const { return Policies::Search::epmfs(branches_,fusepath_,paths_); } mergerfs-2.42.0/src/policy_mfs.hpp0000644000000000000000000000342015177346257015573 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "policy.hpp" namespace Policy { namespace MFS { class Action final : public Policy::ActionImpl { public: Action() : Policy::ActionImpl("mfs") {} public: int operator()(const Branches::Ptr&, const fs::path&, std::vector&) const final; }; class Create final : public Policy::CreateImpl { public: Create() : Policy::CreateImpl("mfs") {} public: int operator()(const Branches::Ptr&, const fs::path&, std::vector&) const final; bool path_preserving() const final { return false; } }; class Search final : public Policy::SearchImpl { public: Search() : Policy::SearchImpl("mfs") {} public: int operator()(const Branches::Ptr&, const fs::path&, std::vector&) const final; }; } } mergerfs-2.42.0/src/policy_msplfs.cpp0000644000000000000000000000631715177346257016315 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "policy_msplfs.hpp" #include "errno.hpp" #include "fs_exists.hpp" #include "fs_info.hpp" #include "fs_path.hpp" #include "fs_statvfs_cache.hpp" #include "policies.hpp" #include "policy.hpp" #include "policy_error.hpp" #include "strvec.hpp" #include #include #include static Branch* _create_1(const Branches::Ptr &branches_, const fs::path &fusepath_, int *err_) { int rv; u64 lfs; fs::info_t info; Branch *obranch; obranch = nullptr; lfs = std::numeric_limits::max(); for(auto &branch : *branches_) { if(branch.ro_or_nc()) error_and_continue(*err_,EROFS); if(!fs::exists(branch.path,fusepath_)) error_and_continue(*err_,ENOENT); rv = fs::info(branch.path,&info); if(rv < 0) error_and_continue(*err_,ENOENT); if(info.readonly) error_and_continue(*err_,EROFS); if(info.spaceavail < branch.minfreespace()) error_and_continue(*err_,ENOSPC); if(info.spaceavail > lfs) continue; lfs = info.spaceavail; obranch = &branch; } return obranch; } static int _create(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) { int error; Branch *branch; fs::path fusepath; error = ENOENT; fusepath = fusepath_; for(;;) { branch = ::_create_1(branches_,fusepath,&error); if(branch) break; if(fusepath == "/") break; fusepath = fusepath.parent_path(); } if(!branch) return -error; paths_.emplace_back(branch); return 0; } int Policy::MSPLFS::Action::operator()(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) const { return Policies::Action::eplfs(branches_,fusepath_,paths_); } int Policy::MSPLFS::Create::operator()(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) const { return ::_create(branches_,fusepath_,paths_); } int Policy::MSPLFS::Search::operator()(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) const { return Policies::Search::eplfs(branches_,fusepath_,paths_); } mergerfs-2.42.0/src/policy_msplfs.hpp0000644000000000000000000000343315177346257016316 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "policy.hpp" namespace Policy { namespace MSPLFS { class Action final : public Policy::ActionImpl { public: Action() : Policy::ActionImpl("msplfs") {} public: int operator()(const Branches::Ptr&, const fs::path&, std::vector&) const final; }; class Create final : public Policy::CreateImpl { public: Create() : Policy::CreateImpl("msplfs") {} public: int operator()(const Branches::Ptr&, const fs::path&, std::vector&) const final; bool path_preserving() const final { return true; } }; class Search final : public Policy::SearchImpl { public: Search() : Policy::SearchImpl("msplfs") {} public: int operator()(const Branches::Ptr&, const fs::path&, std::vector&) const final; }; } } mergerfs-2.42.0/src/policy_msplus.cpp0000644000000000000000000000621015177346257016324 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "policy_msplus.hpp" #include "errno.hpp" #include "fs_exists.hpp" #include "fs_info.hpp" #include "fs_path.hpp" #include "fs_statvfs_cache.hpp" #include "policies.hpp" #include "policy.hpp" #include "policy_error.hpp" #include static Branch* _create_1(const Branches::Ptr &branches_, const fs::path &fusepath_, int *err_) { int rv; u64 lus; fs::info_t info; Branch *obranch; obranch = nullptr; lus = std::numeric_limits::max(); for(auto &branch : *branches_) { if(branch.ro_or_nc()) error_and_continue(*err_,EROFS); if(!fs::exists(branch.path,fusepath_)) error_and_continue(*err_,ENOENT); rv = fs::info(branch.path,&info); if(rv < 0) error_and_continue(*err_,ENOENT); if(info.readonly) error_and_continue(*err_,EROFS); if(info.spaceavail < branch.minfreespace()) error_and_continue(*err_,ENOSPC); if(info.spaceused >= lus) continue; lus = info.spaceused; obranch = &branch; } return obranch; } static int _create(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) { int err; Branch *branch; fs::path fusepath; err = ENOENT; fusepath = fusepath_; for(;;) { branch = ::_create_1(branches_,fusepath,&err); if(branch) break; if(fusepath == "/") break; fusepath = fusepath.parent_path(); } if(!branch) return -err; paths_.emplace_back(branch); return 0; } int Policy::MSPLUS::Action::operator()(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) const { return Policies::Action::eplus(branches_,fusepath_,paths_); } int Policy::MSPLUS::Create::operator()(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) const { return ::_create(branches_,fusepath_,paths_); } int Policy::MSPLUS::Search::operator()(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) const { return Policies::Search::eplus(branches_,fusepath_,paths_); } mergerfs-2.42.0/src/policy_msplus.hpp0000644000000000000000000000343315177346257016335 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "policy.hpp" namespace Policy { namespace MSPLUS { class Action final : public Policy::ActionImpl { public: Action() : Policy::ActionImpl("msplus") {} public: int operator()(const Branches::Ptr&, const fs::path&, std::vector&) const final; }; class Create final : public Policy::CreateImpl { public: Create() : Policy::CreateImpl("msplus") {} public: int operator()(const Branches::Ptr&, const fs::path&, std::vector&) const final; bool path_preserving() const final { return true; } }; class Search final : public Policy::SearchImpl { public: Search() : Policy::SearchImpl("msplus") {} public: int operator()(const Branches::Ptr&, const fs::path&, std::vector&) const final; }; } } mergerfs-2.42.0/src/policy_mspmfs.cpp0000644000000000000000000000632315177346257016313 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "policy_mspmfs.hpp" #include "errno.hpp" #include "fs_exists.hpp" #include "fs_info.hpp" #include "fs_path.hpp" #include "fs_statvfs_cache.hpp" #include "policies.hpp" #include "policy.hpp" #include "policy_error.hpp" #include "policy_mspmfs.hpp" #include #include #include static Branch* _create_1(const Branches::Ptr &branches_, const fs::path &fusepath_, int *err_) { int rv; u64 mfs; fs::info_t info; Branch *obranch; obranch = nullptr; mfs = std::numeric_limits::min(); for(auto &branch : *branches_) { if(branch.ro_or_nc()) error_and_continue(*err_,EROFS); if(!fs::exists(branch.path,fusepath_)) error_and_continue(*err_,ENOENT); rv = fs::info(branch.path,&info); if(rv < 0) error_and_continue(*err_,ENOENT); if(info.readonly) error_and_continue(*err_,EROFS); if(info.spaceavail < branch.minfreespace()) error_and_continue(*err_,ENOSPC); if(info.spaceavail < mfs) continue; mfs = info.spaceavail; obranch = &branch; } return obranch; } static int _create(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) { int error; Branch *branch; fs::path fusepath; error = ENOENT; fusepath = fusepath_; for(;;) { branch = ::_create_1(branches_,fusepath,&error); if(branch) break; if(fusepath == "/") break; fusepath = fusepath.parent_path(); } if(!branch) return -error; paths_.emplace_back(branch); return 0; } int Policy::MSPMFS::Action::operator()(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) const { return Policies::Action::epmfs(branches_,fusepath_,paths_); } int Policy::MSPMFS::Create::operator()(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) const { return ::_create(branches_,fusepath_,paths_); } int Policy::MSPMFS::Search::operator()(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) const { return Policies::Search::epmfs(branches_,fusepath_,paths_); } mergerfs-2.42.0/src/policy_mspmfs.hpp0000644000000000000000000000343315177346257016317 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "policy.hpp" namespace Policy { namespace MSPMFS { class Action final : public Policy::ActionImpl { public: Action() : Policy::ActionImpl("mspmfs") {} public: int operator()(const Branches::Ptr&, const fs::path&, std::vector&) const final; }; class Create final : public Policy::CreateImpl { public: Create() : Policy::CreateImpl("mspmfs") {} public: int operator()(const Branches::Ptr&, const fs::path&, std::vector&) const final; bool path_preserving() const final { return true; } }; class Search final : public Policy::SearchImpl { public: Search() : Policy::SearchImpl("mspmfs") {} public: int operator()(const Branches::Ptr&, const fs::path&, std::vector&) const final; }; } } mergerfs-2.42.0/src/policy_msppfrd.cpp0000644000000000000000000001006015177346257016452 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "policy_msppfrd.hpp" #include "errno.hpp" #include "fs_exists.hpp" #include "fs_info.hpp" #include "fs_path.hpp" #include "fs_statvfs_cache.hpp" #include "policy.hpp" #include "policy_msppfrd.hpp" #include "policies.hpp" #include "policy_error.hpp" #include "rnd.hpp" #include struct BranchInfo { u64 spaceavail; Branch *branch; }; typedef std::vector BranchInfoVec; static int _create_1(const Branches::Ptr &branches_, const fs::path &fusepath_, BranchInfoVec *branchinfo_, u64 *sum_) { int rv; int error; fs::info_t info; *sum_ = 0; error = ENOENT; for(auto &branch : *branches_) { if(branch.ro_or_nc()) error_and_continue(error,EROFS); if(!fs::exists(branch.path,fusepath_)) error_and_continue(error,ENOENT); rv = fs::info(branch.path,&info); if(rv < 0) error_and_continue(error,ENOENT); if(info.readonly) error_and_continue(error,EROFS); if(info.spaceavail < branch.minfreespace()) error_and_continue(error,ENOSPC); *sum_ += info.spaceavail; branchinfo_->push_back({info.spaceavail,&branch}); } return -error; } static int _get_branchinfo(const Branches::Ptr &branches_, const fs::path &fusepath_, BranchInfoVec *branchinfo_, u64 *sum_) { int rv; fs::path fusepath; fusepath = fusepath_; for(;;) { rv = ::_create_1(branches_,fusepath,branchinfo_,sum_); if(branchinfo_->size()) break; if(fusepath == "/") break; fusepath = fusepath.parent_path(); } return rv; } static Branch* _get_branch(const BranchInfoVec &branchinfo_, cu64 sum_) { u64 idx; u64 threshold; if(sum_ == 0) return nullptr; idx = 0; threshold = RND::rand64(sum_); for(const auto &branchinfo : branchinfo_) { idx += branchinfo.spaceavail; if(idx < threshold) continue; return branchinfo.branch; } return nullptr; } static int _create(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) { int rv; u64 sum; Branch *branch; BranchInfoVec branchinfo; rv = ::_get_branchinfo(branches_,fusepath_,&branchinfo,&sum); branch = ::_get_branch(branchinfo,sum); if(!branch) return rv; paths_.emplace_back(branch); return 0; } int Policy::MSPPFRD::Action::operator()(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) const { return Policies::Action::eppfrd(branches_,fusepath_,paths_); } int Policy::MSPPFRD::Create::operator()(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) const { return ::_create(branches_,fusepath_,paths_); } int Policy::MSPPFRD::Search::operator()(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) const { return Policies::Search::eppfrd(branches_,fusepath_,paths_); } mergerfs-2.42.0/src/policy_msppfrd.hpp0000644000000000000000000000344015177346257016463 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "policy.hpp" namespace Policy { namespace MSPPFRD { class Action final : public Policy::ActionImpl { public: Action() : Policy::ActionImpl("msppfrd") {} public: int operator()(const Branches::Ptr&, const fs::path&, std::vector&) const final; }; class Create final : public Policy::CreateImpl { public: Create() : Policy::CreateImpl("msppfrd") {} public: int operator()(const Branches::Ptr&, const fs::path&, std::vector&) const final; bool path_preserving() const final { return true; }; }; class Search final : public Policy::SearchImpl { public: Search() : Policy::SearchImpl("msppfrd") {} public: int operator()(const Branches::Ptr&, const fs::path&, std::vector&) const final; }; } } mergerfs-2.42.0/src/policy_newest.cpp0000644000000000000000000001020715177346257016307 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "policy_newest.hpp" #include "errno.hpp" #include "fs_exists.hpp" #include "fs_info.hpp" #include "fs_path.hpp" #include "fs_statvfs_cache.hpp" #include "policy.hpp" #include "policy_error.hpp" #include #include #include static int _create(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) { int rv; int err; time_t newest; struct stat st; fs::info_t info; Branch *obranch; obranch = nullptr; err = ENOENT; newest = std::numeric_limits::min(); for(auto &branch : *branches_) { if(branch.ro_or_nc()) error_and_continue(err,EROFS); if(!fs::exists(branch.path,fusepath_,&st)) error_and_continue(err,ENOENT); if(st.st_mtime < newest) continue; rv = fs::info(branch.path,&info); if(rv < 0) error_and_continue(err,ENOENT); if(info.readonly) error_and_continue(err,EROFS); if(info.spaceavail < branch.minfreespace()) error_and_continue(err,ENOSPC); newest = st.st_mtime; obranch = &branch; } if(!obranch) return -err; paths_.emplace_back(obranch); return 0; } static int _action(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) { int rv; int err; bool readonly; time_t newest; struct stat st; Branch *obranch; obranch = nullptr; err = ENOENT; newest = std::numeric_limits::min(); for(auto &branch : *branches_) { if(branch.ro()) error_and_continue(err,EROFS); if(!fs::exists(branch.path,fusepath_,&st)) error_and_continue(err,ENOENT); if(st.st_mtime < newest) continue; rv = fs::statvfs_cache_readonly(branch.path,&readonly); if(rv < 0) error_and_continue(err,ENOENT); if(readonly) error_and_continue(err,EROFS); newest = st.st_mtime; obranch = &branch; } if(!obranch) return -err; paths_.emplace_back(obranch); return 0; } static int _search(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) { time_t newest; struct stat st; Branch *obranch; obranch = nullptr; newest = std::numeric_limits::min(); for(auto &branch : *branches_) { if(!fs::exists(branch.path,fusepath_,&st)) continue; if(st.st_mtime < newest) continue; newest = st.st_mtime; obranch = &branch; } if(!obranch) return -ENOENT; paths_.emplace_back(obranch); return 0; } int Policy::Newest::Action::operator()(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) const { return ::_action(branches_,fusepath_,paths_); } int Policy::Newest::Create::operator()(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) const { return ::_create(branches_,fusepath_,paths_); } int Policy::Newest::Search::operator()(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) const { return ::_search(branches_,fusepath_,paths_); } mergerfs-2.42.0/src/policy_newest.hpp0000644000000000000000000000343415177346257016320 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "policy.hpp" namespace Policy { namespace Newest { class Action final : public Policy::ActionImpl { public: Action() : Policy::ActionImpl("newest") {} public: int operator()(const Branches::Ptr&, const fs::path&, std::vector&) const final; }; class Create final : public Policy::CreateImpl { public: Create() : Policy::CreateImpl("newest") {} public: int operator()(const Branches::Ptr&, const fs::path&, std::vector&) const final; bool path_preserving() const final { return false; } }; class Search final : public Policy::SearchImpl { public: Search() : Policy::SearchImpl("newest") {} public: int operator()(const Branches::Ptr&, const fs::path&, std::vector&) const final; }; } } mergerfs-2.42.0/src/policy_pfrd.cpp0000644000000000000000000000660015177346257015737 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "policy_pfrd.hpp" #include "errno.hpp" #include "fs_info.hpp" #include "fs_path.hpp" #include "policies.hpp" #include "policy.hpp" #include "policy_error.hpp" #include "policy_pfrd.hpp" #include "rnd.hpp" #include "strvec.hpp" #include #include struct BranchInfo { u64 spaceavail; Branch *branch; }; typedef std::vector BranchInfoVec; static int _get_branchinfo(const Branches::Ptr &branches_, BranchInfoVec *branchinfo_, u64 *sum_) { int rv; int err; fs::info_t info; *sum_ = 0; err = ENOENT; for(auto &branch : *branches_) { if(branch.ro_or_nc()) error_and_continue(err,EROFS); rv = fs::info(branch.path,&info); if(rv < 0) error_and_continue(err,ENOENT); if(info.readonly) error_and_continue(err,EROFS); if(info.spaceavail < branch.minfreespace()) error_and_continue(err,ENOSPC); *sum_ += info.spaceavail; branchinfo_->push_back({info.spaceavail,&branch}); } return -err; } static Branch* _get_branch(const BranchInfoVec &branchinfo_, cu64 sum_) { u64 idx; u64 threshold; if(sum_ == 0) return nullptr; idx = 0; threshold = RND::rand64(sum_); for(const auto &bi : branchinfo_) { idx += bi.spaceavail; if(idx < threshold) continue; return bi.branch; } return nullptr; } static int _create(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) { int err; u64 sum; Branch *branch; BranchInfoVec branchinfo; err = ::_get_branchinfo(branches_,&branchinfo,&sum); branch = ::_get_branch(branchinfo,sum); if(!branch) return err; paths_.emplace_back(branch); return 0; } int Policy::PFRD::Action::operator()(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) const { return Policies::Action::eppfrd(branches_,fusepath_,paths_); } int Policy::PFRD::Create::operator()(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) const { return ::_create(branches_,fusepath_,paths_); } int Policy::PFRD::Search::operator()(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) const { return Policies::Search::eppfrd(branches_,fusepath_,paths_); } mergerfs-2.42.0/src/policy_pfrd.hpp0000644000000000000000000000342415177346257015745 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "policy.hpp" namespace Policy { namespace PFRD { class Action final : public Policy::ActionImpl { public: Action() : Policy::ActionImpl("pfrd") {} public: int operator()(const Branches::Ptr&, const fs::path&, std::vector&) const final; }; class Create final : public Policy::CreateImpl { public: Create() : Policy::CreateImpl("pfrd") {} public: int operator()(const Branches::Ptr&, const fs::path&, std::vector&) const final; bool path_preserving() const final { return false; } }; class Search final : public Policy::SearchImpl { public: Search() : Policy::SearchImpl("pfrd") {} public: int operator()(const Branches::Ptr&, const fs::path&, std::vector&) const final; }; } } mergerfs-2.42.0/src/policy_rand.cpp0000644000000000000000000000364115177346257015732 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "policy_rand.hpp" #include "errno.hpp" #include "policy.hpp" #include "policies.hpp" #include "rnd.hpp" int Policy::Rand::Action::operator()(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) const { int rv; rv = Policies::Action::all(branches_,fusepath_,paths_); if(rv == 0) RND::shrink_to_rand_elem(paths_); return rv; } int Policy::Rand::Create::operator()(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) const { int rv; rv = Policies::Create::all(branches_,fusepath_,paths_); if(rv == 0) RND::shrink_to_rand_elem(paths_); return rv; } int Policy::Rand::Search::operator()(const Branches::Ptr &branches_, const fs::path &fusepath_, std::vector &paths_) const { int rv; rv = Policies::Search::all(branches_,fusepath_,paths_); if(rv == 0) RND::shrink_to_rand_elem(paths_); return rv; } mergerfs-2.42.0/src/policy_rand.hpp0000644000000000000000000000342415177346257015736 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "policy.hpp" namespace Policy { namespace Rand { class Action final : public Policy::ActionImpl { public: Action() : Policy::ActionImpl("rand") {} public: int operator()(const Branches::Ptr&, const fs::path&, std::vector&) const final; }; class Create final : public Policy::CreateImpl { public: Create() : Policy::CreateImpl("rand") {} public: int operator()(const Branches::Ptr&, const fs::path&, std::vector&) const final; bool path_preserving() const final { return false; } }; class Search final : public Policy::SearchImpl { public: Search() : Policy::SearchImpl("rand") {} public: int operator()(const Branches::Ptr&, const fs::path&, std::vector&) const final; }; } } mergerfs-2.42.0/src/policy_rv.hpp0000644000000000000000000000312415177346257015436 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include #include struct PolicyRV { struct RV { RV(const int rv_, const std::string &basepath_) : rv(rv_), basepath(basepath_) { } int rv; std::string basepath; }; std::vector successes; std::vector errors; void insert(const int rv_, const std::string &basepath_) { if(rv_ >= 0) successes.push_back({rv_,basepath_}); else errors.push_back({rv_,basepath_}); } int get_error(const std::string &basepath_) { for(const auto &s : successes) { if(s.basepath == basepath_) return s.rv; } for(const auto &e : errors) { if(e.basepath == basepath_) return e.rv; } return -ENOENT; } }; mergerfs-2.42.0/src/predictability.h0000644000000000000000000000015415177346257016100 0ustar rootroot#pragma once #define likely(x) __builtin_expect(!!(x), 1) #define unlikely(x) __builtin_expect(!!(x), 0) mergerfs-2.42.0/src/procfs.hpp0000644000000000000000000000170215177346257014724 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include namespace procfs { extern int PROC_SELF_FD_FD; void init(); void shutdown(); std::string get_name(const int tid); } mergerfs-2.42.0/src/resources.cpp0000644000000000000000000000441615177346257015442 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "resources.hpp" #include "fs_opendir.hpp" #include "fs_closedir.hpp" #include "fs_readdir.hpp" #include "errno.hpp" #include #include #include #include #include int resources::reset_umask(void) { umask(0); return 0; } int resources::maxout_rlimit(const int resource) { int rv; struct rlimit rlim; rlim.rlim_cur = RLIM_INFINITY; rlim.rlim_max = RLIM_INFINITY; rv = ::setrlimit(resource,&rlim); if(rv == 0) return 0; rv = ::getrlimit(resource,&rlim); if(rv == -1) return -errno; rv = 0; rlim.rlim_cur = rlim.rlim_max; while(rv == 0) { rv = ::setrlimit(resource,&rlim); rlim.rlim_max *= 2; rlim.rlim_cur = rlim.rlim_max; } return rv; } int resources::maxout_rlimit_nofile(void) { return maxout_rlimit(RLIMIT_NOFILE); } int resources::maxout_rlimit_fsize(void) { return maxout_rlimit(RLIMIT_FSIZE); } int resources::setpriority(const int prio_) { DIR *dir; struct dirent *e; ::setpriority(PRIO_PROCESS,0,prio_); dir = fs::opendir("/proc/self/task"); if(dir == NULL) return -errno; while(true) { pid_t tid; e = fs::readdir(dir); if(e == NULL) break; if(e->d_name[0] == '.') continue; try { tid = std::stoi(e->d_name); } catch(...) { continue; } ::setpriority(PRIO_PROCESS,tid,prio_); } fs::closedir(dir); return 0; } mergerfs-2.42.0/src/resources.hpp0000644000000000000000000000176215177346257015450 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once namespace resources { int reset_umask(void); int maxout_rlimit(const int resource); int maxout_rlimit_nofile(void); int maxout_rlimit_fsize(void); int setpriority(const int prio); } mergerfs-2.42.0/src/rnd.cpp0000644000000000000000000000301215177346257014202 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "rnd.hpp" #include "rapidhash/rapidhash.h" #include #include static u64 G_SEED; __attribute__((constructor)) static void _constructor() { struct timeval tv; gettimeofday(&tv,NULL); G_SEED = tv.tv_sec; G_SEED <<= 32; G_SEED |= tv.tv_usec; } // Lifted from wyhash.h's wyrand() static u64 _rapidhash_rand(u64 *seed_) { *seed_ += 0x2d358dccaa6c78a5ull; return rapid_mix(*seed_,*seed_ ^ 0x8bb84b93962eacc9ull); } u64 RND::rand64(void) { return _rapidhash_rand(&G_SEED); } u64 RND::rand64(cu64 max_) { assert(max_ > 0); return (RND::rand64() % max_); } u64 RND::rand64(cu64 min_, cu64 max_) { assert(max_ > min_); return (min_ + (RND::rand64() % (max_ - min_))); } mergerfs-2.42.0/src/rnd.hpp0000644000000000000000000000230515177346257014213 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "base_types.h" #include class RND { public: RND(); public: static u64 rand64(void); static u64 rand64(cu64 max_); static u64 rand64(cu64 min_, cu64 max_); template static void shrink_to_rand_elem(std::vector &v_) { if(v_.size() <= 1) return; std::swap(v_[0],v_[RND::rand64(v_.size())]); v_.resize(1); } }; mergerfs-2.42.0/src/stat_util.hpp0000644000000000000000000000231415177346257015440 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include namespace StatUtil { static inline bool empty(const struct stat &st_) { return (st_.st_size == 0); } static inline bool writable(const struct stat &st_) { return (st_.st_mode & (S_IWUSR|S_IWGRP|S_IWOTH)); } static inline bool writable_or_not_empty(const struct stat &st_) { return (StatUtil::writable(st_) || !StatUtil::empty(st_)); } } mergerfs-2.42.0/src/state.cpp0000644000000000000000000000424015177346257014543 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "state.hpp" #include "errno.hpp" State state; // static // void // _register_getattr(State *state_) // { // State::GetSet x; // x.get = [state_]() -> std::string // { // return state_->getattr.to_string(); // }; // x.set = [state_](const std::string_view s_) -> int // { // return state_->getattr.from_string(s_); // }; // state_->set_getset("user.mergerfs.func.getattr",x); // } State::State() { // _register_getattr(this); } void State::set_getset(const std::string &name_, const State::GetSet &gs_) { _getset[name_] = gs_; } int State::get(const std::string &key_, std::string &val_) { std::map::iterator i; i = _getset.find(key_); if((i == _getset.end()) || (!i->second.get)) return -ENOATTR; val_ = i->second.get(); return 0; } int State::set(const std::string &key_, const std::string_view val_) { std::map::iterator i; i = _getset.find(key_); if((i == _getset.end()) || (!i->second.set)) return -ENOATTR; return i->second.set(val_); } int State::valid(const std::string &key_, const std::string_view val_) { std::map::iterator i; i = _getset.find(key_); if((i == _getset.end()) || (!i->second.valid)) return -ENOATTR; return i->second.valid(val_); } mergerfs-2.42.0/src/state.hpp0000644000000000000000000001061715177346257014555 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ /* GLOBAL STATE AND OPEN FILE TRACKING =================================== This file defines the global State object that holds the open_files map, which tracks all currently open files in the filesystem. OPEN_FILE STRUCTURE ------------------- The OpenFile struct represents a file that is currently open. It contains: - ref_count: Number of active opens sharing this file. When it reaches 0, the file is eligible for cleanup. - backing_id: Kernel handle for FUSE passthrough mode. INVALID_BACKING_ID means passthrough is not enabled for this file. - fi: Pointer to the canonical FileInfo object containing file metadata and the file descriptor used as the source for overlapping opens. Since a file descriptor has state associated with it, concurrent opens get their own duplicated fd and their own FileInfo stored only in fuse_file_info_t.fh. The map entry keeps the canonical FileInfo so later opens can duplicate it and so the nodeid can retain a shared passthrough backing_id. THREAD SAFETY ------------- The open_files map uses boost::concurrent_flat_map which provides: - Bucket-level locking for fine-grained concurrency - visit() for atomic read-modify operations - try_emplace() for atomic insertion - erase_if() for conditional removal While there is fine-grained locking it isn't per entry and as a result the code for opening and releasing is more complicated since having file io syscalls in the critical section lambda could cause contention. LIFECYCLE STATES ---------------- An OpenFile entry goes through these states: 1. NOT IN MAP - File is not open 2. ACTIVE (ref_count >= 1) - File is open and the canonical FileInfo is in use 3. ERASED - The final release removed the map entry and cleanup continues outside the map callback See fuse_open.cpp and fuse_release.cpp for detailed documentation on the concurrency patterns and per-handle cleanup rules. */ #pragma once #include "boost/unordered/concurrent_flat_map.hpp" #include "fileinfo.hpp" #include "fuse.h" #include #include #include #include class State { public: State(); public: struct OpenFile { OpenFile() = delete; OpenFile(const int backing_id_, FileInfo * const fi_) : ref_count(1), backing_id(backing_id_), fi(fi_) { } OpenFile(OpenFile &&o_) noexcept : ref_count(o_.ref_count.load()), backing_id(o_.backing_id), fi(o_.fi) { } std::atomic ref_count; int backing_id; FileInfo *fi; }; public: FileInfo* get_fi(const fuse_req_ctx_t *ctx_, cu64 fh_) const { FileInfo *fi; fi = FileInfo::from_fh(fh_); if(not fi) open_files.cvisit(ctx_->nodeid, [&](auto &v_) { fi = v_.second.fi; }); return fi; } public: struct GetSet { std::function get; std::function set; std::function valid; }; void set_getset(const std::string &name, const State::GetSet &gs); int get(const std::string &key, std::string &val); int set(const std::string &key, const std::string_view val); int valid(const std::string &key, const std::string_view val); public: using OpenFileMap = boost::concurrent_flat_map; private: std::map _getset; public: OpenFileMap open_files; }; extern State state; mergerfs-2.42.0/src/statvfs_util.hpp0000644000000000000000000000236115177346257016161 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "base_types.h" #include #include namespace StatVFS { static inline bool readonly(const struct statvfs &st_) { return (st_.f_flag & ST_RDONLY); } static inline s64 spaceavail(const struct statvfs &st_) { return (st_.f_frsize * st_.f_bavail); } static inline s64 spaceused(const struct statvfs &st_) { return (st_.f_frsize * (st_.f_blocks - st_.f_bavail)); } } mergerfs-2.42.0/src/str.cpp0000644000000000000000000001567215177346257014246 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "str.hpp" #include #include #include #include #include #include #include #include #include #include #include using std::set; using std::string; using std::string_view; using std::vector; std::vector str::split(const string_view str_, const char delimiter_) { std::vector result; if(str_.empty()) return result; size_t start = 0; size_t pos = str_.find(delimiter_, start); while(pos != std::string_view::npos) { size_t length = (pos - start); result.emplace_back(str_.substr(start, length)); start = pos + 1; pos = str_.find(delimiter_, start); } result.emplace_back(str_.substr(start)); return result; } std::set str::split_to_set(const string_view str_, const char delimiter_) { std::set result; if(str_.empty()) return result; size_t start = 0; size_t pos = str_.find(delimiter_, start); while(pos != std::string_view::npos) { size_t length = (pos - start); result.emplace(str_.substr(start, length)); start = pos + 1; pos = str_.find(delimiter_, start); } result.emplace(str_.substr(start)); return result; } std::vector str::split_on_null(const std::string_view str_) { return str::split(str_, '\0'); } std::vector str::lsplit1(const string_view str_, const char delimiter_) { std::vector result; if(str_.empty()) return result; std::size_t off = str_.find(delimiter_); if(off == std::string_view::npos) { result.emplace_back(str_); } else { result.emplace_back(str_.substr(0, off)); result.emplace_back(str_.substr(off + 1)); } return result; } std::vector str::rsplit1(const string_view str_, const char delimiter_) { std::vector result; if(str_.empty()) return result; std::size_t off = str_.rfind(delimiter_); if(off == std::string_view::npos) { result.emplace_back(str_); } else { result.emplace_back(str_.substr(0, off)); result.emplace_back(str_.substr(off + 1)); } return result; } std::pair str::splitkv(const std::string_view str_, const char delimiter_) { std::size_t pos = str_.find(delimiter_); if(pos != std::string_view::npos) return {std::string{str_.substr(0, pos)}, std::string{str_.substr(pos + 1)}}; return {std::string{str_}, std::string{}}; } string str::join(const vector &vec_, const size_t substridx_, const char sep_) { if(vec_.empty()) return string(); string rv = vec_[0].substr(substridx_); for(size_t i = 1; i < vec_.size(); i++) rv += sep_ + vec_[i].substr(substridx_); return rv; } string str::join(const vector &vec_, const char sep_) { return str::join(vec_, 0, sep_); } string str::join(const set &set_, const char sep_) { string rv; if(set_.empty()) return {}; for(auto const &s : set_) rv += s + sep_; if(!rv.empty()) rv.pop_back(); return rv; } size_t str::longest_common_prefix_index(const vector &vec_) { if(vec_.empty()) return string::npos; for(size_t n = 0; n < vec_[0].size(); n++) { char chr = vec_[0][n]; for(size_t i = 1; i < vec_.size(); i++) { if(n >= vec_[i].size()) return n; if(vec_[i][n] != chr) return n; } } return string::npos; } string str::longest_common_prefix(const vector &vec_) { size_t idx = longest_common_prefix_index(vec_); if(idx != string::npos) return vec_[0].substr(0, idx); return string(); } string str::remove_common_prefix_and_join(const vector &vec_, const char sep_) { size_t idx = str::longest_common_prefix_index(vec_); if(idx == string::npos) idx = 0; return str::join(vec_, idx, sep_); } void str::erase_fnmatches(const vector &patterns_, vector &strs_) { auto si = strs_.begin(); while(si != strs_.end()) { int match = FNM_NOMATCH; for(auto pi = patterns_.begin(); pi != patterns_.end() && match != 0; ++pi) { match = fnmatch(pi->c_str(), si->c_str(), 0); } if(match == 0) si = strs_.erase(si); else ++si; } } bool str::startswith(const string_view str_, const string_view prefix_) noexcept { if(prefix_.size() > str_.size()) return false; return str_.compare(0, prefix_.size(), prefix_) == 0; } bool str::endswith(const string_view str_, const string_view suffix_) noexcept { if(suffix_.size() > str_.size()) return false; return str_.compare(str_.size() - suffix_.size(), suffix_.size(), suffix_) == 0; } std::string str::trim(const std::string_view str_) { if(str_.empty()) return std::string{}; auto start = str_.begin(); auto end = str_.end(); while(start != end && std::isspace(static_cast(*start))) ++start; if(start == end) return std::string{}; --end; while(end != start && std::isspace(static_cast(*end))) --end; return std::string{start, end + 1}; } bool str::eq(const char *s0_, const char *s1_) noexcept { if((s0_ == nullptr) || (s1_ == nullptr)) return (s0_ == s1_); return (std::strcmp(s0_, s1_) == 0); } bool str::startswith(const char *s_, const char *p_) noexcept { if((s_ == nullptr) || (p_ == nullptr)) return false; while(*p_) { if(*p_ != *s_) return false; p_++; s_++; } return true; } std::string str::replace(const std::string_view str_, const char src_, const char dst_) { std::string result; result.reserve(str_.size()); for(char c : str_) result.push_back(c == src_ ? dst_ : c); return result; } mergerfs-2.42.0/src/str.hpp0000644000000000000000000000564515177346257014252 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include #include #include #include #include namespace str { [[nodiscard]] std::vector split(const std::string_view str, const char delimiter); [[nodiscard]] std::set split_to_set(const std::string_view str, const char delimiter); [[nodiscard]] std::vector split_on_null(const std::string_view str); [[nodiscard]] std::vector lsplit1(const std::string_view str, const char delimiter); [[nodiscard]] std::vector rsplit1(const std::string_view str, const char delimiter); [[nodiscard]] std::pair splitkv(const std::string_view str, const char delimiter); [[nodiscard]] std::string join(const std::vector &vec, const size_t substridx, const char sep); [[nodiscard]] std::string join(const std::vector &vec, const char sep); [[nodiscard]] std::string join(const std::set &s, const char sep); [[nodiscard]] size_t longest_common_prefix_index(const std::vector &vec); [[nodiscard]] std::string longest_common_prefix(const std::vector &vec); [[nodiscard]] std::string remove_common_prefix_and_join(const std::vector &vec, const char sep); void erase_fnmatches(const std::vector &patterns, std::vector &strs); [[nodiscard]] bool startswith(const std::string_view str, const std::string_view prefix) noexcept; [[nodiscard]] bool startswith(const char *str, const char *prefix) noexcept; [[nodiscard]] bool endswith(const std::string_view str, const std::string_view suffix) noexcept; [[nodiscard]] std::string trim(const std::string_view str); [[nodiscard]] bool eq(const char *s0, const char *s1) noexcept; [[nodiscard]] std::string replace(const std::string_view str, const char src, const char dst); } mergerfs-2.42.0/src/strvec.hpp0000644000000000000000000000160015177346257014733 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include #include typedef std::vector StrVec; mergerfs-2.42.0/src/supported_getdents64.hpp0000644000000000000000000000165215177346257017530 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #ifdef __linux__ #include #ifdef SYS_getdents64 #define MERGERFS_SUPPORTED_GETDENTS64 #endif #endif mergerfs-2.42.0/src/supported_statx.hpp0000644000000000000000000000170715177346257016705 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif #include #include #ifdef STATX_TYPE #define MERGERFS_SUPPORTED_STATX #endif mergerfs-2.42.0/src/symlinkify.hpp0000644000000000000000000000531315177346257015630 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "fuse_kernel.h" #include "base_types.h" #include namespace symlinkify { static inline bool can_be_symlink(const struct stat &st_, const s64 timeout_) { if(S_ISDIR(st_.st_mode) || (st_.st_mode & (S_IWUSR|S_IWGRP|S_IWOTH))) return false; const s64 now = ::time(NULL); return (((now - st_.st_mtime) > timeout_) && ((now - st_.st_ctime) > timeout_)); } static inline bool can_be_symlink(const struct fuse_statx &st_, const s64 timeout_) { if(S_ISDIR(st_.mode) || (st_.mode & (S_IWUSR|S_IWGRP|S_IWOTH))) return false; const s64 now = ::time(NULL); return (((now - st_.mtime.tv_sec) > timeout_) && ((now - st_.ctime.tv_sec) > timeout_)); } static inline void convert(const std::string &target_, struct stat *st_) { st_->st_mode = (((st_->st_mode & ~S_IFMT) | S_IFLNK) | 0777); st_->st_size = target_.size(); st_->st_blocks = 0; } static inline void convert(const std::string &target_, struct fuse_statx *st_) { st_->mode = (((st_->mode & ~S_IFMT) | S_IFLNK) | 0777); st_->size = target_.size(); st_->blocks = 0; } static inline void convert_if_can_be_symlink(const std::string &target_, struct stat *st_, const s64 timeout_) { if(timeout_ < 0) return; if(!symlinkify::can_be_symlink(*st_,timeout_)) return; symlinkify::convert(target_,st_); } static inline void convert_if_can_be_symlink(const std::string &target_, fuse_statx *st_, const s64 timeout_) { if(timeout_ < 0) return; if(!symlinkify::can_be_symlink(*st_,timeout_)) return; symlinkify::convert(target_,st_); } } mergerfs-2.42.0/src/thread_info.hpp0000644000000000000000000000204315177346257015711 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "fs_lstat.hpp" namespace thread_info { static inline int process_count() { int rv; struct stat st; rv = fs::lstat("/proc/self/task",&st); if(rv < 0) return rv; return (st.st_nlink - 2); } } mergerfs-2.42.0/src/to_neg_errno.hpp0000644000000000000000000000207715177346257016116 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include template static inline T to_neg_errno(const T rv_, const int errno_) { return ((rv_ == (T)-1) ? -errno_ : rv_); } template static inline T to_neg_errno(const T rv_) { return ::to_neg_errno(rv_,errno); } mergerfs-2.42.0/src/to_string.cpp0000644000000000000000000000243415177346257015436 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "to_string.hpp" #include "fmt/core.h" #include std::string str::to(const bool bool_) { return (bool_ ? "true" : "false"); } std::string str::to(const int int_) { return fmt::format("{}",int_); } std::string str::to(cu64 uint64_) { return fmt::format("{}",uint64_); } std::string str::to(cs64 int64_) { return fmt::format("{}",int64_); } std::string str::to(const std::string &s_) { return s_; } std::string str::to(const fs::path &path_) { return path_.string(); } mergerfs-2.42.0/src/to_string.hpp0000644000000000000000000000212215177346257015435 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "base_types.h" #include "fs_path.hpp" #include #include namespace str { std::string to(const bool); std::string to(const int); std::string to(cu64); std::string to(cs64); std::string to(const std::string&); std::string to(const fs::path&); } mergerfs-2.42.0/src/tofrom_ref.hpp0000644000000000000000000000230615177346257015573 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "to_string.hpp" #include "from_string.hpp" #include "tofrom_string.hpp" template class TFSRef : public ToFromString { public: int from_string(const std::string_view s_) final { return str::from(s_,&_data); } std::string to_string(void) const final { return str::to(_data); } public: TFSRef(T &data_) : _data(data_) { } private: T &_data; }; mergerfs-2.42.0/src/tofrom_string.hpp0000644000000000000000000000201215177346257016317 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include #include class ToFromString { public: virtual std::string to_string() const = 0; virtual int from_string(const std::string_view) = 0; bool display = true; bool ro = false; }; mergerfs-2.42.0/src/tofrom_wrapper.hpp0000644000000000000000000000432215177346257016477 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "from_string.hpp" #include "to_string.hpp" #include "tofrom_string.hpp" #include template class ToFromWrapper : public ToFromString { public: int from_string(const std::string_view s_) final { return str::from(s_,&_data); } std::string to_string(void) const final { return str::to(_data); } public: ToFromWrapper() { } ToFromWrapper(const T data_) : _data(data_) { } public: ToFromWrapper& operator=(const T &data_) { _data = data_; return *this; } public: operator const T&() const { return _data; } const T& operator*() const { return _data; } T* operator->() { return &_data; } const T* operator->() const { return &_data; } public: bool operator==(const T &data_) const { return (_data == data_); } private: T _data; }; template class ROToFromWrapper : public ToFromString { public: int from_string(const std::string_view s_) final { return -EROFS; } std::string to_string(void) const final { return str::to(_data); } public: ROToFromWrapper() { } ROToFromWrapper(const T data_) : _data(data_) { } public: operator T() const { return _data; } T* operator->() { return &_data; } public: bool operator==(const T &data_) const { return (_data == data_); } private: T _data; }; mergerfs-2.42.0/src/ugid.cpp0000644000000000000000000000170315177346257014354 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include namespace ugid { thread_local uid_t currentuid = 0; thread_local gid_t currentgid = 0; thread_local bool initialized = false; } mergerfs-2.42.0/src/ugid.hpp0000644000000000000000000000535615177346257014371 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #include "fuse_req_ctx.h" #include "predictability.h" #include "fuse_kernel.h" #include #include #include #include #include struct ugid_t { ugid_t(const uid_t uid_, const gid_t gid_) : uid(uid_), gid(gid_) { } ugid_t(const fuse_req_ctx_t *ctx_) : ugid_t(ctx_->uid,ctx_->gid) { } uid_t uid; gid_t gid; }; #if defined SYS_setreuid32 #define SETREUID(R,E) (::syscall(SYS_setreuid32,(R),(E))) #else #define SETREUID(R,E) (::syscall(SYS_setreuid,(R),(E))) #endif #if defined SYS_setregid32 #define SETREGID(R,E) (::syscall(SYS_setregid32,(R),(E))) #else #define SETREGID(R,E) (::syscall(SYS_setregid,(R),(E))) #endif #if defined SYS_geteuid32 #define GETEUID() (::syscall(SYS_geteuid32)) #else #define GETEUID() (::syscall(SYS_geteuid)) #endif #if defined SYS_getegid32 #define GETEGID() (::syscall(SYS_getegid32)) #else #define GETEGID() (::syscall(SYS_getegid)) #endif namespace ugid { extern thread_local uid_t currentuid; extern thread_local gid_t currentgid; extern thread_local bool initialized; static inline void set(const uid_t newuid_, const gid_t newgid_) { assert(newuid_ != FUSE_INVALID_UIDGID); assert(newgid_ != FUSE_INVALID_UIDGID); if(unlikely(!initialized)) { currentuid = GETEUID(); currentgid = GETEGID(); initialized = true; } if((newuid_ == currentuid) && (newgid_ == currentgid)) return; SETREGID(-1,newgid_); SETREUID(-1,newuid_); currentuid = newuid_; currentgid = newgid_; } struct SetGuard { SetGuard(const ugid_t ugid_) : prev(currentuid,currentgid) { assert(currentuid == 0); assert(currentgid == 0); ugid::set(ugid_.uid,ugid_.gid); } ~SetGuard() { ugid::set(prev.uid,prev.gid); } const ugid_t prev; }; } #undef SETREUID #undef SETREGID #undef GETEUID #undef GETEGID mergerfs-2.42.0/src/xattr.hpp0000644000000000000000000000237015177346257014574 0ustar rootroot/* ISC License Copyright (c) 2026, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #pragma once #if defined(__ANDROID__) # include #elif defined(__APPLE__) # include #elif defined(__linux__) # include #endif #ifdef USE_XATTR # ifdef __linux__ # include # include # else # undef USE_XATTR # pragma message "USE_XATTR unset: xattrs disabled" # endif #endif #ifndef XATTR_CREATE # define XATTR_CREATE 0x1 #endif #ifndef XATTR_REPLACE # define XATTR_REPLACE 0x2 #endif mergerfs-2.42.0/src/version.hpp0000644000000000000000000000007615177346260015112 0ustar rootroot#pragma once static const char MERGERFS_VERSION[] = "2.42.0"; mergerfs-2.42.0/tests/0000755000000000000000000000000015177346257013272 5ustar rootrootmergerfs-2.42.0/tests/OPTIONS_TEST_PLAN.md0000644000000000000000000002126315177346257016424 0ustar rootroot# Options Test Plan Possible integration and unit tests for options listed in `mkdocs/docs/config/options.md`. Legend: - **Integration**: mount-level behavior test (black-box, syscall parity / side effects) - **Unit**: focused parser/config/logic test (white-box or low-level component) ## Core mount and branch options | Option | Integration tests | Unit tests | |---|---|---| | `config` | Load same settings via CLI vs config file and compare behavior | Parse comments, `key`, `key=val`, unknown keys, duplicate keys ordering | | `branches` | Multi-branch create/search/action behavior; glob expansion; dynamic branch updates | Branch string parser ops (`+`, `+<`, `+>`, `-`, `->`, `-<`, `=`), mode parse, minfreespace parse | | `mountpoint` | Verify mount succeeds/fails with valid/invalid mountpoint | Config validation for mountpoint path | | `branches-mount-timeout` | Delayed branch mount appears before timeout -> starts; after timeout -> continue/fail based on flag | Timeout arithmetic and mount-detection helper logic | | `branches-mount-timeout-fail` | Timeout expiration returns non-zero when true | Boolean parse and gating of startup continuation | | `minfreespace` | Create policy excludes near-full branches | Size parser (`B/K/M/G/T`, overflow, bad suffix) | | `moveonenospc` | ENOSPC write triggers move+retry and preserves metadata | Policy dispatch and error mapping (`ENOSPC`/`EDQUOT`) | | `inodecalc` | Stable inode expectations per mode on files/dirs/hardlinks | Hash function determinism and 32-bit/64-bit variants | ## IO behavior options | Option | Integration tests | Unit tests | |---|---|---| | `dropcacheonclose` | Close after write/read and confirm no correctness regression | `posix_fadvise` call path invoked only when enabled | | `direct-io-allow-mmap` | `O_DIRECT` + `mmap` behavior on supported kernels | Feature flag gating by kernel capability | | `nullrw` | Writes report success but data unchanged; reads become no-op behavior | Read/write null path selection | | `readahead` | Sequential read throughput/request size changes with non-zero setting | Parser and branch-level readahead setter behavior | | `async-read` | Concurrent read ordering/parallelism differs when toggled | FUSE config flag toggling | | `fuse-msg-size` | Large IO request chunking and throughput with different values | Pagesize conversion parser and min/max clamping | | `flush-on-close` | `never/always/opened-for-write` close semantics | Mode enum parse and branching logic | | `proxy-ioprio` | Different caller ioprio reflected in IO scheduling side-effects | ioprio fetch/apply path and fallback behavior | | `parallel-direct-writes` | Parallel non-extending writes behavior with/without option | Kernel capability gating | | `passthrough.io` | `off/ro/wo/rw` path selection for reads/writes and incompatibility checks | Enum parse, compatibility checks (`cache.writeback`, `nullrw`, etc.) | | `passthrough.max-stack-depth` | Stacked FS scenarios with depth 1 vs 2 | Range validation and config propagation | ## Path transformation and cross-device options | Option | Integration tests | Unit tests | |---|---|---| | `symlinkify` | Old non-writable files appear as symlinks after timeout | Eligibility predicate (mode, age, type) | | `symlinkify-timeout` | Boundary test around exact timeout second | Timeout comparison helper | | `ignorepponrename` | Rename behavior with and without path preservation | Rename policy selection logic | | `follow-symlinks` | `never/directory/regular/all` on symlink to file/dir/broken link | Enum parse and target-type dispatch | | `link-exdev` | EXDEV hardlink fallback modes: passthrough/rel/abs-base/abs-pool | Strategy selection and symlink target synthesis | | `rename-exdev` | EXDEV rename fallback modes: passthrough/rel/abs | Fallback path generation and state machine | | `link-cow` | Hardlinked file opened for write breaks link and writes private copy | Link-count check and copy-on-write trigger logic | ## Permission and metadata options | Option | Integration tests | Unit tests | |---|---|---| | `export-support` | NFS-export style behavior sanity and mount flags exposure | Init-time flag propagation | | `kernel-permissions-check` | Access/permission checks handled by kernel vs userspace path | Mount option mapping (`default_permissions`) | | `security-capability` | `security.capability` xattr returns ENOATTR when disabled | Name filter helper | | `xattr` | `passthrough/noattr/nosys` behavior for set/get/list/remove xattr | Enum parse and short-circuit return paths | | `statfs` | `base` vs `full` branch inclusion by path | Mode parse and branch-filter helper | | `statfs-ignore` | `none/ro/nc` effect on available space accounting | Ignore predicate and accumulator logic | | `nfsopenhack` | File create/open mode behavior under NFS-like patterns | Enum parse and hook decision logic | | `posix-acl` | ACL xattr roundtrip and chmod/chown interaction when enabled | Mount/init flag propagation | ## Threading and scheduling options | Option | Integration tests | Unit tests | |---|---|---| | `read-thread-count` | Throughput/latency and correctness under different values | Value normalization (`0`, negatives, min=1) | | `process-thread-count` | Separation of read/process pools and queue pressure behavior | Pool enable/disable logic | | `process-thread-queue-depth` | Backpressure behavior with depth changes | Queue sizing and timeout/try-enqueue semantics | | `pin-threads` | Thread CPU affinity placement for each strategy | Strategy parser and CPU selection algorithm | | `scheduling-priority` | Process nice value set at startup and effective scheduling | Range validation and setpriority wrapper | ## Function/category policy options | Option | Integration tests | Unit tests | |---|---|---| | `func.FUNC` | Override a single function policy and verify only that op changes | Parser mapping from key to policy holder | | `func.readdir` | `seq/cosr/cor` ordering, latency, duplicate suppression, thread count parsing | Mode parser (`cosr:N:M`, `cor:N:M`) | | `category.action` | Bulk action policy changes for chmod/chown/rename/unlink | Category-to-function propagation | | `category.create` | Create policy effects on create/mkdir/mknod/link/symlink | Category propagation and precedence | | `category.search` | Search policy effects on getattr/open/readlink/getxattr | Category propagation and precedence | | Option ordering note | Later options override earlier (`func.*` then `category.*` etc.) | Deterministic application order test | ## Cache options | Option | Integration tests | Unit tests | |---|---|---| | `cache.statfs` | Repeated statfs calls use cache within timeout | Timeout cache invalidation behavior | | `cache.attr` | Repeated getattr freshness across timeout boundaries | Attr cache key and expiry logic | | `cache.entry` | Name lookup caching for existing entries | Entry cache insertion/expiry | | `cache.negative-entry` | Missing entry lookup caching and stale-negative behavior | Negative cache behavior | | `cache.files` | `off/partial/full/auto-full/per-process` correctness and coherence | Enum parse and mode decision helper | | `cache.files.process-names` | Per-process cache activation by comm name | List parser and matcher | | `cache.writeback` | Coalesced write behavior; incompatibility handling with passthrough | Flag validation and FUSE config setup | | `cache.symlinks` | Readlink repeated calls reflect cache policy | Feature gating by kernel support | | `cache.readdir` | Readdir repeated calls and invalidation behavior | Feature gating and config wiring | ## Misc options | Option | Integration tests | Unit tests | |---|---|---| | `lazy-umount-mountpoint` | Live-upgrade remount scenario with stale previous mount | Startup control flow and error handling | | `remember-nodes` | NFS-like lookup stability until unlink/remove/rename replacement | Boolean and numeric compatibility parsing | | `noforget` | Retained nodes released on unlink/remove/rename replacement | Alias mapping to retained-node mode | | `allow-idmap` | UID/GID mapping behavior in idmapped mounts | Init flag propagation and compatibility checks | | `debug` | FUSE trace generation enabled/disabled | Debug option parse and logger toggling | | `log.file` | Trace output to stderr vs file path | Path parser and file sink setup | | `fsname` | Filesystem name shown in mount/df matches config | fsname default derivation and override | ## Prioritized backlog (recommended first) 1. `xattr` mode tests (`passthrough/noattr/nosys`) + regression for current xattr mismatch 2. `statfs` / `statfs-ignore` mode matrix 3. EXDEV fallbacks (`link-exdev`, `rename-exdev`) 4. `follow-symlinks` + `symlinkify` behavior matrix 5. Policy precedence (`func.*`, `category.*`, ordering) 6. Cache timeout behavior (`cache.attr`, `cache.entry`, `cache.negative-entry`, `cache.statfs`) mergerfs-2.42.0/tests/README.md0000644000000000000000000000656315177346257014563 0ustar rootroot# POSIX Soft Conformance Suite This directory contains integration tests that exercise mergerfs FUSE operations and compare behavior against equivalent native syscalls on a local filesystem. The suite is "soft POSIX": it focuses on practical parity for return values, `errno`, and key side effects, including common error paths. Each test mounts its own ephemeral mergerfs instance with random temporary branches and cleans everything up automatically. Run with: ```bash python3 tests/run-tests ``` ## Coverage Matrix - `access` -> `TEST_posix_access` - `chmod` / `fchmod` -> `TEST_posix_chmod`, `TEST_use_fchmod_after_unlink` - `chown` / `fchown` -> `TEST_posix_chown`, `TEST_use_fchown_after_unlink` - `create` / `mknod` -> `TEST_posix_create_mknod` - `getattr` / `fgetattr` -> `TEST_posix_getattr_fgetattr`, `TEST_use_fstat_after_unlink` - `open` / `read` / `write` -> `TEST_posix_open_read_write`, `TEST_o_direct` - `flush` / `release` / `fsync` / `fsyncdir` -> `TEST_posix_fsync_flush` - `release` close semantics -> `TEST_posix_release` - `releasedir` close semantics -> `TEST_posix_releasedir` - `truncate` / `ftruncate` -> `TEST_posix_truncate_ftruncate`, `TEST_use_ftruncate_after_unlink` - `utimens` / `futimens` -> `TEST_posix_utimens`, `TEST_use_futimens_after_unlink` - `fallocate` -> `TEST_use_fallocate_after_unlink` - `copy_file_range` -> `TEST_posix_copy_file_range` - `ioctl` -> `TEST_posix_ioctl` - `poll` -> `TEST_posix_poll` - `tmpfile` (`O_TMPFILE`) -> `TEST_posix_tmpfile` - `bmap` (via `FIBMAP` ioctl parity) -> `TEST_posix_bmap` - `readlink` -> `TEST_readlink_semantics` - `link` / `symlink` -> `TEST_posix_link_symlink` - `mkdir` / `rmdir` -> `TEST_posix_mkdir_rmdir` - `unlink` / `rename` -> `TEST_posix_unlink_rename`, `TEST_unlink_rename` - `statfs` -> `TEST_posix_statfs` - `statx` -> `TEST_posix_statx` - `syncfs` -> `TEST_posix_syncfs` - `flock` / `lock` -> `TEST_posix_locking` - `setxattr` / `getxattr` / `listxattr` / `removexattr` -> `TEST_posix_xattr` - xattr object/flag matrix (`file`, `dir`, symlink `l*`, create/replace) -> `TEST_posix_xattr_matrix` - xattr mode runtime toggles (`passthrough`/`noattr`/`nosys`) -> `TEST_cfg_xattr_modes` - statfs mode and statfs-ignore runtime toggles -> `TEST_cfg_statfs_ignore` - EXDEV fallback runtime toggles for link/rename -> `TEST_cfg_link_rename_exdev` - `readdir` (+ seek/tell behavior) -> `TEST_posix_readdir` - `readdir_plus` semantic parity (list+stat and readdir policy toggles) -> `TEST_posix_readdir_plus` - lifecycle (`init`/`destroy`) harness check -> `TEST_mount_lifecycle` - hidden temp exposure checks -> `TEST_no_fuse_hidden` ## Error Conditions Emphasized Across tests, parity checks include combinations of: - `ENOENT` - `ENOTDIR` - `EEXIST` - `ENOTEMPTY` - `EISDIR` - `EBADF` - privilege-sensitive outcomes (for example `EPERM`) where applicable ## Notes - Some behavior is runtime/environment dependent (kernel, mount options, uid/gid, capabilities). Tests compare mergerfs to native behavior in the same runtime to keep assertions robust. - Tests that cannot exercise a behavior in the current environment may exit 77 and are reported as `SKIP` by `tests/run-tests`. - The xattr test uses a `user.*` key and assumes user xattrs are enabled. - Tests mount their own ephemeral mergerfs instances using the `mergerfs_mount` context manager in `posix_parity.py`. Random directories are created and cleaned up automatically. mergerfs-2.42.0/tests/TEST_api_xattr0000755000000000000000000000551115177346257016054 0ustar rootroot#!/usr/bin/env python3 import os import sys from posix_parity import cleanup_dir from posix_parity import fail from posix_parity import join from posix_parity import mergerfs_branches from posix_parity import mergerfs_get_option from posix_parity import mergerfs_mount from posix_parity import mergerfs_set_option from posix_parity import temp_dir from posix_parity import touch def main(): try: with mergerfs_mount() as (mount, branches): ctrl = join(mount, ".mergerfs") if not os.path.exists(ctrl): return fail(".mergerfs control file not found") if not branches: return fail("no branches found") merge_base = temp_dir(mount) try: merge_file = join(merge_base, "api_test") touch(merge_file, b"test") try: fullpath = os.getxattr(merge_file, "user.mergerfs.fullpath") fullpath_str = fullpath.decode("utf-8", errors="surrogateescape") if not fullpath_str: return fail("fullpath xattr is empty") if not os.path.exists(fullpath_str): return fail(f"fullpath '{fullpath_str}' does not exist on disk") except OSError as exc: return fail(f"getxattr fullpath: errno={exc.errno}") try: relpath = os.getxattr(merge_file, "user.mergerfs.relpath") relpath_str = relpath.decode("utf-8", errors="surrogateescape") if not relpath_str: return fail("relpath xattr is empty") except OSError as exc: return fail(f"getxattr relpath: errno={exc.errno}") try: basepath = os.getxattr(merge_file, "user.mergerfs.basepath") basepath_str = basepath.decode("utf-8", errors="surrogateescape") if not basepath_str: return fail("basepath xattr is empty") except OSError as exc: return fail(f"getxattr basepath: errno={exc.errno}") try: allpaths = os.getxattr(merge_file, "user.mergerfs.allpaths") allpaths_str = allpaths.decode("utf-8", errors="surrogateescape") if not allpaths_str: return fail("allpaths xattr is empty") except OSError as exc: return fail(f"getxattr allpaths: errno={exc.errno}") return 0 finally: cleanup_dir(merge_base) except RuntimeError as exc: print(str(exc), end="") return 77 except Exception as exc: return fail(str(exc)) if __name__ == "__main__": raise SystemExit(main()) mergerfs-2.42.0/tests/TEST_cfg_link_rename_exdev0000755000000000000000000001445015177346257020361 0ustar rootroot#!/usr/bin/env python3 import errno import os import sys import uuid from posix_parity import cleanup_dir from posix_parity import fail from posix_parity import join from posix_parity import mergerfs_branches from posix_parity import mergerfs_get_option from posix_parity import mergerfs_mount from posix_parity import mergerfs_set_option from posix_parity import touch SKIP = 77 def get_errno(func): try: func() return 0 except OSError as exc: return exc.errno def symlink_resolves(path): target = os.readlink(path) if os.path.isabs(target): return os.path.realpath(target) return os.path.realpath(join(os.path.dirname(path), target)) def require_symlink(path, label): if not os.path.islink(path): return f"{label}: expected symlink fallback" if not os.path.exists(path): return f"{label}: symlink target does not exist: {os.readlink(path)!r}" return None def setup_paths(branches, mount, rel_base, name): src_rel = join(rel_base, f"{name}.src") dst_rel = join(rel_base, "dst", name) src = join(mount, src_rel) dst = join(mount, dst_rel) cleanup_dir(join(branches[0], rel_base)) cleanup_dir(join(branches[1], rel_base)) os.makedirs(join(branches[0], rel_base), exist_ok=True) os.makedirs(join(branches[1], rel_base, "dst"), exist_ok=True) touch(join(branches[0], src_rel), b"src") return src, dst, join(branches[0], src_rel) def main(): try: with mergerfs_mount(num_branches=2) as (mount, branches): rel_base = f".mergerfs_exdev_test_{os.getpid()}_{uuid.uuid4().hex}" if len(branches) < 2: print("EXDEV fallback test requires at least 2 branches", end="") return SKIP branches = branches[:2] if os.stat(branches[0]).st_dev == os.stat(branches[1]).st_dev: print("EXDEV fallback test requires branches on different devices", end="") return SKIP try: try: orig_create = mergerfs_get_option(mount, "category.create") orig_link = mergerfs_get_option(mount, "link-exdev") orig_rename = mergerfs_get_option(mount, "rename-exdev") except (PermissionError, FileNotFoundError, OSError): print("EXDEV fallback runtime options unavailable", end="") return SKIP try: mergerfs_set_option(mount, "category.create", "epmfs") src, dst, src_base = setup_paths(branches, mount, rel_base, "link_pass") mergerfs_set_option(mount, "link-exdev", "passthrough") err = get_errno(lambda: os.link(src, dst + ".link.pass")) if err != errno.EXDEV: print(f"link-exdev passthrough did not exercise EXDEV, errno={err}", end="") return SKIP for mode in ("rel-symlink", "abs-base-symlink", "abs-pool-symlink"): src, dst, src_base = setup_paths(branches, mount, rel_base, f"link_{mode}") mergerfs_set_option(mount, "link-exdev", mode) link_path = dst + ".link" err = get_errno(lambda: os.link(src, link_path)) if err != 0: return fail(f"link-exdev={mode} returned errno={err}") err_msg = require_symlink(link_path, f"link-exdev={mode}") if err_msg: return fail(err_msg) resolved = symlink_resolves(link_path) if mode == "abs-base-symlink" and resolved != os.path.realpath(src_base): return fail(f"link-exdev={mode}: target {resolved!r} != {os.path.realpath(src_base)!r}") if mode != "abs-base-symlink" and resolved != os.path.realpath(src): return fail(f"link-exdev={mode}: target {resolved!r} != {os.path.realpath(src)!r}") src_ren, dst_ren, _ = setup_paths(branches, mount, rel_base, "rename_pass") mergerfs_set_option(mount, "rename-exdev", "passthrough") err = get_errno(lambda: os.rename(src_ren, dst_ren + ".ren.pass")) if err != errno.EXDEV: print(f"rename-exdev passthrough did not exercise EXDEV, errno={err}", end="") return SKIP for mode in ("rel-symlink", "abs-symlink"): src_ren, dst_ren, _ = setup_paths(branches, mount, rel_base, f"rename_{mode}") mergerfs_set_option(mount, "rename-exdev", mode) ren_path = dst_ren + ".ren" err = get_errno(lambda: os.rename(src_ren, ren_path)) if err != 0: return fail(f"rename-exdev={mode} returned errno={err}") err_msg = require_symlink(ren_path, f"rename-exdev={mode}") if err_msg: return fail(err_msg) target = symlink_resolves(ren_path) if ".mergerfs_rename_exdev" not in target: return fail(f"rename-exdev={mode}: target not moved under .mergerfs_rename_exdev: {target!r}") with open(ren_path, "rb") as fp: if fp.read() != b"src": return fail(f"rename-exdev={mode}: symlink target content mismatch") except (PermissionError, FileNotFoundError, OSError): return SKIP finally: try: mergerfs_set_option(mount, "category.create", orig_create) mergerfs_set_option(mount, "link-exdev", orig_link) mergerfs_set_option(mount, "rename-exdev", orig_rename) except OSError: pass return 0 finally: for branch in branches: cleanup_dir(join(branch, rel_base)) except RuntimeError as exc: print(str(exc), end="") return 77 if __name__ == "__main__": raise SystemExit(main()) mergerfs-2.42.0/tests/TEST_cfg_statfs_ignore0000755000000000000000000000423115177346257017545 0ustar rootroot#!/usr/bin/env python3 import os import sys from posix_parity import fail from posix_parity import mergerfs_get_option from posix_parity import mergerfs_mount from posix_parity import mergerfs_set_option def main(): try: with mergerfs_mount() as (mount, _): try: orig_statfs = mergerfs_get_option(mount, "statfs") orig_ignore = mergerfs_get_option(mount, "statfs-ignore") except (PermissionError, FileNotFoundError, OSError): return 0 try: mergerfs_set_option(mount, "statfs", "base") mergerfs_set_option(mount, "statfs-ignore", "none") s_none = os.statvfs(mount) mergerfs_set_option(mount, "statfs-ignore", "nc") s_nc = os.statvfs(mount) mergerfs_set_option(mount, "statfs-ignore", "ro") s_ro = os.statvfs(mount) if s_nc.f_bavail > s_none.f_bavail: return fail( f"statfs-ignore=nc increased bavail unexpectedly nc={s_nc.f_bavail} none={s_none.f_bavail}" ) if s_ro.f_bavail > s_nc.f_bavail: return fail( f"statfs-ignore=ro increased bavail unexpectedly ro={s_ro.f_bavail} nc={s_nc.f_bavail}" ) mergerfs_set_option(mount, "statfs", "full") s_full = os.statvfs(mount) if s_full.f_bsize <= 0 or s_full.f_frsize <= 0: return fail( f"statfs=full invalid block sizes bsize={s_full.f_bsize} frsize={s_full.f_frsize}" ) except (PermissionError, FileNotFoundError, OSError): return 0 finally: try: mergerfs_set_option(mount, "statfs", orig_statfs) mergerfs_set_option(mount, "statfs-ignore", orig_ignore) except OSError: pass return 0 except RuntimeError as exc: print(str(exc), end="") return 77 if __name__ == "__main__": raise SystemExit(main()) mergerfs-2.42.0/tests/TEST_cfg_xattr_modes0000755000000000000000000000504115177346257017227 0ustar rootroot#!/usr/bin/env python3 import errno import os import sys import tempfile from posix_parity import cleanup_dir from posix_parity import fail from posix_parity import join from posix_parity import mergerfs_get_option from posix_parity import mergerfs_mount from posix_parity import mergerfs_set_option from posix_parity import temp_dir from posix_parity import touch def get_errno(func): try: func() return 0 except OSError as exc: return exc.errno def main(): try: with mergerfs_mount() as (mount, _): merge_base = temp_dir(mount) try: path = join(merge_base, "file") xname = "user.test" xval = b"v" touch(path, b"x") try: orig = mergerfs_get_option(mount, "xattr") except (PermissionError, FileNotFoundError): return 0 try: mergerfs_set_option(mount, "xattr", "passthrough") set_err = get_errno(lambda: os.setxattr(path, xname, xval)) get_err = get_errno(lambda: os.getxattr(path, xname)) if set_err != 0: return fail(f"xattr=passthrough setxattr expected success got errno={set_err}") if get_err == errno.ENODATA: return fail(f"xattr=passthrough getxattr returned ENODATA, expected success") if get_err != 0: return fail(f"xattr=passthrough getxattr unexpected errno={get_err}") mergerfs_set_option(mount, "xattr", "noattr") err = get_errno(lambda: os.getxattr(path, xname)) if err != errno.ENODATA: return fail(f"xattr=noattr getxattr expected ENODATA got errno={err}") err = get_errno(lambda: os.setxattr(path, xname, xval)) if err != errno.ENODATA: return fail(f"xattr=noattr setxattr expected ENODATA got errno={err}") except (PermissionError, FileNotFoundError): return 0 finally: try: mergerfs_set_option(mount, "xattr", orig) except OSError: pass return 0 finally: cleanup_dir(merge_base) except RuntimeError as exc: print(str(exc), end="") return 77 if __name__ == "__main__": raise SystemExit(main()) mergerfs-2.42.0/tests/TEST_io_passthrough_create_open0000755000000000000000000000744715177346257021475 0ustar rootroot#!/usr/bin/env python3 import tempfile import os import sys def main(): try: from posix_parity import mergerfs_mount with mergerfs_mount() as (mount, _): (fd, filepath) = tempfile.mkstemp(dir=mount) try: test_data = b"passthrough io test data for create\n" * 100 bytes_written = os.write(fd, test_data) if bytes_written != len(test_data): print("create write failed: expected {} bytes, wrote {}".format(len(test_data), bytes_written)) return 1 os.lseek(fd, 0, os.SEEK_SET) read_data = os.read(fd, len(test_data)) if read_data != test_data: print("create read failed: data mismatch") return 1 os.close(fd) fd = -1 fd = os.open(filepath, os.O_RDWR) os.lseek(fd, 0, os.SEEK_SET) read_data = os.read(fd, len(test_data)) if read_data != test_data: print("open read failed: data mismatch") return 1 os.lseek(fd, 0, os.SEEK_END) more_data = b"additional passthrough data for open\n" * 50 bytes_written = os.write(fd, more_data) if bytes_written != len(more_data): print("open write failed: expected {} bytes, wrote {}".format(len(more_data), bytes_written)) return 1 os.lseek(fd, 0, os.SEEK_SET) all_data = os.read(fd, len(test_data) + len(more_data)) if all_data != test_data + more_data: print("open final read failed: data mismatch") return 1 fd2 = os.open(filepath, os.O_RDWR) try: os.lseek(fd2, 0, os.SEEK_SET) read_data2 = os.read(fd2, len(test_data) + len(more_data)) if read_data2 != test_data + more_data: print("second open read failed: data mismatch") return 1 os.lseek(fd2, 0, os.SEEK_END) extra_data = b"data from second file descriptor\n" * 25 bytes_written = os.write(fd2, extra_data) if bytes_written != len(extra_data): print("second open write failed: expected {} bytes, wrote {}".format(len(extra_data), bytes_written)) return 1 os.lseek(fd, 0, os.SEEK_SET) combined_data = os.read(fd, len(test_data) + len(more_data) + len(extra_data)) expected_data = test_data + more_data + extra_data if combined_data != expected_data: print("cross-fd read failed: data mismatch (writes from fd2 not visible on fd)") return 1 finally: os.close(fd2) fd3 = os.open(filepath, os.O_RDONLY) try: os.lseek(fd3, 0, os.SEEK_SET) read_data3 = os.read(fd3, len(expected_data)) if read_data3 != expected_data: print("third open read failed: data mismatch") return 1 finally: os.close(fd3) os.close(fd) fd = -1 return 0 finally: if fd >= 0: os.close(fd) try: os.unlink(filepath) except FileNotFoundError: pass except RuntimeError as exc: print(str(exc), end="") return 77 if __name__ == "__main__": raise SystemExit(main()) mergerfs-2.42.0/tests/TEST_io_passthrough_open_race0000755000000000000000000000771415177346257021141 0ustar rootroot#!/usr/bin/env python3 import os import sys import tempfile import threading from posix_parity import mergerfs_mount NUM_THREADS = 50 TEST_DATA = b"race condition test data\n" def open_and_operate(filepath, barrier, results, index): fd = None try: barrier.wait() fd = os.open(filepath, os.O_RDWR) offset = index * len(TEST_DATA) os.lseek(fd, offset, os.SEEK_SET) bytes_written = os.write(fd, TEST_DATA) if bytes_written != len(TEST_DATA): results[index] = ("write_error", "expected {} bytes, wrote {}".format(len(TEST_DATA), bytes_written)) os.close(fd) fd = None return os.lseek(fd, offset, os.SEEK_SET) read_data = os.read(fd, len(TEST_DATA)) if read_data != TEST_DATA: results[index] = ("read_error", "data mismatch at offset {}".format(offset)) os.close(fd) fd = None return results[index] = ("success", fd) fd = None except Exception as e: if fd is not None: try: os.close(fd) except OSError: pass results[index] = ("exception", str(e)) def main(): try: with mergerfs_mount() as (mount, _): (fd, filepath) = tempfile.mkstemp(dir=mount) total_size = NUM_THREADS * len(TEST_DATA) os.ftruncate(fd, total_size) os.close(fd) barrier = threading.Barrier(NUM_THREADS) results = [None] * NUM_THREADS threads = [] for i in range(NUM_THREADS): t = threading.Thread(target=open_and_operate, args=(filepath, barrier, results, i)) threads.append(t) for t in threads: t.start() for t in threads: t.join() failed = False fds_to_close = [] for i, result in enumerate(results): if result is None: print("thread {} returned no result".format(i)) failed = True elif result[0] == "success": fds_to_close.append(result[1]) else: print("thread {} failed: {} - {}".format(i, result[0], result[1])) failed = True if failed: for fd in fds_to_close: os.close(fd) os.unlink(filepath) return 1 if fds_to_close: verify_fd = fds_to_close[0] os.lseek(verify_fd, 0, os.SEEK_SET) all_data = os.read(verify_fd, total_size) expected_data = TEST_DATA * NUM_THREADS if all_data != expected_data: print("final verification failed: data mismatch") print("expected {} bytes, got {} bytes".format(len(expected_data), len(all_data))) for fd in fds_to_close: os.close(fd) os.unlink(filepath) return 1 if len(fds_to_close) >= 2: fd_a = fds_to_close[0] fd_b = fds_to_close[1] new_data = b"cross-fd visibility test\n" os.lseek(fd_a, 0, os.SEEK_SET) os.write(fd_a, new_data) os.lseek(fd_b, 0, os.SEEK_SET) read_back = os.read(fd_b, len(new_data)) if read_back != new_data: print("cross-fd visibility failed: write from fd_a not visible on fd_b") for fd in fds_to_close: os.close(fd) os.unlink(filepath) return 1 for fd in fds_to_close: os.close(fd) os.unlink(filepath) return 0 except RuntimeError as exc: print(str(exc), end="") return 77 if __name__ == "__main__": raise SystemExit(main()) mergerfs-2.42.0/tests/TEST_mount_lifecycle0000755000000000000000000000147415177346257017246 0ustar rootroot#!/usr/bin/env python3 import os import sys from posix_parity import fail from posix_parity import find_fusermount from posix_parity import find_mergerfs from posix_parity import mergerfs_mount def main(): if os.geteuid() != 0: return 0 if find_mergerfs() is None: return 0 if find_fusermount() is None: return 0 try: with mergerfs_mount() as (mount, _): with open(os.path.join(mount, "lifecycle-file"), "wb") as fp: fp.write(b"ok") if not os.path.exists(os.path.join(mount, "lifecycle-file")): return fail("mount lifecycle: expected created file to exist") return 0 except RuntimeError as exc: print(str(exc), end="") return 77 if __name__ == "__main__": raise SystemExit(main())mergerfs-2.42.0/tests/TEST_movefile_enospc0000755000000000000000000000545515177346257017245 0ustar rootroot#!/usr/bin/env python3 import errno import os import sys from posix_parity import cleanup_dir from posix_parity import fail from posix_parity import join from posix_parity import mergerfs_branches from posix_parity import mergerfs_get_option from posix_parity import mergerfs_mount from posix_parity import mergerfs_set_option from posix_parity import temp_dir from posix_parity import touch SKIP = 77 def main(): try: with mergerfs_mount(num_branches=2) as (mount, branches): try: orig_moveonenospc = mergerfs_get_option(mount, "moveonenospc") except (PermissionError, FileNotFoundError): print("moveonenospc runtime option unavailable", end="") return SKIP except OSError as exc: if exc.errno == errno.EOPNOTSUPP: print("moveonenospc runtime option unsupported", end="") return SKIP raise if len(branches) < 2: print("moveonenospc test requires at least 2 branches", end="") return SKIP merge_base = temp_dir(mount) try: mergerfs_set_option(mount, "moveonenospc", "mfs") if mergerfs_get_option(mount, "moveonenospc") != "mfs": return fail("moveonenospc: failed to set documented policy value") merge_file = join(merge_base, "enospc_test") touch(merge_file, b"test data for enospc") if not os.path.exists(merge_file): return fail("moveonenospc: file was not created") fullpath = None try: fullpath = os.getxattr(merge_file, "user.mergerfs.fullpath").decode() except OSError: pass if fullpath and not os.path.exists(fullpath): return fail(f"moveonenospc: fullpath does not exist on disk: {fullpath}") with open(merge_file, "r") as f: content = f.read() if content != "test data for enospc": return fail(f"moveonenospc: file content mismatch: got {content!r}") mergerfs_set_option(mount, "moveonenospc", orig_moveonenospc) print("moveonenospc ENOSPC path requires a constrained branch", end="") return SKIP except Exception as exc: try: mergerfs_set_option(mount, "moveonenospc", orig_moveonenospc) except Exception: pass return fail(str(exc)) finally: cleanup_dir(merge_base) except RuntimeError as exc: print(str(exc), end="") return 77 if __name__ == "__main__": raise SystemExit(main()) mergerfs-2.42.0/tests/TEST_no_fuse_hidden0000755000000000000000000000134415177346257017032 0ustar rootroot#!/usr/bin/env python3 import tempfile import os import sys from posix_parity import mergerfs_mount def main(): try: with mergerfs_mount() as (mount, _): (fd, filepath) = tempfile.mkstemp(dir=mount) os.unlink(filepath) found = False for entry in os.scandir(mount): if entry.name.startswith(".fuse_hidden"): print("found .fuse_hidden file {}".format(entry.name), end='') found = True os.close(fd) if found: return 1 return 0 except RuntimeError as exc: print(str(exc), end="") return 77 if __name__ == "__main__": raise SystemExit(main()) mergerfs-2.42.0/tests/TEST_o_direct0000755000000000000000000000364015177346257015652 0ustar rootroot#!/usr/bin/env python3 import tempfile import ctypes import mmap import os import resource import sys from posix_parity import mergerfs_mount libc = ctypes.CDLL(None, use_errno=True) libc.read.argtypes = [ctypes.c_int, ctypes.c_void_p, ctypes.c_size_t] libc.read.restype = ctypes.c_ssize_t def aligned_read(fd, size): buf = mmap.mmap(-1, size) ptr = ctypes.addressof(ctypes.c_char.from_buffer(buf)) ctypes.set_errno(0) rv = libc.read(fd, ctypes.c_void_p(ptr), size) if rv < 0: err = ctypes.get_errno() buf.close() raise OSError(err, os.strerror(err)) data = buf[:rv] buf.close() return data def main(): try: with mergerfs_mount() as (mount, _): (fd, filepath) = tempfile.mkstemp(dir=mount) os.close(fd) fd = os.open(filepath, os.O_RDWR|os.O_DIRECT|os.O_TRUNC) os.unlink(filepath) size = resource.getpagesize() pattern = (b"mergerfs-o-direct" * ((size // 16) + 1))[:size] buf = mmap.mmap(-1, size) buf.write(pattern) buf.seek(0) try: written = os.write(fd, buf) if written != size: print(f"O_DIRECT short write: wrote {written}, expected {size}", end="") return 1 os.lseek(fd, 0, os.SEEK_SET) data = aligned_read(fd, size) if len(data) != size: print(f"O_DIRECT short read: read {len(data)}, expected {size}", end="") return 1 if data != pattern: print("O_DIRECT data mismatch", end="") return 1 finally: buf.close() os.close(fd) return 0 except RuntimeError as exc: print(str(exc), end="") return 77 if __name__ == "__main__": raise SystemExit(main()) mergerfs-2.42.0/tests/TEST_open_after_unlink0000755000000000000000000000435015177346257017563 0ustar rootroot#!/usr/bin/env python3 import os import sys from posix_parity import cleanup_dir from posix_parity import fail from posix_parity import join from posix_parity import mergerfs_mount from posix_parity import temp_dir from posix_parity import touch def main(): try: with mergerfs_mount() as (mount, _): merge_base = temp_dir(mount) try: merge_file = join(merge_base, "testfile") touch(merge_file, b"hello world") fd = os.open(merge_file, os.O_RDWR) try: data = os.read(fd, 4096) if data != b"hello world": return fail("read before unlink: expected 'hello world', got {!r}".format(data)) os.unlink(merge_file) fd2 = os.dup(fd) try: os.lseek(fd2, 0, os.SEEK_SET) data2 = os.read(fd2, 4096) if data2 != b"hello world": return fail("read after unlink via dup: expected 'hello world', got {!r}".format(data2)) os.lseek(fd, 0, os.SEEK_SET) written = os.write(fd, b"modified") if written != len(b"modified"): return fail("write after unlink: wrote {}, expected {}".format(written, len(b"modified"))) os.lseek(fd, 0, os.SEEK_SET) data3 = os.read(fd, 4096) if not data3.startswith(b"modified"): return fail("read back written data: got {!r} after writing 'modified'".format(data3)) finally: os.close(fd2) finally: os.close(fd) return 0 except Exception as exc: return fail(str(exc)) finally: try: os.unlink(join(merge_base, "testfile")) except FileNotFoundError: pass cleanup_dir(merge_base) except RuntimeError as exc: print(str(exc), end="") return 77 if __name__ == "__main__": raise SystemExit(main()) mergerfs-2.42.0/tests/TEST_policy_lup0000755000000000000000000001046315177346257016242 0ustar rootroot#!/usr/bin/env python3 import os import sys from posix_parity import cleanup_dir from posix_parity import fail from posix_parity import join from posix_parity import mergerfs_branches from posix_parity import mergerfs_get_option from posix_parity import mergerfs_mount from posix_parity import mergerfs_set_option from posix_parity import temp_dir from posix_parity import touch SKIP = 77 def used_percent(path): st = os.statvfs(path) if st.f_blocks == 0: return 1.0 used = st.f_blocks - st.f_bfree return used / st.f_blocks def branch_for_fullpath(branches, fullpath): fullpath = os.path.realpath(fullpath) for branch in branches: branch = os.path.realpath(branch) try: common = os.path.commonpath([branch, fullpath]) except ValueError: continue if common == branch: return branch return None def least_used_branches(branches, rel_dir): scored = [] for branch in branches: path = join(branch, rel_dir) if os.path.isdir(path): scored.append((used_percent(path), os.path.realpath(branch))) if not scored: return set() min_used = min(score for score, _ in scored) return {branch for score, branch in scored if score == min_used} def main(): try: with mergerfs_mount(num_branches=2) as (mount, branches): try: orig_create = mergerfs_get_option(mount, "func.create") except (PermissionError, FileNotFoundError, OSError): print("LUP create policy option unavailable", end="") return SKIP try: orig_search = mergerfs_get_option(mount, "func.search") except (PermissionError, FileNotFoundError, OSError): print("LUP search policy option unavailable", end="") return SKIP if len(branches) < 2: print("LUP policy test requires at least 2 branches", end="") return SKIP merge_base = temp_dir(mount) rel_base = os.path.relpath(merge_base, mount) try: for branch in branches: os.makedirs(join(branch, rel_base), exist_ok=True) mergerfs_set_option(mount, "func.create", "lup") mergerfs_set_option(mount, "func.search", "lup") path = join(merge_base, "lup_test_file") expected = least_used_branches(branches, rel_base) touch(path, b"lup create test") if not os.path.exists(path): return fail("LUP create: file not created") fullpath = os.getxattr(path, "user.mergerfs.fullpath").decode() if not fullpath: return fail("LUP create: no fullpath attribute") actual = branch_for_fullpath(branches, fullpath) if actual not in expected: return fail(f"LUP create: selected {actual}, expected one of {sorted(expected)}") path2 = join(merge_base, "lup_test_file2") for branch in branches: touch(join(branch, rel_base, "lup_test_file2"), b"lup search test") expected = least_used_branches(branches, rel_base) fullpath2 = os.getxattr(path2, "user.mergerfs.fullpath").decode() if not fullpath2: return fail("LUP search: no fullpath attribute") actual = branch_for_fullpath(branches, fullpath2) if actual not in expected: return fail(f"LUP search: selected {actual}, expected one of {sorted(expected)}") mergerfs_set_option(mount, "func.create", orig_create) mergerfs_set_option(mount, "func.search", orig_search) return 0 except Exception as exc: mergerfs_set_option(mount, "func.create", orig_create) mergerfs_set_option(mount, "func.search", orig_search) return fail(str(exc)) finally: cleanup_dir(merge_base) for branch in branches: cleanup_dir(join(branch, rel_base)) except RuntimeError as exc: print(str(exc), end="") return 77 if __name__ == "__main__": raise SystemExit(main()) mergerfs-2.42.0/tests/TEST_posix_access0000755000000000000000000000517215177346257016547 0ustar rootroot#!/usr/bin/env python3 import errno import os import sys import tempfile from posix_parity import cleanup_dir from posix_parity import cleanup_paths from posix_parity import compare_access from posix_parity import fail from posix_parity import join from posix_parity import mergerfs_mount from posix_parity import temp_dir from posix_parity import touch def main(): try: with mergerfs_mount() as (mount, _): with tempfile.TemporaryDirectory() as native: merge_base = temp_dir(mount) try: native_base = join(native, os.path.basename(merge_base)) os.makedirs(native_base, exist_ok=True) merge_file = join(merge_base, "file") native_file = join(native_base, "file") merge_notdir = join(merge_base, "notdir") native_notdir = join(native_base, "notdir") merge_missing = join(merge_base, "missing") native_missing = join(native_base, "missing") cleanup_paths([merge_file, merge_notdir]) touch(merge_file, b"ok", 0o644) touch(native_file, b"ok", 0o644) touch(merge_notdir, b"x", 0o644) touch(native_notdir, b"x", 0o644) err = compare_access("F_OK existing", merge_file, native_file, os.F_OK) if err: return fail(err) err = compare_access( "F_OK missing", merge_missing, native_missing, os.F_OK, errno.ENOENT ) if err: return fail(err) err = compare_access( "X_OK non-directory prefix", join(merge_notdir, "child"), join(native_notdir, "child"), os.X_OK, errno.ENOTDIR, ) if err: return fail(err) os.chmod(merge_file, 0) os.chmod(native_file, 0) err = compare_access("R_OK unreadable", merge_file, native_file, os.R_OK) if err: return fail(err) os.chmod(merge_file, 0o644) os.chmod(native_file, 0o644) return 0 finally: cleanup_dir(merge_base) except RuntimeError as exc: print(str(exc), end="") return 77 if __name__ == "__main__": raise SystemExit(main()) mergerfs-2.42.0/tests/TEST_posix_bmap0000755000000000000000000000421515177346257016222 0ustar rootroot#!/usr/bin/env python3 import ctypes import errno import fcntl import os import struct import sys import tempfile from posix_parity import cleanup_dir from posix_parity import compare_calls from posix_parity import fail from posix_parity import join from posix_parity import mergerfs_mount from posix_parity import temp_dir from posix_parity import touch FIBMAP = 1 def fibmap(fd, block=0): buf = struct.pack("i", block) out = fcntl.ioctl(fd, FIBMAP, buf) return struct.unpack("i", out)[0] def main(): try: with mergerfs_mount() as (mount, _): with tempfile.TemporaryDirectory() as native: merge_base = temp_dir(mount) try: native_base = join(native, os.path.basename(merge_base)) os.makedirs(native_base, exist_ok=True) merge_file = join(merge_base, "file") native_file = join(native_base, "file") touch(merge_file, b"x" * 8192) touch(native_file, b"x" * 8192) mfd = os.open(merge_file, os.O_RDONLY) nfd = os.open(native_file, os.O_RDONLY) try: err = compare_calls( "ioctl FIBMAP block0", lambda: fibmap(mfd, 0), lambda: fibmap(nfd, 0), lambda a, b: (a >= 0) == (b >= 0), ) if err: return fail(err) finally: os.close(mfd) os.close(nfd) err = compare_calls( "ioctl FIBMAP EBADF", lambda: fibmap(mfd, 0), lambda: fibmap(nfd, 0), ) if err: return fail(err) return 0 finally: cleanup_dir(merge_base) except RuntimeError as exc: print(str(exc), end="") return 77 if __name__ == "__main__": raise SystemExit(main()) mergerfs-2.42.0/tests/TEST_posix_chmod0000755000000000000000000000701115177346257016372 0ustar rootroot#!/usr/bin/env python3 import errno import os import stat import sys import tempfile from posix_parity import cleanup_dir from posix_parity import cleanup_paths from posix_parity import compare_calls from posix_parity import fail from posix_parity import join from posix_parity import mergerfs_mount from posix_parity import should_compare_inode from posix_parity import stat_cmp_basic from posix_parity import temp_dir from posix_parity import touch def stat_cmp_basic_with_inode(lhs, rhs): return stat_cmp_basic(lhs, rhs) and lhs.st_ino == rhs.st_ino def main(): try: with mergerfs_mount() as (mount, _): stcmp = stat_cmp_basic_with_inode if should_compare_inode(mount) else stat_cmp_basic with tempfile.TemporaryDirectory() as native: merge_base = temp_dir(mount) try: native_base = join(native, os.path.basename(merge_base)) os.makedirs(native_base, exist_ok=True) merge_file = join(merge_base, "file") native_file = join(native_base, "file") merge_missing = join(merge_base, "missing") native_missing = join(native_base, "missing") merge_notdir = join(merge_base, "notdir") native_notdir = join(native_base, "notdir") cleanup_paths([merge_file, merge_notdir]) touch(merge_file, b"x", 0o644) touch(native_file, b"x", 0o644) touch(merge_notdir, b"x", 0o644) touch(native_notdir, b"x", 0o644) err = compare_calls( "chmod success", lambda: os.chmod(merge_file, 0o600), lambda: os.chmod(native_file, 0o600), ) if err: return fail(err) err = compare_calls( "chmod stat parity", lambda: os.lstat(merge_file), lambda: os.lstat(native_file), stcmp, ) if err: return fail(err) err = compare_calls( "chmod ENOENT", lambda: os.chmod(merge_missing, 0o600), lambda: os.chmod(native_missing, 0o600), ) if err: return fail(err) err = compare_calls( "chmod ENOTDIR", lambda: os.chmod(join(merge_notdir, "child"), 0o600), lambda: os.chmod(join(native_notdir, "child"), 0o600), ) if err: return fail(err) if os.geteuid() != 0: err = compare_calls( "chmod setuid parity", lambda: os.chmod(merge_file, stat.S_ISUID | 0o644), lambda: os.chmod(native_file, stat.S_ISUID | 0o644), ) if err: return fail(err) else: _ = errno.EPERM return 0 finally: cleanup_dir(merge_base) except RuntimeError as exc: print(str(exc), end="") return 77 if __name__ == "__main__": raise SystemExit(main()) mergerfs-2.42.0/tests/TEST_posix_chown0000755000000000000000000000560015177346257016420 0ustar rootroot#!/usr/bin/env python3 import os import sys import tempfile from posix_parity import cleanup_dir from posix_parity import cleanup_paths from posix_parity import compare_calls from posix_parity import fail from posix_parity import join from posix_parity import mergerfs_mount from posix_parity import temp_dir from posix_parity import touch def main(): try: with mergerfs_mount() as (mount, _): uid = os.getuid() gid = os.getgid() with tempfile.TemporaryDirectory() as native: merge_base = temp_dir(mount) try: native_base = join(native, os.path.basename(merge_base)) os.makedirs(native_base, exist_ok=True) merge_file = join(merge_base, "file") native_file = join(native_base, "file") merge_missing = join(merge_base, "missing") native_missing = join(native_base, "missing") merge_notdir = join(merge_base, "notdir") native_notdir = join(native_base, "notdir") cleanup_paths([merge_file, merge_notdir]) touch(merge_file, b"x", 0o644) touch(native_file, b"x", 0o644) touch(merge_notdir, b"x", 0o644) touch(native_notdir, b"x", 0o644) err = compare_calls( "chown self", lambda: os.chown(merge_file, uid, gid), lambda: os.chown(native_file, uid, gid), ) if err: return fail(err) err = compare_calls( "chown ENOENT", lambda: os.chown(merge_missing, uid, gid), lambda: os.chown(native_missing, uid, gid), ) if err: return fail(err) err = compare_calls( "chown ENOTDIR", lambda: os.chown(join(merge_notdir, "child"), uid, gid), lambda: os.chown(join(native_notdir, "child"), uid, gid), ) if err: return fail(err) if os.geteuid() != 0: err = compare_calls( "chown EPERM foreign uid", lambda: os.chown(merge_file, 0, gid), lambda: os.chown(native_file, 0, gid), ) if err: return fail(err) return 0 finally: cleanup_dir(merge_base) except RuntimeError as exc: print(str(exc), end="") return 77 if __name__ == "__main__": raise SystemExit(main()) mergerfs-2.42.0/tests/TEST_posix_copy_file_range0000755000000000000000000001613415177346257020433 0ustar rootroot#!/usr/bin/env python3 import errno import hashlib import os import shutil import sys import tempfile from posix_parity import cleanup_dir from posix_parity import compare_calls from posix_parity import fail from posix_parity import join from posix_parity import mergerfs_mount from posix_parity import temp_dir from posix_parity import touch def _native_tmp(): tests_dir = os.path.dirname(os.path.realpath(__file__)) parent = os.path.join(tests_dir, ".test_tmp") os.makedirs(parent, exist_ok=True) return tempfile.mkdtemp(prefix="native_", dir=parent) class NativeTmp: def __enter__(self): self.path = _native_tmp() return self.path def __exit__(self, *args): shutil.rmtree(self.path, ignore_errors=True) def main(): try: with mergerfs_mount() as (mount, _): if not hasattr(os, "copy_file_range"): return 0 with NativeTmp() as native: merge_base = temp_dir(mount) try: native_base = join(native, os.path.basename(merge_base)) os.makedirs(native_base, exist_ok=True) merge_src = join(merge_base, "src") merge_dst = join(merge_base, "dst") native_src = join(native_base, "src") native_dst = join(native_base, "dst") payload = b"0123456789abcdefghijklmnopqrstuvwxyz" touch(merge_src, payload) touch(native_src, payload) touch(merge_dst, b"") touch(native_dst, b"") msfd = os.open(merge_src, os.O_RDONLY) mdfd = os.open(merge_dst, os.O_WRONLY) nsfd = os.open(native_src, os.O_RDONLY) ndfd = os.open(native_dst, os.O_WRONLY) try: err = compare_calls( "copy_file_range success", lambda: os.copy_file_range(msfd, mdfd, 16), lambda: os.copy_file_range(nsfd, ndfd, 16), lambda a, b: a == b, ) if err: return fail(err) finally: os.close(msfd) os.close(mdfd) os.close(nsfd) os.close(ndfd) with open(merge_dst, "rb") as mf, open(native_dst, "rb") as nf: mdata = mf.read() ndata = nf.read() if mdata != ndata: return fail(f"copy_file_range dst mismatch mergerfs={mdata!r} native={ndata!r}") mdfd = os.open(merge_dst, os.O_WRONLY) ndfd = os.open(native_dst, os.O_WRONLY) try: err = compare_calls( "copy_file_range EBADF src", lambda: os.copy_file_range(-1, mdfd, 1), lambda: os.copy_file_range(-1, ndfd, 1), ) if err: return fail(err) finally: os.close(mdfd) os.close(ndfd) large_len = (5 << 30) + 4096 merge_large_src = join(merge_base, "src-large") merge_large_dst = join(merge_base, "dst-large") native_large_src = join(native_base, "src-large") native_large_dst = join(native_base, "dst-large") touch(merge_large_src, b"") touch(merge_large_dst, b"") touch(native_large_src, b"") touch(native_large_dst, b"") msfd = os.open(merge_large_src, os.O_RDWR) mdfd = os.open(merge_large_dst, os.O_RDWR) nsfd = os.open(native_large_src, os.O_RDWR) ndfd = os.open(native_large_dst, os.O_RDWR) try: try: os.ftruncate(msfd, large_len) os.ftruncate(nsfd, large_len) os.pwrite(msfd, b"z", large_len - 1) os.pwrite(nsfd, b"z", large_len - 1) except OSError as exc: if exc.errno in (errno.ENOSPC, errno.EFBIG): return 0 raise total_m = 0 while True: n = os.copy_file_range(msfd, mdfd, large_len) if n == 0: break total_m += n if total_m >= large_len: break total_n = 0 while True: n = os.copy_file_range(nsfd, ndfd, large_len) if n == 0: break total_n += n if total_n >= large_len: break mstat = os.fstat(mdfd) nstat = os.fstat(ndfd) if mstat.st_size != nstat.st_size: return fail( "copy_file_range large sparse dst size mismatch " f"mergerfs={mstat.st_size} native={nstat.st_size}" ) def sha256_partial(fd, size): h = hashlib.sha256() pos = os.lseek(fd, 0, os.SEEK_SET) remaining = size while remaining > 0: chunk = os.read(fd, min(remaining, 65536)) if not chunk: break h.update(chunk) remaining -= len(chunk) os.lseek(fd, pos, os.SEEK_SET) return h.digest() if os.path.getsize(merge_large_dst) != os.path.getsize(native_large_dst): return fail("copy_file_range large: final sizes differ") mhash = sha256_partial(mdfd, mstat.st_size) nhash = sha256_partial(ndfd, nstat.st_size) if mhash != nhash: return fail("copy_file_range large: content hash mismatch") finally: os.close(msfd) os.close(mdfd) os.close(nsfd) os.close(ndfd) return 0 finally: cleanup_dir(merge_base) except RuntimeError as exc: print(str(exc), end="") return 77 if __name__ == "__main__": raise SystemExit(main())mergerfs-2.42.0/tests/TEST_posix_create_mknod0000755000000000000000000000716115177346257017741 0ustar rootroot#!/usr/bin/env python3 import os import stat import sys import tempfile from posix_parity import cleanup_dir from posix_parity import cleanup_paths from posix_parity import compare_calls from posix_parity import fail from posix_parity import join from posix_parity import mergerfs_mount from posix_parity import temp_dir def main(): try: with mergerfs_mount() as (mount, _): with tempfile.TemporaryDirectory() as native: merge_base = temp_dir(mount) try: native_base = join(native, os.path.basename(merge_base)) os.makedirs(native_base, exist_ok=True) merge_file = join(merge_base, "file") native_file = join(native_base, "file") merge_exist = join(merge_base, "exist") native_exist = join(native_base, "exist") merge_notdir = join(merge_base, "notdir") native_notdir = join(native_base, "notdir") cleanup_paths([merge_file, merge_exist, merge_notdir]) err = compare_calls( "create success", lambda: os.open(merge_file, os.O_CREAT | os.O_EXCL | os.O_WRONLY, 0o640), lambda: os.open(native_file, os.O_CREAT | os.O_EXCL | os.O_WRONLY, 0o640), close_fds=True, ) if err: return fail(err) with open(merge_exist, "wb"): pass with open(native_exist, "wb"): pass err = compare_calls( "create EEXIST", lambda: os.open(merge_exist, os.O_CREAT | os.O_EXCL | os.O_WRONLY, 0o640), lambda: os.open(native_exist, os.O_CREAT | os.O_EXCL | os.O_WRONLY, 0o640), close_fds=True, ) if err: return fail(err) with open(merge_notdir, "wb"): pass with open(native_notdir, "wb"): pass err = compare_calls( "create ENOTDIR", lambda: os.open(join(merge_notdir, "child"), os.O_CREAT | os.O_WRONLY, 0o640), lambda: os.open(join(native_notdir, "child"), os.O_CREAT | os.O_WRONLY, 0o640), ) if err: return fail(err) merge_node = join(merge_base, "mknod") native_node = join(native_base, "mknod") cleanup_paths([merge_node]) err = compare_calls( "mknod regular", lambda: os.mknod(merge_node, stat.S_IFREG | 0o600, 0), lambda: os.mknod(native_node, stat.S_IFREG | 0o600, 0), ) if err: return fail(err) err = compare_calls( "mknod EEXIST", lambda: os.mknod(merge_node, stat.S_IFREG | 0o600, 0), lambda: os.mknod(native_node, stat.S_IFREG | 0o600, 0), ) if err: return fail(err) return 0 finally: cleanup_dir(merge_base) except RuntimeError as exc: print(str(exc), end="") return 77 if __name__ == "__main__": raise SystemExit(main()) mergerfs-2.42.0/tests/TEST_posix_fsync_flush0000755000000000000000000000605215177346257017627 0ustar rootroot#!/usr/bin/env python3 import os import sys import tempfile from posix_parity import cleanup_dir from posix_parity import compare_calls from posix_parity import fail from posix_parity import join from posix_parity import mergerfs_mount from posix_parity import temp_dir from posix_parity import touch def main(): try: with mergerfs_mount() as (mount, _): with tempfile.TemporaryDirectory() as native: merge_base = temp_dir(mount) try: native_base = join(native, os.path.basename(merge_base)) os.makedirs(native_base, exist_ok=True) merge_file = join(merge_base, "file") native_file = join(native_base, "file") merge_dir = join(merge_base, "dir") native_dir = join(native_base, "dir") touch(merge_file, b"abc") touch(native_file, b"abc") os.makedirs(merge_dir, exist_ok=True) os.makedirs(native_dir, exist_ok=True) mfd = os.open(merge_file, os.O_RDWR) nfd = os.open(native_file, os.O_RDWR) try: os.lseek(mfd, 0, os.SEEK_END) os.lseek(nfd, 0, os.SEEK_END) os.write(mfd, b"-appended") os.write(nfd, b"-appended") err = compare_calls("fsync file", lambda: os.fsync(mfd), lambda: os.fsync(nfd)) if err: return fail(err) finally: os.close(mfd) os.close(nfd) mdirfd = os.open(merge_dir, os.O_RDONLY | os.O_DIRECTORY) ndirfd = os.open(native_dir, os.O_RDONLY | os.O_DIRECTORY) try: err = compare_calls("fsync dir", lambda: os.fsync(mdirfd), lambda: os.fsync(ndirfd)) if err: return fail(err) finally: os.close(mdirfd) os.close(ndirfd) bad_m = os.open(merge_file, os.O_RDONLY) bad_n = os.open(native_file, os.O_RDONLY) os.close(bad_m) os.close(bad_n) err = compare_calls("fsync EBADF", lambda: os.fsync(bad_m), lambda: os.fsync(bad_n)) if err: return fail(err) with open(merge_file, "rb") as mf, open(native_file, "rb") as nf: mdata = mf.read() ndata = nf.read() if mdata != ndata: return fail(f"flush content mismatch mergerfs={mdata!r} native={ndata!r}") return 0 finally: cleanup_dir(merge_base) except RuntimeError as exc: print(str(exc), end="") return 77 if __name__ == "__main__": raise SystemExit(main()) mergerfs-2.42.0/tests/TEST_posix_getattr_fgetattr0000755000000000000000000000750715177346257020664 0ustar rootroot#!/usr/bin/env python3 import os import stat import sys import tempfile from posix_parity import cleanup_dir from posix_parity import cleanup_paths from posix_parity import compare_calls from posix_parity import fail from posix_parity import join from posix_parity import mergerfs_mount from posix_parity import should_compare_inode from posix_parity import temp_dir from posix_parity import touch def st_cmp(lhs, rhs, compare_ino=False): base = ( stat.S_IFMT(lhs.st_mode) == stat.S_IFMT(rhs.st_mode) and stat.S_IMODE(lhs.st_mode) == stat.S_IMODE(rhs.st_mode) and lhs.st_nlink == rhs.st_nlink ) if stat.S_ISDIR(lhs.st_mode) or stat.S_ISDIR(rhs.st_mode): return base and (not compare_ino or lhs.st_ino == rhs.st_ino) return base and lhs.st_size == rhs.st_size and (not compare_ino or lhs.st_ino == rhs.st_ino) def main(): try: with mergerfs_mount() as (mount, _): compare_ino = should_compare_inode(mount) with tempfile.TemporaryDirectory() as native: merge_base = temp_dir(mount) try: native_base = join(native, os.path.basename(merge_base)) os.makedirs(native_base, exist_ok=True) merge_file = join(merge_base, "file") native_file = join(native_base, "file") merge_dir = join(merge_base, "dir") native_dir = join(native_base, "dir") merge_missing = join(merge_base, "missing") native_missing = join(native_base, "missing") merge_notdir = join(merge_base, "notdir") native_notdir = join(native_base, "notdir") cleanup_paths([merge_file, merge_dir, merge_notdir]) touch(merge_file, b"abc", 0o640) touch(native_file, b"abc", 0o640) os.makedirs(merge_dir, exist_ok=True) os.makedirs(native_dir, exist_ok=True) touch(merge_notdir, b"x", 0o644) touch(native_notdir, b"x", 0o644) err = compare_calls( "lstat regular", lambda: os.lstat(merge_file), lambda: os.lstat(native_file), lambda l, r: st_cmp(l, r, compare_ino) ) if err: return fail(err) err = compare_calls( "lstat directory", lambda: os.lstat(merge_dir), lambda: os.lstat(native_dir), lambda l, r: st_cmp(l, r, compare_ino) ) if err: return fail(err) mfd = os.open(merge_file, os.O_RDONLY) nfd = os.open(native_file, os.O_RDONLY) try: err = compare_calls("fstat open fd", lambda: os.fstat(mfd), lambda: os.fstat(nfd), lambda l, r: st_cmp(l, r, compare_ino)) if err: return fail(err) finally: os.close(mfd) os.close(nfd) err = compare_calls("lstat ENOENT", lambda: os.lstat(merge_missing), lambda: os.lstat(native_missing)) if err: return fail(err) err = compare_calls( "lstat ENOTDIR", lambda: os.lstat(join(merge_notdir, "child")), lambda: os.lstat(join(native_notdir, "child")), ) if err: return fail(err) return 0 finally: cleanup_dir(merge_base) except RuntimeError as exc: print(str(exc), end="") return 77 if __name__ == "__main__": raise SystemExit(main()) mergerfs-2.42.0/tests/TEST_posix_ioctl0000755000000000000000000000420415177346257016413 0ustar rootroot#!/usr/bin/env python3 import array import fcntl import os import termios import sys import tempfile from posix_parity import cleanup_dir from posix_parity import compare_calls from posix_parity import fail from posix_parity import join from posix_parity import mergerfs_mount from posix_parity import temp_dir from posix_parity import touch def fionread(fd): buf = array.array("i", [0]) fcntl.ioctl(fd, termios.FIONREAD, buf, True) return buf[0] def main(): try: with mergerfs_mount() as (mount, _): with tempfile.TemporaryDirectory() as native: merge_base = temp_dir(mount) try: native_base = join(native, os.path.basename(merge_base)) os.makedirs(native_base, exist_ok=True) merge_file = join(merge_base, "file") native_file = join(native_base, "file") touch(merge_file, b"hello-world") touch(native_file, b"hello-world") mfd = os.open(merge_file, os.O_RDONLY) nfd = os.open(native_file, os.O_RDONLY) try: err = compare_calls("ioctl FIONREAD", lambda: fionread(mfd), lambda: fionread(nfd), lambda a, b: a == b) if err: return fail(err) os.lseek(mfd, 5, os.SEEK_SET) os.lseek(nfd, 5, os.SEEK_SET) err = compare_calls( "ioctl FIONREAD after seek", lambda: fionread(mfd), lambda: fionread(nfd), lambda a, b: a == b, ) if err: return fail(err) finally: os.close(mfd) os.close(nfd) return 0 finally: cleanup_dir(merge_base) except RuntimeError as exc: print(str(exc), end="") return 77 if __name__ == "__main__": raise SystemExit(main()) mergerfs-2.42.0/tests/TEST_posix_link_symlink0000755000000000000000000000524515177346257020012 0ustar rootroot#!/usr/bin/env python3 import os import sys import tempfile from posix_parity import cleanup_dir from posix_parity import cleanup_paths from posix_parity import compare_calls from posix_parity import fail from posix_parity import join from posix_parity import mergerfs_mount from posix_parity import temp_dir from posix_parity import touch def main(): try: with mergerfs_mount() as (mount, _): with tempfile.TemporaryDirectory() as native: merge_base = temp_dir(mount) try: native_base = join(native, os.path.basename(merge_base)) os.makedirs(native_base, exist_ok=True) merge_src = join(merge_base, "src") native_src = join(native_base, "src") merge_dst = join(merge_base, "dst") native_dst = join(native_base, "dst") merge_slnk = join(merge_base, "symlink") native_slnk = join(native_base, "symlink") merge_missing = join(merge_base, "missing") native_missing = join(native_base, "missing") cleanup_paths([merge_src, merge_dst, merge_slnk]) touch(merge_src, b"src", 0o644) touch(native_src, b"src", 0o644) err = compare_calls("link success", lambda: os.link(merge_src, merge_dst), lambda: os.link(native_src, native_dst)) if err: return fail(err) err = compare_calls( "link ENOENT source", lambda: os.link(merge_missing, join(merge_base, "dst2")), lambda: os.link(native_missing, join(native_base, "dst2")), ) if err: return fail(err) err = compare_calls( "symlink success", lambda: os.symlink("src", merge_slnk), lambda: os.symlink("src", native_slnk), ) if err: return fail(err) err = compare_calls( "symlink EEXIST", lambda: os.symlink("src", merge_slnk), lambda: os.symlink("src", native_slnk), ) if err: return fail(err) return 0 finally: cleanup_dir(merge_base) except RuntimeError as exc: print(str(exc), end="") return 77 if __name__ == "__main__": raise SystemExit(main()) mergerfs-2.42.0/tests/TEST_posix_locking0000755000000000000000000001243215177346257016731 0ustar rootroot#!/usr/bin/env python3 import fcntl import errno import os import struct import subprocess import sys import tempfile from posix_parity import cleanup_dir from posix_parity import compare_calls from posix_parity import fail from posix_parity import join from posix_parity import mergerfs_mount from posix_parity import temp_dir from posix_parity import touch def pack_flock(l_type, l_whence=0, l_start=0, l_len=0, l_pid=0): return struct.pack("hhqqi", l_type, l_whence, l_start, l_len, l_pid) def try_process_lock(path): fd = os.open(path, os.O_RDWR) try: try: fcntl.fcntl(fd, fcntl.F_SETLK, pack_flock(fcntl.F_WRLCK)) return 0 except OSError as exc: return exc.errno finally: os.close(fd) def child_lock_errno(path): proc = subprocess.run( [sys.executable, __file__, "--try-process-lock", path], stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, check=False, ) if proc.returncode != 0: raise RuntimeError(proc.stderr.strip() or f"child lock helper failed: {proc.returncode}") return int(proc.stdout.strip()) def main(): if len(sys.argv) == 3 and sys.argv[1] == "--try-process-lock": print(try_process_lock(sys.argv[2])) return 0 try: with mergerfs_mount() as (mount, _): with tempfile.TemporaryDirectory() as native: merge_base = temp_dir(mount) try: native_base = join(native, os.path.basename(merge_base)) os.makedirs(native_base, exist_ok=True) merge_file = join(merge_base, "file") native_file = join(native_base, "file") touch(merge_file, b"x") touch(native_file, b"x") mfd1 = os.open(merge_file, os.O_RDWR) mfd2 = os.open(merge_file, os.O_RDWR) nfd1 = os.open(native_file, os.O_RDWR) nfd2 = os.open(native_file, os.O_RDWR) try: err = compare_calls( "flock EX nonblock", lambda: fcntl.flock(mfd1, fcntl.LOCK_EX | fcntl.LOCK_NB), lambda: fcntl.flock(nfd1, fcntl.LOCK_EX | fcntl.LOCK_NB), ) if err: return fail(err) err = compare_calls( "flock SH nonblock second fd", lambda: fcntl.flock(mfd2, fcntl.LOCK_SH | fcntl.LOCK_NB), lambda: fcntl.flock(nfd2, fcntl.LOCK_SH | fcntl.LOCK_NB), ) if err: return fail(err) err = compare_calls("flock unlock", lambda: fcntl.flock(mfd1, fcntl.LOCK_UN), lambda: fcntl.flock(nfd1, fcntl.LOCK_UN)) if err: return fail(err) err = compare_calls("flock unlock second fd", lambda: fcntl.flock(mfd2, fcntl.LOCK_UN), lambda: fcntl.flock(nfd2, fcntl.LOCK_UN)) if err: return fail(err) wrlk = pack_flock(fcntl.F_WRLCK) unlck = pack_flock(fcntl.F_UNLCK) err = compare_calls("fcntl F_SETLK write lock", lambda: fcntl.fcntl(mfd1, fcntl.F_SETLK, wrlk), lambda: fcntl.fcntl(nfd1, fcntl.F_SETLK, wrlk)) if err: return fail(err) m_lock_errno = child_lock_errno(merge_file) n_lock_errno = child_lock_errno(native_file) if m_lock_errno != n_lock_errno: return fail(f"fcntl F_SETLK child contention errno mismatch mergerfs={m_lock_errno} native={n_lock_errno}") if m_lock_errno not in (errno.EACCES, errno.EAGAIN): return fail(f"fcntl F_SETLK child contention expected lock conflict got errno={m_lock_errno}") err = compare_calls("fcntl F_SETLK unlock", lambda: fcntl.fcntl(mfd1, fcntl.F_SETLK, unlck), lambda: fcntl.fcntl(nfd1, fcntl.F_SETLK, unlck)) if err: return fail(err) bad_m = os.open(merge_file, os.O_RDONLY) bad_n = os.open(native_file, os.O_RDONLY) os.close(bad_m) os.close(bad_n) err = compare_calls( "fcntl EBADF", lambda: fcntl.fcntl(bad_m, fcntl.F_GETFD), lambda: fcntl.fcntl(bad_n, fcntl.F_GETFD), ) if err: return fail(err) finally: os.close(mfd1) os.close(mfd2) os.close(nfd1) os.close(nfd2) return 0 finally: cleanup_dir(merge_base) except RuntimeError as exc: print(str(exc), end="") return 77 if __name__ == "__main__": raise SystemExit(main()) mergerfs-2.42.0/tests/TEST_posix_mkdir_rmdir0000755000000000000000000000545715177346257017617 0ustar rootroot#!/usr/bin/env python3 import os import sys import tempfile from posix_parity import cleanup_dir from posix_parity import cleanup_paths from posix_parity import compare_calls from posix_parity import fail from posix_parity import join from posix_parity import mergerfs_mount from posix_parity import temp_dir from posix_parity import touch def main(): try: with mergerfs_mount() as (mount, _): with tempfile.TemporaryDirectory() as native: merge_base = temp_dir(mount) try: native_base = join(native, os.path.basename(merge_base)) os.makedirs(native_base, exist_ok=True) merge_dir = join(merge_base, "dir") native_dir = join(native_base, "dir") merge_notdir = join(merge_base, "notdir") native_notdir = join(native_base, "notdir") cleanup_paths([merge_dir, merge_notdir]) err = compare_calls("mkdir success", lambda: os.mkdir(merge_dir, 0o755), lambda: os.mkdir(native_dir, 0o755)) if err: return fail(err) err = compare_calls("mkdir EEXIST", lambda: os.mkdir(merge_dir, 0o755), lambda: os.mkdir(native_dir, 0o755)) if err: return fail(err) touch(merge_notdir, b"x") touch(native_notdir, b"x") err = compare_calls( "mkdir ENOTDIR", lambda: os.mkdir(join(merge_notdir, "child"), 0o755), lambda: os.mkdir(join(native_notdir, "child"), 0o755), ) if err: return fail(err) err = compare_calls("rmdir success", lambda: os.rmdir(merge_dir), lambda: os.rmdir(native_dir)) if err: return fail(err) err = compare_calls("rmdir ENOENT", lambda: os.rmdir(merge_dir), lambda: os.rmdir(native_dir)) if err: return fail(err) touch(join(merge_base, "nonempty/file"), b"x") touch(join(native_base, "nonempty/file"), b"x") err = compare_calls( "rmdir ENOTEMPTY", lambda: os.rmdir(join(merge_base, "nonempty")), lambda: os.rmdir(join(native_base, "nonempty")), ) if err: return fail(err) return 0 finally: cleanup_dir(merge_base) except RuntimeError as exc: print(str(exc), end="") return 77 if __name__ == "__main__": raise SystemExit(main()) mergerfs-2.42.0/tests/TEST_posix_open_read_write0000755000000000000000000000665615177346257020464 0ustar rootroot#!/usr/bin/env python3 import os import sys import tempfile from posix_parity import cleanup_dir from posix_parity import cleanup_paths from posix_parity import compare_calls from posix_parity import fail from posix_parity import join from posix_parity import mergerfs_mount from posix_parity import temp_dir from posix_parity import touch def main(): try: with mergerfs_mount() as (mount, _): with tempfile.TemporaryDirectory() as native: merge_base = temp_dir(mount) try: native_base = join(native, os.path.basename(merge_base)) os.makedirs(native_base, exist_ok=True) merge_file = join(merge_base, "file") native_file = join(native_base, "file") merge_missing = join(merge_base, "missing") native_missing = join(native_base, "missing") merge_dir = join(merge_base, "dir") native_dir = join(native_base, "dir") merge_notdir = join(merge_base, "notdir") native_notdir = join(native_base, "notdir") cleanup_paths([merge_file, merge_notdir]) touch(merge_file, b"123456", 0o644) touch(native_file, b"123456", 0o644) os.makedirs(merge_dir, exist_ok=True) os.makedirs(native_dir, exist_ok=True) touch(merge_notdir, b"x", 0o644) touch(native_notdir, b"x", 0o644) err = compare_calls("open ENOENT", lambda: os.open(merge_missing, os.O_RDONLY), lambda: os.open(native_missing, os.O_RDONLY)) if err: return fail(err) err = compare_calls("open EISDIR", lambda: os.open(merge_dir, os.O_WRONLY), lambda: os.open(native_dir, os.O_WRONLY)) if err: return fail(err) err = compare_calls( "open ENOTDIR", lambda: os.open(join(merge_notdir, "child"), os.O_RDONLY), lambda: os.open(join(native_notdir, "child"), os.O_RDONLY), ) if err: return fail(err) mfd = os.open(merge_file, os.O_RDWR) nfd = os.open(native_file, os.O_RDWR) try: os.lseek(mfd, 0, os.SEEK_SET) os.lseek(nfd, 0, os.SEEK_SET) m_data = os.read(mfd, 6) n_data = os.read(nfd, 6) if m_data != n_data: return fail(f"read parity mismatch mergerfs={m_data!r} native={n_data!r}") os.lseek(mfd, 0, os.SEEK_SET) os.lseek(nfd, 0, os.SEEK_SET) mw = os.write(mfd, b"abc") nw = os.write(nfd, b"abc") if mw != nw: return fail(f"write count mismatch mergerfs={mw} native={nw}") finally: os.close(mfd) os.close(nfd) return 0 finally: cleanup_dir(merge_base) except RuntimeError as exc: print(str(exc), end="") return 77 if __name__ == "__main__": raise SystemExit(main()) mergerfs-2.42.0/tests/TEST_posix_poll0000755000000000000000000000402215177346257016245 0ustar rootroot#!/usr/bin/env python3 import os import select import sys import tempfile from posix_parity import cleanup_dir from posix_parity import fail from posix_parity import join from posix_parity import mergerfs_mount from posix_parity import temp_dir from posix_parity import touch def poll_mask(fd, timeout_ms=25): p = select.poll() p.register(fd, select.POLLIN | select.POLLOUT | select.POLLERR | select.POLLHUP) events = p.poll(timeout_ms) mask = 0 for _fd, ev in events: mask |= ev return mask def main(): try: with mergerfs_mount() as (mount, _): with tempfile.TemporaryDirectory() as native: merge_base = temp_dir(mount) try: native_base = join(native, os.path.basename(merge_base)) os.makedirs(native_base, exist_ok=True) merge_file = join(merge_base, "file") native_file = join(native_base, "file") touch(merge_file, b"abcdef") touch(native_file, b"abcdef") mfd = os.open(merge_file, os.O_RDONLY) nfd = os.open(native_file, os.O_RDONLY) try: mmask = poll_mask(mfd) nmask = poll_mask(nfd) if bool(mmask & select.POLLIN) != bool(nmask & select.POLLIN): return fail(f"poll POLLIN mismatch mergerfs_mask=0x{mmask:x} native_mask=0x{nmask:x}") if bool(mmask & select.POLLOUT) != bool(nmask & select.POLLOUT): return fail(f"poll POLLOUT mismatch mergerfs_mask=0x{mmask:x} native_mask=0x{nmask:x}") finally: os.close(mfd) os.close(nfd) return 0 finally: cleanup_dir(merge_base) except RuntimeError as exc: print(str(exc), end="") return 77 if __name__ == "__main__": raise SystemExit(main()) mergerfs-2.42.0/tests/TEST_posix_readdir0000755000000000000000000001313215177346257016713 0ustar rootroot#!/usr/bin/env python3 import ctypes import os import sys import tempfile from posix_parity import cleanup_dir from posix_parity import compare_calls from posix_parity import fail from posix_parity import join from posix_parity import mergerfs_mount from posix_parity import temp_dir from posix_parity import touch class Dirent(ctypes.Structure): _fields_ = [ ("d_ino", ctypes.c_ulong), ("d_off", ctypes.c_long), ("d_reclen", ctypes.c_ushort), ("d_type", ctypes.c_ubyte), ("d_name", ctypes.c_char * 256), ] libc = ctypes.CDLL(None, use_errno=True) libc.opendir.argtypes = [ctypes.c_char_p] libc.opendir.restype = ctypes.c_void_p libc.readdir.argtypes = [ctypes.c_void_p] libc.readdir.restype = ctypes.POINTER(Dirent) libc.telldir.argtypes = [ctypes.c_void_p] libc.telldir.restype = ctypes.c_long libc.seekdir.argtypes = [ctypes.c_void_p, ctypes.c_long] libc.seekdir.restype = None libc.rewinddir.argtypes = [ctypes.c_void_p] libc.rewinddir.restype = None libc.closedir.argtypes = [ctypes.c_void_p] libc.closedir.restype = ctypes.c_int def opendir_or_raise(path): ctypes.set_errno(0) dp = libc.opendir(path.encode()) if not dp: err = ctypes.get_errno() raise OSError(err, os.strerror(err), path) return dp def decode_name(ent): return bytes(ent.d_name).split(b"\0", 1)[0].decode("utf-8", errors="surrogateescape") def read_all_names(dp): names = [] while True: entp = libc.readdir(dp) if not entp: break names.append(decode_name(entp.contents)) return names def next_non_dot(dp): while True: entp = libc.readdir(dp) if not entp: return None name = decode_name(entp.contents) if name not in (".", ".."): return name def names_set(path): dp = opendir_or_raise(path) try: return set(n for n in read_all_names(dp) if n not in (".", "..")) finally: libc.closedir(dp) def seek_tell_consistent(path): dp = opendir_or_raise(path) try: _first = next_non_dot(dp) if _first is None: return True pos = libc.telldir(dp) second = next_non_dot(dp) if second is None: return True libc.seekdir(dp, pos) again = next_non_dot(dp) return second == again finally: libc.closedir(dp) def deleted_visibility_signature(dirpath, victim_path): dp = opendir_or_raise(dirpath) try: before = set(n for n in read_all_names(dp) if n not in (".", "..")) os.unlink(victim_path) libc.rewinddir(dp) after = set(n for n in read_all_names(dp) if n not in (".", "..")) return ("victim" in before, "victim" in after) finally: libc.closedir(dp) def main(): try: with mergerfs_mount() as (mount, _): with tempfile.TemporaryDirectory() as native: merge_base = temp_dir(mount) try: native_base = join(native, os.path.basename(merge_base)) os.makedirs(native_base, exist_ok=True) merge_dir = join(merge_base, "dir") native_dir = join(native_base, "dir") merge_notdir = join(merge_base, "notdir") native_notdir = join(native_base, "notdir") for idx in range(8): touch(join(merge_dir, f"f{idx}"), b"x") touch(join(native_dir, f"f{idx}"), b"x") touch(merge_notdir, b"x") touch(native_notdir, b"x") err = compare_calls( "opendir ENOENT", lambda: opendir_or_raise(join(merge_base, "missing")), lambda: opendir_or_raise(join(native_base, "missing")), ) if err: return fail(err) err = compare_calls( "opendir ENOTDIR", lambda: opendir_or_raise(join(merge_notdir, "child")), lambda: opendir_or_raise(join(native_notdir, "child")), ) if err: return fail(err) merge_names = names_set(merge_dir) native_names = names_set(native_dir) if merge_names != native_names: return fail(f"readdir names mismatch mergerfs={sorted(merge_names)} native={sorted(native_names)}") merge_consistent = seek_tell_consistent(merge_dir) native_consistent = seek_tell_consistent(native_dir) if merge_consistent != native_consistent: return fail( f"seekdir/telldir consistency mismatch mergerfs={merge_consistent} native={native_consistent}" ) touch(join(merge_dir, "victim"), b"x") touch(join(native_dir, "victim"), b"x") merge_sig = deleted_visibility_signature(merge_dir, join(merge_dir, "victim")) native_sig = deleted_visibility_signature(native_dir, join(native_dir, "victim")) if merge_sig != native_sig: return fail(f"deleted-entry visibility mismatch mergerfs={merge_sig} native={native_sig}") return 0 finally: cleanup_dir(merge_base) except RuntimeError as exc: print(str(exc), end="") return 77 if __name__ == "__main__": raise SystemExit(main()) mergerfs-2.42.0/tests/TEST_posix_readdir_plus0000755000000000000000000000513015177346257017755 0ustar rootroot#!/usr/bin/env python3 import os import sys import tempfile from posix_parity import cleanup_dir from posix_parity import fail from posix_parity import join from posix_parity import mergerfs_get_option from posix_parity import mergerfs_mount from posix_parity import mergerfs_set_option from posix_parity import temp_dir from posix_parity import touch def list_and_stat(dirpath): out = {} for name in os.listdir(dirpath): if name in (".", ".."): continue st = os.lstat(os.path.join(dirpath, name)) out[name] = (st.st_mode & 0xF000, st.st_size) return out def main(): try: with mergerfs_mount() as (mount, _): with tempfile.TemporaryDirectory() as native: merge_base = temp_dir(mount) try: native_base = join(native, os.path.basename(merge_base)) os.makedirs(native_base, exist_ok=True) merge_dir = join(merge_base, "dir") native_dir = join(native_base, "dir") for i in range(40): touch(join(merge_dir, f"f{i:03d}"), bytes(str(i), "ascii")) touch(join(native_dir, f"f{i:03d}"), bytes(str(i), "ascii")) m_map = list_and_stat(merge_dir) n_map = list_and_stat(native_dir) if m_map != n_map: return fail("readdir+getattr map mismatch between mergerfs and native") try: orig = mergerfs_get_option(mount, "func.readdir") except (PermissionError, FileNotFoundError, OSError): return 0 try: for mode in ("seq", "cosr:2:2", "cor:2:2"): mergerfs_set_option(mount, "func.readdir", mode) got = list_and_stat(merge_dir) if got != m_map: return fail(f"func.readdir={mode} changed readdir+getattr semantic output") except (PermissionError, FileNotFoundError, OSError): return 0 finally: try: mergerfs_set_option(mount, "func.readdir", orig) except OSError: pass return 0 finally: cleanup_dir(merge_base) except RuntimeError as exc: print(str(exc), end="") return 77 if __name__ == "__main__": raise SystemExit(main()) mergerfs-2.42.0/tests/TEST_posix_release0000755000000000000000000000571715177346257016733 0ustar rootroot#!/usr/bin/env python3 import os import sys import tempfile from posix_parity import cleanup_dir from posix_parity import fail from posix_parity import join from posix_parity import mergerfs_mount from posix_parity import temp_dir from posix_parity import touch def main(): try: with mergerfs_mount() as (mount, _): with tempfile.TemporaryDirectory() as native: merge_base = temp_dir(mount) try: native_base = join(native, os.path.basename(merge_base)) os.makedirs(native_base, exist_ok=True) merge_file = join(merge_base, "file") native_file = join(native_base, "file") touch(merge_file, b"abc") touch(native_file, b"abc") mfd1 = os.open(merge_file, os.O_RDWR) nfd1 = os.open(native_file, os.O_RDWR) mfd2 = os.dup(mfd1) nfd2 = os.dup(nfd1) try: os.close(mfd1) os.close(nfd1) mw = os.write(mfd2, b"X") nw = os.write(nfd2, b"X") if mw != nw: return fail(f"release dup write mismatch mergerfs={mw} native={nw}") os.lseek(mfd2, 0, os.SEEK_SET) os.lseek(nfd2, 0, os.SEEK_SET) mr = os.read(mfd2, 4) nr = os.read(nfd2, 4) if mr != nr: return fail(f"release dup read mismatch mergerfs={mr!r} native={nr!r}") finally: os.close(mfd2) os.close(nfd2) with open(merge_file, "rb") as mf, open(native_file, "rb") as nf: md = mf.read() nd = nf.read() if md != nd: return fail(f"release final data mismatch mergerfs={md!r} native={nd!r}") mfd = os.open(merge_file, os.O_RDONLY) nfd = os.open(native_file, os.O_RDONLY) os.close(mfd) os.close(nfd) try: os.close(mfd) m_err = 0 except OSError as exc: m_err = exc.errno try: os.close(nfd) n_err = 0 except OSError as exc: n_err = exc.errno if m_err != n_err: return fail(f"release EBADF mismatch mergerfs_errno={m_err} native_errno={n_err}") return 0 finally: cleanup_dir(merge_base) except RuntimeError as exc: print(str(exc), end="") return 77 if __name__ == "__main__": raise SystemExit(main()) mergerfs-2.42.0/tests/TEST_posix_releasedir0000755000000000000000000000425515177346257017426 0ustar rootroot#!/usr/bin/env python3 import ctypes import os import sys import tempfile from posix_parity import cleanup_dir from posix_parity import fail from posix_parity import join from posix_parity import mergerfs_mount from posix_parity import temp_dir from posix_parity import touch libc = ctypes.CDLL(None, use_errno=True) libc.opendir.argtypes = [ctypes.c_char_p] libc.opendir.restype = ctypes.c_void_p libc.dirfd.argtypes = [ctypes.c_void_p] libc.dirfd.restype = ctypes.c_int libc.closedir.argtypes = [ctypes.c_void_p] libc.closedir.restype = ctypes.c_int def opendir(path): ctypes.set_errno(0) dp = libc.opendir(path.encode()) if not dp: err = ctypes.get_errno() raise OSError(err, os.strerror(err), path) return dp def close_and_dirfd_errno(path): dp = opendir(path) fd = libc.dirfd(dp) if fd < 0: libc.closedir(dp) raise OSError(ctypes.get_errno(), "dirfd failed", path) rv = libc.closedir(dp) if rv != 0: raise OSError(ctypes.get_errno(), "closedir failed", path) try: os.fstat(fd) return 0 except OSError as exc: return exc.errno def main(): try: with mergerfs_mount() as (mount, _): with tempfile.TemporaryDirectory() as native: merge_base = temp_dir(mount) try: native_base = join(native, os.path.basename(merge_base)) os.makedirs(native_base, exist_ok=True) merge_dir = join(merge_base, "dir") native_dir = join(native_base, "dir") touch(join(merge_dir, "a"), b"x") touch(join(native_dir, "a"), b"x") m_err = close_and_dirfd_errno(merge_dir) n_err = close_and_dirfd_errno(native_dir) if m_err != n_err: return fail(f"releasedir EBADF parity mismatch mergerfs_errno={m_err} native_errno={n_err}") return 0 finally: cleanup_dir(merge_base) except RuntimeError as exc: print(str(exc), end="") return 77 if __name__ == "__main__": raise SystemExit(main()) mergerfs-2.42.0/tests/TEST_posix_statfs0000755000000000000000000000325315177346257016610 0ustar rootroot#!/usr/bin/env python3 import os import sys import tempfile from posix_parity import cleanup_dir from posix_parity import compare_calls from posix_parity import fail from posix_parity import join from posix_parity import mergerfs_mount from posix_parity import temp_dir def statvfs_cmp(lhs, rhs): return ( lhs.f_namemax == rhs.f_namemax and lhs.f_bsize == rhs.f_bsize and lhs.f_frsize == rhs.f_frsize and lhs.f_bsize > 0 and lhs.f_frsize > 0 ) def main(): try: with mergerfs_mount() as (mount, _): with tempfile.TemporaryDirectory() as native: merge_base = temp_dir(mount) try: native_base = join(native, os.path.basename(merge_base)) os.makedirs(native_base, exist_ok=True) err = compare_calls( "statvfs mount parity", lambda: os.statvfs(mount), lambda: os.statvfs(native), statvfs_cmp, ) if err: return fail(err) err = compare_calls( "statvfs ENOENT", lambda: os.statvfs(join(merge_base, "missing")), lambda: os.statvfs(join(native_base, "missing")), ) if err: return fail(err) return 0 finally: cleanup_dir(merge_base) except RuntimeError as exc: print(str(exc), end="") return 77 if __name__ == "__main__": raise SystemExit(main()) mergerfs-2.42.0/tests/TEST_posix_statx0000755000000000000000000002002315177346257016441 0ustar rootroot#!/usr/bin/env python3 import ctypes import errno import os import sys from posix_parity import cleanup_dir from posix_parity import fail from posix_parity import join from posix_parity import mergerfs_fullpath from posix_parity import mergerfs_mount from posix_parity import should_compare_inode from posix_parity import temp_dir from posix_parity import touch AT_FDCWD = -100 AT_SYMLINK_NOFOLLOW = 0x100 STATX_TYPE = 0x0001 STATX_MODE = 0x0002 STATX_NLINK = 0x0004 STATX_UID = 0x0008 STATX_GID = 0x0010 STATX_SIZE = 0x0200 STATX_BASIC_STATS = STATX_TYPE | STATX_MODE | STATX_NLINK | STATX_UID | STATX_GID | STATX_SIZE class StatxTimestamp(ctypes.Structure): _fields_ = [ ("tv_sec", ctypes.c_longlong), ("tv_nsec", ctypes.c_uint), ("__reserved", ctypes.c_int), ] class Statx(ctypes.Structure): _fields_ = [ ("stx_mask", ctypes.c_uint), ("stx_blksize", ctypes.c_uint), ("stx_attributes", ctypes.c_ulonglong), ("stx_nlink", ctypes.c_uint), ("stx_uid", ctypes.c_uint), ("stx_gid", ctypes.c_uint), ("stx_mode", ctypes.c_ushort), ("__spare0", ctypes.c_ushort), ("stx_ino", ctypes.c_ulonglong), ("stx_size", ctypes.c_ulonglong), ("stx_blocks", ctypes.c_ulonglong), ("stx_attributes_mask", ctypes.c_ulonglong), ("stx_atime", StatxTimestamp), ("stx_btime", StatxTimestamp), ("stx_ctime", StatxTimestamp), ("stx_mtime", StatxTimestamp), ("stx_rdev_major", ctypes.c_uint), ("stx_rdev_minor", ctypes.c_uint), ("stx_dev_major", ctypes.c_uint), ("stx_dev_minor", ctypes.c_uint), ("stx_mnt_id", ctypes.c_ulonglong), ("stx_dio_mem_align", ctypes.c_uint), ("stx_dio_offset_align", ctypes.c_uint), ("stx_subvol", ctypes.c_ulonglong), ("stx_atomic_write_unit_min", ctypes.c_uint), ("stx_atomic_write_unit_max", ctypes.c_uint), ("stx_atomic_write_segments_max", ctypes.c_uint), ("stx_dio_read_offset_align", ctypes.c_uint), ("__spare3", ctypes.c_ulonglong * 9), ] libc = ctypes.CDLL(None, use_errno=True) if not hasattr(libc, "statx"): raise SystemExit(0) libc.statx.argtypes = [ctypes.c_int, ctypes.c_char_p, ctypes.c_int, ctypes.c_uint, ctypes.POINTER(Statx)] libc.statx.restype = ctypes.c_int def statx_call(path, flags=0, mask=STATX_BASIC_STATS): st = Statx() ctypes.set_errno(0) rv = libc.statx(AT_FDCWD, path.encode(), flags, mask, ctypes.byref(st)) err = ctypes.get_errno() if rv < 0: raise OSError(err, os.strerror(err), path) return st def errno_name(err): if err is None: return "None" return errno.errorcode.get(err, str(err)) def statx_summary(st): return ( "{" f"mask=0x{st.stx_mask:x}," f"mode={st.stx_mode:o}," f"type=0x{(st.stx_mode & 0xF000):x}," f"perm=0o{(st.stx_mode & 0x0FFF):o}," f"nlink={st.stx_nlink}," f"uid={st.stx_uid}," f"gid={st.stx_gid}," f"size={st.stx_size}," f"ino={st.stx_ino}," f"blocks={st.stx_blocks}," f"blksize={st.stx_blksize}" "}" ) def call_pair(name, merge_call, native_call): try: m_val = merge_call() m_err = None except OSError as exc: m_val = None m_err = exc.errno try: n_val = native_call() n_err = None except OSError as exc: n_val = None n_err = exc.errno if m_err != n_err: return None, None, ( f"{name}: errno mismatch\n" f" mergerfs errno: {m_err} ({errno_name(m_err)})\n" f" native errno: {n_err} ({errno_name(n_err)})" ) if m_err is not None: return None, None, None return m_val, n_val, None def cmp_statx_basic(a, b): return ( (a.stx_mode & 0xF000) == (b.stx_mode & 0xF000) and (a.stx_mode & 0x0FFF) == (b.stx_mode & 0x0FFF) and a.stx_nlink == b.stx_nlink and a.stx_uid == b.stx_uid and a.stx_gid == b.stx_gid and a.stx_size == b.stx_size ) def cmp_statx_basic_with_inode(a, b): return cmp_statx_basic(a, b) and a.stx_ino == b.stx_ino def expect_same_errno(name, mcall, ncall): m_err = None n_err = None try: mcall() except OSError as exc: m_err = exc.errno try: ncall() except OSError as exc: n_err = exc.errno if m_err != n_err: return ( f"{name}: errno mismatch\n" f" mergerfs errno: {m_err} ({errno_name(m_err)})\n" f" native errno: {n_err} ({errno_name(n_err)})" ) return None def main(): try: with mergerfs_mount() as (mount, _): stcmp = cmp_statx_basic_with_inode if should_compare_inode(mount) else cmp_statx_basic merge_base = temp_dir(mount) try: merge_file = join(merge_base, "file") merge_link = join(merge_base, "link") touch(merge_file, b"hello") try: native_file = mergerfs_fullpath(merge_file) except OSError: return 0 try: os.unlink(merge_link) except FileNotFoundError: pass os.symlink("file", merge_link) try: native_link = mergerfs_fullpath(merge_link) except OSError: return 0 expected_native_link = os.path.join(os.path.dirname(native_file), "link") if not os.path.islink(native_link): if os.path.islink(expected_native_link): native_link = expected_native_link else: return 0 native_missing = os.path.join(os.path.dirname(native_file), "missing") mst, nst, err = call_pair( "statx regular", lambda: statx_call(merge_file), lambda: statx_call(native_file), ) if err: return fail(err) if not stcmp(mst, nst): return fail( "statx basic mismatch\n" f" mergerfs path: {merge_file}\n" f" native path: {native_file}\n" f" mergerfs statx: {statx_summary(mst)}\n" f" native statx: {statx_summary(nst)}" ) mst, nst, err = call_pair( "statx symlink nofollow", lambda: statx_call(merge_link, flags=AT_SYMLINK_NOFOLLOW), lambda: statx_call(native_link, flags=AT_SYMLINK_NOFOLLOW), ) if err: return fail(err) if (mst.stx_mode & 0xF000) != (nst.stx_mode & 0xF000): return fail( "statx symlink type mismatch\n" f" mergerfs path: {merge_link}\n" f" native path: {native_link}\n" f" mergerfs statx: {statx_summary(mst)}\n" f" native statx: {statx_summary(nst)}" ) err = expect_same_errno( "statx ENOENT", lambda: statx_call(join(merge_base, "missing")), lambda: statx_call(native_missing), ) if err: return fail(err) err = expect_same_errno( "statx ENOTDIR", lambda: statx_call(join(merge_file, "child")), lambda: statx_call(join(native_file, "child")), ) if err: return fail(err) return 0 finally: cleanup_dir(merge_base) except RuntimeError as exc: print(str(exc), end="") return 77 if __name__ == "__main__": raise SystemExit(main()) mergerfs-2.42.0/tests/TEST_posix_syncfs0000755000000000000000000000370715177346257016615 0ustar rootroot#!/usr/bin/env python3 import ctypes import os import sys import tempfile from posix_parity import cleanup_dir from posix_parity import compare_calls from posix_parity import fail from posix_parity import join from posix_parity import mergerfs_mount from posix_parity import temp_dir from posix_parity import touch libc = ctypes.CDLL(None, use_errno=True) libc.syncfs.argtypes = [ctypes.c_int] libc.syncfs.restype = ctypes.c_int def syncfs_fd(fd): ctypes.set_errno(0) rv = libc.syncfs(fd) if rv == 0: return 0 err = ctypes.get_errno() raise OSError(err, os.strerror(err)) def main(): try: with mergerfs_mount() as (mount, _): with tempfile.TemporaryDirectory() as native: merge_base = temp_dir(mount) try: native_base = join(native, os.path.basename(merge_base)) os.makedirs(native_base, exist_ok=True) merge_file = join(merge_base, "file") native_file = join(native_base, "file") touch(merge_file, b"x") touch(native_file, b"x") mfd = os.open(merge_file, os.O_RDONLY) nfd = os.open(native_file, os.O_RDONLY) try: err = compare_calls("syncfs success", lambda: syncfs_fd(mfd), lambda: syncfs_fd(nfd)) if err: return fail(err) finally: os.close(mfd) os.close(nfd) err = compare_calls("syncfs EBADF", lambda: syncfs_fd(-1), lambda: syncfs_fd(-1)) if err: return fail(err) return 0 finally: cleanup_dir(merge_base) except RuntimeError as exc: print(str(exc), end="") return 77 if __name__ == "__main__": raise SystemExit(main()) mergerfs-2.42.0/tests/TEST_posix_tmpfile0000755000000000000000000000451015177346257016741 0ustar rootroot#!/usr/bin/env python3 import errno import os import sys import tempfile from posix_parity import cleanup_dir from posix_parity import fail from posix_parity import mergerfs_mount from posix_parity import join from posix_parity import temp_dir def open_tmpfile(dirpath): return os.open(dirpath, os.O_TMPFILE | os.O_RDWR, 0o600) def errno_of(call): try: fd = call() os.close(fd) return 0 except OSError as exc: return exc.errno def main(): if not hasattr(os, "O_TMPFILE"): return 0 try: with mergerfs_mount() as (mount, _): with tempfile.TemporaryDirectory() as native: merge_base = temp_dir(mount) try: native_base = join(native, os.path.basename(merge_base)) os.makedirs(native_base, exist_ok=True) merge_dir = merge_base native_dir = native_base m_err = errno_of(lambda: open_tmpfile(merge_dir)) n_err = errno_of(lambda: open_tmpfile(native_dir)) if m_err == errno.EOPNOTSUPP: return 0 if m_err != n_err: return fail(f"O_TMPFILE support mismatch mergerfs_errno={m_err} native_errno={n_err}") if m_err in (errno.EOPNOTSUPP, errno.EISDIR, errno.EINVAL, errno.ENOSYS): return 0 mfd = open_tmpfile(merge_dir) try: nfd = open_tmpfile(native_dir) except OSError: os.close(mfd) return fail("O_TMPFILE: native open failed after merge succeeded") try: mw = os.write(mfd, b"tmpfile-data") nw = os.write(nfd, b"tmpfile-data") if mw != nw: return fail(f"O_TMPFILE write count mismatch mergerfs={mw} native={nw}") finally: os.close(mfd) os.close(nfd) return 0 finally: cleanup_dir(merge_base) except RuntimeError as exc: print(str(exc), end="") return 77 if __name__ == "__main__": raise SystemExit(main()) mergerfs-2.42.0/tests/TEST_posix_truncate_ftruncate0000755000000000000000000000446715177346257021214 0ustar rootroot#!/usr/bin/env python3 import os import sys import tempfile from posix_parity import cleanup_dir from posix_parity import cleanup_paths from posix_parity import compare_calls from posix_parity import fail from posix_parity import join from posix_parity import mergerfs_mount from posix_parity import temp_dir from posix_parity import touch def main(): try: with mergerfs_mount() as (mount, _): with tempfile.TemporaryDirectory() as native: merge_base = temp_dir(mount) try: native_base = join(native, os.path.basename(merge_base)) os.makedirs(native_base, exist_ok=True) merge_file = join(merge_base, "file") native_file = join(native_base, "file") merge_missing = join(merge_base, "missing") native_missing = join(native_base, "missing") cleanup_paths([merge_file]) touch(merge_file, b"1234567890") touch(native_file, b"1234567890") err = compare_calls("truncate shrink", lambda: os.truncate(merge_file, 3), lambda: os.truncate(native_file, 3)) if err: return fail(err) err = compare_calls("truncate ENOENT", lambda: os.truncate(merge_missing, 1), lambda: os.truncate(native_missing, 1)) if err: return fail(err) mfd = os.open(merge_file, os.O_RDWR) nfd = os.open(native_file, os.O_RDWR) try: err = compare_calls("ftruncate grow", lambda: os.ftruncate(mfd, 16), lambda: os.ftruncate(nfd, 16)) if err: return fail(err) finally: os.close(mfd) os.close(nfd) err = compare_calls("ftruncate EBADF", lambda: os.ftruncate(-1, 4), lambda: os.ftruncate(-1, 4)) if err: return fail(err) return 0 finally: cleanup_dir(merge_base) except RuntimeError as exc: print(str(exc), end="") return 77 if __name__ == "__main__": raise SystemExit(main()) mergerfs-2.42.0/tests/TEST_posix_unlink_rename0000755000000000000000000000556415177346257020142 0ustar rootroot#!/usr/bin/env python3 import os import sys import tempfile from posix_parity import cleanup_dir from posix_parity import cleanup_paths from posix_parity import compare_calls from posix_parity import fail from posix_parity import join from posix_parity import mergerfs_mount from posix_parity import temp_dir from posix_parity import touch def main(): try: with mergerfs_mount() as (mount, _): with tempfile.TemporaryDirectory() as native: merge_base = temp_dir(mount) try: native_base = join(native, os.path.basename(merge_base)) os.makedirs(native_base, exist_ok=True) merge_a = join(merge_base, "a") native_a = join(native_base, "a") merge_b = join(merge_base, "b") native_b = join(native_base, "b") merge_missing = join(merge_base, "missing") native_missing = join(native_base, "missing") merge_notdir = join(merge_base, "notdir") native_notdir = join(native_base, "notdir") cleanup_paths([merge_a, merge_b, merge_notdir]) touch(merge_a, b"a") touch(native_a, b"a") err = compare_calls("unlink success", lambda: os.unlink(merge_a), lambda: os.unlink(native_a)) if err: return fail(err) err = compare_calls("unlink ENOENT", lambda: os.unlink(merge_missing), lambda: os.unlink(native_missing)) if err: return fail(err) touch(merge_a, b"a") touch(native_a, b"a") touch(merge_b, b"b") touch(native_b, b"b") err = compare_calls("rename overwrite", lambda: os.rename(merge_a, merge_b), lambda: os.rename(native_a, native_b)) if err: return fail(err) err = compare_calls("rename ENOENT", lambda: os.rename(merge_missing, merge_a), lambda: os.rename(native_missing, native_a)) if err: return fail(err) touch(merge_notdir, b"x") touch(native_notdir, b"x") err = compare_calls( "rename ENOTDIR", lambda: os.rename(join(merge_notdir, "child"), merge_a), lambda: os.rename(join(native_notdir, "child"), native_a), ) if err: return fail(err) return 0 finally: cleanup_dir(merge_base) except RuntimeError as exc: print(str(exc), end="") return 77 if __name__ == "__main__": raise SystemExit(main()) mergerfs-2.42.0/tests/TEST_posix_utimens0000755000000000000000000000551015177346257016766 0ustar rootroot#!/usr/bin/env python3 import os import sys import tempfile import time from posix_parity import cleanup_dir from posix_parity import cleanup_paths from posix_parity import compare_calls from posix_parity import fail from posix_parity import join from posix_parity import mergerfs_mount from posix_parity import temp_dir from posix_parity import touch def main(): try: with mergerfs_mount() as (mount, _): with tempfile.TemporaryDirectory() as native: merge_base = temp_dir(mount) try: native_base = join(native, os.path.basename(merge_base)) os.makedirs(native_base, exist_ok=True) merge_file = join(merge_base, "file") native_file = join(native_base, "file") merge_missing = join(merge_base, "missing") native_missing = join(native_base, "missing") cleanup_paths([merge_file]) touch(merge_file, b"x") touch(native_file, b"x") now = time.time() times = (now - 1000, now - 500) err = compare_calls( "utime path success", lambda: os.utime(merge_file, times=times), lambda: os.utime(native_file, times=times), ) if err: return fail(err) mfd = os.open(merge_file, os.O_RDWR) nfd = os.open(native_file, os.O_RDWR) try: err = compare_calls( "utime fd success", lambda: os.utime(mfd, times=times), lambda: os.utime(nfd, times=times), ) if err: return fail(err) finally: os.close(mfd) os.close(nfd) err = compare_calls( "utime ENOENT", lambda: os.utime(merge_missing, times=times), lambda: os.utime(native_missing, times=times), ) if err: return fail(err) err = compare_calls( "utime EBADF", lambda: os.utime(-1, times=times), lambda: os.utime(-1, times=times), ) if err: return fail(err) return 0 finally: cleanup_dir(merge_base) except RuntimeError as exc: print(str(exc), end="") return 77 if __name__ == "__main__": raise SystemExit(main()) mergerfs-2.42.0/tests/TEST_posix_xattr0000755000000000000000000001463715177346257016456 0ustar rootroot#!/usr/bin/env python3 import os import sys import tempfile import errno from posix_parity import cleanup_dir from posix_parity import compare_calls from posix_parity import fail from posix_parity import join from posix_parity import mergerfs_mount from posix_parity import temp_dir from posix_parity import touch def errno_name(err): if err is None: return "None" return errno.errorcode.get(err, str(err)) def format_oserror(prefix, exc): return f"{prefix}: errno={exc.errno}({errno_name(exc.errno)}) msg={exc.strerror}" def has_attr(name): def _cmp(lhs, rhs): return (name in lhs) == (name in rhs) return _cmp def main(): try: with mergerfs_mount() as (mount, _): with tempfile.TemporaryDirectory() as native: merge_base = temp_dir(mount) try: native_base = join(native, os.path.basename(merge_base)) os.makedirs(native_base, exist_ok=True) merge_file = join(merge_base, "file") native_file = join(native_base, "file") merge_missing = join(merge_base, "missing") native_missing = join(native_base, "missing") merge_notdir = join(merge_base, "notdir") native_notdir = join(native_base, "notdir") touch(merge_file, b"x") touch(native_file, b"x") touch(merge_notdir, b"x") touch(native_notdir, b"x") xname = "user.posix_parity" xvalue = b"parity-check" err = compare_calls( "setxattr success", lambda: os.setxattr(merge_file, xname, xvalue), lambda: os.setxattr(native_file, xname, xvalue), ) if err: try: os.setxattr(merge_file, xname, xvalue) except OSError as exc: err += " | " + format_oserror("mergerfs setxattr", exc) try: os.setxattr(native_file, xname, xvalue) except OSError as exc: err += " | " + format_oserror("native setxattr", exc) return fail(err) err = compare_calls( "getxattr success", lambda: os.getxattr(merge_file, xname), lambda: os.getxattr(native_file, xname), lambda lhs, rhs: lhs == rhs, ) if err: try: os.getxattr(merge_file, xname) except OSError as exc: err += " | " + format_oserror("mergerfs getxattr", exc) try: os.getxattr(native_file, xname) except OSError as exc: err += " | " + format_oserror("native getxattr", exc) return fail(err) err = compare_calls( "listxattr includes key", lambda: os.listxattr(merge_file), lambda: os.listxattr(native_file), has_attr(xname), ) if err: try: m_list = os.listxattr(merge_file) err += f" | mergerfs list={m_list!r}" except OSError as exc: err += " | " + format_oserror("mergerfs listxattr", exc) try: n_list = os.listxattr(native_file) err += f" | native list={n_list!r}" except OSError as exc: err += " | " + format_oserror("native listxattr", exc) return fail(err) err = compare_calls( "removexattr success", lambda: os.removexattr(merge_file, xname), lambda: os.removexattr(native_file, xname), ) if err: try: os.removexattr(merge_file, xname) except OSError as exc: err += " | " + format_oserror("mergerfs removexattr", exc) try: os.removexattr(native_file, xname) except OSError as exc: err += " | " + format_oserror("native removexattr", exc) return fail(err) err = compare_calls( "getxattr missing attr", lambda: os.getxattr(merge_file, xname), lambda: os.getxattr(native_file, xname), ) if err: try: os.getxattr(merge_file, xname) except OSError as exc: err += " | " + format_oserror("mergerfs getxattr missing", exc) try: os.getxattr(native_file, xname) except OSError as exc: err += " | " + format_oserror("native getxattr missing", exc) return fail(err) err = compare_calls( "setxattr ENOENT", lambda: os.setxattr(merge_missing, xname, xvalue), lambda: os.setxattr(native_missing, xname, xvalue), ) if err: return fail(err) err = compare_calls( "getxattr ENOTDIR", lambda: os.getxattr(join(merge_notdir, "child"), xname), lambda: os.getxattr(join(native_notdir, "child"), xname), ) if err: return fail(err) return 0 finally: cleanup_dir(merge_base) except RuntimeError as exc: print(str(exc), end="") return 77 if __name__ == "__main__": raise SystemExit(main()) mergerfs-2.42.0/tests/TEST_posix_xattr_matrix0000755000000000000000000002070415177346257020032 0ustar rootroot#!/usr/bin/env python3 import errno import os import sys import tempfile from posix_parity import cleanup_dir from posix_parity import fail from posix_parity import join from posix_parity import mergerfs_mount from posix_parity import temp_dir from posix_parity import touch def errno_name(err): if err is None: return "None" return errno.errorcode.get(err, str(err)) def invoke(callable_): try: return True, callable_(), 0 except OSError as exc: return False, None, exc.errno def compare(name, m_call, n_call, value_cmp=None): m_ok, m_val, m_errno = invoke(m_call) n_ok, n_val, n_errno = invoke(n_call) if m_ok != n_ok: return ( f"{name}: success mismatch mergerfs={m_ok} native={n_ok} " f"(mergerfs_errno={m_errno}:{errno_name(m_errno)} native_errno={n_errno}:{errno_name(n_errno)})" ) if m_errno != n_errno: return ( f"{name}: errno mismatch mergerfs={m_errno}:{errno_name(m_errno)} " f"native={n_errno}:{errno_name(n_errno)}" ) if m_ok and value_cmp is not None and not value_cmp(m_val, n_val): return f"{name}: value mismatch mergerfs={m_val!r} native={n_val!r}" return None def getxattr_cmp(path_m, path_n, xname): return compare( f"getxattr {xname} {os.path.basename(path_m)}", lambda: os.getxattr(path_m, xname), lambda: os.getxattr(path_n, xname), lambda a, b: a == b, ) def list_has_cmp(path_m, path_n, xname): return compare( f"listxattr has {xname} {os.path.basename(path_m)}", lambda: os.listxattr(path_m), lambda: os.listxattr(path_n), lambda a, b: ((xname in a) == (xname in b)), ) def lsetxattr(path, name, value): if hasattr(os, "lsetxattr"): return os.lsetxattr(path, name, value) return os.setxattr(path, name, value, follow_symlinks=False) def lgetxattr(path, name): if hasattr(os, "lgetxattr"): return os.lgetxattr(path, name) return os.getxattr(path, name, follow_symlinks=False) def llistxattr(path): if hasattr(os, "llistxattr"): return os.llistxattr(path) return os.listxattr(path, follow_symlinks=False) def lremovexattr(path, name): if hasattr(os, "lremovexattr"): return os.lremovexattr(path, name) return os.removexattr(path, name, follow_symlinks=False) def main(): try: with mergerfs_mount() as (mount, _): with tempfile.TemporaryDirectory() as native: merge_base = temp_dir(mount) try: native_base = join(native, os.path.basename(merge_base)) os.makedirs(native_base, exist_ok=True) root_m = merge_base root_n = native_base file_m = join(root_m, "file") file_n = join(root_n, "file") dir_m = join(root_m, "dir") dir_n = join(root_n, "dir") link_m = join(root_m, "link") link_n = join(root_n, "link") touch(file_m, b"x") touch(file_n, b"x") os.makedirs(dir_m, exist_ok=True) os.makedirs(dir_n, exist_ok=True) try: os.unlink(link_m) except FileNotFoundError: pass try: os.unlink(link_n) except FileNotFoundError: pass os.symlink("file", link_m) os.symlink("file", link_n) objs = [ ("file", file_m, file_n), ("dir", dir_m, dir_n), ] xbase = "user.xattr_matrix" for obj_name, path_m, path_n in objs: xname = f"{xbase}.{obj_name}" err = compare( f"setxattr default {obj_name}", lambda p=path_m, n=xname: os.setxattr(p, n, b"v1"), lambda p=path_n, n=xname: os.setxattr(p, n, b"v1"), ) if err: return fail(err) err = getxattr_cmp(path_m, path_n, xname) if err: return fail(err) err = list_has_cmp(path_m, path_n, xname) if err: return fail(err) if hasattr(os, "XATTR_CREATE"): err = compare( f"setxattr CREATE existing {obj_name}", lambda p=path_m, n=xname: os.setxattr(p, n, b"v2", os.XATTR_CREATE), lambda p=path_n, n=xname: os.setxattr(p, n, b"v2", os.XATTR_CREATE), ) if err: return fail(err) if hasattr(os, "XATTR_REPLACE"): err = compare( f"setxattr REPLACE existing {obj_name}", lambda p=path_m, n=xname: os.setxattr(p, n, b"v3", os.XATTR_REPLACE), lambda p=path_n, n=xname: os.setxattr(p, n, b"v3", os.XATTR_REPLACE), ) if err: return fail(err) err = getxattr_cmp(path_m, path_n, xname) if err: return fail(err) missing_name = f"{xname}.missing" if hasattr(os, "XATTR_REPLACE"): err = compare( f"setxattr REPLACE missing {obj_name}", lambda p=path_m, n=missing_name: os.setxattr(p, n, b"v", os.XATTR_REPLACE), lambda p=path_n, n=missing_name: os.setxattr(p, n, b"v", os.XATTR_REPLACE), ) if err: return fail(err) err = compare( f"removexattr existing {obj_name}", lambda p=path_m, n=xname: os.removexattr(p, n), lambda p=path_n, n=xname: os.removexattr(p, n), ) if err: return fail(err) err = compare( f"removexattr missing {obj_name}", lambda p=path_m, n=xname: os.removexattr(p, n), lambda p=path_n, n=xname: os.removexattr(p, n), ) if err: return fail(err) lxname = f"{xbase}.link" err = compare( "lsetxattr symlink default", lambda: lsetxattr(link_m, lxname, b"lv1"), lambda: lsetxattr(link_n, lxname, b"lv1"), ) if err: return fail(err) err = compare( "lgetxattr symlink", lambda: lgetxattr(link_m, lxname), lambda: lgetxattr(link_n, lxname), lambda a, b: a == b, ) if err: return fail(err) err = compare( "llistxattr has symlink key", lambda: llistxattr(link_m), lambda: llistxattr(link_n), lambda a, b: ((lxname in a) == (lxname in b)), ) if err: return fail(err) err = compare( "lremovexattr symlink", lambda: lremovexattr(link_m, lxname), lambda: lremovexattr(link_n, lxname), ) if err: return fail(err) return 0 finally: cleanup_dir(merge_base) except RuntimeError as exc: print(str(exc), end="") return 77 if __name__ == "__main__": raise SystemExit(main()) mergerfs-2.42.0/tests/TEST_readlink_semantics0000755000000000000000000001775515177346257017735 0ustar rootroot#!/usr/bin/env python3 import ctypes import errno import os import sys import tempfile from posix_parity import cleanup_dir from posix_parity import join from posix_parity import mergerfs_mount from posix_parity import temp_dir libc = ctypes.CDLL(None, use_errno=True) libc.readlink.argtypes = [ctypes.c_char_p, ctypes.c_char_p, ctypes.c_size_t] libc.readlink.restype = ctypes.c_ssize_t def readlink_raw(path, bufsiz): buf = ctypes.create_string_buffer(bufsiz) ctypes.set_errno(0) rv = libc.readlink(path.encode(), buf, bufsiz) err = ctypes.get_errno() return rv, err, bytes(buf) def compare_case(name, merge_path, native_path, bufsiz, expect_errno=None): m_rv, m_errno, m_buf = readlink_raw(merge_path, bufsiz) n_rv, n_errno, n_buf = readlink_raw(native_path, bufsiz) if m_rv != n_rv: return f"{name}: return mismatch mergerfs={m_rv} native={n_rv}" if m_errno != n_errno: return f"{name}: errno mismatch mergerfs={m_errno} native={n_errno}" if m_rv >= 0 and m_buf != n_buf: return f"{name}: buffer mismatch mergerfs={m_buf!r} native={n_buf!r}" if expect_errno is not None and n_errno != expect_errno: return f"{name}: expected errno={expect_errno}, got errno={n_errno}" return None def main(): try: with mergerfs_mount() as (mount, _): target = "target-abcdefghijklmnopqrstuvwxyz" with tempfile.TemporaryDirectory() as native_dir: merge_base = temp_dir(mount) try: native_base = join(native_dir, os.path.basename(merge_base)) os.makedirs(native_base, exist_ok=True) paths = { "merge_link": join(merge_base, "readlink-semantics-link"), "native_link": join(native_base, "readlink-semantics-link"), "merge_regular": join(merge_base, "readlink-semantics-regular"), "native_regular": join(native_base, "readlink-semantics-regular"), "merge_notdir": join(merge_base, "readlink-semantics-notdir"), "native_notdir": join(native_base, "readlink-semantics-notdir"), "merge_loop": join(merge_base, "readlink-semantics-loop"), "native_loop": join(native_base, "readlink-semantics-loop"), "merge_private_dir": join(merge_base, "readlink-semantics-private"), "native_private_dir": join(native_base, "readlink-semantics-private"), } paths["merge_private_link"] = os.path.join(paths["merge_private_dir"], "link") paths["native_private_link"] = os.path.join(paths["native_private_dir"], "link") for p in ( paths["merge_private_link"], paths["merge_link"], paths["merge_regular"], paths["merge_notdir"], paths["merge_loop"], ): try: os.unlink(p) except FileNotFoundError: pass try: os.rmdir(paths["merge_private_dir"]) except FileNotFoundError: pass except OSError: pass os.symlink(target, paths["merge_link"]) os.symlink(target, paths["native_link"]) with open(paths["merge_regular"], "w", encoding="ascii"): pass with open(paths["native_regular"], "w", encoding="ascii"): pass with open(paths["merge_notdir"], "w", encoding="ascii"): pass with open(paths["native_notdir"], "w", encoding="ascii"): pass os.symlink("readlink-semantics-loop", paths["merge_loop"]) os.symlink("readlink-semantics-loop", paths["native_loop"]) os.makedirs(paths["merge_private_dir"], exist_ok=True) os.makedirs(paths["native_private_dir"], exist_ok=True) os.symlink(target, paths["merge_private_link"]) os.symlink(target, paths["native_private_link"]) cases = [] for bufsiz in (0, 1, 2, 5, 8, len(target), len(target) + 1): cases.append(( f"success/truncation bufsiz={bufsiz}", paths["merge_link"], paths["native_link"], bufsiz, errno.EINVAL if bufsiz == 0 else None, )) cases.extend([ ( "EINVAL non-symlink", paths["merge_regular"], paths["native_regular"], 128, errno.EINVAL, ), ( "ENOENT missing path", join(merge_base, "readlink-semantics-missing"), join(native_base, "readlink-semantics-missing"), 128, errno.ENOENT, ), ( "ENOTDIR non-directory prefix", os.path.join(paths["merge_notdir"], "child"), os.path.join(paths["native_notdir"], "child"), 128, errno.ENOTDIR, ), ( "ELOOP prefix symlink loop", os.path.join(paths["merge_loop"], "child"), os.path.join(paths["native_loop"], "child"), 128, errno.ELOOP, ), ( "ENAMETOOLONG long pathname", join(merge_base, "a" * 8192), join(native_base, "a" * 8192), 128, errno.ENAMETOOLONG, ), ]) os.chmod(paths["merge_private_dir"], 0o600) os.chmod(paths["native_private_dir"], 0o600) cases.append(( "EACCES unreadable path prefix", paths["merge_private_link"], paths["native_private_link"], 128, errno.EACCES if os.geteuid() != 0 else None, )) for case in cases: err = compare_case(*case) if err is not None: print(err, end="") return 1 rv, err, _ = readlink_raw(paths["merge_link"], 1) if rv != 1 or err != 0: print(f"bufsiz=1 expected rv=1 errno=0, got rv={rv} errno={err}", end="") return 1 return 0 finally: try: os.chmod(paths["merge_private_dir"], 0o700) except (FileNotFoundError, PermissionError): pass try: os.chmod(paths["native_private_dir"], 0o700) except (FileNotFoundError, PermissionError): pass cleanup_dir(merge_base) except RuntimeError as exc: print(str(exc), end="") return 77 if __name__ == "__main__": raise SystemExit(main()) mergerfs-2.42.0/tests/TEST_rmdir_enotempty_priority0000755000000000000000000000336215177346257021245 0ustar rootroot#!/usr/bin/env python3 import errno import os import sys import tempfile from posix_parity import cleanup_dir from posix_parity import fail from posix_parity import join from posix_parity import mergerfs_branches from posix_parity import mergerfs_get_option from posix_parity import mergerfs_mount from posix_parity import temp_dir from posix_parity import touch def get_errno(func): try: func() return 0 except OSError as exc: return exc.errno def main(): try: with mergerfs_mount(num_branches=2) as (mount, branches): merge_base = temp_dir(mount) try: if len(branches) < 2: return 0 merge_dir = join(merge_base, "nonempty_dir") os.makedirs(merge_dir) child_file = join(merge_dir, "child.txt") branch0 = branches[0] native_child = join(branch0, os.path.relpath(child_file, mount)) touch(child_file, b"prevents rmdir") err = get_errno(lambda: os.rmdir(merge_dir)) if err != errno.ENOTEMPTY: return fail(f"rmdir non-empty dir: expected ENOTEMPTY({errno.ENOTEMPTY}), got {err}") os.unlink(child_file) err = get_errno(lambda: os.rmdir(merge_dir)) if err != 0: return fail(f"rmdir empty dir after removing child: expected success, got errno={err}") return 0 except Exception as exc: return fail(str(exc)) finally: cleanup_dir(merge_base) except RuntimeError as exc: print(str(exc), end="") return 77 if __name__ == "__main__": raise SystemExit(main()) mergerfs-2.42.0/tests/TEST_unlink_rename0000755000000000000000000000252115177346257016706 0ustar rootroot#!/usr/bin/env python3 import tempfile import os import sys from posix_parity import mergerfs_mount def main(): try: with mergerfs_mount() as (mount, _): (srcfd, src) = tempfile.mkstemp(dir=mount) (tgtfd, tgt) = tempfile.mkstemp(dir=mount) st_src_before = os.fstat(srcfd) st_tgt_before = os.fstat(tgtfd) os.unlink(tgt) os.rename(src, tgt) st_src_after = os.fstat(srcfd) st_tgt_after = os.fstat(tgtfd) if st_src_after.st_size != st_src_before.st_size: os.close(srcfd) os.close(tgtfd) print("rename: src fd size changed before={} after={}".format( st_src_before.st_size, st_src_after.st_size), end='') return 1 if st_tgt_after.st_ino != st_tgt_before.st_ino: os.close(srcfd) os.close(tgtfd) print("rename: tgt fd inode changed after unlink+rename expected={} got={}".format( st_tgt_before.st_ino, st_tgt_after.st_ino), end='') return 1 os.close(srcfd) os.close(tgtfd) return 0 except RuntimeError as exc: print(str(exc), end="") return 77 if __name__ == "__main__": raise SystemExit(main()) mergerfs-2.42.0/tests/TEST_use_fallocate_after_unlink0000755000000000000000000000202015177346257021420 0ustar rootroot#!/usr/bin/env python3 import tempfile import os import sys from posix_parity import mergerfs_mount def main(): try: with mergerfs_mount() as (mount, _): (fd, filepath) = tempfile.mkstemp(dir=mount) os.posix_fallocate(fd, 0, 1024) st1 = os.fstat(fd) if st1.st_size < 1024: os.close(fd) os.unlink(filepath) print("fallocate before unlink: expected size >= 1024, got {}".format(st1.st_size), end='') return 1 os.unlink(filepath) os.posix_fallocate(fd, 1024, 2048) st2 = os.fstat(fd) if st2.st_size < 1024 + 2048: os.close(fd) print("fallocate after unlink: expected size >= 3072, got {}".format(st2.st_size), end='') return 1 os.close(fd) return 0 except RuntimeError as exc: print(str(exc), end="") return 77 if __name__ == "__main__": raise SystemExit(main()) mergerfs-2.42.0/tests/TEST_use_fchmod_after_unlink0000755000000000000000000000206615177346257020740 0ustar rootroot#!/usr/bin/env python3 import tempfile import os import stat import sys from posix_parity import mergerfs_mount def main(): try: with mergerfs_mount() as (mount, _): (fd, filepath) = tempfile.mkstemp(dir=mount) os.fchmod(fd, 0o700) st1 = os.fstat(fd) if stat.S_IMODE(st1.st_mode) != 0o700: os.close(fd) os.unlink(filepath) print("fchmod before unlink: expected mode 0o700, got 0o{:o}".format(stat.S_IMODE(st1.st_mode)), end='') return 1 os.unlink(filepath) os.fchmod(fd, 0o755) st2 = os.fstat(fd) if stat.S_IMODE(st2.st_mode) != 0o755: os.close(fd) print("fchmod after unlink: expected mode 0o755, got 0o{:o}".format(stat.S_IMODE(st2.st_mode)), end='') return 1 os.close(fd) return 0 except RuntimeError as exc: print(str(exc), end="") return 77 if __name__ == "__main__": raise SystemExit(main()) mergerfs-2.42.0/tests/TEST_use_fchown_after_unlink0000755000000000000000000000230115177346257020754 0ustar rootroot#!/usr/bin/env python3 import tempfile import os import sys from posix_parity import mergerfs_mount def main(): try: with mergerfs_mount() as (mount, _): (fd, filepath) = tempfile.mkstemp(dir=mount) uid = os.getuid() gid = os.getgid() os.fchown(fd, uid, gid) st1 = os.fstat(fd) if st1.st_uid != uid or st1.st_gid != gid: os.close(fd) os.unlink(filepath) print("fchown before unlink: expected uid={} gid={}, got uid={} gid={}".format( uid, gid, st1.st_uid, st1.st_gid), end='') return 1 os.unlink(filepath) os.fchown(fd, uid, gid) st2 = os.fstat(fd) if st2.st_uid != uid or st2.st_gid != gid: os.close(fd) print("fchown after unlink: expected uid={} gid={}, got uid={} gid={}".format( uid, gid, st2.st_uid, st2.st_gid), end='') return 1 os.close(fd) return 0 except RuntimeError as exc: print(str(exc), end="") return 77 if __name__ == "__main__": raise SystemExit(main()) mergerfs-2.42.0/tests/TEST_use_fstat_after_unlink0000755000000000000000000000265615177346257020626 0ustar rootroot#!/usr/bin/env python3 import tempfile import os import sys from posix_parity import mergerfs_mount def main(): try: with mergerfs_mount() as (mount, _): (fd, filepath) = tempfile.mkstemp(dir=mount) x_before = os.lstat(filepath) x = os.fstat(fd) if x.st_size != x_before.st_size: os.close(fd) os.unlink(filepath) print("fstat before unlink: size mismatch lstat={} fstat={}".format(x_before.st_size, x.st_size), end='') return 1 if x.st_mode != x_before.st_mode: os.close(fd) os.unlink(filepath) print("fstat before unlink: mode mismatch lstat={} fstat={}".format(x_before.st_mode, x.st_mode), end='') return 1 os.unlink(filepath) y = os.fstat(fd) if y.st_nlink != 0: os.close(fd) print("fstat after unlink: expected nlink=0, got {}".format(y.st_nlink), end='') return 1 if y.st_size != x.st_size: os.close(fd) print("fstat after unlink: size changed from {} to {}".format(x.st_size, y.st_size), end='') return 1 os.close(fd) return 0 except RuntimeError as exc: print(str(exc), end="") return 77 if __name__ == "__main__": raise SystemExit(main()) mergerfs-2.42.0/tests/TEST_use_ftruncate_after_unlink0000755000000000000000000000174415177346257021475 0ustar rootroot#!/usr/bin/env python3 import tempfile import os import sys from posix_parity import mergerfs_mount def main(): try: with mergerfs_mount() as (mount, _): (fd, filepath) = tempfile.mkstemp(dir=mount) os.ftruncate(fd, 10) st1 = os.fstat(fd) if st1.st_size != 10: os.close(fd) os.unlink(filepath) print("ftruncate before unlink: expected size 10, got {}".format(st1.st_size), end='') return 1 os.unlink(filepath) os.ftruncate(fd, 20) st2 = os.fstat(fd) if st2.st_size != 20: os.close(fd) print("ftruncate after unlink: expected size 20, got {}".format(st2.st_size), end='') return 1 os.close(fd) return 0 except RuntimeError as exc: print(str(exc), end="") return 77 if __name__ == "__main__": raise SystemExit(main()) mergerfs-2.42.0/tests/TEST_use_futimens_after_unlink0000755000000000000000000000246415177346257021334 0ustar rootroot#!/usr/bin/env python3 import tempfile import os import sys from posix_parity import mergerfs_mount def main(): try: with mergerfs_mount() as (mount, _): (fd, filepath) = tempfile.mkstemp(dir=mount) times = (1234567890, 9876543210) os.utime(fd, times=times) st1 = os.fstat(fd) if st1.st_atime != times[0] or st1.st_mtime != times[1]: os.close(fd) os.unlink(filepath) print("futimens before unlink: expected atime={} mtime={}, got atime={} mtime={}".format( times[0], times[1], st1.st_atime, st1.st_mtime), end='') return 1 os.unlink(filepath) times2 = (1111111111, 2222222222) os.utime(fd, times=times2) st2 = os.fstat(fd) if st2.st_atime != times2[0] or st2.st_mtime != times2[1]: os.close(fd) print("futimens after unlink: expected atime={} mtime={}, got atime={} mtime={}".format( times2[0], times2[1], st2.st_atime, st2.st_mtime), end='') return 1 os.close(fd) return 0 except RuntimeError as exc: print(str(exc), end="") return 77 if __name__ == "__main__": raise SystemExit(main()) mergerfs-2.42.0/tests/posix_parity.py0000644000000000000000000001714015177346257016401 0ustar rootroot#!/usr/bin/env python3 import ctypes import errno import os import shutil import stat import subprocess import sys import tempfile import time from contextlib import contextmanager libc = ctypes.CDLL(None, use_errno=True) libc.access.argtypes = [ctypes.c_char_p, ctypes.c_int] libc.access.restype = ctypes.c_int def find_mergerfs(): script_dir = os.path.dirname(os.path.realpath(__file__)) build_path = os.path.join(script_dir, "..", "build", "mergerfs") if os.path.isfile(build_path): return os.path.realpath(build_path) return shutil.which("mergerfs") def find_fusermount(): return shutil.which("fusermount3") or shutil.which("fusermount") def has_tool(name): return shutil.which(name) is not None def mount_mergerfs(branches, mountpoint, options=None): mergerfs_bin = find_mergerfs() if mergerfs_bin is None: raise RuntimeError("mergerfs binary not found") if options is None: options = "defaults,use_ino,category.create=mfs" if os.geteuid() == 0: options += ",allow_other" branch_arg = ":".join(branches) cmd = [mergerfs_bin, branch_arg, mountpoint, "-o", options] subprocess.run(cmd, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) def unmount_mergerfs(mountpoint): um = find_fusermount() if um is None: raise RuntimeError("fusermount3/fusermount not found") for attempt in range(3): u = subprocess.run([um, "-u", mountpoint], stdout=subprocess.PIPE, stderr=subprocess.PIPE) if u.returncode == 0: return time.sleep(1) subprocess.run([um, "-z", mountpoint], stdout=subprocess.PIPE, stderr=subprocess.PIPE) @contextmanager def mergerfs_mount(num_branches=2, options=None): mergerfs_bin = find_mergerfs() if mergerfs_bin is None: raise RuntimeError("mergerfs binary not found") if find_fusermount() is None: raise RuntimeError("fusermount3/fusermount not found") tests_dir = os.path.dirname(os.path.realpath(__file__)) tmp_parent = os.path.join(tests_dir, ".test_tmp") os.makedirs(tmp_parent, exist_ok=True) tmpdir = tempfile.mkdtemp(prefix="mergerfs_test_", dir=tmp_parent) try: branches = [os.path.join(tmpdir, f"branch{i}") for i in range(num_branches)] for b in branches: os.makedirs(b, exist_ok=True) mountpoint = os.path.join(tmpdir, "mp") os.makedirs(mountpoint, exist_ok=True) mount_mergerfs(branches, mountpoint, options) yield mountpoint, branches finally: try: unmount_mergerfs(mountpoint) except Exception: pass shutil.rmtree(tmpdir, ignore_errors=True) def temp_dir(root): """Create a temporary directory within the given root directory.""" return tempfile.mkdtemp(dir=root) def cleanup_dir(path): """Recursively remove a directory and its contents, ignoring errors.""" if path and os.path.exists(path): try: shutil.rmtree(path, ignore_errors=True) except Exception: pass def invoke(callable_): try: return True, callable_(), 0 except OSError as exc: return False, None, exc.errno def compare_calls(name, merge_call, native_call, value_cmp=None, close_fds=False): m_ok, m_val, m_errno = invoke(merge_call) n_ok, n_val, n_errno = invoke(native_call) if close_fds: # WARNING: close_fds=True should only be used when the callable # returns an fd (non-negative int from os.open etc.), NOT when it # returns arbitrary integers (e.g., byte counts, offsets). try: if m_ok: close_if_fd(m_val) finally: if n_ok: close_if_fd(n_val) if m_ok != n_ok: return ( f"{name}: success mismatch mergerfs={m_ok} native={n_ok} " f"(mergerfs_errno={m_errno} native_errno={n_errno})" ) if m_errno != n_errno: return f"{name}: errno mismatch mergerfs={m_errno} native={n_errno}" if m_ok and value_cmp is not None and not value_cmp(m_val, n_val): return f"{name}: value mismatch mergerfs={m_val!r} native={n_val!r}" return None def access_raw(path, mode): ctypes.set_errno(0) rv = libc.access(path.encode(), mode) err = ctypes.get_errno() return rv, err def compare_access(name, merge_path, native_path, mode, expect_errno=None): m_rv, m_errno = access_raw(merge_path, mode) n_rv, n_errno = access_raw(native_path, mode) if m_rv != n_rv: return f"{name}: return mismatch mergerfs={m_rv} native={n_rv}" if m_errno != n_errno: return f"{name}: errno mismatch mergerfs={m_errno} native={n_errno}" if expect_errno is not None and n_errno != expect_errno: return f"{name}: expected errno={expect_errno}, got errno={n_errno}" return None def stat_cmp_basic(lhs, rhs): return ( stat.S_IFMT(lhs.st_mode) == stat.S_IFMT(rhs.st_mode) and stat.S_IMODE(lhs.st_mode) == stat.S_IMODE(rhs.st_mode) and lhs.st_size == rhs.st_size ) def cleanup_paths(paths): for path in paths: try: if os.path.islink(path) or os.path.isfile(path): os.unlink(path) elif os.path.isdir(path): os.rmdir(path) except FileNotFoundError: pass def close_if_fd(value): if isinstance(value, int) and value >= 0: try: os.close(value) except OSError: pass def fail(msg): print(msg, end="") return 1 def join(root, rel): return os.path.join(root, rel) def ensure_parent(path): os.makedirs(os.path.dirname(path), exist_ok=True) def touch(path, data=b"x", mode=0o644): ensure_parent(path) with open(path, "wb") as fp: fp.write(data) os.chmod(path, mode) def mergerfs_ctrl_file(mount): return join(mount, ".mergerfs") def mergerfs_key(option_key): return f"user.mergerfs.{option_key}" def mergerfs_get_option(mount, option_key): raw = os.getxattr(mergerfs_ctrl_file(mount), mergerfs_key(option_key)) return raw.decode("utf-8", errors="surrogateescape") def mergerfs_set_option(mount, option_key, value): if isinstance(value, bytes): payload = value else: payload = str(value).encode("utf-8") os.setxattr(mergerfs_ctrl_file(mount), mergerfs_key(option_key), payload) def parse_allpaths(raw): if isinstance(raw, str): raw = raw.encode("utf-8", errors="surrogateescape") paths = [] for p in raw.split(b"\0"): if not p: continue paths.append(p.decode("utf-8", errors="surrogateescape")) return paths def _parse_branch_entry(entry): entry = entry.strip() if not entry: return None if "=" in entry: return entry.split("=", 1)[0] return entry def mergerfs_branches(mount): raw = mergerfs_get_option(mount, "branches") branches = [] for entry in raw.split(":"): path = _parse_branch_entry(entry) if path: branches.append(path) return branches def underlying_path(mount, rel): branches = mergerfs_branches(mount) if not branches: raise RuntimeError("no mergerfs branches configured") return os.path.join(branches[0], rel) def pair_paths(mount, rel): return join(mount, rel), underlying_path(mount, rel) def should_compare_inode(mount): try: inodecalc = mergerfs_get_option(mount, "inodecalc").strip().lower() except OSError: return False return inodecalc == "passthrough" def mergerfs_fullpath(path): raw = os.getxattr(path, "user.mergerfs.fullpath") return raw.decode("utf-8", errors="surrogateescape") mergerfs-2.42.0/tests/run-tests0000755000000000000000000000204715177346257015167 0ustar rootroot#!/usr/bin/env python3 import os import sys import subprocess SKIP = 77 test_path = os.path.realpath(sys.argv[0]) test_path = os.path.dirname(test_path) failed = False for entry in os.scandir(test_path): if not entry.name.startswith('TEST_'): continue try: print(entry.name + ': ', end='', flush=True) fullpath = os.path.join(test_path, entry.name) args = [fullpath] rv = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) output, _ = rv.communicate(timeout=120) if rv.returncode == SKIP: print('SKIP - {}'.format(output.decode(errors='replace'))) elif rv.returncode: print('FAIL - {}'.format(output.decode(errors='replace'))) failed = True else: print('PASS') except subprocess.TimeoutExpired: rv.kill() rv.wait() print('FAIL - timeout') failed = True except Exception as e: print('FAIL - {}'.format(e)) failed = True sys.exit(1 if failed else 0) mergerfs-2.42.0/tests/tests.cpp0000644000000000000000000030014515177346257015143 0ustar rootroot#include "acutest/acutest.h" #include "config.hpp" #include "fs_copyfile.hpp" #include "fs_inode.hpp" #include "from_string.hpp" #include "hashset.hpp" #include "num.hpp" #include "rapidhash/rapidhash.h" #include "rnd.hpp" #include "str.hpp" #include "thread_pool.hpp" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include template bool wait_until(Predicate pred_, const int timeout_ms_ = 2000) { for(int i = 0; i < timeout_ms_; ++i) { if(pred_()) return true; std::this_thread::sleep_for(std::chrono::milliseconds(1)); } return pred_(); } void test_nop() { TEST_CHECK(true); } void test_config_bool() { ConfigBOOL v; TEST_CHECK(v.from_string("true") == 0); TEST_CHECK(v == true); TEST_CHECK(v.to_string() == "true"); TEST_CHECK(v.from_string("false") == 0); TEST_CHECK(v == false); TEST_CHECK(v.to_string() == "false"); TEST_CHECK(v.from_string("asdf") == -EINVAL); } void test_config_uint64() { ConfigU64 v; TEST_CHECK(v.from_string("0") == 0); TEST_CHECK(v == (uint64_t)0); TEST_CHECK(v.to_string() == "0"); TEST_CHECK(v.from_string("123") == 0); TEST_CHECK(v == (uint64_t)123); TEST_CHECK(v.to_string() == "123"); TEST_CHECK(v.from_string("1234567890") == 0); TEST_CHECK(v == (uint64_t)1234567890); TEST_CHECK(v.to_string() == "1234567890"); TEST_CHECK(v.from_string("asdf") == -EINVAL); } void test_config_int() { ConfigINT v; TEST_CHECK(v.from_string("0") == 0); TEST_CHECK(v == (int)0); TEST_CHECK(v.to_string() == "0"); TEST_CHECK(v.from_string("123") == 0); TEST_CHECK(v == (int)123); TEST_CHECK(v.to_string() == "123"); TEST_CHECK(v.from_string("1234567890") == 0); TEST_CHECK(v == (int)1234567890); TEST_CHECK(v.to_string() == "1234567890"); TEST_CHECK(v.from_string("asdf") == -EINVAL); } void test_config_str() { ConfigSTR v; TEST_CHECK(v.from_string("foo") == 0); TEST_CHECK(v == "foo"); TEST_CHECK(v.to_string() == "foo"); } void test_str_stuff() { std::vector v; std::set s; std::pair kv; // split() - vector v = str::split("",':'); TEST_CHECK(v.size() == 0); v = str::split("a:b:c",':'); TEST_CHECK(v.size() == 3); TEST_CHECK(v[0] == "a"); TEST_CHECK(v[1] == "b"); TEST_CHECK(v[2] == "c"); v = str::split("a::b:c",':'); TEST_CHECK(v.size() == 4); TEST_CHECK(v[0] == "a"); TEST_CHECK(v[1] == ""); TEST_CHECK(v[2] == "b"); TEST_CHECK(v[3] == "c"); v = str::split("single",':'); TEST_CHECK(v.size() == 1); TEST_CHECK(v[0] == "single"); // split_to_set() s = str::split_to_set("",':'); TEST_CHECK(s.size() == 0); s = str::split_to_set("a:b:c",':'); TEST_CHECK(s.size() == 3); TEST_CHECK(s.count("a") == 1); TEST_CHECK(s.count("b") == 1); TEST_CHECK(s.count("c") == 1); s = str::split_to_set("a:a:b",':'); TEST_CHECK(s.size() == 2); TEST_CHECK(s.count("a") == 1); TEST_CHECK(s.count("b") == 1); // split_on_null() std::string nullstr = "hello"; nullstr += '\0'; nullstr += "world"; nullstr += '\0'; nullstr += "test"; v = str::split_on_null(std::string_view(nullstr.data(), nullstr.size())); TEST_CHECK(v.size() == 3); TEST_CHECK(v[0] == "hello"); TEST_CHECK(v[1] == "world"); TEST_CHECK(v[2] == "test"); v = str::split_on_null(""); TEST_CHECK(v.size() == 0); // lsplit1() v = str::lsplit1("foo=bar=baz",'='); TEST_CHECK(v.size() == 2); TEST_CHECK(v[0] == "foo"); TEST_CHECK(v[1] == "bar=baz"); v = str::lsplit1("",'='); TEST_CHECK(v.size() == 0); v = str::lsplit1("no_delimiter",'='); TEST_CHECK(v.size() == 1); TEST_CHECK(v[0] == "no_delimiter"); // rsplit1() v = str::rsplit1("foo=bar=baz",'='); TEST_CHECK(v.size() == 2); TEST_CHECK(v[0] == "foo=bar"); TEST_CHECK(v[1] == "baz"); v = str::rsplit1("",'='); TEST_CHECK(v.size() == 0); v = str::rsplit1("no_delimiter",'='); TEST_CHECK(v.size() == 1); TEST_CHECK(v[0] == "no_delimiter"); // splitkv() kv = str::splitkv("key=value", '='); TEST_CHECK(kv.first == "key"); TEST_CHECK(kv.second == "value"); kv = str::splitkv("key=", '='); TEST_CHECK(kv.first == "key"); TEST_CHECK(kv.second == ""); kv = str::splitkv("key", '='); TEST_CHECK(kv.first == "key"); TEST_CHECK(kv.second == ""); kv = str::splitkv("", '='); TEST_CHECK(kv.first == ""); TEST_CHECK(kv.second == ""); // join() - vector with substr v = {"abc", "def", "ghi"}; std::string joined = str::join(v, 1, ':'); TEST_CHECK(joined == "bc:ef:hi"); // join() - vector joined = str::join(v, ':'); TEST_CHECK(joined == "abc:def:ghi"); v = {"single"}; joined = str::join(v, ':'); TEST_CHECK(joined == "single"); v = {}; joined = str::join(v, ':'); TEST_CHECK(joined == ""); // join() - set s = {"a", "b", "c"}; joined = str::join(s, ':'); TEST_CHECK(joined == "a:b:c"); s = {}; joined = str::join(s, ':'); TEST_CHECK(joined == ""); // longest_common_prefix_index() v = {"/foo/bar", "/foo/baz", "/foo/qux"}; TEST_CHECK(str::longest_common_prefix_index(v) == 5); v = {"/foo/bar"}; TEST_CHECK(str::longest_common_prefix_index(v) == std::string::npos); v = {}; TEST_CHECK(str::longest_common_prefix_index(v) == std::string::npos); v = {"abc", "xyz"}; TEST_CHECK(str::longest_common_prefix_index(v) == 0); // longest_common_prefix() v = {"/foo/bar", "/foo/baz"}; TEST_CHECK(str::longest_common_prefix(v) == "/foo/ba"); v = {"/foo/bar"}; // Single element - returns empty string (implementation detail) TEST_CHECK(str::longest_common_prefix(v) == ""); v = {}; TEST_CHECK(str::longest_common_prefix(v) == ""); // remove_common_prefix_and_join() v = {"/foo/bar", "/foo/baz", "/foo/qux"}; joined = str::remove_common_prefix_and_join(v, ':'); TEST_CHECK(joined == "bar:baz:qux"); v = {}; joined = str::remove_common_prefix_and_join(v, ':'); TEST_CHECK(joined == ""); // startswith() - string_view TEST_CHECK(str::startswith("hello world", "hello") == true); TEST_CHECK(str::startswith("hello world", "world") == false); TEST_CHECK(str::startswith("hello", "hello world") == false); TEST_CHECK(str::startswith("", "") == true); TEST_CHECK(str::startswith("hello", "") == true); // startswith() - char* TEST_CHECK(str::startswith("hello world", "hello") == true); TEST_CHECK(str::startswith("hello world", "world") == false); // endswith() TEST_CHECK(str::endswith("hello world", "world") == true); TEST_CHECK(str::endswith("hello world", "hello") == false); TEST_CHECK(str::endswith("hello", "hello world") == false); TEST_CHECK(str::endswith("", "") == true); TEST_CHECK(str::endswith("hello", "") == true); // trim() TEST_CHECK(str::trim(" hello ") == "hello"); TEST_CHECK(str::trim("hello") == "hello"); TEST_CHECK(str::trim(" ") == ""); TEST_CHECK(str::trim("") == ""); TEST_CHECK(str::trim("\t\nhello\r\n") == "hello"); TEST_CHECK(str::trim(" hello world ") == "hello world"); // eq() TEST_CHECK(str::eq("hello", "hello") == true); TEST_CHECK(str::eq("hello", "world") == false); TEST_CHECK(str::eq("", "") == true); // replace() TEST_CHECK(str::replace("hello world", ' ', '_') == "hello_world"); TEST_CHECK(str::replace("abc", 'x', 'y') == "abc"); TEST_CHECK(str::replace("", 'x', 'y') == ""); TEST_CHECK(str::replace("aaa", 'a', 'b') == "bbb"); // erase_fnmatches() v = {"foo.txt", "bar.cpp", "baz.h", "test.txt"}; std::vector patterns = {"*.txt"}; str::erase_fnmatches(patterns, v); TEST_CHECK(v.size() == 2); // Order may vary, just check elements exist bool has_bar_cpp = false; bool has_baz_h = false; for(const auto& s : v) { if(s == "bar.cpp") has_bar_cpp = true; if(s == "baz.h") has_baz_h = true; } TEST_CHECK(has_bar_cpp); TEST_CHECK(has_baz_h); v = {"foo.txt", "bar.cpp"}; patterns = {"*.txt", "*.cpp"}; str::erase_fnmatches(patterns, v); TEST_CHECK(v.size() == 0); v = {"foo.txt", "bar.cpp"}; patterns = {}; str::erase_fnmatches(patterns, v); TEST_CHECK(v.size() == 2); } void test_config_branches() { uint64_t minfreespace = 1234; Branches b; b.minfreespace = minfreespace; Branches::Ptr bcp0; Branches::Ptr bcp1; TEST_CHECK(b->minfreespace() == 1234); TEST_CHECK(b.to_string() == ""); // Parse initial value for branch TEST_CHECK(b.from_string(b.to_string()) == 0); bcp0 = b; TEST_CHECK(b.from_string("/foo/bar") == 0); TEST_CHECK(b.to_string() == "/foo/bar=RW"); bcp1 = b; TEST_CHECK(bcp0.get() != bcp1.get()); TEST_CHECK(b.from_string("/foo/bar=RW,1234") == 0); TEST_CHECK(b.to_string() == "/foo/bar=RW,1234"); TEST_CHECK(b.from_string("/foo/bar=RO,1234:/foo/baz=NC,4321") == 0); TEST_CHECK(b.to_string() == "/foo/bar=RO,1234:/foo/baz=NC,4321"); bcp0 = b; TEST_CHECK((*bcp0).size() == 2); TEST_CHECK((*bcp0)[0].path == "/foo/bar"); TEST_CHECK((*bcp0)[0].minfreespace() == 1234); TEST_MSG("minfreespace: expected = %lu; produced = %lu", 1234UL, (*bcp0)[0].minfreespace()); TEST_CHECK((*bcp0)[1].path == "/foo/baz"); TEST_CHECK((*bcp0)[1].minfreespace() == 4321); TEST_MSG("minfreespace: expected = %lu; produced = %lu", 4321UL, (*bcp0)[1].minfreespace()); TEST_CHECK(b.from_string("foo/bar") == 0); TEST_CHECK(b.from_string("./foo/bar") == 0); TEST_CHECK(b.from_string("./foo/bar:/bar/baz:blah/asdf") == 0); } // --------------------------------------------------------------------------- // Branch unit tests // --------------------------------------------------------------------------- void test_branch_default_ctor_mode() { Branch b; TEST_CHECK(b.mode == Branch::Mode::RW); } void test_branch_to_string_modes() { uint64_t global = 0; Branch b(global); b.path = "/mnt/disk1"; b.mode = Branch::Mode::RW; TEST_CHECK(b.to_string() == "/mnt/disk1=RW"); b.mode = Branch::Mode::RO; TEST_CHECK(b.to_string() == "/mnt/disk1=RO"); b.mode = Branch::Mode::NC; TEST_CHECK(b.to_string() == "/mnt/disk1=NC"); } void test_branch_to_string_with_minfreespace() { uint64_t global = 0; Branch b(global); b.path = "/mnt/disk1"; b.mode = Branch::Mode::RW; // While minfreespace is held by pointer (global default), it is NOT emitted TEST_CHECK(b.to_string() == "/mnt/disk1=RW"); // Once set_minfreespace is called the value is stored locally and IS emitted b.set_minfreespace(1024); TEST_CHECK(b.to_string() == "/mnt/disk1=RW,1K"); b.set_minfreespace(1024 * 1024); TEST_CHECK(b.to_string() == "/mnt/disk1=RW,1M"); b.set_minfreespace(1024 * 1024 * 1024); TEST_CHECK(b.to_string() == "/mnt/disk1=RW,1G"); b.set_minfreespace(500); TEST_CHECK(b.to_string() == "/mnt/disk1=RW,500"); } void test_branch_mode_predicates() { Branch b; b.mode = Branch::Mode::RW; TEST_CHECK(b.ro() == false); TEST_CHECK(b.nc() == false); TEST_CHECK(b.ro_or_nc() == false); b.mode = Branch::Mode::RO; TEST_CHECK(b.ro() == true); TEST_CHECK(b.nc() == false); TEST_CHECK(b.ro_or_nc() == true); b.mode = Branch::Mode::NC; TEST_CHECK(b.ro() == false); TEST_CHECK(b.nc() == true); TEST_CHECK(b.ro_or_nc() == true); } void test_branch_minfreespace_pointer_vs_value() { uint64_t global = 9999; Branch b(global); // Reads through the pointer TEST_CHECK(b.minfreespace() == 9999); // Pointer tracks changes to the referenced global global = 1234; TEST_CHECK(b.minfreespace() == 1234); // set_minfreespace switches variant to owned u64 b.set_minfreespace(42); TEST_CHECK(b.minfreespace() == 42); // Global changes no longer affect it global = 9999; TEST_CHECK(b.minfreespace() == 42); } void test_branch_copy_constructor() { uint64_t global = 100; Branch orig(global); orig.path = "/orig"; orig.mode = Branch::Mode::RO; Branch copy(orig); TEST_CHECK(copy.path == "/orig"); TEST_CHECK(copy.mode == Branch::Mode::RO); TEST_CHECK(copy.minfreespace() == 100); } void test_branch_copy_assignment() { uint64_t global = 77; Branch a(global); a.path = "/a"; a.mode = Branch::Mode::NC; a.set_minfreespace(555); Branch b; b = a; TEST_CHECK(b.path == "/a"); TEST_CHECK(b.mode == Branch::Mode::NC); TEST_CHECK(b.minfreespace() == 555); } // --------------------------------------------------------------------------- // Branches unit tests // --------------------------------------------------------------------------- void test_branches_default_minfreespace() { Branches b; // Default minfreespace propagates into each parsed branch b.minfreespace = 8192; TEST_CHECK(b.from_string("/tmp/a") == 0); Branches::Ptr p = b; TEST_CHECK((*p)[0].minfreespace() == 8192); } void test_branches_per_branch_minfreespace_overrides_default() { Branches b; b.minfreespace = 1000; TEST_CHECK(b.from_string("/tmp/a=RW,2000") == 0); Branches::Ptr p = b; TEST_CHECK((*p)[0].minfreespace() == 2000); TEST_MSG("expected 2000, got %lu", (unsigned long)(*p)[0].minfreespace()); } void test_branches_add_end_operator() { Branches b; TEST_CHECK(b.from_string("/tmp/a") == 0); TEST_CHECK(b->size() == 1); // + appends to end TEST_CHECK(b.from_string("+/tmp/b") == 0); Branches::Ptr p = b; TEST_CHECK((*p).size() == 2); TEST_CHECK((*p)[0].path == "/tmp/a"); TEST_CHECK((*p)[1].path == "/tmp/b"); // +> also appends to end TEST_CHECK(b.from_string("+>/tmp/c") == 0); p = b; TEST_CHECK((*p).size() == 3); TEST_CHECK((*p)[2].path == "/tmp/c"); } void test_branches_add_begin_operator() { Branches b; TEST_CHECK(b.from_string("/tmp/a") == 0); TEST_CHECK(b.from_string("+size() == 2); // = replaces the whole list TEST_CHECK(b.from_string("=/tmp/c") == 0); Branches::Ptr p = b; TEST_CHECK((*p).size() == 1); TEST_CHECK((*p)[0].path == "/tmp/c"); } void test_branches_erase_end_operator() { Branches b; TEST_CHECK(b.from_string("/tmp/a:/tmp/b:/tmp/c") == 0); TEST_CHECK(b.from_string("->") == 0); Branches::Ptr p = b; TEST_CHECK((*p).size() == 2); TEST_CHECK((*p).back().path == "/tmp/b"); } void test_branches_erase_begin_operator() { Branches b; TEST_CHECK(b.from_string("/tmp/a:/tmp/b:/tmp/c") == 0); TEST_CHECK(b.from_string("-<") == 0); Branches::Ptr p = b; TEST_CHECK((*p).size() == 2); TEST_CHECK((*p).front().path == "/tmp/b"); } void test_branches_erase_fnmatch_operator() { Branches b; TEST_CHECK(b.from_string("/tmp/disk1:/tmp/disk2:/mnt/ssd") == 0); // Remove branches matching /tmp/* TEST_CHECK(b.from_string("-/tmp/*") == 0); Branches::Ptr p = b; TEST_CHECK((*p).size() == 1); TEST_CHECK((*p)[0].path == "/mnt/ssd"); } void test_branches_erase_fnmatch_multiple_patterns() { Branches b; TEST_CHECK(b.from_string("/tmp/a:/tmp/b:/mnt/c:/mnt/d") == 0); TEST_CHECK(b.from_string("-/tmp/a:/mnt/d") == 0); Branches::Ptr p = b; TEST_CHECK((*p).size() == 2); TEST_CHECK((*p)[0].path == "/tmp/b"); TEST_CHECK((*p)[1].path == "/mnt/c"); } void test_branches_invalid_mode() { Branches b; TEST_CHECK(b.from_string("/tmp/a=XX") == -EINVAL); } void test_branches_invalid_minfreespace() { Branches b; TEST_CHECK(b.from_string("/tmp/a=RW,notanumber") == -EINVAL); } void test_branches_to_paths() { Branches b; TEST_CHECK(b.from_string("/tmp/a:/tmp/b:/tmp/c") == 0); Branches::Ptr p = b; std::vector paths = (*p).to_paths(); TEST_CHECK(paths.size() == 3); TEST_CHECK(paths[0] == "/tmp/a"); TEST_CHECK(paths[1] == "/tmp/b"); TEST_CHECK(paths[2] == "/tmp/c"); StrVec sv; (*p).to_paths(sv); TEST_CHECK(sv.size() == 3); TEST_CHECK(sv[0] == "/tmp/a"); TEST_CHECK(sv[1] == "/tmp/b"); TEST_CHECK(sv[2] == "/tmp/c"); } void test_branches_cow_semantics() { Branches b; TEST_CHECK(b.from_string("/tmp/a") == 0); Branches::Ptr snap0 = b; TEST_CHECK(b.from_string("+/tmp/b") == 0); Branches::Ptr snap1 = b; // Each mutation produces a new Impl pointer TEST_CHECK(snap0.get() != snap1.get()); // snap0 is unchanged TEST_CHECK((*snap0).size() == 1); TEST_CHECK((*snap1).size() == 2); } void test_branches_mode_round_trip() { Branches b; TEST_CHECK(b.from_string("/tmp/a=RO:/tmp/b=NC:/tmp/c=RW") == 0); TEST_CHECK(b.to_string() == "/tmp/a=RO:/tmp/b=NC:/tmp/c=RW"); Branches::Ptr p = b; TEST_CHECK((*p)[0].mode == Branch::Mode::RO); TEST_CHECK((*p)[1].mode == Branch::Mode::NC); TEST_CHECK((*p)[2].mode == Branch::Mode::RW); } void test_branches_srcmounts_to_string() { Branches b; TEST_CHECK(b.from_string("/tmp/a=RO,1234:/tmp/b=NC") == 0); SrcMounts sm(b); // SrcMounts::to_string emits only paths, no mode or minfreespace TEST_CHECK(sm.to_string() == "/tmp/a:/tmp/b"); } void test_branches_srcmounts_empty() { Branches b; SrcMounts sm(b); TEST_CHECK(sm.to_string() == ""); } // --------------------------------------------------------------------------- // Branch::to_string humanization edge cases // --------------------------------------------------------------------------- void test_branch_to_string_1t() { uint64_t global = 0; Branch b(global); b.path = "/mnt/disk1"; b.mode = Branch::Mode::RW; b.set_minfreespace(1024ULL * 1024 * 1024 * 1024); TEST_CHECK(b.to_string() == "/mnt/disk1=RW,1T"); b.set_minfreespace(2ULL * 1024 * 1024 * 1024 * 1024); TEST_CHECK(b.to_string() == "/mnt/disk1=RW,2T"); } void test_branch_to_string_non_exact_multiple() { // 1536 = 1.5K: not divisible by any tier, emitted as raw decimal uint64_t global = 0; Branch b(global); b.path = "/mnt/disk1"; b.mode = Branch::Mode::RW; b.set_minfreespace(1536); TEST_CHECK(b.to_string() == "/mnt/disk1=RW,1536"); // 1537 also not exact b.set_minfreespace(1537); TEST_CHECK(b.to_string() == "/mnt/disk1=RW,1537"); } void test_branch_to_string_zero_owned_minfreespace() { // Default Branch() holds u64(0) in variant — to_string WILL emit ",0" Branch b; b.path = "/mnt/disk1"; b.mode = Branch::Mode::RW; TEST_CHECK(b.to_string() == "/mnt/disk1=RW,0"); } void test_branch_copy_pointer_aliasing() { // A copy of a pointer-backed Branch shares the same pointer — // mutating the original global value is seen by both. uint64_t global = 1024; Branch orig(global); orig.path = "/mnt/a"; orig.mode = Branch::Mode::RW; Branch copy = orig; TEST_CHECK(orig.minfreespace() == 1024); TEST_CHECK(copy.minfreespace() == 1024); // Both see the updated value through the shared pointer global = 2048; TEST_CHECK(orig.minfreespace() == 2048); TEST_CHECK(copy.minfreespace() == 2048); } // --------------------------------------------------------------------------- // parse_mode: case-sensitivity // --------------------------------------------------------------------------- void test_branches_mode_case_sensitivity() { Branches b; // Only exact uppercase is accepted TEST_CHECK(b.from_string("/tmp/a=rw") == -EINVAL); TEST_CHECK(b.from_string("/tmp/a=ro") == -EINVAL); TEST_CHECK(b.from_string("/tmp/a=nc") == -EINVAL); TEST_CHECK(b.from_string("/tmp/a=Rw") == -EINVAL); TEST_CHECK(b.from_string("/tmp/a=RW") == 0); } // --------------------------------------------------------------------------- // parse_minfreespace: suffix variants // --------------------------------------------------------------------------- void test_branches_minfreespace_lowercase_suffixes() { Branches b; Branches::Ptr p; // Lowercase k/m/g/t must be accepted and multiply correctly TEST_CHECK(b.from_string("/tmp/a=RW,1k") == 0); p = b; TEST_CHECK((*p)[0].minfreespace() == 1024ULL); TEST_CHECK(b.from_string("/tmp/a=RW,1m") == 0); p = b; TEST_CHECK((*p)[0].minfreespace() == 1024ULL * 1024); TEST_CHECK(b.from_string("/tmp/a=RW,1g") == 0); p = b; TEST_CHECK((*p)[0].minfreespace() == 1024ULL * 1024 * 1024); TEST_CHECK(b.from_string("/tmp/a=RW,1t") == 0); p = b; TEST_CHECK((*p)[0].minfreespace() == 1024ULL * 1024 * 1024 * 1024); } void test_branches_minfreespace_bytes_suffix() { Branches b; Branches::Ptr p; // 'B' / 'b' suffix means bytes (no multiplication) TEST_CHECK(b.from_string("/tmp/a=RW,1024B") == 0); p = b; TEST_CHECK((*p)[0].minfreespace() == 1024ULL); TEST_CHECK(b.from_string("/tmp/a=RW,1024b") == 0); p = b; TEST_CHECK((*p)[0].minfreespace() == 1024ULL); } void test_branches_minfreespace_zero() { Branches b; TEST_CHECK(b.from_string("/tmp/a=RW,0") == 0); Branches::Ptr p = b; TEST_CHECK((*p)[0].minfreespace() == 0ULL); // to_string should reproduce the zero TEST_CHECK(p->to_string() == "/tmp/a=RW,0"); } void test_branches_minfreespace_negative_invalid() { Branches b; TEST_CHECK(b.from_string("/tmp/a=RW,-1") == -EINVAL); } void test_branches_minfreespace_overflow() { Branches b; // 16777216T overflows u64 (16777216 * 2^40 > 2^64-1) TEST_CHECK(b.from_string("/tmp/a=RW,16777216T") == -EOVERFLOW); } // --------------------------------------------------------------------------- // Minfreespace round-trip through Branches // --------------------------------------------------------------------------- void test_branches_minfreespace_round_trip() { Branches b; // Parse 1K — should store 1024, to_string should emit "1K" TEST_CHECK(b.from_string("/tmp/a=RW,1K") == 0); { Branches::Ptr p = b; TEST_CHECK((*p)[0].minfreespace() == 1024ULL); TEST_CHECK(p->to_string() == "/tmp/a=RW,1K"); // Re-parsing the output should produce the same state TEST_CHECK(b.from_string(p->to_string()) == 0); } { Branches::Ptr p = b; TEST_CHECK((*p)[0].minfreespace() == 1024ULL); } } void test_branches_minfreespace_round_trip_1t() { Branches b; TEST_CHECK(b.from_string("/tmp/a=RW,1T") == 0); Branches::Ptr p = b; TEST_CHECK((*p)[0].minfreespace() == 1024ULL * 1024 * 1024 * 1024); TEST_CHECK(p->to_string() == "/tmp/a=RW,1T"); } // --------------------------------------------------------------------------- // Instruction dispatch edge cases // --------------------------------------------------------------------------- void test_branches_clear_with_equals_alone() { Branches b; TEST_CHECK(b.from_string("/tmp/a:/tmp/b") == 0); TEST_CHECK(b->size() == 2); // "=" alone clears the list TEST_CHECK(b.from_string("=") == 0); TEST_CHECK(b->empty()); } void test_branches_empty_string_clears_same_as_equals() { // "" and "=" both dispatch to l::set — should produce identical result Branches b1, b2; TEST_CHECK(b1.from_string("/tmp/a") == 0); TEST_CHECK(b2.from_string("/tmp/a") == 0); TEST_CHECK(b1.from_string("=") == 0); TEST_CHECK(b2.from_string("") == 0); TEST_CHECK(b1->empty()); TEST_CHECK(b2->empty()); } void test_branches_plus_and_plus_greater_equivalent() { // "+" and "+>" both dispatch to l::add_end Branches b1, b2; TEST_CHECK(b1.from_string("/tmp/a") == 0); TEST_CHECK(b2.from_string("/tmp/a") == 0); TEST_CHECK(b1.from_string("+/tmp/b") == 0); TEST_CHECK(b2.from_string("+>/tmp/b") == 0); TEST_CHECK(b1->to_string() == b2->to_string()); } void test_branches_unknown_instruction_einval() { Branches b; // "++" is not a recognized instruction TEST_CHECK(b.from_string("++-/tmp/a") == -EINVAL); // "+-" is not recognized either TEST_CHECK(b.from_string("+-/tmp/a") == -EINVAL); } // --------------------------------------------------------------------------- // parse_branch edge cases // --------------------------------------------------------------------------- void test_branches_empty_options_after_equals_einval() { Branches b; // "/tmp/a=" — empty options field (no mode) is invalid TEST_CHECK(b.from_string("/tmp/a=") == -EINVAL); } void test_branches_path_with_equals_in_name() { Branches b; // rsplit1 splits on the LAST '=' so "/path/with=sign=RW" works TEST_CHECK(b.from_string("/tmp/with=equals=RW") == 0); Branches::Ptr p = b; TEST_CHECK((*p)[0].path == "/tmp/with=equals"); TEST_CHECK((*p)[0].mode == Branch::Mode::RW); } // --------------------------------------------------------------------------- // add_begin / add_end with multiple colon-separated paths // --------------------------------------------------------------------------- void test_branches_add_end_multiple_paths() { Branches b; TEST_CHECK(b.from_string("/tmp/a") == 0); // "+>" with two paths should append both in order TEST_CHECK(b.from_string("+>/tmp/b:/tmp/c") == 0); Branches::Ptr p = b; TEST_CHECK((*p).size() == 3); TEST_CHECK((*p)[0].path == "/tmp/a"); TEST_CHECK((*p)[1].path == "/tmp/b"); TEST_CHECK((*p)[2].path == "/tmp/c"); } void test_branches_add_begin_multiple_paths() { Branches b; TEST_CHECK(b.from_string("/tmp/a") == 0); // "+<" with two paths should prepend both in order TEST_CHECK(b.from_string("+size() == 2); } void test_branches_erase_wildcard_removes_all() { Branches b; TEST_CHECK(b.from_string("/tmp/a:/tmp/b:/tmp/c") == 0); // "-*" — '*' matches everything (no FNM_PATHNAME, so '*' matches '/') TEST_CHECK(b.from_string("-*") == 0); TEST_CHECK(b->empty()); } void test_branches_erase_nonmatching_pattern_noop() { Branches b; TEST_CHECK(b.from_string("/tmp/a:/tmp/b") == 0); // Pattern that matches nothing — list unchanged TEST_CHECK(b.from_string("-/mnt/*") == 0); TEST_CHECK(b->size() == 2); } void test_branches_erase_multi_pattern_first_miss_second_hit() { Branches b; TEST_CHECK(b.from_string("/tmp/a:/mnt/b") == 0); // First pattern matches nothing, second matches /mnt/b TEST_CHECK(b.from_string("-/nonexist/*:/mnt/*") == 0); Branches::Ptr p = b; TEST_CHECK((*p).size() == 1); TEST_CHECK((*p)[0].path == "/tmp/a"); } // --------------------------------------------------------------------------- // erase_begin / erase_end on single-element list // --------------------------------------------------------------------------- void test_branches_erase_end_single_element() { Branches b; TEST_CHECK(b.from_string("/tmp/a") == 0); TEST_CHECK(b.from_string("->") == 0); TEST_CHECK(b->empty()); } void test_branches_erase_begin_single_element() { Branches b; TEST_CHECK(b.from_string("/tmp/a") == 0); TEST_CHECK(b.from_string("-<") == 0); TEST_CHECK(b->empty()); } void test_branches_erase_end_empty_returns_enoent() { Branches b; TEST_CHECK(b.from_string("->") == -ENOENT); TEST_CHECK(b->empty()); } void test_branches_erase_begin_empty_returns_enoent() { Branches b; TEST_CHECK(b.from_string("-<") == -ENOENT); TEST_CHECK(b->empty()); } // --------------------------------------------------------------------------- // Operation sequences // --------------------------------------------------------------------------- void test_branches_clear_then_add() { Branches b; TEST_CHECK(b.from_string("/tmp/a:/tmp/b") == 0); TEST_CHECK(b.from_string("=") == 0); TEST_CHECK(b->empty()); TEST_CHECK(b.from_string("+/tmp/c") == 0); Branches::Ptr p = b; TEST_CHECK((*p).size() == 1); TEST_CHECK((*p)[0].path == "/tmp/c"); } void test_branches_add_begin_then_end_then_erase_both() { Branches b; TEST_CHECK(b.from_string("/tmp/b") == 0); TEST_CHECK(b.from_string("+/tmp/c") == 0); // append { Branches::Ptr p = b; TEST_CHECK((*p).size() == 3); TEST_CHECK((*p)[0].path == "/tmp/a"); TEST_CHECK((*p)[1].path == "/tmp/b"); TEST_CHECK((*p)[2].path == "/tmp/c"); } TEST_CHECK(b.from_string("-<") == 0); // remove first TEST_CHECK(b.from_string("->") == 0); // remove last { Branches::Ptr p = b; TEST_CHECK((*p).size() == 1); TEST_CHECK((*p)[0].path == "/tmp/b"); } } void test_branches_error_in_multipath_add_leaves_list_unchanged() { Branches b; TEST_CHECK(b.from_string("/tmp/a") == 0); // Second path has invalid mode — the whole add should fail atomically TEST_CHECK(b.from_string("+/tmp/b:/tmp/c=XX") == -EINVAL); // Original list unchanged Branches::Ptr p = b; TEST_CHECK((*p).size() == 1); TEST_CHECK((*p)[0].path == "/tmp/a"); } void test_branches_error_in_set_leaves_list_unchanged() { Branches b; TEST_CHECK(b.from_string("/tmp/a") == 0); // Invalid set — list should be unchanged TEST_CHECK(b.from_string("=/tmp/b=BADMODE") == -EINVAL); Branches::Ptr p = b; TEST_CHECK((*p).size() == 1); TEST_CHECK((*p)[0].path == "/tmp/a"); } // --------------------------------------------------------------------------- // Branches::minfreespace live tracking // --------------------------------------------------------------------------- void test_branches_global_minfreespace_live_tracking() { Branches b; TEST_CHECK(b.from_string("/tmp/a") == 0); // Branch uses pointer to Branches::minfreespace — tracks it live uint64_t initial = b.minfreespace; { Branches::Ptr p = b; TEST_CHECK((*p)[0].minfreespace() == initial); } b.minfreespace = 999999; { Branches::Ptr p = b; TEST_CHECK((*p)[0].minfreespace() == 999999); } } // --------------------------------------------------------------------------- // SrcMounts: from_string stub and live reflection of Branches mutations // --------------------------------------------------------------------------- void test_branches_srcmounts_from_string_noop() { Branches b; TEST_CHECK(b.from_string("/tmp/a:/tmp/b") == 0); SrcMounts sm(b); // from_string on SrcMounts is a no-op stub — always returns 0, no change TEST_CHECK(sm.from_string("/tmp/c:/tmp/d") == 0); // Branches should be unchanged (still /tmp/a:/tmp/b) TEST_CHECK(sm.to_string() == "/tmp/a:/tmp/b"); } void test_branches_srcmounts_reflects_mutations() { Branches b; TEST_CHECK(b.from_string("/tmp/a") == 0); SrcMounts sm(b); TEST_CHECK(sm.to_string() == "/tmp/a"); // Mutate Branches; SrcMounts::to_string should reflect the new state TEST_CHECK(b.from_string("+/tmp/b") == 0); TEST_CHECK(sm.to_string() == "/tmp/a:/tmp/b"); TEST_CHECK(b.from_string("->") == 0); TEST_CHECK(sm.to_string() == "/tmp/a"); } void test_config_cachefiles() { CacheFiles cf; TEST_CHECK(cf.from_string("off") == 0); TEST_CHECK(cf.to_string() == "off"); TEST_CHECK(cf.from_string("partial") == 0); TEST_CHECK(cf.to_string() == "partial"); TEST_CHECK(cf.from_string("full") == 0); TEST_CHECK(cf.to_string() == "full"); TEST_CHECK(cf.from_string("auto-full") == 0); TEST_CHECK(cf.to_string() == "auto-full"); TEST_CHECK(cf.from_string("foobar") == -EINVAL); } void test_config_inodecalc() { InodeCalc ic("passthrough"); TEST_CHECK(ic.from_string("passthrough") == 0); TEST_CHECK(ic.to_string() == "passthrough"); TEST_CHECK(ic.from_string("path-hash") == 0); TEST_CHECK(ic.to_string() == "path-hash"); TEST_CHECK(ic.from_string("devino-hash") == 0); TEST_CHECK(ic.to_string() == "devino-hash"); TEST_CHECK(ic.from_string("hybrid-hash") == 0); TEST_CHECK(ic.to_string() == "hybrid-hash"); TEST_CHECK(ic.from_string("path-hash32") == 0); TEST_CHECK(ic.to_string() == "path-hash32"); TEST_CHECK(ic.from_string("devino-hash32") == 0); TEST_CHECK(ic.to_string() == "devino-hash32"); TEST_CHECK(ic.from_string("hybrid-hash32") == 0); TEST_CHECK(ic.to_string() == "hybrid-hash32"); TEST_CHECK(ic.from_string("asdf") == -EINVAL); } void test_fs_inode_readdir_calc_matches_calc() { const fs::path branch_path("/mnt/disk1"); const std::vector dirpaths = { fs::path(), fs::path("tv/season_01"), }; const std::vector> entries = { {"episode_01.mkv", S_IFREG}, {"extras", S_IFDIR}, {"nfo-file.nfo", S_IFREG}, {"a_very_long_entry_name_used_to_force_buffer_growth.txt", S_IFREG}, }; const std::vector algos = { "passthrough", "path-hash", "path-hash32", "devino-hash", "devino-hash32", "hybrid-hash", "hybrid-hash32", }; for(const auto &algo : algos) { TEST_CHECK(fs::inode::set_algo(algo) == 0); for(const auto &dirpath : dirpaths) { fs::inode::ReaddirCalc calc(branch_path,dirpath); ino_t ino = 1000; for(const auto &[name,mode] : entries) { const fs::path fullpath = dirpath / name; const u64 expected = fs::inode::calc(branch_path.string(), fullpath.string(), mode, ino); const u64 actual = calc.calc(name.c_str(), name.size(), mode, ino); TEST_CHECK(actual == expected); ++ino; } } } } void test_config_moveonenospc() { MoveOnENOSPC m(false); TEST_CHECK(m.to_string() == "false"); TEST_CHECK(m.from_string("mfs") == 0); TEST_CHECK(m.to_string() == "mfs"); TEST_CHECK(m.from_string("mspmfs") == 0); TEST_CHECK(m.to_string() == "mspmfs"); TEST_CHECK(m.from_string("true") == 0); TEST_CHECK(m.to_string() == "pfrd"); TEST_CHECK(m.from_string("blah") == -EINVAL); } void test_config_nfsopenhack() { NFSOpenHack n; TEST_CHECK(n.from_string("off") == 0); TEST_CHECK(n.to_string() == "off"); TEST_CHECK(n == NFSOpenHack::ENUM::OFF); TEST_CHECK(n.from_string("git") == 0); TEST_CHECK(n.to_string() == "git"); TEST_CHECK(n == NFSOpenHack::ENUM::GIT); TEST_CHECK(n.from_string("all") == 0); TEST_CHECK(n.to_string() == "all"); TEST_CHECK(n == NFSOpenHack::ENUM::ALL); } void test_config_readdir() { Config cfg; TEST_CHECK(cfg.has_key("func.readdir") == true); const auto &map = cfg.get_map(); TEST_CHECK(map.count("func.readdir") > 0); } void test_config_statfs() { StatFS s; TEST_CHECK(s.from_string("base") == 0); TEST_CHECK(s.to_string() == "base"); TEST_CHECK(s == StatFS::ENUM::BASE); TEST_CHECK(s.from_string("full") == 0); TEST_CHECK(s.to_string() == "full"); TEST_CHECK(s == StatFS::ENUM::FULL); TEST_CHECK(s.from_string("asdf") == -EINVAL); } void test_config_statfs_ignore() { StatFSIgnore s; TEST_CHECK(s.from_string("none") == 0); TEST_CHECK(s.to_string() == "none"); TEST_CHECK(s == StatFSIgnore::ENUM::NONE); TEST_CHECK(s.from_string("ro") == 0); TEST_CHECK(s.to_string() == "ro"); TEST_CHECK(s == StatFSIgnore::ENUM::RO); TEST_CHECK(s.from_string("nc") == 0); TEST_CHECK(s.to_string() == "nc"); TEST_CHECK(s == StatFSIgnore::ENUM::NC); TEST_CHECK(s.from_string("asdf") == -EINVAL); } void test_config_xattr() { XAttr x; TEST_CHECK(x.from_string("passthrough") == 0); TEST_CHECK(x.to_string() == "passthrough"); TEST_CHECK(x == XAttr::ENUM::PASSTHROUGH); TEST_CHECK(x.from_string("noattr") == 0); TEST_CHECK(x.to_string() == "noattr"); TEST_CHECK(x == XAttr::ENUM::NOATTR); TEST_CHECK(x.from_string("nosys") == 0); TEST_CHECK(x.to_string() == "nosys"); TEST_CHECK(x == XAttr::ENUM::NOSYS); TEST_CHECK(x.from_string("asdf") == -EINVAL); } void test_config() { Config cfg; TEST_CHECK(cfg.set("async-read","true") == 0); } // ===================================================================== // ThreadPool tests // ===================================================================== void test_tp_construct_default() { ThreadPool tp(2, 4, "test.default"); auto threads = tp.threads(); TEST_CHECK(threads.size() == 2); } void test_tp_construct_named() { ThreadPool tp(1, 2, "test.named"); auto threads = tp.threads(); TEST_CHECK(threads.size() == 1); } void test_tp_construct_zero_threads_throws() { bool threw = false; try { ThreadPool tp(0, 4, "test.zero"); } catch(const std::runtime_error &) { threw = true; } TEST_CHECK(threw); } void test_tp_enqueue_work() { ThreadPool tp(2, 4, "test.ew"); std::atomic counter{0}; for(int i = 0; i < 10; ++i) tp.enqueue_work([&counter](){ counter.fetch_add(1); }); // wait for completion for(int i = 0; i < 1000 && counter.load() < 10; ++i) std::this_thread::sleep_for(std::chrono::milliseconds(1)); TEST_CHECK(counter.load() == 10); } void test_tp_enqueue_work_with_ptoken() { ThreadPool tp(2, 4, "test.ewp"); std::atomic counter{0}; auto ptok = tp.ptoken(); for(int i = 0; i < 10; ++i) tp.enqueue_work(ptok, [&counter](){ counter.fetch_add(1); }); for(int i = 0; i < 1000 && counter.load() < 10; ++i) std::this_thread::sleep_for(std::chrono::milliseconds(1)); TEST_CHECK(counter.load() == 10); } void test_tp_try_enqueue_work() { // Use 1 thread and a small queue depth of 2 ThreadPool tp(1, 2, "test.tew"); std::atomic counter{0}; // These should succeed (queue has room) bool ok = tp.try_enqueue_work([&counter](){ counter.fetch_add(1); }); TEST_CHECK(ok); for(int i = 0; i < 1000 && counter.load() < 1; ++i) std::this_thread::sleep_for(std::chrono::milliseconds(1)); TEST_CHECK(counter.load() == 1); } void test_tp_try_enqueue_work_with_ptoken() { ThreadPool tp(1, 2, "test.tewp"); std::atomic counter{0}; auto ptok = tp.ptoken(); bool ok = tp.try_enqueue_work(ptok, [&counter](){ counter.fetch_add(1); }); TEST_CHECK(ok); for(int i = 0; i < 1000 && counter.load() < 1; ++i) std::this_thread::sleep_for(std::chrono::milliseconds(1)); TEST_CHECK(counter.load() == 1); } void test_tp_try_enqueue_work_for() { ThreadPool tp(1, 2, "test.tewf"); std::atomic counter{0}; bool ok = tp.try_enqueue_work_for(100000, // 100ms [&counter](){ counter.fetch_add(1); }); TEST_CHECK(ok); for(int i = 0; i < 1000 && counter.load() < 1; ++i) std::this_thread::sleep_for(std::chrono::milliseconds(1)); TEST_CHECK(counter.load() == 1); } void test_tp_try_enqueue_work_for_with_ptoken() { ThreadPool tp(1, 2, "test.tewfp"); std::atomic counter{0}; auto ptok = tp.ptoken(); bool ok = tp.try_enqueue_work_for(ptok, 100000, // 100ms [&counter](){ counter.fetch_add(1); }); TEST_CHECK(ok); for(int i = 0; i < 1000 && counter.load() < 1; ++i) std::this_thread::sleep_for(std::chrono::milliseconds(1)); TEST_CHECK(counter.load() == 1); } void test_tp_enqueue_task_int() { ThreadPool tp(2, 4, "test.eti"); auto future = tp.enqueue_task([]() -> int { return 42; }); TEST_CHECK(future.get() == 42); } void test_tp_enqueue_task_void() { ThreadPool tp(2, 4, "test.etv"); std::atomic ran{false}; auto future = tp.enqueue_task([&ran]() { ran.store(true); }); future.get(); // should not throw TEST_CHECK(ran.load()); } void test_tp_enqueue_task_string() { ThreadPool tp(2, 4, "test.ets"); auto future = tp.enqueue_task([]() -> std::string { return "hello"; }); TEST_CHECK(future.get() == "hello"); } void test_tp_enqueue_task_exception() { ThreadPool tp(2, 4, "test.ete"); auto future = tp.enqueue_task([]() -> int { throw std::runtime_error("task error"); return 0; }); bool caught = false; try { future.get(); } catch(const std::runtime_error &e) { caught = true; TEST_CHECK(std::string(e.what()) == "task error"); } TEST_CHECK(caught); } void test_tp_threads_returns_correct_count() { ThreadPool tp(4, 8, "test.thr"); auto threads = tp.threads(); TEST_CHECK(threads.size() == 4); // All thread IDs should be non-zero for(auto t : threads) TEST_CHECK(t != 0); } void test_tp_threads_unique_ids() { ThreadPool tp(4, 8, "test.uid"); auto threads = tp.threads(); // All thread IDs should be unique for(std::size_t i = 0; i < threads.size(); ++i) for(std::size_t j = i + 1; j < threads.size(); ++j) TEST_CHECK(threads[i] != threads[j]); } void test_tp_add_thread() { ThreadPool tp(2, 4, "test.add"); TEST_CHECK(tp.threads().size() == 2); int rv = tp.add_thread(); TEST_CHECK(rv == 0); TEST_CHECK(tp.threads().size() == 3); } void test_tp_remove_thread() { ThreadPool tp(3, 4, "test.rm"); TEST_CHECK(tp.threads().size() == 3); int rv = tp.remove_thread(); TEST_CHECK(rv == 0); TEST_CHECK(tp.threads().size() == 2); } void test_tp_remove_thread_refuses_last() { ThreadPool tp(1, 4, "test.rmlast"); TEST_CHECK(tp.threads().size() == 1); int rv = tp.remove_thread(); TEST_CHECK(rv == -EINVAL); TEST_CHECK(tp.threads().size() == 1); } void test_tp_set_threads_grow() { ThreadPool tp(2, 8, "test.grow"); TEST_CHECK(tp.threads().size() == 2); int rv = tp.set_threads(4); TEST_CHECK(rv == 0); TEST_CHECK(tp.threads().size() == 4); } void test_tp_set_threads_shrink() { ThreadPool tp(4, 8, "test.shrink"); TEST_CHECK(tp.threads().size() == 4); int rv = tp.set_threads(2); TEST_CHECK(rv == 0); TEST_CHECK(tp.threads().size() == 2); } void test_tp_set_threads_zero() { ThreadPool tp(2, 4, "test.sz"); int rv = tp.set_threads(0); TEST_CHECK(rv == -EINVAL); TEST_CHECK(tp.threads().size() == 2); } void test_tp_set_threads_same() { ThreadPool tp(3, 4, "test.same"); int rv = tp.set_threads(3); TEST_CHECK(rv == 0); TEST_CHECK(tp.threads().size() == 3); } void test_tp_work_after_add_thread() { ThreadPool tp(1, 4, "test.waat"); tp.add_thread(); tp.add_thread(); std::atomic counter{0}; const int N = 20; for(int i = 0; i < N; ++i) tp.enqueue_work([&counter](){ counter.fetch_add(1); }); for(int i = 0; i < 2000 && counter.load() < N; ++i) std::this_thread::sleep_for(std::chrono::milliseconds(1)); TEST_CHECK(counter.load() == N); } void test_tp_work_after_remove_thread() { ThreadPool tp(3, 4, "test.wart"); tp.remove_thread(); std::atomic counter{0}; const int N = 10; for(int i = 0; i < N; ++i) tp.enqueue_work([&counter](){ counter.fetch_add(1); }); for(int i = 0; i < 2000 && counter.load() < N; ++i) std::this_thread::sleep_for(std::chrono::milliseconds(1)); TEST_CHECK(counter.load() == N); } void test_tp_worker_exception_no_crash() { ThreadPool tp(2, 4, "test.exc"); // Enqueue work that throws -- pool should not crash tp.enqueue_work([](){ throw std::runtime_error("deliberate error"); }); // Enqueue normal work after the exception std::atomic ran{false}; tp.enqueue_work([&ran](){ ran.store(true); }); for(int i = 0; i < 1000 && !ran.load(); ++i) std::this_thread::sleep_for(std::chrono::milliseconds(1)); TEST_CHECK(ran.load()); } void test_tp_concurrent_enqueue() { ThreadPool tp(4, 64, "test.conc"); std::atomic counter{0}; const int PRODUCERS = 4; const int ITEMS_PER = 50; const int TOTAL = PRODUCERS * ITEMS_PER; std::vector producers; for(int p = 0; p < PRODUCERS; ++p) { producers.emplace_back([&tp, &counter]() { auto ptok = tp.ptoken(); for(int i = 0; i < ITEMS_PER; ++i) tp.enqueue_work(ptok, [&counter](){ counter.fetch_add(1); }); }); } for(auto &t : producers) t.join(); for(int i = 0; i < 5000 && counter.load() < TOTAL; ++i) std::this_thread::sleep_for(std::chrono::milliseconds(1)); TEST_CHECK(counter.load() == TOTAL); } void test_tp_enqueue_task_multiple() { ThreadPool tp(4, 16, "test.etm"); std::vector> futures; const int N = 20; for(int i = 0; i < N; ++i) futures.push_back(tp.enqueue_task([i]() -> int { return i * i; })); for(int i = 0; i < N; ++i) TEST_CHECK(futures[i].get() == i * i); } void test_tp_ptoken_creation() { ThreadPool tp(2, 4, "test.ptok"); // Multiple ptokens should be independently usable auto ptok1 = tp.ptoken(); auto ptok2 = tp.ptoken(); std::atomic counter{0}; tp.enqueue_work(ptok1, [&counter](){ counter.fetch_add(1); }); tp.enqueue_work(ptok2, [&counter](){ counter.fetch_add(1); }); for(int i = 0; i < 1000 && counter.load() < 2; ++i) std::this_thread::sleep_for(std::chrono::milliseconds(1)); TEST_CHECK(counter.load() == 2); } void test_tp_destruction_drains_queue() { std::atomic counter{0}; { ThreadPool tp(2, 64, "test.drain"); for(int i = 0; i < 50; ++i) tp.enqueue_work([&counter](){ counter.fetch_add(1); }); // destructor runs here -- should drain all queued work } TEST_CHECK(counter.load() == 50); } void test_tp_move_only_callable() { ThreadPool tp(2, 4, "test.moc"); auto ptr = std::make_unique(99); auto future = tp.enqueue_task([p = std::move(ptr)]() -> int { return *p; }); TEST_CHECK(future.get() == 99); } void test_tp_work_ordering_single_thread() { // With a single thread, work should execute in FIFO order ThreadPool tp(1, 16, "test.order"); std::vector results; std::mutex mtx; const int N = 10; for(int i = 0; i < N; ++i) tp.enqueue_work([i, &results, &mtx](){ std::lock_guard lk(mtx); results.push_back(i); }); // Wait for all work to complete for(int i = 0; i < 2000; ++i) { { std::lock_guard lk(mtx); if((int)results.size() == N) break; } std::this_thread::sleep_for(std::chrono::milliseconds(1)); } std::lock_guard lk(mtx); TEST_CHECK((int)results.size() == N); for(int i = 0; i < N; ++i) TEST_CHECK(results[i] == i); } void test_tp_try_enqueue_work_fails_when_full() { ThreadPool tp(1, 1, "test.tewfull"); std::atomic release{false}; std::atomic worker_started{false}; std::atomic ran{0}; tp.enqueue_work([&release, &worker_started, &ran]() { worker_started.store(true); while(!release.load()) std::this_thread::sleep_for(std::chrono::milliseconds(1)); ran.fetch_add(1); }); TEST_CHECK(wait_until([&worker_started](){ return worker_started.load(); })); tp.enqueue_work([&ran](){ ran.fetch_add(1); }); bool ok = tp.try_enqueue_work([&ran](){ ran.fetch_add(1); }); TEST_CHECK(!ok); release.store(true); TEST_CHECK(wait_until([&ran](){ return ran.load() == 2; })); TEST_CHECK(ran.load() == 2); } void test_tp_try_enqueue_work_for_times_out_when_full() { ThreadPool tp(1, 1, "test.tewftimeout"); std::atomic release{false}; std::atomic worker_started{false}; std::atomic ran{0}; tp.enqueue_work([&release, &worker_started, &ran]() { worker_started.store(true); while(!release.load()) std::this_thread::sleep_for(std::chrono::milliseconds(1)); ran.fetch_add(1); }); TEST_CHECK(wait_until([&worker_started](){ return worker_started.load(); })); tp.enqueue_work([&ran](){ ran.fetch_add(1); }); auto start = std::chrono::steady_clock::now(); bool ok = tp.try_enqueue_work_for(20000, [&ran](){ ran.fetch_add(1); }); auto end = std::chrono::steady_clock::now(); TEST_CHECK(!ok); auto elapsed_us = std::chrono::duration_cast(end - start).count(); TEST_CHECK(elapsed_us >= 10000); release.store(true); TEST_CHECK(wait_until([&ran](){ return ran.load() == 2; })); TEST_CHECK(ran.load() == 2); } void test_tp_enqueue_work_blocks_until_slot_available() { ThreadPool tp(1, 1, "test.ewblocks"); std::atomic release{false}; std::atomic worker_started{false}; std::atomic producer_returned{false}; std::atomic ran{0}; tp.enqueue_work([&release, &worker_started, &ran]() { worker_started.store(true); while(!release.load()) std::this_thread::sleep_for(std::chrono::milliseconds(1)); ran.fetch_add(1); }); TEST_CHECK(wait_until([&worker_started](){ return worker_started.load(); })); tp.enqueue_work([&ran](){ ran.fetch_add(1); }); std::thread producer([&tp, &ran, &producer_returned]() { tp.enqueue_work([&ran](){ ran.fetch_add(1); }); producer_returned.store(true); }); std::this_thread::sleep_for(std::chrono::milliseconds(20)); TEST_CHECK(!producer_returned.load()); release.store(true); TEST_CHECK(wait_until([&producer_returned](){ return producer_returned.load(); })); producer.join(); TEST_CHECK(wait_until([&ran](){ return ran.load() == 3; })); TEST_CHECK(ran.load() == 3); } void test_tp_worker_nonstd_exception_no_crash() { ThreadPool tp(2, 4, "test.nsexc"); tp.enqueue_work([](){ throw 7; }); std::atomic ran{false}; tp.enqueue_work([&ran](){ ran.store(true); }); TEST_CHECK(wait_until([&ran](){ return ran.load(); })); TEST_CHECK(ran.load()); } void test_tp_remove_thread_under_load() { ThreadPool tp(4, 64, "test.rmuload"); std::atomic counter{0}; const int N = 300; for(int i = 0; i < N; ++i) tp.enqueue_work([&counter]() { std::this_thread::sleep_for(std::chrono::milliseconds(1)); counter.fetch_add(1); }); int rv1 = -1; int rv2 = -1; std::thread remover([&tp, &rv1, &rv2]() { rv1 = tp.remove_thread(); rv2 = tp.remove_thread(); }); remover.join(); TEST_CHECK(rv1 == 0); TEST_CHECK(rv2 == 0); TEST_CHECK(tp.threads().size() == 2); TEST_CHECK(wait_until([&counter, N](){ return counter.load() == N; }, 10000)); TEST_CHECK(counter.load() == N); std::atomic post_ok{false}; tp.enqueue_work([&post_ok](){ post_ok.store(true); }); TEST_CHECK(wait_until([&post_ok](){ return post_ok.load(); })); } void test_tp_set_threads_concurrent_with_enqueue() { ThreadPool tp(3, 128, "test.stcwe"); const int PRODUCERS = 4; const int PER_PRODUCER = 150; const int TOTAL = PRODUCERS * PER_PRODUCER; std::atomic counter{0}; std::atomic producers_done{false}; std::atomic resize_calls{0}; std::thread resizer([&tp, &producers_done, &resize_calls]() { int i = 0; while(!producers_done.load()) { std::size_t count = ((i % 2) == 0 ? 2 : 6); int rv = tp.set_threads(count); if(rv == 0) resize_calls.fetch_add(1); ++i; } }); std::vector producers; for(int p = 0; p < PRODUCERS; ++p) { producers.emplace_back([&tp, &counter]() { auto ptok = tp.ptoken(); for(int i = 0; i < PER_PRODUCER; ++i) tp.enqueue_work(ptok, [&counter](){ counter.fetch_add(1); }); }); } for(auto &t : producers) t.join(); producers_done.store(true); resizer.join(); TEST_CHECK(resize_calls.load() > 0); TEST_CHECK(wait_until([&counter, TOTAL](){ return counter.load() == TOTAL; }, 10000)); TEST_CHECK(counter.load() == TOTAL); } void test_tp_repeated_resize_stress() { ThreadPool tp(2, 64, "test.resize"); const int ROUNDS = 30; const int PER_ROUND = 20; const int TOTAL = ROUNDS * PER_ROUND; std::atomic counter{0}; for(int r = 0; r < ROUNDS; ++r) { std::size_t target = 1 + (r % 5); int rv = tp.set_threads(target); TEST_CHECK(rv == 0); for(int i = 0; i < PER_ROUND; ++i) tp.enqueue_work([&counter](){ counter.fetch_add(1); }); } TEST_CHECK(wait_until([&counter, TOTAL](){ return counter.load() == TOTAL; }, 10000)); TEST_CHECK(counter.load() == TOTAL); } void test_tp_many_producers_many_tasks_stress() { ThreadPool tp(8, 256, "test.mpmt"); const int PRODUCERS = 8; const int ITEMS_PER = 200; const int TOTAL = PRODUCERS * ITEMS_PER; std::atomic counter{0}; std::vector producers; for(int p = 0; p < PRODUCERS; ++p) { producers.emplace_back([&tp, &counter]() { auto ptok = tp.ptoken(); for(int i = 0; i < ITEMS_PER; ++i) tp.enqueue_work(ptok, [&counter](){ counter.fetch_add(1); }); }); } for(auto &t : producers) t.join(); TEST_CHECK(wait_until([&counter, TOTAL](){ return counter.load() == TOTAL; }, 10000)); TEST_CHECK(counter.load() == TOTAL); } void test_tp_heavy_mixed_resize_and_enqueue_stress() { ThreadPool tp(6, 512, "test.hmix"); const int PRODUCERS = 10; const int PER_PRODUCER = 2500; const int TOTAL = PRODUCERS * PER_PRODUCER; std::atomic executed{0}; std::atomic producers_done{false}; std::atomic resize_ops{0}; std::thread resizer([&tp, &producers_done, &resize_ops]() { int i = 0; while(!producers_done.load()) { const std::size_t target = 2 + (i % 10); int rv = tp.set_threads(target); if(rv == 0) resize_ops.fetch_add(1); ++i; } }); std::vector producers; producers.reserve(PRODUCERS); for(int p = 0; p < PRODUCERS; ++p) { producers.emplace_back([&tp, &executed]() { auto ptok = tp.ptoken(); for(int i = 0; i < PER_PRODUCER; ++i) tp.enqueue_work(ptok, [&executed](){ executed.fetch_add(1); }); }); } for(auto &t : producers) t.join(); producers_done.store(true); resizer.join(); TEST_CHECK(resize_ops.load() > 0); TEST_CHECK(wait_until([&executed, TOTAL](){ return executed.load() == TOTAL; }, 30000)); TEST_CHECK(executed.load() == TOTAL); } void test_tp_heavy_try_enqueue_pressure() { ThreadPool tp(1, 1, "test.hpress"); const int PRODUCERS = 6; const int ATTEMPTS_PER = 2500; std::atomic accepted{0}; std::atomic rejected{0}; std::atomic executed{0}; std::vector producers; producers.reserve(PRODUCERS); for(int p = 0; p < PRODUCERS; ++p) { producers.emplace_back([&tp, &accepted, &rejected, &executed]() { auto ptok = tp.ptoken(); for(int i = 0; i < ATTEMPTS_PER; ++i) { bool ok = tp.try_enqueue_work_for(ptok, 200, [&executed]() { std::this_thread::sleep_for(std::chrono::microseconds(50)); executed.fetch_add(1); }); if(ok) accepted.fetch_add(1); else rejected.fetch_add(1); } }); } for(auto &t : producers) t.join(); TEST_CHECK(accepted.load() > 0); TEST_CHECK(rejected.load() > 0); TEST_CHECK(wait_until([&executed, &accepted]() { return executed.load() == accepted.load(); }, 30000)); TEST_CHECK(executed.load() == accepted.load()); } void test_tp_heavy_repeated_construct_destroy() { const int ROUNDS = 150; for(int r = 0; r < ROUNDS; ++r) { std::atomic counter{0}; { ThreadPool tp(4, 128, "test.hctor"); for(int i = 0; i < 400; ++i) tp.enqueue_work([&counter]() { std::this_thread::sleep_for(std::chrono::microseconds(25)); counter.fetch_add(1); }); } TEST_CHECK(counter.load() == 400); } } void test_tp_heavy_enqueue_task_mixed_outcomes() { ThreadPool tp(8, 512, "test.htask"); const int N = 12000; std::vector> futures; futures.reserve(N); for(int i = 0; i < N; ++i) { futures.emplace_back(tp.enqueue_task([i]() -> int { if((i % 11) == 0) throw std::runtime_error("heavy task error"); return i; })); } long long expected_sum = 0; int expected_success = 0; int expected_errors = 0; for(int i = 0; i < N; ++i) { if((i % 11) == 0) { expected_errors += 1; } else { expected_success += 1; expected_sum += i; } } int actual_success = 0; int actual_errors = 0; long long actual_sum = 0; for(auto &f : futures) { try { actual_sum += f.get(); actual_success += 1; } catch(const std::runtime_error &e) { actual_errors += 1; TEST_CHECK(std::string(e.what()) == "heavy task error"); } } TEST_CHECK(actual_success == expected_success); TEST_CHECK(actual_errors == expected_errors); TEST_CHECK(actual_sum == expected_sum); } void test_tp_heavy_add_remove_churn_under_enqueue() { ThreadPool tp(6, 512, "test.hchurn"); const int PRODUCERS = 6; const int PER_PRODUCER = 2200; const int TOTAL = PRODUCERS * PER_PRODUCER; const int CHURN_OPS = 700; std::atomic executed{0}; std::atomic producers_done{false}; std::atomic add_ok{0}; std::atomic remove_ok{0}; std::thread churner([&tp, &producers_done, &add_ok, &remove_ok]() { int i = 0; while(!producers_done.load() && i < CHURN_OPS) { int rv_add = tp.add_thread(); if(rv_add == 0) add_ok.fetch_add(1); int rv_remove = tp.remove_thread(); if(rv_remove == 0) remove_ok.fetch_add(1); ++i; } }); std::vector producers; producers.reserve(PRODUCERS); for(int p = 0; p < PRODUCERS; ++p) { producers.emplace_back([&tp, &executed]() { auto ptok = tp.ptoken(); for(int i = 0; i < PER_PRODUCER; ++i) tp.enqueue_work(ptok, [&executed]() { executed.fetch_add(1); }); }); } for(auto &t : producers) t.join(); producers_done.store(true); churner.join(); TEST_CHECK(add_ok.load() > 0); TEST_CHECK(remove_ok.load() > 0); TEST_CHECK(wait_until([&executed, TOTAL](){ return executed.load() == TOTAL; }, 30000)); TEST_CHECK(executed.load() == TOTAL); } void test_config_has_key() { Config cfg; TEST_CHECK(cfg.has_key("async-read") == true); TEST_CHECK(cfg.has_key("branches") == true); TEST_CHECK(cfg.has_key("version") == true); TEST_CHECK(cfg.has_key("nonexistent-key-xyz") == false); TEST_CHECK(cfg.has_key("") == false); // Underscore form should NOT match (has_key does no normalization) TEST_CHECK(cfg.has_key("async_read") == false); } void test_config_keys() { Config cfg; const auto &map = cfg.get_map(); // Result must be non-empty TEST_CHECK(!map.empty()); // Verify known keys are present TEST_CHECK(map.count("async-read") > 0); TEST_CHECK(map.count("branches") > 0); TEST_CHECK(map.count("version") > 0); // No key should be empty for(const auto &[k, v] : map) TEST_CHECK(!k.empty()); } void test_config_keys_xattr() { Config cfg; ssize_t needed = cfg.keys_listxattr(nullptr, 0); TEST_CHECK(needed > 0); std::string s(needed, '\0'); ssize_t written = cfg.keys_listxattr(s.data(), needed); TEST_CHECK(written > 0); s.resize(written); // Every token must start with "user.mergerfs." and end with NUL const char *p = s.data(); const char *end = p + s.size(); int count = 0; while(p < end) { const char *nul = static_cast(memchr(p, '\0', end - p)); TEST_CHECK(nul != nullptr); if(!nul) break; std::string entry(p, nul); TEST_CHECK(str::startswith(entry, "user.mergerfs.")); ++count; p = nul + 1; } TEST_CHECK(count > 0); } void test_config_keys_listxattr_size() { Config cfg; ssize_t sz = cfg.keys_listxattr_size(); TEST_CHECK(sz > 0); // Size must accommodate a buffer filled by keys_listxattr std::string buf(sz, '\0'); ssize_t written = cfg.keys_listxattr(buf.data(), sz); TEST_CHECK(written > 0); TEST_CHECK(written <= sz); } void test_config_keys_listxattr_fill() { Config cfg; // size=0 must return required size (not write anything) ssize_t needed = cfg.keys_listxattr(nullptr, 0); TEST_CHECK(needed > 0); // Allocate exact size and fill std::vector buf(needed); ssize_t written = cfg.keys_listxattr(buf.data(), needed); TEST_CHECK(written > 0); TEST_CHECK(written <= needed); // Every entry must start with "user.mergerfs." and end with NUL const char *p = buf.data(); const char *end = p + written; int count = 0; while(p < end) { const char *nul = static_cast(memchr(p, '\0', end - p)); TEST_CHECK(nul != nullptr); if(!nul) break; std::string entry(p, nul); TEST_CHECK(str::startswith(entry, "user.mergerfs.")); TEST_CHECK(entry.size() > strlen("user.mergerfs.")); ++count; p = nul + 1; } TEST_CHECK(count > 0); // Keys reported by keys_listxattr must be consistent across two calls std::vector xattr_buf(needed); ssize_t xattr_written = cfg.keys_listxattr(xattr_buf.data(), needed); TEST_CHECK(xattr_written == written); TEST_CHECK(memcmp(buf.data(), xattr_buf.data(), written) == 0); } void test_config_keys_listxattr_erange() { Config cfg; // Buffer too small (1 byte) must return -ERANGE char tiny[1] = {'\xff'}; ssize_t rv = cfg.keys_listxattr(tiny, 1); TEST_CHECK(rv == -ERANGE); } void test_config_get_set_roundtrip() { Config cfg; std::string val; // bool: async-read TEST_CHECK(cfg.set("async-read", "false") == 0); TEST_CHECK(cfg.get("async-read", &val) == 0); TEST_CHECK(val == "false"); TEST_CHECK(cfg.set("async-read", "true") == 0); TEST_CHECK(cfg.get("async-read", &val) == 0); TEST_CHECK(val == "true"); // u64: cache-attr TEST_CHECK(cfg.set("cache.attr", "42") == 0); TEST_CHECK(cfg.get("cache.attr", &val) == 0); TEST_CHECK(val == "42"); // string: fsname TEST_CHECK(cfg.set("fsname", "myfs") == 0); TEST_CHECK(cfg.get("fsname", &val) == 0); TEST_CHECK(val == "myfs"); } void test_config_get_unknown_key() { Config cfg; std::string val; int rv = cfg.get("no-such-key", &val); TEST_CHECK(rv == -ENOATTR); } void test_config_set_unknown_key() { Config cfg; int rv = cfg.set("no-such-key", "value"); TEST_CHECK(rv == -ENOATTR); } void test_config_set_invalid_value() { Config cfg; std::string val; // "async-read" is a bool — "notabool" must be rejected int rv = cfg.set("async-read", "notabool"); TEST_CHECK(rv == -EINVAL); // value must be unchanged TEST_CHECK(cfg.get("async-read", &val) == 0); TEST_CHECK(val == "true"); } void test_config_set_underscore_normalization() { Config cfg; std::string val; // Underscores must be converted to hyphens TEST_CHECK(cfg.set("async_read", "false") == 0); TEST_CHECK(cfg.get("async-read", &val) == 0); TEST_CHECK(val == "false"); } void test_config_get_underscore_normalization() { Config cfg; std::string val; TEST_CHECK(cfg.set("async-read", "false") == 0); TEST_CHECK(cfg.get("async_read", &val) == 0); TEST_CHECK(val == "false"); } void test_config_set_kv_form() { Config cfg; std::string val; TEST_CHECK(cfg.set("async-read=false") == 0); TEST_CHECK(cfg.get("async-read", &val) == 0); TEST_CHECK(val == "false"); // With spaces around delimiter TEST_CHECK(cfg.set("async-read = true") == 0); TEST_CHECK(cfg.get("async-read", &val) == 0); TEST_CHECK(val == "true"); } void test_config_remember_nodes_bool_numeric() { bool old_remember_nodes = fuse_cfg.remember_nodes; Config cfg; std::string val; fuse_cfg.remember_nodes = false; // remember-nodes accepts ints: 0 disables, non-zero enables TEST_CHECK(cfg.set("remember-nodes", "0") == 0); TEST_CHECK(cfg.get("remember-nodes", &val) == 0); TEST_CHECK(val == "false"); TEST_CHECK(cfg.set("remember-nodes", "86400") == 0); TEST_CHECK(cfg.get("remember-nodes", &val) == 0); TEST_CHECK(val == "true"); TEST_CHECK(cfg.set("remember", "-1") == 0); TEST_CHECK(cfg.get("remember", &val) == 0); TEST_CHECK(val == "true"); // remember-nodes also accepts bool strings TEST_CHECK(cfg.set("remember-nodes", "false") == 0); TEST_CHECK(cfg.get("remember-nodes", &val) == 0); TEST_CHECK(val == "false"); // never-forget-nodes is bool; it reflects the feature state TEST_CHECK(cfg.set("never-forget-nodes", "true") == 0); TEST_CHECK(cfg.get("never-forget-nodes", &val) == 0); TEST_CHECK(val == "true"); // Querying remember-nodes after never-forget-nodes=true returns true // (both alias the same fuse_cfg.remember_nodes) TEST_CHECK(cfg.get("remember-nodes", &val) == 0); TEST_CHECK(val == "true"); // Empty string treated as true TEST_CHECK(cfg.set("noforget", "") == 0); TEST_CHECK(cfg.get("noforget", &val) == 0); TEST_CHECK(val == "true"); // remember-nodes also accepts empty string as true fuse_cfg.remember_nodes = false; TEST_CHECK(cfg.set("remember-nodes", "") == 0); TEST_CHECK(cfg.get("remember-nodes", &val) == 0); TEST_CHECK(val == "true"); // Invalid string rejected by remember-nodes TEST_CHECK(cfg.set("remember-nodes", "notabool") == -EINVAL); fuse_cfg.remember_nodes = old_remember_nodes; } void test_config_readonly_before_init() { Config cfg; std::string val; // version is RO even before finish_initializing() int rv = cfg.set("version", "9.9.9"); TEST_CHECK(rv == -EROFS); } void test_config_readonly_after_init() { Config cfg; std::string val; // Before init: mutable fields can be set TEST_CHECK(cfg.set("async-read", "false") == 0); cfg.finish_initializing(); // async-read is marked RO after init int rv = cfg.set("async-read", "true"); TEST_CHECK(rv == -EROFS); // Value must be unchanged TEST_CHECK(cfg.get("async-read", &val) == 0); TEST_CHECK(val == "false"); } void test_config_mutable_after_init() { Config cfg; std::string val; cfg.finish_initializing(); // dropcacheonclose is NOT RO after init — should still be settable TEST_CHECK(cfg.set("dropcacheonclose", "true") == 0); TEST_CHECK(cfg.get("dropcacheonclose", &val) == 0); TEST_CHECK(val == "true"); } void test_config_from_stream_basic() { Config cfg; std::string val; std::istringstream ss("async-read=false\ncache.attr=99\n"); int rv = cfg.from_stream(ss); TEST_CHECK(rv == 0); TEST_CHECK(cfg.get("async-read", &val) == 0); TEST_CHECK(val == "false"); TEST_CHECK(cfg.get("cache.attr", &val) == 0); TEST_CHECK(val == "99"); } void test_config_from_stream_comments_and_blanks() { Config cfg; std::string val; std::istringstream ss( "# this is a comment\n" "\n" " \n" "async-read=false\n" "# another comment\n" "cache.attr=7\n" ); int rv = cfg.from_stream(ss); TEST_CHECK(rv == 0); TEST_CHECK(cfg.get("async-read", &val) == 0); TEST_CHECK(val == "false"); TEST_CHECK(cfg.get("cache.attr", &val) == 0); TEST_CHECK(val == "7"); } void test_config_from_stream_bad_lines() { Config cfg; std::istringstream ss("async-read=false\nbad-key-xyz=oops\ncache.attr=5\n"); int rv = cfg.from_stream(ss); // Must report error but still apply valid lines TEST_CHECK(rv == -EINVAL); TEST_CHECK(!cfg.errs.empty()); std::string val; TEST_CHECK(cfg.get("async-read", &val) == 0); TEST_CHECK(val == "false"); TEST_CHECK(cfg.get("cache.attr", &val) == 0); TEST_CHECK(val == "5"); } void test_config_from_file_nonexistent() { Config cfg; int rv = cfg.from_file("/this/path/does/not/exist/config.txt"); TEST_CHECK(rv < 0); TEST_CHECK(!cfg.errs.empty()); } void test_config_is_rootdir() { TEST_CHECK(Config::is_rootdir("") == true); TEST_CHECK(Config::is_rootdir("/") == false); TEST_CHECK(Config::is_rootdir("/foo") == false); } void test_config_is_ctrl_file() { TEST_CHECK(Config::is_ctrl_file(".mergerfs") == true); TEST_CHECK(Config::is_ctrl_file("/.mergerfs") == false); TEST_CHECK(Config::is_ctrl_file("mergerfs") == false); TEST_CHECK(Config::is_ctrl_file("") == false); } void test_config_is_mergerfs_xattr() { TEST_CHECK(Config::is_mergerfs_xattr("user.mergerfs.async-read") == true); TEST_CHECK(Config::is_mergerfs_xattr("user.mergerfs.") == true); TEST_CHECK(Config::is_mergerfs_xattr("user.mergerfs") == false); TEST_CHECK(Config::is_mergerfs_xattr("user.other.async-read") == false); TEST_CHECK(Config::is_mergerfs_xattr("") == false); } void test_config_is_cmd_xattr() { TEST_CHECK(Config::is_cmd_xattr("user.mergerfs.cmd.foo") == true); TEST_CHECK(Config::is_cmd_xattr("user.mergerfs.cmd.") == true); TEST_CHECK(Config::is_cmd_xattr("user.mergerfs.async-read") == false); TEST_CHECK(Config::is_cmd_xattr("user.mergerfs.cmd") == false); TEST_CHECK(Config::is_cmd_xattr("") == false); } void test_config_prune_ctrl_xattr() { TEST_CHECK(Config::prune_ctrl_xattr("user.mergerfs.async-read") == "async-read"); TEST_CHECK(Config::prune_ctrl_xattr("user.mergerfs.cache.attr") == "cache.attr"); // Exactly the prefix — nothing after it: returns empty TEST_CHECK(Config::prune_ctrl_xattr("user.mergerfs.") == ""); // Shorter than prefix — returns empty TEST_CHECK(Config::prune_ctrl_xattr("user.mergerfs") == ""); TEST_CHECK(Config::prune_ctrl_xattr("") == ""); } void test_config_prune_cmd_xattr() { using sv = std::string_view; TEST_CHECK(Config::prune_cmd_xattr("user.mergerfs.cmd.foo") == sv("foo")); TEST_CHECK(Config::prune_cmd_xattr("user.mergerfs.cmd.bar.baz") == sv("bar.baz")); TEST_CHECK(Config::prune_cmd_xattr("user.mergerfs.cmd.") == sv("")); TEST_CHECK(Config::prune_cmd_xattr("user.mergerfs.cmd") == sv("")); TEST_CHECK(Config::prune_cmd_xattr("") == sv("")); } void test_fs_copyfile_basic() { int rv; int src_fd; struct stat st; fs::path src_path; fs::path dst_path; fs::path tmp_dir; char tmp_template[] = "/tmp/mergerfs-test-copyfile-basic-XXXXXX"; if(::mkdtemp(tmp_template) == nullptr) { TEST_CHECK(false); return; } tmp_dir = tmp_template; src_path = tmp_dir / "src.bin"; dst_path = tmp_dir / "dst.bin"; src_fd = ::open(src_path.c_str(),O_RDWR|O_CREAT|O_TRUNC,0600); TEST_CHECK(src_fd >= 0); if(src_fd < 0) { std::filesystem::remove_all(tmp_dir); return; } rv = ::ftruncate(src_fd,(16 * 1024 * 1024)); TEST_CHECK(rv == 0); rv = ::pwrite(src_fd,"A",1,0); TEST_CHECK(rv == 1); rv = ::pwrite(src_fd,"Z",1,((16 * 1024 * 1024) - 1)); TEST_CHECK(rv == 1); rv = fs::copyfile(src_fd,dst_path,{.cleanup_failure = true}); TEST_CHECK(rv == 0); rv = ::fstat(src_fd,&st); TEST_CHECK(rv == 0); struct stat dst_st; rv = ::stat(dst_path.c_str(),&dst_st); TEST_CHECK(rv == 0); if(rv == 0) TEST_CHECK(st.st_size == dst_st.st_size); char c; int dst_fd = ::open(dst_path.c_str(),O_RDONLY); TEST_CHECK(dst_fd >= 0); if(dst_fd >= 0) { rv = ::pread(dst_fd,&c,1,0); TEST_CHECK((rv == 1) && (c == 'A')); rv = ::pread(dst_fd,&c,1,(dst_st.st_size - 1)); TEST_CHECK((rv == 1) && (c == 'Z')); ::close(dst_fd); } ::close(src_fd); std::filesystem::remove_all(tmp_dir); } void test_fs_copyfile_source_changes_cleanup_tmpfiles() { int rv; int src_fd; fs::path src_path; fs::path dst_path; fs::path tmp_dir; std::atomic stop_mutator{false}; std::atomic mutator_updates{0}; char tmp_template[] = "/tmp/mergerfs-test-copyfile-race-XXXXXX"; if(::mkdtemp(tmp_template) == nullptr) { TEST_CHECK(false); return; } tmp_dir = tmp_template; src_path = tmp_dir / "src.bin"; dst_path = tmp_dir / "dst.bin"; src_fd = ::open(src_path.c_str(),O_RDWR|O_CREAT|O_TRUNC,0600); TEST_CHECK(src_fd >= 0); if(src_fd < 0) { std::filesystem::remove_all(tmp_dir); return; } rv = ::ftruncate(src_fd,(64 * 1024 * 1024)); TEST_CHECK(rv == 0); auto mutator = std::thread([&]() { for(int i = 0; i < 200 && !stop_mutator.load(); ++i) { struct timespec ts[2]; ::clock_gettime(CLOCK_REALTIME,&ts[0]); ts[1] = ts[0]; ::utimensat(AT_FDCWD,src_path.c_str(),ts,0); mutator_updates.fetch_add(1); std::this_thread::sleep_for(std::chrono::milliseconds(1)); } }); rv = fs::copyfile(src_fd,dst_path,{.cleanup_failure = true}); stop_mutator.store(true); mutator.join(); TEST_CHECK(rv == 0); TEST_CHECK(mutator_updates.load() > 0); bool found_tmp_file = false; std::string tmp_prefix; tmp_prefix = "."; tmp_prefix += dst_path.filename().string(); tmp_prefix += "_"; for(const auto &entry : std::filesystem::directory_iterator(tmp_dir)) { const std::string name = entry.path().filename().string(); if(name.rfind(tmp_prefix,0) == 0) { found_tmp_file = true; break; } } TEST_CHECK(found_tmp_file == false); ::close(src_fd); std::filesystem::remove_all(tmp_dir); } void test_hashset_put_and_size() { HashSet set; const char *names[] = { "alpha", "bravo", "charlie", "delta", "echo", "foxtrot", "golf", "hotel", "india", "juliet", "kilo", "lima", }; const size_t names_len = (sizeof(names) / sizeof(names[0])); const char *extra = "omega-long-filename"; TEST_CHECK(set.size() == 0); TEST_CHECK(set.put(names[0]) == 1); TEST_CHECK(set.put(names[0],strlen(names[0])) == 0); for(size_t i = 1; i < names_len; ++i) TEST_CHECK(set.put(names[i],strlen(names[i])) == 1); TEST_CHECK(set.size() == (int)names_len); TEST_CHECK(set.put(names[7]) == 0); TEST_CHECK(set.put(names[11],strlen(names[11])) == 0); TEST_CHECK(set.size() == (int)names_len); TEST_CHECK(set.put(extra) == 1); TEST_CHECK(set.put(extra,strlen(extra)) == 0); TEST_CHECK(set.size() == (int)(names_len + 1)); } void test_str_eq_nullptr() { TEST_CHECK(str::eq(nullptr, nullptr) == true); TEST_CHECK(str::eq(nullptr, "") == false); TEST_CHECK(str::eq("", nullptr) == false); TEST_CHECK(str::eq(nullptr, "hello") == false); TEST_CHECK(str::eq("hello", nullptr) == false); TEST_CHECK(str::eq(nullptr, nullptr) == true); } void test_str_startswith_char_nullptr() { TEST_CHECK(str::startswith((const char*)nullptr, "foo") == false); TEST_CHECK(str::startswith("foo", (const char*)nullptr) == false); TEST_CHECK(str::startswith((const char*)nullptr, (const char*)nullptr) == false); TEST_CHECK(str::startswith("foobar", "foo") == true); TEST_CHECK(str::startswith("foobar", "bar") == false); TEST_CHECK(str::startswith("", "") == true); } void test_str_from_u64_suffixes() { u64 val; TEST_CHECK(str::from("0", &val) == 0); TEST_CHECK(val == 0); TEST_CHECK(str::from("1024", &val) == 0); TEST_CHECK(val == 1024); TEST_CHECK(str::from("1K", &val) == 0); TEST_CHECK(val == 1024); TEST_CHECK(str::from("1k", &val) == 0); TEST_CHECK(val == 1024); TEST_CHECK(str::from("1M", &val) == 0); TEST_CHECK(val == 1024 * 1024); TEST_CHECK(str::from("1m", &val) == 0); TEST_CHECK(val == 1024 * 1024); TEST_CHECK(str::from("1G", &val) == 0); TEST_CHECK(val == 1024ULL * 1024ULL * 1024ULL); TEST_CHECK(str::from("1g", &val) == 0); TEST_CHECK(val == 1024ULL * 1024ULL * 1024ULL); TEST_CHECK(str::from("1T", &val) == 0); TEST_CHECK(val == 1024ULL * 1024ULL * 1024ULL * 1024ULL); TEST_CHECK(str::from("1t", &val) == 0); TEST_CHECK(val == 1024ULL * 1024ULL * 1024ULL * 1024ULL); TEST_CHECK(str::from("1024B", &val) == 0); TEST_CHECK(val == 1024); TEST_CHECK(str::from("1024b", &val) == 0); TEST_CHECK(val == 1024); TEST_CHECK(str::from("2K", &val) == 0); TEST_CHECK(val == 2048); TEST_CHECK(str::from("4M", &val) == 0); TEST_CHECK(val == 4ULL * 1024 * 1024); TEST_CHECK(str::from("1P", &val) == -EINVAL); TEST_CHECK(str::from("hello", &val) == -EINVAL); TEST_CHECK(str::from("", &val) == -EINVAL); TEST_CHECK(str::from("16777216T", &val) == -EOVERFLOW); TEST_CHECK(str::from("9999999999999999999999", &val) == -EINVAL); } void test_str_from_s64() { s64 val; TEST_CHECK(str::from("0", &val) == 0); TEST_CHECK(val == 0); TEST_CHECK(str::from("-1", &val) == 0); TEST_CHECK(val == -1); TEST_CHECK(str::from("1K", &val) == 0); TEST_CHECK(val == 1024); TEST_CHECK(str::from("1M", &val) == 0); TEST_CHECK(val == 1024 * 1024); TEST_CHECK(str::from("1G", &val) == 0); TEST_CHECK(val == 1024LL * 1024 * 1024); TEST_CHECK(str::from("1T", &val) == 0); TEST_CHECK(val == 1024LL * 1024 * 1024 * 1024); TEST_CHECK(str::from("1P", &val) == -EINVAL); TEST_CHECK(str::from("abc", &val) == -EINVAL); } void test_str_from_int() { int val; TEST_CHECK(str::from("0", &val) == 0); TEST_CHECK(val == 0); TEST_CHECK(str::from("123", &val) == 0); TEST_CHECK(val == 123); TEST_CHECK(str::from("-456", &val) == 0); TEST_CHECK(val == -456); TEST_CHECK(str::from("1K", &val) == 0); TEST_CHECK(val == 1); TEST_CHECK(str::from("abc", &val) == -EINVAL); } void test_num_humanize() { TEST_CHECK(num::humanize(0) == "0"); TEST_CHECK(num::humanize(512) == "512"); TEST_CHECK(num::humanize(1024) == "1K"); TEST_CHECK(num::humanize(2048) == "2K"); TEST_CHECK(num::humanize(1024 * 1024) == "1M"); TEST_CHECK(num::humanize(2 * 1024 * 1024) == "2M"); TEST_CHECK(num::humanize(1024ULL * 1024 * 1024) == "1G"); TEST_CHECK(num::humanize(2ULL * 1024 * 1024 * 1024) == "2G"); TEST_CHECK(num::humanize(1024ULL * 1024 * 1024 * 1024) == "1T"); TEST_CHECK(num::humanize(2ULL * 1024 * 1024 * 1024 * 1024) == "2T"); TEST_CHECK(num::humanize(1536) == "1536"); TEST_CHECK(num::humanize(1025) == "1025"); } struct RmdirErr { private: std::optional _err; public: RmdirErr() {} operator int() { return (_err.has_value() ? _err.value() : -ENOENT); } RmdirErr& operator=(int v_) { if(!_err.has_value()) _err = ((v_ >= 0) ? 0 : v_); else if((v_ == -EEXIST) || (v_ == -ENOTEMPTY)) _err = v_; else if((*_err == -EEXIST) || (*_err == -ENOTEMPTY)) ; else if(v_ >= 0) _err = 0; else _err = v_; return *this; } bool operator==(int v_) { if(_err.has_value()) return (_err.value() == v_); return false; } }; void test_rmdir_err_default_is_enoent() { RmdirErr err; TEST_CHECK((int)err == -ENOENT); } void test_rmdir_err_first_success_sets_zero() { RmdirErr err; err = 0; TEST_CHECK((int)err == 0); } void test_rmdir_err_first_error_sets_value() { RmdirErr err; err = -EACCES; TEST_CHECK((int)err == -EACCES); } void test_rmdir_err_enotempty_overwrites_other() { RmdirErr err; err = -EACCES; err = -ENOTEMPTY; TEST_CHECK((int)err == -ENOTEMPTY); } void test_rmdir_err_eexist_overwrites_other() { RmdirErr err; err = -EACCES; err = -EEXIST; TEST_CHECK((int)err == -EEXIST); } void test_rmdir_err_enotempty_not_overwritten_by_other() { RmdirErr err; err = -ENOTEMPTY; err = -EACCES; TEST_CHECK((int)err == -ENOTEMPTY); } void test_rmdir_err_eexist_not_overwritten_by_other() { RmdirErr err; err = -EEXIST; err = -EACCES; TEST_CHECK((int)err == -EEXIST); } void test_rmdir_err_success_does_not_overwrite_priority() { RmdirErr err; err = -ENOTEMPTY; err = 0; TEST_CHECK((int)err == -ENOTEMPTY); RmdirErr err2; err2 = -EEXIST; err2 = 0; TEST_CHECK((int)err2 == -EEXIST); } void test_rmdir_err_success_overwrites_generic_error() { RmdirErr err; err = -EACCES; err = 0; TEST_CHECK((int)err == 0); } void test_rmdir_err_enotempty_overwrites_enotempty() { RmdirErr err; err = -ENOTEMPTY; err = -EEXIST; TEST_CHECK((int)err == -EEXIST); } void test_hashset_inline_to_heap_growth() { HashSet set; for(int i = 0; i < 20; ++i) { char buf[32]; snprintf(buf, sizeof(buf), "key_%d", i); TEST_CHECK(set.put(buf) == 1); } TEST_CHECK(set.size() == 20); for(int i = 0; i < 20; ++i) { char buf[32]; snprintf(buf, sizeof(buf), "key_%d", i); TEST_CHECK(set.put(buf) == 0); } TEST_CHECK(set.size() == 20); } void test_hashset_empty_string() { HashSet set; TEST_CHECK(set.put("") == 1); TEST_CHECK(set.put("") == 0); TEST_CHECK(set.size() == 1); } void test_hashset_many_items() { HashSet set; for(int i = 0; i < 100; ++i) { char buf[32]; snprintf(buf, sizeof(buf), "longer_key_name_%d", i); TEST_CHECK(set.put(buf) == 1); } TEST_CHECK(set.size() == 100); for(int i = 0; i < 100; ++i) { char buf[32]; snprintf(buf, sizeof(buf), "longer_key_name_%d", i); TEST_CHECK(set.put(buf) == 0); } TEST_CHECK(set.size() == 100); } void test_fs_inode_set_algo_valid() { const std::vector algos = { "passthrough", "path-hash", "path-hash32", "devino-hash", "devino-hash32", "hybrid-hash", "hybrid-hash32", }; for(const auto &algo : algos) { TEST_CHECK(fs::inode::set_algo(algo) == 0); TEST_CHECK(fs::inode::get_algo() == algo); } } void test_fs_inode_set_algo_invalid() { TEST_CHECK(fs::inode::set_algo("nope") == -EINVAL); TEST_CHECK(fs::inode::set_algo("") == -EINVAL); TEST_CHECK(fs::inode::set_algo("HYBRID-HASH") == -EINVAL); } void test_fs_inode_passthrough_returns_raw_ino() { TEST_CHECK(fs::inode::set_algo("passthrough") == 0); const fs::path branch("/mnt/disk1"); const fs::path fusepath("some/file"); TEST_CHECK(fs::inode::calc(branch, fusepath, S_IFREG, 42) == 42); TEST_CHECK(fs::inode::calc(branch, fusepath, S_IFDIR, 999) == 999); TEST_CHECK(fs::inode::calc(branch, fusepath, S_IFREG, 1) == 1); } void test_fs_inode_different_algos_produce_distinct_inodes() { const fs::path branch("/mnt/disk1"); const fs::path fusepath("some/file"); const std::vector algos = { "path-hash", "devino-hash", "hybrid-hash", }; std::vector inodes; for(const auto &algo : algos) { TEST_CHECK(fs::inode::set_algo(algo) == 0); inodes.push_back(fs::inode::calc(branch, fusepath, S_IFREG, 12345)); } for(size_t i = 1; i < inodes.size(); ++i) TEST_CHECK(inodes[i] != inodes[0]); } void test_rnd_rand64_basic() { u64 v1 = RND::rand64(); u64 v2 = RND::rand64(); TEST_CHECK(v1 != v2); } void test_rnd_rand64_max() { for(int i = 0; i < 1000; ++i) { u64 v = RND::rand64(100); TEST_CHECK(v < 100); } } void test_rnd_rand64_range() { for(int i = 0; i < 1000; ++i) { u64 v = RND::rand64(10, 50); TEST_CHECK(v >= 10); TEST_CHECK(v < 50); } } void test_rnd_shrink_to_rand_elem() { std::vector v = {1}; RND::shrink_to_rand_elem(v); TEST_CHECK(v.size() == 1); std::vector v2; RND::shrink_to_rand_elem(v2); TEST_CHECK(v2.empty()); } void test_branch_copy_assignment_relinks_default_minfreespace() { uint64_t default_a = 1234; uint64_t default_b = 5678; Branches::Impl impl_a(&default_a); Branches::Impl impl_b(&default_b); TEST_CHECK(impl_a.from_string("/a") == 0); TEST_CHECK(impl_b.from_string("/b") == 0); impl_a = impl_b; TEST_CHECK(impl_a.size() == 1); for(auto &branch : impl_a) { if(std::holds_alternative(branch._minfreespace)) TEST_CHECK(std::get(branch._minfreespace) == &default_a); } } void test_branch_move_assignment_relinks_default_minfreespace() { uint64_t default_a = 1234; uint64_t default_b = 5678; Branches::Impl impl_a(&default_a); Branches::Impl impl_b(&default_b); TEST_CHECK(impl_a.from_string("/a") == 0); TEST_CHECK(impl_b.from_string("/b") == 0); impl_a = std::move(impl_b); TEST_CHECK(impl_a.size() == 1); for(auto &branch : impl_a) { if(std::holds_alternative(branch._minfreespace)) TEST_CHECK(std::get(branch._minfreespace) == &default_a); } } void test_rapidhash_withSeed_preserves_default_output() { uint8_t buffer[192]; const uint64_t seeds[] = { 0, 1, 0x0123456789abcdefull, 0xffffffffffffffffull, 0xa0761d6478bd642full, }; for(size_t i = 0; i < sizeof(buffer); ++i) buffer[i] = (uint8_t)(((i * 131u) + 17u) & 0xffu); for(size_t offset = 0; offset < 16; ++offset) { const uint8_t *key = buffer + offset; for(size_t len = 0; len <= 160; ++len) { for(const uint64_t seed : seeds) { const uint64_t canonical = rapidhash_internal(key,len,seed,rapid_secret); TEST_CHECK(rapidhash_withSeed(key,len,seed) == canonical); if(len <= 48) TEST_CHECK(rapidhashNano_withSeed(key,len,seed) == canonical); if(len <= 80) TEST_CHECK(rapidhashMicro_withSeed(key,len,seed) == canonical); } } } } TEST_LIST = { {"nop",test_nop}, {"config_bool",test_config_bool}, {"config_uint64",test_config_uint64}, {"config_int",test_config_int}, {"config_str",test_config_str}, {"hashset_put_and_size",test_hashset_put_and_size}, {"rapidhash_withSeed_preserves_default_output",test_rapidhash_withSeed_preserves_default_output}, {"config_branches",test_config_branches}, {"branch_default_ctor_mode",test_branch_default_ctor_mode}, {"branch_to_string_modes",test_branch_to_string_modes}, {"branch_to_string_with_minfreespace",test_branch_to_string_with_minfreespace}, {"branch_mode_predicates",test_branch_mode_predicates}, {"branch_minfreespace_pointer_vs_value",test_branch_minfreespace_pointer_vs_value}, {"branch_copy_constructor",test_branch_copy_constructor}, {"branch_copy_assignment",test_branch_copy_assignment}, {"branches_default_minfreespace",test_branches_default_minfreespace}, {"branches_per_branch_minfreespace_overrides_default",test_branches_per_branch_minfreespace_overrides_default}, {"branches_add_end_operator",test_branches_add_end_operator}, {"branches_add_begin_operator",test_branches_add_begin_operator}, {"branches_set_operator",test_branches_set_operator}, {"branches_erase_end_operator",test_branches_erase_end_operator}, {"branches_erase_begin_operator",test_branches_erase_begin_operator}, {"branches_erase_fnmatch_operator",test_branches_erase_fnmatch_operator}, {"branches_erase_fnmatch_multiple_patterns",test_branches_erase_fnmatch_multiple_patterns}, {"branches_invalid_mode",test_branches_invalid_mode}, {"branches_invalid_minfreespace",test_branches_invalid_minfreespace}, {"branches_to_paths",test_branches_to_paths}, {"branches_cow_semantics",test_branches_cow_semantics}, {"branches_mode_round_trip",test_branches_mode_round_trip}, {"branches_srcmounts_to_string",test_branches_srcmounts_to_string}, {"branches_srcmounts_empty",test_branches_srcmounts_empty}, {"branch_to_string_1t",test_branch_to_string_1t}, {"branch_to_string_non_exact_multiple",test_branch_to_string_non_exact_multiple}, {"branch_to_string_zero_owned_minfreespace",test_branch_to_string_zero_owned_minfreespace}, {"branch_copy_pointer_aliasing",test_branch_copy_pointer_aliasing}, {"branches_mode_case_sensitivity",test_branches_mode_case_sensitivity}, {"branches_minfreespace_lowercase_suffixes",test_branches_minfreespace_lowercase_suffixes}, {"branches_minfreespace_bytes_suffix",test_branches_minfreespace_bytes_suffix}, {"branches_minfreespace_zero",test_branches_minfreespace_zero}, {"branches_minfreespace_negative_invalid",test_branches_minfreespace_negative_invalid}, {"branches_minfreespace_overflow",test_branches_minfreespace_overflow}, {"branches_minfreespace_round_trip",test_branches_minfreespace_round_trip}, {"branches_minfreespace_round_trip_1t",test_branches_minfreespace_round_trip_1t}, {"branches_clear_with_equals_alone",test_branches_clear_with_equals_alone}, {"branches_empty_string_clears_same_as_equals",test_branches_empty_string_clears_same_as_equals}, {"branches_plus_and_plus_greater_equivalent",test_branches_plus_and_plus_greater_equivalent}, {"branches_unknown_instruction_einval",test_branches_unknown_instruction_einval}, {"branches_empty_options_after_equals_einval",test_branches_empty_options_after_equals_einval}, {"branches_path_with_equals_in_name",test_branches_path_with_equals_in_name}, {"branches_add_end_multiple_paths",test_branches_add_end_multiple_paths}, {"branches_add_begin_multiple_paths",test_branches_add_begin_multiple_paths}, {"branches_erase_empty_pattern_noop",test_branches_erase_empty_pattern_noop}, {"branches_erase_wildcard_removes_all",test_branches_erase_wildcard_removes_all}, {"branches_erase_nonmatching_pattern_noop",test_branches_erase_nonmatching_pattern_noop}, {"branches_erase_multi_pattern_first_miss_second_hit",test_branches_erase_multi_pattern_first_miss_second_hit}, {"branches_erase_end_single_element",test_branches_erase_end_single_element}, {"branches_erase_begin_single_element",test_branches_erase_begin_single_element}, {"branches_erase_end_empty_returns_enoent",test_branches_erase_end_empty_returns_enoent}, {"branches_erase_begin_empty_returns_enoent",test_branches_erase_begin_empty_returns_enoent}, {"branches_clear_then_add",test_branches_clear_then_add}, {"branches_add_begin_then_end_then_erase_both",test_branches_add_begin_then_end_then_erase_both}, {"branches_error_in_multipath_add_leaves_list_unchanged",test_branches_error_in_multipath_add_leaves_list_unchanged}, {"branches_error_in_set_leaves_list_unchanged",test_branches_error_in_set_leaves_list_unchanged}, {"branches_global_minfreespace_live_tracking",test_branches_global_minfreespace_live_tracking}, {"branches_srcmounts_from_string_noop",test_branches_srcmounts_from_string_noop}, {"branches_srcmounts_reflects_mutations",test_branches_srcmounts_reflects_mutations}, {"config_cachefiles",test_config_cachefiles}, {"config_inodecalc",test_config_inodecalc}, {"fs_inode_readdir_calc_matches_calc",test_fs_inode_readdir_calc_matches_calc}, {"config_moveonenospc",test_config_moveonenospc}, {"config_nfsopenhack",test_config_nfsopenhack}, {"config_readdir",test_config_readdir}, {"config_statfs",test_config_statfs}, {"config_statfsignore",test_config_statfs_ignore}, {"config_xattr",test_config_xattr}, {"config",test_config}, {"config_has_key",test_config_has_key}, {"config_keys",test_config_keys}, {"config_keys_xattr",test_config_keys_xattr}, {"config_keys_listxattr_size",test_config_keys_listxattr_size}, {"config_keys_listxattr_fill",test_config_keys_listxattr_fill}, {"config_keys_listxattr_erange",test_config_keys_listxattr_erange}, {"config_get_set_roundtrip",test_config_get_set_roundtrip}, {"config_get_unknown_key",test_config_get_unknown_key}, {"config_set_unknown_key",test_config_set_unknown_key}, {"config_set_invalid_value",test_config_set_invalid_value}, {"config_set_underscore_normalization",test_config_set_underscore_normalization}, {"config_get_underscore_normalization",test_config_get_underscore_normalization}, {"config_set_kv_form",test_config_set_kv_form}, {"config_remember_nodes_bool_numeric",test_config_remember_nodes_bool_numeric}, {"config_readonly_before_init",test_config_readonly_before_init}, {"config_readonly_after_init",test_config_readonly_after_init}, {"config_mutable_after_init",test_config_mutable_after_init}, {"config_from_stream_basic",test_config_from_stream_basic}, {"config_from_stream_comments_and_blanks",test_config_from_stream_comments_and_blanks}, {"config_from_stream_bad_lines",test_config_from_stream_bad_lines}, {"config_from_file_nonexistent",test_config_from_file_nonexistent}, {"config_is_rootdir",test_config_is_rootdir}, {"config_is_ctrl_file",test_config_is_ctrl_file}, {"config_is_mergerfs_xattr",test_config_is_mergerfs_xattr}, {"config_is_cmd_xattr",test_config_is_cmd_xattr}, {"config_prune_ctrl_xattr",test_config_prune_ctrl_xattr}, {"config_prune_cmd_xattr",test_config_prune_cmd_xattr}, {"fs_copyfile_basic",test_fs_copyfile_basic}, {"fs_copyfile_source_changes_cleanup_tmpfiles",test_fs_copyfile_source_changes_cleanup_tmpfiles}, {"str_eq_nullptr",test_str_eq_nullptr}, {"str_startswith_char_nullptr",test_str_startswith_char_nullptr}, {"str_from_u64_suffixes",test_str_from_u64_suffixes}, {"str_from_s64",test_str_from_s64}, {"str_from_int",test_str_from_int}, {"num_humanize",test_num_humanize}, {"rmdir_err_default_is_enoent",test_rmdir_err_default_is_enoent}, {"rmdir_err_first_success_sets_zero",test_rmdir_err_first_success_sets_zero}, {"rmdir_err_first_error_sets_value",test_rmdir_err_first_error_sets_value}, {"rmdir_err_enotempty_overwrites_other",test_rmdir_err_enotempty_overwrites_other}, {"rmdir_err_eexist_overwrites_other",test_rmdir_err_eexist_overwrites_other}, {"rmdir_err_enotempty_not_overwritten_by_other",test_rmdir_err_enotempty_not_overwritten_by_other}, {"rmdir_err_eexist_not_overwritten_by_other",test_rmdir_err_eexist_not_overwritten_by_other}, {"rmdir_err_success_does_not_overwrite_priority",test_rmdir_err_success_does_not_overwrite_priority}, {"rmdir_err_success_overwrites_generic_error",test_rmdir_err_success_overwrites_generic_error}, {"rmdir_err_enotempty_overwrites_enotempty",test_rmdir_err_enotempty_overwrites_enotempty}, {"hashset_inline_to_heap_growth",test_hashset_inline_to_heap_growth}, {"hashset_empty_string",test_hashset_empty_string}, {"hashset_many_items",test_hashset_many_items}, {"fs_inode_set_algo_valid",test_fs_inode_set_algo_valid}, {"fs_inode_set_algo_invalid",test_fs_inode_set_algo_invalid}, {"fs_inode_passthrough_returns_raw_ino",test_fs_inode_passthrough_returns_raw_ino}, {"fs_inode_different_algos_produce_distinct_inodes",test_fs_inode_different_algos_produce_distinct_inodes}, {"rnd_rand64_basic",test_rnd_rand64_basic}, {"rnd_rand64_max",test_rnd_rand64_max}, {"rnd_rand64_range",test_rnd_rand64_range}, {"rnd_shrink_to_rand_elem",test_rnd_shrink_to_rand_elem}, {"branch_copy_assignment_relinks_default_minfreespace",test_branch_copy_assignment_relinks_default_minfreespace}, {"branch_move_assignment_relinks_default_minfreespace",test_branch_move_assignment_relinks_default_minfreespace}, {"str",test_str_stuff}, {"tp_construct_default",test_tp_construct_default}, {"tp_construct_named",test_tp_construct_named}, {"tp_construct_zero_threads_throws",test_tp_construct_zero_threads_throws}, {"tp_enqueue_work",test_tp_enqueue_work}, {"tp_enqueue_work_with_ptoken",test_tp_enqueue_work_with_ptoken}, {"tp_try_enqueue_work",test_tp_try_enqueue_work}, {"tp_try_enqueue_work_with_ptoken",test_tp_try_enqueue_work_with_ptoken}, {"tp_try_enqueue_work_for",test_tp_try_enqueue_work_for}, {"tp_try_enqueue_work_for_with_ptoken",test_tp_try_enqueue_work_for_with_ptoken}, {"tp_enqueue_task_int",test_tp_enqueue_task_int}, {"tp_enqueue_task_void",test_tp_enqueue_task_void}, {"tp_enqueue_task_string",test_tp_enqueue_task_string}, {"tp_enqueue_task_exception",test_tp_enqueue_task_exception}, {"tp_enqueue_task_multiple",test_tp_enqueue_task_multiple}, {"tp_threads_returns_correct_count",test_tp_threads_returns_correct_count}, {"tp_threads_unique_ids",test_tp_threads_unique_ids}, {"tp_add_thread",test_tp_add_thread}, {"tp_remove_thread",test_tp_remove_thread}, {"tp_remove_thread_refuses_last",test_tp_remove_thread_refuses_last}, {"tp_set_threads_grow",test_tp_set_threads_grow}, {"tp_set_threads_shrink",test_tp_set_threads_shrink}, {"tp_set_threads_zero",test_tp_set_threads_zero}, {"tp_set_threads_same",test_tp_set_threads_same}, {"tp_work_after_add_thread",test_tp_work_after_add_thread}, {"tp_work_after_remove_thread",test_tp_work_after_remove_thread}, {"tp_worker_exception_no_crash",test_tp_worker_exception_no_crash}, {"tp_concurrent_enqueue",test_tp_concurrent_enqueue}, {"tp_ptoken_creation",test_tp_ptoken_creation}, {"tp_destruction_drains_queue",test_tp_destruction_drains_queue}, {"tp_move_only_callable",test_tp_move_only_callable}, {"tp_work_ordering_single_thread",test_tp_work_ordering_single_thread}, {"tp_try_enqueue_work_fails_when_full",test_tp_try_enqueue_work_fails_when_full}, {"tp_try_enqueue_work_for_times_out_when_full",test_tp_try_enqueue_work_for_times_out_when_full}, {"tp_enqueue_work_blocks_until_slot_available",test_tp_enqueue_work_blocks_until_slot_available}, {"tp_worker_nonstd_exception_no_crash",test_tp_worker_nonstd_exception_no_crash}, {"tp_remove_thread_under_load",test_tp_remove_thread_under_load}, {"tp_set_threads_concurrent_with_enqueue",test_tp_set_threads_concurrent_with_enqueue}, {"tp_repeated_resize_stress",test_tp_repeated_resize_stress}, {"tp_many_producers_many_tasks_stress",test_tp_many_producers_many_tasks_stress}, {"tp_heavy_mixed_resize_and_enqueue_stress",test_tp_heavy_mixed_resize_and_enqueue_stress}, {"tp_heavy_try_enqueue_pressure",test_tp_heavy_try_enqueue_pressure}, {"tp_heavy_repeated_construct_destroy",test_tp_heavy_repeated_construct_destroy}, {"tp_heavy_enqueue_task_mixed_outcomes",test_tp_heavy_enqueue_task_mixed_outcomes}, {"tp_heavy_add_remove_churn_under_enqueue",test_tp_heavy_add_remove_churn_under_enqueue}, {NULL,NULL} }; mergerfs-2.42.0/tools/0000755000000000000000000000000015177346257013270 5ustar rootrootmergerfs-2.42.0/tools/mergerfs.percent-full-mover0000755000000000000000000000156715177346257020566 0ustar rootroot#!/usr/bin/env sh if [ $# != 3 ]; then echo "usage: $0 " exit 1 fi CACHEFS="${1}" BASEPOOL="${2}" PERCENTAGE="${3}" set -o errexit while [ $(df "${CACHEFS}" | tail -n1 | awk '{print $5}' | cut -d'%' -f1) -gt ${PERCENTAGE} ] do # Find the file with the oldest access time FILE=$(find "${CACHEFS}" -type f -printf '%A@ %P\n' | \ sort | \ head -n 1 | \ cut -d' ' -f2-) # If no file found, exit test -n "${FILE}" || exit 0 # Move file rsync \ --archive \ --acls \ --xattrs \ --atimes \ --hard-links \ --one-file-system \ --quiet \ --preallocate \ --remove-source-files \ --relative \ --log-file=/tmp/mergerfs-cache-rsync.log \ "${CACHEFS}/./${FILE}" \ "${BASEPOOL}/" done mergerfs-2.42.0/tools/mergerfs.time-based-mover0000755000000000000000000000105415177346257020167 0ustar rootroot#!/usr/bin/env sh if [ $# != 3 ]; then echo "usage: $0 " exit 1 fi CACHEFS="${1}" BASEPOOL="${2}" DAYS_OLD=${3} find "${CACHEFS}" -type f -atime +${DAYS_OLD} -printf '%P\n' | \ rsync \ --files-from=- \ --archive \ --acls \ --xattrs \ --atimes \ --hard-links \ --one-file-system \ --quiet \ --preallocate \ --remove-source-files \ --log-file=/tmp/mergerfs-cache-rsync.log \ "${CACHEFS}/" \ "${BASEPOOL}/" mergerfs-2.42.0/tools/preload.c0000644000000000000000000002123115177346257015061 0ustar rootroot/* ISC License Copyright (c) 2025, Antonio SJ Musumeci Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #ifdef __FreeBSD__ #define O_TMPFILE 0 #else #define _GNU_SOURCE //#define _POSIX_C_SOURCE 200809L #endif #include #include #include #include #include #include #include #include #include #include #ifdef __FreeBSD__ #include #else #include #endif #include typedef char IOCTL_BUF[4096]; #define IOCTL_APP_TYPE 0xDF #define IOCTL_FILE_INFO _IOWR(IOCTL_APP_TYPE,0,IOCTL_BUF) #define LOAD_FUNC(func) \ do \ { \ if(!_libc_##func) \ _libc_##func = (func##_func_t)dlsym(RTLD_NEXT,#func); \ assert(_libc_##func != NULL); \ } \ while(0) typedef int (*open_func_t)(const char*, int, ...); typedef int (*open64_func_t)(const char*, int, ...); typedef int (*openat_func_t)(int, const char*, int, ...); typedef int (*openat64_func_t)(int, const char*, int, ...); typedef int (*creat_func_t)(const char*, mode_t); typedef int (*creat64_func_t)(const char*, mode_t); typedef FILE* (*fopen_func_t)(const char*, const char*); typedef FILE* (*fopen64_func_t)(const char*, const char*); static open_func_t _libc_open = NULL; static open64_func_t _libc_open64 = NULL; static openat_func_t _libc_openat = NULL; static openat64_func_t _libc_openat64 = NULL; static fopen_func_t _libc_fopen = NULL; static fopen64_func_t _libc_fopen64 = NULL; static creat_func_t _libc_creat = NULL; static creat64_func_t _libc_creat64 = NULL; static int get_underlying_filepath(int fd_, char *filepath_, size_t filepath_size_) { int rv; rv = fgetxattr(fd_,"user.mergerfs.fullpath",filepath_,filepath_size_); if(rv == -1) return -1; return rv; } static void strip_exec(const char *orig_mode_, char *new_mode_) { size_t i; size_t j; for(i = j = 0; orig_mode_[i]; i++) { if(orig_mode_[i] == 'x') continue; new_mode_[j++] = orig_mode_[i]; } new_mode_[j] = '\0'; } #ifndef _FILE_OFFSET_BITS int open(const char *pathname_, int flags_, ...) { int rv; int fd; mode_t mode; struct stat st; LOAD_FUNC(open); mode = 0; if(flags_ & (O_CREAT|O_TMPFILE)) { va_list args; va_start(args,flags_); mode = va_arg(args,mode_t); va_end(args); } fd = _libc_open(pathname_,flags_,mode); if(fd == -1) return -1; if(flags_ & (O_DIRECTORY|O_PATH|O_TMPFILE)) return fd; rv = fstat(fd,&st); if(rv == -1) return fd; if((st.st_mode & S_IFMT) != S_IFREG) return fd; char real_pathname[PATH_MAX]; rv = get_underlying_filepath(fd,real_pathname,sizeof(real_pathname)); if(rv == -1) return fd; flags_ &= ~(O_EXCL|O_CREAT); rv = _libc_open(real_pathname,flags_,mode); if(rv == -1) return fd; close(fd); return rv; } #endif int open64(const char *pathname_, int flags_, ...) { int rv; int fd; mode_t mode; struct stat st; LOAD_FUNC(open64); mode = 0; if(flags_ & (O_CREAT|O_TMPFILE)) { va_list args; va_start(args,flags_); mode = va_arg(args,mode_t); va_end(args); } fd = _libc_open64(pathname_,flags_,mode); if(fd == -1) return -1; if(flags_ & (O_DIRECTORY|O_PATH|O_TMPFILE)) return fd; rv = fstat(fd,&st); if(rv == -1) return fd; if((st.st_mode & S_IFMT) != S_IFREG) return fd; char real_pathname[PATH_MAX]; rv = get_underlying_filepath(fd,real_pathname,sizeof(real_pathname)); if(rv == -1) return fd; flags_ &= ~(O_EXCL|O_CREAT); rv = _libc_open64(real_pathname,flags_,mode); if(rv == -1) return fd; close(fd); return rv; } #ifndef _FILE_OFFSET_BITS int openat(int dirfd_, const char *pathname_, int flags_, ...) { int rv; int fd; mode_t mode; struct stat st; LOAD_FUNC(openat); mode = 0; if(flags_ & (O_CREAT|O_TMPFILE)) { va_list args; va_start(args,flags_); mode = va_arg(args,mode_t); va_end(args); } fd = _libc_openat(dirfd_,pathname_,flags_,mode); if(fd == -1) return -1; if(flags_ & (O_DIRECTORY|O_PATH|O_TMPFILE)) return fd; rv = fstat(fd,&st); if(rv == -1) return fd; if((st.st_mode & S_IFMT) != S_IFREG) return fd; char real_pathname[PATH_MAX]; rv = get_underlying_filepath(fd,real_pathname,sizeof(real_pathname)); if(rv == -1) return fd; flags_ &= ~(O_EXCL|O_CREAT); rv = _libc_openat(dirfd_,real_pathname,flags_,mode); if(rv == -1) return fd; close(fd); return rv; } #endif int openat64(int dirfd_, const char *pathname_, int flags_, ...) { int rv; int fd; mode_t mode; struct stat st; LOAD_FUNC(openat64); mode = 0; if(flags_ & (O_CREAT|O_TMPFILE)) { va_list args; va_start(args,flags_); mode = va_arg(args,mode_t); va_end(args); } fd = _libc_openat64(dirfd_,pathname_,flags_,mode); if(fd == -1) return -1; if(flags_ & (O_DIRECTORY|O_PATH|O_TMPFILE)) return fd; rv = fstat(fd,&st); if(rv == -1) return fd; if((st.st_mode & S_IFMT) != S_IFREG) return fd; char real_pathname[PATH_MAX]; rv = get_underlying_filepath(fd,real_pathname,sizeof(real_pathname)); if(rv == -1) return fd; flags_ &= ~(O_EXCL|O_CREAT); rv = _libc_openat64(dirfd_,real_pathname,flags_,mode); if(rv == -1) return fd; close(fd); return rv; } #ifndef _FILE_OFFSET_BITS FILE* fopen(const char *pathname_, const char *mode_) { int fd; int rv; FILE *f; FILE *f2; struct stat st; LOAD_FUNC(fopen); f = _libc_fopen(pathname_,mode_); if(f == NULL) return NULL; fd = fileno(f); if(fd == -1) return f; rv = fstat(fd,&st); if(rv == -1) return f; if((st.st_mode & S_IFMT) != S_IFREG) return f; char real_pathname[PATH_MAX]; rv = get_underlying_filepath(fd,real_pathname,sizeof(real_pathname)); if(rv == -1) return f; char new_mode[64]; strip_exec(mode_,new_mode); f2 = _libc_fopen(real_pathname,new_mode); if(f2 == NULL) return f; fclose(f); return f2; } #endif FILE* fopen64(const char *pathname_, const char *mode_) { int fd; int rv; FILE *f; FILE *f2; struct stat st; LOAD_FUNC(fopen64); f = _libc_fopen64(pathname_,mode_); if(f == NULL) return NULL; fd = fileno(f); if(fd == -1) return f; rv = fstat(fd,&st); if(rv == -1) return f; if((st.st_mode & S_IFMT) != S_IFREG) return f; char real_pathname[PATH_MAX]; rv = get_underlying_filepath(fd,real_pathname,sizeof(real_pathname)); if(rv == -1) return f; char new_mode[64]; strip_exec(mode_,new_mode); f2 = _libc_fopen64(real_pathname,new_mode); if(f2 == NULL) return f; fclose(f); return f2; } #ifndef _FILE_OFFSET_BITS int creat(const char *pathname_, mode_t mode_) { int fd; int rv; LOAD_FUNC(creat); fd = _libc_creat(pathname_,mode_); if(fd == -1) return -1; char real_pathname[PATH_MAX]; rv = get_underlying_filepath(fd,real_pathname,sizeof(real_pathname)); if(rv == -1) return fd; rv = _libc_creat(real_pathname,mode_); if(rv == -1) return fd; close(fd); return rv; } #endif int creat64(const char *pathname_, mode_t mode_) { int fd; int rv; LOAD_FUNC(creat64); fd = _libc_creat64(pathname_,mode_); if(fd == -1) return -1; char real_pathname[PATH_MAX]; rv = get_underlying_filepath(fd,real_pathname,sizeof(real_pathname)); if(rv == -1) return fd; rv = _libc_creat64(real_pathname,mode_); if(rv == -1) return fd; close(fd); return rv; } mergerfs-2.42.0/vendored/0000755000000000000000000000000015177346257013736 5ustar rootrootmergerfs-2.42.0/vendored/CLI11/0000755000000000000000000000000015177346257014507 5ustar rootrootmergerfs-2.42.0/vendored/CLI11/CLI11.hpp0000644000000000000000000163526715177346257016015 0ustar rootroot// CLI11: Version 2.6.2 // Originally designed by Henry Schreiner // https://github.com/CLIUtils/CLI11 // // This is a standalone header file generated by MakeSingleHeader.py in CLI11/scripts // from: v2.6.2 // // CLI11 2.6.2 Copyright (c) 2017-2026 University of Cincinnati, developed by Henry // Schreiner under NSF AWARD 1414736. All rights reserved. // // Redistribution and use in source and binary forms of CLI11, with or without // modification, are permitted provided that the following conditions are met: // // 1. Redistributions of source code must retain the above copyright notice, this // list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright notice, // this list of conditions and the following disclaimer in the documentation // and/or other materials provided with the distribution. // 3. Neither the name of the copyright holder nor the names of its contributors // may be used to endorse or promote products derived from this software without // specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON // ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #pragma once // Standard combined includes: #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define CLI11_VERSION_MAJOR 2 #define CLI11_VERSION_MINOR 6 #define CLI11_VERSION_PATCH 2 #define CLI11_VERSION "2.6.2" // The following version macro is very similar to the one in pybind11 #if !(defined(_MSC_VER) && __cplusplus == 199711L) && !defined(__INTEL_COMPILER) #if __cplusplus >= 201402L #define CLI11_CPP14 #if __cplusplus >= 201703L #define CLI11_CPP17 #if __cplusplus > 201703L #define CLI11_CPP20 #if __cplusplus > 202002L #define CLI11_CPP23 #if __cplusplus > 202302L #define CLI11_CPP26 #endif #endif #endif #endif #endif #elif defined(_MSC_VER) && __cplusplus == 199711L // MSVC sets _MSVC_LANG rather than __cplusplus (supposedly until the standard was fully implemented) // Unless you use the /Zc:__cplusplus flag on Visual Studio 2017 15.7 Preview 3 or newer #if _MSVC_LANG >= 201402L #define CLI11_CPP14 #if _MSVC_LANG > 201402L && _MSC_VER >= 1910 #define CLI11_CPP17 #if _MSVC_LANG > 201703L && _MSC_VER >= 1910 #define CLI11_CPP20 #if _MSVC_LANG > 202002L && _MSC_VER >= 1922 #define CLI11_CPP23 #endif #endif #endif #endif #endif #if defined(CLI11_CPP14) #define CLI11_DEPRECATED(reason) [[deprecated(reason)]] #elif defined(_MSC_VER) #define CLI11_DEPRECATED(reason) __declspec(deprecated(reason)) #else #define CLI11_DEPRECATED(reason) __attribute__((deprecated(reason))) #endif // GCC < 10 doesn't ignore this in unevaluated contexts #if !defined(CLI11_CPP17) || \ (defined(__GNUC__) && !defined(__llvm__) && !defined(__INTEL_COMPILER) && __GNUC__ < 10 && __GNUC__ > 4) #define CLI11_NODISCARD #else #define CLI11_NODISCARD [[nodiscard]] #endif /** detection of rtti */ #ifndef CLI11_USE_STATIC_RTTI #if (defined(_HAS_STATIC_RTTI) && _HAS_STATIC_RTTI) #define CLI11_USE_STATIC_RTTI 1 #elif defined(__cpp_rtti) #if (defined(_CPPRTTI) && _CPPRTTI == 0) #define CLI11_USE_STATIC_RTTI 1 #else #define CLI11_USE_STATIC_RTTI 0 #endif #elif (defined(__GCC_RTTI) && __GXX_RTTI) #define CLI11_USE_STATIC_RTTI 0 #else #define CLI11_USE_STATIC_RTTI 1 #endif #endif /** availability */ #if defined CLI11_CPP17 && defined __has_include && !defined CLI11_HAS_FILESYSTEM #if __has_include() // Filesystem cannot be used if targeting macOS < 10.15 #if defined __MAC_OS_X_VERSION_MIN_REQUIRED && __MAC_OS_X_VERSION_MIN_REQUIRED < 101500 #define CLI11_HAS_FILESYSTEM 0 #elif defined(__wasi__) // As of wasi-sdk-14, filesystem is not implemented #define CLI11_HAS_FILESYSTEM 0 #else #include #if defined __cpp_lib_filesystem && __cpp_lib_filesystem >= 201703 #if defined _GLIBCXX_RELEASE && _GLIBCXX_RELEASE >= 9 #define CLI11_HAS_FILESYSTEM 1 #elif defined(__GLIBCXX__) // if we are using gcc and Version <9 default to no filesystem #define CLI11_HAS_FILESYSTEM 0 #else #define CLI11_HAS_FILESYSTEM 1 #endif #else #define CLI11_HAS_FILESYSTEM 0 #endif #endif #endif #endif /** availability */ #if !defined(CLI11_CPP26) && !defined(CLI11_HAS_CODECVT) #if defined(__GNUC__) && !defined(__llvm__) && !defined(__INTEL_COMPILER) && __GNUC__ < 5 #define CLI11_HAS_CODECVT 0 #else #define CLI11_HAS_CODECVT 1 #include #endif #else #if defined(CLI11_HAS_CODECVT) #if CLI11_HAS_CODECVT > 0 #include #endif #else #define CLI11_HAS_CODECVT 0 #endif #endif /** rtti enabled */ #ifndef CLI11_HAS_RTTI #if defined(__GXX_RTTI) && __GXX_RTTI == 1 // gcc #define CLI11_HAS_RTTI 1 #elif defined(_CPPRTTI) && _CPPRTTI == 1 // msvc #define CLI11_HAS_RTTI 1 #elif defined(__NO_RTTI__) && __NO_RTTI__ == 1 // intel #define CLI11_HAS_RTTI 0 #elif defined(__has_feature) // clang and other newer compilers #if __has_feature(cxx_rtti) #define CLI11_HAS_RTTI 1 #else #define CLI11_HAS_RTTI 0 #endif #elif defined(__RTTI) || defined(__INTEL_RTTI__) // more intel and some other compilers #define CLI11_HAS_RTTI 1 #else #define CLI11_HAS_RTTI 0 #endif #endif /** disable deprecations */ #if defined(__GNUC__) // GCC or clang #define CLI11_DIAGNOSTIC_PUSH _Pragma("GCC diagnostic push") #define CLI11_DIAGNOSTIC_POP _Pragma("GCC diagnostic pop") #define CLI11_DIAGNOSTIC_IGNORE_DEPRECATED _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") #elif defined(_MSC_VER) #define CLI11_DIAGNOSTIC_PUSH __pragma(warning(push)) #define CLI11_DIAGNOSTIC_POP __pragma(warning(pop)) #define CLI11_DIAGNOSTIC_IGNORE_DEPRECATED __pragma(warning(disable : 4996)) #else #define CLI11_DIAGNOSTIC_PUSH #define CLI11_DIAGNOSTIC_POP #define CLI11_DIAGNOSTIC_IGNORE_DEPRECATED #endif /** Inline macro **/ #ifdef CLI11_COMPILE #define CLI11_INLINE #else #define CLI11_INLINE inline #endif /** Module inline to support module operations**/ #if defined CLI11_CPP17 #define CLI11_MODULE_INLINE inline #else #define CLI11_MODULE_INLINE static #endif #if defined CLI11_HAS_FILESYSTEM && CLI11_HAS_FILESYSTEM > 0 #include // NOLINT(build/include) #else #include #include #endif #ifdef CLI11_CPP17 #include #endif // CLI11_CPP17 #if defined CLI11_HAS_FILESYSTEM && CLI11_HAS_FILESYSTEM > 0 #include #include // NOLINT(build/include) #endif // CLI11_HAS_FILESYSTEM #if defined(_WIN32) #if !(defined(_AMD64_) || defined(_X86_) || defined(_ARM_)) #if defined(__amd64__) || defined(__amd64) || defined(__x86_64__) || defined(__x86_64) || defined(_M_X64) || \ defined(_M_AMD64) #define _AMD64_ #elif defined(i386) || defined(__i386) || defined(__i386__) || defined(__i386__) || defined(_M_IX86) #define _X86_ #elif defined(__arm__) || defined(_M_ARM) || defined(_M_ARMT) #define _ARM_ #elif defined(__aarch64__) || defined(_M_ARM64) #define _ARM64_ #elif defined(_M_ARM64EC) #define _ARM64EC_ #endif #endif // first #ifndef NOMINMAX // if NOMINMAX is already defined we don't want to mess with that either way #define NOMINMAX #include #undef NOMINMAX #else #include #endif // second #include // third #include #include #endif namespace CLI { /// Convert a wide string to a narrow string. CLI11_INLINE std::string narrow(const std::wstring &str); CLI11_INLINE std::string narrow(const wchar_t *str); CLI11_INLINE std::string narrow(const wchar_t *str, std::size_t size); /// Convert a narrow string to a wide string. CLI11_INLINE std::wstring widen(const std::string &str); CLI11_INLINE std::wstring widen(const char *str); CLI11_INLINE std::wstring widen(const char *str, std::size_t size); #ifdef CLI11_CPP17 CLI11_INLINE std::string narrow(std::wstring_view str); CLI11_INLINE std::wstring widen(std::string_view str); #endif // CLI11_CPP17 #if defined CLI11_HAS_FILESYSTEM && CLI11_HAS_FILESYSTEM > 0 /// Convert a char-string to a native path correctly. CLI11_INLINE std::filesystem::path to_path(std::string_view str); #endif // CLI11_HAS_FILESYSTEM namespace detail { #if !CLI11_HAS_CODECVT /// Attempt to set one of the acceptable unicode locales for conversion CLI11_INLINE void set_unicode_locale() { static const std::array unicode_locales{{"C.UTF-8", "en_US.UTF-8", ".UTF-8"}}; for(const auto &locale_name : unicode_locales) { if(std::setlocale(LC_ALL, locale_name) != nullptr) { return; } } throw std::runtime_error("CLI::narrow: could not set locale to C.UTF-8"); } template struct scope_guard_t { F closure; explicit scope_guard_t(F closure_) : closure(closure_) {} ~scope_guard_t() { closure(); } }; template CLI11_NODISCARD CLI11_INLINE scope_guard_t scope_guard(F &&closure) { return scope_guard_t{std::forward(closure)}; } #endif // !CLI11_HAS_CODECVT CLI11_DIAGNOSTIC_PUSH CLI11_DIAGNOSTIC_IGNORE_DEPRECATED CLI11_INLINE std::string narrow_impl(const wchar_t *str, std::size_t str_size) { #if CLI11_HAS_CODECVT #ifdef _WIN32 return std::wstring_convert>().to_bytes(str, str + str_size); #else return std::wstring_convert>().to_bytes(str, str + str_size); #endif // _WIN32 #else // CLI11_HAS_CODECVT (void)str_size; std::mbstate_t state = std::mbstate_t(); const wchar_t *it = str; std::string old_locale = std::setlocale(LC_ALL, nullptr); auto sg = scope_guard([&] { std::setlocale(LC_ALL, old_locale.c_str()); }); set_unicode_locale(); std::size_t new_size = std::wcsrtombs(nullptr, &it, 0, &state); if(new_size == static_cast(-1)) { throw std::runtime_error("CLI::narrow: conversion error in std::wcsrtombs at offset " + std::to_string(it - str)); } std::string result(new_size, '\0'); std::wcsrtombs(const_cast(result.data()), &str, new_size, &state); return result; #endif // CLI11_HAS_CODECVT } CLI11_INLINE std::wstring widen_impl(const char *str, std::size_t str_size) { #if CLI11_HAS_CODECVT #ifdef _WIN32 return std::wstring_convert>().from_bytes(str, str + str_size); #else return std::wstring_convert>().from_bytes(str, str + str_size); #endif // _WIN32 #else // CLI11_HAS_CODECVT (void)str_size; std::mbstate_t state = std::mbstate_t(); const char *it = str; std::string old_locale = std::setlocale(LC_ALL, nullptr); auto sg = scope_guard([&] { std::setlocale(LC_ALL, old_locale.c_str()); }); set_unicode_locale(); std::size_t new_size = std::mbsrtowcs(nullptr, &it, 0, &state); if(new_size == static_cast(-1)) { throw std::runtime_error("CLI::widen: conversion error in std::mbsrtowcs at offset " + std::to_string(it - str)); } std::wstring result(new_size, L'\0'); std::mbsrtowcs(const_cast(result.data()), &str, new_size, &state); return result; #endif // CLI11_HAS_CODECVT } CLI11_DIAGNOSTIC_POP } // namespace detail CLI11_INLINE std::string narrow(const wchar_t *str, std::size_t str_size) { return detail::narrow_impl(str, str_size); } CLI11_INLINE std::string narrow(const std::wstring &str) { return detail::narrow_impl(str.data(), str.size()); } // Flawfinder: ignore CLI11_INLINE std::string narrow(const wchar_t *str) { return detail::narrow_impl(str, std::wcslen(str)); } CLI11_INLINE std::wstring widen(const char *str, std::size_t str_size) { return detail::widen_impl(str, str_size); } CLI11_INLINE std::wstring widen(const std::string &str) { return detail::widen_impl(str.data(), str.size()); } // Flawfinder: ignore CLI11_INLINE std::wstring widen(const char *str) { return detail::widen_impl(str, std::strlen(str)); } #ifdef CLI11_CPP17 CLI11_INLINE std::string narrow(std::wstring_view str) { return detail::narrow_impl(str.data(), str.size()); } CLI11_INLINE std::wstring widen(std::string_view str) { return detail::widen_impl(str.data(), str.size()); } #endif // CLI11_CPP17 #if defined CLI11_HAS_FILESYSTEM && CLI11_HAS_FILESYSTEM > 0 CLI11_INLINE std::filesystem::path to_path(std::string_view str) { return std::filesystem::path{ #ifdef _WIN32 widen(str) #else str #endif // _WIN32 }; } #endif // CLI11_HAS_FILESYSTEM namespace detail { #ifdef _WIN32 /// Decode and return UTF-8 argv from GetCommandLineW. CLI11_INLINE std::vector compute_win32_argv(); #endif } // namespace detail namespace detail { #ifdef _WIN32 CLI11_INLINE std::vector compute_win32_argv() { std::vector result; int argc = 0; auto deleter = [](wchar_t **ptr) { LocalFree(ptr); }; // NOLINTBEGIN(*-avoid-c-arrays) auto wargv = std::unique_ptr(CommandLineToArgvW(GetCommandLineW(), &argc), deleter); // NOLINTEND(*-avoid-c-arrays) if(wargv == nullptr) { throw std::runtime_error("CommandLineToArgvW failed with code " + std::to_string(GetLastError())); } result.reserve(static_cast(argc)); for(size_t i = 0; i < static_cast(argc); ++i) { result.push_back(narrow(wargv[i])); } return result; } #endif } // namespace detail /// Include the items in this namespace to get free conversion of enums to/from streams. /// (This is available inside CLI as well, so CLI11 will use this without a using statement). namespace enums { /// output streaming for enumerations template ::value>::type> std::ostream &operator<<(std::ostream &in, const T &item) { // make sure this is out of the detail namespace otherwise it won't be found when needed // https://isocpp.org/wiki/faq/input-output#print-char-or-ptr-as-number return in << +static_cast::type>(item); } } // namespace enums /// Export to CLI namespace using enums::operator<<; namespace detail { /// a constant defining an expected max vector size defined to be a big number that could be multiplied by 4 and not /// produce overflow for some expected uses CLI11_MODULE_INLINE constexpr int expected_max_vector_size{1 << 29}; // Based on http://stackoverflow.com/questions/236129/split-a-string-in-c /// Split a string by a delim CLI11_INLINE std::vector split(const std::string &s, char delim); /// Simple function to join a string template std::string join(const T &v, std::string delim = ",") { std::ostringstream s; auto beg = std::begin(v); auto end = std::end(v); if(beg != end) s << *beg++; while(beg != end) { s << delim << *beg++; } auto rval = s.str(); if(!rval.empty() && delim.size() == 1 && rval.back() == delim[0]) { // remove trailing delimiter if the last entry was empty rval.pop_back(); } return rval; } /// Simple function to join a string from processed elements template ::value>::type> std::string join(const T &v, Callable func, std::string delim = ",") { std::ostringstream s; auto beg = std::begin(v); auto end = std::end(v); auto loc = s.tellp(); while(beg != end) { auto nloc = s.tellp(); if(nloc > loc) { s << delim; loc = nloc; } s << func(*beg++); } return s.str(); } /// Join a string in reverse order template std::string rjoin(const T &v, std::string delim = ",") { std::ostringstream s; for(std::size_t start = 0; start < v.size(); start++) { if(start > 0) s << delim; s << v[v.size() - start - 1]; } return s.str(); } // Based roughly on http://stackoverflow.com/questions/25829143/c-trim-whitespace-from-a-string /// Trim whitespace from left of string CLI11_INLINE std::string <rim(std::string &str); /// Trim anything from left of string CLI11_INLINE std::string <rim(std::string &str, const std::string &filter); /// Trim whitespace from right of string CLI11_INLINE std::string &rtrim(std::string &str); /// Trim anything from right of string CLI11_INLINE std::string &rtrim(std::string &str, const std::string &filter); /// Trim whitespace from string inline std::string &trim(std::string &str) { return ltrim(rtrim(str)); } /// Trim anything from string inline std::string &trim(std::string &str, const std::string filter) { return ltrim(rtrim(str, filter), filter); } /// Make a copy of the string and then trim it inline std::string trim_copy(const std::string &str) { std::string s = str; return trim(s); } /// remove quotes at the front and back of a string either '"' or '\'' CLI11_INLINE std::string &remove_quotes(std::string &str); /// remove quotes from all elements of a string vector and process escaped components CLI11_INLINE void remove_quotes(std::vector &args); /// Add a leader to the beginning of all new lines (nothing is added /// at the start of the first line). `"; "` would be for ini files /// /// Can't use Regex, or this would be a subs. CLI11_INLINE std::string fix_newlines(const std::string &leader, std::string input); /// Make a copy of the string and then trim it, any filter string can be used (any char in string is filtered) inline std::string trim_copy(const std::string &str, const std::string &filter) { std::string s = str; return trim(s, filter); } /// Print subcommand aliases CLI11_INLINE std::ostream &format_aliases(std::ostream &out, const std::vector &aliases, std::size_t wid); /// Verify the first character of an option /// - is a trigger character, ! has special meaning and new lines would just be annoying to deal with template bool valid_first_char(T c) { return ((c != '-') && (static_cast(c) > 33)); // space and '!' not allowed } /// Verify following characters of an option template bool valid_later_char(T c) { // = and : are value separators, { has special meaning for option defaults, // and control codes other than tab would just be annoying to deal with in many places allowing space here has too // much potential for inadvertent entry errors and bugs return ((c != '=') && (c != ':') && (c != '{') && ((static_cast(c) > 32) || c == '\t')); } /// Verify an option/subcommand name CLI11_INLINE bool valid_name_string(const std::string &str); /// Verify an app name inline bool valid_alias_name_string(const std::string &str) { return ((str.find_first_of('\n') == std::string::npos) && (str.find_first_of('\0') == std::string::npos)); } /// check if a string is a container segment separator (empty or "%%") inline bool is_separator(const std::string &str) { return (str.empty() || (str.size() == 2 && str[0] == '%' && str[1] == '%')); } /// Verify that str consists of letters only inline bool isalpha(const std::string &str) { return std::all_of(str.begin(), str.end(), [](char c) { return std::isalpha(c, std::locale()); }); } /// Return a lower case version of a string inline std::string to_lower(std::string str) { std::transform(std::begin(str), std::end(str), std::begin(str), [](const std::string::value_type &x) { return std::tolower(x, std::locale()); }); return str; } /// remove underscores from a string inline std::string remove_underscore(std::string str) { str.erase(std::remove(std::begin(str), std::end(str), '_'), std::end(str)); return str; } /// @brief get valid group separators _' + local separator if different /// @return a string containing the group separators CLI11_INLINE std::string get_group_separators(); /// Find and replace a substring with another substring CLI11_INLINE std::string find_and_replace(std::string str, std::string from, std::string to); /// check if the flag definitions has possible false flags inline bool has_default_flag_values(const std::string &flags) { return (flags.find_first_of("{!") != std::string::npos); } CLI11_INLINE void remove_default_flag_values(std::string &flags); /// Check if a string is a member of a list of strings and optionally ignore case or ignore underscores CLI11_INLINE std::ptrdiff_t find_member(std::string name, const std::vector names, bool ignore_case = false, bool ignore_underscore = false); /// Find a trigger string and call a modify callable function that takes the current string and starting position of the /// trigger and returns the position in the string to search for the next trigger string template inline std::string find_and_modify(std::string str, std::string trigger, Callable modify) { std::size_t start_pos = 0; while((start_pos = str.find(trigger, start_pos)) != std::string::npos) { start_pos = modify(str, start_pos); } return str; } /// close a sequence of characters indicated by a closure character. Brackets allows sub sequences /// recognized bracket sequences include "'`[(<{ other closure characters are assumed to be literal strings CLI11_INLINE std::size_t close_sequence(const std::string &str, std::size_t start, char closure_char); /// Split a string '"one two" "three"' into 'one two', 'three' /// Quote characters can be ` ' or " or bracket characters [{(< with matching to the matching bracket CLI11_INLINE std::vector split_up(std::string str, char delimiter = '\0'); /// get the value of an environmental variable or empty string if empty CLI11_INLINE std::string get_environment_value(const std::string &env_name); /// This function detects an equal or colon followed by an escaped quote after an argument /// then modifies the string to replace the equality with a space. This is needed /// to allow the split up function to work properly and is intended to be used with the find_and_modify function /// the return value is the offset+1 which is required by the find_and_modify function. CLI11_INLINE std::size_t escape_detect(std::string &str, std::size_t offset); /// @brief detect if a string has escapable characters /// @param str the string to do the detection on /// @return true if the string has escapable characters CLI11_INLINE bool has_escapable_character(const std::string &str); /// @brief escape all escapable characters /// @param str the string to escape /// @return a string with the escapable characters escaped with '\' CLI11_INLINE std::string add_escaped_characters(const std::string &str); /// @brief replace the escaped characters with their equivalent CLI11_INLINE std::string remove_escaped_characters(const std::string &str); /// generate a string with all non printable characters escaped to hex codes CLI11_INLINE std::string binary_escape_string(const std::string &string_to_escape, bool force = false); CLI11_INLINE bool is_binary_escaped_string(const std::string &escaped_string); /// extract an escaped binary_string CLI11_INLINE std::string extract_binary_string(const std::string &escaped_string); /// process a quoted string, remove the quotes and if appropriate handle escaped characters CLI11_INLINE bool process_quoted_string(std::string &str, char string_char = '\"', char literal_char = '\'', bool disable_secondary_array_processing = false); /// This function formats the given text as a paragraph with fixed width and applies correct line wrapping /// with a custom line prefix. The paragraph will get streamed to the given ostream. CLI11_INLINE std::ostream &streamOutAsParagraph(std::ostream &out, const std::string &text, std::size_t paragraphWidth, const std::string &linePrefix = "", bool skipPrefixOnFirstLine = false); } // namespace detail namespace detail { CLI11_INLINE std::vector split(const std::string &s, char delim) { std::vector elems; // Check to see if empty string, give consistent result if(s.empty()) { elems.emplace_back(); } else { std::stringstream ss; ss.str(s); std::string item; while(std::getline(ss, item, delim)) { elems.push_back(item); } } return elems; } CLI11_INLINE std::string <rim(std::string &str) { auto it = std::find_if(str.begin(), str.end(), [](char ch) { return !std::isspace(ch, std::locale()); }); str.erase(str.begin(), it); return str; } CLI11_INLINE std::string <rim(std::string &str, const std::string &filter) { auto it = std::find_if(str.begin(), str.end(), [&filter](char ch) { return filter.find(ch) == std::string::npos; }); str.erase(str.begin(), it); return str; } CLI11_INLINE std::string &rtrim(std::string &str) { auto it = std::find_if(str.rbegin(), str.rend(), [](char ch) { return !std::isspace(ch, std::locale()); }); str.erase(it.base(), str.end()); return str; } CLI11_INLINE std::string &rtrim(std::string &str, const std::string &filter) { auto it = std::find_if(str.rbegin(), str.rend(), [&filter](char ch) { return filter.find(ch) == std::string::npos; }); str.erase(it.base(), str.end()); return str; } CLI11_INLINE std::string &remove_quotes(std::string &str) { if(str.length() > 1 && (str.front() == '"' || str.front() == '\'' || str.front() == '`')) { if(str.front() == str.back()) { str.pop_back(); str.erase(str.begin(), str.begin() + 1); } } return str; } CLI11_INLINE std::string &remove_outer(std::string &str, char key) { if(str.length() > 1 && (str.front() == key)) { if(str.front() == str.back()) { str.pop_back(); str.erase(str.begin(), str.begin() + 1); } } return str; } CLI11_INLINE std::string fix_newlines(const std::string &leader, std::string input) { std::string::size_type n = 0; while(n != std::string::npos && n < input.size()) { n = input.find_first_of("\r\n", n); if(n != std::string::npos) { input = input.substr(0, n + 1) + leader + input.substr(n + 1); n += leader.size(); } } return input; } CLI11_INLINE std::ostream &format_aliases(std::ostream &out, const std::vector &aliases, std::size_t wid) { if(!aliases.empty()) { out << std::setw(static_cast(wid)) << " aliases: "; bool front = true; for(const auto &alias : aliases) { if(!front) { out << ", "; } else { front = false; } out << detail::fix_newlines(" ", alias); } out << "\n"; } return out; } CLI11_INLINE bool valid_name_string(const std::string &str) { if(str.empty() || !valid_first_char(str[0])) { return false; } auto e = str.end(); for(auto c = str.begin() + 1; c != e; ++c) if(!valid_later_char(*c)) return false; return true; } CLI11_INLINE std::string get_group_separators() { std::string separators{"_'"}; #if CLI11_HAS_RTTI != 0 char group_separator = std::use_facet>(std::locale()).thousands_sep(); separators.push_back(group_separator); #endif return separators; } CLI11_INLINE std::string find_and_replace(std::string str, std::string from, std::string to) { std::size_t start_pos = 0; while((start_pos = str.find(from, start_pos)) != std::string::npos) { str.replace(start_pos, from.length(), to); start_pos += to.length(); } return str; } CLI11_INLINE void remove_default_flag_values(std::string &flags) { auto loc = flags.find_first_of('{', 2); while(loc != std::string::npos) { auto finish = flags.find_first_of("},", loc + 1); if((finish != std::string::npos) && (flags[finish] == '}')) { flags.erase(flags.begin() + static_cast(loc), flags.begin() + static_cast(finish) + 1); } loc = flags.find_first_of('{', loc + 1); } flags.erase(std::remove(flags.begin(), flags.end(), '!'), flags.end()); } CLI11_INLINE std::ptrdiff_t find_member(std::string name, const std::vector names, bool ignore_case, bool ignore_underscore) { auto it = std::end(names); if(ignore_case) { if(ignore_underscore) { name = detail::to_lower(detail::remove_underscore(name)); it = std::find_if(std::begin(names), std::end(names), [&name](std::string local_name) { return detail::to_lower(detail::remove_underscore(local_name)) == name; }); } else { name = detail::to_lower(name); it = std::find_if(std::begin(names), std::end(names), [&name](std::string local_name) { return detail::to_lower(local_name) == name; }); } } else if(ignore_underscore) { name = detail::remove_underscore(name); it = std::find_if(std::begin(names), std::end(names), [&name](std::string local_name) { return detail::remove_underscore(local_name) == name; }); } else { it = std::find(std::begin(names), std::end(names), name); } return (it != std::end(names)) ? (it - std::begin(names)) : (-1); } CLI11_MODULE_INLINE const std::string &escapedChars("\b\t\n\f\r\"\\"); CLI11_MODULE_INLINE const std::string &escapedCharsCode("btnfr\"\\"); CLI11_MODULE_INLINE const std::string &bracketChars("\"'`[(<{"); CLI11_MODULE_INLINE const std::string &matchBracketChars("\"'`])>}"); CLI11_INLINE bool has_escapable_character(const std::string &str) { return (str.find_first_of(escapedChars) != std::string::npos); } CLI11_INLINE std::string add_escaped_characters(const std::string &str) { std::string out; out.reserve(str.size() + 4); for(char s : str) { auto sloc = escapedChars.find_first_of(s); if(sloc != std::string::npos) { out.push_back('\\'); out.push_back(escapedCharsCode[sloc]); } else { out.push_back(s); } } return out; } CLI11_INLINE std::uint32_t hexConvert(char hc) { int hcode{0}; if(hc >= '0' && hc <= '9') { hcode = (hc - '0'); } else if(hc >= 'A' && hc <= 'F') { hcode = (hc - 'A' + 10); } else if(hc >= 'a' && hc <= 'f') { hcode = (hc - 'a' + 10); } else { hcode = -1; } return static_cast(hcode); } CLI11_INLINE char make_char(std::uint32_t code) { return static_cast(static_cast(code)); } CLI11_INLINE void append_codepoint(std::string &str, std::uint32_t code) { if(code < 0x80) { // ascii code equivalent str.push_back(static_cast(code)); } else if(code < 0x800) { // \u0080 to \u07FF // 110yyyyx 10xxxxxx; 0x3f == 0b0011'1111 str.push_back(make_char(0xC0 | code >> 6)); str.push_back(make_char(0x80 | (code & 0x3F))); } else if(code < 0x10000) { // U+0800...U+FFFF if(0xD800 <= code && code <= 0xDFFF) { throw std::invalid_argument("[0xD800, 0xDFFF] are not valid UTF-8."); } // 1110yyyy 10yxxxxx 10xxxxxx str.push_back(make_char(0xE0 | code >> 12)); str.push_back(make_char(0x80 | (code >> 6 & 0x3F))); str.push_back(make_char(0x80 | (code & 0x3F))); } else if(code < 0x110000) { // U+010000 ... U+10FFFF // 11110yyy 10yyxxxx 10xxxxxx 10xxxxxx str.push_back(make_char(0xF0 | code >> 18)); str.push_back(make_char(0x80 | (code >> 12 & 0x3F))); str.push_back(make_char(0x80 | (code >> 6 & 0x3F))); str.push_back(make_char(0x80 | (code & 0x3F))); } } CLI11_INLINE std::string remove_escaped_characters(const std::string &str) { std::string out; out.reserve(str.size()); for(auto loc = str.begin(); loc < str.end(); ++loc) { if(*loc == '\\') { if(str.end() - loc < 2) { throw std::invalid_argument("invalid escape sequence " + str); } auto ecloc = escapedCharsCode.find_first_of(*(loc + 1)); if(ecloc != std::string::npos) { out.push_back(escapedChars[ecloc]); ++loc; } else if(*(loc + 1) == 'u') { // must have 4 hex characters if(str.end() - loc < 6) { throw std::invalid_argument("unicode sequence must have 4 hex codes " + str); } std::uint32_t code{0}; std::uint32_t mplier{16 * 16 * 16}; for(int ii = 2; ii < 6; ++ii) { std::uint32_t res = hexConvert(*(loc + ii)); if(res > 0x0F) { throw std::invalid_argument("unicode sequence must have 4 hex codes " + str); } code += res * mplier; mplier = mplier / 16; } append_codepoint(out, code); loc += 5; } else if(*(loc + 1) == 'U') { // must have 8 hex characters if(str.end() - loc < 10) { throw std::invalid_argument("unicode sequence must have 8 hex codes " + str); } std::uint32_t code{0}; std::uint32_t mplier{16 * 16 * 16 * 16 * 16 * 16 * 16}; for(int ii = 2; ii < 10; ++ii) { std::uint32_t res = hexConvert(*(loc + ii)); if(res > 0x0F) { throw std::invalid_argument("unicode sequence must have 8 hex codes " + str); } code += res * mplier; mplier = mplier / 16; } append_codepoint(out, code); loc += 9; } else if(*(loc + 1) == '0') { out.push_back('\0'); ++loc; } else { throw std::invalid_argument(std::string("unrecognized escape sequence \\") + *(loc + 1) + " in " + str); } } else { out.push_back(*loc); } } return out; } CLI11_INLINE std::size_t close_string_quote(const std::string &str, std::size_t start, char closure_char) { std::size_t loc{0}; for(loc = start + 1; loc < str.size(); ++loc) { if(str[loc] == closure_char) { break; } if(str[loc] == '\\') { // skip the next character for escaped sequences ++loc; } } return loc; } CLI11_INLINE std::size_t close_literal_quote(const std::string &str, std::size_t start, char closure_char) { auto loc = str.find_first_of(closure_char, start + 1); return (loc != std::string::npos ? loc : str.size()); } CLI11_INLINE std::size_t close_sequence(const std::string &str, std::size_t start, char closure_char) { auto bracket_loc = matchBracketChars.find(closure_char); switch(bracket_loc) { case 0: return close_string_quote(str, start, closure_char); case 1: case 2: #if defined(_MSC_VER) && _MSC_VER < 1920 case(std::size_t)-1: #else case std::string::npos: #endif return close_literal_quote(str, start, closure_char); default: break; } std::string closures(1, closure_char); auto loc = start + 1; while(loc < str.size()) { if(str[loc] == closures.back()) { closures.pop_back(); if(closures.empty()) { return loc; } } bracket_loc = bracketChars.find(str[loc]); if(bracket_loc != std::string::npos) { switch(bracket_loc) { case 0: loc = close_string_quote(str, loc, str[loc]); break; case 1: case 2: loc = close_literal_quote(str, loc, str[loc]); break; default: closures.push_back(matchBracketChars[bracket_loc]); break; } } ++loc; } if(loc > str.size()) { loc = str.size(); } return loc; } CLI11_INLINE std::vector split_up(std::string str, char delimiter) { auto find_ws = [delimiter](char ch) { return (delimiter == '\0') ? std::isspace(ch, std::locale()) : (ch == delimiter); }; trim(str); std::vector output; while(!str.empty()) { if(bracketChars.find_first_of(str[0]) != std::string::npos) { auto bracketLoc = bracketChars.find_first_of(str[0]); auto end = close_sequence(str, 0, matchBracketChars[bracketLoc]); if(end >= str.size()) { output.push_back(std::move(str)); str.clear(); } else { output.push_back(str.substr(0, end + 1)); if(end + 2 < str.size()) { str = str.substr(end + 2); } else { str.clear(); } } } else { auto it = std::find_if(std::begin(str), std::end(str), find_ws); if(it != std::end(str)) { std::string value = std::string(str.begin(), it); output.push_back(value); str = std::string(it + 1, str.end()); } else { output.push_back(str); str.clear(); } } trim(str); } return output; } CLI11_INLINE std::size_t escape_detect(std::string &str, std::size_t offset) { auto next = str[offset + 1]; if((next == '\"') || (next == '\'') || (next == '`')) { auto astart = str.find_last_of("-/ \"\'`", offset - 1); if(astart != std::string::npos) { if(str[astart] == ((str[offset] == '=') ? '-' : '/')) str[offset] = ' '; // interpret this as a space so the split_up works properly } } return offset + 1; } CLI11_INLINE std::string binary_escape_string(const std::string &string_to_escape, bool force) { // s is our escaped output string std::string escaped_string{}; // loop through all characters for(char c : string_to_escape) { // check if a given character is printable // the cast is necessary to avoid undefined behaviour if(isprint(static_cast(c)) == 0) { std::stringstream stream; // if the character is not printable // we'll convert it to a hex string using a stringstream // note that since char is signed we have to cast it to unsigned first stream << std::hex << static_cast(static_cast(c)); std::string code = stream.str(); escaped_string += std::string("\\x") + (code.size() < 2 ? "0" : "") + code; } else if(c == 'x' || c == 'X') { // need to check for inadvertent binary sequences if(!escaped_string.empty() && escaped_string.back() == '\\') { escaped_string += std::string("\\x") + (c == 'x' ? "78" : "58"); } else { escaped_string.push_back(c); } } else { escaped_string.push_back(c); } } if(escaped_string != string_to_escape || force) { auto sqLoc = escaped_string.find('\''); while(sqLoc != std::string::npos) { escaped_string[sqLoc] = '\\'; escaped_string.insert(sqLoc + 1, "x27"); sqLoc = escaped_string.find('\''); } escaped_string.insert(0, "'B\"("); escaped_string.push_back(')'); escaped_string.push_back('"'); escaped_string.push_back('\''); } return escaped_string; } CLI11_INLINE bool is_binary_escaped_string(const std::string &escaped_string) { size_t ssize = escaped_string.size(); if(escaped_string.compare(0, 3, "B\"(") == 0 && escaped_string.compare(ssize - 2, 2, ")\"") == 0) { return true; } return (escaped_string.compare(0, 4, "'B\"(") == 0 && escaped_string.compare(ssize - 3, 3, ")\"'") == 0); } CLI11_INLINE std::string extract_binary_string(const std::string &escaped_string) { std::size_t start{0}; std::size_t tail{0}; size_t ssize = escaped_string.size(); if(escaped_string.compare(0, 3, "B\"(") == 0 && escaped_string.compare(ssize - 2, 2, ")\"") == 0) { start = 3; tail = 2; } else if(escaped_string.compare(0, 4, "'B\"(") == 0 && escaped_string.compare(ssize - 3, 3, ")\"'") == 0) { start = 4; tail = 3; } if(start == 0) { return escaped_string; } std::string outstring; outstring.reserve(ssize - start - tail); std::size_t loc = start; while(loc < ssize - tail) { // ssize-2 to skip )" at the end if(escaped_string[loc] == '\\' && (escaped_string[loc + 1] == 'x' || escaped_string[loc + 1] == 'X')) { auto c1 = escaped_string[loc + 2]; auto c2 = escaped_string[loc + 3]; std::uint32_t res1 = hexConvert(c1); std::uint32_t res2 = hexConvert(c2); if(res1 <= 0x0F && res2 <= 0x0F) { loc += 4; outstring.push_back(static_cast(res1 * 16 + res2)); continue; } } outstring.push_back(escaped_string[loc]); ++loc; } return outstring; } CLI11_INLINE void remove_quotes(std::vector &args) { for(auto &arg : args) { if(arg.front() == '\"' && arg.back() == '\"') { remove_quotes(arg); // only remove escaped for string arguments not literal strings arg = remove_escaped_characters(arg); } else { remove_quotes(arg); } } } CLI11_INLINE void handle_secondary_array(std::string &str) { if(str.size() >= 2 && str.front() == '[' && str.back() == ']') { // handle some special array processing for arguments if it might be interpreted as a secondary array std::string tstr{"[["}; for(std::size_t ii = 1; ii < str.size(); ++ii) { tstr.push_back(str[ii]); tstr.push_back(str[ii]); } str = std::move(tstr); } } CLI11_INLINE bool process_quoted_string(std::string &str, char string_char, char literal_char, bool disable_secondary_array_processing) { if(str.size() <= 1) { return false; } if(detail::is_binary_escaped_string(str)) { str = detail::extract_binary_string(str); if(!disable_secondary_array_processing) handle_secondary_array(str); return true; } if(str.front() == string_char && str.back() == string_char) { detail::remove_outer(str, string_char); if(str.find_first_of('\\') != std::string::npos) { str = detail::remove_escaped_characters(str); } if(!disable_secondary_array_processing) handle_secondary_array(str); return true; } if((str.front() == literal_char || str.front() == '`') && str.back() == str.front()) { detail::remove_outer(str, str.front()); if(!disable_secondary_array_processing) handle_secondary_array(str); return true; } return false; } std::string get_environment_value(const std::string &env_name) { std::string ename_string; #ifdef _MSC_VER // Windows version char *buffer = nullptr; std::size_t sz = 0; if(_dupenv_s(&buffer, &sz, env_name.c_str()) == 0 && buffer != nullptr) { ename_string = std::string(buffer); free(buffer); } #else // This also works on Windows, but gives a warning // MISRA static analysis need. MISRACPP2023-25_5_2-a-1 const char *buffer = nullptr; buffer = std::getenv(env_name.c_str()); if(buffer != nullptr) { ename_string = std::string(buffer); } #endif return ename_string; } CLI11_INLINE std::ostream &streamOutAsParagraph(std::ostream &out, const std::string &text, std::size_t paragraphWidth, const std::string &linePrefix, bool skipPrefixOnFirstLine) { if(!skipPrefixOnFirstLine) out << linePrefix; // First line prefix std::istringstream lss(text); std::string line = ""; while(std::getline(lss, line)) { std::istringstream iss(line); std::string word = ""; std::size_t charsWritten = 0; while(iss >> word) { if(charsWritten > 0 && (word.length() + 1 + charsWritten > paragraphWidth)) { out << '\n' << linePrefix; charsWritten = 0; } if(charsWritten == 0) { out << word; charsWritten += word.length(); } else { out << ' ' << word; charsWritten += word.length() + 1; } } if(!lss.eof()) out << '\n' << linePrefix; } return out; } } // namespace detail // Use one of these on all error classes. // These are temporary and are undef'd at the end of this file. #define CLI11_ERROR_DEF(parent, name) \ protected: \ name(std::string ename, std::string msg, int exit_code) : parent(std::move(ename), std::move(msg), exit_code) {} \ name(std::string ename, std::string msg, ExitCodes exit_code) \ : parent(std::move(ename), std::move(msg), exit_code) {} \ \ public: \ name(std::string msg, ExitCodes exit_code) : parent(#name, std::move(msg), exit_code) {} \ name(std::string msg, int exit_code) : parent(#name, std::move(msg), exit_code) {} // This is added after the one above if a class is used directly and builds its own message #define CLI11_ERROR_SIMPLE(name) \ explicit name(std::string msg) : name(#name, msg, ExitCodes::name) {} /// These codes are part of every error in CLI. They can be obtained from e using e.exit_code or as a quick shortcut, /// int values from e.get_error_code(). enum class ExitCodes : int { Success = 0, IncorrectConstruction = 100, BadNameString, OptionAlreadyAdded, FileError, ConversionError, ValidationError, RequiredError, RequiresError, ExcludesError, ExtrasError, ConfigError, InvalidError, HorribleError, OptionNotFound, ArgumentMismatch, BaseClass = 127 }; // Error definitions /// @defgroup error_group Errors /// @brief Errors thrown by CLI11 /// /// These are the errors that can be thrown. Some of them, like CLI::Success, are not really errors. /// @{ /// All errors derive from this one class Error : public std::runtime_error { int actual_exit_code; std::string error_name{"Error"}; public: CLI11_NODISCARD int get_exit_code() const { return actual_exit_code; } CLI11_NODISCARD std::string get_name() const { return error_name; } Error(std::string name, std::string msg, int exit_code = static_cast(ExitCodes::BaseClass)) : runtime_error(msg), actual_exit_code(exit_code), error_name(std::move(name)) {} Error(std::string name, std::string msg, ExitCodes exit_code) : Error(name, msg, static_cast(exit_code)) {} }; // Note: Using Error::Error constructors does not work on GCC 4.7 /// Construction errors (not in parsing) class ConstructionError : public Error { CLI11_ERROR_DEF(Error, ConstructionError) }; /// Thrown when an option is set to conflicting values (non-vector and multi args, for example) class IncorrectConstruction : public ConstructionError { CLI11_ERROR_DEF(ConstructionError, IncorrectConstruction) CLI11_ERROR_SIMPLE(IncorrectConstruction) static IncorrectConstruction PositionalFlag(std::string name) { return IncorrectConstruction(name + ": Flags cannot be positional"); } static IncorrectConstruction Set0Opt(std::string name) { return IncorrectConstruction(name + ": Cannot set 0 expected, use a flag instead"); } static IncorrectConstruction SetFlag(std::string name) { return IncorrectConstruction(name + ": Cannot set an expected number for flags"); } static IncorrectConstruction ChangeNotVector(std::string name) { return IncorrectConstruction(name + ": You can only change the expected arguments for vectors"); } static IncorrectConstruction AfterMultiOpt(std::string name) { return IncorrectConstruction( name + ": You can't change expected arguments after you've changed the multi option policy!"); } static IncorrectConstruction MissingOption(std::string name) { return IncorrectConstruction("Option " + name + " is not defined"); } static IncorrectConstruction MultiOptionPolicy(std::string name) { return IncorrectConstruction(name + ": multi_option_policy only works for flags and exact value options"); } }; /// Thrown on construction of a bad name class BadNameString : public ConstructionError { CLI11_ERROR_DEF(ConstructionError, BadNameString) CLI11_ERROR_SIMPLE(BadNameString) static BadNameString OneCharName(std::string name) { return BadNameString("Invalid one char name: " + name); } static BadNameString MissingDash(std::string name) { return BadNameString("Long names strings require 2 dashes " + name); } static BadNameString BadLongName(std::string name) { return BadNameString("Bad long name: " + name); } static BadNameString BadPositionalName(std::string name) { return BadNameString("Invalid positional Name: " + name); } static BadNameString ReservedName(std::string name) { return BadNameString("Names '-','--','++' are reserved and not allowed as option names " + name); } static BadNameString MultiPositionalNames(std::string name) { return BadNameString("Only one positional name allowed, remove: " + name); } }; /// Thrown when an option already exists class OptionAlreadyAdded : public ConstructionError { CLI11_ERROR_DEF(ConstructionError, OptionAlreadyAdded) explicit OptionAlreadyAdded(std::string name) : OptionAlreadyAdded(name + " is already added", ExitCodes::OptionAlreadyAdded) {} static OptionAlreadyAdded Requires(std::string name, std::string other) { return {name + " requires " + other, ExitCodes::OptionAlreadyAdded}; } static OptionAlreadyAdded Excludes(std::string name, std::string other) { return {name + " excludes " + other, ExitCodes::OptionAlreadyAdded}; } }; // Parsing errors /// Anything that can error in Parse class ParseError : public Error { CLI11_ERROR_DEF(Error, ParseError) }; // Not really "errors" /// This is a successful completion on parsing, supposed to exit class Success : public ParseError { CLI11_ERROR_DEF(ParseError, Success) Success() : Success("Successfully completed, should be caught and quit", ExitCodes::Success) {} }; /// -h or --help on command line class CallForHelp : public Success { CLI11_ERROR_DEF(Success, CallForHelp) CallForHelp() : CallForHelp("This should be caught in your main function, see examples", ExitCodes::Success) {} }; /// Usually something like --help-all on command line class CallForAllHelp : public Success { CLI11_ERROR_DEF(Success, CallForAllHelp) CallForAllHelp() : CallForAllHelp("This should be caught in your main function, see examples", ExitCodes::Success) {} }; /// -v or --version on command line class CallForVersion : public Success { CLI11_ERROR_DEF(Success, CallForVersion) CallForVersion() : CallForVersion("This should be caught in your main function, see examples", ExitCodes::Success) {} }; /// Does not output a diagnostic in CLI11_PARSE, but allows main() to return with a specific error code. class RuntimeError : public ParseError { CLI11_ERROR_DEF(ParseError, RuntimeError) explicit RuntimeError(int exit_code = 1) : RuntimeError("Runtime error", exit_code) {} }; /// Thrown when parsing an INI file and it is missing class FileError : public ParseError { CLI11_ERROR_DEF(ParseError, FileError) CLI11_ERROR_SIMPLE(FileError) static FileError Missing(std::string name) { return FileError(name + " was not readable (missing?)"); } }; /// Thrown when conversion call back fails, such as when an int fails to coerce to a string class ConversionError : public ParseError { CLI11_ERROR_DEF(ParseError, ConversionError) CLI11_ERROR_SIMPLE(ConversionError) ConversionError(std::string member, std::string name) : ConversionError("The value " + member + " is not an allowed value for " + name) {} ConversionError(std::string name, std::vector results) : ConversionError("Could not convert: " + name + " = " + detail::join(results)) {} static ConversionError TooManyInputsFlag(std::string name) { return ConversionError(name + ": too many inputs for a flag"); } static ConversionError TrueFalse(std::string name) { return ConversionError(name + ": Should be true/false or a number"); } }; /// Thrown when validation of results fails class ValidationError : public ParseError { CLI11_ERROR_DEF(ParseError, ValidationError) CLI11_ERROR_SIMPLE(ValidationError) explicit ValidationError(std::string name, std::string msg) : ValidationError(name + ": " + msg) {} }; /// Thrown when a required option is missing class RequiredError : public ParseError { CLI11_ERROR_DEF(ParseError, RequiredError) explicit RequiredError(std::string name) : RequiredError(name + " is required", ExitCodes::RequiredError) {} static RequiredError Subcommand(std::size_t min_subcom) { if(min_subcom == 1) { return RequiredError("A subcommand"); } return {"Requires at least " + std::to_string(min_subcom) + " subcommands", ExitCodes::RequiredError}; } static RequiredError Option(std::size_t min_option, std::size_t max_option, std::size_t used, const std::string &option_list) { if((min_option == 1) && (max_option == 1) && (used == 0)) return RequiredError("Exactly 1 option from [" + option_list + "]"); if((min_option == 1) && (max_option == 1) && (used > 1)) { return {"Exactly 1 option from [" + option_list + "] is required but " + std::to_string(used) + " were given", ExitCodes::RequiredError}; } if((min_option == 1) && (used == 0)) return RequiredError("At least 1 option from [" + option_list + "]"); if(used < min_option) { return {"Requires at least " + std::to_string(min_option) + " options used but only " + std::to_string(used) + " were given from [" + option_list + "]", ExitCodes::RequiredError}; } if(max_option == 1) return {"Requires at most 1 options be given from [" + option_list + "]", ExitCodes::RequiredError}; return {"Requires at most " + std::to_string(max_option) + " options be used but " + std::to_string(used) + " were given from [" + option_list + "]", ExitCodes::RequiredError}; } }; /// Thrown when the wrong number of arguments has been received class ArgumentMismatch : public ParseError { CLI11_ERROR_DEF(ParseError, ArgumentMismatch) CLI11_ERROR_SIMPLE(ArgumentMismatch) ArgumentMismatch(std::string name, int expected, std::size_t received) : ArgumentMismatch(expected > 0 ? ("Expected exactly " + std::to_string(expected) + " arguments to " + name + ", got " + std::to_string(received)) : ("Expected at least " + std::to_string(-expected) + " arguments to " + name + ", got " + std::to_string(received)), ExitCodes::ArgumentMismatch) {} static ArgumentMismatch AtLeast(std::string name, int num, std::size_t received) { return ArgumentMismatch(name + ": At least " + std::to_string(num) + " required but received " + std::to_string(received)); } static ArgumentMismatch AtMost(std::string name, int num, std::size_t received) { return ArgumentMismatch(name + ": At most " + std::to_string(num) + " required but received " + std::to_string(received)); } static ArgumentMismatch TypedAtLeast(std::string name, int num, std::string type) { return ArgumentMismatch(name + ": " + std::to_string(num) + " required " + type + " missing"); } static ArgumentMismatch FlagOverride(std::string name) { return ArgumentMismatch(name + " was given a disallowed flag override"); } static ArgumentMismatch PartialType(std::string name, int num, std::string type) { return ArgumentMismatch(name + ": " + type + " only partially specified: " + std::to_string(num) + " required for each element"); } }; /// Thrown when a requires option is missing class RequiresError : public ParseError { CLI11_ERROR_DEF(ParseError, RequiresError) RequiresError(std::string curname, std::string subname) : RequiresError(curname + " requires " + subname, ExitCodes::RequiresError) {} }; /// Thrown when an excludes option is present class ExcludesError : public ParseError { CLI11_ERROR_DEF(ParseError, ExcludesError) ExcludesError(std::string curname, std::string subname) : ExcludesError(curname + " excludes " + subname, ExitCodes::ExcludesError) {} }; /// Thrown when too many positionals or options are found class ExtrasError : public ParseError { CLI11_ERROR_DEF(ParseError, ExtrasError) explicit ExtrasError(std::vector args) : ExtrasError((args.size() > 1 ? "The following arguments were not expected: " : "The following argument was not expected: ") + detail::join(args, " "), ExitCodes::ExtrasError) {} ExtrasError(const std::string &name, std::vector args) : ExtrasError(name, (args.size() > 1 ? "The following arguments were not expected: " : "The following argument was not expected: ") + detail::join(args, " "), ExitCodes::ExtrasError) {} }; /// Thrown when extra values are found in an INI file class ConfigError : public ParseError { CLI11_ERROR_DEF(ParseError, ConfigError) CLI11_ERROR_SIMPLE(ConfigError) static ConfigError Extras(std::string item) { return ConfigError("INI was not able to parse " + item); } static ConfigError NotConfigurable(std::string item) { return ConfigError(item + ": This option is not allowed in a configuration file"); } }; /// Thrown when validation fails before parsing class InvalidError : public ParseError { CLI11_ERROR_DEF(ParseError, InvalidError) explicit InvalidError(std::string name) : InvalidError(name + ": Too many positional arguments with unlimited expected args", ExitCodes::InvalidError) { } }; /// This is just a safety check to verify selection and parsing match - you should not ever see it /// Strings are directly added to this error, but again, it should never be seen. class HorribleError : public ParseError { CLI11_ERROR_DEF(ParseError, HorribleError) CLI11_ERROR_SIMPLE(HorribleError) }; // After parsing /// Thrown when counting a nonexistent option class OptionNotFound : public Error { CLI11_ERROR_DEF(Error, OptionNotFound) explicit OptionNotFound(std::string name) : OptionNotFound(name + " not found", ExitCodes::OptionNotFound) {} }; #undef CLI11_ERROR_DEF #undef CLI11_ERROR_SIMPLE /// @} // Type tools // Utilities for type enabling namespace detail { // Based generally on https://rmf.io/cxx11/almost-static-if /// Simple empty scoped class enum class enabler : std::uint8_t {}; /// An instance to use in EnableIf CLI11_MODULE_INLINE constexpr enabler dummy = {}; } // namespace detail /// A copy of enable_if_t from C++14, compatible with C++11. /// /// We could check to see if C++14 is being used, but it does not hurt to redefine this /// (even Google does this: https://github.com/google/skia/blob/main/include/private/SkTLogic.h) /// It is not in the std namespace anyway, so no harm done. template using enable_if_t = typename std::enable_if::type; /// A copy of std::void_t from C++17 (helper for C++11 and C++14) template struct make_void { using type = void; }; /// A copy of std::void_t from C++17 - same reasoning as enable_if_t, it does not hurt to redefine template using void_t = typename make_void::type; /// A copy of std::conditional_t from C++14 - same reasoning as enable_if_t, it does not hurt to redefine template using conditional_t = typename std::conditional::type; /// Check to see if something is bool (fail check by default) template struct is_bool : std::false_type {}; /// Check to see if something is bool (true if actually a bool) template <> struct is_bool : std::true_type {}; /// Check to see if something is a shared pointer template struct is_shared_ptr : std::false_type {}; /// Check to see if something is a shared pointer (True if really a shared pointer) template struct is_shared_ptr> : std::true_type {}; /// Check to see if something is a shared pointer (True if really a shared pointer) template struct is_shared_ptr> : std::true_type {}; /// Check to see if something is copyable pointer template struct is_copyable_ptr { static bool const value = is_shared_ptr::value || std::is_pointer::value; }; /// This can be specialized to override the type deduction for IsMember. template struct IsMemberType { using type = T; }; /// The main custom type needed here is const char * should be a string. template <> struct IsMemberType { using type = std::string; }; namespace adl_detail { /// Check for existence of user-supplied lexical_cast. /// /// This struct has to be in a separate namespace so that it doesn't see our lexical_cast overloads in CLI::detail. /// Standard says it shouldn't see them if it's defined before the corresponding lexical_cast declarations, but this /// requires a working implementation of two-phase lookup, and not all compilers can boast that (msvc, ahem). template class is_lexical_castable { template static auto test(int) -> decltype(lexical_cast(std::declval(), std::declval()), std::true_type()); template static auto test(...) -> std::false_type; public: static constexpr bool value = decltype(test(0))::value; }; } // namespace adl_detail namespace detail { // These are utilities for IsMember and other transforming objects /// Handy helper to access the element_type generically. This is not part of is_copyable_ptr because it requires that /// pointer_traits be valid. /// not a pointer template struct element_type { using type = T; }; template struct element_type::value>::type> { using type = typename std::pointer_traits::element_type; }; /// Combination of the element type and value type - remove pointer (including smart pointers) and get the value_type of /// the container template struct element_value_type { using type = typename element_type::type::value_type; }; /// Adaptor for set-like structure: This just wraps a normal container in a few utilities that do almost nothing. template struct pair_adaptor : std::false_type { using value_type = typename T::value_type; using first_type = typename std::remove_const::type; using second_type = typename std::remove_const::type; /// Get the first value (really just the underlying value) template static auto first(Q &&pair_value) -> decltype(std::forward(pair_value)) { return std::forward(pair_value); } /// Get the second value (really just the underlying value) template static auto second(Q &&pair_value) -> decltype(std::forward(pair_value)) { return std::forward(pair_value); } }; /// Adaptor for map-like structure (true version, must have key_type and mapped_type). /// This wraps a mapped container in a few utilities access it in a general way. template struct pair_adaptor< T, conditional_t, void>> : std::true_type { using value_type = typename T::value_type; using first_type = typename std::remove_const::type; using second_type = typename std::remove_const::type; /// Get the first value (really just the underlying value) template static auto first(Q &&pair_value) -> decltype(std::get<0>(std::forward(pair_value))) { return std::get<0>(std::forward(pair_value)); } /// Get the second value (really just the underlying value) template static auto second(Q &&pair_value) -> decltype(std::get<1>(std::forward(pair_value))) { return std::get<1>(std::forward(pair_value)); } }; // Warning is suppressed due to "bug" in gcc<5.0 and gcc 7.0 with c++17 enabled that generates a -Wnarrowing warning // in the unevaluated context even if the function that was using this wasn't used. The standard says narrowing in // brace initialization shouldn't be allowed but for backwards compatibility gcc allows it in some contexts. It is a // little fuzzy what happens in template constructs and I think that was something GCC took a little while to work out. // But regardless some versions of gcc generate a warning when they shouldn't from the following code so that should be // suppressed #ifdef __GNUC__ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wnarrowing" #endif // check for constructibility from a specific type and copy assignable used in the parse detection template class is_direct_constructible { template static auto test(int, std::true_type) -> decltype( // NVCC warns about narrowing conversions here #ifdef __CUDACC__ #ifdef __NVCC_DIAG_PRAGMA_SUPPORT__ #pragma nv_diag_suppress 2361 #else #pragma diag_suppress 2361 #endif #endif TT{std::declval()} #ifdef __CUDACC__ #ifdef __NVCC_DIAG_PRAGMA_SUPPORT__ #pragma nv_diag_default 2361 #else #pragma diag_default 2361 #endif #endif , std::is_move_assignable()); template static auto test(int, std::false_type) -> std::false_type; template static auto test(...) -> std::false_type; public: static constexpr bool value = decltype(test(0, typename std::is_constructible::type()))::value; }; #ifdef __GNUC__ #pragma GCC diagnostic pop #endif // Check for output streamability // Based on https://stackoverflow.com/questions/22758291/how-can-i-detect-if-a-type-can-be-streamed-to-an-stdostream template class is_ostreamable { template static auto test(int) -> decltype(std::declval() << std::declval(), std::true_type()); template static auto test(...) -> std::false_type; public: static constexpr bool value = decltype(test(0))::value; }; /// Check for input streamability template class is_istreamable { template static auto test(int) -> decltype(std::declval() >> std::declval(), std::true_type()); template static auto test(...) -> std::false_type; public: static constexpr bool value = decltype(test(0))::value; }; /// Check for complex template class is_complex { template static auto test(int) -> decltype(std::declval().real(), std::declval().imag(), std::true_type()); template static auto test(...) -> std::false_type; public: static constexpr bool value = decltype(test(0))::value; }; /// Templated operation to get a value from a stream template ::value, detail::enabler> = detail::dummy> bool from_stream(const std::string &istring, T &obj) { std::istringstream is; is.str(istring); is >> obj; return !is.fail() && !is.rdbuf()->in_avail(); } template ::value, detail::enabler> = detail::dummy> bool from_stream(const std::string & /*istring*/, T & /*obj*/) { return false; } // check to see if an object is a mutable container (fail by default) template struct is_mutable_container : std::false_type {}; /// type trait to test if a type is a mutable container meaning it has a value_type, it has an iterator, a clear, and /// end methods and an insert function. And for our purposes we exclude std::string and types that can be constructed /// from a std::string template struct is_mutable_container< T, conditional_t().end()), decltype(std::declval().clear()), decltype(std::declval().insert(std::declval().end())>(), std::declval()))>, void>> : public conditional_t::value || std::is_constructible::value, std::false_type, std::true_type> {}; // check to see if an object is a mutable container (fail by default) template struct is_readable_container : std::false_type {}; /// type trait to test if a type is a container meaning it has a value_type, it has an iterator, and an end /// method. template struct is_readable_container< T, conditional_t().end()), decltype(std::declval().begin())>, void>> : public std::true_type {}; // check to see if an object is a wrapper (fail by default) template struct is_wrapper : std::false_type {}; // check if an object is a wrapper (it has a value_type defined) template struct is_wrapper, void>> : public std::true_type {}; // Check for tuple like types, as in classes with a tuple_size type trait // Even though in C++26 std::complex gains a std::tuple interface, for our purposes we treat is as NOT a tuple template class is_tuple_like { template ::value, detail::enabler> = detail::dummy> // static auto test(int) // -> decltype(std::conditional<(std::tuple_size::value > 0), std::true_type, std::false_type>::type()); static auto test(int) -> decltype(std::tuple_size::type>::value, std::true_type{}); template static auto test(...) -> std::false_type; public: static constexpr bool value = decltype(test(0))::value; }; /// This will only trigger for actual void type template struct type_count_base { static const int value{0}; }; /// Type size for regular object types that do not look like a tuple template struct type_count_base::value && !is_mutable_container::value && !std::is_void::value>::type> { static constexpr int value{1}; }; /// the base tuple size template struct type_count_base::value && !is_mutable_container::value>::type> { static constexpr int value{// cppcheck-suppress unusedStructMember std::tuple_size::type>::value}; }; /// Type count base for containers is the type_count_base of the individual element template struct type_count_base::value>::type> { static constexpr int value{type_count_base::value}; }; /// Convert an object to a string (directly forward if this can become a string) template ::value, detail::enabler> = detail::dummy> auto to_string(T &&value) -> decltype(std::forward(value)) { return std::forward(value); } /// Construct a string from the object template ::value && !std::is_convertible::value, detail::enabler> = detail::dummy> std::string to_string(T &&value) { return std::string(value); // NOLINT(google-readability-casting) } /// Convert an object to a string (streaming must be supported for that type) template ::value && !std::is_constructible::value && is_ostreamable::value, detail::enabler> = detail::dummy> std::string to_string(T &&value) { std::stringstream stream; stream << value; return stream.str(); } // additional forward declarations /// Print tuple value string for tuples of size ==1 template ::value && !std::is_constructible::value && !is_ostreamable::value && is_tuple_like::value && type_count_base::value == 1, detail::enabler> = detail::dummy> inline std::string to_string(T &&value); /// Print tuple value string for tuples of size > 1 template ::value && !std::is_constructible::value && !is_ostreamable::value && is_tuple_like::value && type_count_base::value >= 2, detail::enabler> = detail::dummy> inline std::string to_string(T &&value); /// If conversion is not supported, return an empty string (streaming is not supported for that type) template < typename T, enable_if_t::value && !std::is_constructible::value && !is_ostreamable::value && !is_readable_container::type>::value && !is_tuple_like::value, detail::enabler> = detail::dummy> inline std::string to_string(T &&) { return {}; } /// convert a readable container to a string template ::value && !std::is_constructible::value && !is_ostreamable::value && is_readable_container::value && !is_tuple_like::value, detail::enabler> = detail::dummy> inline std::string to_string(T &&variable) { auto cval = variable.begin(); auto end = variable.end(); if(cval == end) { return {"{}"}; } std::vector defaults; while(cval != end) { defaults.emplace_back(CLI::detail::to_string(*cval)); ++cval; } return {"[" + detail::join(defaults) + "]"}; } /// Convert a tuple like object to a string /// forward declarations for tuple_value_strings template inline typename std::enable_if::value, std::string>::type tuple_value_string(T && /*value*/); /// Recursively generate the tuple value string template inline typename std::enable_if<(I < type_count_base::value), std::string>::type tuple_value_string(T &&value); /// Print tuple value string for tuples of size ==1 template ::value && !std::is_constructible::value && !is_ostreamable::value && is_tuple_like::value && type_count_base::value == 1, detail::enabler>> inline std::string to_string(T &&value) { return to_string(std::get<0>(value)); } /// Print tuple value string for tuples of size > 1 template ::value && !std::is_constructible::value && !is_ostreamable::value && is_tuple_like::value && type_count_base::value >= 2, detail::enabler>> inline std::string to_string(T &&value) { auto tname = std::string(1, '[') + tuple_value_string(value); tname.push_back(']'); return tname; } /// Empty string if the index > tuple size template inline typename std::enable_if::value, std::string>::type tuple_value_string(T && /*value*/) { return std::string{}; } /// Recursively generate the tuple value string template inline typename std::enable_if<(I < type_count_base::value), std::string>::type tuple_value_string(T &&value) { auto str = std::string{to_string(std::get(value))} + ',' + tuple_value_string(value); if(str.back() == ',') str.pop_back(); return str; } /// special template overload template ::value, detail::enabler> = detail::dummy> auto checked_to_string(T &&value) -> decltype(to_string(std::forward(value))) { return to_string(std::forward(value)); } /// special template overload template ::value, detail::enabler> = detail::dummy> std::string checked_to_string(T &&) { return std::string{}; } /// get a string as a convertible value for arithmetic types template ::value, detail::enabler> = detail::dummy> std::string value_string(const T &value) { return std::to_string(value); } /// get a string as a convertible value for enumerations template ::value, detail::enabler> = detail::dummy> std::string value_string(const T &value) { return std::to_string(static_cast::type>(value)); } /// for other types just use the regular to_string function template ::value && !std::is_arithmetic::value, detail::enabler> = detail::dummy> auto value_string(const T &value) -> decltype(to_string(value)) { return to_string(value); } /// template to get the underlying value type if it exists or use a default template struct wrapped_type { using type = def; }; /// Type size for regular object types that do not look like a tuple template struct wrapped_type::value>::type> { using type = typename T::value_type; }; /// Set of overloads to get the type size of an object /// forward declare the subtype_count structure template struct subtype_count; /// forward declare the subtype_count_min structure template struct subtype_count_min; /// This will only trigger for actual void type template struct type_count { static const int value{0}; }; /// Type size for regular object types that do not look like a tuple template struct type_count::value && !is_tuple_like::value && !is_complex::value && !std::is_void::value>::type> { static constexpr int value{1}; }; /// Type size for complex since it sometimes looks like a wrapper template struct type_count::value>::type> { static constexpr int value{2}; }; /// Type size of types that are wrappers,except complex and tuples(which can also be wrappers sometimes) template struct type_count::value>::type> { static constexpr int value{subtype_count::value}; }; /// Type size of types that are wrappers,except containers complex and tuples(which can also be wrappers sometimes) template struct type_count::value && !is_complex::value && !is_tuple_like::value && !is_mutable_container::value>::type> { static constexpr int value{type_count::value}; }; /// 0 if the index > tuple size template constexpr typename std::enable_if::value, int>::type tuple_type_size() { return 0; } /// Recursively generate the tuple type name template constexpr typename std::enable_if < I::value, int>::type tuple_type_size() { return subtype_count::type>::value + tuple_type_size(); } /// Get the type size of the sum of type sizes for all the individual tuple types template struct type_count::value && !is_complex::value>::type> { static constexpr int value{tuple_type_size()}; }; /// definition of subtype count template struct subtype_count { static constexpr int value{is_mutable_container::value ? expected_max_vector_size : type_count::value}; }; /// This will only trigger for actual void type template struct type_count_min { static const int value{0}; }; /// Type size for regular object types that do not look like a tuple template struct type_count_min< T, typename std::enable_if::value && !is_tuple_like::value && !is_wrapper::value && !is_complex::value && !std::is_void::value>::type> { static constexpr int value{type_count::value}; }; /// Type size for complex since it sometimes looks like a wrapper template struct type_count_min::value>::type> { static constexpr int value{1}; }; /// Type size min of types that are wrappers,except complex and tuples(which can also be wrappers sometimes) template struct type_count_min< T, typename std::enable_if::value && !is_complex::value && !is_tuple_like::value>::type> { static constexpr int value{subtype_count_min::value}; }; /// 0 if the index > tuple size template constexpr typename std::enable_if::value, int>::type tuple_type_size_min() { return 0; } /// Recursively generate the tuple type name template constexpr typename std::enable_if < I::value, int>::type tuple_type_size_min() { return subtype_count_min::type>::value + tuple_type_size_min(); } /// Get the type size of the sum of type sizes for all the individual tuple types template struct type_count_min::value && !is_complex::value>::type> { static constexpr int value{tuple_type_size_min()}; }; /// definition of subtype count template struct subtype_count_min { static constexpr int value{is_mutable_container::value ? ((type_count::value < expected_max_vector_size) ? type_count::value : 0) : type_count_min::value}; }; /// This will only trigger for actual void type template struct expected_count { static const int value{0}; }; /// For most types the number of expected items is 1 template struct expected_count::value && !is_wrapper::value && !std::is_void::value>::type> { static constexpr int value{1}; }; /// number of expected items in a vector template struct expected_count::value>::type> { static constexpr int value{expected_max_vector_size}; }; /// number of expected items in a vector template struct expected_count::value && is_wrapper::value>::type> { static constexpr int value{expected_count::value}; }; // Enumeration of the different supported categorizations of objects enum class object_category : std::uint8_t { char_value = 1, integral_value = 2, unsigned_integral = 4, enumeration = 6, boolean_value = 8, floating_point = 10, number_constructible = 12, double_constructible = 14, integer_constructible = 16, // string like types string_assignable = 23, string_constructible = 24, wstring_assignable = 25, wstring_constructible = 26, other = 45, // special wrapper or container types wrapper_value = 50, complex_number = 60, tuple_value = 70, container_value = 80, }; /// Set of overloads to classify an object according to type /// some type that is not otherwise recognized template struct classify_object { static constexpr object_category value{object_category::other}; }; /// Signed integers template struct classify_object< T, typename std::enable_if::value && !std::is_same::value && std::is_signed::value && !is_bool::value && !std::is_enum::value>::type> { static constexpr object_category value{object_category::integral_value}; }; /// Unsigned integers template struct classify_object::value && std::is_unsigned::value && !std::is_same::value && !is_bool::value>::type> { static constexpr object_category value{object_category::unsigned_integral}; }; /// single character values template struct classify_object::value && !std::is_enum::value>::type> { static constexpr object_category value{object_category::char_value}; }; /// Boolean values template struct classify_object::value>::type> { static constexpr object_category value{object_category::boolean_value}; }; /// Floats template struct classify_object::value>::type> { static constexpr object_category value{object_category::floating_point}; }; #if defined _MSC_VER // in MSVC wstring should take precedence if available this isn't as useful on other compilers due to the broader use of // utf-8 encoding #define WIDE_STRING_CHECK \ !std::is_assignable::value && !std::is_constructible::value #define STRING_CHECK true #else #define WIDE_STRING_CHECK true #define STRING_CHECK !std::is_assignable::value && !std::is_constructible::value #endif /// String and similar direct assignment template struct classify_object< T, typename std::enable_if::value && !std::is_integral::value && WIDE_STRING_CHECK && std::is_assignable::value>::type> { static constexpr object_category value{object_category::string_assignable}; }; /// String and similar constructible and copy assignment template struct classify_object< T, typename std::enable_if::value && !std::is_integral::value && !std::is_assignable::value && (type_count::value == 1) && WIDE_STRING_CHECK && std::is_constructible::value>::type> { static constexpr object_category value{object_category::string_constructible}; }; /// Wide strings template struct classify_object::value && !std::is_integral::value && STRING_CHECK && std::is_assignable::value>::type> { static constexpr object_category value{object_category::wstring_assignable}; }; template struct classify_object< T, typename std::enable_if::value && !std::is_integral::value && !std::is_assignable::value && (type_count::value == 1) && STRING_CHECK && std::is_constructible::value>::type> { static constexpr object_category value{object_category::wstring_constructible}; }; /// Enumerations template struct classify_object::value>::type> { static constexpr object_category value{object_category::enumeration}; }; template struct classify_object::value>::type> { static constexpr object_category value{object_category::complex_number}; }; /// Handy helper to contain a bunch of checks that rule out many common types (integers, string like, floating point, /// vectors, and enumerations template struct uncommon_type { using type = typename std::conditional< !std::is_floating_point::value && !std::is_integral::value && !std::is_assignable::value && !std::is_constructible::value && !std::is_assignable::value && !std::is_constructible::value && !is_complex::value && !is_mutable_container::value && !std::is_enum::value, std::true_type, std::false_type>::type; static constexpr bool value = type::value; }; /// wrapper type template struct classify_object::value && is_wrapper::value && !is_tuple_like::value && uncommon_type::value)>::type> { static constexpr object_category value{object_category::wrapper_value}; }; /// Assignable from double or int template struct classify_object::value && type_count::value == 1 && !is_wrapper::value && is_direct_constructible::value && is_direct_constructible::value>::type> { static constexpr object_category value{object_category::number_constructible}; }; /// Assignable from int template struct classify_object::value && type_count::value == 1 && !is_wrapper::value && !is_direct_constructible::value && is_direct_constructible::value>::type> { static constexpr object_category value{object_category::integer_constructible}; }; /// Assignable from double template struct classify_object::value && type_count::value == 1 && !is_wrapper::value && is_direct_constructible::value && !is_direct_constructible::value>::type> { static constexpr object_category value{object_category::double_constructible}; }; /// Tuple type template struct classify_object< T, typename std::enable_if::value && ((type_count::value >= 2 && !is_wrapper::value) || (uncommon_type::value && !is_direct_constructible::value && !is_direct_constructible::value) || (uncommon_type::value && type_count::value >= 2))>::type> { static constexpr object_category value{object_category::tuple_value}; // the condition on this class requires it be like a tuple, but on some compilers (like Xcode) tuples can be // constructed from just the first element so tuples of can be constructed from a string, which // could lead to issues so there are two variants of the condition, the first isolates things with a type size >=2 // mainly to get tuples on Xcode with the exception of wrappers, the second is the main one and just separating out // those cases that are caught by other object classifications }; /// container type template struct classify_object::value>::type> { static constexpr object_category value{object_category::container_value}; }; // Type name print /// Was going to be based on /// http://stackoverflow.com/questions/1055452/c-get-name-of-type-in-template /// But this is cleaner and works better in this case template ::value == object_category::char_value, detail::enabler> = detail::dummy> constexpr const char *type_name() { return "CHAR"; } template ::value == object_category::integral_value || classify_object::value == object_category::integer_constructible, detail::enabler> = detail::dummy> constexpr const char *type_name() { return "INT"; } template ::value == object_category::unsigned_integral, detail::enabler> = detail::dummy> constexpr const char *type_name() { return "UINT"; } template ::value == object_category::floating_point || classify_object::value == object_category::number_constructible || classify_object::value == object_category::double_constructible, detail::enabler> = detail::dummy> constexpr const char *type_name() { return "FLOAT"; } /// Print name for enumeration types template ::value == object_category::enumeration, detail::enabler> = detail::dummy> constexpr const char *type_name() { return "ENUM"; } /// Print name for enumeration types template ::value == object_category::boolean_value, detail::enabler> = detail::dummy> constexpr const char *type_name() { return "BOOLEAN"; } /// Print name for enumeration types template ::value == object_category::complex_number, detail::enabler> = detail::dummy> constexpr const char *type_name() { return "COMPLEX"; } /// Print for all other types template ::value >= object_category::string_assignable && classify_object::value <= object_category::other, detail::enabler> = detail::dummy> constexpr const char *type_name() { return "TEXT"; } /// typename for tuple value template ::value == object_category::tuple_value && type_count_base::value >= 2, detail::enabler> = detail::dummy> std::string type_name(); // forward declaration /// Generate type name for a wrapper or container value template ::value == object_category::container_value || classify_object::value == object_category::wrapper_value, detail::enabler> = detail::dummy> std::string type_name(); // forward declaration /// Print name for single element tuple types template ::value == object_category::tuple_value && type_count_base::value == 1, detail::enabler> = detail::dummy> inline std::string type_name() { return type_name::type>::type>(); } /// Empty string if the index > tuple size template inline typename std::enable_if::value, std::string>::type tuple_name() { return std::string{}; } /// Recursively generate the tuple type name template inline typename std::enable_if<(I < type_count_base::value), std::string>::type tuple_name() { auto str = std::string{type_name::type>::type>()} + ',' + tuple_name(); if(str.back() == ',') str.pop_back(); return str; } /// Print type name for tuples with 2 or more elements template ::value == object_category::tuple_value && type_count_base::value >= 2, detail::enabler>> inline std::string type_name() { auto tname = std::string(1, '[') + tuple_name(); tname.push_back(']'); return tname; } /// get the type name for a type that has a value_type member template ::value == object_category::container_value || classify_object::value == object_category::wrapper_value, detail::enabler>> inline std::string type_name() { return type_name(); } // Lexical cast /// Convert to an unsigned integral template ::value, detail::enabler> = detail::dummy> bool integral_conversion(const std::string &input, T &output) noexcept { if(input.empty() || input.front() == '-') { return false; } char *val{nullptr}; errno = 0; std::uint64_t output_ll = std::strtoull(input.c_str(), &val, 0); if(errno == ERANGE) { return false; } output = static_cast(output_ll); if(val == (input.c_str() + input.size()) && static_cast(output) == output_ll) { return true; } val = nullptr; std::int64_t output_sll = std::strtoll(input.c_str(), &val, 0); if(val == (input.c_str() + input.size())) { output = (output_sll < 0) ? static_cast(0) : static_cast(output_sll); return (static_cast(output) == output_sll); } // remove separators if present auto group_separators = get_group_separators(); if(input.find_first_of(group_separators) != std::string::npos) { std::string nstring = input; for(auto &separator : group_separators) { if(input.find_first_of(separator) != std::string::npos) { nstring.erase(std::remove(nstring.begin(), nstring.end(), separator), nstring.end()); } } return integral_conversion(nstring, output); } if(std::isspace(static_cast(input.back()))) { return integral_conversion(trim_copy(input), output); } if(input.compare(0, 2, "0o") == 0 || input.compare(0, 2, "0O") == 0) { val = nullptr; errno = 0; output_ll = std::strtoull(input.c_str() + 2, &val, 8); if(errno == ERANGE) { return false; } output = static_cast(output_ll); return (val == (input.c_str() + input.size()) && static_cast(output) == output_ll); } if(input.compare(0, 2, "0b") == 0 || input.compare(0, 2, "0B") == 0) { // LCOV_EXCL_START // In some new compilers including the coverage testing one binary strings are handled properly in strtoull // automatically so this coverage is missing but is well tested in other compilers val = nullptr; errno = 0; output_ll = std::strtoull(input.c_str() + 2, &val, 2); if(errno == ERANGE) { return false; } output = static_cast(output_ll); return (val == (input.c_str() + input.size()) && static_cast(output) == output_ll); // LCOV_EXCL_STOP } return false; } /// Convert to a signed integral template ::value, detail::enabler> = detail::dummy> bool integral_conversion(const std::string &input, T &output) noexcept { if(input.empty()) { return false; } char *val = nullptr; errno = 0; std::int64_t output_ll = std::strtoll(input.c_str(), &val, 0); if(errno == ERANGE) { return false; } output = static_cast(output_ll); if(val == (input.c_str() + input.size()) && static_cast(output) == output_ll) { return true; } if(input == "true") { // this is to deal with a few oddities with flags and wrapper int types output = static_cast(1); return true; } // remove separators if present auto group_separators = get_group_separators(); if(input.find_first_of(group_separators) != std::string::npos) { for(auto &separator : group_separators) { if(input.find_first_of(separator) != std::string::npos) { std::string nstring = input; nstring.erase(std::remove(nstring.begin(), nstring.end(), separator), nstring.end()); return integral_conversion(nstring, output); } } } if(std::isspace(static_cast(input.back()))) { return integral_conversion(trim_copy(input), output); } if(input.compare(0, 2, "0o") == 0 || input.compare(0, 2, "0O") == 0) { val = nullptr; errno = 0; output_ll = std::strtoll(input.c_str() + 2, &val, 8); if(errno == ERANGE) { return false; } output = static_cast(output_ll); return (val == (input.c_str() + input.size()) && static_cast(output) == output_ll); } if(input.compare(0, 2, "0b") == 0 || input.compare(0, 2, "0B") == 0) { // LCOV_EXCL_START // In some new compilers including the coverage testing one binary strings are handled properly in strtoll // automatically so this coverage is missing but is well tested in other compilers val = nullptr; errno = 0; output_ll = std::strtoll(input.c_str() + 2, &val, 2); if(errno == ERANGE) { return false; } output = static_cast(output_ll); return (val == (input.c_str() + input.size()) && static_cast(output) == output_ll); // LCOV_EXCL_STOP } return false; } /// Convert a flag into an integer value typically binary flags sets errno to nonzero if conversion failed inline std::int64_t to_flag_value(std::string val) noexcept { static const std::string trueString("true"); static const std::string falseString("false"); if(val == trueString) { return 1; } if(val == falseString) { return -1; } val = detail::to_lower(val); std::int64_t ret = 0; if(val.size() == 1) { if(val[0] >= '1' && val[0] <= '9') { return (static_cast(val[0]) - '0'); } switch(val[0]) { case '0': case 'f': case 'n': case '-': ret = -1; break; case 't': case 'y': case '+': ret = 1; break; default: errno = EINVAL; return -1; } return ret; } if(val == trueString || val == "on" || val == "yes" || val == "enable") { ret = 1; } else if(val == falseString || val == "off" || val == "no" || val == "disable") { ret = -1; } else { char *loc_ptr{nullptr}; ret = std::strtoll(val.c_str(), &loc_ptr, 0); if(loc_ptr != (val.c_str() + val.size()) && errno == 0) { errno = EINVAL; } } return ret; } /// Integer conversion template ::value == object_category::integral_value || classify_object::value == object_category::unsigned_integral, detail::enabler> = detail::dummy> bool lexical_cast(const std::string &input, T &output) { return integral_conversion(input, output); } /// char values template ::value == object_category::char_value, detail::enabler> = detail::dummy> bool lexical_cast(const std::string &input, T &output) { if(input.size() == 1) { output = static_cast(input[0]); return true; } std::int8_t res{0}; // we do it this way as some systems have char as signed and not, this ensures consistency in the way things are // handled bool result = integral_conversion(input, res); if(result) { output = static_cast(res); } return result; } /// Boolean values template ::value == object_category::boolean_value, detail::enabler> = detail::dummy> bool lexical_cast(const std::string &input, T &output) { errno = 0; auto out = to_flag_value(input); if(errno == 0) { output = (out > 0); } else if(errno == ERANGE) { output = (input[0] != '-'); } else { return false; } return true; } /// Floats template ::value == object_category::floating_point, detail::enabler> = detail::dummy> bool lexical_cast(const std::string &input, T &output) { if(input.empty()) { return false; } char *val = nullptr; auto output_ld = std::strtold(input.c_str(), &val); output = static_cast(output_ld); if(val == (input.c_str() + input.size())) { return true; } while(std::isspace(static_cast(*val))) { ++val; if(val == (input.c_str() + input.size())) { return true; } } // remove separators if present auto group_separators = get_group_separators(); if(input.find_first_of(group_separators) != std::string::npos) { for(auto &separator : group_separators) { if(input.find_first_of(separator) != std::string::npos) { std::string nstring = input; nstring.erase(std::remove(nstring.begin(), nstring.end(), separator), nstring.end()); return lexical_cast(nstring, output); } } } return false; } /// complex template ::value == object_category::complex_number, detail::enabler> = detail::dummy> bool lexical_cast(const std::string &input, T &output) { using XC = typename wrapped_type::type; XC x{0.0}, y{0.0}; auto str1 = input; bool worked = false; auto nloc = str1.find_last_of("+-"); if(nloc != std::string::npos && nloc > 0) { worked = lexical_cast(str1.substr(0, nloc), x); str1 = str1.substr(nloc); if(str1.back() == 'i' || str1.back() == 'j') str1.pop_back(); worked = worked && lexical_cast(str1, y); } else { if(str1.back() == 'i' || str1.back() == 'j') { str1.pop_back(); worked = lexical_cast(str1, y); x = XC{0}; } else { worked = lexical_cast(str1, x); y = XC{0}; } } if(worked) { output = T{x, y}; return worked; } return from_stream(input, output); } /// String and similar direct assignment template ::value == object_category::string_assignable, detail::enabler> = detail::dummy> bool lexical_cast(const std::string &input, T &output) { output = input; return true; } /// String and similar constructible and copy assignment template < typename T, enable_if_t::value == object_category::string_constructible, detail::enabler> = detail::dummy> bool lexical_cast(const std::string &input, T &output) { output = T(input); return true; } /// Wide strings template < typename T, enable_if_t::value == object_category::wstring_assignable, detail::enabler> = detail::dummy> bool lexical_cast(const std::string &input, T &output) { output = widen(input); return true; } template < typename T, enable_if_t::value == object_category::wstring_constructible, detail::enabler> = detail::dummy> bool lexical_cast(const std::string &input, T &output) { output = T{widen(input)}; return true; } /// Enumerations template ::value == object_category::enumeration, detail::enabler> = detail::dummy> bool lexical_cast(const std::string &input, T &output) { typename std::underlying_type::type val; if(!integral_conversion(input, val)) { return false; } output = static_cast(val); return true; } /// wrapper types template ::value == object_category::wrapper_value && std::is_assignable::value, detail::enabler> = detail::dummy> bool lexical_cast(const std::string &input, T &output) { typename T::value_type val; if(lexical_cast(input, val)) { output = val; return true; } return from_stream(input, output); } template ::value == object_category::wrapper_value && !std::is_assignable::value && std::is_assignable::value, detail::enabler> = detail::dummy> bool lexical_cast(const std::string &input, T &output) { typename T::value_type val; if(lexical_cast(input, val)) { output = T{val}; return true; } return from_stream(input, output); } /// Assignable from double or int template < typename T, enable_if_t::value == object_category::number_constructible, detail::enabler> = detail::dummy> bool lexical_cast(const std::string &input, T &output) { int val = 0; if(integral_conversion(input, val)) { output = T(val); return true; } double dval = 0.0; if(lexical_cast(input, dval)) { output = T{dval}; return true; } return from_stream(input, output); } /// Assignable from int template < typename T, enable_if_t::value == object_category::integer_constructible, detail::enabler> = detail::dummy> bool lexical_cast(const std::string &input, T &output) { int val = 0; if(integral_conversion(input, val)) { output = T(val); return true; } return from_stream(input, output); } /// Assignable from double template < typename T, enable_if_t::value == object_category::double_constructible, detail::enabler> = detail::dummy> bool lexical_cast(const std::string &input, T &output) { double val = 0.0; if(lexical_cast(input, val)) { output = T{val}; return true; } return from_stream(input, output); } /// Non-string convertible from an int template ::value == object_category::other && std::is_assignable::value, detail::enabler> = detail::dummy> bool lexical_cast(const std::string &input, T &output) { int val = 0; if(integral_conversion(input, val)) { #ifdef _MSC_VER #pragma warning(push) #pragma warning(disable : 4800) #endif // with Atomic this could produce a warning due to the conversion but if atomic gets here it is an old style // so will most likely still work output = val; #ifdef _MSC_VER #pragma warning(pop) #endif return true; } // LCOV_EXCL_START // This version of cast is only used for odd cases in an older compilers the fail over // from_stream is tested elsewhere an not relevant for coverage here return from_stream(input, output); // LCOV_EXCL_STOP } /// Non-string parsable by a stream template ::value == object_category::other && !std::is_assignable::value && is_istreamable::value, detail::enabler> = detail::dummy> bool lexical_cast(const std::string &input, T &output) { return from_stream(input, output); } /// Fallback overload that prints a human-readable error for types that we don't recognize and that don't have a /// user-supplied lexical_cast overload. template ::value == object_category::other && !std::is_assignable::value && !is_istreamable::value && !adl_detail::is_lexical_castable::value, detail::enabler> = detail::dummy> bool lexical_cast(const std::string & /*input*/, T & /*output*/) { static_assert(!std::is_same::value, // Can't just write false here. "option object type must have a lexical cast overload or streaming input operator(>>) defined, if it " "is convertible from another type use the add_option(...) with XC being the known type"); return false; } /// Assign a value through lexical cast operations /// Strings can be empty so we need to do a little different template ::value && (classify_object::value == object_category::string_assignable || classify_object::value == object_category::string_constructible || classify_object::value == object_category::wstring_assignable || classify_object::value == object_category::wstring_constructible), detail::enabler> = detail::dummy> bool lexical_assign(const std::string &input, AssignTo &output) { return lexical_cast(input, output); } /// Assign a value through lexical cast operations template ::value && std::is_assignable::value && classify_object::value != object_category::string_assignable && classify_object::value != object_category::string_constructible && classify_object::value != object_category::wstring_assignable && classify_object::value != object_category::wstring_constructible, detail::enabler> = detail::dummy> bool lexical_assign(const std::string &input, AssignTo &output) { if(input.empty()) { output = AssignTo{}; return true; } return lexical_cast(input, output); } // LCOV_EXCL_LINE /// Assign a value through lexical cast operations template ::value && !std::is_assignable::value && classify_object::value == object_category::wrapper_value, detail::enabler> = detail::dummy> bool lexical_assign(const std::string &input, AssignTo &output) { if(input.empty()) { typename AssignTo::value_type emptyVal{}; output = emptyVal; return true; } return lexical_cast(input, output); } /// Assign a value through lexical cast operations for int compatible values /// mainly for atomic operations on some compilers template ::value && !std::is_assignable::value && classify_object::value != object_category::wrapper_value && std::is_assignable::value, detail::enabler> = detail::dummy> bool lexical_assign(const std::string &input, AssignTo &output) { if(input.empty()) { output = 0; return true; } int val{0}; if(lexical_cast(input, val)) { #if defined(__clang__) /* on some older clang compilers */ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wsign-conversion" #endif output = val; #if defined(__clang__) #pragma clang diagnostic pop #endif return true; } return false; } /// Assign a value converted from a string in lexical cast to the output value directly template ::value && std::is_assignable::value, detail::enabler> = detail::dummy> bool lexical_assign(const std::string &input, AssignTo &output) { ConvertTo val{}; bool parse_result = (!input.empty()) ? lexical_cast(input, val) : true; if(parse_result) { output = val; } return parse_result; } /// Assign a value from a lexical cast through constructing a value and move assigning it template < typename AssignTo, typename ConvertTo, enable_if_t::value && !std::is_assignable::value && std::is_move_assignable::value, detail::enabler> = detail::dummy> bool lexical_assign(const std::string &input, AssignTo &output) { ConvertTo val{}; bool parse_result = input.empty() ? true : lexical_cast(input, val); if(parse_result) { output = AssignTo(val); // use () form of constructor to allow some implicit conversions } return parse_result; } /// primary lexical conversion operation, 1 string to 1 type of some kind template ::value <= object_category::other && classify_object::value <= object_category::wrapper_value, detail::enabler> = detail::dummy> bool lexical_conversion(const std::vector &strings, AssignTo &output) { return lexical_assign(strings[0], output); } /// Lexical conversion if there is only one element but the conversion type is for two, then call a two element /// constructor template ::value <= 2) && expected_count::value == 1 && is_tuple_like::value && type_count_base::value == 2, detail::enabler> = detail::dummy> bool lexical_conversion(const std::vector &strings, AssignTo &output) { // the remove const is to handle pair types coming from a container using FirstType = typename std::remove_const::type>::type; using SecondType = typename std::tuple_element<1, ConvertTo>::type; FirstType v1; SecondType v2{}; bool retval = lexical_assign(strings[0], v1); retval = retval && lexical_assign((strings.size() > 1) ? strings[1] : std::string{}, v2); if(retval) { output = AssignTo{v1, v2}; } return retval; } /// Lexical conversion of a container types of single elements template ::value && is_mutable_container::value && type_count::value == 1, detail::enabler> = detail::dummy> bool lexical_conversion(const std::vector &strings, AssignTo &output) { output.erase(output.begin(), output.end()); if(strings.empty()) { return true; } if(strings.size() == 1 && strings[0] == "{}") { return true; } bool skip_remaining = false; if(strings.size() == 2 && strings[0] == "{}" && is_separator(strings[1])) { skip_remaining = true; } for(const auto &elem : strings) { typename AssignTo::value_type out; bool retval = lexical_assign(elem, out); if(!retval) { return false; } output.insert(output.end(), std::move(out)); if(skip_remaining) { break; } } return (!output.empty()); } /// Lexical conversion for complex types template ::value, detail::enabler> = detail::dummy> bool lexical_conversion(const std::vector &strings, AssignTo &output) { if(strings.size() >= 2 && !strings[1].empty()) { using XC2 = typename wrapped_type::type; XC2 x{0.0}, y{0.0}; auto str1 = strings[1]; if(str1.back() == 'i' || str1.back() == 'j') { str1.pop_back(); } auto worked = lexical_cast(strings[0], x) && lexical_cast(str1, y); if(worked) { output = ConvertTo{x, y}; } return worked; } return lexical_assign(strings[0], output); } /// Conversion to a vector type using a particular single type as the conversion type template ::value && (expected_count::value == 1) && (type_count::value == 1), detail::enabler> = detail::dummy> bool lexical_conversion(const std::vector &strings, AssignTo &output) { bool retval = true; output.clear(); output.reserve(strings.size()); for(const auto &elem : strings) { output.emplace_back(); retval = retval && lexical_assign(elem, output.back()); } return (!output.empty()) && retval; } // forward declaration /// Lexical conversion of a container types with conversion type of two elements template ::value && is_mutable_container::value && type_count_base::value == 2, detail::enabler> = detail::dummy> bool lexical_conversion(std::vector strings, AssignTo &output); /// Lexical conversion of a vector types with type_size >2 forward declaration template ::value && is_mutable_container::value && type_count_base::value != 2 && ((type_count::value > 2) || (type_count::value > type_count_base::value)), detail::enabler> = detail::dummy> bool lexical_conversion(const std::vector &strings, AssignTo &output); /// Conversion for tuples template ::value && is_tuple_like::value && (type_count_base::value != type_count::value || type_count::value > 2), detail::enabler> = detail::dummy> bool lexical_conversion(const std::vector &strings, AssignTo &output); // forward declaration /// Conversion for operations where the assigned type is some class but the conversion is a mutable container or large /// tuple template ::value && !is_mutable_container::value && classify_object::value != object_category::wrapper_value && (is_mutable_container::value || type_count::value > 2), detail::enabler> = detail::dummy> bool lexical_conversion(const std::vector &strings, AssignTo &output) { if(strings.size() > 1 || (!strings.empty() && !(strings.front().empty()))) { ConvertTo val; auto retval = lexical_conversion(strings, val); output = AssignTo{val}; return retval; } output = AssignTo{}; return true; } /// function template for converting tuples if the static Index is greater than the tuple size template inline typename std::enable_if<(I >= type_count_base::value), bool>::type tuple_conversion(const std::vector &, AssignTo &) { return true; } /// Conversion of a tuple element where the type size ==1 and not a mutable container template inline typename std::enable_if::value && type_count::value == 1, bool>::type tuple_type_conversion(std::vector &strings, AssignTo &output) { auto retval = lexical_assign(strings[0], output); strings.erase(strings.begin()); return retval; } /// Conversion of a tuple element where the type size !=1 but the size is fixed and not a mutable container template inline typename std::enable_if::value && (type_count::value > 1) && type_count::value == type_count_min::value, bool>::type tuple_type_conversion(std::vector &strings, AssignTo &output) { auto retval = lexical_conversion(strings, output); strings.erase(strings.begin(), strings.begin() + type_count::value); return retval; } /// Conversion of a tuple element where the type is a mutable container or a type with different min and max type sizes template inline typename std::enable_if::value || type_count::value != type_count_min::value, bool>::type tuple_type_conversion(std::vector &strings, AssignTo &output) { std::size_t index{subtype_count_min::value}; const std::size_t mx_count{subtype_count::value}; const std::size_t mx{(std::min)(mx_count, strings.size() - 1)}; while(index < mx) { if(is_separator(strings[index])) { break; } ++index; } bool retval = lexical_conversion( std::vector(strings.begin(), strings.begin() + static_cast(index)), output); if(strings.size() > index) { strings.erase(strings.begin(), strings.begin() + static_cast(index) + 1); } else { strings.clear(); } return retval; } /// Tuple conversion operation template inline typename std::enable_if<(I < type_count_base::value), bool>::type tuple_conversion(std::vector strings, AssignTo &output) { bool retval = true; using ConvertToElement = typename std:: conditional::value, typename std::tuple_element::type, ConvertTo>::type; if(!strings.empty()) { retval = retval && tuple_type_conversion::type, ConvertToElement>( strings, std::get(output)); } retval = retval && tuple_conversion(std::move(strings), output); return retval; } /// Lexical conversion of a container types with tuple elements of size 2 template ::value && is_mutable_container::value && type_count_base::value == 2, detail::enabler>> bool lexical_conversion(std::vector strings, AssignTo &output) { output.clear(); while(!strings.empty()) { typename std::remove_const::type>::type v1; typename std::tuple_element<1, typename ConvertTo::value_type>::type v2; bool retval = tuple_type_conversion(strings, v1); if(!strings.empty()) { retval = retval && tuple_type_conversion(strings, v2); } if(retval) { output.insert(output.end(), typename AssignTo::value_type{v1, v2}); } else { return false; } } return (!output.empty()); } /// lexical conversion of tuples with type count>2 or tuples of types of some element with a type size>=2 template ::value && is_tuple_like::value && (type_count_base::value != type_count::value || type_count::value > 2), detail::enabler>> bool lexical_conversion(const std::vector &strings, AssignTo &output) { static_assert( !is_tuple_like::value || type_count_base::value == type_count_base::value, "if the conversion type is defined as a tuple it must be the same size as the type you are converting to"); return tuple_conversion(strings, output); } /// Lexical conversion of a vector types for everything but tuples of two elements and types of size 1 template ::value && is_mutable_container::value && type_count_base::value != 2 && ((type_count::value > 2) || (type_count::value > type_count_base::value)), detail::enabler>> bool lexical_conversion(const std::vector &strings, AssignTo &output) { bool retval = true; output.clear(); std::vector temp; std::size_t ii{0}; std::size_t icount{0}; std::size_t xcm{type_count::value}; auto ii_max = strings.size(); while(ii < ii_max) { temp.push_back(strings[ii]); ++ii; ++icount; if(icount == xcm || is_separator(temp.back()) || ii == ii_max) { if(static_cast(xcm) > type_count_min::value && is_separator(temp.back())) { temp.pop_back(); } typename AssignTo::value_type temp_out; retval = retval && lexical_conversion(temp, temp_out); temp.clear(); if(!retval) { return false; } output.insert(output.end(), std::move(temp_out)); icount = 0; } } return retval; } /// conversion for wrapper types template ::value == object_category::wrapper_value && std::is_assignable::value, detail::enabler> = detail::dummy> bool lexical_conversion(const std::vector &strings, AssignTo &output) { if(strings.empty() || strings.front().empty()) { output = ConvertTo{}; return true; } typename ConvertTo::value_type val; if(lexical_conversion(strings, val)) { output = ConvertTo{val}; return true; } return false; } /// conversion for wrapper types template ::value == object_category::wrapper_value && !std::is_assignable::value, detail::enabler> = detail::dummy> bool lexical_conversion(const std::vector &strings, AssignTo &output) { using ConvertType = typename ConvertTo::value_type; if(strings.empty() || strings.front().empty()) { output = ConvertType{}; return true; } ConvertType val; if(lexical_conversion(strings, val)) { output = val; return true; } return false; } /// Sum a vector of strings inline std::string sum_string_vector(const std::vector &values) { double val{0.0}; bool fail{false}; std::string output; for(const auto &arg : values) { double tv{0.0}; auto comp = lexical_cast(arg, tv); if(!comp) { errno = 0; auto fv = detail::to_flag_value(arg); fail = (errno != 0); if(fail) { break; } tv = static_cast(fv); } val += tv; } if(fail) { for(const auto &arg : values) { output.append(arg); } } else { std::ostringstream out; out.precision(16); out << val; output = out.str(); } return output; } } // namespace detail namespace detail { // Returns false if not a short option. Otherwise, sets opt name and rest and returns true CLI11_INLINE bool split_short(const std::string ¤t, std::string &name, std::string &rest); // Returns false if not a long option. Otherwise, sets opt name and other side of = and returns true CLI11_INLINE bool split_long(const std::string ¤t, std::string &name, std::string &value); // Returns false if not a windows style option. Otherwise, sets opt name and value and returns true CLI11_INLINE bool split_windows_style(const std::string ¤t, std::string &name, std::string &value); // Splits a string into multiple long and short names CLI11_INLINE std::vector split_names(std::string current); /// extract default flag values either {def} or starting with a ! CLI11_INLINE std::vector> get_default_flag_values(const std::string &str); /// Get a vector of short names, one of long names, and a single name CLI11_INLINE std::tuple, std::vector, std::string> get_names(const std::vector &input, bool allow_non_standard = false); } // namespace detail namespace detail { CLI11_INLINE bool split_short(const std::string ¤t, std::string &name, std::string &rest) { if(current.size() > 1 && current[0] == '-' && valid_first_char(current[1])) { name = current.substr(1, 1); rest = current.substr(2); return true; } return false; } CLI11_INLINE bool split_long(const std::string ¤t, std::string &name, std::string &value) { if(current.size() > 2 && current.compare(0, 2, "--") == 0 && valid_first_char(current[2])) { auto loc = current.find_first_of('='); if(loc != std::string::npos) { name = current.substr(2, loc - 2); value = current.substr(loc + 1); } else { name = current.substr(2); value = ""; } return true; } return false; } CLI11_INLINE bool split_windows_style(const std::string ¤t, std::string &name, std::string &value) { if(current.size() > 1 && current[0] == '/' && valid_first_char(current[1])) { auto loc = current.find_first_of(':'); if(loc != std::string::npos) { name = current.substr(1, loc - 1); value = current.substr(loc + 1); } else { name = current.substr(1); value = ""; } return true; } return false; } CLI11_INLINE std::vector split_names(std::string current) { std::vector output; std::size_t val = 0; while((val = current.find(',')) != std::string::npos) { output.push_back(trim_copy(current.substr(0, val))); current = current.substr(val + 1); } output.push_back(trim_copy(current)); return output; } CLI11_INLINE std::vector> get_default_flag_values(const std::string &str) { std::vector flags = split_names(str); flags.erase(std::remove_if(flags.begin(), flags.end(), [](const std::string &name) { return ((name.empty()) || (!(((name.find_first_of('{') != std::string::npos) && (name.back() == '}')) || (name[0] == '!')))); }), flags.end()); std::vector> output; output.reserve(flags.size()); for(auto &flag : flags) { auto def_start = flag.find_first_of('{'); std::string defval = "false"; if((def_start != std::string::npos) && (flag.back() == '}')) { defval = flag.substr(def_start + 1); defval.pop_back(); flag.erase(def_start, std::string::npos); // NOLINT(readability-suspicious-call-argument) } flag.erase(0, flag.find_first_not_of("-!")); output.emplace_back(flag, defval); } return output; } CLI11_INLINE std::tuple, std::vector, std::string> get_names(const std::vector &input, bool allow_non_standard) { std::vector short_names; std::vector long_names; std::string pos_name; for(std::string name : input) { if(name.empty()) { continue; } if(name.length() > 1 && name[0] == '-' && name[1] != '-') { if(name.length() == 2 && valid_first_char(name[1])) { short_names.emplace_back(1, name[1]); } else if(name.length() > 2) { if(allow_non_standard) { name = name.substr(1); if(valid_name_string(name)) { short_names.push_back(name); } else { throw BadNameString::BadLongName(name); } } else { throw BadNameString::MissingDash(name); } } else { throw BadNameString::OneCharName(name); } } else if(name.length() > 2 && name.substr(0, 2) == "--") { name = name.substr(2); if(valid_name_string(name)) { long_names.push_back(name); } else { throw BadNameString::BadLongName(name); } } else if(name == "-" || name == "--" || name == "++") { throw BadNameString::ReservedName(name); } else { if(!pos_name.empty()) { throw BadNameString::MultiPositionalNames(name); } if(valid_name_string(name)) { pos_name = name; } else { throw BadNameString::BadPositionalName(name); } } } return std::make_tuple(short_names, long_names, pos_name); } } // namespace detail class App; /// Holds values to load into Options struct ConfigItem { /// This is the list of parents std::vector parents{}; /// This is the name std::string name{}; /// Listing of inputs std::vector inputs{}; /// @brief indicator if a multiline vector separator was inserted bool multiline{false}; /// The list of parents and name joined by "." CLI11_NODISCARD std::string fullname() const { std::vector tmp = parents; tmp.emplace_back(name); return detail::join(tmp, "."); (void)multiline; // suppression for cppcheck false positive } }; /// This class provides a converter for configuration files. class Config { protected: std::vector items{}; public: /// Convert an app into a configuration virtual std::string to_config(const App *, bool, bool, std::string) const = 0; /// Convert a configuration into an app virtual std::vector from_config(std::istream &) const = 0; /// Get a flag value CLI11_NODISCARD virtual std::string to_flag(const ConfigItem &item) const { if(item.inputs.size() == 1) { return item.inputs.at(0); } if(item.inputs.empty()) { return "{}"; } throw ConversionError::TooManyInputsFlag(item.fullname()); // LCOV_EXCL_LINE } /// Parse a config file, throw an error (ParseError:ConfigParseError or FileError) on failure CLI11_NODISCARD std::vector from_file(const std::string &name) const { #if defined CLI11_HAS_FILESYSTEM && CLI11_HAS_FILESYSTEM > 0 std::ifstream input{to_path(name)}; #else std::ifstream input{name}; #endif if(!input.good()) throw FileError::Missing(name); return from_config(input); } /// Virtual destructor virtual ~Config() = default; }; /// This converter works with INI/TOML files; to write INI files use ConfigINI class ConfigBase : public Config { protected: /// the character used for comments char commentChar = '#'; /// the character used to start an array '\0' is a default to not use char arrayStart = '['; /// the character used to end an array '\0' is a default to not use char arrayEnd = ']'; /// the character used to separate elements in an array char arraySeparator = ','; /// the character used separate the name from the value char valueDelimiter = '='; /// the character to use around strings char stringQuote = '"'; /// the character to use around single characters and literal strings char literalQuote = '\''; /// the maximum number of layers to allow uint8_t maximumLayers{255}; /// the separator used to separator parent layers char parentSeparatorChar{'.'}; /// comment default values bool commentDefaultsBool = false; /// specify the config reader should collapse repeated field names to a single vector bool allowMultipleDuplicateFields{false}; /// Specify the configuration index to use for arrayed sections int16_t configIndex{-1}; /// Specify the configuration section that should be used std::string configSection{}; public: std::string to_config(const App * /*app*/, bool default_also, bool write_description, std::string prefix) const override; std::vector from_config(std::istream &input) const override; /// Specify the configuration for comment characters ConfigBase *comment(char cchar) { commentChar = cchar; return this; } /// Specify the start and end characters for an array ConfigBase *arrayBounds(char aStart, char aEnd) { arrayStart = aStart; arrayEnd = aEnd; return this; } /// Specify the delimiter character for an array ConfigBase *arrayDelimiter(char aSep) { arraySeparator = aSep; return this; } /// Specify the delimiter between a name and value ConfigBase *valueSeparator(char vSep) { valueDelimiter = vSep; return this; } /// Specify the quote characters used around strings and literal strings ConfigBase *quoteCharacter(char qString, char literalChar) { stringQuote = qString; literalQuote = literalChar; return this; } /// Specify the maximum number of parents ConfigBase *maxLayers(uint8_t layers) { maximumLayers = layers; return this; } /// Specify the separator to use for parent layers ConfigBase *parentSeparator(char sep) { parentSeparatorChar = sep; return this; } /// comment default value options ConfigBase *commentDefaults(bool comDef = true) { commentDefaultsBool = comDef; return this; } /// get a reference to the configuration section std::string §ionRef() { return configSection; } /// get the section CLI11_NODISCARD const std::string §ion() const { return configSection; } /// specify a particular section of the configuration file to use ConfigBase *section(const std::string §ionName) { configSection = sectionName; return this; } /// get a reference to the configuration index int16_t &indexRef() { return configIndex; } /// get the section index CLI11_NODISCARD int16_t index() const { return configIndex; } /// specify a particular index in the section to use (-1) for all sections to use ConfigBase *index(int16_t sectionIndex) { configIndex = sectionIndex; return this; } /// specify that multiple duplicate arguments should be merged even if not sequential ConfigBase *allowDuplicateFields(bool value = true) { allowMultipleDuplicateFields = value; return this; } }; /// the default Config is the TOML file format using ConfigTOML = ConfigBase; /// ConfigINI generates a "standard" INI compliant output class ConfigINI : public ConfigTOML { public: ConfigINI() { commentChar = ';'; arrayStart = '\0'; arrayEnd = '\0'; arraySeparator = ' '; valueDelimiter = '='; } }; class Option; /// @defgroup validator_group Validators /// @brief Some validators that are provided /// /// These are simple `std::string(const std::string&)` validators that are useful. They return /// a string if the validation fails. A custom struct is provided, as well, with the same user /// semantics, but with the ability to provide a new type name. /// @{ /// class Validator { protected: /// This is the description function, if empty the description_ will be used std::function desc_function_{[]() { return std::string{}; }}; /// This is the base function that is to be called. /// Returns a string error message if validation fails. std::function func_{[](std::string &) { return std::string{}; }}; /// The name for search purposes of the Validator std::string name_{}; /// A Validator will only apply to an indexed value (-1 is all elements) int application_index_ = -1; /// Enable for Validator to allow it to be disabled if need be bool active_{true}; /// specify that a validator should not modify the input bool non_modifying_{false}; Validator(std::string validator_desc, std::function func) : desc_function_([validator_desc]() { return validator_desc; }), func_(std::move(func)) {} public: Validator() = default; /// Construct a Validator with just the description string explicit Validator(std::string validator_desc) : desc_function_([validator_desc]() { return validator_desc; }) {} /// Construct Validator from basic information Validator(std::function op, std::string validator_desc, std::string validator_name = "") : desc_function_([validator_desc]() { return validator_desc; }), func_(std::move(op)), name_(std::move(validator_name)) {} /// Set the Validator operation function Validator &operation(std::function op) { func_ = std::move(op); return *this; } /// This is the required operator for a Validator - provided to help /// users (CLI11 uses the member `func` directly) std::string operator()(std::string &str) const; /// This is the required operator for a Validator - provided to help /// users (CLI11 uses the member `func` directly) std::string operator()(const std::string &str) const { std::string value = str; return (active_) ? func_(value) : std::string{}; } /// Specify the type string Validator &description(std::string validator_desc) { desc_function_ = [validator_desc]() { return validator_desc; }; return *this; } /// Specify the type string CLI11_NODISCARD Validator description(std::string validator_desc) const; /// Generate type description information for the Validator CLI11_NODISCARD std::string get_description() const { if(active_) { return desc_function_(); } return std::string{}; } /// Specify the type string Validator &name(std::string validator_name) { name_ = std::move(validator_name); return *this; } /// Specify the type string CLI11_NODISCARD Validator name(std::string validator_name) const { Validator newval(*this); newval.name_ = std::move(validator_name); return newval; } /// Get the name of the Validator CLI11_NODISCARD const std::string &get_name() const { return name_; } /// Specify whether the Validator is active or not Validator &active(bool active_val = true) { active_ = active_val; return *this; } /// Specify whether the Validator is active or not CLI11_NODISCARD Validator active(bool active_val = true) const { Validator newval(*this); newval.active_ = active_val; return newval; } /// Specify whether the Validator can be modifying or not Validator &non_modifying(bool no_modify = true) { non_modifying_ = no_modify; return *this; } /// Specify the application index of a validator Validator &application_index(int app_index) { application_index_ = app_index; return *this; } /// Specify the application index of a validator CLI11_NODISCARD Validator application_index(int app_index) const { Validator newval(*this); newval.application_index_ = app_index; return newval; } /// Get the current value of the application index CLI11_NODISCARD int get_application_index() const { return application_index_; } /// Get a boolean if the validator is active CLI11_NODISCARD bool get_active() const { return active_; } /// Get a boolean if the validator is allowed to modify the input returns true if it can modify the input CLI11_NODISCARD bool get_modifying() const { return !non_modifying_; } /// Combining validators is a new validator. Type comes from left validator if function, otherwise only set if the /// same. Validator operator&(const Validator &other) const; /// Combining validators is a new validator. Type comes from left validator if function, otherwise only set if the /// same. Validator operator|(const Validator &other) const; /// Create a validator that fails when a given validator succeeds Validator operator!() const; private: void _merge_description(const Validator &val1, const Validator &val2, const std::string &merger); }; /// Alias for Validator for custom Validator for clarity using CustomValidator = Validator; // The implementation of the built in validators is using the Validator class; // the user is only expected to use the const (static) versions (since there's no setup). // Therefore, this is in detail. namespace detail { /// CLI enumeration of different file types enum class path_type : std::uint8_t { nonexistent, file, directory }; /// get the type of the path from a file name CLI11_INLINE path_type check_path(const char *file) noexcept; // Static is not needed here, because global const implies static. /// Check for an existing file (returns error message if check fails) class ExistingFileValidator : public Validator { public: ExistingFileValidator(); }; /// Check for an existing directory (returns error message if check fails) class ExistingDirectoryValidator : public Validator { public: ExistingDirectoryValidator(); }; /// Check for an existing path class ExistingPathValidator : public Validator { public: ExistingPathValidator(); }; /// Check for an non-existing path class NonexistentPathValidator : public Validator { public: NonexistentPathValidator(); }; class EscapedStringTransformer : public Validator { public: EscapedStringTransformer(); }; } // namespace detail /// Check for existing file (returns error message if check fails) CLI11_MODULE_INLINE const detail::ExistingFileValidator ExistingFile; /// Check for an existing directory (returns error message if check fails) CLI11_MODULE_INLINE const detail::ExistingDirectoryValidator ExistingDirectory; /// Check for an existing path CLI11_MODULE_INLINE const detail::ExistingPathValidator ExistingPath; /// Check for an non-existing path CLI11_MODULE_INLINE const detail::NonexistentPathValidator NonexistentPath; /// convert escaped characters into their associated values CLI11_MODULE_INLINE const detail::EscapedStringTransformer EscapedString; /// Modify a path if the file is a particular default location, can be used as Check or transform /// with the error return optionally disabled class FileOnDefaultPath : public Validator { public: explicit FileOnDefaultPath(std::string default_path, bool enableErrorReturn = true); }; /// Produce a range (factory). Min and max are inclusive. class Range : public Validator { public: /// This produces a range with min and max inclusive. /// /// Note that the constructor is templated, but the struct is not, so C++17 is not /// needed to provide nice syntax for Range(a,b). template Range(T min_val, T max_val, const std::string &validator_name = std::string{}) : Validator(validator_name) { if(validator_name.empty()) { std::stringstream out; out << detail::type_name() << " in [" << min_val << " - " << max_val << "]"; description(out.str()); } func_ = [min_val, max_val](std::string &input) { using CLI::detail::lexical_cast; T val; bool converted = lexical_cast(input, val); if((!converted) || (val < min_val || val > max_val)) { std::stringstream out; out << "Value " << input << " not in range ["; out << min_val << " - " << max_val << "]"; return out.str(); } return std::string{}; }; } /// Range of one value is 0 to value template explicit Range(T max_val, const std::string &validator_name = std::string{}) : Range(static_cast(0), max_val, validator_name) {} }; /// Check for a non negative number CLI11_MODULE_INLINE const Range NonNegativeNumber((std::numeric_limits::max)(), "NONNEGATIVE"); /// Check for a positive valued number (val>0.0), ::min here is the smallest positive number CLI11_MODULE_INLINE const Range PositiveNumber((std::numeric_limits::min)(), (std::numeric_limits::max)(), "POSITIVE"); namespace detail { // the following suggestion was made by Nikita Ofitserov(@himikof) // done in templates to prevent compiler warnings on negation of unsigned numbers /// Do a check for overflow on signed numbers template inline typename std::enable_if::value, T>::type overflowCheck(const T &a, const T &b) { if((a > 0) == (b > 0)) { return ((std::numeric_limits::max)() / (std::abs)(a) < (std::abs)(b)); } return ((std::numeric_limits::min)() / (std::abs)(a) > -(std::abs)(b)); } /// Do a check for overflow on unsigned numbers template inline typename std::enable_if::value, T>::type overflowCheck(const T &a, const T &b) { return ((std::numeric_limits::max)() / a < b); } /// Performs a *= b; if it doesn't cause integer overflow. Returns false otherwise. template typename std::enable_if::value, bool>::type checked_multiply(T &a, T b) { if(a == 0 || b == 0 || a == 1 || b == 1) { a *= b; return true; } if(a == (std::numeric_limits::min)() || b == (std::numeric_limits::min)()) { return false; } if(overflowCheck(a, b)) { return false; } a *= b; return true; } /// Performs a *= b; if it doesn't equal infinity. Returns false otherwise. template typename std::enable_if::value, bool>::type checked_multiply(T &a, T b) { T c = a * b; if(std::isinf(c) && !std::isinf(a) && !std::isinf(b)) { return false; } a = c; return true; } /// Split a string into a program name and command line arguments /// the string is assumed to contain a file name followed by other arguments /// the return value contains is a pair with the first argument containing the program name and the second /// everything else. CLI11_INLINE std::pair split_program_name(std::string commandline); } // namespace detail /// @} CLI11_INLINE std::string Validator::operator()(std::string &str) const { std::string retstring; if(active_) { if(non_modifying_) { std::string value = str; retstring = func_(value); } else { retstring = func_(str); } } return retstring; } CLI11_NODISCARD CLI11_INLINE Validator Validator::description(std::string validator_desc) const { Validator newval(*this); newval.desc_function_ = [validator_desc]() { return validator_desc; }; return newval; } CLI11_INLINE Validator Validator::operator&(const Validator &other) const { Validator newval; newval._merge_description(*this, other, " AND "); // Give references (will make a copy in lambda function) const std::function &f1 = func_; const std::function &f2 = other.func_; newval.func_ = [f1, f2](std::string &input) { std::string s1 = f1(input); std::string s2 = f2(input); if(!s1.empty() && !s2.empty()) return std::string("(") + s1 + ") AND (" + s2 + ")"; return s1 + s2; }; newval.active_ = active_ && other.active_; newval.application_index_ = application_index_; return newval; } CLI11_INLINE Validator Validator::operator|(const Validator &other) const { Validator newval; newval._merge_description(*this, other, " OR "); // Give references (will make a copy in lambda function) const std::function &f1 = func_; const std::function &f2 = other.func_; newval.func_ = [f1, f2](std::string &input) { std::string s1 = f1(input); std::string s2 = f2(input); if(s1.empty() || s2.empty()) return std::string(); return std::string("(") + s1 + ") OR (" + s2 + ")"; }; newval.active_ = active_ && other.active_; newval.application_index_ = application_index_; return newval; } CLI11_INLINE Validator Validator::operator!() const { Validator newval; const std::function &dfunc1 = desc_function_; newval.desc_function_ = [dfunc1]() { auto str = dfunc1(); return (!str.empty()) ? std::string("NOT ") + str : std::string{}; }; // Give references (will make a copy in lambda function) const std::function &f1 = func_; newval.func_ = [f1, dfunc1](std::string &test) -> std::string { std::string s1 = f1(test); if(s1.empty()) { return std::string("check ") + dfunc1() + " succeeded improperly"; } return std::string{}; }; newval.active_ = active_; newval.application_index_ = application_index_; return newval; } CLI11_INLINE void Validator::_merge_description(const Validator &val1, const Validator &val2, const std::string &merger) { const std::function &dfunc1 = val1.desc_function_; const std::function &dfunc2 = val2.desc_function_; desc_function_ = [=]() { std::string f1 = dfunc1(); std::string f2 = dfunc2(); if((f1.empty()) || (f2.empty())) { return f1 + f2; } return std::string(1, '(') + f1 + ')' + merger + '(' + f2 + ')'; }; } namespace detail { #if defined CLI11_HAS_FILESYSTEM && CLI11_HAS_FILESYSTEM > 0 CLI11_INLINE path_type check_path(const char *file) noexcept { std::error_code ec; auto stat = std::filesystem::status(to_path(file), ec); if(ec) { return path_type::nonexistent; } switch(stat.type()) { case std::filesystem::file_type::none: // LCOV_EXCL_LINE case std::filesystem::file_type::not_found: return path_type::nonexistent; // LCOV_EXCL_LINE case std::filesystem::file_type::directory: return path_type::directory; case std::filesystem::file_type::symlink: case std::filesystem::file_type::block: case std::filesystem::file_type::character: case std::filesystem::file_type::fifo: case std::filesystem::file_type::socket: case std::filesystem::file_type::regular: case std::filesystem::file_type::unknown: default: return path_type::file; } } #else CLI11_INLINE path_type check_path(const char *file) noexcept { #if defined(_MSC_VER) struct __stat64 buffer; if(_stat64(file, &buffer) == 0) { return ((buffer.st_mode & S_IFDIR) != 0) ? path_type::directory : path_type::file; } #else struct stat buffer; if(stat(file, &buffer) == 0) { return ((buffer.st_mode & S_IFDIR) != 0) ? path_type::directory : path_type::file; } #endif return path_type::nonexistent; } #endif CLI11_INLINE ExistingFileValidator::ExistingFileValidator() : Validator("FILE") { func_ = [](std::string &filename) { auto path_result = check_path(filename.c_str()); if(path_result == path_type::nonexistent) { return "File does not exist: " + filename; } if(path_result == path_type::directory) { return "File is actually a directory: " + filename; } return std::string(); }; } CLI11_INLINE ExistingDirectoryValidator::ExistingDirectoryValidator() : Validator("DIR") { func_ = [](std::string &filename) { auto path_result = check_path(filename.c_str()); if(path_result == path_type::nonexistent) { return "Directory does not exist: " + filename; } if(path_result == path_type::file) { return "Directory is actually a file: " + filename; } return std::string(); }; } CLI11_INLINE ExistingPathValidator::ExistingPathValidator() : Validator("PATH(existing)") { func_ = [](std::string &filename) { auto path_result = check_path(filename.c_str()); if(path_result == path_type::nonexistent) { return "Path does not exist: " + filename; } return std::string(); }; } CLI11_INLINE NonexistentPathValidator::NonexistentPathValidator() : Validator("PATH(non-existing)") { func_ = [](std::string &filename) { auto path_result = check_path(filename.c_str()); if(path_result != path_type::nonexistent) { return "Path already exists: " + filename; } return std::string(); }; } CLI11_INLINE EscapedStringTransformer::EscapedStringTransformer() { func_ = [](std::string &str) { try { if(str.size() > 1 && (str.front() == '\"' || str.front() == '\'' || str.front() == '`') && str.front() == str.back()) { process_quoted_string(str); } else if(str.find_first_of('\\') != std::string::npos) { if(detail::is_binary_escaped_string(str)) { str = detail::extract_binary_string(str); } else { str = remove_escaped_characters(str); } } return std::string{}; } catch(const std::invalid_argument &ia) { return std::string(ia.what()); } }; } } // namespace detail CLI11_INLINE FileOnDefaultPath::FileOnDefaultPath(std::string default_path, bool enableErrorReturn) : Validator("FILE") { func_ = [default_path, enableErrorReturn](std::string &filename) { auto path_result = detail::check_path(filename.c_str()); if(path_result == detail::path_type::nonexistent) { std::string test_file_path = default_path; if(default_path.back() != '/' && default_path.back() != '\\') { // Add folder separator test_file_path += '/'; } test_file_path.append(filename); path_result = detail::check_path(test_file_path.c_str()); if(path_result == detail::path_type::file) { filename = test_file_path; } else { if(enableErrorReturn) { return "File does not exist: " + filename; } } } return std::string{}; }; } namespace detail { CLI11_INLINE std::pair split_program_name(std::string commandline) { // try to determine the programName std::pair vals; trim(commandline); auto esp = commandline.find_first_of(' ', 1); while(detail::check_path(commandline.substr(0, esp).c_str()) != path_type::file) { esp = commandline.find_first_of(' ', esp + 1); if(esp == std::string::npos) { // if we have reached the end and haven't found a valid file just assume the first argument is the // program name if(commandline[0] == '"' || commandline[0] == '\'' || commandline[0] == '`') { bool embeddedQuote = false; auto keyChar = commandline[0]; auto end = commandline.find_first_of(keyChar, 1); while((end != std::string::npos) && (commandline[end - 1] == '\\')) { // deal with escaped quotes end = commandline.find_first_of(keyChar, end + 1); embeddedQuote = true; } if(end != std::string::npos) { vals.first = commandline.substr(1, end - 1); esp = end + 1; if(embeddedQuote) { vals.first = find_and_replace(vals.first, std::string("\\") + keyChar, std::string(1, keyChar)); } } else { esp = commandline.find_first_of(' ', 1); } } else { esp = commandline.find_first_of(' ', 1); } break; } } if(vals.first.empty()) { vals.first = commandline.substr(0, esp); rtrim(vals.first); } // strip the program name vals.second = (esp < commandline.length() - 1) ? commandline.substr(esp + 1) : std::string{}; ltrim(vals.second); return vals; } } // namespace detail /// @} // The implementation of the extra validators is using the Validator class; // the user is only expected to use the const (static) versions (since there's no setup). // Therefore, this is in detail. namespace detail { /// Validate the given string is a legal ipv4 address class IPV4Validator : public Validator { public: IPV4Validator(); }; } // namespace detail /// Validate the input as a particular type template class TypeValidator : public Validator { public: explicit TypeValidator(const std::string &validator_name) : Validator(validator_name, [](std::string &input_string) { using CLI::detail::lexical_cast; auto val = DesiredType(); if(!lexical_cast(input_string, val)) { return std::string("Failed parsing ") + input_string + " as a " + detail::type_name(); } return std::string{}; }) {} TypeValidator() : TypeValidator(detail::type_name()) {} }; /// Check for a number const TypeValidator Number("NUMBER"); /// Produce a bounded range (factory). Min and max are inclusive. class Bound : public Validator { public: /// This bounds a value with min and max inclusive. /// /// Note that the constructor is templated, but the struct is not, so C++17 is not /// needed to provide nice syntax for Range(a,b). template Bound(T min_val, T max_val) { std::stringstream out; out << detail::type_name() << " bounded to [" << min_val << " - " << max_val << "]"; description(out.str()); func_ = [min_val, max_val](std::string &input) { using CLI::detail::lexical_cast; T val; bool converted = lexical_cast(input, val); if(!converted) { return std::string("Value ") + input + " could not be converted"; } if(val < min_val) input = detail::to_string(min_val); else if(val > max_val) input = detail::to_string(max_val); return std::string{}; }; } /// Range of one value is 0 to value template explicit Bound(T max_val) : Bound(static_cast(0), max_val) {} }; // Static is not needed here, because global const implies static. /// Check for an IP4 address CLI11_MODULE_INLINE const detail::IPV4Validator ValidIPV4; namespace detail { template ::type>::value, detail::enabler> = detail::dummy> auto smart_deref(T value) -> decltype(*value) { return *value; } template < typename T, enable_if_t::type>::value, detail::enabler> = detail::dummy> typename std::remove_reference::type &smart_deref(T &value) { // NOLINTNEXTLINE return value; } /// Generate a string representation of a set template std::string generate_set(const T &set) { using element_t = typename detail::element_type::type; using iteration_type_t = typename detail::pair_adaptor::value_type; // the type of the object pair std::string out(1, '{'); out.append(detail::join( detail::smart_deref(set), [](const iteration_type_t &v) { return detail::pair_adaptor::first(v); }, ",")); out.push_back('}'); return out; } /// Generate a string representation of a map template std::string generate_map(const T &map, bool key_only = false) { using element_t = typename detail::element_type::type; using iteration_type_t = typename detail::pair_adaptor::value_type; // the type of the object pair std::string out(1, '{'); out.append(detail::join( detail::smart_deref(map), [key_only](const iteration_type_t &v) { std::string res{detail::to_string(detail::pair_adaptor::first(v))}; if(!key_only) { res.append("->"); res += detail::to_string(detail::pair_adaptor::second(v)); } return res; }, ",")); out.push_back('}'); return out; } template struct has_find { template static auto test(int) -> decltype(std::declval().find(std::declval()), std::true_type()); template static auto test(...) -> decltype(std::false_type()); static const auto value = decltype(test(0))::value; using type = std::integral_constant; }; /// A search function template ::value, detail::enabler> = detail::dummy> auto search(const T &set, const V &val) -> std::pair { using element_t = typename detail::element_type::type; auto &setref = detail::smart_deref(set); auto it = std::find_if(std::begin(setref), std::end(setref), [&val](decltype(*std::begin(setref)) v) { return (detail::pair_adaptor::first(v) == val); }); return {(it != std::end(setref)), it}; } /// A search function that uses the built in find function template ::value, detail::enabler> = detail::dummy> auto search(const T &set, const V &val) -> std::pair { auto &setref = detail::smart_deref(set); auto it = setref.find(val); return {(it != std::end(setref)), it}; } /// A search function with a filter function template auto search(const T &set, const V &val, const std::function &filter_function) -> std::pair { using element_t = typename detail::element_type::type; // do the potentially faster first search auto res = search(set, val); if((res.first) || (!(filter_function))) { return res; } // if we haven't found it do the longer linear search with all the element translations auto &setref = detail::smart_deref(set); auto it = std::find_if(std::begin(setref), std::end(setref), [&](decltype(*std::begin(setref)) v) { V a{detail::pair_adaptor::first(v)}; a = filter_function(a); return (a == val); }); return {(it != std::end(setref)), it}; } } // namespace detail /// Verify items are in a set class IsMember : public Validator { public: using filter_fn_t = std::function; /// This allows in-place construction using an initializer list template IsMember(std::initializer_list values, Args &&...args) : IsMember(std::vector(values), std::forward(args)...) {} /// This checks to see if an item is in a set (empty function) template explicit IsMember(T &&set) : IsMember(std::forward(set), nullptr) {} /// This checks to see if an item is in a set: pointer or copy version. You can pass in a function that will filter /// both sides of the comparison before computing the comparison. template explicit IsMember(T set, F filter_function) { // Get the type of the contained item - requires a container have ::value_type // if the type does not have first_type and second_type, these are both value_type using element_t = typename detail::element_type::type; // Removes (smart) pointers if needed using item_t = typename detail::pair_adaptor::first_type; // Is value_type if not a map using local_item_t = typename IsMemberType::type; // This will convert bad types to good ones // (const char * to std::string) // Make a local copy of the filter function, using a std::function if not one already std::function filter_fn = filter_function; // This is the type name for help, it will take the current version of the set contents desc_function_ = [set]() { return detail::generate_set(detail::smart_deref(set)); }; // This is the function that validates // It stores a copy of the set pointer-like, so shared_ptr will stay alive func_ = [set, filter_fn](std::string &input) { using CLI::detail::lexical_cast; local_item_t b; if(!lexical_cast(input, b)) { throw ValidationError(input); // name is added later } if(filter_fn) { b = filter_fn(b); } auto res = detail::search(set, b, filter_fn); if(res.first) { // Make sure the version in the input string is identical to the one in the set if(filter_fn) { input = detail::value_string(detail::pair_adaptor::first(*(res.second))); } // Return empty error string (success) return std::string{}; } // If you reach this point, the result was not found return input + " not in " + detail::generate_set(detail::smart_deref(set)); }; } /// You can pass in as many filter functions as you like, they nest (string only currently) template IsMember(T &&set, filter_fn_t filter_fn_1, filter_fn_t filter_fn_2, Args &&...other) : IsMember( std::forward(set), [filter_fn_1, filter_fn_2](std::string a) { return filter_fn_2(filter_fn_1(a)); }, other...) {} }; /// definition of the default transformation object template using TransformPairs = std::vector>; /// Translate named items to other or a value set class Transformer : public Validator { public: using filter_fn_t = std::function; /// This allows in-place construction template Transformer(std::initializer_list> values, Args &&...args) : Transformer(TransformPairs(values), std::forward(args)...) {} /// direct map of std::string to std::string template explicit Transformer(T &&mapping) : Transformer(std::forward(mapping), nullptr) {} /// This checks to see if an item is in a set: pointer or copy version. You can pass in a function that will filter /// both sides of the comparison before computing the comparison. template explicit Transformer(T mapping, F filter_function) { static_assert(detail::pair_adaptor::type>::value, "mapping must produce value pairs"); // Get the type of the contained item - requires a container have ::value_type // if the type does not have first_type and second_type, these are both value_type using element_t = typename detail::element_type::type; // Removes (smart) pointers if needed using item_t = typename detail::pair_adaptor::first_type; // Is value_type if not a map using local_item_t = typename IsMemberType::type; // Will convert bad types to good ones // (const char * to std::string) // Make a local copy of the filter function, using a std::function if not one already std::function filter_fn = filter_function; // This is the type name for help, it will take the current version of the set contents desc_function_ = [mapping]() { return detail::generate_map(detail::smart_deref(mapping)); }; func_ = [mapping, filter_fn](std::string &input) { using CLI::detail::lexical_cast; local_item_t b; if(!lexical_cast(input, b)) { return std::string(); // there is no possible way we can match anything in the mapping if we can't convert so just return } if(filter_fn) { b = filter_fn(b); } auto res = detail::search(mapping, b, filter_fn); if(res.first) { input = detail::value_string(detail::pair_adaptor::second(*res.second)); } return std::string{}; }; } /// You can pass in as many filter functions as you like, they nest template Transformer(T &&mapping, filter_fn_t filter_fn_1, filter_fn_t filter_fn_2, Args &&...other) : Transformer( std::forward(mapping), [filter_fn_1, filter_fn_2](std::string a) { return filter_fn_2(filter_fn_1(a)); }, other...) {} }; /// translate named items to other or a value set class CheckedTransformer : public Validator { public: using filter_fn_t = std::function; /// This allows in-place construction template CheckedTransformer(std::initializer_list> values, Args &&...args) : CheckedTransformer(TransformPairs(values), std::forward(args)...) {} /// direct map of std::string to std::string template explicit CheckedTransformer(T mapping) : CheckedTransformer(std::move(mapping), nullptr) {} /// This checks to see if an item is in a set: pointer or copy version. You can pass in a function that will filter /// both sides of the comparison before computing the comparison. template explicit CheckedTransformer(T mapping, F filter_function) { static_assert(detail::pair_adaptor::type>::value, "mapping must produce value pairs"); // Get the type of the contained item - requires a container have ::value_type // if the type does not have first_type and second_type, these are both value_type using element_t = typename detail::element_type::type; // Removes (smart) pointers if needed using item_t = typename detail::pair_adaptor::first_type; // Is value_type if not a map using local_item_t = typename IsMemberType::type; // Will convert bad types to good ones // (const char * to std::string) using iteration_type_t = typename detail::pair_adaptor::value_type; // the type of the object pair // Make a local copy of the filter function, using a std::function if not one already std::function filter_fn = filter_function; auto tfunc = [mapping]() { std::string out("value in "); out += detail::generate_map(detail::smart_deref(mapping)) + " OR {"; out += detail::join( detail::smart_deref(mapping), [](const iteration_type_t &v) { return detail::value_string(detail::pair_adaptor::second(v)); }, ","); out.push_back('}'); return out; }; desc_function_ = tfunc; func_ = [mapping, tfunc, filter_fn](std::string &input) { using CLI::detail::lexical_cast; local_item_t b; bool converted = lexical_cast(input, b); if(converted) { if(filter_fn) { b = filter_fn(b); } auto res = detail::search(mapping, b, filter_fn); if(res.first) { input = detail::value_string(detail::pair_adaptor::second(*res.second)); return std::string{}; } } for(const auto &v : detail::smart_deref(mapping)) { auto output_string = detail::value_string(detail::pair_adaptor::second(v)); if(output_string == input) { return std::string(); } } return "Check " + input + " " + tfunc() + " FAILED"; }; } /// You can pass in as many filter functions as you like, they nest template CheckedTransformer(T &&mapping, filter_fn_t filter_fn_1, filter_fn_t filter_fn_2, Args &&...other) : CheckedTransformer( std::forward(mapping), [filter_fn_1, filter_fn_2](std::string a) { return filter_fn_2(filter_fn_1(a)); }, other...) {} }; /// Helper function to allow ignore_case to be passed to IsMember or Transform inline std::string ignore_case(std::string item) { return detail::to_lower(item); } /// Helper function to allow ignore_underscore to be passed to IsMember or Transform inline std::string ignore_underscore(std::string item) { return detail::remove_underscore(item); } /// Helper function to allow checks to ignore spaces to be passed to IsMember or Transform inline std::string ignore_space(std::string item) { item.erase(std::remove(std::begin(item), std::end(item), ' '), std::end(item)); item.erase(std::remove(std::begin(item), std::end(item), '\t'), std::end(item)); return item; } /// Multiply a number by a factor using given mapping. /// Can be used to write transforms for SIZE or DURATION inputs. /// /// Example: /// With mapping = `{"b"->1, "kb"->1024, "mb"->1024*1024}` /// one can recognize inputs like "100", "12kb", "100 MB", /// that will be automatically transformed to 100, 14448, 104857600. /// /// Output number type matches the type in the provided mapping. /// Therefore, if it is required to interpret real inputs like "0.42 s", /// the mapping should be of a type or . class AsNumberWithUnit : public Validator { public: /// Adjust AsNumberWithUnit behavior. /// CASE_SENSITIVE/CASE_INSENSITIVE controls how units are matched. /// UNIT_OPTIONAL/UNIT_REQUIRED throws ValidationError /// if UNIT_REQUIRED is set and unit literal is not found. enum Options : std::uint8_t { CASE_SENSITIVE = 0, CASE_INSENSITIVE = 1, UNIT_OPTIONAL = 0, UNIT_REQUIRED = 2, DEFAULT = CASE_INSENSITIVE | UNIT_OPTIONAL }; template explicit AsNumberWithUnit(std::map mapping, Options opts = DEFAULT, const std::string &unit_name = "UNIT") { description(generate_description(unit_name, opts)); validate_mapping(mapping, opts); // transform function func_ = [mapping, opts](std::string &input) -> std::string { Number num{}; detail::rtrim(input); if(input.empty()) { throw ValidationError("Input is empty"); } // Find split position between number and prefix auto unit_begin = input.end(); while(unit_begin > input.begin() && std::isalpha(*(unit_begin - 1), std::locale())) { --unit_begin; } std::string unit{unit_begin, input.end()}; input.resize(static_cast(std::distance(input.begin(), unit_begin))); detail::trim(input); if(opts & UNIT_REQUIRED && unit.empty()) { throw ValidationError("Missing mandatory unit"); } if(opts & CASE_INSENSITIVE) { unit = detail::to_lower(unit); } if(unit.empty()) { using CLI::detail::lexical_cast; if(!lexical_cast(input, num)) { throw ValidationError(std::string("Value ") + input + " could not be converted to " + detail::type_name()); } // No need to modify input if no unit passed return {}; } // find corresponding factor auto it = mapping.find(unit); if(it == mapping.end()) { throw ValidationError(unit + " unit not recognized. " "Allowed values: " + detail::generate_map(mapping, true)); } if(!input.empty()) { using CLI::detail::lexical_cast; bool converted = lexical_cast(input, num); if(!converted) { throw ValidationError(std::string("Value ") + input + " could not be converted to " + detail::type_name()); } // perform safe multiplication bool ok = detail::checked_multiply(num, it->second); if(!ok) { throw ValidationError(detail::to_string(num) + " multiplied by " + unit + " factor would cause number overflow. Use smaller value."); } } else { num = static_cast(it->second); } input = detail::to_string(num); return {}; }; } private: /// Check that mapping contains valid units. /// Update mapping for CASE_INSENSITIVE mode. template static void validate_mapping(std::map &mapping, Options opts) { for(auto &kv : mapping) { if(kv.first.empty()) { throw ValidationError("Unit must not be empty."); } if(!detail::isalpha(kv.first)) { throw ValidationError("Unit must contain only letters."); } } // make all units lowercase if CASE_INSENSITIVE if(opts & CASE_INSENSITIVE) { std::map lower_mapping; for(auto &kv : mapping) { auto s = detail::to_lower(kv.first); if(lower_mapping.count(s)) { throw ValidationError(std::string("Several matching lowercase unit representations are found: ") + s); } lower_mapping[detail::to_lower(kv.first)] = kv.second; } mapping = std::move(lower_mapping); } } /// Generate description like this: NUMBER [UNIT] template static std::string generate_description(const std::string &name, Options opts) { std::stringstream out; out << detail::type_name() << ' '; if(opts & UNIT_REQUIRED) { out << name; } else { out << '[' << name << ']'; } return out.str(); } }; inline AsNumberWithUnit::Options operator|(const AsNumberWithUnit::Options &a, const AsNumberWithUnit::Options &b) { return static_cast(static_cast(a) | static_cast(b)); } /// Converts a human-readable size string (with unit literal) to uin64_t size. /// Example: /// "100" => 100 /// "1 b" => 100 /// "10Kb" => 10240 // you can configure this to be interpreted as kilobyte (*1000) or kibibyte (*1024) /// "10 KB" => 10240 /// "10 kb" => 10240 /// "10 kib" => 10240 // *i, *ib are always interpreted as *bibyte (*1024) /// "10kb" => 10240 /// "2 MB" => 2097152 /// "2 EiB" => 2^61 // Units up to exibyte are supported class AsSizeValue : public AsNumberWithUnit { public: using result_t = std::uint64_t; /// If kb_is_1000 is true, /// interpret 'kb', 'k' as 1000 and 'kib', 'ki' as 1024 /// (same applies to higher order units as well). /// Otherwise, interpret all literals as factors of 1024. /// The first option is formally correct, but /// the second interpretation is more wide-spread /// (see https://en.wikipedia.org/wiki/Binary_prefix). explicit AsSizeValue(bool kb_is_1000); private: /// Get mapping static std::map init_mapping(bool kb_is_1000); /// Cache calculated mapping static std::map get_mapping(bool kb_is_1000); }; #if defined(CLI11_ENABLE_EXTRA_VALIDATORS) && CLI11_ENABLE_EXTRA_VALIDATORS != 0 // new extra validators #if CLI11_HAS_FILESYSTEM namespace detail { enum class Permission : std::uint8_t { none = 0, read = 1, write = 2, exec = 4 }; class PermissionValidator : public Validator { public: explicit PermissionValidator(Permission permission); }; } // namespace detail /// Check that the file exist and available for read const detail::PermissionValidator ReadPermissions(detail::Permission::read); /// Check that the file exist and available for write const detail::PermissionValidator WritePermissions(detail::Permission::write); /// Check that the file exist and available for write const detail::PermissionValidator ExecPermissions(detail::Permission::exec); #endif #endif namespace detail { CLI11_INLINE IPV4Validator::IPV4Validator() : Validator("IPV4") { func_ = [](std::string &ip_addr) { auto cdot = std::count(ip_addr.begin(), ip_addr.end(), '.'); if(cdot != 3u) { return std::string("Invalid IPV4 address: must have 3 separators"); } auto result = CLI::detail::split(ip_addr, '.'); if(result.size() != 4) { return std::string("Invalid IPV4 address: must have four parts (") + ip_addr + ')'; } int num = 0; for(const auto &var : result) { using CLI::detail::lexical_cast; bool retval = lexical_cast(var, num); if(!retval) { return std::string("Failed parsing number (") + var + ')'; } if(num < 0 || num > 255) { return std::string("Each IP number must be between 0 and 255 ") + var; } } return std::string{}; }; } } // namespace detail CLI11_INLINE AsSizeValue::AsSizeValue(bool kb_is_1000) : AsNumberWithUnit(get_mapping(kb_is_1000)) { if(kb_is_1000) { description("SIZE [b, kb(=1000b), kib(=1024b), ...]"); } else { description("SIZE [b, kb(=1024b), ...]"); } } CLI11_INLINE std::map AsSizeValue::init_mapping(bool kb_is_1000) { std::map m; result_t k_factor = kb_is_1000 ? 1000 : 1024; result_t ki_factor = 1024; result_t k = 1; result_t ki = 1; m["b"] = 1; for(std::string p : {"k", "m", "g", "t", "p", "e"}) { k *= k_factor; ki *= ki_factor; m[p] = k; m[p + "b"] = k; m[p + "i"] = ki; m[p + "ib"] = ki; } return m; } CLI11_INLINE std::map AsSizeValue::get_mapping(bool kb_is_1000) { if(kb_is_1000) { static auto m = init_mapping(true); return m; } static auto m = init_mapping(false); return m; } namespace detail {} // namespace detail /// @} #if defined(CLI11_ENABLE_EXTRA_VALIDATORS) && CLI11_ENABLE_EXTRA_VALIDATORS != 0 // new extra validators namespace detail { #if defined CLI11_HAS_FILESYSTEM && CLI11_HAS_FILESYSTEM > 0 CLI11_INLINE PermissionValidator::PermissionValidator(Permission permission) { std::filesystem::perms permission_code = std::filesystem::perms::none; std::string permission_name; switch(permission) { case Permission::read: permission_code = std::filesystem::perms::owner_read | std::filesystem::perms::group_read | std::filesystem::perms::others_read; permission_name = "read"; break; case Permission::write: permission_code = std::filesystem::perms::owner_write | std::filesystem::perms::group_write | std::filesystem::perms::others_write; permission_name = "write"; break; case Permission::exec: permission_code = std::filesystem::perms::owner_exec | std::filesystem::perms::group_exec | std::filesystem::perms::others_exec; permission_name = "exec"; break; case Permission::none: default: permission_code = std::filesystem::perms::none; break; } func_ = [permission_code](std::string &path) { std::error_code ec; auto p = std::filesystem::path(path); if(!std::filesystem::exists(p, ec)) { return std::string("Path does not exist: ") + path; } if(ec) { return std::string("Error checking path: ") + ec.message(); // LCOV_EXCL_LINE } if(permission_code == std::filesystem::perms::none) { return std::string{}; } auto perms = std::filesystem::status(p, ec).permissions(); if(ec) { return std::string("Error checking path status: ") + ec.message(); // LCOV_EXCL_LINE } if((perms & permission_code) == std::filesystem::perms::none) { return std::string("Path does not have required permissions: ") + path; } return std::string{}; }; description("Path with " + permission_name + " permission"); } #endif } // namespace detail #endif class Option; class App; /// This enum signifies the type of help requested /// /// This is passed in by App; all user classes must accept this as /// the second argument. enum class AppFormatMode : std::uint8_t { Normal, ///< The normal, detailed help All, ///< A fully expanded help Sub, ///< Used when printed as part of expanded subcommand }; /// This is the minimum requirements to run a formatter. /// /// A user can subclass this is if they do not care at all /// about the structure in CLI::Formatter. class FormatterBase { protected: /// @name Options ///@{ /// The width of the left column (options/flags/subcommands) std::size_t column_width_{30}; /// The alignment ratio for long options within the left column float long_option_alignment_ratio_{1 / 3.f}; /// The width of the right column (description of options/flags/subcommands) std::size_t right_column_width_{65}; /// The width of the description paragraph at the top of help std::size_t description_paragraph_width_{80}; /// The width of the footer paragraph std::size_t footer_paragraph_width_{80}; /// options controlling formatting for footer and descriptions bool enable_description_formatting_{true}; bool enable_footer_formatting_{true}; /// options controlling formatting of options bool enable_option_defaults_{true}; bool enable_option_type_names_{true}; bool enable_default_flag_values_{true}; /// @brief The required help printout labels (user changeable) /// Values are Needs, Excludes, etc. std::map labels_{}; ///@} /// @name Basic ///@{ public: FormatterBase() = default; FormatterBase(const FormatterBase &) = default; FormatterBase(FormatterBase &&) = default; FormatterBase &operator=(const FormatterBase &) = default; FormatterBase &operator=(FormatterBase &&) = default; /// Adding a destructor in this form to work around bug in GCC 4.7 virtual ~FormatterBase() noexcept {} // NOLINT(modernize-use-equals-default) /// This is the key method that puts together help virtual std::string make_help(const App *, std::string, AppFormatMode) const = 0; ///@} /// @name Setters ///@{ /// Set the "REQUIRED" or other labels void label(std::string key, std::string val) { labels_[key] = val; } /// Set the left column width (options/flags/subcommands) void column_width(std::size_t val) { column_width_ = val; } /// Set the alignment ratio for long options within the left column /// The ratio is in [0;1] range (e.g. 0.2 = 20% of column width, 6.f/column_width = 6th character) void long_option_alignment_ratio(float ratio) { long_option_alignment_ratio_ = (ratio >= 0.0f) ? ((ratio <= 1.0f) ? ratio : 1.0f / ratio) : ((ratio < -1.0f) ? 1.0f / (-ratio) : -ratio); } /// Set the right column width (description of options/flags/subcommands) void right_column_width(std::size_t val) { right_column_width_ = val; } /// Set the description paragraph width at the top of help void description_paragraph_width(std::size_t val) { description_paragraph_width_ = val; } /// Set the footer paragraph width void footer_paragraph_width(std::size_t val) { footer_paragraph_width_ = val; } /// enable formatting for description paragraph void enable_description_formatting(bool value = true) { enable_description_formatting_ = value; } /// disable formatting for footer paragraph void enable_footer_formatting(bool value = true) { enable_footer_formatting_ = value; } /// enable option defaults to be printed void enable_option_defaults(bool value = true) { enable_option_defaults_ = value; } /// enable option type names to be printed void enable_option_type_names(bool value = true) { enable_option_type_names_ = value; } /// enable default flag values to be printed void enable_default_flag_values(bool value = true) { enable_default_flag_values_ = value; } ///@} /// @name Getters ///@{ /// Get the current value of a name (REQUIRED, etc.) CLI11_NODISCARD std::string get_label(std::string key) const { if(labels_.find(key) == labels_.end()) return key; return labels_.at(key); } /// Get the current left column width (options/flags/subcommands) CLI11_NODISCARD std::size_t get_column_width() const { return column_width_; } /// Get the current right column width (description of options/flags/subcommands) CLI11_NODISCARD std::size_t get_right_column_width() const { return right_column_width_; } /// Get the current description paragraph width at the top of help CLI11_NODISCARD std::size_t get_description_paragraph_width() const { return description_paragraph_width_; } /// Get the current footer paragraph width CLI11_NODISCARD std::size_t get_footer_paragraph_width() const { return footer_paragraph_width_; } /// @brief Get the current alignment ratio for long options within the left column /// @return CLI11_NODISCARD float get_long_option_alignment_ratio() const { return long_option_alignment_ratio_; } /// Get the current status of description paragraph formatting CLI11_NODISCARD bool is_description_paragraph_formatting_enabled() const { return enable_description_formatting_; } /// Get the current status of whether footer paragraph formatting is enabled CLI11_NODISCARD bool is_footer_paragraph_formatting_enabled() const { return enable_footer_formatting_; } /// Get the current status of whether option defaults are printed CLI11_NODISCARD bool is_option_defaults_enabled() const { return enable_option_defaults_; } /// Get the current status of whether option type names are printed CLI11_NODISCARD bool is_option_type_names_enabled() const { return enable_option_type_names_; } /// Get the current status of whether default flag values are printed CLI11_NODISCARD bool is_default_flag_values_enabled() const { return enable_default_flag_values_; } ///@} }; /// This is a specialty override for lambda functions class FormatterLambda final : public FormatterBase { using funct_t = std::function; /// The lambda to hold and run funct_t lambda_; public: /// Create a FormatterLambda with a lambda function explicit FormatterLambda(funct_t funct) : lambda_(std::move(funct)) {} /// Adding a destructor (mostly to make GCC 4.7 happy) ~FormatterLambda() noexcept override {} // NOLINT(modernize-use-equals-default) /// This will simply call the lambda function std::string make_help(const App *app, std::string name, AppFormatMode mode) const override { return lambda_(app, name, mode); } }; /// This is the default Formatter for CLI11. It pretty prints help output, and is broken into quite a few /// overridable methods, to be highly customizable with minimal effort. class Formatter : public FormatterBase { public: Formatter() = default; Formatter(const Formatter &) = default; Formatter(Formatter &&) = default; Formatter &operator=(const Formatter &) = default; Formatter &operator=(Formatter &&) = default; /// @name Overridables ///@{ /// This prints out a group of options with title /// CLI11_NODISCARD virtual std::string make_group(std::string group, bool is_positional, std::vector opts) const; /// This prints out just the positionals "group" virtual std::string make_positionals(const App *app) const; /// This prints out all the groups of options std::string make_groups(const App *app, AppFormatMode mode) const; /// This prints out all the subcommands virtual std::string make_subcommands(const App *app, AppFormatMode mode) const; /// This prints out a subcommand virtual std::string make_subcommand(const App *sub) const; /// This prints out a subcommand in help-all virtual std::string make_expanded(const App *sub, AppFormatMode mode) const; /// This prints out all the groups of options virtual std::string make_footer(const App *app) const; /// This displays the description line virtual std::string make_description(const App *app) const; /// This displays the usage line virtual std::string make_usage(const App *app, std::string name) const; /// This puts everything together std::string make_help(const App *app, std::string, AppFormatMode mode) const override; ///@} /// @name Options ///@{ /// This prints out an option help line, either positional or optional form virtual std::string make_option(const Option *, bool) const; /// @brief This is the name part of an option, Default: left column virtual std::string make_option_name(const Option *, bool) const; /// @brief This is the options part of the name, Default: combined into left column virtual std::string make_option_opts(const Option *) const; /// @brief This is the description. Default: Right column, on new line if left column too large virtual std::string make_option_desc(const Option *) const; /// @brief This is used to print the name on the USAGE line virtual std::string make_option_usage(const Option *opt) const; ///@} }; using results_t = std::vector; /// callback function definition using callback_t = std::function; class Option; class App; class ConfigBase; using Option_p = std::unique_ptr