drdb: don't check for failure from mempool_alloc()
Subsystems (2)
PATCH 1/1 drdb: don't check for failure from mempool_alloc()
mempool_alloc() cannot fail if the gfp flags allow
it to sleep, and GFP_NOIO allows for sleeping.
So drbd_req_new() cannot fail, and drbd_request_prepare() doesn't need to check if it did.
Signed-off-by NeilBrown <[email protected]>
--- drivers/block/drbd/drbd_req.c | 11 ----------- 1 file changed, 11 deletions(-)
drivers/block/drbd/drbd_req.c +0 -11
@@ -52,8 +52,6 @@ static struct drbd_request *drbd_req_new(struct drbd_device *device, struct biostruct drbd_request *req; req =mempool_alloc (drbd_request_mempool,GFP_NOIO ); -if (!req) -return NULL ;memset (req,0 ,sizeof (*req));drbd_req_make_private_bio (req, bio_src);
@@ -1214,15 +1212,6 @@ drbd_request_prepare(struct drbd_device *device, struct bio *bio, unsigned long/* allocate outside of all locks; */ req =drbd_req_new (device, bio); -if (!req) { -dec_ap_bio (device); -/* only pass the error to the upper layers. -* if user cannot handle io errors, that's not our business. */ -drbd_err (device,"could not kmalloc() req\n" ); - bio->bi_error = -ENOMEM ; -bio_endio (bio); -return ERR_PTR (-ENOMEM ); - } req->start_jif = start_jif;if (!get_ldev (device)) {
Signature · 1 line
2.12.2