Date: Sun, 4 Jan 2015 00:46:07 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r276648 - in stable/10/sys: cddl/contrib/opensolaris/uts/common/fs/zfs fs/ext2fs fs/msdosfs fs/nandfs fs/tmpfs ufs/ufs Message-ID: <201501040046.t040k7FS075108@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Sun Jan 4 00:46:06 2015 New Revision: 276648 URL: https://svnweb.freebsd.org/changeset/base/276648 Log: MFC r276007: Handle MAKEENTRY cnp flag in the VOP_CREATE(). Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c stable/10/sys/fs/ext2fs/ext2_vnops.c stable/10/sys/fs/msdosfs/msdosfs_vnops.c stable/10/sys/fs/nandfs/nandfs_vnops.c stable/10/sys/fs/tmpfs/tmpfs_vnops.c stable/10/sys/ufs/ufs/ufs_vnops.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sun Jan 4 00:44:24 2015 (r276647) +++ stable/10/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sun Jan 4 00:46:06 2015 (r276648) @@ -6155,15 +6155,20 @@ zfs_freebsd_create(ap) { struct componentname *cnp = ap->a_cnp; vattr_t *vap = ap->a_vap; - int mode; + int error, mode; ASSERT(cnp->cn_flags & SAVENAME); vattr_init_mask(vap); mode = vap->va_mode & ALLPERMS; - return (zfs_create(ap->a_dvp, cnp->cn_nameptr, vap, !EXCL, mode, - ap->a_vpp, cnp->cn_cred, cnp->cn_thread)); + error = zfs_create(ap->a_dvp, cnp->cn_nameptr, vap, !EXCL, mode, + ap->a_vpp, cnp->cn_cred, cnp->cn_thread); +#ifdef FREEBSD_NAMECACHE + if (error == 0 && (cnp->cn_flags & MAKEENTRY) != 0) + cache_enter(ap->a_dvp, *ap->a_vpp, cnp); +#endif + return (error); } static int Modified: stable/10/sys/fs/ext2fs/ext2_vnops.c ============================================================================== --- stable/10/sys/fs/ext2fs/ext2_vnops.c Sun Jan 4 00:44:24 2015 (r276647) +++ stable/10/sys/fs/ext2fs/ext2_vnops.c Sun Jan 4 00:46:06 2015 (r276648) @@ -240,8 +240,10 @@ ext2_create(struct vop_create_args *ap) error = ext2_makeinode(MAKEIMODE(ap->a_vap->va_type, ap->a_vap->va_mode), ap->a_dvp, ap->a_vpp, ap->a_cnp); - if (error) + if (error != 0) return (error); + if ((ap->a_cnp->cn_flags & MAKEENTRY) != 0) + cache_enter(ap->a_dvp, *ap->a_vpp, ap->a_cnp); return (0); } Modified: stable/10/sys/fs/msdosfs/msdosfs_vnops.c ============================================================================== --- stable/10/sys/fs/msdosfs/msdosfs_vnops.c Sun Jan 4 00:44:24 2015 (r276647) +++ stable/10/sys/fs/msdosfs/msdosfs_vnops.c Sun Jan 4 00:46:06 2015 (r276648) @@ -184,6 +184,8 @@ msdosfs_create(ap) if (error) goto bad; *ap->a_vpp = DETOV(dep); + if ((cnp->cn_flags & MAKEENTRY) != 0) + cache_enter(ap->a_dvp, *ap->a_vpp, cnp); return (0); bad: Modified: stable/10/sys/fs/nandfs/nandfs_vnops.c ============================================================================== --- stable/10/sys/fs/nandfs/nandfs_vnops.c Sun Jan 4 00:44:24 2015 (r276647) +++ stable/10/sys/fs/nandfs/nandfs_vnops.c Sun Jan 4 00:46:06 2015 (r276648) @@ -1414,6 +1414,8 @@ nandfs_create(struct vop_create_args *ap return (error); } *vpp = NTOV(node); + if ((cnp->cn_flags & MAKEENTRY) != 0) + cache_enter(dvp, *vpp, cnp); DPRINTF(VNCALL, ("created file vp %p nandnode %p ino %jx\n", *vpp, node, (uintmax_t)node->nn_ino)); Modified: stable/10/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- stable/10/sys/fs/tmpfs/tmpfs_vnops.c Sun Jan 4 00:44:24 2015 (r276647) +++ stable/10/sys/fs/tmpfs/tmpfs_vnops.c Sun Jan 4 00:46:06 2015 (r276648) @@ -213,10 +213,14 @@ tmpfs_create(struct vop_create_args *v) struct vnode **vpp = v->a_vpp; struct componentname *cnp = v->a_cnp; struct vattr *vap = v->a_vap; + int error; MPASS(vap->va_type == VREG || vap->va_type == VSOCK); - return tmpfs_alloc_file(dvp, vpp, vap, cnp, NULL); + error = tmpfs_alloc_file(dvp, vpp, vap, cnp, NULL); + if (error == 0 && (cnp->cn_flags & MAKEENTRY) != 0) + cache_enter(dvp, *vpp, cnp); + return (error); } static int Modified: stable/10/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- stable/10/sys/ufs/ufs/ufs_vnops.c Sun Jan 4 00:44:24 2015 (r276647) +++ stable/10/sys/ufs/ufs/ufs_vnops.c Sun Jan 4 00:46:06 2015 (r276648) @@ -205,8 +205,10 @@ ufs_create(ap) error = ufs_makeinode(MAKEIMODE(ap->a_vap->va_type, ap->a_vap->va_mode), ap->a_dvp, ap->a_vpp, ap->a_cnp); - if (error) + if (error != 0) return (error); + if ((ap->a_cnp->cn_flags & MAKEENTRY) != 0) + cache_enter(ap->a_dvp, *ap->a_vpp, ap->a_cnp); return (0); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201501040046.t040k7FS075108>