lessen file handle size sanity checks: kernel does it already (mostly)
This commit is contained in:
parent
96fd5059d7
commit
4609dd7023
@ -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;
|
||||
|
||||
|
@ -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));
|
||||
|
Loading…
Reference in New Issue
Block a user