MCPcopy Create free account
hub / github.com/bobranten/Ext4Fsd / __buffer_head_search

Function __buffer_head_search

Ext4Fsd/linux.c:372–393  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

370//
371
372static 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
395static int buffer_head_blocknr_cmp(struct rb_node *a, struct rb_node *b)
396{

Callers 1

buffer_head_searchFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected