relax typechecks so that all file types work (they were already supported)

This commit is contained in:
pooka 2006-10-27 12:26:25 +00:00
parent 30a851c1d1
commit 9638ee1464
2 changed files with 8 additions and 9 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: dtfs_subr.c,v 1.3 2006/10/26 22:53:25 pooka Exp $ */
/* $NetBSD: dtfs_subr.c,v 1.4 2006/10/27 12:26:25 pooka Exp $ */
/*
* Copyright (c) 2006 Antti Kantee. All Rights Reserved.
@ -89,11 +89,6 @@ dtfs_genfile(struct puffs_node *dir, const char *name, enum vtype type)
struct dtfs_mount *dtm;
struct puffs_node *newpn;
/* support only regular files and directories */
if (!(type == VREG || type == VDIR || type == VLNK || type == VBLK
|| type == VCHR))
return NULL;
assert(dir->pn_type == VDIR);
assert(dir->pn_mnt != NULL);
@ -216,6 +211,8 @@ dtfs_freenode(struct puffs_node *pn)
case VCHR:
case VBLK:
case VDIR:
case VSOCK:
case VFIFO:
break;
default:
assert(0);

View File

@ -1,4 +1,4 @@
/* $NetBSD: dtfs_vnops.c,v 1.4 2006/10/26 22:53:25 pooka Exp $ */
/* $NetBSD: dtfs_vnops.c,v 1.5 2006/10/27 12:26:25 pooka Exp $ */
/*
* Copyright (c) 2006 Antti Kantee. All Rights Reserved.
@ -128,7 +128,7 @@ dtfs_create(struct puffs_usermount *pu, void *opc, void **newnode,
struct puffs_node *pn_parent = opc;
struct puffs_node *pn_new;
if (va->va_type != VREG)
if (!(va->va_type == VREG || va->va_type == VSOCK))
return ENODEV;
pn_new = dtfs_genfile(pn_parent, pcn->pcn_name, va->va_type);
@ -313,7 +313,9 @@ dtfs_mknod(struct puffs_usermount *pu, void *opc, void **newnode,
struct puffs_node *pn_new;
struct dtfs_file *df;
assert(va->va_type == VBLK || va->va_type == VCHR);
if (!(va->va_type == VBLK || va->va_type == VCHR
|| va->va_type == VFIFO))
return EINVAL;
pn_new = dtfs_genfile(pn_parent, pcn->pcn_name, va->va_type);
puffs_setvattr(&pn_new->pn_va, va);