summaryrefslogtreecommitdiffstats
path: root/sys/cddl
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2014-12-21 13:29:33 +0000
committerkib <kib@FreeBSD.org>2014-12-21 13:29:33 +0000
commit4e541c87563cf7aa973372226a0ae396db98e6b4 (patch)
tree55c5abcc434cafee85807f8e7fbbaa018d3ec612 /sys/cddl
parent9031d3b270a85e5be8bf907b88c9c22e07ae31cc (diff)
downloadFreeBSD-src-4e541c87563cf7aa973372226a0ae396db98e6b4.zip
FreeBSD-src-4e541c87563cf7aa973372226a0ae396db98e6b4.tar.gz
Handle MAKEENTRY cnp flag in the VOP_CREATE(). Curiously, some
fs, e.g. smbfs, already did it. Tested by: pho (previous version) Sponsored by: The FreeBSD Foundation MFC after: 2 weeks
Diffstat (limited to 'sys/cddl')
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
index 5d7fa70..9b11652 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
@@ -6180,15 +6180,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
OpenPOWER on IntegriCloud