Support GPFS prealloc interface
authorAlexander Bokovoy <ab@samba.org>
Wed, 16 Jan 2008 09:19:51 +0000 (12:19 +0300)
committerAlexander Bokovoy <ab@samba.org>
Wed, 16 Jan 2008 09:19:51 +0000 (12:19 +0300)
Signed-off-by: Alexander Bokovoy <ab@samba.org>(This used to be commit c26e355533e473c4386d0e6d651637e71d4231dc)
source3/modules/vfs_prealloc.c

index 2d64bc0184ded75357642f30c1881eb52e983fe4..cb3508dc30f7dd291759c34854fb932cb764122a 100644 (file)
 #define lock_type struct flock64
 #endif
 
+#ifdef HAVE_GPFS
+#include "gpfs_gpl.h"
+#endif
+
 #define MODULE "prealloc"
 static int module_debug;
 
 static int preallocate_space(int fd, SMB_OFF_T size)
 {
+#ifndef HAVE_GPFS
        lock_type fl = {0};
        int err;
 
@@ -78,6 +83,9 @@ static int preallocate_space(int fd, SMB_OFF_T size)
        err = -1;
        errno = ENOSYS;
 #endif
+#else /* GPFS uses completely different interface */
+       err = gpfs_prealloc(fd, (gpfs_off64_t)0, (gpfs_off64_t)size);
+#endif
 
        if (err) {
                DEBUG(module_debug,