[Dovecot] AIX: mntctl implementation for NFS quota support

Ralf Becker beckerr at fh-trier.de
Sun Jul 6 19:41:05 EEST 2008


Hi Timo,

I've added support for a static mtab buffer.

Unfortunately 256 Bytes are too small by far. In my case the required 
space is about 3 KByte. To avoid unnecessary memory allocation the 
static size is determined at configuration time by getting the current 
buffer size and adding space for about 5 mountpoints more. In addition 
'configure' now checks for sys/vmount.h

Regards, Ralf

Timo Sirainen schrieb am 05.07.2008 22:04:
> On Jul 5, 2008, at 10:39 PM, Ralf Becker wrote:
> 
>> I've added mntctl support to 'lib/mountpoint.c' today. My tests are 
>> looking good and so I'd like to share the patch.
>> While I'm still not really familiar with dovecots memory management, I 
>> need someone who is familiar with it to have a look on my lines of 
>> code. Especially the usage or p_new, t_strconcat and p_free should be 
>> checked. :-)
> 
> I'd probably change the allocations a bit to avoid extra syscalls. 
> Something like:
> 
> // guess that 256 bytes is enough usually. use larger value if it's not.
> char mtab_static[256], *mtab = mtab_static;
> 
> count = mntctl(..);
> while (count == 0) {
>   mtab = t_malloc(size);
>   count = mntctl(..);
> }
> if (count < 0) {
>   i_error("mntctl() failed: %m");
>   return -1;
> }
> ..etc..
> 
> Also change to HAVE_SYS_VMOUNT_H.
> 
>> To activate the patch you have to add "#define HAVE_VMOUNT_H 1" do 
>> 'config.h'. Maybe someone wants to alter configure* to do this 
>> automatically?
> 
> Just add sys/vmount.h to AC_CHECK_HEADERS() list.

-- 
______________________________________________________________________

  Dipl.-Inform. (FH) Ralf Becker     Rechenzentrum (r/ft) der FH Trier
  (Network|Mail|Web|Firewall)           University of applied sciences
  Administrator                           Schneidershof, D-54293 Trier

    Mail: beckerr at fh-trier.de                    Fon: +49 651 8103 499
     Web: http://www.fh-trier.de/~beckerr        Fax: +49 651 8103 214
  PubKey: http://www.fh-trier.de/~beckerr     Crypto: GnuPG, S/MIME
______________________________________________________________________

  Wenn Gott gewollt haette, dass E-Mail in HTML geschrieben wuerden,
  endeten Gebete traditionell mit </amen>. (Tom Listen)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dovecot-aix-mntctl.patch.gz
Type: application/octet-stream
Size: 1689 bytes
Desc: not available
Url : http://dovecot.org/pipermail/dovecot/attachments/20080706/beaf63e9/attachment.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 6074 bytes
Desc: S/MIME Cryptographic Signature
Url : http://dovecot.org/pipermail/dovecot/attachments/20080706/beaf63e9/attachment.bin 


More information about the dovecot mailing list