From 67f2eebb44e1f27017750eddaf5a5ea513cb9c71 Mon Sep 17 00:00:00 2001 From: mjg Date: Wed, 10 Jun 2015 10:43:59 +0000 Subject: Generalised support for copy-on-write structures shared by threads. Thread credentials are maintained as follows: each thread has a pointer to creds and a reference on them. The pointer is compared with proc's creds on userspace<->kernel boundary and updated if needed. This patch introduces a counter which can be compared instead, so that more structures can use this scheme without adding more comparisons on the boundary. --- sys/kern/subr_syscall.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/kern/subr_syscall.c') diff --git a/sys/kern/subr_syscall.c b/sys/kern/subr_syscall.c index 1bf78b8..070ba28 100644 --- a/sys/kern/subr_syscall.c +++ b/sys/kern/subr_syscall.c @@ -61,8 +61,8 @@ syscallenter(struct thread *td, struct syscall_args *sa) p = td->td_proc; td->td_pticks = 0; - if (td->td_ucred != p->p_ucred) - cred_update_thread(td); + if (td->td_cowgen != p->p_cowgen) + thread_cow_update(td); if (p->p_flag & P_TRACED) { traced = 1; PROC_LOCK(p); -- cgit v1.1