- 论坛徽章:
- 0
|
你说的这里有什么问题? 能否详细说一下?
原帖由 sisi8408 于 2007-8-23 11:37 发表 [url=http://linux.chinaunix.net/bbs/redirect.php?goto=findpost&&
void shrink_dcache_sb(struct super_block * sb)
{
struct list_head *tmp, *next;
struct dentry *dentry;
/*
* Pass one ... move the dentries for the specified
* superblock to the most recent end of the unused list.
*/
spin_lock(&dcache_lock);
list_for_each_safe(tmp, next, &dentry_unused) {
dentry = list_entry(tmp, struct dentry, d_lru);
if (dentry->d_sb != sb)
continue;
list_move(tmp, &dentry_unused);
}
/*
* Pass two ... free the dentries for this superblock.
*/
repeat:
list_for_each_safe(tmp, next, &dentry_unused) {
dentry = list_entry(tmp, struct dentry, d_lru);
if (dentry->d_sb != sb)
continue;
dentry_stat.nr_unused--;
list_del_init(tmp);
spin_lock(&dentry->d_lock);
if (atomic_read(&dentry->d_count)) {
/*
* linux-2.6.20.7/fs/dcache.c
*
* ¥3
* how can i get dentry on lru later?
* where u go on earth?
*/
spin_unlock(&dentry->d_lock);
continue;
}
prune_one_dentry(dentry);
cond_resched_lock(&dcache_lock);
goto repeat;
}
spin_unlock(&dcache_lock);
} |
|