diff options
author | Mateusz Guzik <mjg@FreeBSD.org> | 2022-09-17 09:10:38 +0000 |
---|---|---|
committer | Mateusz Guzik <mjg@FreeBSD.org> | 2022-09-17 09:10:38 +0000 |
commit | 5b5b7e2ca2fa9a2418dd51749f4ef6f881ae7179 (patch) | |
tree | 8eb9e4815891effd93c3fdcae47710afbce899b9 /sys/ufs | |
parent | 3df3d88cc5e291e106696c5a7734dc6640693a4a (diff) | |
download | src-5b5b7e2ca2fa9a2418dd51749f4ef6f881ae7179.tar.gz src-5b5b7e2ca2fa9a2418dd51749f4ef6f881ae7179.zip |
vfs: always retain path buffer after lookup
This removes some of the complexity needed to maintain HASBUF and
allows for removing injecting SAVENAME by filesystems.
Reviewed by: kib (previous version)
Differential Revision: https://reviews.freebsd.org/D36542
Diffstat (limited to 'sys/ufs')
-rw-r--r-- | sys/ufs/ufs/ufs_lookup.c | 6 | ||||
-rw-r--r-- | sys/ufs/ufs/ufs_vnops.c | 20 |
2 files changed, 0 insertions, 26 deletions
diff --git a/sys/ufs/ufs/ufs_lookup.c b/sys/ufs/ufs/ufs_lookup.c index 9c6e95687f85..4c390f4c42ef 100644 --- a/sys/ufs/ufs/ufs_lookup.c +++ b/sys/ufs/ufs/ufs_lookup.c @@ -524,13 +524,10 @@ notfound: * We return ni_vp == NULL to indicate that the entry * does not currently exist; we leave a pointer to * the (locked) directory inode in ndp->ni_dvp. - * The pathname buffer is saved so that the name - * can be obtained later. * * NB - if the directory is unlocked, then this * information cannot be used. */ - cnp->cn_flags |= SAVENAME; return (EJUSTRETURN); } /* @@ -670,7 +667,6 @@ found: #endif *vpp = tdp; - cnp->cn_flags |= SAVENAME; return (0); } if (dd_ino != NULL) @@ -830,8 +826,6 @@ ufs_makedirentry(struct inode *ip, struct componentname *cnp, u_int namelen; namelen = (unsigned)cnp->cn_namelen; - KASSERT((cnp->cn_flags & SAVENAME) != 0, - ("ufs_makedirentry: missing name")); KASSERT(namelen <= UFS_MAXNAMLEN, ("ufs_makedirentry: name too long")); newdirp->d_ino = ip->i_number; diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index af01fb37fe53..cf101ae50750 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -1099,11 +1099,6 @@ ufs_link( struct direct newdir; int error; -#ifdef INVARIANTS - if ((cnp->cn_flags & HASBUF) == 0) - panic("ufs_link: no name"); -#endif - if (DOINGSUJ(tdvp)) { error = softdep_prelink(tdvp, vp, cnp); if (error != 0) { @@ -1194,8 +1189,6 @@ ufs_whiteout( case CREATE: /* create a new directory whiteout */ #ifdef INVARIANTS - if ((cnp->cn_flags & SAVENAME) == 0) - panic("ufs_whiteout: missing name"); if (OFSFMT(dvp)) panic("ufs_whiteout: old format filesystem"); #endif @@ -1283,11 +1276,6 @@ ufs_rename( checkpath_locked = want_seqc_end = false; -#ifdef INVARIANTS - if ((tcnp->cn_flags & HASBUF) == 0 || - (fcnp->cn_flags & HASBUF) == 0) - panic("ufs_rename: no name"); -#endif endoff = 0; mp = tdvp->v_mount; VOP_UNLOCK(tdvp); @@ -2020,10 +2008,6 @@ ufs_mkdir( int error, dmode; long blkoff; -#ifdef INVARIANTS - if ((cnp->cn_flags & HASBUF) == 0) - panic("ufs_mkdir: no name"); -#endif dp = VTOI(dvp); error = ufs_sync_nlink(dvp, NULL); if (error != 0) @@ -2789,10 +2773,6 @@ ufs_makeinode(int mode, struct vnode *dvp, struct vnode **vpp, int error; pdir = VTOI(dvp); -#ifdef INVARIANTS - if ((cnp->cn_flags & HASBUF) == 0) - panic("%s: no name", callfunc); -#endif *vpp = NULL; if ((mode & IFMT) == 0) mode |= IFREG; |