Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752856AbbG3W2i (ORCPT ); Thu, 30 Jul 2015 18:28:38 -0400 Received: from linuxhacker.ru ([217.76.32.60]:33789 "EHLO fiona.linuxhacker.ru" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1752071AbbG3W2f (ORCPT ); Thu, 30 Jul 2015 18:28:35 -0400 From: green@linuxhacker.ru To: Greg Kroah-Hartman , devel@driverdev.osuosl.org, Andreas Dilger Cc: Linux Kernel Mailing List , Oleg Drokin , Oleg Drokin Subject: [PATCH 09/13] staging/lustre: Use hlist primitives directly Date: Thu, 30 Jul 2015 18:28:00 -0400 Message-Id: <1438295284-2307773-10-git-send-email-green@linuxhacker.ru> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1438295284-2307773-1-git-send-email-green@linuxhacker.ru> References: <1438295284-2307773-1-git-send-email-green@linuxhacker.ru> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4178 Lines: 103 From: Oleg Drokin Get rid of ll_d_hlist* compat defines. Signed-off-by: Oleg Drokin --- drivers/staging/lustre/lustre/include/linux/lustre_compat25.h | 9 --------- drivers/staging/lustre/lustre/llite/dcache.c | 3 +-- drivers/staging/lustre/lustre/llite/namei.c | 10 ++++------ 3 files changed, 5 insertions(+), 17 deletions(-) diff --git a/drivers/staging/lustre/lustre/include/linux/lustre_compat25.h b/drivers/staging/lustre/lustre/include/linux/lustre_compat25.h index 65493b3..bc4f752 100644 --- a/drivers/staging/lustre/lustre/include/linux/lustre_compat25.h +++ b/drivers/staging/lustre/lustre/include/linux/lustre_compat25.h @@ -69,15 +69,6 @@ # define inode_dio_read(i) atomic_inc(&(i)->i_dio_count) /* inode_dio_done(i) use as-is for read unlock */ -#define ll_d_hlist_node hlist_node -#define ll_d_hlist_empty(list) hlist_empty(list) -#define ll_d_hlist_entry(ptr, type, name) hlist_entry(ptr.first, type, name) -#define ll_d_hlist_for_each(tmp, i_dentry) hlist_for_each(tmp, i_dentry) -#define ll_d_hlist_for_each_entry(dentry, p, i_dentry, alias) \ - p = NULL; hlist_for_each_entry(dentry, i_dentry, alias) - - - #define ll_pagevec_init(pv, cold) do {} while (0) #define ll_pagevec_add(pv, pg) (0) #define ll_pagevec_lru_add_file(pv) do {} while (0) diff --git a/drivers/staging/lustre/lustre/llite/dcache.c b/drivers/staging/lustre/lustre/llite/dcache.c index 7b008a6..b866859 100644 --- a/drivers/staging/lustre/lustre/llite/dcache.c +++ b/drivers/staging/lustre/lustre/llite/dcache.c @@ -250,7 +250,6 @@ void ll_intent_release(struct lookup_intent *it) void ll_invalidate_aliases(struct inode *inode) { struct dentry *dentry; - struct ll_d_hlist_node *p; LASSERT(inode != NULL); @@ -258,7 +257,7 @@ void ll_invalidate_aliases(struct inode *inode) inode->i_ino, inode->i_generation, inode); ll_lock_dcache(inode); - ll_d_hlist_for_each_entry(dentry, p, &inode->i_dentry, d_u.d_alias) { + hlist_for_each_entry(dentry, &inode->i_dentry, d_u.d_alias) { CDEBUG(D_DENTRY, "dentry in drop %pd (%p) parent %p inode %p flags %d\n", dentry, dentry, dentry->d_parent, d_inode(dentry), dentry->d_flags); diff --git a/drivers/staging/lustre/lustre/llite/namei.c b/drivers/staging/lustre/lustre/llite/namei.c index 2ed1e0a..05e7dc8 100644 --- a/drivers/staging/lustre/lustre/llite/namei.c +++ b/drivers/staging/lustre/lustre/llite/namei.c @@ -144,10 +144,9 @@ struct inode *ll_iget(struct super_block *sb, ino_t hash, static void ll_invalidate_negative_children(struct inode *dir) { struct dentry *dentry, *tmp_subdir; - struct ll_d_hlist_node *p; ll_lock_dcache(dir); - ll_d_hlist_for_each_entry(dentry, p, &dir->i_dentry, d_u.d_alias) { + hlist_for_each_entry(dentry, &dir->i_dentry, d_u.d_alias) { spin_lock(&dentry->d_lock); if (!list_empty(&dentry->d_subdirs)) { struct dentry *child; @@ -334,15 +333,14 @@ void ll_i2gids(__u32 *suppgids, struct inode *i1, struct inode *i2) static struct dentry *ll_find_alias(struct inode *inode, struct dentry *dentry) { struct dentry *alias, *discon_alias, *invalid_alias; - struct ll_d_hlist_node *p; - if (ll_d_hlist_empty(&inode->i_dentry)) + if (hlist_empty(&inode->i_dentry)) return NULL; discon_alias = invalid_alias = NULL; ll_lock_dcache(inode); - ll_d_hlist_for_each_entry(alias, p, &inode->i_dentry, d_u.d_alias) { + hlist_for_each_entry(alias, &inode->i_dentry, d_u.d_alias) { LASSERT(alias != dentry); spin_lock(&alias->d_lock); @@ -690,7 +688,7 @@ static struct inode *ll_create_node(struct inode *dir, struct lookup_intent *it) goto out; } - LASSERT(ll_d_hlist_empty(&inode->i_dentry)); + LASSERT(hlist_empty(&inode->i_dentry)); /* We asked for a lock on the directory, but were granted a * lock on the inode. Since we finally have an inode pointer, -- 2.1.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/