Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 320355
b: refs/heads/master
c: ed63f4f
h: refs/heads/master
i:
  320353: 2071b51
  320351: 1414831
v: v3
  • Loading branch information
Alex Elder authored and Sage Weil committed Jul 31, 2012
1 parent b7bf373 commit 1db1a95
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9a5d690b08478fc2358d885703014853e44a357e
refs/heads/master: ed63f4fd9a88218ee709e8f57c36c0c5f219a7ad
13 changes: 6 additions & 7 deletions trunk/drivers/block/rbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -493,8 +493,7 @@ static bool rbd_dev_ondisk_valid(struct rbd_image_header_ondisk *ondisk)
*/
static int rbd_header_from_disk(struct rbd_image_header *header,
struct rbd_image_header_ondisk *ondisk,
u32 allocated_snaps,
gfp_t gfp_flags)
u32 allocated_snaps)
{
u32 i, snap_count;

Expand All @@ -507,18 +506,18 @@ static int rbd_header_from_disk(struct rbd_image_header *header,
return -EINVAL;
header->snapc = kmalloc(sizeof(struct ceph_snap_context) +
snap_count * sizeof(u64),
gfp_flags);
GFP_KERNEL);
if (!header->snapc)
return -ENOMEM;

header->snap_names_len = le64_to_cpu(ondisk->snap_names_len);
if (snap_count) {
header->snap_names = kmalloc(header->snap_names_len,
gfp_flags);
GFP_KERNEL);
if (!header->snap_names)
goto err_snapc;
header->snap_sizes = kmalloc(snap_count * sizeof(u64),
gfp_flags);
GFP_KERNEL);
if (!header->snap_sizes)
goto err_names;
} else {
Expand All @@ -527,7 +526,7 @@ static int rbd_header_from_disk(struct rbd_image_header *header,
}

header->object_prefix = kmalloc(sizeof (ondisk->block_name) + 1,
gfp_flags);
GFP_KERNEL);
if (!header->object_prefix)
goto err_sizes;

Expand Down Expand Up @@ -1625,7 +1624,7 @@ static int rbd_read_header(struct rbd_device *rbd_dev,
if (rc < 0)
goto out_dh;

rc = rbd_header_from_disk(header, dh, snap_count, GFP_KERNEL);
rc = rbd_header_from_disk(header, dh, snap_count);
if (rc < 0) {
if (rc == -ENXIO)
pr_warning("unrecognized header format"
Expand Down

0 comments on commit 1db1a95

Please sign in to comment.