Subject: Re: poolifying fileassoc
To: None <blymn@baesystems.com.au>
From: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
List: tech-kern
Date: 02/02/2007 08:29:22
>  /*
> - * uvm_aio_aiodone: do iodone processing for async i/os.
> - * this should be called in thread context, not interrupt context.
> + *
> + * uvm_io_done: Set page flag status when an i/o (synch or asynch) has
> + * completed or an async i/o is started.  This function handles the
> + * following situations:
> + *
> + *  - Synchronous i/o has completed
> + *  - Asynchronous i/o has been initiated
> + *  - Asynchronous i/o had completed
> + *  - i/o is associated with swap
> + *
> + * All these cases what needs to be done to the page structures is very
> + * similar with some small variations depending on the calling situation.
> + *
> + * pgs - array of pages to handle
> + * npages - number of pages in request
> + * write - TRUE if a write request
> + * swap - TRUE if a swap request
> + * aio_complete - TRUE if called from aio completion
> + * overwrite - TRUE if overwriting pages
> + * ext_error - error status from caller
> + * ext_slock - ignored iff swap otherwise is uobj lock held
> + * swslot - swap slot (used iff swap == TRUE)
> + * ridx - extra pages to round to fs block size transaction
> + *        (set to npages if no rounding done)
> + * orignpages - original transaction size before rounding.
> + * aio_initiate - TRUE if pages are being brought in asynchronously.
> + * vn - pointer to vnode for object.
> + *
> + * pageqlock and object locks must be held iff swap is FALSE.  The
> + * locks will be released before return.
>   */
> -
> -void
> -uvm_aio_aiodone(struct buf *bp)
> +int
> +uvm_io_done(struct vm_page **pgs, int npages, boolean_t write, boolean_t swap,
> +	    boolean_t aio_complete, boolean_t overwrite, int ext_error,
> +	    struct simplelock *ext_slock, int swslot, int ridx,
> +	    int orignpages, boolean_t aio_initiate, struct vnode *vp)
>  {

it takes too much arguments.  it should be more self-contained, IMO.
eg. it's better to make uvm_io_done acquire locks by itself.

YAMAMOTO Takashi