… | |
… | |
630 | |
630 | |
631 | =over 4 |
631 | =over 4 |
632 | |
632 | |
633 | =item eio_mtouch (void *addr, size_t length, int flags, int pri, eio_cb cb, void *data) |
633 | =item eio_mtouch (void *addr, size_t length, int flags, int pri, eio_cb cb, void *data) |
634 | |
634 | |
635 | Reads (C<flags == 0>) or modifies (C<flags == EIO_MT_MODIFY) the given |
635 | Reads (C<flags == 0>) or modifies (C<flags == EIO_MT_MODIFY>) the given |
636 | memory area, page-wise, that is, it reads (or reads and writes back) the |
636 | memory area, page-wise, that is, it reads (or reads and writes back) the |
637 | first octet of every page that spans the memory area. |
637 | first octet of every page that spans the memory area. |
638 | |
638 | |
639 | This can be used to page in some mmapped file, or dirty some pages. Note |
639 | This can be used to page in some mmapped file, or dirty some pages. Note |
640 | that dirtying is an unlocked read-write access, so races can ensue when |
640 | that dirtying is an unlocked read-write access, so races can ensue when |
… | |
… | |
764 | request finish on its own. |
764 | request finish on its own. |
765 | |
765 | |
766 | =item 3) open callback adds more requests |
766 | =item 3) open callback adds more requests |
767 | |
767 | |
768 | In the open callback, if the open was not successful, copy C<< |
768 | In the open callback, if the open was not successful, copy C<< |
769 | req->errorno >> to C<< grp->errorno >> and set C<< grp->errorno >> to |
769 | req->errorno >> to C<< grp->errorno >> and set C<< grp->result >> to |
770 | C<-1> to signal an error. |
770 | C<-1> to signal an error. |
771 | |
771 | |
772 | Otherwise, malloc some memory or so and issue a read request, adding the |
772 | Otherwise, malloc some memory or so and issue a read request, adding the |
773 | read request to the group. |
773 | read request to the group. |
774 | |
774 | |
775 | =item 4) continue issuing requests till finished |
775 | =item 4) continue issuing requests till finished |
776 | |
776 | |
777 | In the real callback, check for errors and possibly continue with |
777 | In the read callback, check for errors and possibly continue with |
778 | C<eio_close> or any other eio request in the same way. |
778 | C<eio_close> or any other eio request in the same way. |
779 | |
779 | |
780 | As soon as no new requests are added the group request will finish. Make |
780 | As soon as no new requests are added, the group request will finish. Make |
781 | sure you I<always> set C<< grp->result >> to some sensible value. |
781 | sure you I<always> set C<< grp->result >> to some sensible value. |
782 | |
782 | |
783 | =back |
783 | =back |
784 | |
784 | |
785 | =head4 REQUEST LIMITING |
785 | =head4 REQUEST LIMITING |