• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Query related to lookup
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Query related to lookup


  • Subject: Re: Query related to lookup
  • From: Ken Hornstein <email@hidden>
  • Date: Mon, 08 Apr 2013 15:35:15 -0400

>We are already supplying VNFS_NOCACHE flag to vnode_create(). But Ken
>and Me are facing a problem where we want to purge the name cache entry
>because file / folder is renamed / deleted remotely.

Well, my case is a bit simpler ... in the network filesystem I did, I
get a callback from the server when a vnode gets invalidated/changed, so
I can call cache_purge().  That was never a problem for me.

>I was looking for entry point similar to dentry::revalidate from
>linux which will give us an opportunity to re-validate name cache
>entry. Currently, name cache implementation from Darwin kernel does not
>have any "time-to-live" duration assigned with it. Once you enter a
>vnode into name cache by calling cache_enter() , VFS won't ever call the
>file system driver to re-validate that name cache entry unless we remove
>the name cache entry via VNOP_RECLAIM / VNOP_INACTIVE.

Have you looked at sys/vnode.h?  The comments are instructive here:

#define VNFS_NOCACHE    0x01    /* do not add to name cache at this time */
#define VNFS_CANTCACHE  0x02    /* never add this instance to the name cache */

VNFS_NOCACHE means "don't add it to the name cache at vnode creation time".
But it sounds like you're calling cache_enter() on it (why?), so the
filesystem obliges you and puts in into the name cache.  You shouldn't
do that, from what you're saying.  Or, you could use VNFS_CANTCACHE.
But even if you use VNFS_CANTCACHE, don't call cache_enter().  It looks
like ... if you use VNFS_CANTCACHE, VNCACHEABLE _isn't_ set on the vnode,
which means that in a few cases where the VFS layer could add it to
the name cache for it, it doesn't.

So, in summary:

- Use VFS_CANTCACHE
- Don't call cache_enter().

--Ken
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Filesystem-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • RE: Query related to lookup
      • From: Pratima Kudale <email@hidden>
References: 
 >RE: Query related to lookup (From: Pratima Kudale <email@hidden>)

  • Prev by Date: Re: Query related to lookup
  • Next by Date: RE: Query related to lookup
  • Previous by thread: Re: Query related to lookup
  • Next by thread: RE: Query related to lookup
  • Index(es):
    • Date
    • Thread