The branch stable/13 has been updated by kib:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=893aecc35acc603ba9ca00addefd6c6ead9f403c

commit 893aecc35acc603ba9ca00addefd6c6ead9f403c
Author:     Konstantin Belousov <[email protected]>
AuthorDate: 2021-06-14 19:03:41 +0000
Commit:     Konstantin Belousov <[email protected]>
CommitDate: 2021-07-07 10:23:25 +0000

    namei: add NDPREINIT() macro
    
    (cherry picked from commit 802cf4ab0ee9cae7af523cfcf1221febd2143210)
---
 sys/kern/vfs_syscalls.c | 9 +++++++++
 sys/sys/namei.h         | 3 +++
 2 files changed, 12 insertions(+)

diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c
index c18bb56fc632..7f2f3480a5af 100644
--- a/sys/kern/vfs_syscalls.c
+++ b/sys/kern/vfs_syscalls.c
@@ -1329,6 +1329,7 @@ kern_mknodat(struct thread *td, int fd, const char *path, 
enum uio_seg pathseg,
        }
        if (error != 0)
                return (error);
+       NDPREINIT(&nd);
 restart:
        bwillwrite();
        NDINIT_ATRIGHTS(&nd, CREATE, LOCKPARENT | SAVENAME | AUDITVNODE1 |
@@ -1437,6 +1438,7 @@ kern_mkfifoat(struct thread *td, int fd, const char *path,
        int error;
 
        AUDIT_ARG_MODE(mode);
+       NDPREINIT(&nd);
 restart:
        bwillwrite();
        NDINIT_ATRIGHTS(&nd, CREATE, LOCKPARENT | SAVENAME | AUDITVNODE1 |
@@ -1568,6 +1570,7 @@ kern_linkat(struct thread *td, int fd1, int fd2, const 
char *path1,
        struct nameidata nd;
        int error;
 
+       NDPREINIT(&nd);
        do {
                bwillwrite();
                NDINIT_ATRIGHTS(&nd, LOOKUP, follow | AUDITVNODE1, segflag,
@@ -1715,6 +1718,7 @@ kern_symlinkat(struct thread *td, const char *path1, int 
fd, const char *path2,
                syspath = tmppath;
        }
        AUDIT_ARG_TEXT(syspath);
+       NDPREINIT(&nd);
 restart:
        bwillwrite();
        NDINIT_ATRIGHTS(&nd, CREATE, LOCKPARENT | SAVENAME | AUDITVNODE1 |
@@ -1779,6 +1783,7 @@ sys_undelete(struct thread *td, struct undelete_args *uap)
        struct nameidata nd;
        int error;
 
+       NDPREINIT(&nd);
 restart:
        bwillwrite();
        NDINIT(&nd, DELETE, LOCKPARENT | DOWHITEOUT | AUDITVNODE1,
@@ -1892,6 +1897,7 @@ kern_funlinkat(struct thread *td, int dfd, const char 
*path, int fd,
                        return (error);
        }
 
+       NDPREINIT(&nd);
 restart:
        bwillwrite();
        NDINIT_ATRIGHTS(&nd, DELETE, LOCKPARENT | LOCKLEAF | AUDITVNODE1 |
@@ -3423,6 +3429,7 @@ kern_truncate(struct thread *td, const char *path, enum 
uio_seg pathseg,
 
        if (length < 0)
                return (EINVAL);
+       NDPREINIT(&nd);
 retry:
        NDINIT(&nd, LOOKUP, FOLLOW | AUDITVNODE1, pathseg, path, td);
        if ((error = namei(&nd)) != 0)
@@ -3790,6 +3797,7 @@ kern_mkdirat(struct thread *td, int fd, const char *path, 
enum uio_seg segflg,
        int error;
 
        AUDIT_ARG_MODE(mode);
+       NDPREINIT(&nd);
 restart:
        bwillwrite();
        NDINIT_ATRIGHTS(&nd, CREATE, LOCKPARENT | SAVENAME | AUDITVNODE1 |
@@ -3860,6 +3868,7 @@ kern_frmdirat(struct thread *td, int dfd, const char 
*path, int fd,
                        return (error);
        }
 
+       NDPREINIT(&nd);
 restart:
        bwillwrite();
        NDINIT_ATRIGHTS(&nd, DELETE, LOCKPARENT | LOCKLEAF | AUDITVNODE1 |
diff --git a/sys/sys/namei.h b/sys/sys/namei.h
index 5f3d917083a5..b4db0e758e2b 100644
--- a/sys/sys/namei.h
+++ b/sys/sys/namei.h
@@ -265,6 +265,9 @@ do {                                                        
                        \
        _ndp->ni_startdir = NULL;                                               
\
 } while (0)
 
+#define        NDPREINIT(ndp) do {                                             
        \
+} while (0)
+
 #define NDF_NO_DVP_RELE                0x00000001
 #define NDF_NO_DVP_UNLOCK      0x00000002
 #define NDF_NO_DVP_PUT         0x00000003
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to