Skip to contentSkip to conversation

Recursive modified-timestamp?

DISCUSSION Alexander G. M. Smith 3 participants 3 messages Jan 1, 2005 – Jan 6, 2005

lore
Share & tools
lore
#0 lore raw

Fred Schaettgen wrote on Sat, 1 Jan 2005 12:56:33 +0100:

Quoted 4 lines

Do you know if this service was actually provided by the file system or was it just a clever use of a more simple feature of the fs which allows to do that? There are certainly a lot of things which could be done, if changed files can be found quickly, but those things don't need to go into fs itself.

It was part of the file system. The kernel / file system interface API has a function that your file system calls to post a change notification, taking a change code and up to three file inode numbers (useful for renaming operations that move a file to a new directory) and a string:

int notify_listener (int op, nspace_id nsid, vnode_id vnida, vnode_id vnidb, vnode_id vnidc, const char *name);

The kernel would then take care of building and sending messages to interested programs, or do nothing if there were no listeners. The API for query updates is similar.

Quoted 4 lines

With "change notification flag" I didn't mean to have the send messages, but put links to the file into a folder, so a daemon can poll for changes. I guess polling is better in this case, since it limits the overhead even in persence of many changes.

Kind of like stored notifcations, saved for later use? That could be a concept to explore in general. I can see making a special index that would collect files which match a standing query, with the unusual option of allowing the user to empty the index when they wish. Cool. Thanks for the inspiration! Now offline programs can catch up on changes that happened while they weren't running. I'll have to add it to my experimental file system along with magic directories showing query results, whenever I get time :-(.

An alternative would be to have attributes on files - some flag that gets set during a build and cleared when you edit the source. Or if the text editor can't do attributes (or the kernel can't auto-wipe an attribute when the file is changed), you could store the build date in the attribute and compare it with the file modified date to find all files that are out of date. Or for that matter, just store the last build date somewhere global and look for source files for your project which are more recent using an index. A path match or another attribute would mark files as belonging to a particular project.

(last_modified>=2004.12.31)&&(Project=="MyProject")

Quoted 4 lines

I claim that the approach I described...
- ...allows all these things to be done efficiently in userspace.
- ...is the smallest change to the fs neccessary for it.
- ...could be implemented in reiser4 without significant performance losses.

Possibly. But I'd like to generalize it a bit. Percolated attributes are perhaps a better more general idea. We already have inherited attributes (such as security of children being inherited from the parent) so going in the other direction isn't all that big step, it just needs an application, like your modification detection system.

- Alex

#1 lore raw
Quoted 8 lines · Alexander G. M. Smith

Possibly. But I'd like to generalize it a bit. Percolated attributes are perhaps a better more general idea. We already have inherited attributes (such as security of children being inherited from the parent) so going in the other direction isn't all that big step, it just needs an application, like your modification detection system.

The general form of inheritance should not be restricted to inheriting from parents. Parents should merely be a default if nothing is specified as what one inherits from. And when one inherits, one can write through to what one inherits from, at least by default.

At least, such are my thoughts on the matter.

Hans

#2 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hans Reiser wrote:

| Alexander G. M. Smith wrote:
|
|>
|> Possibly.  But I'd like to generalize it a bit.  Percolated attributes
|> are
|> perhaps a better more general idea.  We already have inherited attributes
|> (such as security of children being inherited from the parent) so
|> going in
|> the other direction isn't all that big step, it just needs an
|> application,
|> like your modification detection system.
|>
|>
| The general form of inheritance should not be restricted to inheriting
| from parents.  Parents should merely be a default if nothing is
| specified as what one inherits from.  And when one inherits, one can
| write through to what one inherits from, at least by default.

Right. Thinking back to the recursive-mtimes, one possible way to get an mtime for a tree is to have every modification to one of its files percolate back up the tree (child-to-parent), meaning a parent is "inheriting" that attribute from each of its children.

This could be made fast by merely having a flag that says "this file has been modified since this program last checked", so that the change-flag doesn't have to go all the way back up the tree each time.

One possible way to do this is to give each file/directory a list of links to each of its parents. How hard would that be to add? -----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iQIVAwUBQd28SXgHNmZLgCUhAQLBfBAAlRBz2RKpBpYxqI5D1LXUQsv6/pDPO3kF ROlGCaS4lbFIsVHuJazS1uVW+JSY/7FQWRBx06PpsM3jB8RHCKnlhx8WUgGEt9sb r7AQ+u91nPk2Oh638X6tNgFPbiUMCFpRZXuQ7e7SmyxIuqEEwUsIsEIirqo6uru5 KN7/2JiABMlUIQAF8SbPB4RwNxUbAP1d//khAhhseLlq4b7nyT426kLVmxQY5hjq QiMxJWvODm9ifuKu+Kwe2DhZa+s/jKAHCIdKNP25rzUTSaOtRnqX90zAJmO/vtL6 HKGAW3+YpuVv+wV7wcSfKNoCRSdr1m2HxgmIoyF5I7Z1G4/hMCqilroK+2lii2aA DhjvSSUFlLwnvZcvWwnsE8T/pRXICT5RR/pvmtIiji+HJUJEufn75+QxPk/IFYNk HboXahafDm669tQiOPvHhBIRNxblXmO4BsumJ5C8b3Qt6Xpx434VkHfqWmcgnTjg a/wyXSa5/AiD4KrMR9GcN1PkOVP6Kr42o2w/iGEUZqQfM11kWCLAvYA/8fcYgxWm der1Pa+jrw9/t4eJFTEPE0jKNau7MXlA/yeIXXVh+0T51fApdXuPsOCs8J5GWzCZ 8EUaXS7FO7FrI4/ynarnewlOtVvAOGiit1aMDdN89fF1WlTWU3aze8pCPgJ+EQb8 T8Sb9/eLWJM=
=hNoL
-----END PGP SIGNATURE-----