.mmap = afs_linux_mmap,
.open = afs_linux_open,
.flush = afs_linux_flush,
+#ifdef AFS_LINUX26_ENV
+ .sendfile = generic_file_sendfile,
+#endif
.release = afs_linux_release,
.fsync = afs_linux_fsync,
.lock = afs_linux_lock,
#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;
+ 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.
* 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;
+ }
#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 (!code) {
- /* update time so it doesn't expire immediately */
- newdp->d_time = jiffies;
- d_move(olddp, newdp);
- }
+ if (rehash)
+ d_rehash(rehash);
#if defined(AFS_LINUX26_ENV)
unlock_kernel();
struct inode_operations afs_symlink_iops = {
#if defined(AFS_LINUX24_ENV)
.readlink = page_readlink,
+#if defined(HAVE_KERNEL_PAGE_FOLLOW_LINK)
.follow_link = page_follow_link,
+#else
+ .follow_link = page_follow_link_light,
+#endif
.setattr = afs_notify_change,
#else
.readlink = afs_linux_readlink,