[09/12] kdat: Config for lastcap

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

Details

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

Commit Message

Pavel Emelianov April 24, 2017, 8:08 p.m.
The last-cap value is a kernel constant that can be specified
once during criu compilation.

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

Patch hide | download patch | download mbox

diff --git a/criu/kerndat.c b/criu/kerndat.c
index 90fca22..e8f955f 100644
--- a/criu/kerndat.c
+++ b/criu/kerndat.c
@@ -360,6 +360,13 @@  static int init_zero_page_pfn()
 	return ret;
 }
 
+#ifdef CONFIG_KERNEL_LASTCAP
+static inline int get_last_cap(void)
+{
+	kdat.last_cap = CONFIG_KERNEL_LASTCAP;
+	return 0;
+}
+#else
 static int get_last_cap(void)
 {
 	struct sysctl_req req[] = {
@@ -368,6 +375,7 @@  static int get_last_cap(void)
 
 	return sysctl_op(req, ARRAY_SIZE(req), CTL_READ, 0);
 }
+#endif
 
 static bool kerndat_has_memfd_create(void)
 {