On Tue, Jan 30, 2001 at 04:17:55PM -0800, Matt Dillon wrote:
>
> : VOP_SWAPACCOUNT(nbp->b_vp, nbp);
> : BUF_KERNPROC(nbp);
> : BUF_STRATEGY(nbp);
> :
> :Now, I have to define the vop in vm_swap.c, where I can get the area
> :index from the block number in a clean way and frob my counters.
> :The same method could be used in swap_pager_putpages().
> :swap_pager_reserve() would need to construct a buf and act in a similar
> :way as e.g. swap_pager_strategy(), only that the buffer is not flushed
> :afterwards, only VOP_SWAPACCOUNT is called. Of course, this can be
> :done much easier by just passing the block number to VOP_SWAPACCOUNT,
> :and calling it for each blk returned by swp_pager_getswapspace()
> :(it costs virtually nothing, so it should be OK).
> :So, VOP_SWAPACCOUNT would become:
> : VOP_SWAPACCOUNT(nbp->b_vp, nbp->b_blkno, nbp->bcount);
> :
> :Or did I get things wrong?
> :
> : - thomas
>
> Hmm. I think it would be easier to figure it out in the swap
> allocation and free code. Specifically, look in vm/swap_pager.c:
>
> * The swp_pager_getswapspace() function
> * The swp_pager_freeswapspace() function
>
> I think these are the best places to keep track of per-swap-area
> allocation and frees. Note that the system tracks overall swap
> useage in these routines as well (the vm_swap_size global).
Yep. I only thought I should keep the layering by using VOPs. But you
are right, swap_pager and vm_swap are dependent anyway, so this can
be justified, and things are not duplicated over the whole file.
So, is it OK with you if I do it the way you described?
- thomas
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message