Guest User

Untitled

a guest
May 27th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. static int clook_dispatch(struct request_queue *q, int force)
  2. {
  3. struct clook_data *nd = q->elevator->elevator_data;
  4.  
  5. if (nd->next != NULL) {
  6. struct request *rq, *next;
  7. char *direction;
  8. rq = nd->next;
  9. nd->next = NULL;
  10. next = list_entry(rq->queuelist.next, struct request, queuelist);
  11. /* rq = list_entry(nd->queue.next, struct request, queuelist); */
  12. if(next)
  13. nd->next = next;
  14.  
  15. list_del_init(&rq->queuelist);
  16. elv_dispatch_sort(q, rq);
  17.  
  18. /* determin read or write */
  19. if(REQ_RW & rq->cmd_flags) {
  20. direction = "write";
  21. } else {
  22. direction = "read";
  23. }
  24.  
  25. /* print so we can check order of actual dispatch */
  26. printk("[CLOOK] dis <%s> to <%lu>\n", direction, (unsigned long)rq->sector);
  27.  
  28. return 1;
  29. }
  30. return 0;
  31. }
Add Comment
Please, Sign In to add comment