Date: Mon, 18 May 2020 09:25:23 +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-12@freebsd.org Subject: svn commit: r361196 - stable/12/sys/compat/linuxkpi/common/include/linux Message-ID: <202005180925.04I9PNu0064846@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: hselasky Date: Mon May 18 09:25:23 2020 New Revision: 361196 URL: https://svnweb.freebsd.org/changeset/base/361196 Log: MFC r360531: Implement mutex_lock_killable() in the LinuxKPI. Submitted by: ashafer_badland.io (Austin Shafer) Sponsored by: Mellanox Technologies Modified: stable/12/sys/compat/linuxkpi/common/include/linux/mutex.h Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/compat/linuxkpi/common/include/linux/mutex.h ============================================================================== --- stable/12/sys/compat/linuxkpi/common/include/linux/mutex.h Mon May 18 09:24:36 2020 (r361195) +++ stable/12/sys/compat/linuxkpi/common/include/linux/mutex.h Mon May 18 09:25:23 2020 (r361196) @@ -66,6 +66,18 @@ typedef struct mutex { linux_mutex_lock_interruptible(_m); \ }) +/* + * Reuse the interruptable method since the SX + * lock handles both signals and interrupts: + */ +#define mutex_lock_killable(_m) ({ \ + MUTEX_SKIP() ? 0 : \ + linux_mutex_lock_interruptible(_m); \ +}) + +#define mutex_lock_killable_nested(_m, _sub) \ + mutex_lock_killable(_m) + #define mutex_unlock(_m) do { \ if (MUTEX_SKIP()) \ break; \
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202005180925.04I9PNu0064846>