aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/drbd/drbd_req.c
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruen@linbit.com>2011-01-26 12:45:11 -0500
committerPhilipp Reisner <philipp.reisner@linbit.com>2011-09-28 04:26:28 -0400
commit9e204cddaf76d19ce0e84f025b0946110694dbfb (patch)
tree1aa2b56518366033498a404bb4b35954894851d9 /drivers/block/drbd/drbd_req.c
parent3e394da184ab32d2c345fd459e1eeb7b9586bb4e (diff)
drbd: Move some functions to where they are used
Move drbd_update_congested() to drbd_main.c, and drbd_req_new() and drbd_req_free() to drbd_req.c: those functions are not used anywhere else. Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Diffstat (limited to 'drivers/block/drbd/drbd_req.c')
-rw-r--r--drivers/block/drbd/drbd_req.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/drivers/block/drbd/drbd_req.c b/drivers/block/drbd/drbd_req.c
index 74179f7986e1..25fa87c95a10 100644
--- a/drivers/block/drbd/drbd_req.c
+++ b/drivers/block/drbd/drbd_req.c
@@ -56,6 +56,35 @@ static void _drbd_end_io_acct(struct drbd_conf *mdev, struct drbd_request *req)
56 part_stat_unlock(); 56 part_stat_unlock();
57} 57}
58 58
59static struct drbd_request *drbd_req_new(struct drbd_conf *mdev,
60 struct bio *bio_src)
61{
62 struct drbd_request *req;
63
64 req = mempool_alloc(drbd_request_mempool, GFP_NOIO);
65 if (!req)
66 return NULL;
67
68 drbd_req_make_private_bio(req, bio_src);
69 req->rq_state = bio_data_dir(bio_src) == WRITE ? RQ_WRITE : 0;
70 req->mdev = mdev;
71 req->master_bio = bio_src;
72 req->epoch = 0;
73 drbd_clear_interval(&req->i);
74 req->i.sector = bio_src->bi_sector;
75 req->i.size = bio_src->bi_size;
76 INIT_LIST_HEAD(&req->tl_requests);
77 INIT_LIST_HEAD(&req->w.list);
78
79 return req;
80}
81
82static void drbd_req_free(struct drbd_request *req)
83{
84 mempool_free(req, drbd_request_mempool);
85}
86
87/* rw is bio_data_dir(), only READ or WRITE */
59static void _req_is_done(struct drbd_conf *mdev, struct drbd_request *req, const int rw) 88static void _req_is_done(struct drbd_conf *mdev, struct drbd_request *req, const int rw)
60{ 89{
61 const unsigned long s = req->rq_state; 90 const unsigned long s = req->rq_state;