Re: [PATCH] [RFC] fsnotify: Tell the user what part of the file might have changed

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Alexey Zaytsev
Date: Monday, November 15, 2010 - 12:08 pm

On Mon, Nov 15, 2010 at 13:57, Tvrtko Ursulin <tvrtko.ursulin@sophos.com> wrote:

Hi, Vladislav. ;)


Not sure I get what you mean here. The range is used with two events.
For mofidy, it's the range of the last write, and for close_write it
accumulates the changes. Does not work well if you only modify the
beginning and the end of the file, but if should work well enough for
the majority of writes, which I assume are contiguous, and you can
still get the exact changes by listening to the modify events.


Yep.


Not sure here. The range takes up 128 bytes, which almost doubles the
event size. And it's only applicable to the modify and close_write
events. Optional may be not the right term, but the point is, the
fields are present for the two events, and not for the others.

Maybe, the union should contain per-events structures, like

union {
        struct modity {
                __u64 start;
                __u64 end;
        };
        struct close_write {
                __u64 start;
                __u64 end;
               something else here in the future;
       };
       struct some_other_event {
                other event's stuff;
       }
};

so we could extend it further, maintaining the compatibility?


Yep. If you write 100 bytes at 0, the end is going to be 100. Not sure
which is better.


That's not the point. If start would be initialized with 0,
min(orig_fpos, f->f_whatchanged.start) would always yield 0. Currently
the user gets -1 if write_close happened without any actual
modifications.

Thanks, end of course.
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] [RFC] fsnotify: Tell the user what part of the ..., Alexey Zaytsev, (Mon Nov 15, 12:08 pm)