const char *newname = newdp->d_name.name;
#if defined(AFS_LINUX26_ENV)
+ struct dentry *rehash = NULL;
+
lock_kernel();
#endif
/* Remove old and new entries from name hash. New one will change below.
* cases. Let another lookup put things right, if need be.
*/
#if defined(AFS_LINUX26_ENV)
- if (!d_unhashed(olddp))
- d_drop(olddp);
- if (!d_unhashed(newdp))
+ if (!d_unhashed(newdp)) {
d_drop(newdp);
+ rehash = newdp;
+ }
+
+#ifdef maybe
+ if (atomic_read(&olddp->d_count) > 1) {
+ printk("afs_linux_rename::shrink_dcache_parent()\n");
+ shrink_dcache_parent(olddp);
+ }
+#endif
#else
if (!list_empty(&olddp->d_hash))
d_drop(olddp);
code = afs_rename(ITOAFS(oldip), oldname, ITOAFS(newip), newname, credp);
AFS_GUNLOCK();
- if (!code) {
- /* update time so it doesn't expire immediately */
- newdp->d_time = jiffies;
- d_move(olddp, newdp);
- }
#if defined(AFS_LINUX26_ENV)
+ if (rehash)
+ d_rehash(rehash);
+
unlock_kernel();
#endif