Commit b72d7dcb authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] sunrpc dcache cleanup

Patch from Dipankar Sarma <dipankar@in.ibm.com>

All fs should be using dcache APIs to manipulate dcache hash lists.  This is
in line with the dcache cleanup patch (dcache_rcu-1) from Maneesh that Linus
accepted.  This seems like a reasonable cleanup.  One change though, we don't
need to grab dcache_lock while deleting dentries from the private list and
__d_drop() should suffice here.
parent fec07c11
......@@ -488,14 +488,15 @@ rpc_depopulate(struct dentry *dir)
dentry = list_entry(pos, struct dentry, d_child);
if (!d_unhashed(dentry)) {
dget_locked(dentry);
list_del(&dentry->d_hash);
__d_drop(dentry);
list_add(&dentry->d_hash, &head);
}
}
spin_unlock(&dcache_lock);
while (!list_empty(&head)) {
dentry = list_entry(head.next, struct dentry, d_hash);
list_del_init(&dentry->d_hash);
/* Private list, so no dcache_lock needed and use __d_drop */
__d_drop(dentry);
if (dentry->d_inode) {
rpc_inode_setowner(dentry->d_inode, NULL);
simple_unlink(dir->d_inode, dentry);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment