]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
move d_rcu from overlapping d_child to overlapping d_alias
authorAl Viro <viro@zeniv.linux.org.uk>
Sun, 26 Oct 2014 23:19:16 +0000 (19:19 -0400)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 1 Jan 2015 01:27:50 +0000 (01:27 +0000)
commit 946e51f2bf37f1656916eb75bd0742ba33983c28 upstream.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
[bwh: Backported to 3.2:
 - Apply name changes in all the different places we use d_alias and d_child
 - Move the WARN_ON() in __d_free() to d_free() as we don't have dentry_free()]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
23 files changed:
arch/powerpc/platforms/cell/spufs/inode.c
drivers/usb/core/inode.c
fs/9p/vfs_inode_dotl.c
fs/affs/amigaffs.c
fs/autofs4/expire.c
fs/autofs4/root.c
fs/ceph/dir.c
fs/ceph/inode.c
fs/cifs/inode.c
fs/coda/cache.c
fs/dcache.c
fs/debugfs/inode.c
fs/exportfs/expfs.c
fs/ext4/fsync.c
fs/libfs.c
fs/ncpfs/dir.c
fs/ncpfs/ncplib_kernel.h
fs/nfs/getroot.c
fs/notify/fsnotify.c
fs/ocfs2/dcache.c
include/linux/dcache.h
kernel/cgroup.c
security/selinux/selinuxfs.c

index 70ec4e992f54bcda2eec7b268b0328ab89a48cb4..941d5cbd8357cfc41b27e81b8146e1d9f946c3ef 100644 (file)
@@ -165,7 +165,7 @@ static void spufs_prune_dir(struct dentry *dir)
        struct dentry *dentry, *tmp;
 
        mutex_lock(&dir->d_inode->i_mutex);
-       list_for_each_entry_safe(dentry, tmp, &dir->d_subdirs, d_u.d_child) {
+       list_for_each_entry_safe(dentry, tmp, &dir->d_subdirs, d_child) {
                spin_lock(&dentry->d_lock);
                if (!(d_unhashed(dentry)) && dentry->d_inode) {
                        dget_dlock(dentry);
@@ -223,7 +223,7 @@ out:
         * - free child's inode if possible
         * - free child
         */
-       list_for_each_entry_safe(dentry, tmp, &dir->d_subdirs, d_u.d_child) {
+       list_for_each_entry_safe(dentry, tmp, &dir->d_subdirs, d_child) {
                dput(dentry);
        }
 
index 2278dad886e2e8b028b2809eb39ccba8c09dff46..5babd94c9fbc916a0c2910fbef5841efaaf59d16 100644 (file)
@@ -212,7 +212,7 @@ static void update_bus(struct dentry *bus)
 
        mutex_lock(&bus->d_inode->i_mutex);
 
-       list_for_each_entry(dev, &bus->d_subdirs, d_u.d_child)
+       list_for_each_entry(dev, &bus->d_subdirs, d_child)
                if (dev->d_inode)
                        update_dev(dev);
 
@@ -229,7 +229,7 @@ static void update_sb(struct super_block *sb)
 
        mutex_lock_nested(&root->d_inode->i_mutex, I_MUTEX_PARENT);
 
-       list_for_each_entry(bus, &root->d_subdirs, d_u.d_child) {
+       list_for_each_entry(bus, &root->d_subdirs, d_child) {
                if (bus->d_inode) {
                        switch (S_IFMT & bus->d_inode->i_mode) {
                        case S_IFDIR:
@@ -345,7 +345,7 @@ static int usbfs_empty (struct dentry *dentry)
 
        spin_lock(&dentry->d_lock);
        list_for_each(list, &dentry->d_subdirs) {
-               struct dentry *de = list_entry(list, struct dentry, d_u.d_child);
+               struct dentry *de = list_entry(list, struct dentry, d_child);
 
                spin_lock_nested(&de->d_lock, DENTRY_D_LOCK_NESTED);
                if (usbfs_positive(de)) {
index 0b5745e219460fcda4d686349e3ba5ce69122318..30d4fa826e7c227c30d28d852b14ede26531b16f 100644 (file)
@@ -81,7 +81,7 @@ static struct dentry *v9fs_dentry_from_dir_inode(struct inode *inode)
        spin_lock(&inode->i_lock);
        /* Directory should have only one entry. */
        BUG_ON(S_ISDIR(inode->i_mode) && !list_is_singular(&inode->i_dentry));
-       dentry = list_entry(inode->i_dentry.next, struct dentry, d_alias);
+       dentry = list_entry(inode->i_dentry.next, struct dentry, d_u.d_alias);
        spin_unlock(&inode->i_lock);
        return dentry;
 }
index de37ec842340c3943de5c7351a1e70cc7c5e4268..43c05d8fd82cba3b0cc5c65b320213532d84c6a8 100644 (file)
@@ -132,7 +132,7 @@ affs_fix_dcache(struct dentry *dentry, u32 entry_ino)
        head = &inode->i_dentry;
        next = head->next;
        while (next != head) {
-               dentry = list_entry(next, struct dentry, d_alias);
+               dentry = list_entry(next, struct dentry, d_u.d_alias);
                if (entry_ino == (u32)(long)dentry->d_fsdata) {
                        dentry->d_fsdata = data;
                        break;
index 2c69d1257314fd2811b0cf9921f0c4e1395bfb25..7fc03715d5a8098407d3a0c4c9dc246032457a72 100644 (file)
@@ -100,7 +100,7 @@ static struct dentry *get_next_positive_subdir(struct dentry *prev,
        p = prev;
        spin_lock(&p->d_lock);
 again:
-       next = p->d_u.d_child.next;
+       next = p->d_child.next;
 start:
        if (next == &root->d_subdirs) {
                spin_unlock(&p->d_lock);
@@ -109,7 +109,7 @@ start:
                return NULL;
        }
 
-       q = list_entry(next, struct dentry, d_u.d_child);
+       q = list_entry(next, struct dentry, d_child);
 
        spin_lock_nested(&q->d_lock, DENTRY_D_LOCK_NESTED);
        /* Negative dentry - try next */
@@ -165,13 +165,13 @@ again:
                                goto relock;
                        }
                        spin_unlock(&p->d_lock);
-                       next = p->d_u.d_child.next;
+                       next = p->d_child.next;
                        p = parent;
                        if (next != &parent->d_subdirs)
                                break;
                }
        }
-       ret = list_entry(next, struct dentry, d_u.d_child);
+       ret = list_entry(next, struct dentry, d_child);
 
        spin_lock_nested(&ret->d_lock, DENTRY_D_LOCK_NESTED);
        /* Negative dentry - try next */
@@ -455,7 +455,7 @@ found:
        spin_lock(&sbi->lookup_lock);
        spin_lock(&expired->d_parent->d_lock);
        spin_lock_nested(&expired->d_lock, DENTRY_D_LOCK_NESTED);
-       list_move(&expired->d_parent->d_subdirs, &expired->d_u.d_child);
+       list_move(&expired->d_parent->d_subdirs, &expired->d_child);
        spin_unlock(&expired->d_lock);
        spin_unlock(&expired->d_parent->d_lock);
        spin_unlock(&sbi->lookup_lock);
index 790fa63876443c0fa8be0d4637e7a378a1398e8d..2e936c6bfc7e6b0aadc1b2acf11e995e18bf22b1 100644 (file)
@@ -651,7 +651,7 @@ static void autofs_clear_leaf_automount_flags(struct dentry *dentry)
        /* only consider parents below dentrys in the root */
        if (IS_ROOT(parent->d_parent))
                return;
-       d_child = &dentry->d_u.d_child;
+       d_child = &dentry->d_child;
        /* Set parent managed if it's becoming empty */
        if (d_child->next == &parent->d_subdirs &&
            d_child->prev == &parent->d_subdirs)
index 98954003a8d313007386d4cfc214c5dba9296647..7903e62473cfd0cac317dd507124d6064bb88793 100644 (file)
@@ -104,7 +104,7 @@ static unsigned fpos_off(loff_t p)
 /*
  * When possible, we try to satisfy a readdir by peeking at the
  * dcache.  We make this work by carefully ordering dentries on
- * d_u.d_child when we initially get results back from the MDS, and
+ * d_child when we initially get results back from the MDS, and
  * falling back to a "normal" sync readdir if any dentries in the dir
  * are dropped.
  *
@@ -140,11 +140,11 @@ static int __dcache_readdir(struct file *filp,
                p = parent->d_subdirs.prev;
                dout(" initial p %p/%p\n", p->prev, p->next);
        } else {
-               p = last->d_u.d_child.prev;
+               p = last->d_child.prev;
        }
 
 more:
-       dentry = list_entry(p, struct dentry, d_u.d_child);
+       dentry = list_entry(p, struct dentry, d_child);
        di = ceph_dentry(dentry);
        while (1) {
                dout(" p %p/%p %s d_subdirs %p/%p\n", p->prev, p->next,
@@ -166,7 +166,7 @@ more:
                     !dentry->d_inode ? " null" : "");
                spin_unlock(&dentry->d_lock);
                p = p->prev;
-               dentry = list_entry(p, struct dentry, d_u.d_child);
+               dentry = list_entry(p, struct dentry, d_child);
                di = ceph_dentry(dentry);
        }
 
index 87fb132fb33012a9ca7839e9cca832eb472a1087..8e889b773d2406586cb437ccc2ff32443d43326e 100644 (file)
@@ -868,9 +868,9 @@ static void ceph_set_dentry_offset(struct dentry *dn)
 
        spin_lock(&dir->d_lock);
        spin_lock_nested(&dn->d_lock, DENTRY_D_LOCK_NESTED);
-       list_move(&dn->d_u.d_child, &dir->d_subdirs);
+       list_move(&dn->d_child, &dir->d_subdirs);
        dout("set_dentry_offset %p %lld (%p %p)\n", dn, di->offset,
-            dn->d_u.d_child.prev, dn->d_u.d_child.next);
+            dn->d_child.prev, dn->d_child.next);
        spin_unlock(&dn->d_lock);
        spin_unlock(&dir->d_lock);
 }
@@ -1256,7 +1256,7 @@ retry_lookup:
                        /* reorder parent's d_subdirs */
                        spin_lock(&parent->d_lock);
                        spin_lock_nested(&dn->d_lock, DENTRY_D_LOCK_NESTED);
-                       list_move(&dn->d_u.d_child, &parent->d_subdirs);
+                       list_move(&dn->d_child, &parent->d_subdirs);
                        spin_unlock(&dn->d_lock);
                        spin_unlock(&parent->d_lock);
                }
index c0c51e11db7e219d8a9d545dfe9b3e3b2f390b20..710dd05ccd9c447599ad215409c14f82de6176e4 100644 (file)
@@ -823,7 +823,7 @@ inode_has_hashed_dentries(struct inode *inode)
        struct dentry *dentry;
 
        spin_lock(&inode->i_lock);
-       list_for_each_entry(dentry, &inode->i_dentry, d_alias) {
+       list_for_each_entry(dentry, &inode->i_dentry, d_u.d_alias) {
                if (!d_unhashed(dentry) || IS_ROOT(dentry)) {
                        spin_unlock(&inode->i_lock);
                        return true;
index 6901578761841ae6c0ed950c26de2cf64c9d1389..4b2e5cb502f690ac0fd8dfc9f1e0fa0ac378d4f8 100644 (file)
@@ -95,7 +95,7 @@ static void coda_flag_children(struct dentry *parent, int flag)
        spin_lock(&parent->d_lock);
        list_for_each(child, &parent->d_subdirs)
        {
-               de = list_entry(child, struct dentry, d_u.d_child);
+               de = list_entry(child, struct dentry, d_child);
                /* don't know what to do with negative dentries */
                if ( ! de->d_inode ) 
                        continue;
index d3229296a0bc34260a9faf53eee78a58caffd757..226a93a3f7bdd6a831ec853b30b7930a104a890e 100644 (file)
@@ -42,7 +42,7 @@
 /*
  * Usage:
  * dcache->d_inode->i_lock protects:
- *   - i_dentry, d_alias, d_inode of aliases
+ *   - i_dentry, d_u.d_alias, d_inode of aliases
  * dcache_hash_bucket lock protects:
  *   - the dcache hash table
  * s_anon bl list spinlock protects:
@@ -57,7 +57,7 @@
  *   - d_unhashed()
  *   - d_parent and d_subdirs
  *   - childrens' d_child and d_parent
- *   - d_alias, d_inode
+ *   - d_u.d_alias, d_inode
  *
  * Ordering:
  * dentry->d_inode->i_lock
@@ -140,7 +140,6 @@ static void __d_free(struct rcu_head *head)
 {
        struct dentry *dentry = container_of(head, struct dentry, d_u.d_rcu);
 
-       WARN_ON(!list_empty(&dentry->d_alias));
        if (dname_external(dentry))
                kfree(dentry->d_name.name);
        kmem_cache_free(dentry_cache, dentry); 
@@ -151,6 +150,7 @@ static void __d_free(struct rcu_head *head)
  */
 static void d_free(struct dentry *dentry)
 {
+       WARN_ON(!list_empty(&dentry->d_u.d_alias));
        BUG_ON(dentry->d_count);
        this_cpu_dec(nr_dentry);
        if (dentry->d_op && dentry->d_op->d_release)
@@ -189,7 +189,7 @@ static void dentry_iput(struct dentry * dentry)
        struct inode *inode = dentry->d_inode;
        if (inode) {
                dentry->d_inode = NULL;
-               list_del_init(&dentry->d_alias);
+               list_del_init(&dentry->d_u.d_alias);
                spin_unlock(&dentry->d_lock);
                spin_unlock(&inode->i_lock);
                if (!inode->i_nlink)
@@ -213,7 +213,7 @@ static void dentry_unlink_inode(struct dentry * dentry)
 {
        struct inode *inode = dentry->d_inode;
        dentry->d_inode = NULL;
-       list_del_init(&dentry->d_alias);
+       list_del_init(&dentry->d_u.d_alias);
        dentry_rcuwalk_barrier(dentry);
        spin_unlock(&dentry->d_lock);
        spin_unlock(&inode->i_lock);
@@ -306,7 +306,7 @@ static struct dentry *d_kill(struct dentry *dentry, struct dentry *parent)
        __releases(parent->d_lock)
        __releases(dentry->d_inode->i_lock)
 {
-       list_del(&dentry->d_u.d_child);
+       list_del(&dentry->d_child);
        /*
         * Inform try_to_ascend() that we are no longer attached to the
         * dentry tree
@@ -624,7 +624,7 @@ static struct dentry *__d_find_alias(struct inode *inode, int want_discon)
 
 again:
        discon_alias = NULL;
-       list_for_each_entry(alias, &inode->i_dentry, d_alias) {
+       list_for_each_entry(alias, &inode->i_dentry, d_u.d_alias) {
                spin_lock(&alias->d_lock);
                if (S_ISDIR(inode->i_mode) || !d_unhashed(alias)) {
                        if (IS_ROOT(alias) &&
@@ -677,7 +677,7 @@ void d_prune_aliases(struct inode *inode)
        struct dentry *dentry;
 restart:
        spin_lock(&inode->i_lock);
-       list_for_each_entry(dentry, &inode->i_dentry, d_alias) {
+       list_for_each_entry(dentry, &inode->i_dentry, d_u.d_alias) {
                spin_lock(&dentry->d_lock);
                if (!dentry->d_count) {
                        __dget_dlock(dentry);
@@ -857,7 +857,7 @@ static void shrink_dcache_for_umount_subtree(struct dentry *dentry)
                /* descend to the first leaf in the current subtree */
                while (!list_empty(&dentry->d_subdirs))
                        dentry = list_entry(dentry->d_subdirs.next,
-                                           struct dentry, d_u.d_child);
+                                           struct dentry, d_child);
 
                /* consume the dentries from this leaf up through its parents
                 * until we find one with children or run out altogether */
@@ -889,17 +889,17 @@ static void shrink_dcache_for_umount_subtree(struct dentry *dentry)
 
                        if (IS_ROOT(dentry)) {
                                parent = NULL;
-                               list_del(&dentry->d_u.d_child);
+                               list_del(&dentry->d_child);
                        } else {
                                parent = dentry->d_parent;
                                parent->d_count--;
-                               list_del(&dentry->d_u.d_child);
+                               list_del(&dentry->d_child);
                        }
 
                        inode = dentry->d_inode;
                        if (inode) {
                                dentry->d_inode = NULL;
-                               list_del_init(&dentry->d_alias);
+                               list_del_init(&dentry->d_u.d_alias);
                                if (dentry->d_op && dentry->d_op->d_iput)
                                        dentry->d_op->d_iput(dentry, inode);
                                else
@@ -917,7 +917,7 @@ static void shrink_dcache_for_umount_subtree(struct dentry *dentry)
                } while (list_empty(&dentry->d_subdirs));
 
                dentry = list_entry(dentry->d_subdirs.next,
-                                   struct dentry, d_u.d_child);
+                                   struct dentry, d_child);
        }
 }
 
@@ -1010,7 +1010,7 @@ repeat:
 resume:
        while (next != &this_parent->d_subdirs) {
                struct list_head *tmp = next;
-               struct dentry *dentry = list_entry(tmp, struct dentry, d_u.d_child);
+               struct dentry *dentry = list_entry(tmp, struct dentry, d_child);
                next = tmp->next;
 
                spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED);
@@ -1037,7 +1037,7 @@ resume:
                this_parent = try_to_ascend(this_parent, locked, seq);
                if (!this_parent)
                        goto rename_retry;
-               next = child->d_u.d_child.next;
+               next = child->d_child.next;
                goto resume;
        }
        spin_unlock(&this_parent->d_lock);
@@ -1093,7 +1093,7 @@ repeat:
 resume:
        while (next != &this_parent->d_subdirs) {
                struct list_head *tmp = next;
-               struct dentry *dentry = list_entry(tmp, struct dentry, d_u.d_child);
+               struct dentry *dentry = list_entry(tmp, struct dentry, d_child);
                next = tmp->next;
 
                spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED);
@@ -1144,7 +1144,7 @@ resume:
                this_parent = try_to_ascend(this_parent, locked, seq);
                if (!this_parent)
                        goto rename_retry;
-               next = child->d_u.d_child.next;
+               next = child->d_child.next;
                goto resume;
        }
 out:
@@ -1230,8 +1230,8 @@ struct dentry *__d_alloc(struct super_block *sb, const struct qstr *name)
        INIT_HLIST_BL_NODE(&dentry->d_hash);
        INIT_LIST_HEAD(&dentry->d_lru);
        INIT_LIST_HEAD(&dentry->d_subdirs);
-       INIT_LIST_HEAD(&dentry->d_alias);
-       INIT_LIST_HEAD(&dentry->d_u.d_child);
+       INIT_LIST_HEAD(&dentry->d_u.d_alias);
+       INIT_LIST_HEAD(&dentry->d_child);
        d_set_d_op(dentry, dentry->d_sb->s_d_op);
 
        this_cpu_inc(nr_dentry);
@@ -1261,7 +1261,7 @@ struct dentry *d_alloc(struct dentry * parent, const struct qstr *name)
         */
        __dget_dlock(parent);
        dentry->d_parent = parent;
-       list_add(&dentry->d_u.d_child, &parent->d_subdirs);
+       list_add(&dentry->d_child, &parent->d_subdirs);
        spin_unlock(&parent->d_lock);
 
        return dentry;
@@ -1318,7 +1318,7 @@ static void __d_instantiate(struct dentry *dentry, struct inode *inode)
        if (inode) {
                if (unlikely(IS_AUTOMOUNT(inode)))
                        dentry->d_flags |= DCACHE_NEED_AUTOMOUNT;
-               list_add(&dentry->d_alias, &inode->i_dentry);
+               list_add(&dentry->d_u.d_alias, &inode->i_dentry);
        }
        dentry->d_inode = inode;
        dentry_rcuwalk_barrier(dentry);
@@ -1343,7 +1343,7 @@ static void __d_instantiate(struct dentry *dentry, struct inode *inode)
  
 void d_instantiate(struct dentry *entry, struct inode * inode)
 {
-       BUG_ON(!list_empty(&entry->d_alias));
+       BUG_ON(!list_empty(&entry->d_u.d_alias));
        if (inode)
                spin_lock(&inode->i_lock);
        __d_instantiate(entry, inode);
@@ -1382,7 +1382,7 @@ static struct dentry *__d_instantiate_unique(struct dentry *entry,
                return NULL;
        }
 
-       list_for_each_entry(alias, &inode->i_dentry, d_alias) {
+       list_for_each_entry(alias, &inode->i_dentry, d_u.d_alias) {
                struct qstr *qstr = &alias->d_name;
 
                /*
@@ -1408,7 +1408,7 @@ struct dentry *d_instantiate_unique(struct dentry *entry, struct inode *inode)
 {
        struct dentry *result;
 
-       BUG_ON(!list_empty(&entry->d_alias));
+       BUG_ON(!list_empty(&entry->d_u.d_alias));
 
        if (inode)
                spin_lock(&inode->i_lock);
@@ -1458,7 +1458,7 @@ static struct dentry * __d_find_any_alias(struct inode *inode)
 
        if (list_empty(&inode->i_dentry))
                return NULL;
-       alias = list_first_entry(&inode->i_dentry, struct dentry, d_alias);
+       alias = list_first_entry(&inode->i_dentry, struct dentry, d_u.d_alias);
        __dget(alias);
        return alias;
 }
@@ -1525,7 +1525,7 @@ struct dentry *d_obtain_alias(struct inode *inode)
        spin_lock(&tmp->d_lock);
        tmp->d_inode = inode;
        tmp->d_flags |= DCACHE_DISCONNECTED;
-       list_add(&tmp->d_alias, &inode->i_dentry);
+       list_add(&tmp->d_u.d_alias, &inode->i_dentry);
        hlist_bl_lock(&tmp->d_sb->s_anon);
        hlist_bl_add_head(&tmp->d_hash, &tmp->d_sb->s_anon);
        hlist_bl_unlock(&tmp->d_sb->s_anon);
@@ -1931,7 +1931,7 @@ int d_validate(struct dentry *dentry, struct dentry *dparent)
        struct dentry *child;
 
        spin_lock(&dparent->d_lock);
-       list_for_each_entry(child, &dparent->d_subdirs, d_u.d_child) {
+       list_for_each_entry(child, &dparent->d_subdirs, d_child) {
                if (dentry == child) {
                        spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED);
                        __dget_dlock(dentry);
@@ -2178,8 +2178,8 @@ static void __d_move(struct dentry * dentry, struct dentry * target)
        /* Unhash the target: dput() will then get rid of it */
        __d_drop(target);
 
-       list_del(&dentry->d_u.d_child);
-       list_del(&target->d_u.d_child);
+       list_del(&dentry->d_child);
+       list_del(&target->d_child);
 
        /* Switch the names.. */
        switch_names(dentry, target);
@@ -2189,15 +2189,15 @@ static void __d_move(struct dentry * dentry, struct dentry * target)
        if (IS_ROOT(dentry)) {
                dentry->d_parent = target->d_parent;
                target->d_parent = target;
-               INIT_LIST_HEAD(&target->d_u.d_child);
+               INIT_LIST_HEAD(&target->d_child);
        } else {
                swap(dentry->d_parent, target->d_parent);
 
                /* And add them back to the (new) parent lists */
-               list_add(&target->d_u.d_child, &target->d_parent->d_subdirs);
+               list_add(&target->d_child, &target->d_parent->d_subdirs);
        }
 
-       list_add(&dentry->d_u.d_child, &dentry->d_parent->d_subdirs);
+       list_add(&dentry->d_child, &dentry->d_parent->d_subdirs);
 
        write_seqcount_end(&target->d_seq);
        write_seqcount_end(&dentry->d_seq);
@@ -2304,18 +2304,18 @@ static void __d_materialise_dentry(struct dentry *dentry, struct dentry *anon)
        swap(dentry->d_name.hash, anon->d_name.hash);
 
        dentry->d_parent = (aparent == anon) ? dentry : aparent;
-       list_del(&dentry->d_u.d_child);
+       list_del(&dentry->d_child);
        if (!IS_ROOT(dentry))
-               list_add(&dentry->d_u.d_child, &dentry->d_parent->d_subdirs);
+               list_add(&dentry->d_child, &dentry->d_parent->d_subdirs);
        else
-               INIT_LIST_HEAD(&dentry->d_u.d_child);
+               INIT_LIST_HEAD(&dentry->d_child);
 
        anon->d_parent = (dparent == dentry) ? anon : dparent;
-       list_del(&anon->d_u.d_child);
+       list_del(&anon->d_child);
        if (!IS_ROOT(anon))
-               list_add(&anon->d_u.d_child, &anon->d_parent->d_subdirs);
+               list_add(&anon->d_child, &anon->d_parent->d_subdirs);
        else
-               INIT_LIST_HEAD(&anon->d_u.d_child);
+               INIT_LIST_HEAD(&anon->d_child);
 
        write_seqcount_end(&dentry->d_seq);
        write_seqcount_end(&anon->d_seq);
@@ -2893,7 +2893,7 @@ repeat:
 resume:
        while (next != &this_parent->d_subdirs) {
                struct list_head *tmp = next;
-               struct dentry *dentry = list_entry(tmp, struct dentry, d_u.d_child);
+               struct dentry *dentry = list_entry(tmp, struct dentry, d_child);
                next = tmp->next;
 
                spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED);
@@ -2923,7 +2923,7 @@ resume:
                this_parent = try_to_ascend(this_parent, locked, seq);
                if (!this_parent)
                        goto rename_retry;
-               next = child->d_u.d_child.next;
+               next = child->d_child.next;
                goto resume;
        }
        spin_unlock(&this_parent->d_lock);
index 01951c6b6632e9b9bc3240a49d0f4df955de83c7..6ac0893ca9fe2eb68be8476ab537292f7ff59722 100644 (file)
@@ -399,7 +399,7 @@ void debugfs_remove_recursive(struct dentry *dentry)
         * use the d_u.d_child as the rcu head and corrupt this list.
         */
        spin_lock(&parent->d_lock);
-       list_for_each_entry(child, &parent->d_subdirs, d_u.d_child) {
+       list_for_each_entry(child, &parent->d_subdirs, d_child) {
                if (!debugfs_positive(child))
                        continue;
 
index b05acb7961355dfb680e49f3145a11065f6ac851..3bbf5e75df0a313452c2325b7be7e43fe54dcbcb 100644 (file)
@@ -50,7 +50,7 @@ find_acceptable_alias(struct dentry *result,
 
        inode = result->d_inode;
        spin_lock(&inode->i_lock);
-       list_for_each_entry(dentry, &inode->i_dentry, d_alias) {
+       list_for_each_entry(dentry, &inode->i_dentry, d_u.d_alias) {
                dget(dentry);
                spin_unlock(&inode->i_lock);
                if (toput)
index a8d03a4d3f8b92dd4e6c0b7c30bc8292dde9e9b4..019c29c89824307c825c2d06e59790b30702a189 100644 (file)
@@ -139,7 +139,7 @@ static int ext4_sync_parent(struct inode *inode)
                spin_lock(&inode->i_lock);
                if (!list_empty(&inode->i_dentry)) {
                        dentry = list_first_entry(&inode->i_dentry,
-                                                 struct dentry, d_alias);
+                                                 struct dentry, d_u.d_alias);
                        dget(dentry);
                }
                spin_unlock(&inode->i_lock);
index f6d411eef1e73d52c4d62c3b65432565accdff49..ce85edf8aca58beb9615e9bad789f98b0aa434fb 100644 (file)
@@ -104,18 +104,18 @@ loff_t dcache_dir_lseek(struct file *file, loff_t offset, int origin)
 
                        spin_lock(&dentry->d_lock);
                        /* d_lock not required for cursor */
-                       list_del(&cursor->d_u.d_child);
+                       list_del(&cursor->d_child);
                        p = dentry->d_subdirs.next;
                        while (n && p != &dentry->d_subdirs) {
                                struct dentry *next;
-                               next = list_entry(p, struct dentry, d_u.d_child);
+                               next = list_entry(p, struct dentry, d_child);
                                spin_lock_nested(&next->d_lock, DENTRY_D_LOCK_NESTED);
                                if (simple_positive(next))
                                        n--;
                                spin_unlock(&next->d_lock);
                                p = p->next;
                        }
-                       list_add_tail(&cursor->d_u.d_child, p);
+                       list_add_tail(&cursor->d_child, p);
                        spin_unlock(&dentry->d_lock);
                }
        }
@@ -139,7 +139,7 @@ int dcache_readdir(struct file * filp, void * dirent, filldir_t filldir)
 {
        struct dentry *dentry = filp->f_path.dentry;
        struct dentry *cursor = filp->private_data;
-       struct list_head *p, *q = &cursor->d_u.d_child;
+       struct list_head *p, *q = &cursor->d_child;
        ino_t ino;
        int i = filp->f_pos;
 
@@ -165,7 +165,7 @@ int dcache_readdir(struct file * filp, void * dirent, filldir_t filldir)
 
                        for (p=q->next; p != &dentry->d_subdirs; p=p->next) {
                                struct dentry *next;
-                               next = list_entry(p, struct dentry, d_u.d_child);
+                               next = list_entry(p, struct dentry, d_child);
                                spin_lock_nested(&next->d_lock, DENTRY_D_LOCK_NESTED);
                                if (!simple_positive(next)) {
                                        spin_unlock(&next->d_lock);
@@ -282,7 +282,7 @@ int simple_empty(struct dentry *dentry)
        int ret = 0;
 
        spin_lock(&dentry->d_lock);
-       list_for_each_entry(child, &dentry->d_subdirs, d_u.d_child) {
+       list_for_each_entry(child, &dentry->d_subdirs, d_child) {
                spin_lock_nested(&child->d_lock, DENTRY_D_LOCK_NESTED);
                if (simple_positive(child)) {
                        spin_unlock(&child->d_lock);
index 844bd64807d4fa2f108d577f47d47cd5df689674..efa38a92858c426bc5ad4d0fa5c7782ea9b59f7f 100644 (file)
@@ -391,7 +391,7 @@ ncp_dget_fpos(struct dentry *dentry, struct dentry *parent, unsigned long fpos)
        spin_lock(&parent->d_lock);
        next = parent->d_subdirs.next;
        while (next != &parent->d_subdirs) {
-               dent = list_entry(next, struct dentry, d_u.d_child);
+               dent = list_entry(next, struct dentry, d_child);
                if ((unsigned long)dent->d_fsdata == fpos) {
                        if (dent->d_inode)
                                dget(dent);
index 09881e6aa5ad9ff4b31500827094c9dfcf734ae7..64a817af666c99d3909efa9021e7b46b89212a0a 100644 (file)
@@ -194,7 +194,7 @@ ncp_renew_dentries(struct dentry *parent)
        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);
+               dentry = list_entry(next, struct dentry, d_child);
 
                if (dentry->d_fsdata == NULL)
                        ncp_age_dentry(server, dentry);
@@ -216,7 +216,7 @@ ncp_invalidate_dircache_entries(struct dentry *parent)
        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);
+               dentry = list_entry(next, struct dentry, d_child);
                dentry->d_fsdata = NULL;
                ncp_age_dentry(server, dentry);
                next = next->next;
index dcb61548887fdba13fc484c844aeb3a6b14a0fe9..d7abf9ed4d4de08ca354917e97b84a20b0ac246b 100644 (file)
@@ -65,7 +65,7 @@ static int nfs_superblock_set_dummy_root(struct super_block *sb, struct inode *i
                 */
                spin_lock(&sb->s_root->d_inode->i_lock);
                spin_lock(&sb->s_root->d_lock);
-               list_del_init(&sb->s_root->d_alias);
+               list_del_init(&sb->s_root->d_u.d_alias);
                spin_unlock(&sb->s_root->d_lock);
                spin_unlock(&sb->s_root->d_inode->i_lock);
        }
index 79b47cbb5cd82e8e89bf96de095bf76bcd2c0c47..f8ea28fc5d430e10efe69eec719852a9b81dc791 100644 (file)
@@ -62,14 +62,14 @@ void __fsnotify_update_child_dentry_flags(struct inode *inode)
        spin_lock(&inode->i_lock);
        /* run all of the dentries associated with this inode.  Since this is a
         * directory, there damn well better only be one item on this list */
-       list_for_each_entry(alias, &inode->i_dentry, d_alias) {
+       list_for_each_entry(alias, &inode->i_dentry, d_u.d_alias) {
                struct dentry *child;
 
                /* run all of the children of the original inode and fix their
                 * d_flags to indicate parental interest (their parent is the
                 * original inode) */
                spin_lock(&alias->d_lock);
-               list_for_each_entry(child, &alias->d_subdirs, d_u.d_child) {
+               list_for_each_entry(child, &alias->d_subdirs, d_child) {
                        if (!child->d_inode)
                                continue;
 
index e5ba348183321d133ab7f75c715b305dbed28a07..26977cc14ae4a830feff7f6fc6c0768bb7e405e6 100644 (file)
@@ -175,7 +175,7 @@ struct dentry *ocfs2_find_local_alias(struct inode *inode,
 
        spin_lock(&inode->i_lock);
        list_for_each(p, &inode->i_dentry) {
-               dentry = list_entry(p, struct dentry, d_alias);
+               dentry = list_entry(p, struct dentry, d_u.d_alias);
 
                spin_lock(&dentry->d_lock);
                if (ocfs2_match_dentry(dentry, parent_blkno, skip_unhashed)) {
index 1dfe974fb9fd7609c33c495262f4b2591a5c9946..99374de00c146a6ea5b0bdec1b26da3ef802c569 100644 (file)
@@ -133,15 +133,15 @@ struct dentry {
        void *d_fsdata;                 /* fs-specific data */
 
        struct list_head d_lru;         /* LRU list */
+       struct list_head d_child;       /* child of parent list */
+       struct list_head d_subdirs;     /* our children */
        /*
-        * d_child and d_rcu can share memory
+        * d_alias and d_rcu can share memory
         */
        union {
-               struct list_head d_child;       /* child of parent list */
+               struct list_head d_alias;       /* inode alias list */
                struct rcu_head d_rcu;
        } d_u;
-       struct list_head d_subdirs;     /* our children */
-       struct list_head d_alias;       /* inode alias list */
 };
 
 /*
index ffcf896ddfc0c54dcc89127282f37385a8a491e3..eafb6dd3e19ccf6bb154aa673a3f5996a0172815 100644 (file)
@@ -881,7 +881,7 @@ static void cgroup_clear_directory(struct dentry *dentry)
        spin_lock(&dentry->d_lock);
        node = dentry->d_subdirs.next;
        while (node != &dentry->d_subdirs) {
-               struct dentry *d = list_entry(node, struct dentry, d_u.d_child);
+               struct dentry *d = list_entry(node, struct dentry, d_child);
 
                spin_lock_nested(&d->d_lock, DENTRY_D_LOCK_NESTED);
                list_del_init(node);
@@ -915,7 +915,7 @@ static void cgroup_d_remove_dir(struct dentry *dentry)
        parent = dentry->d_parent;
        spin_lock(&parent->d_lock);
        spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED);
-       list_del_init(&dentry->d_u.d_child);
+       list_del_init(&dentry->d_child);
        spin_unlock(&dentry->d_lock);
        spin_unlock(&parent->d_lock);
        remove_dir(dentry);
index b4f802d2c1d472b3ac32e9c2f3ce53e81f640b49..4dd8dcf146893e0162a5f40a075301a7d0366bde 100644 (file)
@@ -1197,7 +1197,7 @@ static void sel_remove_entries(struct dentry *de)
        spin_lock(&de->d_lock);
        node = de->d_subdirs.next;
        while (node != &de->d_subdirs) {
-               struct dentry *d = list_entry(node, struct dentry, d_u.d_child);
+               struct dentry *d = list_entry(node, struct dentry, d_child);
 
                spin_lock_nested(&d->d_lock, DENTRY_D_LOCK_NESTED);
                list_del_init(node);
@@ -1704,12 +1704,12 @@ static void sel_remove_classes(void)
 
        list_for_each(class_node, &class_dir->d_subdirs) {
                struct dentry *class_subdir = list_entry(class_node,
-                                       struct dentry, d_u.d_child);
+                                       struct dentry, d_child);
                struct list_head *class_subdir_node;
 
                list_for_each(class_subdir_node, &class_subdir->d_subdirs) {
                        struct dentry *d = list_entry(class_subdir_node,
-                                               struct dentry, d_u.d_child);
+                                               struct dentry, d_child);
 
                        if (d->d_inode)
                                if (d->d_inode->i_mode & S_IFDIR)