new aio engine

Volker Lendecke Volker.Lendecke at SerNet.DE
Mon Jul 16 09:14:06 MDT 2012



find a new async I/O engine for Samba. The old one was based
around the posix aio API, the branch converts it to

It uses a pthread based implementation in by default via
lib/asys and lib/pthreadpool.

pthreadpool has a sync fake implementation that works
without threads.

The posix api is used in the vfs_aio_posix module for
in-kernel implementations like FreeBSD and others that might
be more efficient than a user-space pthreads one.

The AIO engine is always compiled, HAVE_AIO is reduced to
the vfs_aio_posix module.

asys.h has more functions mentioned than actually
implemented. asys_open is not implemented yet, this will
require a fork model. I nevertheless want to show the easy
piece for review early.

It has one (at the moment fatal) flaw: If a file is closed
while async requests are still on the fly, the pread/pwrite
might end up on the wrong file. Two ways out: Hold back the
close SMB until all async requests are finished, or put the
os-level fd on the pending close queue until all the async
requests are finished. I tend to implement the latter.



SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen, mailto:kontakt at

More information about the samba-technical mailing list