Date: Wed, 2 Apr 1997 17:06:48 -0700 (MST) From: Terry Lambert <terry@lambert.org> To: pmchen@eecs.umich.edu (Peter M. Chen) Cc: freebsd-hackers@freebsd.org Subject: Re: VOP_PUTPAGES Message-ID: <199704030006.RAA15015@phaeton.artisoft.com> In-Reply-To: <199704022320.SAA19709@life.eecs.umich.edu> from "Peter M. Chen" at Apr 2, 97 06:20:42 pm
next in thread | previous in thread | raw e-mail | index | archive | help
> 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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199704030006.RAA15015>