BBlack has submitted this change and it was merged.

Change subject: add fallocate patch
......................................................................


add fallocate patch

Change-Id: Ibc1737a98dd49a6699346b223c19d8d520857f31
---
A debian/patches/0010-varnishd-persistent-fallocate.patch
M debian/patches/series
2 files changed, 39 insertions(+), 0 deletions(-)

Approvals:
  BBlack: Verified; Looks good to me, approved
  jenkins-bot: Verified



diff --git a/debian/patches/0010-varnishd-persistent-fallocate.patch 
b/debian/patches/0010-varnishd-persistent-fallocate.patch
new file mode 100644
index 0000000..6fc06f6
--- /dev/null
+++ b/debian/patches/0010-varnishd-persistent-fallocate.patch
@@ -0,0 +1,38 @@
+diff --git a/bin/varnishd/storage_persistent_mgt.c 
b/bin/varnishd/storage_persistent_mgt.c
+index ff10973..6b714b3 100644
+--- a/bin/varnishd/storage_persistent_mgt.c
++++ b/bin/varnishd/storage_persistent_mgt.c
+@@ -39,6 +39,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <sys/mman.h>
++#include <fcntl.h>
+ 
+ #include "cache.h"
+ #include "stevedore.h"
+@@ -160,6 +161,13 @@ smp_mgt_init(struct stevedore *parent, int ac, char * 
const *av)
+ 
+       AZ(ftruncate(sc->fd, sc->mediasize));
+ 
++#ifdef HAVE_POSIX_FALLOCATE
++      const int pfa_err = posix_fallocate(sc->fd, 0, sc->mediasize);
++      if(pfa_err)
++              ARGV_ERR("(-spersistent): fallocate() for %s failed: %s",
++                      sc->filename, strerror(pfa_err));
++#endif
++
+       /* Try to determine correct mmap address */
+       i = read(sc->fd, &sgn, sizeof sgn);
+       assert(i == sizeof sgn);
+diff --git a/configure.ac b/configure.ac
+index 306cf24..f550b91 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -199,6 +199,7 @@ AC_CHECK_FUNCS([abort2])
+ AC_CHECK_FUNCS([timegm])
+ AC_CHECK_FUNCS([nanosleep])
+ AC_CHECK_FUNCS([setppriv])
++AC_CHECK_FUNCS([posix_fallocate])
+ 
+ save_LIBS="${LIBS}"
+ LIBS="${PTHREAD_LIBS}"
diff --git a/debian/patches/series b/debian/patches/series
index 1aa802c..96a8115 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -5,6 +5,7 @@
 0010-varnishd-persistent-mmap-exit.patch
 0010-varnishd-cachehitmiss-ignore-purge.patch
 0010-libvmod_std-collect.patch
+0010-varnishd-persistent-fallocate.patch
 0020-filter-headers.patch
 0098-libvmod-netmapper-src.patch
 0099-libvmod-netmapper-ac.patch

-- 
To view, visit https://gerrit.wikimedia.org/r/105903
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ibc1737a98dd49a6699346b223c19d8d520857f31
Gerrit-PatchSet: 1
Gerrit-Project: operations/debs/varnish
Gerrit-Branch: 3.0.5-plus-wm
Gerrit-Owner: BBlack <bbl...@wikimedia.org>
Gerrit-Reviewer: BBlack <bbl...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to