Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 188571
b: refs/heads/master
c: 991abb6
h: refs/heads/master
i:
  188569: 59c47fb
  188567: ab5cf8f
v: v3
  • Loading branch information
Sage Weil committed Oct 9, 2009
1 parent 79e9980 commit eeac914
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 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: 0ba6478df7c6bef0f4b2625554545f941f89fb97
refs/heads/master: 991abb6ecfc8edf9863aa6a3f43249e63f9d4d4e
15 changes: 10 additions & 5 deletions trunk/fs/ceph/osdmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -366,8 +366,8 @@ static int osdmap_set_max_osd(struct ceph_osdmap *map, int max)
/*
* Insert a new pg_temp mapping
*/
static void __insert_pg_mapping(struct ceph_pg_mapping *new,
struct rb_root *root)
static int __insert_pg_mapping(struct ceph_pg_mapping *new,
struct rb_root *root)
{
struct rb_node **p = &root->rb_node;
struct rb_node *parent = NULL;
Expand All @@ -381,11 +381,12 @@ static void __insert_pg_mapping(struct ceph_pg_mapping *new,
else if (new->pgid > pg->pgid)
p = &(*p)->rb_right;
else
BUG();
return -EEXIST;
}

rb_link_node(&new->node, parent, p);
rb_insert_color(&new->node, root);
return 0;
}

/*
Expand Down Expand Up @@ -481,7 +482,9 @@ struct ceph_osdmap *osdmap_decode(void **p, void *end)
for (j = 0; j < n; j++)
ceph_decode_32(p, pg->osds[j]);

__insert_pg_mapping(pg, &map->pg_temp);
err = __insert_pg_mapping(pg, &map->pg_temp);
if (err)
goto bad;
dout(" added pg_temp %llx len %d\n", pgid, len);
}

Expand Down Expand Up @@ -681,7 +684,9 @@ struct ceph_osdmap *osdmap_apply_incremental(void **p, void *end,
pg->len = pglen;
for (j = 0; j < len; j++)
ceph_decode_32(p, pg->osds[j]);
__insert_pg_mapping(pg, &map->pg_temp);
err = __insert_pg_mapping(pg, &map->pg_temp);
if (err)
goto bad;
dout(" added pg_temp %llx len %d\n", pgid, pglen);
}
}
Expand Down

0 comments on commit eeac914

Please sign in to comment.