Re: [RFC][PATCH] inotify 0.10.0

Ray Lee
2004-09-30T15:31:14Z

On Wed, 2004-09-29 at 20:05 -0700, Paul Jackson wrote:
> Robert wrote:
> > A monitor on "/etc" will return "hosts" if hosts is modified. Which I
> > think is OK--we don't pass the entire path, nor do we want to if we
> > could do it easily, for numerous reasons ..
>
> How about returning the inode number?
>
> Notice that this can be converted to the name without using stat, using
> the d_ino field in the struct dirent returned from an opendir/readdir
> loop.

This changes an O(1) process to O(N), where N is the size of the
directory. That's one of the issues with dnotify that they're trying to
fix.

Bottom line, the kernel has that information available to it, and
cheaply. Forcing userspace to rederive that information for the
advantage of not spewing filenames out of the kernel is a false economy,
when viewed from the entire system.

Ray