Re: updating HFS+ inode info. on open() call
Re: updating HFS+ inode info. on open() call
- Subject: Re: updating HFS+ inode info. on open() call
- From: Shawn Erickson <email@hidden>
- Date: Sat, 9 Mar 2002 08:15:20 -0800
Why does the data need to be stored with the file (not that it isn't a
sensible goal). Why not have a database of files and their usage be
maintained by your logic that watches open/close. This would be better
at supporting your predictive pre-fetching if the database was designed
to allow for the types of searches you need to do. Having to grok the
file system for usage information could be slow because it is not tuned
for it.
Basically you could do this by having a file system "filter" that you
could lay over _any_ file system. This filter would maintain the
database of usage directly. Basically the moment you try to store this
information in the file system you become file system dependent (which
may be fine in your solution).
-Shawn
On Wednesday, March 6, 2002, at 08:56 PM, Ian Brown wrote:
I am trying to store statistical information with files that persists
across reboots. Theoretically it looks like an attribute record
(HFSPlusAttrInlineData) would be the best place to put this
information, however it does not look like those work yet (correct me
if I am wrong.)
FIRST:
I want to store a counter with each file (or file metadata) counting
open()'s. I can then set them to zero and run filesystem benchmarks
and get file access statistics. "But," they say, "this can be done by
taking a trace." I know, but it would not show me how to store
statistical information with files. Why do I want to do this then?
NEXT:
I will be able to store predictive information with files.
Specifically I would like to store a reference to the file that gets
accessed next. I plan to do this at the time of the next open().
This will give me file grouping information and predictive
pre-fetching information.
The situation with mmap() had not crossed my mind, however I am not
sure if it is an issue with what I am ultimately trying to do.
Ian
What exactly are you trying to do?
Is this total number of open() calls for a file counter? Does it
persist across reboot?
Are you planning on decrementing the counter when close() is called?
If so, What do you intend to do for the case
open()
mmap()
close()
Now you counter goes to 0, but the inode is still in use...
--Umesh
--
Umesh Vaishampayan Apple Computer, Inc.
Mac OS X Kernel Ph: (408) 974 0229
_______________________________________________
darwin-kernel mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/darwin-kernel
Do not post admin requests to the list. They will be ignored.
_______________________________________________
darwin-kernel mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/darwin-kernel
Do not post admin requests to the list. They will be ignored.