RE: Query related to lookup
RE: Query related to lookup
- Subject: RE: Query related to lookup
- From: Pratima Kudale <email@hidden>
- Date: Mon, 08 Apr 2013 12:48:31 -0700
- Acceptlanguage: en-US
- Thread-topic: Query related to lookup
Ken,
Thanks for inputs. About your comment:
>>So, in summary:
>>
>>- Use VFS_CANTCACHE
>>- Don't call cache_enter().
Which means implement your own name cache ... I wanted to solve this problem using OSx built-in name cache. We also have directory notification callback mechanism where we can call cache_purge().
But I wanted to raise/verify my concern on whether or not VFS layer from OSx kernel supports "time-to-live" for a vnode like linux / freeebsd dentry.
Shantonu,
Should I file an enhancement bug report for this? This would definitely be a nice-to-have feature.
Thanks,
Pratima
-----Original Message-----
From: Ken Hornstein [mailto:email@hidden]
Sent: Monday, April 08, 2013 12:35 PM
To: Pratima Kudale
Cc: Pratima Kudale; email@hidden
Subject: Re: Query related to lookup
>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