git: a32ed5ec05d9 - main - pseudofs: Simplify pfs_visible_proc
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 02 Apr 2023 08:24:30 UTC
The branch main has been updated by dchagin:
URL: https://cgit.FreeBSD.org/src/commit/?id=a32ed5ec05d9bc01b8e70b45ff510d2f972a0877
commit a32ed5ec05d9bc01b8e70b45ff510d2f972a0877
Author: Dmitry Chagin <dchagin@FreeBSD.org>
AuthorDate: 2023-04-02 08:24:10 +0000
Commit: Dmitry Chagin <dchagin@FreeBSD.org>
CommitDate: 2023-04-02 08:24:10 +0000
pseudofs: Simplify pfs_visible_proc
Reviewed by: des
Differential revision: https://reviews.freebsd.org/D39383
MFC after: 1 month
---
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 96c59d7c023d..53e4c2b6b85c 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