Use of mmap in Samba 3

Jeremy Allison jra at samba.org
Thu Mar 27 23:40:31 GMT 2008


On Thu, Mar 27, 2008 at 05:03:25PM -0600, Cam Macdonell wrote:
> 
> Hi,
> 
> I am curious if there are any circumstances under which a Samba Server 
> would mmap a file.  I did a quick search through the code and most uses 
> of mmap seem to point to tdb and ldb.  Is mmap used for the databases or 
> are files ever mmaped?  Such as for better performance.
> 
> If found the following comment in source/lib/replace/test/shared_mmap.c:
> 
> /* this tests whether we can use a shared writeable mmap on a file -
> as needed for the mmap variant of FAST_SHARE_MODES */
> 
> as well as the smb.conf parameter "use mmap" but it refers to debugging 
> tdb code.
> 
> However, I wasn't able to find any more information in the documentation.

We used to do this (in Samba < 3.0), but the problem comes with dealing with the signals
if another application truncates the mmap'ed region whilst it's active.

Jeremy.


More information about the samba-technical mailing list