In my opinion, w[i] is less than -1. On 2 December 2013 11:53, Lipeng Wan <lipengwan86@xxxxxxxxx> wrote: > Hi Dong, > > Thanks for your reply. Then is it valid to access the memory space > specified by that negative id? > > L Wan > > On Sun, Dec 1, 2013 at 10:31 PM, Dong Yuan <yuandong1222@xxxxxxxxx> wrote: >> If my memory serves me well, negative id means buckets (root, room, >> rack, cabinet, etc.), well positive means osds. >> >> On 2 December 2013 11:20, Lipeng Wan <lipengwan86@xxxxxxxxx> wrote: >>> Hi guys, >>> >>> I am reading the source code of ceph and trying to understand the data >>> structure of crush_map. Now I am confused by the use of "struct >>> crush_bucket **buckets" in function "int crush_do_rule(...)" in >>> src/crush/mapper.c. It seems that the index of array "map->buckets[]" >>> could be negative (see line 551, src/crush/mapper.c). I was wondering >>> if anyone could explain why the index of this array can be negative >>> and how those buckets were added into this array. Thanks. >>> >>> Best, >>> L. Wan >>> -- >>> To unsubscribe from this list: send the line "unsubscribe ceph-devel" in >>> the body of a message to majordomo@xxxxxxxxxxxxxxx >>> More majordomo info at http://vger.kernel.org/majordomo-info.html >> >> >> >> -- >> Dong Yuan >> Email:yuandong1222@xxxxxxxxx -- Dong Yuan Email:yuandong1222@xxxxxxxxx -- To unsubscribe from this list: send the line "unsubscribe ceph-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html