aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/powerpc/platforms/cell/spufs/inode.c2
-rw-r--r--drivers/staging/lustre/lustre/llite/dcache.c2
-rw-r--r--drivers/staging/lustre/lustre/llite/llite_lib.c2
-rw-r--r--drivers/staging/lustre/lustre/llite/namei.c8
-rw-r--r--fs/affs/amigaffs.c2
-rw-r--r--fs/autofs4/expire.c12
-rw-r--r--fs/autofs4/root.c2
-rw-r--r--fs/ceph/dir.c8
-rw-r--r--fs/ceph/inode.c2
-rw-r--r--fs/cifs/inode.c2
-rw-r--r--fs/coda/cache.c2
-rw-r--r--fs/dcache.c53
-rw-r--r--fs/debugfs/inode.c2
-rw-r--r--fs/exportfs/expfs.c2
-rw-r--r--fs/libfs.c12
-rw-r--r--fs/ncpfs/dir.c2
-rw-r--r--fs/ncpfs/ncplib_kernel.h4
-rw-r--r--fs/nfs/getroot.c2
-rw-r--r--fs/notify/fsnotify.c4
-rw-r--r--fs/ocfs2/dcache.c2
-rw-r--r--include/linux/dcache.h8
-rw-r--r--kernel/trace/trace.c4
-rw-r--r--kernel/trace/trace_events.c2
-rw-r--r--security/selinux/selinuxfs.c6
24 files changed, 73 insertions, 74 deletions
diff --git a/arch/powerpc/platforms/cell/spufs/inode.c b/arch/powerpc/platforms/cell/spufs/inode.c
index 87ba7cf99cd7..65d633f20d37 100644
--- a/arch/powerpc/platforms/cell/spufs/inode.c
+++ b/arch/powerpc/platforms/cell/spufs/inode.c
@@ -164,7 +164,7 @@ static void spufs_prune_dir(struct dentry *dir)
164 struct dentry *dentry, *tmp; 164 struct dentry *dentry, *tmp;
165 165
166 mutex_lock(&dir->d_inode->i_mutex); 166 mutex_lock(&dir->d_inode->i_mutex);
167 list_for_each_entry_safe(dentry, tmp, &dir->d_subdirs, d_u.d_child) { 167 list_for_each_entry_safe(dentry, tmp, &dir->d_subdirs, d_child) {
168 spin_lock(&dentry->d_lock); 168 spin_lock(&dentry->d_lock);
169 if (!(d_unhashed(dentry)) && dentry->d_inode) { 169 if (!(d_unhashed(dentry)) && dentry->d_inode) {
170 dget_dlock(dentry); 170 dget_dlock(dentry);
diff --git a/drivers/staging/lustre/lustre/llite/dcache.c b/drivers/staging/lustre/lustre/llite/dcache.c
index 439e4875b05c..311907b762bd 100644
--- a/drivers/staging/lustre/lustre/llite/dcache.c
+++ b/drivers/staging/lustre/lustre/llite/dcache.c
@@ -258,7 +258,7 @@ void ll_invalidate_aliases(struct inode *inode)
258 inode->i_ino, inode->i_generation, inode); 258 inode->i_ino, inode->i_generation, inode);
259 259
260 ll_lock_dcache(inode); 260 ll_lock_dcache(inode);
261 ll_d_hlist_for_each_entry(dentry, p, &inode->i_dentry, d_alias) { 261 ll_d_hlist_for_each_entry(dentry, p, &inode->i_dentry, d_u.d_alias) {
262 CDEBUG(D_DENTRY, "dentry in drop %.*s (%p) parent %p " 262 CDEBUG(D_DENTRY, "dentry in drop %.*s (%p) parent %p "
263 "inode %p flags %d\n", dentry->d_name.len, 263 "inode %p flags %d\n", dentry->d_name.len,
264 dentry->d_name.name, dentry, dentry->d_parent, 264 dentry->d_name.name, dentry, dentry->d_parent,
diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c b/drivers/staging/lustre/lustre/llite/llite_lib.c
index a8bcc51057f1..f4ca7b753021 100644
--- a/drivers/staging/lustre/lustre/llite/llite_lib.c
+++ b/drivers/staging/lustre/lustre/llite/llite_lib.c
@@ -711,7 +711,7 @@ void lustre_dump_dentry(struct dentry *dentry, int recur)
711 return; 711 return;
712 712
713 list_for_each(tmp, &dentry->d_subdirs) { 713 list_for_each(tmp, &dentry->d_subdirs) {
714 struct dentry *d = list_entry(tmp, struct dentry, d_u.d_child); 714 struct dentry *d = list_entry(tmp, struct dentry, d_child);
715 lustre_dump_dentry(d, recur - 1); 715 lustre_dump_dentry(d, recur - 1);
716 } 716 }
717} 717}
diff --git a/drivers/staging/lustre/lustre/llite/namei.c b/drivers/staging/lustre/lustre/llite/namei.c
index 7a68c1e027e0..6dfd98509268 100644
--- a/drivers/staging/lustre/lustre/llite/namei.c
+++ b/drivers/staging/lustre/lustre/llite/namei.c
@@ -167,14 +167,14 @@ static void ll_invalidate_negative_children(struct inode *dir)
167 struct ll_d_hlist_node *p; 167 struct ll_d_hlist_node *p;
168 168
169 ll_lock_dcache(dir); 169 ll_lock_dcache(dir);
170 ll_d_hlist_for_each_entry(dentry, p, &dir->i_dentry, d_alias) { 170 ll_d_hlist_for_each_entry(dentry, p, &dir->i_dentry, d_u.d_alias) {
171 spin_lock(&dentry->d_lock); 171 spin_lock(&dentry->d_lock);
172 if (!list_empty(&dentry->d_subdirs)) { 172 if (!list_empty(&dentry->d_subdirs)) {
173 struct dentry *child; 173 struct dentry *child;
174 174
175 list_for_each_entry_safe(child, tmp_subdir, 175 list_for_each_entry_safe(child, tmp_subdir,
176 &dentry->d_subdirs, 176 &dentry->d_subdirs,
177 d_u.d_child) { 177 d_child) {
178 if (child->d_inode == NULL) 178 if (child->d_inode == NULL)
179 d_lustre_invalidate(child, 1); 179 d_lustre_invalidate(child, 1);
180 } 180 }
@@ -362,7 +362,7 @@ static struct dentry *ll_find_alias(struct inode *inode, struct dentry *dentry)
362 discon_alias = invalid_alias = NULL; 362 discon_alias = invalid_alias = NULL;
363 363
364 ll_lock_dcache(inode); 364 ll_lock_dcache(inode);
365 ll_d_hlist_for_each_entry(alias, p, &inode->i_dentry, d_alias) { 365 ll_d_hlist_for_each_entry(alias, p, &inode->i_dentry, d_u.d_alias) {
366 LASSERT(alias != dentry); 366 LASSERT(alias != dentry);
367 367
368 spin_lock(&alias->d_lock); 368 spin_lock(&alias->d_lock);
@@ -953,7 +953,7 @@ static void ll_get_child_fid(struct inode * dir, struct qstr *name,
953{ 953{
954 struct dentry *parent, *child; 954 struct dentry *parent, *child;
955 955
956 parent = ll_d_hlist_entry(dir->i_dentry, struct dentry, d_alias); 956 parent = ll_d_hlist_entry(dir->i_dentry, struct dentry, d_u.d_alias);
957 child = d_lookup(parent, name); 957 child = d_lookup(parent, name);
958 if (child) { 958 if (child) {
959 if (child->d_inode) 959 if (child->d_inode)
diff --git a/fs/affs/amigaffs.c b/fs/affs/amigaffs.c
index abc853968fed..937ce8754b24 100644
--- a/fs/affs/amigaffs.c
+++ b/fs/affs/amigaffs.c
@@ -125,7 +125,7 @@ affs_fix_dcache(struct inode *inode, u32 entry_ino)
125{ 125{
126 struct dentry *dentry; 126 struct dentry *dentry;
127 spin_lock(&inode->i_lock); 127 spin_lock(&inode->i_lock);
128 hlist_for_each_entry(dentry, &inode->i_dentry, d_alias) { 128 hlist_for_each_entry(dentry, &inode->i_dentry, d_u.d_alias) {
129 if (entry_ino == (u32)(long)dentry->d_fsdata) { 129 if (entry_ino == (u32)(long)dentry->d_fsdata) {
130 dentry->d_fsdata = (void *)inode->i_ino; 130 dentry->d_fsdata = (void *)inode->i_ino;
131 break; 131 break;
diff --git a/fs/autofs4/expire.c b/fs/autofs4/expire.c
index 683a5b9ce22a..dcdec6fd33c6 100644
--- a/fs/autofs4/expire.c
+++ b/fs/autofs4/expire.c
@@ -85,7 +85,7 @@ static struct dentry *get_next_positive_subdir(struct dentry *prev,
85 spin_lock(&root->d_lock); 85 spin_lock(&root->d_lock);
86 86
87 if (prev) 87 if (prev)
88 next = prev->d_u.d_child.next; 88 next = prev->d_child.next;
89 else { 89 else {
90 prev = dget_dlock(root); 90 prev = dget_dlock(root);
91 next = prev->d_subdirs.next; 91 next = prev->d_subdirs.next;
@@ -99,13 +99,13 @@ cont:
99 return NULL; 99 return NULL;
100 } 100 }
101 101
102 q = list_entry(next, struct dentry, d_u.d_child); 102 q = list_entry(next, struct dentry, d_child);
103 103
104 spin_lock_nested(&q->d_lock, DENTRY_D_LOCK_NESTED); 104 spin_lock_nested(&q->d_lock, DENTRY_D_LOCK_NESTED);
105 /* Already gone or negative dentry (under construction) - try next */ 105 /* Already gone or negative dentry (under construction) - try next */
106 if (!d_count(q) || !simple_positive(q)) { 106 if (!d_count(q) || !simple_positive(q)) {
107 spin_unlock(&q->d_lock); 107 spin_unlock(&q->d_lock);
108 next = q->d_u.d_child.next; 108 next = q->d_child.next;
109 goto cont; 109 goto cont;
110 } 110 }
111 dget_dlock(q); 111 dget_dlock(q);
@@ -155,13 +155,13 @@ again:
155 goto relock; 155 goto relock;
156 } 156 }
157 spin_unlock(&p->d_lock); 157 spin_unlock(&p->d_lock);
158 next = p->d_u.d_child.next; 158 next = p->d_child.next;
159 p = parent; 159 p = parent;
160 if (next != &parent->d_subdirs) 160 if (next != &parent->d_subdirs)
161 break; 161 break;
162 } 162 }
163 } 163 }
164 ret = list_entry(next, struct dentry, d_u.d_child); 164 ret = list_entry(next, struct dentry, d_child);
165 165
166 spin_lock_nested(&ret->d_lock, DENTRY_D_LOCK_NESTED); 166 spin_lock_nested(&ret->d_lock, DENTRY_D_LOCK_NESTED);
167 /* Negative dentry - try next */ 167 /* Negative dentry - try next */
@@ -489,7 +489,7 @@ found:
489 spin_lock(&sbi->lookup_lock); 489 spin_lock(&sbi->lookup_lock);
490 spin_lock(&expired->d_parent->d_lock); 490 spin_lock(&expired->d_parent->d_lock);
491 spin_lock_nested(&expired->d_lock, DENTRY_D_LOCK_NESTED); 491 spin_lock_nested(&expired->d_lock, DENTRY_D_LOCK_NESTED);
492 list_move(&expired->d_parent->d_subdirs, &expired->d_u.d_child); 492 list_move(&expired->d_parent->d_subdirs, &expired->d_child);
493 spin_unlock(&expired->d_lock); 493 spin_unlock(&expired->d_lock);
494 spin_unlock(&expired->d_parent->d_lock); 494 spin_unlock(&expired->d_parent->d_lock);
495 spin_unlock(&sbi->lookup_lock); 495 spin_unlock(&sbi->lookup_lock);
diff --git a/fs/autofs4/root.c b/fs/autofs4/root.c
index d76d083f2f06..0822c9eacc56 100644
--- a/fs/autofs4/root.c
+++ b/fs/autofs4/root.c
@@ -687,7 +687,7 @@ static void autofs_clear_leaf_automount_flags(struct dentry *dentry)
687 /* only consider parents below dentrys in the root */ 687 /* only consider parents below dentrys in the root */
688 if (IS_ROOT(parent->d_parent)) 688 if (IS_ROOT(parent->d_parent))
689 return; 689 return;
690 d_child = &dentry->d_u.d_child; 690 d_child = &dentry->d_child;
691 /* Set parent managed if it's becoming empty */ 691 /* Set parent managed if it's becoming empty */
692 if (d_child->next == &parent->d_subdirs && 692 if (d_child->next == &parent->d_subdirs &&
693 d_child->prev == &parent->d_subdirs) 693 d_child->prev == &parent->d_subdirs)
diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c
index e6d63f8f98c0..695e7888fef8 100644
--- a/fs/ceph/dir.c
+++ b/fs/ceph/dir.c
@@ -111,7 +111,7 @@ static int fpos_cmp(loff_t l, loff_t r)
111/* 111/*
112 * When possible, we try to satisfy a readdir by peeking at the 112 * When possible, we try to satisfy a readdir by peeking at the
113 * dcache. We make this work by carefully ordering dentries on 113 * dcache. We make this work by carefully ordering dentries on
114 * d_u.d_child when we initially get results back from the MDS, and 114 * d_child when we initially get results back from the MDS, and
115 * falling back to a "normal" sync readdir if any dentries in the dir 115 * falling back to a "normal" sync readdir if any dentries in the dir
116 * are dropped. 116 * are dropped.
117 * 117 *
@@ -147,11 +147,11 @@ static int __dcache_readdir(struct file *file, struct dir_context *ctx,
147 p = parent->d_subdirs.prev; 147 p = parent->d_subdirs.prev;
148 dout(" initial p %p/%p\n", p->prev, p->next); 148 dout(" initial p %p/%p\n", p->prev, p->next);
149 } else { 149 } else {
150 p = last->d_u.d_child.prev; 150 p = last->d_child.prev;
151 } 151 }
152 152
153more: 153more:
154 dentry = list_entry(p, struct dentry, d_u.d_child); 154 dentry = list_entry(p, struct dentry, d_child);
155 di = ceph_dentry(dentry); 155 di = ceph_dentry(dentry);
156 while (1) { 156 while (1) {
157 dout(" p %p/%p %s d_subdirs %p/%p\n", p->prev, p->next, 157 dout(" p %p/%p %s d_subdirs %p/%p\n", p->prev, p->next,
@@ -174,7 +174,7 @@ more:
174 !dentry->d_inode ? " null" : ""); 174 !dentry->d_inode ? " null" : "");
175 spin_unlock(&dentry->d_lock); 175 spin_unlock(&dentry->d_lock);
176 p = p->prev; 176 p = p->prev;
177 dentry = list_entry(p, struct dentry, d_u.d_child); 177 dentry = list_entry(p, struct dentry, d_child);
178 di = ceph_dentry(dentry); 178 di = ceph_dentry(dentry);
179 } 179 }
180 180
diff --git a/fs/ceph/inode.c b/fs/ceph/inode.c
index 7b6139004401..7a1df90c7771 100644
--- a/fs/ceph/inode.c
+++ b/fs/ceph/inode.c
@@ -1399,7 +1399,7 @@ retry_lookup:
1399 /* reorder parent's d_subdirs */ 1399 /* reorder parent's d_subdirs */
1400 spin_lock(&parent->d_lock); 1400 spin_lock(&parent->d_lock);
1401 spin_lock_nested(&dn->d_lock, DENTRY_D_LOCK_NESTED); 1401 spin_lock_nested(&dn->d_lock, DENTRY_D_LOCK_NESTED);
1402 list_move(&dn->d_u.d_child, &parent->d_subdirs); 1402 list_move(&dn->d_child, &parent->d_subdirs);
1403 spin_unlock(&dn->d_lock); 1403 spin_unlock(&dn->d_lock);
1404 spin_unlock(&parent->d_lock); 1404 spin_unlock(&parent->d_lock);
1405 } 1405 }
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index 197cb503d528..0c3ce464cae4 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -895,7 +895,7 @@ inode_has_hashed_dentries(struct inode *inode)
895 struct dentry *dentry; 895 struct dentry *dentry;
896 896
897 spin_lock(&inode->i_lock); 897 spin_lock(&inode->i_lock);
898 hlist_for_each_entry(dentry, &inode->i_dentry, d_alias) { 898 hlist_for_each_entry(dentry, &inode->i_dentry, d_u.d_alias) {
899 if (!d_unhashed(dentry) || IS_ROOT(dentry)) { 899 if (!d_unhashed(dentry) || IS_ROOT(dentry)) {
900 spin_unlock(&inode->i_lock); 900 spin_unlock(&inode->i_lock);
901 return true; 901 return true;
diff --git a/fs/coda/cache.c b/fs/coda/cache.c
index 278f8fdeb9ef..46ee6f238985 100644
--- a/fs/coda/cache.c
+++ b/fs/coda/cache.c
@@ -92,7 +92,7 @@ static void coda_flag_children(struct dentry *parent, int flag)
92 struct dentry *de; 92 struct dentry *de;
93 93
94 spin_lock(&parent->d_lock); 94 spin_lock(&parent->d_lock);
95 list_for_each_entry(de, &parent->d_subdirs, d_u.d_child) { 95 list_for_each_entry(de, &parent->d_subdirs, d_child) {
96 /* don't know what to do with negative dentries */ 96 /* don't know what to do with negative dentries */
97 if (de->d_inode ) 97 if (de->d_inode )
98 coda_flag_inode(de->d_inode, flag); 98 coda_flag_inode(de->d_inode, flag);
diff --git a/fs/dcache.c b/fs/dcache.c
index 3ffef7f4e5cd..8b4c45e40834 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -44,7 +44,7 @@
44/* 44/*
45 * Usage: 45 * Usage:
46 * dcache->d_inode->i_lock protects: 46 * dcache->d_inode->i_lock protects:
47 * - i_dentry, d_alias, d_inode of aliases 47 * - i_dentry, d_u.d_alias, d_inode of aliases
48 * dcache_hash_bucket lock protects: 48 * dcache_hash_bucket lock protects:
49 * - the dcache hash table 49 * - the dcache hash table
50 * s_anon bl list spinlock protects: 50 * s_anon bl list spinlock protects:
@@ -59,7 +59,7 @@
59 * - d_unhashed() 59 * - d_unhashed()
60 * - d_parent and d_subdirs 60 * - d_parent and d_subdirs
61 * - childrens' d_child and d_parent 61 * - childrens' d_child and d_parent
62 * - d_alias, d_inode 62 * - d_u.d_alias, d_inode
63 * 63 *
64 * Ordering: 64 * Ordering:
65 * dentry->d_inode->i_lock 65 * dentry->d_inode->i_lock
@@ -252,14 +252,12 @@ static void __d_free(struct rcu_head *head)
252{ 252{
253 struct dentry *dentry = container_of(head, struct dentry, d_u.d_rcu); 253 struct dentry *dentry = container_of(head, struct dentry, d_u.d_rcu);
254 254
255 WARN_ON(!hlist_unhashed(&dentry->d_alias));
256 kmem_cache_free(dentry_cache, dentry); 255 kmem_cache_free(dentry_cache, dentry);
257} 256}
258 257
259static void __d_free_external(struct rcu_head *head) 258static void __d_free_external(struct rcu_head *head)
260{ 259{
261 struct dentry *dentry = container_of(head, struct dentry, d_u.d_rcu); 260 struct dentry *dentry = container_of(head, struct dentry, d_u.d_rcu);
262 WARN_ON(!hlist_unhashed(&dentry->d_alias));
263 kfree(external_name(dentry)); 261 kfree(external_name(dentry));
264 kmem_cache_free(dentry_cache, dentry); 262 kmem_cache_free(dentry_cache, dentry);
265} 263}
@@ -271,6 +269,7 @@ static inline int dname_external(const struct dentry *dentry)
271 269
272static void dentry_free(struct dentry *dentry) 270static void dentry_free(struct dentry *dentry)
273{ 271{
272 WARN_ON(!hlist_unhashed(&dentry->d_u.d_alias));
274 if (unlikely(dname_external(dentry))) { 273 if (unlikely(dname_external(dentry))) {
275 struct external_name *p = external_name(dentry); 274 struct external_name *p = external_name(dentry);
276 if (likely(atomic_dec_and_test(&p->u.count))) { 275 if (likely(atomic_dec_and_test(&p->u.count))) {
@@ -311,7 +310,7 @@ static void dentry_iput(struct dentry * dentry)
311 struct inode *inode = dentry->d_inode; 310 struct inode *inode = dentry->d_inode;
312 if (inode) { 311 if (inode) {
313 dentry->d_inode = NULL; 312 dentry->d_inode = NULL;
314 hlist_del_init(&dentry->d_alias); 313 hlist_del_init(&dentry->d_u.d_alias);
315 spin_unlock(&dentry->d_lock); 314 spin_unlock(&dentry->d_lock);
316 spin_unlock(&inode->i_lock); 315 spin_unlock(&inode->i_lock);
317 if (!inode->i_nlink) 316 if (!inode->i_nlink)
@@ -336,7 +335,7 @@ static void dentry_unlink_inode(struct dentry * dentry)
336 struct inode *inode = dentry->d_inode; 335 struct inode *inode = dentry->d_inode;
337 __d_clear_type(dentry); 336 __d_clear_type(dentry);
338 dentry->d_inode = NULL; 337 dentry->d_inode = NULL;
339 hlist_del_init(&dentry->d_alias); 338 hlist_del_init(&dentry->d_u.d_alias);
340 dentry_rcuwalk_barrier(dentry); 339 dentry_rcuwalk_barrier(dentry);
341 spin_unlock(&dentry->d_lock); 340 spin_unlock(&dentry->d_lock);
342 spin_unlock(&inode->i_lock); 341 spin_unlock(&inode->i_lock);
@@ -496,7 +495,7 @@ static void __dentry_kill(struct dentry *dentry)
496 } 495 }
497 /* if it was on the hash then remove it */ 496 /* if it was on the hash then remove it */
498 __d_drop(dentry); 497 __d_drop(dentry);
499 list_del(&dentry->d_u.d_child); 498 list_del(&dentry->d_child);
500 /* 499 /*
501 * Inform d_walk() that we are no longer attached to the 500 * Inform d_walk() that we are no longer attached to the
502 * dentry tree 501 * dentry tree
@@ -722,7 +721,7 @@ static struct dentry *__d_find_alias(struct inode *inode)
722 721
723again: 722again:
724 discon_alias = NULL; 723 discon_alias = NULL;
725 hlist_for_each_entry(alias, &inode->i_dentry, d_alias) { 724 hlist_for_each_entry(alias, &inode->i_dentry, d_u.d_alias) {
726 spin_lock(&alias->d_lock); 725 spin_lock(&alias->d_lock);
727 if (S_ISDIR(inode->i_mode) || !d_unhashed(alias)) { 726 if (S_ISDIR(inode->i_mode) || !d_unhashed(alias)) {
728 if (IS_ROOT(alias) && 727 if (IS_ROOT(alias) &&
@@ -772,7 +771,7 @@ void d_prune_aliases(struct inode *inode)
772 struct dentry *dentry; 771 struct dentry *dentry;
773restart: 772restart:
774 spin_lock(&inode->i_lock); 773 spin_lock(&inode->i_lock);
775 hlist_for_each_entry(dentry, &inode->i_dentry, d_alias) { 774 hlist_for_each_entry(dentry, &inode->i_dentry, d_u.d_alias) {
776 spin_lock(&dentry->d_lock); 775 spin_lock(&dentry->d_lock);
777 if (!dentry->d_lockref.count) { 776 if (!dentry->d_lockref.count) {
778 struct dentry *parent = lock_parent(dentry); 777 struct dentry *parent = lock_parent(dentry);
@@ -1050,7 +1049,7 @@ repeat:
1050resume: 1049resume:
1051 while (next != &this_parent->d_subdirs) { 1050 while (next != &this_parent->d_subdirs) {
1052 struct list_head *tmp = next; 1051 struct list_head *tmp = next;
1053 struct dentry *dentry = list_entry(tmp, struct dentry, d_u.d_child); 1052 struct dentry *dentry = list_entry(tmp, struct dentry, d_child);
1054 next = tmp->next; 1053 next = tmp->next;
1055 1054
1056 spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED); 1055 spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED);
@@ -1102,7 +1101,7 @@ resume:
1102 goto rename_retry; 1101 goto rename_retry;
1103 } 1102 }
1104 rcu_read_unlock(); 1103 rcu_read_unlock();
1105 next = child->d_u.d_child.next; 1104 next = child->d_child.next;
1106 goto resume; 1105 goto resume;
1107 } 1106 }
1108 if (need_seqretry(&rename_lock, seq)) { 1107 if (need_seqretry(&rename_lock, seq)) {
@@ -1454,8 +1453,8 @@ struct dentry *__d_alloc(struct super_block *sb, const struct qstr *name)
1454 INIT_HLIST_BL_NODE(&dentry->d_hash); 1453 INIT_HLIST_BL_NODE(&dentry->d_hash);
1455 INIT_LIST_HEAD(&dentry->d_lru); 1454 INIT_LIST_HEAD(&dentry->d_lru);
1456 INIT_LIST_HEAD(&dentry->d_subdirs); 1455 INIT_LIST_HEAD(&dentry->d_subdirs);
1457 INIT_HLIST_NODE(&dentry->d_alias); 1456 INIT_HLIST_NODE(&dentry->d_u.d_alias);
1458 INIT_LIST_HEAD(&dentry->d_u.d_child); 1457 INIT_LIST_HEAD(&dentry->d_child);
1459 d_set_d_op(dentry, dentry->d_sb->s_d_op); 1458 d_set_d_op(dentry, dentry->d_sb->s_d_op);
1460 1459
1461 this_cpu_inc(nr_dentry); 1460 this_cpu_inc(nr_dentry);
@@ -1485,7 +1484,7 @@ struct dentry *d_alloc(struct dentry * parent, const struct qstr *name)
1485 */ 1484 */
1486 __dget_dlock(parent); 1485 __dget_dlock(parent);
1487 dentry->d_parent = parent; 1486 dentry->d_parent = parent;
1488 list_add(&dentry->d_u.d_child, &parent->d_subdirs); 1487 list_add(&dentry->d_child, &parent->d_subdirs);
1489 spin_unlock(&parent->d_lock); 1488 spin_unlock(&parent->d_lock);
1490 1489
1491 return dentry; 1490 return dentry;
@@ -1578,7 +1577,7 @@ static void __d_instantiate(struct dentry *dentry, struct inode *inode)
1578 spin_lock(&dentry->d_lock); 1577 spin_lock(&dentry->d_lock);
1579 __d_set_type(dentry, add_flags); 1578 __d_set_type(dentry, add_flags);
1580 if (inode) 1579 if (inode)
1581 hlist_add_head(&dentry->d_alias, &inode->i_dentry); 1580 hlist_add_head(&dentry->d_u.d_alias, &inode->i_dentry);
1582 dentry->d_inode = inode; 1581 dentry->d_inode = inode;
1583 dentry_rcuwalk_barrier(dentry); 1582 dentry_rcuwalk_barrier(dentry);
1584 spin_unlock(&dentry->d_lock); 1583 spin_unlock(&dentry->d_lock);
@@ -1602,7 +1601,7 @@ static void __d_instantiate(struct dentry *dentry, struct inode *inode)
1602 1601
1603void d_instantiate(struct dentry *entry, struct inode * inode) 1602void d_instantiate(struct dentry *entry, struct inode * inode)
1604{ 1603{
1605 BUG_ON(!hlist_unhashed(&entry->d_alias)); 1604 BUG_ON(!hlist_unhashed(&entry->d_u.d_alias));
1606 if (inode) 1605 if (inode)
1607 spin_lock(&inode->i_lock); 1606 spin_lock(&inode->i_lock);
1608 __d_instantiate(entry, inode); 1607 __d_instantiate(entry, inode);
@@ -1641,7 +1640,7 @@ static struct dentry *__d_instantiate_unique(struct dentry *entry,
1641 return NULL; 1640 return NULL;
1642 } 1641 }
1643 1642
1644 hlist_for_each_entry(alias, &inode->i_dentry, d_alias) { 1643 hlist_for_each_entry(alias, &inode->i_dentry, d_u.d_alias) {
1645 /* 1644 /*
1646 * Don't need alias->d_lock here, because aliases with 1645 * Don't need alias->d_lock here, because aliases with
1647 * d_parent == entry->d_parent are not subject to name or 1646 * d_parent == entry->d_parent are not subject to name or
@@ -1667,7 +1666,7 @@ struct dentry *d_instantiate_unique(struct dentry *entry, struct inode *inode)
1667{ 1666{
1668 struct dentry *result; 1667 struct dentry *result;
1669 1668
1670 BUG_ON(!hlist_unhashed(&entry->d_alias)); 1669 BUG_ON(!hlist_unhashed(&entry->d_u.d_alias));
1671 1670
1672 if (inode) 1671 if (inode)
1673 spin_lock(&inode->i_lock); 1672 spin_lock(&inode->i_lock);
@@ -1698,7 +1697,7 @@ EXPORT_SYMBOL(d_instantiate_unique);
1698 */ 1697 */
1699int d_instantiate_no_diralias(struct dentry *entry, struct inode *inode) 1698int d_instantiate_no_diralias(struct dentry *entry, struct inode *inode)
1700{ 1699{
1701 BUG_ON(!hlist_unhashed(&entry->d_alias)); 1700 BUG_ON(!hlist_unhashed(&entry->d_u.d_alias));
1702 1701
1703 spin_lock(&inode->i_lock); 1702 spin_lock(&inode->i_lock);
1704 if (S_ISDIR(inode->i_mode) && !hlist_empty(&inode->i_dentry)) { 1703 if (S_ISDIR(inode->i_mode) && !hlist_empty(&inode->i_dentry)) {
@@ -1737,7 +1736,7 @@ static struct dentry * __d_find_any_alias(struct inode *inode)
1737 1736
1738 if (hlist_empty(&inode->i_dentry)) 1737 if (hlist_empty(&inode->i_dentry))
1739 return NULL; 1738 return NULL;
1740 alias = hlist_entry(inode->i_dentry.first, struct dentry, d_alias); 1739 alias = hlist_entry(inode->i_dentry.first, struct dentry, d_u.d_alias);
1741 __dget(alias); 1740 __dget(alias);
1742 return alias; 1741 return alias;
1743} 1742}
@@ -1799,7 +1798,7 @@ static struct dentry *__d_obtain_alias(struct inode *inode, int disconnected)
1799 spin_lock(&tmp->d_lock); 1798 spin_lock(&tmp->d_lock);
1800 tmp->d_inode = inode; 1799 tmp->d_inode = inode;
1801 tmp->d_flags |= add_flags; 1800 tmp->d_flags |= add_flags;
1802 hlist_add_head(&tmp->d_alias, &inode->i_dentry); 1801 hlist_add_head(&tmp->d_u.d_alias, &inode->i_dentry);
1803 hlist_bl_lock(&tmp->d_sb->s_anon); 1802 hlist_bl_lock(&tmp->d_sb->s_anon);
1804 hlist_bl_add_head(&tmp->d_hash, &tmp->d_sb->s_anon); 1803 hlist_bl_add_head(&tmp->d_hash, &tmp->d_sb->s_anon);
1805 hlist_bl_unlock(&tmp->d_sb->s_anon); 1804 hlist_bl_unlock(&tmp->d_sb->s_anon);
@@ -2234,7 +2233,7 @@ int d_validate(struct dentry *dentry, struct dentry *dparent)
2234 struct dentry *child; 2233 struct dentry *child;
2235 2234
2236 spin_lock(&dparent->d_lock); 2235 spin_lock(&dparent->d_lock);
2237 list_for_each_entry(child, &dparent->d_subdirs, d_u.d_child) { 2236 list_for_each_entry(child, &dparent->d_subdirs, d_child) {
2238 if (dentry == child) { 2237 if (dentry == child) {
2239 spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED); 2238 spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED);
2240 __dget_dlock(dentry); 2239 __dget_dlock(dentry);
@@ -2525,13 +2524,13 @@ static void __d_move(struct dentry *dentry, struct dentry *target,
2525 /* splicing a tree */ 2524 /* splicing a tree */
2526 dentry->d_parent = target->d_parent; 2525 dentry->d_parent = target->d_parent;
2527 target->d_parent = target; 2526 target->d_parent = target;
2528 list_del_init(&target->d_u.d_child); 2527 list_del_init(&target->d_child);
2529 list_move(&dentry->d_u.d_child, &dentry->d_parent->d_subdirs); 2528 list_move(&dentry->d_child, &dentry->d_parent->d_subdirs);
2530 } else { 2529 } else {
2531 /* swapping two dentries */ 2530 /* swapping two dentries */
2532 swap(dentry->d_parent, target->d_parent); 2531 swap(dentry->d_parent, target->d_parent);
2533 list_move(&target->d_u.d_child, &target->d_parent->d_subdirs); 2532 list_move(&target->d_child, &target->d_parent->d_subdirs);
2534 list_move(&dentry->d_u.d_child, &dentry->d_parent->d_subdirs); 2533 list_move(&dentry->d_child, &dentry->d_parent->d_subdirs);
2535 if (exchange) 2534 if (exchange)
2536 fsnotify_d_move(target); 2535 fsnotify_d_move(target);
2537 fsnotify_d_move(dentry); 2536 fsnotify_d_move(dentry);
@@ -3320,7 +3319,7 @@ void d_tmpfile(struct dentry *dentry, struct inode *inode)
3320{ 3319{
3321 inode_dec_link_count(inode); 3320 inode_dec_link_count(inode);
3322 BUG_ON(dentry->d_name.name != dentry->d_iname || 3321 BUG_ON(dentry->d_name.name != dentry->d_iname ||
3323 !hlist_unhashed(&dentry->d_alias) || 3322 !hlist_unhashed(&dentry->d_u.d_alias) ||
3324 !d_unlinked(dentry)); 3323 !d_unlinked(dentry));
3325 spin_lock(&dentry->d_parent->d_lock); 3324 spin_lock(&dentry->d_parent->d_lock);
3326 spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED); 3325 spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED);
diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c
index 1e3b99d3db0d..05f2960ed7c3 100644
--- a/fs/debugfs/inode.c
+++ b/fs/debugfs/inode.c
@@ -553,7 +553,7 @@ void debugfs_remove_recursive(struct dentry *dentry)
553 * use the d_u.d_child as the rcu head and corrupt this list. 553 * use the d_u.d_child as the rcu head and corrupt this list.
554 */ 554 */
555 spin_lock(&parent->d_lock); 555 spin_lock(&parent->d_lock);
556 list_for_each_entry(child, &parent->d_subdirs, d_u.d_child) { 556 list_for_each_entry(child, &parent->d_subdirs, d_child) {
557 if (!debugfs_positive(child)) 557 if (!debugfs_positive(child))
558 continue; 558 continue;
559 559
diff --git a/fs/exportfs/expfs.c b/fs/exportfs/expfs.c
index a2b350ddd402..fdfd206c737a 100644
--- a/fs/exportfs/expfs.c
+++ b/fs/exportfs/expfs.c
@@ -50,7 +50,7 @@ find_acceptable_alias(struct dentry *result,
50 50
51 inode = result->d_inode; 51 inode = result->d_inode;
52 spin_lock(&inode->i_lock); 52 spin_lock(&inode->i_lock);
53 hlist_for_each_entry(dentry, &inode->i_dentry, d_alias) { 53 hlist_for_each_entry(dentry, &inode->i_dentry, d_u.d_alias) {
54 dget(dentry); 54 dget(dentry);
55 spin_unlock(&inode->i_lock); 55 spin_unlock(&inode->i_lock);
56 if (toput) 56 if (toput)
diff --git a/fs/libfs.c b/fs/libfs.c
index 171d2846f2a3..005843ce5dbd 100644
--- a/fs/libfs.c
+++ b/fs/libfs.c
@@ -114,18 +114,18 @@ loff_t dcache_dir_lseek(struct file *file, loff_t offset, int whence)
114 114
115 spin_lock(&dentry->d_lock); 115 spin_lock(&dentry->d_lock);
116 /* d_lock not required for cursor */ 116 /* d_lock not required for cursor */
117 list_del(&cursor->d_u.d_child); 117 list_del(&cursor->d_child);
118 p = dentry->d_subdirs.next; 118 p = dentry->d_subdirs.next;
119 while (n && p != &dentry->d_subdirs) { 119 while (n && p != &dentry->d_subdirs) {
120 struct dentry *next; 120 struct dentry *next;
121 next = list_entry(p, struct dentry, d_u.d_child); 121 next = list_entry(p, struct dentry, d_child);
122 spin_lock_nested(&next->d_lock, DENTRY_D_LOCK_NESTED); 122 spin_lock_nested(&next->d_lock, DENTRY_D_LOCK_NESTED);
123 if (simple_positive(next)) 123 if (simple_positive(next))
124 n--; 124 n--;
125 spin_unlock(&next->d_lock); 125 spin_unlock(&next->d_lock);
126 p = p->next; 126 p = p->next;
127 } 127 }
128 list_add_tail(&cursor->d_u.d_child, p); 128 list_add_tail(&cursor->d_child, p);
129 spin_unlock(&dentry->d_lock); 129 spin_unlock(&dentry->d_lock);
130 } 130 }
131 } 131 }
@@ -150,7 +150,7 @@ int dcache_readdir(struct file *file, struct dir_context *ctx)
150{ 150{
151 struct dentry *dentry = file->f_path.dentry; 151 struct dentry *dentry = file->f_path.dentry;
152 struct dentry *cursor = file->private_data; 152 struct dentry *cursor = file->private_data;
153 struct list_head *p, *q = &cursor->d_u.d_child; 153 struct list_head *p, *q = &cursor->d_child;
154 154
155 if (!dir_emit_dots(file, ctx)) 155 if (!dir_emit_dots(file, ctx))
156 return 0; 156 return 0;
@@ -159,7 +159,7 @@ int dcache_readdir(struct file *file, struct dir_context *ctx)
159 list_move(q, &dentry->d_subdirs); 159 list_move(q, &dentry->d_subdirs);
160 160
161 for (p = q->next; p != &dentry->d_subdirs; p = p->next) { 161 for (p = q->next; p != &dentry->d_subdirs; p = p->next) {
162 struct dentry *next = list_entry(p, struct dentry, d_u.d_child); 162 struct dentry *next = list_entry(p, struct dentry, d_child);
163 spin_lock_nested(&next->d_lock, DENTRY_D_LOCK_NESTED); 163 spin_lock_nested(&next->d_lock, DENTRY_D_LOCK_NESTED);
164 if (!simple_positive(next)) { 164 if (!simple_positive(next)) {
165 spin_unlock(&next->d_lock); 165 spin_unlock(&next->d_lock);
@@ -287,7 +287,7 @@ int simple_empty(struct dentry *dentry)
287 int ret = 0; 287 int ret = 0;
288 288
289 spin_lock(&dentry->d_lock); 289 spin_lock(&dentry->d_lock);
290 list_for_each_entry(child, &dentry->d_subdirs, d_u.d_child) { 290 list_for_each_entry(child, &dentry->d_subdirs, d_child) {
291 spin_lock_nested(&child->d_lock, DENTRY_D_LOCK_NESTED); 291 spin_lock_nested(&child->d_lock, DENTRY_D_LOCK_NESTED);
292 if (simple_positive(child)) { 292 if (simple_positive(child)) {
293 spin_unlock(&child->d_lock); 293 spin_unlock(&child->d_lock);
diff --git a/fs/ncpfs/dir.c b/fs/ncpfs/dir.c
index 461f6be5df20..865d578704c8 100644
--- a/fs/ncpfs/dir.c
+++ b/fs/ncpfs/dir.c
@@ -403,7 +403,7 @@ ncp_dget_fpos(struct dentry *dentry, struct dentry *parent, unsigned long fpos)
403 403
404 /* If a pointer is invalid, we search the dentry. */ 404 /* If a pointer is invalid, we search the dentry. */
405 spin_lock(&parent->d_lock); 405 spin_lock(&parent->d_lock);
406 list_for_each_entry(dent, &parent->d_subdirs, d_u.d_child) { 406 list_for_each_entry(dent, &parent->d_subdirs, d_child) {
407 if ((unsigned long)dent->d_fsdata == fpos) { 407 if ((unsigned long)dent->d_fsdata == fpos) {
408 if (dent->d_inode) 408 if (dent->d_inode)
409 dget(dent); 409 dget(dent);
diff --git a/fs/ncpfs/ncplib_kernel.h b/fs/ncpfs/ncplib_kernel.h
index 52cb19d66ecb..b785f74bfe3c 100644
--- a/fs/ncpfs/ncplib_kernel.h
+++ b/fs/ncpfs/ncplib_kernel.h
@@ -191,7 +191,7 @@ ncp_renew_dentries(struct dentry *parent)
191 struct dentry *dentry; 191 struct dentry *dentry;
192 192
193 spin_lock(&parent->d_lock); 193 spin_lock(&parent->d_lock);
194 list_for_each_entry(dentry, &parent->d_subdirs, d_u.d_child) { 194 list_for_each_entry(dentry, &parent->d_subdirs, d_child) {
195 if (dentry->d_fsdata == NULL) 195 if (dentry->d_fsdata == NULL)
196 ncp_age_dentry(server, dentry); 196 ncp_age_dentry(server, dentry);
197 else 197 else
@@ -207,7 +207,7 @@ ncp_invalidate_dircache_entries(struct dentry *parent)
207 struct dentry *dentry; 207 struct dentry *dentry;
208 208
209 spin_lock(&parent->d_lock); 209 spin_lock(&parent->d_lock);
210 list_for_each_entry(dentry, &parent->d_subdirs, d_u.d_child) { 210 list_for_each_entry(dentry, &parent->d_subdirs, d_child) {
211 dentry->d_fsdata = NULL; 211 dentry->d_fsdata = NULL;
212 ncp_age_dentry(server, dentry); 212 ncp_age_dentry(server, dentry);
213 } 213 }
diff --git a/fs/nfs/getroot.c b/fs/nfs/getroot.c
index 880618a8b048..ebc6a0add5ae 100644
--- a/fs/nfs/getroot.c
+++ b/fs/nfs/getroot.c
@@ -58,7 +58,7 @@ static int nfs_superblock_set_dummy_root(struct super_block *sb, struct inode *i
58 */ 58 */
59 spin_lock(&sb->s_root->d_inode->i_lock); 59 spin_lock(&sb->s_root->d_inode->i_lock);
60 spin_lock(&sb->s_root->d_lock); 60 spin_lock(&sb->s_root->d_lock);
61 hlist_del_init(&sb->s_root->d_alias); 61 hlist_del_init(&sb->s_root->d_u.d_alias);
62 spin_unlock(&sb->s_root->d_lock); 62 spin_unlock(&sb->s_root->d_lock);
63 spin_unlock(&sb->s_root->d_inode->i_lock); 63 spin_unlock(&sb->s_root->d_inode->i_lock);
64 } 64 }
diff --git a/fs/notify/fsnotify.c b/fs/notify/fsnotify.c
index 9d3e9c50066a..700129940c6e 100644
--- a/fs/notify/fsnotify.c
+++ b/fs/notify/fsnotify.c
@@ -63,14 +63,14 @@ void __fsnotify_update_child_dentry_flags(struct inode *inode)
63 spin_lock(&inode->i_lock); 63 spin_lock(&inode->i_lock);
64 /* run all of the dentries associated with this inode. Since this is a 64 /* run all of the dentries associated with this inode. Since this is a
65 * directory, there damn well better only be one item on this list */ 65 * directory, there damn well better only be one item on this list */
66 hlist_for_each_entry(alias, &inode->i_dentry, d_alias) { 66 hlist_for_each_entry(alias, &inode->i_dentry, d_u.d_alias) {
67 struct dentry *child; 67 struct dentry *child;
68 68
69 /* run all of the children of the original inode and fix their 69 /* run all of the children of the original inode and fix their
70 * d_flags to indicate parental interest (their parent is the 70 * d_flags to indicate parental interest (their parent is the
71 * original inode) */ 71 * original inode) */
72 spin_lock(&alias->d_lock); 72 spin_lock(&alias->d_lock);
73 list_for_each_entry(child, &alias->d_subdirs, d_u.d_child) { 73 list_for_each_entry(child, &alias->d_subdirs, d_child) {
74 if (!child->d_inode) 74 if (!child->d_inode)
75 continue; 75 continue;
76 76
diff --git a/fs/ocfs2/dcache.c b/fs/ocfs2/dcache.c
index e2e05a106beb..92edcfc23c1c 100644
--- a/fs/ocfs2/dcache.c
+++ b/fs/ocfs2/dcache.c
@@ -172,7 +172,7 @@ struct dentry *ocfs2_find_local_alias(struct inode *inode,
172 struct dentry *dentry; 172 struct dentry *dentry;
173 173
174 spin_lock(&inode->i_lock); 174 spin_lock(&inode->i_lock);
175 hlist_for_each_entry(dentry, &inode->i_dentry, d_alias) { 175 hlist_for_each_entry(dentry, &inode->i_dentry, d_u.d_alias) {
176 spin_lock(&dentry->d_lock); 176 spin_lock(&dentry->d_lock);
177 if (ocfs2_match_dentry(dentry, parent_blkno, skip_unhashed)) { 177 if (ocfs2_match_dentry(dentry, parent_blkno, skip_unhashed)) {
178 trace_ocfs2_find_local_alias(dentry->d_name.len, 178 trace_ocfs2_find_local_alias(dentry->d_name.len,
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index b2a2a08523bf..1c2f1b84468b 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -124,15 +124,15 @@ struct dentry {
124 void *d_fsdata; /* fs-specific data */ 124 void *d_fsdata; /* fs-specific data */
125 125
126 struct list_head d_lru; /* LRU list */ 126 struct list_head d_lru; /* LRU list */
127 struct list_head d_child; /* child of parent list */
128 struct list_head d_subdirs; /* our children */
127 /* 129 /*
128 * d_child and d_rcu can share memory 130 * d_alias and d_rcu can share memory
129 */ 131 */
130 union { 132 union {
131 struct list_head d_child; /* child of parent list */ 133 struct hlist_node d_alias; /* inode alias list */
132 struct rcu_head d_rcu; 134 struct rcu_head d_rcu;
133 } d_u; 135 } d_u;
134 struct list_head d_subdirs; /* our children */
135 struct hlist_node d_alias; /* inode alias list */
136}; 136};
137 137
138/* 138/*
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 8a528392b1f4..459a7b1251e5 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -6420,7 +6420,7 @@ static int instance_mkdir (struct inode *inode, struct dentry *dentry, umode_t m
6420 int ret; 6420 int ret;
6421 6421
6422 /* Paranoid: Make sure the parent is the "instances" directory */ 6422 /* Paranoid: Make sure the parent is the "instances" directory */
6423 parent = hlist_entry(inode->i_dentry.first, struct dentry, d_alias); 6423 parent = hlist_entry(inode->i_dentry.first, struct dentry, d_u.d_alias);
6424 if (WARN_ON_ONCE(parent != trace_instance_dir)) 6424 if (WARN_ON_ONCE(parent != trace_instance_dir))
6425 return -ENOENT; 6425 return -ENOENT;
6426 6426
@@ -6447,7 +6447,7 @@ static int instance_rmdir(struct inode *inode, struct dentry *dentry)
6447 int ret; 6447 int ret;
6448 6448
6449 /* Paranoid: Make sure the parent is the "instances" directory */ 6449 /* Paranoid: Make sure the parent is the "instances" directory */
6450 parent = hlist_entry(inode->i_dentry.first, struct dentry, d_alias); 6450 parent = hlist_entry(inode->i_dentry.first, struct dentry, d_u.d_alias);
6451 if (WARN_ON_ONCE(parent != trace_instance_dir)) 6451 if (WARN_ON_ONCE(parent != trace_instance_dir))
6452 return -ENOENT; 6452 return -ENOENT;
6453 6453
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
index 0cc51edde3a8..1b0df1e504f0 100644
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
@@ -461,7 +461,7 @@ static void remove_event_file_dir(struct ftrace_event_file *file)
461 461
462 if (dir) { 462 if (dir) {
463 spin_lock(&dir->d_lock); /* probably unneeded */ 463 spin_lock(&dir->d_lock); /* probably unneeded */
464 list_for_each_entry(child, &dir->d_subdirs, d_u.d_child) { 464 list_for_each_entry(child, &dir->d_subdirs, d_child) {
465 if (child->d_inode) /* probably unneeded */ 465 if (child->d_inode) /* probably unneeded */
466 child->d_inode->i_private = NULL; 466 child->d_inode->i_private = NULL;
467 } 467 }
diff --git a/security/selinux/selinuxfs.c b/security/selinux/selinuxfs.c
index c71737f6d1cc..33db1ad4fd10 100644
--- a/security/selinux/selinuxfs.c
+++ b/security/selinux/selinuxfs.c
@@ -1200,7 +1200,7 @@ static void sel_remove_entries(struct dentry *de)
1200 spin_lock(&de->d_lock); 1200 spin_lock(&de->d_lock);
1201 node = de->d_subdirs.next; 1201 node = de->d_subdirs.next;
1202 while (node != &de->d_subdirs) { 1202 while (node != &de->d_subdirs) {
1203 struct dentry *d = list_entry(node, struct dentry, d_u.d_child); 1203 struct dentry *d = list_entry(node, struct dentry, d_child);
1204 1204
1205 spin_lock_nested(&d->d_lock, DENTRY_D_LOCK_NESTED); 1205 spin_lock_nested(&d->d_lock, DENTRY_D_LOCK_NESTED);
1206 list_del_init(node); 1206 list_del_init(node);
@@ -1674,12 +1674,12 @@ static void sel_remove_classes(void)
1674 1674
1675 list_for_each(class_node, &class_dir->d_subdirs) { 1675 list_for_each(class_node, &class_dir->d_subdirs) {
1676 struct dentry *class_subdir = list_entry(class_node, 1676 struct dentry *class_subdir = list_entry(class_node,
1677 struct dentry, d_u.d_child); 1677 struct dentry, d_child);
1678 struct list_head *class_subdir_node; 1678 struct list_head *class_subdir_node;
1679 1679
1680 list_for_each(class_subdir_node, &class_subdir->d_subdirs) { 1680 list_for_each(class_subdir_node, &class_subdir->d_subdirs) {
1681 struct dentry *d = list_entry(class_subdir_node, 1681 struct dentry *d = list_entry(class_subdir_node,
1682 struct dentry, d_u.d_child); 1682 struct dentry, d_child);
1683 1683
1684 if (d->d_inode) 1684 if (d->d_inode)
1685 if (d->d_inode->i_mode & S_IFDIR) 1685 if (d->d_inode->i_mode & S_IFDIR)