HomeFreeBSD

Add kf_file_nlink field to kf_file and populate it

Description

Add kf_file_nlink field to kf_file and populate it

This will allow user-space programs (e.g. lsof) to locate deleted files
whose nlink equals zero. Prior to this commit, programs has to use
stat(kf_path) to get nlink, but that will fail if the file is deleted.

[mjg: s/fail/file in the commit message]

Reviewed by: mjg
Differential Revision: https://reviews.freebsd.org/D38169

(cherry picked from commit dec7db49602df75119f6b57d32f1eb58e0040abc)

Details

Provenance
c_jia.jeAuthored on Jan 23 2023, 4:36 PM
mjgCommitted on Jan 29 2023, 2:37 PM
Reviewer
mjg
Differential Revision
D38169: Add kf_file_nlink field to kf_file and populate it
Parents
rG3c37c1ea1989: netpfil tests: improve pfsync_defer.py
Branches
Unknown
Tags
Unknown