From 861abdadf9db4dd7ba577537ba262fcda29869dd Mon Sep 17 00:00:00 2001 From: Dmitry Chagin Date: Tue, 13 Jun 2023 15:22:09 +0300 Subject: [PATCH] namei: Add a comment explaining ISRESTARTED flag Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D40494 --- sys/kern/vfs_lookup.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index c813296b493..20919fb38b4 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -81,6 +81,11 @@ static void NDVALIDATE_impl(struct nameidata *, int); #define NDVALIDATE(ndp) #endif +/* + * Prepare namei() to restart. Reset components to its original state and set + * ISRESTARTED flag which signals the underlying lookup code to change the root + * from ABI root to actual root and prevents a further restarts. + */ #define NDRESTART(ndp) do { \ NDREINIT_DBG(ndp); \ ndp->ni_resflags = 0; \