| To: | Barry Naujok <bnaujok@xxxxxxx> |
|---|---|
| Subject: | Re: [RFC 0/2] Case-insensitive filename lookup for XFS |
| From: | Anton Altaparmakov <aia21@xxxxxxxxx> |
| Date: | Wed, 24 Oct 2007 16:05:54 +0100 |
| Cc: | xfs@xxxxxxxxxxx, xfs-dev <xfs-dev@xxxxxxx>, linux-fsdevel@xxxxxxxxxxxxxxx |
| In-reply-to: | <op.t0ox8tfb3jf8g2@pc-bnaujok.melbourne.sgi.com> |
| References: | <op.t0m36sn43jf8g2@pc-bnaujok.melbourne.sgi.com> <30F0B02B-9857-43E8-89C0-E9C85EF081A2@cam.ac.uk> <7858EE76-E860-41C3-8AFC-CE67DF210081@cam.ac.uk> <op.t0ox8tfb3jf8g2@pc-bnaujok.melbourne.sgi.com> |
| Sender: | xfs-bounce@xxxxxxxxxxx |
Hi Barry, On 24 Oct 2007, at 08:39, Barry Naujok wrote: On Tue, 23 Oct 2007 20:07:47 +1000, Anton Altaparmakov <aia21@xxxxxxxxx > wrote:I forgot to say: If you do what I did for NTFS you can also throw Yes, that is correct. Well spotted! That means NTFS needs to start killing all negative dentries belonging to a directory each time a directory entry is created in that directory. That is what I do for NTFS on Mac OS X already but I had forgotten about needing to do it on Linux, too. )-: In OSX there the VFS provides a function to do this "xnu/bsd/vfs/ vfs_cache.c::cache_purge_negatives()", we will need to implement an equivalent on Linux: <quote from xnu/bsd/vfs/vfs_cache.c>
/*
* Purge all negative cache entries that are children of the
* given vnode. A case-insensitive file system (or any file
* system that has multiple equivalent names for the same
* directory entry) can use this when creating or renaming
* to remove negative entries that may no longer apply.
*/
void
cache_purge_negatives(vnode_t vp)
{
struct namecache *ncp;NAME_CACHE_LOCK(); LIST_FOREACH(ncp, &vp->v_ncchildren, nc_child)
if (ncp->nc_vp == NULL)
cache_delete(ncp, 1);NAME_CACHE_UNLOCK(); } </quote> The Linux version should be analogous AFAICS, i.e. take the dentry of the directory in which an entry is being created and iterate over its d_subdirs list and for each dentry on that list if it is a negative dentry, i.e. d_inode is NULL, throw the dentry away. Basically very similar to the OSX function but I can't quite see which dcache function we need to call to do the "throw the dentry away" bit. None of the functions in fs/dcache.c look quite right. I imagine we want to take the dcache_lock, traverse d_subdirs list of the directory dentry and for each negative dentry on the list, do a __dget_locked(), __d_drop(), spin_unlock(&dentry->d_lock), then move it from d_subdirs of its parent to a private list and when when we are done, drop the dcache_lock and go over the private list and do a dput() for each dentry on the private list which will result in them all being d_kill()ed. This can probably be made more efficient by someone who understands the dcache better than me but it seems what I suggest would at least do the right thing... Best regards, Anton -- Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @) Unix Support, Computing Service, University of Cambridge, CB2 3QH, UK Linux NTFS maintainer, http://www.linux-ntfs.org/ |
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | XFA on LVM and MD Raid, Bernd Müller-Rathgeber |
|---|---|
| Next by Date: | Re: problems subscribing to this list., Russell Cattelan |
| Previous by Thread: | Re: [RFC 0/2] Case-insensitive filename lookup for XFS, Barry Naujok |
| Next by Thread: | Re: [RFC 0/2] Case-insensitive filename lookup for XFS, Martin Steigerwald |
| Indexes: | [Date] [Thread] [Top] [All Lists] |