Subject: RFC patch for genfs
To: None <tech-kern@netbsd.org>
From: Reinoud Zandijk <reinoud@netbsd.org>
List: tech-kern
Date: 01/11/2006 04:00:28
--Dxnq1zWXvFF0Q93v
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Dear folks,
i'd like to patch genfs with the following patch to allow it to serve
directories as well as files. If noone objects i'll be committing it soon.
Note that it doesn't change current behaviour.
Index: genfs_vnops.c
===================================================================
RCS file: /cvsroot/src/sys/miscfs/genfs/genfs_vnops.c,v
retrieving revision 1.120
diff -u -r1.120 genfs_vnops.c
--- genfs_vnops.c 11 Jan 2006 00:46:54 -0000 1.120
+++ genfs_vnops.c 11 Jan 2006 02:57:28 -0000
@@ -464,7 +464,7 @@
UVMHIST_LOG(ubchist, "vp %p off 0x%x/%x count %d",
vp, ap->a_offset >> 32, ap->a_offset, *ap->a_count);
- KASSERT(vp->v_type == VREG || vp->v_type == VBLK);
+ KASSERT(vp->v_type == VREG || vp->v_type == VDIR || vp->v_type ==
VBLK);
/* XXXUBC temp limit */
if (*ap->a_count > MAX_READ_PAGES) {
@@ -502,7 +502,7 @@
/* uobj is locked */
if ((flags & PGO_NOTIMESTAMP) == 0 &&
- (vp->v_type == VREG ||
+ (vp->v_type != VBLK ||
(vp->v_mount->mnt_flag & MNT_NODEVMTIME) == 0)) {
int updflags = 0;
@@ -543,7 +543,7 @@
* leave space in the page array for a whole block.
*/
- if (vp->v_type == VREG) {
+ if (vp->v_type != VBLK) {
fs_bshift = vp->v_mount->mnt_fs_bshift;
dev_bshift = vp->v_mount->mnt_dev_bshift;
} else {
@@ -1362,7 +1362,7 @@
}
if (modified && (vp->v_flag & VWRITEMAPDIRTY) != 0 &&
- (vp->v_type == VREG ||
+ (vp->v_type != VBLK ||
(vp->v_mount->mnt_flag & MNT_NODEVMTIME) == 0)) {
GOP_MARKUPDATE(vp, GOP_UPDATE_MODIFIED);
}
@@ -1426,7 +1426,7 @@
vp, pgs, npages, flags);
GOP_SIZE(vp, vp->v_size, &eof, GOP_SIZE_WRITE);
- if (vp->v_type == VREG) {
+ if (vp->v_type != VBLK) {
fs_bshift = vp->v_mount->mnt_fs_bshift;
dev_bshift = vp->v_mount->mnt_dev_bshift;
} else {
-------------------------
With regards,
Reinoud
--Dxnq1zWXvFF0Q93v
Content-Type: application/pgp-signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (NetBSD)
iQEVAwUBQ8R0xYKcNwBDyKpoAQJLqAf+NN3cEXdc5pP0y4uBaI0nJBOv0iYRZZD9
U4cj6DfaqQ22brzbCMVjihSWwdoITkOi/L2+Qk26keXYoiyIwv0Fgf7sBK6kz/ak
k+FtOf/Oa49Z3MKZOPo5Qd1LWnavaIVZpIABX+1rFma/GwoSrHx2ZH2YYI6lFAGy
elSL8rJWrKhidVdmZ+FQJQezM2t7/QTCu2g2AcuvWx8+iyTYaMn8kz28GxjA4c3G
Tl1MjV7gSMxYdXl/gfLCGDC+dRgkyLWCb4cvDprOt+2+36MnA6BNOJ5W+qw3l7+x
mvdpuBLsbnjxd/QJ0au4LwyJDCczp4tln8AnMsCj5YFsyLUXyLHUUw==
=mTAB
-----END PGP SIGNATURE-----
--Dxnq1zWXvFF0Q93v--