support turning REQUIREDIR off and extra consume in lookup

This commit is contained in:
pooka 2007-07-02 18:25:36 +00:00
parent 01d79aae7e
commit ea1108ce11
2 changed files with 11 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: puffs_msgif.h,v 1.39 2007/07/02 10:24:17 pooka Exp $ */
/* $NetBSD: puffs_msgif.h,v 1.40 2007/07/02 18:25:36 pooka Exp $ */
/*
* Copyright (c) 2005, 2006 Antti Kantee. All Rights Reserved.
@ -359,6 +359,7 @@ struct puffs_kcn {
#define PUFFSLOOKUP_FOLLOW 0x00004 /* follow final symlink */
#define PUFFSLOOKUP_NOFOLLOW 0x00008 /* don't follow final symlink */
#define PUFFSLOOKUP_ISLASTCN 0x08000 /* is last component of lookup */
#define PUFFSLOOKUP_REQUIREDIR 0x80000 /* must be directory */
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: puffs_vnops.c,v 1.85 2007/07/02 10:24:17 pooka Exp $ */
/* $NetBSD: puffs_vnops.c,v 1.86 2007/07/02 18:25:37 pooka Exp $ */
/*
* Copyright (c) 2005, 2006, 2007 Antti Kantee. All Rights Reserved.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: puffs_vnops.c,v 1.85 2007/07/02 10:24:17 pooka Exp $");
__KERNEL_RCSID(0, "$NetBSD: puffs_vnops.c,v 1.86 2007/07/02 18:25:37 pooka Exp $");
#include <sys/param.h>
#include <sys/fstrans.h>
@ -516,6 +516,13 @@ puffs_lookup(void *v)
if ((cnp->cn_flags & MAKEENTRY) != 0 && PUFFS_USE_NAMECACHE(pmp))
cache_enter(dvp, vp, cnp);
/* XXX */
if ((lookup_arg.pvnr_cn.pkcn_flags & REQUIREDIR) == 0)
cnp->cn_flags &= ~REQUIREDIR;
if (lookup_arg.pvnr_cn.pkcn_consume)
cnp->cn_consume = MIN(lookup_arg.pvnr_cn.pkcn_consume,
strlen(cnp->cn_nameptr) - cnp->cn_namelen);
out:
if (cnp->cn_flags & ISDOTDOT)
vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY);