diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-06-09 13:06:09 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-07-14 08:32:52 -0400 |
commit | 12447c40394695c9a19920c65fea124bdf3ea034 (patch) | |
tree | 7c689ede79d1b61986706a94b588116b4e5f4288 /fs | |
parent | 3084ee95f08ce353ae26c18c7627c4e9786983ca (diff) |
affs: unobfuscate affs_fix_dcache()
and add a comment on what it's doing
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/affs/amigaffs.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/fs/affs/amigaffs.c b/fs/affs/amigaffs.c index 1c7fd7928d1f..843cdc994804 100644 --- a/fs/affs/amigaffs.c +++ b/fs/affs/amigaffs.c | |||
@@ -122,15 +122,13 @@ affs_remove_hash(struct inode *dir, struct buffer_head *rem_bh) | |||
122 | } | 122 | } |
123 | 123 | ||
124 | static void | 124 | static void |
125 | affs_fix_dcache(struct dentry *dentry, u32 entry_ino) | 125 | affs_fix_dcache(struct inode *inode, u32 entry_ino) |
126 | { | 126 | { |
127 | struct inode *inode = dentry->d_inode; | 127 | struct dentry *dentry; |
128 | void *data = dentry->d_fsdata; | ||
129 | |||
130 | spin_lock(&inode->i_lock); | 128 | spin_lock(&inode->i_lock); |
131 | list_for_each_entry(dentry, &inode->i_dentry, d_alias) { | 129 | list_for_each_entry(dentry, &inode->i_dentry, d_alias) { |
132 | if (entry_ino == (u32)(long)dentry->d_fsdata) { | 130 | if (entry_ino == (u32)(long)dentry->d_fsdata) { |
133 | dentry->d_fsdata = data; | 131 | dentry->d_fsdata = (void *)inode->i_ino; |
134 | break; | 132 | break; |
135 | } | 133 | } |
136 | } | 134 | } |
@@ -172,7 +170,11 @@ affs_remove_link(struct dentry *dentry) | |||
172 | } | 170 | } |
173 | 171 | ||
174 | affs_lock_dir(dir); | 172 | affs_lock_dir(dir); |
175 | affs_fix_dcache(dentry, link_ino); | 173 | /* |
174 | * if there's a dentry for that block, make it | ||
175 | * refer to inode itself. | ||
176 | */ | ||
177 | affs_fix_dcache(inode, link_ino); | ||
176 | retval = affs_remove_hash(dir, link_bh); | 178 | retval = affs_remove_hash(dir, link_bh); |
177 | if (retval) { | 179 | if (retval) { |
178 | affs_unlock_dir(dir); | 180 | affs_unlock_dir(dir); |