[CRIU] [PATCH] vdso: Add vdso_put_mark helper
Cyrill Gorcunov
gorcunov at openvz.org
Fri May 24 07:05:24 EDT 2013
Instead of opencoded mark injection provide
a helper for easier grepability.
Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
arch/x86/vdso-pie.c | 6 +-----
include/vdso.h | 8 ++++++++
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/arch/x86/vdso-pie.c b/arch/x86/vdso-pie.c
index ed76074..6ec2247 100644
--- a/arch/x86/vdso-pie.c
+++ b/arch/x86/vdso-pie.c
@@ -246,7 +246,6 @@ int vdso_proxify(char *who, struct vdso_symtable *sym_rt, VmaEntry *vma, unsigne
struct vdso_symtable s = VDSO_SYMTABLE_INIT;
size_t size = vma_entry_len(vma);
bool remap_rt = true;
- struct vdso_mark *m;
/*
* Find symbols in dumpee vdso.
@@ -301,9 +300,6 @@ int vdso_proxify(char *who, struct vdso_symtable *sym_rt, VmaEntry *vma, unsigne
* routine we could detect this vdso and do not dump it, since
* it's auto-generated every new session if proxy required.
*/
- m = (void *)vdso_rt_parked_at;
- INIT_VDSO_MARK(m);
- m->proxy_addr = vma->start;
-
+ vdso_put_mark((void *)vdso_rt_parked_at, vma->start);
return 0;
}
diff --git a/include/vdso.h b/include/vdso.h
index 88ef713..dbe9a1d 100644
--- a/include/vdso.h
+++ b/include/vdso.h
@@ -107,6 +107,14 @@ static inline bool is_vdso_mark(void *addr)
m->proxy_addr != VDSO_BAD_ADDR;
}
+static inline void vdso_put_mark(void *where, unsigned long proxy_addr)
+{
+ struct vdso_mark *m = where;
+
+ INIT_VDSO_MARK(m);
+ m->proxy_addr = proxy_addr;
+}
+
extern struct vdso_symtable vdso_sym_rt;
extern u64 vdso_pfn;
extern int vdso_init(void);
--
1.8.1.4
More information about the CRIU
mailing list