svn commit: r362829 - head/sys/compat/linuxkpi/common/src

Konstantin Belousov kostikbel at gmail.com
Wed Jul 1 12:03:58 UTC 2020


On Wed, Jul 01, 2020 at 12:56:12PM +0200, Hans Petter Selasky wrote:
> On 2020-07-01 12:30, Konstantin Belousov wrote:
> > I see no point in repeating the same pfind/tdfind calls, better to convert
> > them to pget(), and have this code in one intended place.
> 
> I wonder if we can convert all cases in linux_current.c to use pget(). Could
> you have a look too?

Other uses in linux_current.c are not suitable for pget().  In case
linux_pid_task()/linux_get_pid_task() were passed a tid instead of pid,
current code returns lkpi_task for the specified thread.  In other words,
if using pget(), we would need to find the thread after the call, which
makes no sense.

On the other hand, there are at least two aspects that can be improved.
First, the functions are too similar to require separating body.  Second,
distinction between pid and tid is static and if we are passed pid, it
makes no sense to call tdfind() on it.

https://reviews.freebsd.org/D25534


More information about the svn-src-all mailing list