#endif
dp->d_op = &afs_dentry_operations;
- dp->d_time = jiffies;
d_instantiate(dp, ip);
}
ip->i_op = &afs_symlink_iops;
#endif
}
- dp->d_time = jiffies;
dp->d_op = &afs_dentry_operations;
d_add(dp, AFSTOI(vcp));
tvcp->v.v_fop = &afs_dir_fops;
#endif
dp->d_op = &afs_dentry_operations;
- dp->d_time = jiffies;
d_instantiate(dp, AFSTOI(tvcp));
}
cred_t *credp = crref();
const char *oldname = olddp->d_name.name;
const char *newname = newdp->d_name.name;
-
-#if defined(AFS_LINUX26_ENV)
struct dentry *rehash = NULL;
+#if defined(AFS_LINUX26_ENV)
+ /* Prevent any new references during rename operation. */
lock_kernel();
#endif
/* Remove old and new entries from name hash. New one will change below.
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);
- if (!list_empty(&newdp->d_hash))
+ if (!list_empty(&newdp->d_hash)) {
d_drop(newdp);
+ rehash = newdp;
+ }
#endif
+
+#if defined(AFS_LINUX24_ENV)
+ if (atomic_read(&olddp->d_count) > 1)
+ shrink_dcache_parent(olddp);
+#endif
+
AFS_GLOCK();
code = afs_rename(ITOAFS(oldip), oldname, ITOAFS(newip), newname, credp);
AFS_GUNLOCK();
-
-#if defined(AFS_LINUX26_ENV)
if (rehash)
d_rehash(rehash);
+#if defined(AFS_LINUX26_ENV)
unlock_kernel();
#endif