stat-util: introduce inode_unmodified_hash_ops

This is almost the same as inode_hash_ops, but also hashes + compares
all attributes that could affect the contents of a file. It ignores
"superficial"/"external" attributes such as ownership or access mode
however.
This commit is contained in:
Lennart Poettering
2026-03-24 21:24:47 +01:00
parent cf6f65c5ea
commit 172ae47e65
2 changed files with 59 additions and 0 deletions
+6
View File
@@ -127,6 +127,12 @@ void inode_hash_func(const struct stat *q, struct siphash *state);
int inode_compare_func(const struct stat *a, const struct stat *b);
extern const struct hash_ops inode_hash_ops;
/* This is a more thorough version of the above, and also checks the mtimes, the size, and the rdev. It does
* not check "external" attributes such as access mode or ownership. */
void inode_unmodified_hash_func(const struct stat *q, struct siphash *state);
int inode_unmodified_compare_func(const struct stat *a, const struct stat *b);
extern const struct hash_ops inode_unmodified_hash_ops;
DECLARE_STRING_TABLE_LOOKUP(inode_type, mode_t);
/* Macros that check whether the stat/statx structures have been initialized already. For "struct stat" we