basic,shared: mark eligible functions with _pure_/_const_

Following the recent witch hunt done to static inline functions
I figure we should at least give the compiler some more hint
on optimizations.
This commit is contained in:
Mike Yuan
2025-05-26 20:26:58 +02:00
parent fae687ec2b
commit 180341e732
19 changed files with 88 additions and 90 deletions
+4 -4
View File
@@ -85,15 +85,15 @@ bool statx_mount_same(const struct statx *a, const struct statx *b);
int xstatfsat(int dir_fd, const char *path, struct statfs *ret);
usec_t statx_timestamp_load(const struct statx_timestamp *ts);
nsec_t statx_timestamp_load_nsec(const struct statx_timestamp *ts);
usec_t statx_timestamp_load(const struct statx_timestamp *ts) _pure_;
nsec_t statx_timestamp_load_nsec(const struct statx_timestamp *ts) _pure_;
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;
const char* inode_type_to_string(mode_t m);
mode_t inode_type_from_string(const char *s);
const char* inode_type_to_string(mode_t m) _const_;
mode_t inode_type_from_string(const char *s) _pure_;
/* Macros that check whether the stat/statx structures have been initialized already. For "struct stat" we
* use a check for .st_dev being non-zero, since the kernel unconditionally fills that in, mapping the file