| 370 | // |
| 371 | |
| 372 | static struct buffer_head *__buffer_head_search(struct rb_root *root, |
| 373 | sector_t blocknr) |
| 374 | { |
| 375 | struct rb_node *new = root->rb_node; |
| 376 | |
| 377 | /* Figure out where to put new node */ |
| 378 | while (new) { |
| 379 | struct buffer_head *bh = |
| 380 | container_of(new, struct buffer_head, b_rb_node); |
| 381 | s64 result = blocknr - bh->b_blocknr; |
| 382 | |
| 383 | if (result < 0) |
| 384 | new = new->rb_left; |
| 385 | else if (result > 0) |
| 386 | new = new->rb_right; |
| 387 | else |
| 388 | return bh; |
| 389 | |
| 390 | } |
| 391 | |
| 392 | return NULL; |
| 393 | } |
| 394 | |
| 395 | static int buffer_head_blocknr_cmp(struct rb_node *a, struct rb_node *b) |
| 396 | { |
no outgoing calls
no test coverage detected