Re: [AVFS] Problems with fork, Questions about avfs

Miklos Szeredi <[email protected]> Sat, 12 Feb 2005 08:56:43 +0100
Newsgroups gmane.comp.file-systems.avfs.user
Message-ID <[email protected]>
> >> But on the other hand I don't see any benefit from this solution.
> > 
> > It's simpler, which is a great benifit :)
> 
> Agreed. I implemented this and it looks like it also works. Although it
> is simplier, this code does not allow for later extension to test
> virtual files the same way (example: /tmp/test#/test.zip#/test#/x)

I'm not against getting rid of escaping.  But then let's get rid of
the ifdefs and make it work for all cases.

> And it is not much simplier (10 lines less code ignoring comments).
> I'm currently not sure which one I like more.
> 
> >> Also my code can be extented to allow for supporting files
> >> containing # inside archives if the lstat of the corresponding avfs
> >> struct is used (ps->mnt->avfs->lstat()?).
> > 
> > Inside archives the escaping will work.  I agree that escaping has
> > it's drawbacks, on the other hand # is not a very often used charater
> > in filenames (I know emacs and CVS use it for intrenal purposes).
> 
> My patch deactivate escaping at all (there is a ifdef ESCAPE_MAGIC to
> trigger this)! It would be harder to only escape magic chars for
> virtual files (/tmp/test#/test.zip#/test##/x).

Yes, that's rather ugly, though avfscoda, and LD_PRELOAD did this, by
completely bypassing avfs for local files.

> By extenting my solution to use stat also for virtual file, this
> could be solved but from my point of view it is acceptable not to be
> able to access such virtual files.

I understand.  Please do as you see fit, but I'd rather only include a
proper solution to this problem (with no ifdefs).

Some specific details on how you can improve the readability of
detecting files with magic char inside:

  - make this a separate function (skip_existing_magic(), whatever)

  - don't try to optimize away memory allocation for small buffers,
    it's really not worth the complexity.

  - in fact I think you can get away without a temporary buffer, since
    the original path buffer can be modified (insert a null charater
    at the right position).

My feeling is that making it work for local and virtual files should
make it less complex not more so.  But of course I may be wrong.

Thanks,
Miklos


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click