Change getattr and statx to bespoke policies

* Provides: slight improvement in performance as it no longer will
need to find and then act on the files.
* It doesn't make sense to support all original policy types. Most
people used 'newest' or 'ff' and 'combine' is a better default which
has same runtime as 'newest' but with better output.
This commit is contained in:
Antonio SJ Musumeci 2025-11-13 20:45:52 -06:00
parent 965e26989c
commit b3b8e793f9
145 changed files with 3803 additions and 1192 deletions

View file

@ -2,6 +2,8 @@
#include "config.hpp"
#include "str.hpp"
#include "error.hpp"
void
test_nop()
@ -123,12 +125,11 @@ test_str_stuff()
void
test_config_branches()
{
uint64_t minfreespace;
Branches b(minfreespace);
Branches b;
Branches::Ptr bcp0;
Branches::Ptr bcp1;
minfreespace = 1234;
b.minfreespace = 1234;
TEST_CHECK(b->minfreespace() == 1234);
TEST_CHECK(b.to_string() == "");
@ -304,6 +305,20 @@ test_config()
TEST_CHECK(cfg.set("async-read","true") == 0);
}
void
test_err()
{
Err err;
TEST_CHECK((err = -ENOENT) == -ENOENT);
TEST_CHECK((err = -EROFS) == -EROFS);
TEST_CHECK((err = -ENOENT) == -EROFS);
TEST_CHECK((err = -ENAMETOOLONG) == -ENAMETOOLONG);
TEST_CHECK((err = -EIO) == -ENAMETOOLONG);
TEST_CHECK((err = 0) == 0);
TEST_CHECK((err = -EIO) == 0);
}
TEST_LIST =
{
{"nop",test_nop},
@ -322,5 +337,6 @@ TEST_LIST =
{"config_xattr",test_config_xattr},
{"config",test_config},
{"str",test_str_stuff},
{"err",test_err},
{NULL,NULL}
};