tree-wide: drop workarounds for statx()
struct statx in glibc header was introduced in glibc-2.28 (fd70af45528d59a00eb3190ef6706cb299488fcd), but at that time, sys/stat.h conflicts with linux/stat.h. Since glibc-2.30 (5dad6ffbb2b76215cfcd38c3001778536ada8e8a), sys/stat.h includes linux/stat.h if exists. Since now our baseline of glibc is 2.31. Hence, we can drop workarounds for struct statx by importing linux/stat.h from newer kernel (v6.14-rc4).
This commit is contained in:
+1
-24
@@ -11,7 +11,6 @@
|
||||
|
||||
#include "fs-util.h"
|
||||
#include "macro.h"
|
||||
#include "missing_stat.h"
|
||||
#include "siphash24.h"
|
||||
#include "time-util.h"
|
||||
|
||||
@@ -90,31 +89,12 @@ bool stat_inode_same(const struct stat *a, const struct stat *b);
|
||||
bool stat_inode_unmodified(const struct stat *a, const struct stat *b);
|
||||
|
||||
bool statx_inode_same(const struct statx *a, const struct statx *b);
|
||||
bool statx_mount_same(const struct new_statx *a, const struct new_statx *b);
|
||||
bool statx_mount_same(const struct statx *a, const struct statx *b);
|
||||
|
||||
int statx_fallback(int dfd, const char *path, int flags, unsigned mask, struct statx *sx);
|
||||
|
||||
int xstatfsat(int dir_fd, const char *path, struct statfs *ret);
|
||||
|
||||
#if HAS_FEATURE_MEMORY_SANITIZER
|
||||
# warning "Explicitly initializing struct statx, to work around msan limitation. Please remove as soon as msan has been updated to not require this."
|
||||
# define STRUCT_STATX_DEFINE(var) \
|
||||
struct statx var = {}
|
||||
# define STRUCT_NEW_STATX_DEFINE(var) \
|
||||
union { \
|
||||
struct statx sx; \
|
||||
struct new_statx nsx; \
|
||||
} var = {}
|
||||
#else
|
||||
# define STRUCT_STATX_DEFINE(var) \
|
||||
struct statx var
|
||||
# define STRUCT_NEW_STATX_DEFINE(var) \
|
||||
union { \
|
||||
struct statx sx; \
|
||||
struct new_statx nsx; \
|
||||
} var
|
||||
#endif
|
||||
|
||||
static inline usec_t statx_timestamp_load(const struct statx_timestamp *ts) {
|
||||
return timespec_load(&(const struct timespec) { .tv_sec = ts->tv_sec, .tv_nsec = ts->tv_nsec });
|
||||
}
|
||||
@@ -140,6 +120,3 @@ static inline bool stat_is_set(const struct stat *st) {
|
||||
static inline bool statx_is_set(const struct statx *sx) {
|
||||
return sx && sx->stx_mask != 0;
|
||||
}
|
||||
static inline bool new_statx_is_set(const struct new_statx *sx) {
|
||||
return sx && sx->stx_mask != 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user