All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Rüdiger Klaehn" <rudi@lambda-computing.de>
To: jw schultz <jw@pegasys.ws>
Cc: linux-kernel@vger.kernel.org
Subject: Re: File change notification
Date: Thu, 01 Jan 2004 13:44:01 +0100	[thread overview]
Message-ID: <3FF41611.90109@lambda-computing.de> (raw)
In-Reply-To: <20040101104717.GA1373@pegasys.ws>

jw schultz wrote:

[snip]

>hmm...
>
>
>#ln tree1/sub/dir/file tree2/sub/dir/file
>#watch_tree tree1 &
>#do_something_to tree2/sub/dir/file
>
>A dnotify can potentially know about open, chown, chmod,
>utimes and possibly link of the files by watching the paths
>and cwd; meaning it won't know about alternate paths.  How
>is it to know about read, write, fchown, fchmod and
>truncate?
>
>  
>
Take a look at fs/read_write.c. There are calls to dnotify_parent in all 
file operation functions. There is a comment in fs/dnotify.c which says 
that dnotify_parent is "hopelessly wrong, but unfixable without API 
changes". Another good reason for a new file change notification api...

The only thing I am not so sure about is mmap. I think a mmapped file 
will not create change notifications.

>Perhaps someone else has a more fertile imagination but
>short of looking up all the file inode numbers of the tree
>in question and watching that whole list this sounds futile.
>  
>
Whats wrong with that? You would just have to know the inode numbers of 
all directories in the subtree you are interested in. Then you can do a 
really fast inode->name translation using a hashtable or something. At 
least it is much more lightweight than having to open all directories :-)

I think that it is much cleaner and faster to report the inode numbers 
of the changed files since inode numbers are unique per filesystem and 
they are immediately available. The complicated mapping of inodes to 
path names should happen in user space only for the files the userspace 
process is interested in.


  reply	other threads:[~2004-01-01 12:43 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-31 16:42 File change notification Rüdiger Klaehn
2003-12-31 18:20 ` Javier Fernandez-Ivern
2003-12-31 18:48   ` Rüdiger Klaehn
2004-01-01  1:28     ` Michael Clark
2004-01-01  1:58       ` Dave Jones
2004-01-01  2:18         ` Michael Clark
2004-01-01  2:30           ` Javier Fernandez-Ivern
2004-01-01 13:11       ` Rüdiger Klaehn
2003-12-31 20:49 ` Javier Fernandez-Ivern
2004-01-01  9:02 ` Juergen Hasch
2004-01-01 10:47 ` jw schultz
2004-01-01 12:44   ` Rüdiger Klaehn [this message]
2004-01-03  6:32     ` Jan Harkes
  -- strict thread matches above, loose matches on Subject: below --
2004-02-07  8:29 John Ogness
2004-02-07 14:01 ` Christoph Hellwig
     [not found] <18PG9-4og-27@gated-at.bofh.it>
     [not found] ` <18TgF-QJ-7@gated-at.bofh.it>
     [not found]   ` <18TJE-1qL-3@gated-at.bofh.it>
2003-12-31 19:30     ` René Scharfe
2002-11-01 21:31 file " Colin Burnett
2002-11-01 22:19 ` Chris Wright
2002-11-02 15:43   ` Jamie Lokier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3FF41611.90109@lambda-computing.de \
    --to=rudi@lambda-computing.de \
    --cc=jw@pegasys.ws \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.