mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

185 lines
4.8 KiB

  1. diff -ruN linux-2.6.9/drivers/scsi/qla2xxx/qla_os.c linux-2.6.9-new/drivers/scsi/qla2xxx/qla_os.c
  2. --- linux-2.6.9/drivers/scsi/qla2xxx/qla_os.c 2004-10-18 23:55:29.000000000 +0200
  3. +++ linux-2.6.9-new/drivers/scsi/qla2xxx/qla_os.c 2004-10-19 12:18:38.573385688 +0200
  4. @@ -235,67 +235,6 @@
  5. static __inline__ void
  6. qla2x00_delete_from_done_queue(scsi_qla_host_t *, srb_t *);
  7. -/**************************************************************************
  8. -* sp_put
  9. -*
  10. -* Description:
  11. -* Decrement reference count and call the callback if we're the last
  12. -* owner of the specified sp. Will get the host_lock before calling
  13. -* the callback.
  14. -*
  15. -* Input:
  16. -* ha - pointer to the scsi_qla_host_t where the callback is to occur.
  17. -* sp - pointer to srb_t structure to use.
  18. -*
  19. -* Returns:
  20. -*
  21. -**************************************************************************/
  22. -static inline void
  23. -sp_put(struct scsi_qla_host * ha, srb_t *sp)
  24. -{
  25. - if (atomic_read(&sp->ref_count) == 0) {
  26. - qla_printk(KERN_INFO, ha,
  27. - "%s(): **** SP->ref_count not zero\n",
  28. - __func__);
  29. - DEBUG2(BUG();)
  30. -
  31. - return;
  32. - }
  33. -
  34. - if (!atomic_dec_and_test(&sp->ref_count)) {
  35. - return;
  36. - }
  37. -
  38. - qla2x00_callback(ha, sp->cmd);
  39. -}
  40. -
  41. -/**************************************************************************
  42. -* sp_get
  43. -*
  44. -* Description:
  45. -* Increment reference count of the specified sp.
  46. -*
  47. -* Input:
  48. -* sp - pointer to srb_t structure to use.
  49. -*
  50. -* Returns:
  51. -*
  52. -**************************************************************************/
  53. -static inline void
  54. -sp_get(struct scsi_qla_host * ha, srb_t *sp)
  55. -{
  56. - atomic_inc(&sp->ref_count);
  57. -
  58. - if (atomic_read(&sp->ref_count) > 2) {
  59. - qla_printk(KERN_INFO, ha,
  60. - "%s(): **** SP->ref_count greater than two\n",
  61. - __func__);
  62. - DEBUG2(BUG();)
  63. -
  64. - return;
  65. - }
  66. -}
  67. -
  68. /*
  69. * qla2x00_callback
  70. * Returns the completed SCSI command to LINUX.
  71. @@ -366,6 +305,68 @@
  72. (*(cmd)->scsi_done)(cmd);
  73. }
  74. +/**************************************************************************
  75. +* sp_put
  76. +*
  77. +* Description:
  78. +* Decrement reference count and call the callback if we're the last
  79. +* owner of the specified sp. Will get the host_lock before calling
  80. +* the callback.
  81. +*
  82. +* Input:
  83. +* ha - pointer to the scsi_qla_host_t where the callback is to occur.
  84. +* sp - pointer to srb_t structure to use.
  85. +*
  86. +* Returns:
  87. +*
  88. +**************************************************************************/
  89. +static inline void
  90. +sp_put(struct scsi_qla_host * ha, srb_t *sp)
  91. +{
  92. + if (atomic_read(&sp->ref_count) == 0) {
  93. + qla_printk(KERN_INFO, ha,
  94. + "%s(): **** SP->ref_count not zero\n",
  95. + __func__);
  96. + DEBUG2(BUG();)
  97. +
  98. + return;
  99. + }
  100. +
  101. + if (!atomic_dec_and_test(&sp->ref_count)) {
  102. + return;
  103. + }
  104. +
  105. + qla2x00_callback(ha, sp->cmd);
  106. +}
  107. +
  108. +/**************************************************************************
  109. +* sp_get
  110. +*
  111. +* Description:
  112. +* Increment reference count of the specified sp.
  113. +*
  114. +* Input:
  115. +* sp - pointer to srb_t structure to use.
  116. +*
  117. +* Returns:
  118. +*
  119. +**************************************************************************/
  120. +static inline void
  121. +sp_get(struct scsi_qla_host * ha, srb_t *sp)
  122. +{
  123. + atomic_inc(&sp->ref_count);
  124. +
  125. + if (atomic_read(&sp->ref_count) > 2) {
  126. + qla_printk(KERN_INFO, ha,
  127. + "%s(): **** SP->ref_count greater than two\n",
  128. + __func__);
  129. + DEBUG2(BUG();)
  130. +
  131. + return;
  132. + }
  133. +}
  134. +
  135. +
  136. static inline void
  137. qla2x00_delete_from_done_queue(scsi_qla_host_t *dest_ha, srb_t *sp)
  138. {
  139. diff -ruN linux-2.6.9/drivers/scsi/qla2xxx/qla_rscn.c linux-2.6.9-new/drivers/scsi/qla2xxx/qla_rscn.c
  140. --- linux-2.6.9/drivers/scsi/qla2xxx/qla_rscn.c 2004-10-18 23:53:50.000000000 +0200
  141. +++ linux-2.6.9-new/drivers/scsi/qla2xxx/qla_rscn.c 2004-10-19 12:20:38.270189008 +0200
  142. @@ -242,6 +242,20 @@
  143. }
  144. /**
  145. + * qla2x00_remove_iodesc_timer() - Remove an active timer from an IO descriptor.
  146. + * @iodesc: io descriptor
  147. + */
  148. +static inline void
  149. +qla2x00_remove_iodesc_timer(struct io_descriptor *iodesc)
  150. +{
  151. + if (iodesc->timer.function != NULL) {
  152. + del_timer_sync(&iodesc->timer);
  153. + iodesc->timer.data = (unsigned long) NULL;
  154. + iodesc->timer.function = NULL;
  155. + }
  156. +}
  157. +
  158. +/**
  159. * qla2x00_init_io_descriptors() - Initialize the pool of IO descriptors.
  160. * @ha: HA context
  161. */
  162. @@ -311,20 +325,6 @@
  163. add_timer(&iodesc->timer);
  164. }
  165. -/**
  166. - * qla2x00_remove_iodesc_timer() - Remove an active timer from an IO descriptor.
  167. - * @iodesc: io descriptor
  168. - */
  169. -static inline void
  170. -qla2x00_remove_iodesc_timer(struct io_descriptor *iodesc)
  171. -{
  172. - if (iodesc->timer.function != NULL) {
  173. - del_timer_sync(&iodesc->timer);
  174. - iodesc->timer.data = (unsigned long) NULL;
  175. - iodesc->timer.function = NULL;
  176. - }
  177. -}
  178. -
  179. /**
  180. * IO descriptor support routines.
  181. **/