[03/12] kdat: Config option for iptables xtlocks

Submitted by Pavel Emelianov on April 24, 2017, 8:07 p.m.

Details

Message ID 58FE5AF5.6040701@virtuozzo.com
State New
Series "Speed up kdat checks"
Headers show

Commit Message

Pavel Emelianov April 24, 2017, 8:07 p.m.
Whether or not iptables accepts the -w option can be in
distro case found out compile time. So there's no strict
need to do auto detection on each criu launch.

Default build (with empty config) produces code with
auto-detection.

Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
---
 criu/kerndat.c | 9 +++++++++
 1 file changed, 9 insertions(+)

Patch hide | download patch | download mbox

diff --git a/criu/kerndat.c b/criu/kerndat.c
index 951b09a..b291682 100644
--- a/criu/kerndat.c
+++ b/criu/kerndat.c
@@ -484,6 +484,14 @@  static int kerndat_loginuid(bool for_restore)
 	return ret;
 }
 
+#ifdef CONFIG_IPTABLES_HAS_XTLOCKS
+static inline int kerndat_iptables_has_xtlocks(void)
+{
+	kdat.has_xtlocks = CONFIG_IPTABLES_HAS_XTLOCKS;
+	pr_info("Iptables xtlocks forced to %d\n", CONFIG_IPTABLES_HAS_XTLOCKS);
+	return 0;
+}
+#else
 static int kerndat_iptables_has_xtlocks(void)
 {
 	int fd;
@@ -502,6 +510,7 @@  static int kerndat_iptables_has_xtlocks(void)
 	close_safe(&fd);
 	return 0;
 }
+#endif
 
 int kerndat_tcp_half_closed(void)
 {