Bennett Todd wrote:
I thing that there are 2 different solutions. The first is to use memory mapped filesSomewhat, certainly; but the API to support such scanning is more complex than a pure file-oriented API.
This shows up a lot, and virus-scanning is a major example.
The normal fix is to construct a tempfs, or ramfs, or other
memory-based filesystem to hold the files. This allows sticking with
the file-oriented API while avoiding any need for disk I/O,
eliminating most of the slow-down; .....
and the second is to use tmpfs/ramfs.
The first solution is easy to implement it and memory mapped files supported on most platforms.
But you can not increase significant the virus scanning procedure because clamav uses temporary files
to analyze scanned files.
As I know the Clamav implementation,it is going to have single function to generate temporary file/directory. (cli_gentemp) Could it be a nice solution to implement suplementary cli_gentemp?
Or extend current one allowing memory mapped file generated under some fine algorithm (for example limit memory mapped file to some value and if exhausted use ordinary disk I/O) ?
Just an idea.
Best Regards Boguslaw Brandys
The second solution (tmpfs/ramfs) is better. Easier to implement it and faster. Only, you have to handle
the case in which the filesystem will be full (not usuall) and you must provide support for a secondary (and slower)
storage for large objects. Memory-based filesystems supported at least for linux and solaris.
I am going to proceed with the second solution.
_______________________________________________ http://lists.clamav.net/cgi-bin/mailman/listinfo/clamav-devel
