[Dovecot] AIX: mntctl implementation for NFS quota support

Timo Sirainen tss at iki.fi
Sat Jul 5 23:04:03 EEST 2008


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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 194 bytes
Desc: This is a digitally signed message part
Url : http://dovecot.org/pipermail/dovecot/attachments/20080706/e2389178/attachment.bin 


More information about the dovecot mailing list