Date: Fri, 5 Apr 2019 11:19:24 +0000 (UTC) From: Hans Petter Selasky <hselasky@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r345924 - in stable/11/sys/compat/linuxkpi/common: include/linux src Message-ID: <201904051119.x35BJOXN002310@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: hselasky Date: Fri Apr 5 11:19:23 2019 New Revision: 345924 URL: https://svnweb.freebsd.org/changeset/base/345924 Log: MFC r345098: Implement current_exiting() in the LinuxKPI. Submitted by: Johannes Lundberg <johalun0@gmail.com> Sponsored by: Limelight Networks Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/sched.h stable/11/sys/compat/linuxkpi/common/src/linux_current.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/sched.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/sched.h Fri Apr 5 11:19:07 2019 (r345923) +++ stable/11/sys/compat/linuxkpi/common/include/linux/sched.h Fri Apr 5 11:19:23 2019 (r345924) @@ -143,6 +143,11 @@ linux_schedule_save_interrupt_value(struct task_struct task->bsd_interrupt_value = value; } +bool linux_task_exiting(struct task_struct *task); + +#define current_exiting() \ + linux_task_exiting(current) + static inline int linux_schedule_get_interrupt_value(struct task_struct *task) { Modified: stable/11/sys/compat/linuxkpi/common/src/linux_current.c ============================================================================== --- stable/11/sys/compat/linuxkpi/common/src/linux_current.c Fri Apr 5 11:19:07 2019 (r345923) +++ stable/11/sys/compat/linuxkpi/common/src/linux_current.c Fri Apr 5 11:19:23 2019 (r345924) @@ -215,6 +215,22 @@ linux_get_pid_task(pid_t pid) return (NULL); } +bool +linux_task_exiting(struct task_struct *task) +{ + struct proc *p; + bool ret; + + ret = false; + p = pfind(task->pid); + if (p != NULL) { + if ((p->p_flag & P_WEXIT) != 0) + ret = true; + PROC_UNLOCK(p); + } + return (ret); +} + static void linux_current_init(void *arg __unused) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201904051119.x35BJOXN002310>