chattr-util: drop mostly unused 'previous' argument from chattr_path() and friends

This commit is contained in:
Yu Watanabe
2025-03-04 00:47:12 +09:00
parent 047a4111df
commit a997f3387f
18 changed files with 37 additions and 32 deletions
@@ -57,7 +57,7 @@ static int journal_corrupt_and_append(uint64_t start_offset, uint64_t step) {
assert_se(mkdtemp_malloc("/tmp/journal-append-XXXXXX", &tempdir) >= 0);
assert_se(chdir(tempdir) >= 0);
(void) chattr_path(tempdir, FS_NOCOW_FL, FS_NOCOW_FL, NULL);
(void) chattr_path(tempdir, FS_NOCOW_FL, FS_NOCOW_FL);
log_debug("Opening journal %s/system.journal", tempdir);
@@ -107,7 +107,7 @@ static void test_journal_flush_one(int argc, char *argv[]) {
assert_se(m = mmap_cache_new());
assert_se(mkdtemp_malloc("/var/tmp/test-journal-flush.XXXXXX", &dn) >= 0);
(void) chattr_path(dn, FS_NOCOW_FL, FS_NOCOW_FL, NULL);
(void) chattr_path(dn, FS_NOCOW_FL, FS_NOCOW_FL);
assert_se(fn = path_join(dn, "test.journal"));
@@ -28,7 +28,7 @@ int main(int argc, char *argv[]) {
log_info("Running %d loops", I);
assert_se(mkdtemp(t));
(void) chattr_path(t, FS_NOCOW_FL, FS_NOCOW_FL, NULL);
(void) chattr_path(t, FS_NOCOW_FL, FS_NOCOW_FL);
for (i = 0; i < I; i++) {
r = sd_journal_open(&j, SD_JOURNAL_LOCAL_ONLY | SD_JOURNAL_ASSUME_IMMUTABLE);
@@ -224,7 +224,7 @@ static void mkdtemp_chdir_chattr(const char *template, char **ret) {
/* Speed up things a bit on btrfs, ensuring that CoW is turned off for all files created in our
* directory during the test run */
(void) chattr_path(path, FS_NOCOW_FL, FS_NOCOW_FL, NULL);
(void) chattr_path(path, FS_NOCOW_FL, FS_NOCOW_FL);
*ret = TAKE_PTR(path);
}
@@ -74,7 +74,7 @@ static void run_test(void) {
assert_se(mkdtemp(t));
assert_se(chdir(t) >= 0);
(void) chattr_path(t, FS_NOCOW_FL, FS_NOCOW_FL, NULL);
(void) chattr_path(t, FS_NOCOW_FL, FS_NOCOW_FL);
assert_se(journal_file_open(-EBADF, "one.journal", O_RDWR|O_CREAT, JOURNAL_COMPRESS, 0666, UINT64_MAX, NULL, m, NULL, &one) == 0);
assert_se(journal_file_open(-EBADF, "two.journal", O_RDWR|O_CREAT, JOURNAL_COMPRESS, 0666, UINT64_MAX, NULL, m, NULL, &two) == 0);
@@ -88,7 +88,7 @@ static int run_test(const char *verification_key, ssize_t max_iterations) {
assert_se(mkdtemp(t));
assert_se(chdir(t) >= 0);
(void) chattr_path(t, FS_NOCOW_FL, FS_NOCOW_FL, NULL);
(void) chattr_path(t, FS_NOCOW_FL, FS_NOCOW_FL);
log_info("Generating a test journal");
+1 -1
View File
@@ -20,7 +20,7 @@ static void mkdtemp_chdir_chattr(char *path) {
/* Speed up things a bit on btrfs, ensuring that CoW is turned off for all files created in our
* directory during the test run */
(void) chattr_path(path, FS_NOCOW_FL, FS_NOCOW_FL, NULL);
(void) chattr_path(path, FS_NOCOW_FL, FS_NOCOW_FL);
}
static void test_non_empty_one(void) {