Messages in this thread | ![/](/images/icornerl.gif) | | Date | Tue, 4 Apr 2006 10:41:11 +0530 | From | "Balbir Singh" <> | Subject | Re: [PATCH] Fix dcache race during umount |
| |
> Trying again after some useful comments from Balbir. > Note: the change to prune_dcache looks quite different now. > > NeilBrown > <snip> > tmp = dentry_unused.prev; > + if (unlikely(sb)) { > + /* Try to find a dentry for this sb, but don't try > + * too hard, if they aren't near the tail they will > + * be moved down again soon > + */ > + int skip = count; > + while (skip && > + tmp != &dentry_unused && > + list_entry(tmp, struct dentry, d_lru)->d_sb != sb) { > + skip--; > + tmp = tmp->prev; > + } > + }
This code looks very similar to the first pass in dcache_shrink_sb(). I would prefer if we could re-use that code here, but that would require creating a helper function by splitting the function.
Looks like a good solution to me.
Regards, Balbir - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| ![\](/images/icornerr.gif) |