Fri Jan 7 10:18:06 2011 UTC ()
Fix file handles.  Problem reported & fix tested by kefren.


(pooka)
diff -r1.49 -r1.50 src/lib/libp2k/p2k.c

cvs diff -r1.49 -r1.50 src/lib/libp2k/p2k.c (expand / switch to unified diff)

--- src/lib/libp2k/p2k.c 2011/01/02 13:01:45 1.49
+++ src/lib/libp2k/p2k.c 2011/01/07 10:18:06 1.50
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: p2k.c,v 1.49 2011/01/02 13:01:45 pooka Exp $ */ 1/* $NetBSD: p2k.c,v 1.50 2011/01/07 10:18:06 pooka Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2007, 2008, 2009 Antti Kantee. All Rights Reserved. 4 * Copyright (c) 2007, 2008, 2009 Antti Kantee. All Rights Reserved.
5 * 5 *
6 * Development of this software was supported by the 6 * Development of this software was supported by the
7 * Finnish Cultural Foundation. 7 * Finnish Cultural Foundation.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -624,27 +624,27 @@ p2k_fs_fhtonode(struct puffs_usermount * @@ -624,27 +624,27 @@ p2k_fs_fhtonode(struct puffs_usermount *
624 puffs_newinfo_setvtype(pni, vtype); 624 puffs_newinfo_setvtype(pni, vtype);
625 puffs_newinfo_setsize(pni, vsize); 625 puffs_newinfo_setsize(pni, vsize);
626 /* LINTED: yea, it'll lose accuracy, but that's life */ 626 /* LINTED: yea, it'll lose accuracy, but that's life */
627 puffs_newinfo_setrdev(pni, rdev); 627 puffs_newinfo_setrdev(pni, rdev);
628 628
629 return 0; 629 return 0;
630} 630}
631 631
632/*ARGSUSED*/ 632/*ARGSUSED*/
633int 633int
634p2k_fs_nodetofh(struct puffs_usermount *pu, puffs_cookie_t cookie, void *fid, 634p2k_fs_nodetofh(struct puffs_usermount *pu, puffs_cookie_t cookie, void *fid,
635 size_t *fidsize) 635 size_t *fidsize)
636{ 636{
637 struct vnode *vp = cookie; 637 struct vnode *vp = OPC2VP(cookie);
638 638
639 return rump_pub_vfs_vptofh(vp, fid, fidsize); 639 return rump_pub_vfs_vptofh(vp, fid, fidsize);
640} 640}
641 641
642int 642int
643p2k_fs_extattrctl(struct puffs_usermount *pu, int cmd, 643p2k_fs_extattrctl(struct puffs_usermount *pu, int cmd,
644 puffs_cookie_t cookie, int flags, 644 puffs_cookie_t cookie, int flags,
645 int attrnamespace, const char *attrname) 645 int attrnamespace, const char *attrname)
646{ 646{
647 struct p2k_mount *p2m = puffs_getspecific(pu); 647 struct p2k_mount *p2m = puffs_getspecific(pu);
648 struct mount *mp = p2m->p2m_mp; 648 struct mount *mp = p2m->p2m_mp;
649 struct vnode *vp; 649 struct vnode *vp;
650 650