Skip to content

Commit f222542

Browse files
defaziogiancarlotonyhutter
authored andcommitted
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 <behlendorf1@llnl.gov> Signed-off-by: Gian-Carlo DeFazio <defazio1@llnl.gov> Closes #14377
1 parent 7319a73 commit f222542

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

include/os/linux/kernel/linux/dcache_compat.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@
3535
#define d_make_root(inode) d_alloc_root(inode)
3636
#endif /* HAVE_D_MAKE_ROOT */
3737

38+
#ifdef HAVE_DENTRY_D_U_ALIASES
39+
#define d_alias d_u.d_alias
40+
#endif
41+
3842
/*
3943
* 2.6.30 API change,
4044
* The const keyword was added to the 'struct dentry_operations' in
@@ -70,11 +74,7 @@ zpl_d_drop_aliases(struct inode *inode)
7074
{
7175
struct dentry *dentry;
7276
spin_lock(&inode->i_lock);
73-
#ifdef HAVE_DENTRY_D_U_ALIASES
74-
hlist_for_each_entry(dentry, &inode->i_dentry, d_u.d_alias) {
75-
#else
7677
hlist_for_each_entry(dentry, &inode->i_dentry, d_alias) {
77-
#endif
7878
if (!IS_ROOT(dentry) && !d_mountpoint(dentry) &&
7979
(dentry->d_inode == inode)) {
8080
d_drop(dentry);

0 commit comments

Comments
 (0)