diff options
author | Mike Miller <mike.miller@hp.com> | 2010-06-11 07:13:35 -0400 |
---|---|---|
committer | Jens Axboe <jaxboe@fusionio.com> | 2010-08-07 12:15:25 -0400 |
commit | 29979a71227c46b2ed970b9d603d529c718e5fc8 (patch) | |
tree | 645d790dfb28a2a53a198a778ec1b41509cf73f0 /drivers/block/cciss.c | |
parent | b14aa6dcd083ad00fb416a93f76131734e6c3c17 (diff) |
cciss: move next_command function from ifdef
The definition of next_command also ended up in wrong place It ended up
inside an "#ifdef CONFIG_PROCFS". Already caught by Randy Dunlap and a
couple others. Tried to put it somewhere that made sense.
Signed-off-by: Mike Miller <mike.miller@hp.com>
Cc: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'drivers/block/cciss.c')
-rw-r--r-- | drivers/block/cciss.c | 45 |
1 files changed, 23 insertions, 22 deletions
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c index 156ea365c14d..10a0268a1f92 100644 --- a/drivers/block/cciss.c +++ b/drivers/block/cciss.c | |||
@@ -213,6 +213,7 @@ static void cciss_hba_release(struct device *dev); | |||
213 | static void cciss_device_release(struct device *dev); | 213 | static void cciss_device_release(struct device *dev); |
214 | static void cciss_free_gendisk(ctlr_info_t *h, int drv_index); | 214 | static void cciss_free_gendisk(ctlr_info_t *h, int drv_index); |
215 | static void cciss_free_drive_info(ctlr_info_t *h, int drv_index); | 215 | static void cciss_free_drive_info(ctlr_info_t *h, int drv_index); |
216 | static inline u32 next_command(ctlr_info_t *h); | ||
216 | 217 | ||
217 | /* performant mode helper functions */ | 218 | /* performant mode helper functions */ |
218 | static void calc_bucket_map(int *bucket, int num_buckets, int nsgs, | 219 | static void calc_bucket_map(int *bucket, int num_buckets, int nsgs, |
@@ -374,28 +375,6 @@ static const char *raid_label[] = { "0", "4", "1(1+0)", "5", "5+1", "ADG", | |||
374 | 375 | ||
375 | #ifdef CONFIG_PROC_FS | 376 | #ifdef CONFIG_PROC_FS |
376 | 377 | ||
377 | static inline u32 next_command(ctlr_info_t *h) | ||
378 | { | ||
379 | u32 a; | ||
380 | |||
381 | if (unlikely(h->transMethod != CFGTBL_Trans_Performant)) | ||
382 | return h->access.command_completed(h); | ||
383 | |||
384 | if ((*(h->reply_pool_head) & 1) == (h->reply_pool_wraparound)) { | ||
385 | a = *(h->reply_pool_head); /* Next cmd in ring buffer */ | ||
386 | (h->reply_pool_head)++; | ||
387 | h->commands_outstanding--; | ||
388 | } else { | ||
389 | a = FIFO_EMPTY; | ||
390 | } | ||
391 | /* Check for wraparound */ | ||
392 | if (h->reply_pool_head == (h->reply_pool + h->max_commands)) { | ||
393 | h->reply_pool_head = h->reply_pool; | ||
394 | h->reply_pool_wraparound ^= 1; | ||
395 | } | ||
396 | return a; | ||
397 | } | ||
398 | |||
399 | /* | 378 | /* |
400 | * Report information about this controller. | 379 | * Report information about this controller. |
401 | */ | 380 | */ |
@@ -3411,6 +3390,28 @@ static inline void finish_cmd(ctlr_info_t *h, CommandList_struct *c, | |||
3411 | #endif | 3390 | #endif |
3412 | } | 3391 | } |
3413 | 3392 | ||
3393 | static inline u32 next_command(ctlr_info_t *h) | ||
3394 | { | ||
3395 | u32 a; | ||
3396 | |||
3397 | if (unlikely(h->transMethod != CFGTBL_Trans_Performant)) | ||
3398 | return h->access.command_completed(h); | ||
3399 | |||
3400 | if ((*(h->reply_pool_head) & 1) == (h->reply_pool_wraparound)) { | ||
3401 | a = *(h->reply_pool_head); /* Next cmd in ring buffer */ | ||
3402 | (h->reply_pool_head)++; | ||
3403 | h->commands_outstanding--; | ||
3404 | } else { | ||
3405 | a = FIFO_EMPTY; | ||
3406 | } | ||
3407 | /* Check for wraparound */ | ||
3408 | if (h->reply_pool_head == (h->reply_pool + h->max_commands)) { | ||
3409 | h->reply_pool_head = h->reply_pool; | ||
3410 | h->reply_pool_wraparound ^= 1; | ||
3411 | } | ||
3412 | return a; | ||
3413 | } | ||
3414 | |||
3414 | /* process completion of an indexed ("direct lookup") command */ | 3415 | /* process completion of an indexed ("direct lookup") command */ |
3415 | static inline u32 process_indexed_cmd(ctlr_info_t *h, u32 raw_tag) | 3416 | static inline u32 process_indexed_cmd(ctlr_info_t *h, u32 raw_tag) |
3416 | { | 3417 | { |