Linux 7.1: access dentry d_alias directly

The d_u union introduced in 3.18 is now anonymous, so we need to detect
it and decide the right way to name d_alias.

Note that we used to have support for both names to support kernels
before 3.18, so this commit is effectively reverting the commit that
removed that support, efc293e371.

Sponsored-by: TrueNAS
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Rob Norris <rob.norris@truenas.com>
Closes #18471
This commit is contained in:
Rob Norris
2026-05-02 04:52:57 +10:00
committed by Tony Hutter
parent fc87e269e2
commit 65b4a5c551
3 changed files with 36 additions and 0 deletions
@@ -32,7 +32,9 @@
#define dname(dentry) ((char *)((dentry)->d_name.name))
#define dlen(dentry) ((int)((dentry)->d_name.len))
#ifdef HAVE_DENTRY_D_U_ALIASES
#define d_alias d_u.d_alias
#endif
#ifdef HAVE_MM_PAGE_FLAGS_STRUCT
/*