Skip to contentSkip to conversation

rbd: use gfp_flags parameter in rbd_header_from_disk()

PATCH In review Dan Carpenter 2 participants 2 messages Mar 22, 2012 – Apr 18, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rbd: use gfp_flags parameter in rbd_header_from_disk()

We should use the gfp_flags that the caller specified instead of GFP_KERNEL here.

There is only one caller and it uses GFP_KERNEL, so this change is just a cleanup and doesn't change how the code works.

drivers/block/rbd.c +2 -2
index a6278e7..fc9341f 100644
@@ -474,11 +474,11 @@ static int rbd_header_from_disk(struct rbd_image_header *header,
 		return -ENOMEM;
 	if (snap_count) {
 		header->snap_names = kmalloc(header->snap_names_len,
-					     GFP_KERNEL);
+					     gfp_flags);
 		if (!header->snap_names)
 			goto err_snapc;
 		header->snap_sizes = kmalloc(snap_count * sizeof(u64),
-					     GFP_KERNEL);
+					     gfp_flags);
 		if (!header->snap_sizes)
 			goto err_names;
 	} else {
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Dan Carpenter

We should use the gfp_flags that the caller specified instead of GFP_KERNEL here.

There is only one caller and it uses GFP_KERNEL, so this change is just a cleanup and doesn't change how the code works.

This looks good. Sorry it didn't get committed earlier.

Quoted 23 lines
drivers/block/rbd.c +2 -3
index a6278e7..fc9341f 100644
@@ -474,11 +474,11 @@ static int rbd_header_from_disk(struct rbd_image_header *header,
  		return -ENOMEM;
  	if (snap_count) {
  		header->snap_names = kmalloc(header->snap_names_len,
-					     GFP_KERNEL);
+					     gfp_flags);
  		if (!header->snap_names)
  			goto err_snapc;
  		header->snap_sizes = kmalloc(snap_count * sizeof(u64),
-					     GFP_KERNEL);
+					     gfp_flags);
  		if (!header->snap_sizes)
  			goto err_names;
  	} else {
--

To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html