Nuke PUFFSLOOKUP_FOO and move to NAMEI_FOO

This commit is contained in:
pooka 2007-08-15 14:19:19 +00:00
parent 37f06f1c57
commit 25a346d4fb
4 changed files with 15 additions and 28 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: puffs.h,v 1.77 2007/07/27 08:28:16 pooka Exp $ */
/* $NetBSD: puffs.h,v 1.78 2007/08/15 14:19:19 pooka Exp $ */
/*
* Copyright (c) 2005, 2006, 2007 Antti Kantee. All Rights Reserved.
@ -35,6 +35,7 @@
#include <sys/param.h>
#include <sys/types.h>
#include <sys/mount.h>
#include <sys/namei.h>
#include <sys/stat.h>
#include <sys/statvfs.h>
#include <sys/time.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: dtfs_vnops.c,v 1.37 2007/07/27 08:29:10 pooka Exp $ */
/* $NetBSD: dtfs_vnops.c,v 1.38 2007/08/15 14:19:19 pooka Exp $ */
/*
* Copyright (c) 2006 Antti Kantee. All Rights Reserved.
@ -66,9 +66,9 @@ dtfs_node_lookup(struct puffs_cc *pcc, void *opc, struct puffs_newinfo *pni,
return 0;
}
if ((pcn->pcn_flags & PUFFSLOOKUP_ISLASTCN)
&& (pcn->pcn_nameiop == PUFFSLOOKUP_CREATE ||
pcn->pcn_nameiop == PUFFSLOOKUP_RENAME)) {
if ((pcn->pcn_flags & NAMEI_ISLASTCN)
&& (pcn->pcn_nameiop == NAMEI_CREATE ||
pcn->pcn_nameiop == NAMEI_RENAME)) {
rv = puffs_access(VDIR, pn_dir->pn_va.va_mode,
pn_dir->pn_va.va_uid, pn_dir->pn_va.va_gid,
PUFFS_VWRITE, pcn->pcn_cred);

View File

@ -1,4 +1,4 @@
/* $NetBSD: puffs_msgif.h,v 1.47 2007/07/30 09:04:58 pooka Exp $ */
/* $NetBSD: puffs_msgif.h,v 1.48 2007/08/15 14:19:19 pooka Exp $ */
/*
* Copyright (c) 2005, 2006 Antti Kantee. All Rights Reserved.
@ -29,8 +29,8 @@
* SUCH DAMAGE.
*/
#ifndef _PUFFS_MSGIF_H_
#define _PUFFS_MSGIF_H_
#ifndef _FS_PUFFS_PUFFS_MSGIF_H_
#define _FS_PUFFS_PUFFS_MSGIF_H_
#include <sys/param.h>
#include <sys/time.h>
@ -358,20 +358,6 @@ struct puffs_kcn {
long pkcn_consume; /* IN: extra chars server ate */
};
/*
* XXX: figure out what to do with these, copied from namei.h for now
*/
#define PUFFSLOOKUP_LOOKUP 0 /* perform name lookup only */
#define PUFFSLOOKUP_CREATE 1 /* setup for file creation */
#define PUFFSLOOKUP_DELETE 2 /* setup for file deletion */
#define PUFFSLOOKUP_RENAME 3 /* setup for file renaming */
#define PUFFSLOOKUP_OPMASK 3 /* mask for operation */
#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 */
/*
* Next come the individual requests. They are all subclassed from
@ -740,4 +726,4 @@ struct puffs_vnreq_listextattr { };
memset(&a##_arg, 0, sizeof(struct puffs_vnreq_##a))
#endif
#endif /* _PUFFS_MSGIF_H_ */
#endif /* _FS_PUFFS_PUFFS_MSGIF_H_ */

View File

@ -1,4 +1,4 @@
/* $NetBSD: puffs_portal.c,v 1.8 2007/08/09 22:03:20 pooka Exp $ */
/* $NetBSD: puffs_portal.c,v 1.9 2007/08/15 14:19:19 pooka Exp $ */
/*
* Copyright (c) 2007 Antti Kantee. All Rights Reserved.
@ -28,7 +28,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: puffs_portal.c,v 1.8 2007/08/09 22:03:20 pooka Exp $");
__RCSID("$NetBSD: puffs_portal.c,v 1.9 2007/08/15 14:19:19 pooka Exp $");
#endif /* !lint */
#include <sys/types.h>
@ -488,15 +488,15 @@ portal_node_lookup(struct puffs_cc *pcc, void *opc, struct puffs_newinfo *pni,
assert(opc == PORTAL_ROOT);
if (pcn->pcn_nameiop != PUFFSLOOKUP_LOOKUP
&& pcn->pcn_nameiop != PUFFSLOOKUP_CREATE)
if (pcn->pcn_nameiop != NAMEI_LOOKUP
&& pcn->pcn_nameiop != NAMEI_CREATE)
return EOPNOTSUPP;
portn = makenode(pcn->pcn_name);
puffs_newinfo_setcookie(pni, portn);
puffs_newinfo_setvtype(pni, VREG);
pcn->pcn_flags &= ~PUFFSLOOKUP_REQUIREDIR;
pcn->pcn_flags &= ~NAMEI_REQUIREDIR;
pcn->pcn_consume = strlen(pcn->pcn_name) - pcn->pcn_namelen;
return 0;