linux_idr.c (283675) | linux_idr.c (284530) |
---|---|
1/*- 2 * Copyright (c) 2010 Isilon Systems, Inc. 3 * Copyright (c) 2010 iX Systems, Inc. 4 * Copyright (c) 2010 Panasas, Inc. 5 * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 404 unchanged lines hidden (view full) --- 413 * We may have walked a path where there was a free bit but 414 * it was lower than what we wanted. Restart the search with 415 * a larger starting id. id contains the progress we made so 416 * far. Search the leaf one above this level. This may 417 * restart as many as MAX_LEVEL times but that is expected 418 * to be rare. 419 */ 420 if (idx == IDR_SIZE) { | 1/*- 2 * Copyright (c) 2010 Isilon Systems, Inc. 3 * Copyright (c) 2010 iX Systems, Inc. 4 * Copyright (c) 2010 Panasas, Inc. 5 * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd. 6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 404 unchanged lines hidden (view full) --- 413 * We may have walked a path where there was a free bit but 414 * it was lower than what we wanted. Restart the search with 415 * a larger starting id. id contains the progress we made so 416 * far. Search the leaf one above this level. This may 417 * restart as many as MAX_LEVEL times but that is expected 418 * to be rare. 419 */ 420 if (idx == IDR_SIZE) { |
421 starting_id = id + (1 << (layer+1 * IDR_BITS)); | 421 starting_id = id + (1 << ((layer + 1) * IDR_BITS)); |
422 goto restart; 423 } 424 if (idx > sidx) 425 starting_id = 0; /* Search the whole subtree. */ 426 id |= idx << (layer * IDR_BITS); 427 if (layer == 0) 428 break; 429 if (il->ary[idx] == NULL) { --- 30 unchanged lines hidden --- | 422 goto restart; 423 } 424 if (idx > sidx) 425 starting_id = 0; /* Search the whole subtree. */ 426 id |= idx << (layer * IDR_BITS); 427 if (layer == 0) 428 break; 429 if (il->ary[idx] == NULL) { --- 30 unchanged lines hidden --- |