diff --git a/share/examples/puffs/dtfs/dtfs_vfsops.c b/share/examples/puffs/dtfs/dtfs_vfsops.c index 6c5e0dfb5c4c..43e604d92b86 100644 --- a/share/examples/puffs/dtfs/dtfs_vfsops.c +++ b/share/examples/puffs/dtfs/dtfs_vfsops.c @@ -1,4 +1,4 @@ -/* $NetBSD: dtfs_vfsops.c,v 1.14 2007/04/16 13:06:39 pooka Exp $ */ +/* $NetBSD: dtfs_vfsops.c,v 1.15 2007/04/16 13:25:09 pooka Exp $ */ /* * Copyright (c) 2006 Antti Kantee. All Rights Reserved. @@ -161,9 +161,7 @@ dtfs_fs_fhtonode(struct puffs_cc *pcc, void *fid, size_t fidsize, struct dtfs_fid *dfid; struct puffs_node *pn; - if (fidsize < sizeof(struct dtfs_fid)) - return EINVAL; - + assert(fidsize == sizeof(struct dtfs_fid)); dfid = fid; pn = puffs_pn_nodewalk(pu, addrcmp, dfid->dfid_addr); @@ -197,8 +195,8 @@ dtfs_fs_nodetofh(struct puffs_cc *pcc, void *cookie, *fidsize = sizeof(struct dtfs_fid); return E2BIG; } + *fidsize = sizeof(struct dtfs_fid); } - *fidsize = sizeof(struct dtfs_fid); dfid = fid; diff --git a/share/examples/puffs/sysctlfs/sysctlfs.c b/share/examples/puffs/sysctlfs/sysctlfs.c index a923505095c7..33b99f683459 100644 --- a/share/examples/puffs/sysctlfs/sysctlfs.c +++ b/share/examples/puffs/sysctlfs/sysctlfs.c @@ -1,4 +1,4 @@ -/* $NetBSD: sysctlfs.c,v 1.19 2007/04/16 13:06:39 pooka Exp $ */ +/* $NetBSD: sysctlfs.c,v 1.20 2007/04/16 13:25:10 pooka Exp $ */ /* * Copyright (c) 2006, 2007 Antti Kantee. All Rights Reserved. @@ -321,9 +321,6 @@ sysctlfs_fs_fhtonode(struct puffs_cc *pcc, void *fid, size_t fidsize, struct sfsnode *sfs; struct sfsfid *sfid; - if (fidsize != sizeof(struct sfsfid)) - return EINVAL; - sfid = fid; po.po_len = sfid->len; @@ -350,8 +347,6 @@ sysctlfs_fs_nodetofh(struct puffs_cc *pcc, void *cookie, struct puffs_node *pn = cookie; struct sfsfid *sfid; - assert(*fidsize >= sizeof(struct sfsfid)); - sfid = fid; sfid->len = PNPLEN(pn); memcpy(&sfid->path, PNPATH(pn), sfid->len * sizeof(int));