13 Dec, 2005

1 commit

  • The below patch lets userspace have more control over the inodes that
    inotify will watch. It introduces two new flags.

    IN_ONLYDIR -- only watch the inode if it is a directory.
    This is needed to avoid the race that can occur when we want to be
    sure that we are watching a directory.

    IN_DONT_FOLLOW -- don't follow a symlink. In combination
    with IN_ONLYDIR we can make sure that we don't watch the target of
    symlinks.

    The issues the flags fix came up when writing the gnome-vfs inotify
    backend. Default behaviour is unchanged.

    Signed-off-by: John McCutchan
    Acked-by: Robert Love
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    John McCutchan
     

09 Nov, 2005

1 commit

  • Most permission() calls have a struct nameidata * available. This helper
    takes that as an argument and thus makes sure we pass it down for lookup
    intents and prepares for per-mount read-only support where we need a struct
    vfsmount for checking whether a file is writeable.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Hellwig
     

24 Oct, 2005

1 commit

  • Fix a bug which was reported and diagnosed by
    Stefan Jones

    IDR trees include a cache of idr_layer objects. There's no way to destroy
    this cache, so when we discard an overall idr tree we end up leaking some
    memory.

    Add and use idr_destroy() for this. v9fs and infiniband also need to use
    idr_destroy() to avoid leaks.

    Or, we make the cache global, like radix_tree_preload(). Which is probably
    better. Later.

    Cc: Eric Van Hensbergen
    Cc: Roland Dreier
    Cc: Robert Love
    Cc: John McCutchan
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     

08 Sep, 2005

2 commits

  • People have run into a problem when they do this:

    watch (file1, all_events);
    watch (file2, some_events);

    if file2 is a hard link to file1, some events will be missed because by
    default we replace the mask. The patch below adds a flag IN_MASK_ADD which
    will cause inotify to add to the existing mask if present.

    Signed-off-by: John McCutchan
    Signed-off-by: Robert Love
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    John McCutchan
     
  • Bypass an inotify-related fastpath spinlock and several function calls on
    systems which have no inotify watches registered.

    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    John McCutchan
     

27 Aug, 2005

1 commit

  • There is an off by one problem with idr_get_new_above.

    The comment and function name suggest that it will return an id >
    starting_id, but it actually returned an id >= starting_id, and kernel
    callers other than inotify treated it as such.

    The patch below fixes the comment, and fixes inotifys usage. The
    function name still doesn't match the behaviour, but it never did.

    Signed-off-by: John McCutchan
    Signed-off-by: Linus Torvalds

    John McCutchan
     

16 Aug, 2005

1 commit


02 Aug, 2005

1 commit

  • When you rm a watch, an IN_IGNORED event is sent down the event queue
    with the watch descriptor that you just rm'd.

    If you then add a watch you could get the ignored watch's wd and if you
    haven't read the entire event queue, user space will think that it's
    newly created watch was just ignored.

    To avoid this problem we just use idr_get_new_above instead of
    idr_get_new.

    Signed-off-by: John McCutchan
    Signed-off-by: Robert Love
    Signed-off-by: Linus Torvalds

    John McCutchan
     

27 Jul, 2005

7 commits


14 Jul, 2005

2 commits


13 Jul, 2005

1 commit

  • inotify is intended to correct the deficiencies of dnotify, particularly
    its inability to scale and its terrible user interface:

    * dnotify requires the opening of one fd per each directory
    that you intend to watch. This quickly results in too many
    open files and pins removable media, preventing unmount.
    * dnotify is directory-based. You only learn about changes to
    directories. Sure, a change to a file in a directory affects
    the directory, but you are then forced to keep a cache of
    stat structures.
    * dnotify's interface to user-space is awful. Signals?

    inotify provides a more usable, simple, powerful solution to file change
    notification:

    * inotify's interface is a system call that returns a fd, not SIGIO.
    You get a single fd, which is select()-able.
    * inotify has an event that says "the filesystem that the item
    you were watching is on was unmounted."
    * inotify can watch directories or files.

    Inotify is currently used by Beagle (a desktop search infrastructure),
    Gamin (a FAM replacement), and other projects.

    See Documentation/filesystems/inotify.txt.

    Signed-off-by: Robert Love
    Cc: John McCutchan
    Cc: Christoph Hellwig
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Robert Love