aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorStefani Seibold <stefani@seibold.net>2009-12-21 17:37:28 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2009-12-22 17:17:56 -0500
commit7acd72eb85f1c7a15e8b5eb554994949241737f1 (patch)
tree76712bb9f38690d8cf9c2f91bef811e4413d1aa3 /drivers/scsi
parente64c026dd09b73faf20707711402fc5ed55a8e70 (diff)
kfifo: rename kfifo_put... into kfifo_in... and kfifo_get... into kfifo_out...
rename kfifo_put... into kfifo_in... to prevent miss use of old non in kernel-tree drivers ditto for kfifo_get... -> kfifo_out... Improve the prototypes of kfifo_in and kfifo_out to make the kerneldoc annotations more readable. Add mini "howto porting to the new API" in kfifo.h Signed-off-by: Stefani Seibold <stefani@seibold.net> Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com> Acked-by: Andi Kleen <ak@linux.intel.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/libiscsi.c14
-rw-r--r--drivers/scsi/libiscsi_tcp.c18
-rw-r--r--drivers/scsi/libsrp.c6
3 files changed, 19 insertions, 19 deletions
diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
index 5f0c46f43ee1..c28a712fd4db 100644
--- a/drivers/scsi/libiscsi.c
+++ b/drivers/scsi/libiscsi.c
@@ -517,7 +517,7 @@ static void iscsi_free_task(struct iscsi_task *task)
517 if (conn->login_task == task) 517 if (conn->login_task == task)
518 return; 518 return;
519 519
520 kfifo_put(&session->cmdpool.queue, (void*)&task, sizeof(void*)); 520 kfifo_in(&session->cmdpool.queue, (void*)&task, sizeof(void*));
521 521
522 if (sc) { 522 if (sc) {
523 task->sc = NULL; 523 task->sc = NULL;
@@ -737,7 +737,7 @@ __iscsi_conn_send_pdu(struct iscsi_conn *conn, struct iscsi_hdr *hdr,
737 BUG_ON(conn->c_stage == ISCSI_CONN_INITIAL_STAGE); 737 BUG_ON(conn->c_stage == ISCSI_CONN_INITIAL_STAGE);
738 BUG_ON(conn->c_stage == ISCSI_CONN_STOPPED); 738 BUG_ON(conn->c_stage == ISCSI_CONN_STOPPED);
739 739
740 if (!kfifo_get(&session->cmdpool.queue, 740 if (!kfifo_out(&session->cmdpool.queue,
741 (void*)&task, sizeof(void*))) 741 (void*)&task, sizeof(void*)))
742 return NULL; 742 return NULL;
743 } 743 }
@@ -1567,7 +1567,7 @@ static inline struct iscsi_task *iscsi_alloc_task(struct iscsi_conn *conn,
1567{ 1567{
1568 struct iscsi_task *task; 1568 struct iscsi_task *task;
1569 1569
1570 if (!kfifo_get(&conn->session->cmdpool.queue, 1570 if (!kfifo_out(&conn->session->cmdpool.queue,
1571 (void *) &task, sizeof(void *))) 1571 (void *) &task, sizeof(void *)))
1572 return NULL; 1572 return NULL;
1573 1573
@@ -2469,7 +2469,7 @@ iscsi_pool_init(struct iscsi_pool *q, int max, void ***items, int item_size)
2469 q->max = i; 2469 q->max = i;
2470 goto enomem; 2470 goto enomem;
2471 } 2471 }
2472 kfifo_put(&q->queue, (void*)&q->pool[i], sizeof(void*)); 2472 kfifo_in(&q->queue, (void*)&q->pool[i], sizeof(void*));
2473 } 2473 }
2474 2474
2475 if (items) { 2475 if (items) {
@@ -2819,7 +2819,7 @@ iscsi_conn_setup(struct iscsi_cls_session *cls_session, int dd_size,
2819 2819
2820 /* allocate login_task used for the login/text sequences */ 2820 /* allocate login_task used for the login/text sequences */
2821 spin_lock_bh(&session->lock); 2821 spin_lock_bh(&session->lock);
2822 if (!kfifo_get(&session->cmdpool.queue, 2822 if (!kfifo_out(&session->cmdpool.queue,
2823 (void*)&conn->login_task, 2823 (void*)&conn->login_task,
2824 sizeof(void*))) { 2824 sizeof(void*))) {
2825 spin_unlock_bh(&session->lock); 2825 spin_unlock_bh(&session->lock);
@@ -2839,7 +2839,7 @@ iscsi_conn_setup(struct iscsi_cls_session *cls_session, int dd_size,
2839 return cls_conn; 2839 return cls_conn;
2840 2840
2841login_task_data_alloc_fail: 2841login_task_data_alloc_fail:
2842 kfifo_put(&session->cmdpool.queue, (void*)&conn->login_task, 2842 kfifo_in(&session->cmdpool.queue, (void*)&conn->login_task,
2843 sizeof(void*)); 2843 sizeof(void*));
2844login_task_alloc_fail: 2844login_task_alloc_fail:
2845 iscsi_destroy_conn(cls_conn); 2845 iscsi_destroy_conn(cls_conn);
@@ -2902,7 +2902,7 @@ void iscsi_conn_teardown(struct iscsi_cls_conn *cls_conn)
2902 free_pages((unsigned long) conn->data, 2902 free_pages((unsigned long) conn->data,
2903 get_order(ISCSI_DEF_MAX_RECV_SEG_LEN)); 2903 get_order(ISCSI_DEF_MAX_RECV_SEG_LEN));
2904 kfree(conn->persistent_address); 2904 kfree(conn->persistent_address);
2905 kfifo_put(&session->cmdpool.queue, (void*)&conn->login_task, 2905 kfifo_in(&session->cmdpool.queue, (void*)&conn->login_task,
2906 sizeof(void*)); 2906 sizeof(void*));
2907 if (session->leadconn == conn) 2907 if (session->leadconn == conn)
2908 session->leadconn = NULL; 2908 session->leadconn = NULL;
diff --git a/drivers/scsi/libiscsi_tcp.c b/drivers/scsi/libiscsi_tcp.c
index c0be926637b1..d51ffeca2ec9 100644
--- a/drivers/scsi/libiscsi_tcp.c
+++ b/drivers/scsi/libiscsi_tcp.c
@@ -445,15 +445,15 @@ void iscsi_tcp_cleanup_task(struct iscsi_task *task)
445 return; 445 return;
446 446
447 /* flush task's r2t queues */ 447 /* flush task's r2t queues */
448 while (kfifo_get(&tcp_task->r2tqueue, (void*)&r2t, sizeof(void*))) { 448 while (kfifo_out(&tcp_task->r2tqueue, (void*)&r2t, sizeof(void*))) {
449 kfifo_put(&tcp_task->r2tpool.queue, (void*)&r2t, 449 kfifo_in(&tcp_task->r2tpool.queue, (void*)&r2t,
450 sizeof(void*)); 450 sizeof(void*));
451 ISCSI_DBG_TCP(task->conn, "pending r2t dropped\n"); 451 ISCSI_DBG_TCP(task->conn, "pending r2t dropped\n");
452 } 452 }
453 453
454 r2t = tcp_task->r2t; 454 r2t = tcp_task->r2t;
455 if (r2t != NULL) { 455 if (r2t != NULL) {
456 kfifo_put(&tcp_task->r2tpool.queue, (void*)&r2t, 456 kfifo_in(&tcp_task->r2tpool.queue, (void*)&r2t,
457 sizeof(void*)); 457 sizeof(void*));
458 tcp_task->r2t = NULL; 458 tcp_task->r2t = NULL;
459 } 459 }
@@ -541,7 +541,7 @@ static int iscsi_tcp_r2t_rsp(struct iscsi_conn *conn, struct iscsi_task *task)
541 return 0; 541 return 0;
542 } 542 }
543 543
544 rc = kfifo_get(&tcp_task->r2tpool.queue, (void*)&r2t, sizeof(void*)); 544 rc = kfifo_out(&tcp_task->r2tpool.queue, (void*)&r2t, sizeof(void*));
545 if (!rc) { 545 if (!rc) {
546 iscsi_conn_printk(KERN_ERR, conn, "Could not allocate R2T. " 546 iscsi_conn_printk(KERN_ERR, conn, "Could not allocate R2T. "
547 "Target has sent more R2Ts than it " 547 "Target has sent more R2Ts than it "
@@ -554,7 +554,7 @@ static int iscsi_tcp_r2t_rsp(struct iscsi_conn *conn, struct iscsi_task *task)
554 if (r2t->data_length == 0) { 554 if (r2t->data_length == 0) {
555 iscsi_conn_printk(KERN_ERR, conn, 555 iscsi_conn_printk(KERN_ERR, conn,
556 "invalid R2T with zero data len\n"); 556 "invalid R2T with zero data len\n");
557 kfifo_put(&tcp_task->r2tpool.queue, (void*)&r2t, 557 kfifo_in(&tcp_task->r2tpool.queue, (void*)&r2t,
558 sizeof(void*)); 558 sizeof(void*));
559 return ISCSI_ERR_DATALEN; 559 return ISCSI_ERR_DATALEN;
560 } 560 }
@@ -570,7 +570,7 @@ static int iscsi_tcp_r2t_rsp(struct iscsi_conn *conn, struct iscsi_task *task)
570 "invalid R2T with data len %u at offset %u " 570 "invalid R2T with data len %u at offset %u "
571 "and total length %d\n", r2t->data_length, 571 "and total length %d\n", r2t->data_length,
572 r2t->data_offset, scsi_out(task->sc)->length); 572 r2t->data_offset, scsi_out(task->sc)->length);
573 kfifo_put(&tcp_task->r2tpool.queue, (void*)&r2t, 573 kfifo_in(&tcp_task->r2tpool.queue, (void*)&r2t,
574 sizeof(void*)); 574 sizeof(void*));
575 return ISCSI_ERR_DATALEN; 575 return ISCSI_ERR_DATALEN;
576 } 576 }
@@ -580,7 +580,7 @@ static int iscsi_tcp_r2t_rsp(struct iscsi_conn *conn, struct iscsi_task *task)
580 r2t->sent = 0; 580 r2t->sent = 0;
581 581
582 tcp_task->exp_datasn = r2tsn + 1; 582 tcp_task->exp_datasn = r2tsn + 1;
583 kfifo_put(&tcp_task->r2tqueue, (void*)&r2t, sizeof(void*)); 583 kfifo_in(&tcp_task->r2tqueue, (void*)&r2t, sizeof(void*));
584 conn->r2t_pdus_cnt++; 584 conn->r2t_pdus_cnt++;
585 585
586 iscsi_requeue_task(task); 586 iscsi_requeue_task(task);
@@ -982,7 +982,7 @@ static struct iscsi_r2t_info *iscsi_tcp_get_curr_r2t(struct iscsi_task *task)
982 if (r2t->data_length <= r2t->sent) { 982 if (r2t->data_length <= r2t->sent) {
983 ISCSI_DBG_TCP(task->conn, 983 ISCSI_DBG_TCP(task->conn,
984 " done with r2t %p\n", r2t); 984 " done with r2t %p\n", r2t);
985 kfifo_put(&tcp_task->r2tpool.queue, 985 kfifo_in(&tcp_task->r2tpool.queue,
986 (void *)&tcp_task->r2t, 986 (void *)&tcp_task->r2t,
987 sizeof(void *)); 987 sizeof(void *));
988 tcp_task->r2t = r2t = NULL; 988 tcp_task->r2t = r2t = NULL;
@@ -990,7 +990,7 @@ static struct iscsi_r2t_info *iscsi_tcp_get_curr_r2t(struct iscsi_task *task)
990 } 990 }
991 991
992 if (r2t == NULL) { 992 if (r2t == NULL) {
993 kfifo_get(&tcp_task->r2tqueue, 993 kfifo_out(&tcp_task->r2tqueue,
994 (void *)&tcp_task->r2t, sizeof(void *)); 994 (void *)&tcp_task->r2t, sizeof(void *));
995 r2t = tcp_task->r2t; 995 r2t = tcp_task->r2t;
996 } 996 }
diff --git a/drivers/scsi/libsrp.c b/drivers/scsi/libsrp.c
index 975e448cfcb9..8424b8606efb 100644
--- a/drivers/scsi/libsrp.c
+++ b/drivers/scsi/libsrp.c
@@ -61,7 +61,7 @@ static int srp_iu_pool_alloc(struct srp_queue *q, size_t max,
61 kfifo_init(&q->queue, (void *) q->pool, max * sizeof(void *)); 61 kfifo_init(&q->queue, (void *) q->pool, max * sizeof(void *));
62 62
63 for (i = 0, iue = q->items; i < max; i++) { 63 for (i = 0, iue = q->items; i < max; i++) {
64 kfifo_put(&q->queue, (void *) &iue, sizeof(void *)); 64 kfifo_in(&q->queue, (void *) &iue, sizeof(void *));
65 iue->sbuf = ring[i]; 65 iue->sbuf = ring[i];
66 iue++; 66 iue++;
67 } 67 }
@@ -163,7 +163,7 @@ struct iu_entry *srp_iu_get(struct srp_target *target)
163{ 163{
164 struct iu_entry *iue = NULL; 164 struct iu_entry *iue = NULL;
165 165
166 kfifo_get_locked(&target->iu_queue.queue, (void *) &iue, 166 kfifo_out_locked(&target->iu_queue.queue, (void *) &iue,
167 sizeof(void *), &target->iu_queue.lock); 167 sizeof(void *), &target->iu_queue.lock);
168 if (!iue) 168 if (!iue)
169 return iue; 169 return iue;
@@ -176,7 +176,7 @@ EXPORT_SYMBOL_GPL(srp_iu_get);
176 176
177void srp_iu_put(struct iu_entry *iue) 177void srp_iu_put(struct iu_entry *iue)
178{ 178{
179 kfifo_put_locked(&iue->target->iu_queue.queue, (void *) &iue, 179 kfifo_in_locked(&iue->target->iu_queue.queue, (void *) &iue,
180 sizeof(void *), &iue->target->iu_queue.lock); 180 sizeof(void *), &iue->target->iu_queue.lock);
181} 181}
182EXPORT_SYMBOL_GPL(srp_iu_put); 182EXPORT_SYMBOL_GPL(srp_iu_put);