[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-id: <1380547556-17719-13-git-send-email-b.zolnierkie@samsung.com>
Date: Mon, 30 Sep 2013 15:25:53 +0200
From: Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>
To: axboe@...nel.dk
Cc: abhansali@...c-inc.com, jmoyer@...hat.com,
kyungmin.park@...sung.com, linux-kernel@...r.kernel.org,
b.zolnierkie@...sung.com
Subject: [PATCH 12/14] skd: reorder skd_flush_cmd_[en,de]queue() code
Reorder placement of skd_flush_cmd_[en,de]queue() functions.
Then remove no longer needed function prototypes.
Cc: Akhil Bhansali <abhansali@...c-inc.com>
Cc: Jeff Moyer <jmoyer@...hat.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@...sung.com>
---
drivers/block/skd_main.c | 61 +++++++++++++++++++++---------------------------
1 file changed, 27 insertions(+), 34 deletions(-)
diff --git a/drivers/block/skd_main.c b/drivers/block/skd_main.c
index c72b0e4..4d8e94c 100644
--- a/drivers/block/skd_main.c
+++ b/drivers/block/skd_main.c
@@ -530,11 +530,6 @@ static void skd_log_skmsg(struct skd_device *skdev,
static void skd_log_skreq(struct skd_device *skdev,
struct skd_request_context *skreq, const char *event);
-/* FLUSH FUA flag handling. */
-static int skd_flush_cmd_enqueue(struct skd_device *, void *);
-static void *skd_flush_cmd_dequeue(struct skd_device *);
-
-
/*
*****************************************************************************
* READ/WRITE REQUESTS
@@ -699,6 +694,33 @@ skd_prep_discard_cdb(struct skd_scsi_request *scsi_req,
}
}
+static int skd_flush_cmd_enqueue(struct skd_device *skdev, void *cmd)
+{
+ struct skd_flush_cmd *item;
+
+ item = kmem_cache_zalloc(skd_flush_slab, GFP_ATOMIC);
+ if (!item) {
+ pr_err("skd_flush_cmd_enqueue: Failed to allocated item.\n");
+ return -ENOMEM;
+ }
+
+ item->cmd = cmd;
+ list_add_tail(&item->flist, &skdev->flush_list);
+ return 0;
+}
+
+static void *skd_flush_cmd_dequeue(struct skd_device *skdev)
+{
+ void *cmd;
+ struct skd_flush_cmd *item;
+
+ item = list_entry(skdev->flush_list.next, struct skd_flush_cmd, flist);
+ list_del_init(&item->flist);
+ cmd = item->cmd;
+ kmem_cache_free(skd_flush_slab, item);
+ return cmd;
+}
+
static void skd_request_fn_not_online(struct request_queue *q);
static void skd_request_fn(struct request_queue *q)
@@ -5743,34 +5765,5 @@ static void __exit skd_exit(void)
kmem_cache_destroy(skd_flush_slab);
}
-static int
-skd_flush_cmd_enqueue(struct skd_device *skdev, void *cmd)
-{
- struct skd_flush_cmd *item;
-
- item = kmem_cache_zalloc(skd_flush_slab, GFP_ATOMIC);
- if (!item) {
- pr_err("skd_flush_cmd_enqueue: Failed to allocated item.\n");
- return -ENOMEM;
- }
-
- item->cmd = cmd;
- list_add_tail(&item->flist, &skdev->flush_list);
- return 0;
-}
-
-static void *
-skd_flush_cmd_dequeue(struct skd_device *skdev)
-{
- void *cmd;
- struct skd_flush_cmd *item;
-
- item = list_entry(skdev->flush_list.next, struct skd_flush_cmd, flist);
- list_del_init(&item->flist);
- cmd = item->cmd;
- kmem_cache_free(skd_flush_slab, item);
- return cmd;
-}
-
module_init(skd_init);
module_exit(skd_exit);
--
1.8.2.3
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists