#define MAX_FNUMS (MAX_OPEN_FILES...)

Andrew Tridgell tridge at samba.anu.edu.au
Fri Jul 24 05:50:04 GMT 1998


> To fit in with what I am suggesting, I think I will need to following changes:
> 
> In server.c:
> 
> int max_open_files = 0;       /* Will have to be extern in other files */
> int max_open_directories = 0;
> 
> plus some other code to set these to real or default values depending on
> what happens in reload_services.
> 
> In local.h:
> 
> #define MAX_FNUMS (max_open_files+max_open_directories)
> 
> This minimizes the changes I need to make, but means that the code is more
> difficult to understand.
> 
> Does anyone think I should do it differently?

That certainly is the easiest way, but what I'd rather see is a new
files.c module with a little set of access functions so that the
actual data structure used is hidden from all other modules. The array
(or whatever you choose to use) would then be static inside that
module.

The main reason is that we will have to eventually drop the current
linear array format for Files[] in order to handle really large
arrays. It is just to slow to scan it linearly as we now do in several
places (such as the oplock code).

Probably a good way to proceed is to use the current linear array
stuff but just hide it in files.c then we (or Chris!) can look at what
data structure is most appropriate when the need arises.

     - Tridge


More information about the samba-technical mailing list