aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorAlex Elder <elder@inktank.com>2012-07-19 10:09:27 -0400
committerSage Weil <sage@inktank.com>2012-07-30 21:15:50 -0400
commited63f4fd9a88218ee709e8f57c36c0c5f219a7ad (patch)
treee4de555e1d7b992184959df2fb19e489b12d1acd /drivers/block
parent9a5d690b08478fc2358d885703014853e44a357e (diff)
rbd: drop rbd_header_from_disk() gfp_flags parameter
The function rbd_header_from_disk() is only called in one spot, and it passes GFP_KERNEL as its value for the gfp_flags parameter. Just drop that parameter and substitute GFP_KERNEL everywhere within that function it had been used. (If we find we need the parameter again in the future it's easy enough to add back again.) Signed-off-by: Alex Elder <elder@inktank.com> Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/rbd.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index eed58e99e18d..34ca5c686b46 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -493,8 +493,7 @@ static bool rbd_dev_ondisk_valid(struct rbd_image_header_ondisk *ondisk)
493 */ 493 */
494static int rbd_header_from_disk(struct rbd_image_header *header, 494static int rbd_header_from_disk(struct rbd_image_header *header,
495 struct rbd_image_header_ondisk *ondisk, 495 struct rbd_image_header_ondisk *ondisk,
496 u32 allocated_snaps, 496 u32 allocated_snaps)
497 gfp_t gfp_flags)
498{ 497{
499 u32 i, snap_count; 498 u32 i, snap_count;
500 499
@@ -507,18 +506,18 @@ static int rbd_header_from_disk(struct rbd_image_header *header,
507 return -EINVAL; 506 return -EINVAL;
508 header->snapc = kmalloc(sizeof(struct ceph_snap_context) + 507 header->snapc = kmalloc(sizeof(struct ceph_snap_context) +
509 snap_count * sizeof(u64), 508 snap_count * sizeof(u64),
510 gfp_flags); 509 GFP_KERNEL);
511 if (!header->snapc) 510 if (!header->snapc)
512 return -ENOMEM; 511 return -ENOMEM;
513 512
514 header->snap_names_len = le64_to_cpu(ondisk->snap_names_len); 513 header->snap_names_len = le64_to_cpu(ondisk->snap_names_len);
515 if (snap_count) { 514 if (snap_count) {
516 header->snap_names = kmalloc(header->snap_names_len, 515 header->snap_names = kmalloc(header->snap_names_len,
517 gfp_flags); 516 GFP_KERNEL);
518 if (!header->snap_names) 517 if (!header->snap_names)
519 goto err_snapc; 518 goto err_snapc;
520 header->snap_sizes = kmalloc(snap_count * sizeof(u64), 519 header->snap_sizes = kmalloc(snap_count * sizeof(u64),
521 gfp_flags); 520 GFP_KERNEL);
522 if (!header->snap_sizes) 521 if (!header->snap_sizes)
523 goto err_names; 522 goto err_names;
524 } else { 523 } else {
@@ -527,7 +526,7 @@ static int rbd_header_from_disk(struct rbd_image_header *header,
527 } 526 }
528 527
529 header->object_prefix = kmalloc(sizeof (ondisk->block_name) + 1, 528 header->object_prefix = kmalloc(sizeof (ondisk->block_name) + 1,
530 gfp_flags); 529 GFP_KERNEL);
531 if (!header->object_prefix) 530 if (!header->object_prefix)
532 goto err_sizes; 531 goto err_sizes;
533 532
@@ -1625,7 +1624,7 @@ static int rbd_read_header(struct rbd_device *rbd_dev,
1625 if (rc < 0) 1624 if (rc < 0)
1626 goto out_dh; 1625 goto out_dh;
1627 1626
1628 rc = rbd_header_from_disk(header, dh, snap_count, GFP_KERNEL); 1627 rc = rbd_header_from_disk(header, dh, snap_count);
1629 if (rc < 0) { 1628 if (rc < 0) {
1630 if (rc == -ENXIO) 1629 if (rc == -ENXIO)
1631 pr_warning("unrecognized header format" 1630 pr_warning("unrecognized header format"