From: J. Bruce Fields Date: Sat, 9 Jan 2010 17:22:17 +0000 (-0700) Subject: mountd: minor optimization in v4root_set X-Git-Tag: nfs-utils-1-2-2-rc6~4 X-Git-Url: https://git.decadent.org.uk/gitweb/?p=nfs-utils.git;a=commitdiff_plain;h=37d9e4f9e0d1aeeb296583e40a36ae729786230d mountd: minor optimization in v4root_set Since we're adding new exports as we traverse the export list, it's possible we may find ourselves revisiting an export we just added. It's harmless to reprocess those exports, as we're currently doing. But it's also pointless. (Actually, the current code appears to always add new export entries at the head of each list, so we shouldn't hit this case. It still may be a good idea to keep this check, though, as insulation against future changes to that data structure.) Signed-off-by: J. Bruce Fields --- diff --git a/utils/mountd/v4root.c b/utils/mountd/v4root.c index d890181..b0a10c8 100644 --- a/utils/mountd/v4root.c +++ b/utils/mountd/v4root.c @@ -162,6 +162,13 @@ v4root_set() nxt = exp->m_next; hostname = exp->m_export.e_hostname; + if (exp->m_export.e_flags & NFSEXP_V4ROOT) + /* + * We just added this one, so its + * parents are already dealt with! + */ + continue; + path = strdup(exp->m_export.e_path); for (ptr = path + 1; ptr; ptr = strchr(ptr, '/')) { int ret;