Module Name: src Committed By: dholland Date: Mon Apr 18 00:45:07 UTC 2011
Modified Files: src/sys/kern: vfs_lookup.c Log Message: Goto considered harmful; remove dirloop: in favor of using a loop continue. This runs the "are we mounted?" test on every directory instead of only sometimes; however, it's not exactly an expensive test (null pointer check) and the prior logic wasn't exactly sensible -- it checked at the beginning and after following a symlink but, for some reason, not after crossing a mount point. To generate a diff of this commit: cvs rdiff -u -r1.176 -r1.177 src/sys/kern/vfs_lookup.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/kern/vfs_lookup.c diff -u src/sys/kern/vfs_lookup.c:1.176 src/sys/kern/vfs_lookup.c:1.177 --- src/sys/kern/vfs_lookup.c:1.176 Mon Apr 18 00:40:53 2011 +++ src/sys/kern/vfs_lookup.c Mon Apr 18 00:45:07 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: vfs_lookup.c,v 1.176 2011/04/18 00:40:53 dholland Exp $ */ +/* $NetBSD: vfs_lookup.c,v 1.177 2011/04/18 00:45:07 dholland Exp $ */ /* * Copyright (c) 1982, 1986, 1989, 1993 @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: vfs_lookup.c,v 1.176 2011/04/18 00:40:53 dholland Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vfs_lookup.c,v 1.177 2011/04/18 00:45:07 dholland Exp $"); #include "opt_magiclinks.h" @@ -1118,7 +1118,6 @@ * (currently, this may consume more than one) */ - dirloop: /* * If we have a leading string of slashes, remove * them, and just make sure the current node is a @@ -1259,7 +1258,7 @@ } searchdir = foundobj; foundobj = NULL; - goto dirloop; + continue; } terminal: