Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 251314
b: refs/heads/master
c: 916d4d6
h: refs/heads/master
v: v3
  • Loading branch information
Sage Weil committed May 24, 2011
1 parent cc1eaa3 commit 1415323
Show file tree
Hide file tree
Showing 2 changed files with 8 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: 13143d2d1cffd243a6d778000b02ab4938ac751a
refs/heads/master: 916d4d672779de8e42346fff338617c7b841e8e5
14 changes: 7 additions & 7 deletions trunk/drivers/block/rbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1602,7 +1602,7 @@ static int rbd_header_add_snap(struct rbd_device *dev,
int name_len = strlen(snap_name);
u64 new_snapid;
int ret;
void *data, *data_start, *data_end;
void *data, *p, *e;
u64 ver;

/* we should create a snapshot only if we're pointing at the head */
Expand All @@ -1619,16 +1619,16 @@ static int rbd_header_add_snap(struct rbd_device *dev,
if (!data)
return -ENOMEM;

data_start = data;
data_end = data + name_len + 16;
p = data;
e = data + name_len + 16;

ceph_encode_string_safe(&data, data_end, snap_name, name_len, bad);
ceph_encode_64_safe(&data, data_end, new_snapid, bad);
ceph_encode_string_safe(&p, e, snap_name, name_len, bad);
ceph_encode_64_safe(&p, e, new_snapid, bad);

ret = rbd_req_sync_exec(dev, dev->obj_md_name, "rbd", "snap_add",
data_start, data - data_start, &ver);
data, p - data, &ver);

kfree(data_start);
kfree(data);

if (ret < 0)
return ret;
Expand Down

0 comments on commit 1415323

Please sign in to comment.