Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 Sep 1999 11:00:02 -0700 (PDT)
From:      Christopher Sedore <cmsedore@maxwell.syr.edu>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: kern/13075: signal is not posted for async I/O on raw devices
Message-ID:  <199909151800.LAA07489@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/13075; it has been noted by GNATS.

From: Christopher Sedore <cmsedore@maxwell.syr.edu>
To: "'freebsd-gnats-submit@freebsd.org'" <freebsd-gnats-submit@freebsd.org>,
	"'kwchen@lucent.com'" <kwchen@lucent.com>
Cc:  
Subject: Re: kern/13075: signal is not posted for async I/O on raw devices
Date: Wed, 15 Sep 1999 13:55:09 -0400

 Here's a patch that should fix the problem.  Warning: this patch comes from
 my own version of vfs_aio.c (no differences exist between my code and the
 code modified below, except that which is expressed below, so no
 incompatibilities should arise).  This may cause problems because line
 offsets are significantly different, and I had to hand edit the last patch
 chunk to eliminate a bunch of followon stuff.  
 
 *************** lio_listio(struct proc *p, struct lio_li
 *** 1930,1944 ****
    * to do so from a timeout routine, but *not* from an interrupt routine.
    */
   static void
 ! process_signal(void *ljarg)
   {
 !       struct aio_liojob *lj = ljarg;
 !       if (lj->lioj_signal.sigev_notify == SIGEV_SIGNAL) {
 !               if (lj->lioj_queue_count == lj->lioj_queue_finished_count) {
 !                       psignal(lj->lioj_ki->kaio_p,
 lj->lioj_signal.sigev_signo);
 !                       lj->lioj_flags |= LIOJ_SIGNAL_POSTED;
                 }
         }
   }
 
   /*
 --- 2062,2086 ----
    * to do so from a timeout routine, but *not* from an interrupt routine.
    */
   static void
 ! process_signal(void *aioj)
   {
 !       struct aiocblist *aiocbe = aioj;
 !       struct aio_liojob *lj = aiocbe->lio;
 !       struct aiocb *cb = &aiocbe->uaiocb;
 !
 !       if (lj) {
 !               if (lj->lioj_signal.sigev_notify == SIGEV_SIGNAL) {
 !                       if (lj->lioj_queue_count ==
 lj->lioj_queue_finished_count) {
 !                               psignal(lj->lioj_ki->kaio_p,
 lj->lioj_signal.sigev_signo);
 !                               lj->lioj_flags |= LIOJ_SIGNAL_POSTED;
 !                       }
                 }
         }
 +
 +       if (cb->aio_sigevent.sigev_notify == SIGEV_SIGNAL) {
 +               psignal(aiocbe->userproc,cb->aio_sigevent.sigev_signo);
 +       }
 +
   }
 
   /*
 *************** aio_physwakeup(bp)
 *** 1986,1992 ****
                                 if ((lj->lioj_flags &
 (LIOJ_SIGNAL|LIOJ_SIGNAL_POSTED)) ==
                                         LIOJ_SIGNAL) {
                                         lj->lioj_flags |=
 LIOJ_SIGNAL_POSTED;
 !                                       timeout(process_signal, lj, 0);
                                 }
                         }
                 }
 --- 2128,2134 ----
                                 if ((lj->lioj_flags &
 (LIOJ_SIGNAL|LIOJ_SIGNAL_POSTED)) ==
                                         LIOJ_SIGNAL) {
                                         lj->lioj_flags |=
 LIOJ_SIGNAL_POSTED;
 !                                       timeout(process_signal, aiocbe, 0);
                                 }
                         }
                 }
 *************** aio_physwakeup(bp)
 *** 2004,2010 ****
 --- 2146,2154 ----
                                 ki->kaio_flags &= ~KAIO_WAKEUP;
                                 wakeup(p);
                         }
 +
 +               }
 +
 +               if (aiocbe->uaiocb. aio_sigevent.sigev_notify ==
 SIGEV_SIGNAL) {
 +                       timeout(process_signal, aiocbe, 0);
                 }
         }
         splx(s);
   }
 


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199909151800.LAA07489>