git: b73e978d7d17 - stable/13 - pseudofs: Simplify pfs_visible_proc
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 29 Jun 2023 08:20:00 UTC
The branch stable/13 has been updated by dchagin: URL: https://cgit.FreeBSD.org/src/commit/?id=b73e978d7d17c8e7c995d631c722c654b12df1cd commit b73e978d7d17c8e7c995d631c722c654b12df1cd Author: Dmitry Chagin <dchagin@FreeBSD.org> AuthorDate: 2023-04-02 08:24:10 +0000 Commit: Dmitry Chagin <dchagin@FreeBSD.org> CommitDate: 2023-06-29 08:15:17 +0000 pseudofs: Simplify pfs_visible_proc Reviewed by: des Differential revision: https://reviews.freebsd.org/D39383 MFC after: 1 month (cherry picked from commit a32ed5ec05d9bc01b8e70b45ff510d2f972a0877) --- sys/fs/pseudofs/pseudofs_vnops.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/sys/fs/pseudofs/pseudofs_vnops.c b/sys/fs/pseudofs/pseudofs_vnops.c index f58b1f8bdc47..e0c795ed2a25 100644 --- a/sys/fs/pseudofs/pseudofs_vnops.c +++ b/sys/fs/pseudofs/pseudofs_vnops.c @@ -90,21 +90,17 @@ pn_fileno(struct pfs_node *pn, pid_t pid) static int pfs_visible_proc(struct thread *td, struct pfs_node *pn, struct proc *proc) { - int visible; if (proc == NULL) return (0); PROC_LOCK_ASSERT(proc, MA_OWNED); - visible = ((proc->p_flag & P_WEXIT) == 0); - if (visible) - visible = (p_cansee(td, proc) == 0); - if (visible && pn->pn_vis != NULL) - visible = pn_vis(td, proc, pn); - if (!visible) + if ((proc->p_flag & P_WEXIT) != 0) return (0); - return (1); + if (p_cansee(td, proc) != 0) + return (0); + return (pn_vis(td, proc, pn)); } static int