mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-10 07:10:27 +00:00
affs: unobfuscate affs_fix_dcache()
and add a comment on what it's doing Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
3084ee95f0
commit
12447c4039
@ -122,15 +122,13 @@ affs_remove_hash(struct inode *dir, struct buffer_head *rem_bh)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
affs_fix_dcache(struct dentry *dentry, u32 entry_ino)
|
affs_fix_dcache(struct inode *inode, u32 entry_ino)
|
||||||
{
|
{
|
||||||
struct inode *inode = dentry->d_inode;
|
struct dentry *dentry;
|
||||||
void *data = dentry->d_fsdata;
|
|
||||||
|
|
||||||
spin_lock(&inode->i_lock);
|
spin_lock(&inode->i_lock);
|
||||||
list_for_each_entry(dentry, &inode->i_dentry, d_alias) {
|
list_for_each_entry(dentry, &inode->i_dentry, d_alias) {
|
||||||
if (entry_ino == (u32)(long)dentry->d_fsdata) {
|
if (entry_ino == (u32)(long)dentry->d_fsdata) {
|
||||||
dentry->d_fsdata = data;
|
dentry->d_fsdata = (void *)inode->i_ino;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -172,7 +170,11 @@ affs_remove_link(struct dentry *dentry)
|
|||||||
}
|
}
|
||||||
|
|
||||||
affs_lock_dir(dir);
|
affs_lock_dir(dir);
|
||||||
affs_fix_dcache(dentry, link_ino);
|
/*
|
||||||
|
* if there's a dentry for that block, make it
|
||||||
|
* refer to inode itself.
|
||||||
|
*/
|
||||||
|
affs_fix_dcache(inode, link_ino);
|
||||||
retval = affs_remove_hash(dir, link_bh);
|
retval = affs_remove_hash(dir, link_bh);
|
||||||
if (retval) {
|
if (retval) {
|
||||||
affs_unlock_dir(dir);
|
affs_unlock_dir(dir);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user