]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Fixes for refcounting "struct linux_file" in the LinuxKPI.
authorhselasky <hselasky@FreeBSD.org>
Wed, 31 May 2017 12:02:59 +0000 (12:02 +0000)
committerhselasky <hselasky@FreeBSD.org>
Wed, 31 May 2017 12:02:59 +0000 (12:02 +0000)
commitf87686da6d3de891808228991d0b50cdf604f1c6
treee2ce657d016eccd00f71348b6772c28f49d74b9d
parentb7e7cccc2ecc8f376470a3d54d4770410bb8c628
Fixes for refcounting "struct linux_file" in the LinuxKPI.

- Allow "struct linux_file" to be refcounted when its "_file" member
  is NULL by using its "f_count" field. The reference counts are
  transferred to the file structure when the file descriptor is
  installed.

- Add missing vdrop() calls for error cases during open().

- Set the "_file" member of "struct linux_file" during open. This
allows use of refcounting through get_file() and fput() with LinuxKPI
character devices.

MFC after: 1 week
Sponsored by: Mellanox Technologies
sys/compat/linuxkpi/common/include/linux/file.h
sys/compat/linuxkpi/common/include/linux/fs.h
sys/compat/linuxkpi/common/src/linux_compat.c