kcmp: In kcmp_epoll_target use fget_task
authorEric W. Biederman <ebiederm@xmission.com>
Fri, 20 Nov 2020 23:14:21 +0000 (17:14 -0600)
committerEric W. Biederman <ebiederm@xmission.com>
Thu, 10 Dec 2020 18:39:40 +0000 (12:39 -0600)
commitf43c283a89a7dc531a47d4b1e001503cf3dc3234
tree4cd07b236726827c958bfe2e67bf9f2dd2194fd3
parent950db38ff2c01b7aabbd7ab4a50b7992750fa63d
kcmp: In kcmp_epoll_target use fget_task

Use the helper fget_task and simplify the code.

As well as simplifying the code this removes one unnecessary increment of
struct files_struct.  This unnecessary increment of files_struct.count can
result in exec unnecessarily unsharing files_struct and breaking posix
locks, and it can result in fget_light having to fallback to fget reducing
performance.

Suggested-by: Oleg Nesterov <oleg@redhat.com>
Reviewed-by: Cyrill Gorcunov <gorcunov@gmail.com>
v1: https://lkml.kernel.org/r/20200817220425.9389-4-ebiederm@xmission.com
Link: https://lkml.kernel.org/r/20201120231441.29911-4-ebiederm@xmission.com
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
kernel/kcmp.c