[openbeos] Re: Aw: Re: sync daemon?

  • From: "Axel Dörfler" <axeld@xxxxxxxxxxxxxxxx>
  • To: openbeos@xxxxxxxxxxxxx
  • Date: Sun, 21 Jan 2007 13:54:05 +0100 (MET)

"François Revol" <revol@xxxxxxx> wrote:
> notify_listener(fs, ..., uint32 what)
> {
>       ...
> 
>       if (fs->flags & FS_IS_REMOVABLE) {
>               LOCK();
>               // maybe atomic_or() instead of locking ?
>               thefs->dirty_stats |= what;
>               if (thefs->dirty_stats & ~CHANGED_ATIME) {
>                       sync(fs);
>                       thefs->dirty_stats = 0;
>               }
>               UNLOCK();
>       }
> }

After every change? That wouldn't just be bad for performance, that 
would be awkward :-)
Besides, our notify_stat_changed() already has a "statFields" argument 
- it could indeed be used to monitor if FS_WRITE_STAT_ATIME was the 
only change.
I find Marcus's suggestion of just having shorter delays for removable 
media more appropriate, though. If you wait until the "cache action" is 
mostly over, it probably won't hurt performance that much, anyway.

Anyway, while I think notifying the user if not all changes could been 
written back (and asking to remount the media) is a good idea, I also 
don't think we should pursue this idea any further for R1.

Bye,
   Axel.


Other related posts: