git: c55c6dd6767c - main - emulators/open-vm-tools: fix build after 2587b74c6187 removed NDF_ONLY_PNBUF

From: Dimitry Andric <dim_at_FreeBSD.org>
Date: Mon, 04 Apr 2022 17:58:09 UTC
The branch main has been updated by dim (src committer):

URL: https://cgit.FreeBSD.org/ports/commit/?id=c55c6dd6767ceaf37b3d69cff84d1b859e33d30e

commit c55c6dd6767ceaf37b3d69cff84d1b859e33d30e
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2022-04-04 15:21:54 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2022-04-04 17:54:55 +0000

    emulators/open-vm-tools: fix build after 2587b74c6187 removed NDF_ONLY_PNBUF
    
    After base commit 2587b74c6187, which removed NDF_ONLY_PNBUF,
    emulators/open-vm-tools fails to build, with:
    
    --- vfsops.o ---
    vfsops.c:190:16: error: use of undeclared identifier 'NDF_ONLY_PNBUF'; did you mean 'NDFREE_PNBUF'?
       NDFREE(ndp, NDF_ONLY_PNBUF);
                   ^~~~~~~~~~~~~~
                   NDFREE_PNBUF
    /usr/src/sys/sys/namei.h:291:6: note: 'NDFREE_PNBUF' declared here
    void NDFREE_PNBUF(struct nameidata *);
         ^
    
    Indeed, NDFREE_PNBUF() should now be used.
    
    PR:             263041
    Approved by:    garga (maintainer)
    MFH:            2022Q2
---
 .../files/patch-modules_freebsd_vmblock_vfsops.c          | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/emulators/open-vm-tools/files/patch-modules_freebsd_vmblock_vfsops.c b/emulators/open-vm-tools/files/patch-modules_freebsd_vmblock_vfsops.c
index 1b05ca6c1e9c..64629219c5fa 100644
--- a/emulators/open-vm-tools/files/patch-modules_freebsd_vmblock_vfsops.c
+++ b/emulators/open-vm-tools/files/patch-modules_freebsd_vmblock_vfsops.c
@@ -12,7 +12,7 @@
     VMBLOCKDEBUG("VMBlockVFSMount(mp = %p)\n", (void *)mp);
  
     /*
-@@ -171,7 +176,11 @@ VMBlockVFSMount(struct mount *mp,        // IN: mount(
+@@ -171,14 +176,22 @@ VMBlockVFSMount(struct mount *mp,        // IN: mount(
      * Find lower node and lock if not already locked.
      */
  
@@ -24,7 +24,18 @@
     error = namei(ndp);
     if (error) {
        NDFREE(ndp, 0);
-@@ -276,6 +285,11 @@ VMBlockVFSUnmount(struct mount *mp,    // IN: filesyst
+       uma_zfree(VMBlockPathnameZone, pathname);
+       return error;
+    }
++#ifdef NDF_ONLY_PNBUF
+    NDFREE(ndp, NDF_ONLY_PNBUF);
++#else
++   NDFREE_PNBUF(ndp);
++#endif
+ 
+    /*
+     * Check multi VMBlock mount to avoid `lock against myself' panic.
+@@ -276,6 +289,11 @@ VMBlockVFSUnmount(struct mount *mp,    // IN: filesyst
     void *mntdata;
     int error;
     int flags = 0, removed = 0;