为什么 posix 线程 id 在 Linux 内核函数 filp_close 中可以为 NULL?

Why can the posix thread id be NULL in Linux kernel function filp_close?

以下摘自linux内核:

/*
 * "id" is the POSIX thread ID. We use the
 * files pointer for this..
 */
int filp_close(struct file *filp, fl_owner_t id)

文档说id是posix线程id,应该是current->files.

然而,我在 Linux 内核中发现了很多用法,例如acct_on,用作filp_close(filp, NULL)

我的问题是:

为什么调用filp_close时可以接受NULL?

争论的目的是什么id

根据此 discussionfl_owner_t 的正式描述将是

A generic "file lock owner" value. This is set differently for different 
types of locks. 

The POSIX file lock owner is determined by the "struct files_struct" in the 
thread group. 

Flock (BSD) locks, OFD locks and leases set the fl_owner to the 
file description pointer. 

但实际上这是不透明指针

legacy typedef, should eventually go away

指的是进程文件描述符table (struct files_struct).

至于filp_close函数,只有fs/file.c源使用非NULL id参数。所有其他用户手动创建 filp(使用 filp_openfile_open_name)并将 id 作为 NULL 传递。