Skip to content

Commit

Permalink
move d_rcu from overlapping d_child to overlapping d_alias
Browse files Browse the repository at this point in the history
Signed-off-by: Al Viro <[email protected]>
  • Loading branch information
Al Viro committed Nov 3, 2014
1 parent a740022 commit 946e51f
Show file tree
Hide file tree
Showing 24 changed files with 73 additions and 74 deletions.
2 changes: 1 addition & 1 deletion arch/powerpc/platforms/cell/spufs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,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);
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/lustre/lustre/llite/dcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,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_alias) {
ll_d_hlist_for_each_entry(dentry, p, &inode->i_dentry, d_u.d_alias) {
CDEBUG(D_DENTRY, "dentry in drop %.*s (%p) parent %p "
"inode %p flags %d\n", dentry->d_name.len,
dentry->d_name.name, dentry, dentry->d_parent,
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/lustre/lustre/llite/llite_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@ void lustre_dump_dentry(struct dentry *dentry, int recur)
return;

list_for_each(tmp, &dentry->d_subdirs) {
struct dentry *d = list_entry(tmp, struct dentry, d_u.d_child);
struct dentry *d = list_entry(tmp, struct dentry, d_child);
lustre_dump_dentry(d, recur - 1);
}
}
Expand Down
8 changes: 4 additions & 4 deletions drivers/staging/lustre/lustre/llite/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,14 +167,14 @@ static void ll_invalidate_negative_children(struct inode *dir)
struct ll_d_hlist_node *p;

ll_lock_dcache(dir);
ll_d_hlist_for_each_entry(dentry, p, &dir->i_dentry, d_alias) {
ll_d_hlist_for_each_entry(dentry, p, &dir->i_dentry, d_u.d_alias) {
spin_lock(&dentry->d_lock);
if (!list_empty(&dentry->d_subdirs)) {
struct dentry *child;

list_for_each_entry_safe(child, tmp_subdir,
&dentry->d_subdirs,
d_u.d_child) {
d_child) {
if (child->d_inode == NULL)
d_lustre_invalidate(child, 1);
}
Expand Down Expand Up @@ -362,7 +362,7 @@ static struct dentry *ll_find_alias(struct inode *inode, struct dentry *dentry)
discon_alias = invalid_alias = NULL;

ll_lock_dcache(inode);
ll_d_hlist_for_each_entry(alias, p, &inode->i_dentry, d_alias) {
ll_d_hlist_for_each_entry(alias, p, &inode->i_dentry, d_u.d_alias) {
LASSERT(alias != dentry);

spin_lock(&alias->d_lock);
Expand Down Expand Up @@ -953,7 +953,7 @@ static void ll_get_child_fid(struct inode * dir, struct qstr *name,
{
struct dentry *parent, *child;

parent = ll_d_hlist_entry(dir->i_dentry, struct dentry, d_alias);
parent = ll_d_hlist_entry(dir->i_dentry, struct dentry, d_u.d_alias);
child = d_lookup(parent, name);
if (child) {
if (child->d_inode)
Expand Down
2 changes: 1 addition & 1 deletion fs/affs/amigaffs.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ affs_fix_dcache(struct inode *inode, u32 entry_ino)
{
struct dentry *dentry;
spin_lock(&inode->i_lock);
hlist_for_each_entry(dentry, &inode->i_dentry, d_alias) {
hlist_for_each_entry(dentry, &inode->i_dentry, d_u.d_alias) {
if (entry_ino == (u32)(long)dentry->d_fsdata) {
dentry->d_fsdata = (void *)inode->i_ino;
break;
Expand Down
12 changes: 6 additions & 6 deletions fs/autofs4/expire.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ static struct dentry *get_next_positive_subdir(struct dentry *prev,
spin_lock(&root->d_lock);

if (prev)
next = prev->d_u.d_child.next;
next = prev->d_child.next;
else {
prev = dget_dlock(root);
next = prev->d_subdirs.next;
Expand All @@ -99,13 +99,13 @@ static struct dentry *get_next_positive_subdir(struct dentry *prev,
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);
/* Already gone or negative dentry (under construction) - try next */
if (!d_count(q) || !simple_positive(q)) {
spin_unlock(&q->d_lock);
next = q->d_u.d_child.next;
next = q->d_child.next;
goto cont;
}
dget_dlock(q);
Expand Down Expand Up @@ -155,13 +155,13 @@ static struct dentry *get_next_positive_dentry(struct dentry *prev,
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 */
Expand Down Expand Up @@ -489,7 +489,7 @@ struct dentry *autofs4_expire_indirect(struct super_block *sb,
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);
Expand Down
2 changes: 1 addition & 1 deletion fs/autofs4/root.c
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,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)
Expand Down
8 changes: 4 additions & 4 deletions fs/ceph/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ static int fpos_cmp(loff_t l, loff_t r)
/*
* 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.
*
Expand Down Expand Up @@ -147,11 +147,11 @@ static int __dcache_readdir(struct file *file, struct dir_context *ctx,
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,
Expand All @@ -174,7 +174,7 @@ static int __dcache_readdir(struct file *file, struct dir_context *ctx,
!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);
}

Expand Down
2 changes: 1 addition & 1 deletion fs/ceph/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1399,7 +1399,7 @@ int ceph_readdir_prepopulate(struct ceph_mds_request *req,
/* 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);
}
Expand Down
2 changes: 1 addition & 1 deletion fs/cifs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -895,7 +895,7 @@ inode_has_hashed_dentries(struct inode *inode)
struct dentry *dentry;

spin_lock(&inode->i_lock);
hlist_for_each_entry(dentry, &inode->i_dentry, d_alias) {
hlist_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;
Expand Down
2 changes: 1 addition & 1 deletion fs/coda/cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ static void coda_flag_children(struct dentry *parent, int flag)
struct dentry *de;

spin_lock(&parent->d_lock);
list_for_each_entry(de, &parent->d_subdirs, d_u.d_child) {
list_for_each_entry(de, &parent->d_subdirs, d_child) {
/* don't know what to do with negative dentries */
if (de->d_inode )
coda_flag_inode(de->d_inode, flag);
Expand Down
Loading

0 comments on commit 946e51f

Please sign in to comment.