From owner-freebsd-hackers Wed Apr 2 16:23:52 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id QAA09496 for hackers-outgoing; Wed, 2 Apr 1997 16:23:52 -0800 (PST) Received: from phaeton.artisoft.com (phaeton.Artisoft.COM [198.17.250.50]) by freefall.freebsd.org (8.8.5/8.8.5) with SMTP id QAA09491 for ; Wed, 2 Apr 1997 16:23:48 -0800 (PST) Received: (from terry@localhost) by phaeton.artisoft.com (8.6.11/8.6.9) id RAA15015; Wed, 2 Apr 1997 17:06:49 -0700 From: Terry Lambert Message-Id: <199704030006.RAA15015@phaeton.artisoft.com> Subject: Re: VOP_PUTPAGES To: pmchen@eecs.umich.edu (Peter M. Chen) Date: Wed, 2 Apr 1997 17:06:48 -0700 (MST) Cc: freebsd-hackers@freebsd.org In-Reply-To: <199704022320.SAA19709@life.eecs.umich.edu> from "Peter M. Chen" at Apr 2, 97 06:20:42 pm X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > I feel stupid for asking this, but what does VOP_PUTPAGES call? I tried > tracing through the maze of macros but ended up at vp->v_op[0], which I > think is an error function. > > VOP_PUTPAGES (kern/vnode_if.h) calls > VCALL(vp, VOFFSET(vop_putpages), &a) yes. > which becomes > VOCALL(vp->v_op, VOFFSET(vop_putpages),&a) yes. > which becomes > ( *(vp->v_op[VOFFSET(vop_putpages)])) (&a) yes. And VOFFSET(vop_putpages) is at offset 43 in vfs_op_descs[]. > which becomes > ( *(vp->v_op[((&vop_putpages_desc)->vdesc_offset) ])) (&a) yes. > which becomes > ( *(vp->v_op[0])) (&a) BZZZZZZZZZZTTTT. For FS's where the op is supported, it's the offset of the per FS specific *_putpage. For most FS's, it's not supported, but getpages is -- see ffs_getpages() routine in the source file /sys/ufs/ufs/ufs_readwrite.c For those where it is not, a "failed" call will be called. I don't believe the code is ever really called anywhere -- instead, you should grep for "putpages" in /sys/vm/*.c, and look around there (mostly "default_pager.c", device_pager.c", "swap_pager.c", and "vn_pager.c"). These are called explicity instead of the VOP's. One of the most useful places to look would be in the mmap() code, since that is where the VOP_PUTPAGES() would be most easily implemented (the most interesting code in that case is the vn_pager.c). In general, the getpages() is only used for paging in pages from a file being used as a swap backing store for an executable -- in other words, *clean* pages. The putpages() routine is for writing dirty pages out... and is not currently used. For more details, you should see the posting in -current about John Dyson's modifications to add the op's into the list of VOPS supported as "standard", about 6 moths to a year ago. There is every intent to actually use the putpages VOP -- eventually. Regards, Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.