summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGian-Carlo DeFazio <[email protected]>2023-01-12 10:14:04 -0800
committerTony Hutter <[email protected]>2023-01-19 12:50:42 -0800
commitf22254283a7f42e267170598cddad82606e39031 (patch)
tree90981b52b04c7664fdfa4a5b2148c3fe54dd0b31
parent7319a73921ff89851d454c6d22e7cfdc72c76df4 (diff)
change how d_alias is replaced by du.d_alias
d_alias may need to be converted to du.d_alias depending on the kernel version. d_alias is currently in only one place in the code which changes "hlist_for_each_entry(dentry, &inode->i_dentry, d_alias)" to "hlist_for_each_entry(dentry, &inode->i_dentry, d_u.d_alias)" as neccesary. This effectively results in a double macro expansion for code that uses the zfs headers but already has its own macro for just d_alias (lustre in this case). Remove the conditional code for hlist_for_each_entry and have a macro for "d_alias -> du.d_alias" instead. Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Gian-Carlo DeFazio <[email protected]> Closes #14377
-rw-r--r--include/os/linux/kernel/linux/dcache_compat.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/include/os/linux/kernel/linux/dcache_compat.h b/include/os/linux/kernel/linux/dcache_compat.h
index e2aca1629..c90135fd3 100644
--- a/include/os/linux/kernel/linux/dcache_compat.h
+++ b/include/os/linux/kernel/linux/dcache_compat.h
@@ -35,6 +35,10 @@
#define d_make_root(inode) d_alloc_root(inode)
#endif /* HAVE_D_MAKE_ROOT */
+#ifdef HAVE_DENTRY_D_U_ALIASES
+#define d_alias d_u.d_alias
+#endif
+
/*
* 2.6.30 API change,
* The const keyword was added to the 'struct dentry_operations' in
@@ -70,11 +74,7 @@ zpl_d_drop_aliases(struct inode *inode)
{
struct dentry *dentry;
spin_lock(&inode->i_lock);
-#ifdef HAVE_DENTRY_D_U_ALIASES
- hlist_for_each_entry(dentry, &inode->i_dentry, d_u.d_alias) {
-#else
hlist_for_each_entry(dentry, &inode->i_dentry, d_alias) {
-#endif
if (!IS_ROOT(dentry) && !d_mountpoint(dentry) &&
(dentry->d_inode == inode)) {
d_drop(dentry);