summaryrefslogtreecommitdiff
path: root/fs/ncpfs/ncplib_kernel.h
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2014-09-26 07:57:58 +0400
committerAl Viro <viro@zeniv.linux.org.uk>2014-10-09 10:39:16 +0400
commit821cc3070ff54e39ab6624c843f1905d737d9ac0 (patch)
treeb931db75f0713ca95fa78443f4f6ddd6cd7ec975 /fs/ncpfs/ncplib_kernel.h
parent5e6123f3477e4260fb14392f0a88f1a842fa4d42 (diff)
downloadlinux-821cc3070ff54e39ab6624c843f1905d737d9ac0.tar.xz
ncpfs: use list_for_each_entry() for d_subdirs walk
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/ncpfs/ncplib_kernel.h')
-rw-r--r--fs/ncpfs/ncplib_kernel.h14
1 files changed, 2 insertions, 12 deletions
diff --git a/fs/ncpfs/ncplib_kernel.h b/fs/ncpfs/ncplib_kernel.h
index 32c06587351a..52cb19d66ecb 100644
--- a/fs/ncpfs/ncplib_kernel.h
+++ b/fs/ncpfs/ncplib_kernel.h
@@ -188,20 +188,14 @@ static inline void
ncp_renew_dentries(struct dentry *parent)
{
struct ncp_server *server = NCP_SERVER(parent->d_inode);
- struct list_head *next;
struct dentry *dentry;
spin_lock(&parent->d_lock);
- next = parent->d_subdirs.next;
- while (next != &parent->d_subdirs) {
- dentry = list_entry(next, struct dentry, d_u.d_child);
-
+ list_for_each_entry(dentry, &parent->d_subdirs, d_u.d_child) {
if (dentry->d_fsdata == NULL)
ncp_age_dentry(server, dentry);
else
ncp_new_dentry(dentry);
-
- next = next->next;
}
spin_unlock(&parent->d_lock);
}
@@ -210,16 +204,12 @@ static inline void
ncp_invalidate_dircache_entries(struct dentry *parent)
{
struct ncp_server *server = NCP_SERVER(parent->d_inode);
- struct list_head *next;
struct dentry *dentry;
spin_lock(&parent->d_lock);
- next = parent->d_subdirs.next;
- while (next != &parent->d_subdirs) {
- dentry = list_entry(next, struct dentry, d_u.d_child);
+ list_for_each_entry(dentry, &parent->d_subdirs, d_u.d_child) {
dentry->d_fsdata = NULL;
ncp_age_dentry(server, dentry);
- next = next->next;
}
spin_unlock(&parent->d_lock);
}