Diff for /libaitsched/src/hooks.c between versions 1.10.2.4 and 1.10.2.6

version 1.10.2.4, 2012/08/01 14:49:37 version 1.10.2.6, 2012/08/01 16:47:06
Line 168  sched_hook_cancel(void *task, void *arg __unused) Line 168  sched_hook_cancel(void *task, void *arg __unused)
 #endif  #endif
                         acb = (struct aiocb*) TASK_VAL(t);                          acb = (struct aiocb*) TASK_VAL(t);
                         if (acb) {                          if (acb) {
                                aio_cancel(acb->aio_fildes, acb);                                if (aio_cancel(acb->aio_fildes, acb) == AIO_CANCELED)
                                         aio_return(acb);
                                 free(acb);                                  free(acb);
                                 TASK_VAL(t) = 0;                                  TASK_VAL(t) = 0;
                         }                          }
Line 454  sched_hook_fetch(void *root, void *arg __unused) Line 455  sched_hook_fetch(void *root, void *arg __unused)
         register int i, flg;          register int i, flg;
         int en;          int en;
 #ifdef EVFILT_AIO  #ifdef EVFILT_AIO
        int len;        int len, fd;
         struct aiocb *acb;          struct aiocb *acb;
 #endif  #endif
   
Line 779  sched_hook_fetch(void *root, void *arg __unused) Line 780  sched_hook_fetch(void *root, void *arg __unused)
                                 flg = 0;                                  flg = 0;
                                 TAILQ_FOREACH_SAFE(task, &r->root_aio, task_node, tmp) {                                  TAILQ_FOREACH_SAFE(task, &r->root_aio, task_node, tmp) {
                                         acb = (struct aiocb*) TASK_VAL(task);                                          acb = (struct aiocb*) TASK_VAL(task);
                                        if (acb != ((struct aiocb*) res[i].ident) ||                                         if (acb != ((struct aiocb*) res[i].udata))
                                                        acb->aio_sigevent.sigev_value.sival_ptr != res[i].udata) 
                                                 continue;                                                  continue;
                                         else                                          else
                                                 flg++;                                                  flg++;
Line 800  sched_hook_fetch(void *root, void *arg __unused) Line 800  sched_hook_fetch(void *root, void *arg __unused)
 #ifdef HAVE_LIBPTHREAD  #ifdef HAVE_LIBPTHREAD
                                         pthread_mutex_unlock(&r->root_mtx[taskREADY]);                                          pthread_mutex_unlock(&r->root_mtx[taskREADY]);
 #endif  #endif
                                           fd = acb->aio_fildes;
                                         if ((len = aio_return(acb)) != -1) {                                          if ((len = aio_return(acb)) != -1) {
                                                if (lseek(acb->aio_fildes, acb->aio_offset + len,                                                 if (lseek(fd, acb->aio_offset + len, SEEK_CUR) == -1)
                                                                        SEEK_CUR) == -1) 
                                                         LOGERR;                                                          LOGERR;
                                         } else                                          } else
                                                 LOGERR;                                                  LOGERR;
   
                                         free(acb);                                          free(acb);
                                        TASK_VAL(task) = (u_long) len;                                        TASK_FD(task) = fd;
                                         TASK_DATLEN(task) = (u_long) len;
                                 }                                  }
                                 /* if match at least 2, don't remove resouce of event */                                  /* if match at least 2, don't remove resouce of event */
                                 if (flg > 1)                                  if (flg > 1)

Removed from v.1.10.2.4  
changed lines
  Added in v.1.10.2.6


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>