函数源码 |
Source File:mm\mempolicy.c |
Create Date:2022-07-27 17:06:27 |
首页 | Copyright©Brick |
2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 | /* * Insert a new shared policy into the list. Caller holds sp->lock for * writing. */ static void sp_insert( struct shared_policy *sp, struct sp_node * new ) { struct rb_node **p = &sp->root.rb_node; struct rb_node *parent = NULL; struct sp_node *nd; while (*p) { parent = *p; nd = rb_entry(parent, struct sp_node, nd); if ( new ->start < nd->start) p = &(*p)->rb_left; else if ( new ->end > nd->end) p = &(*p)->rb_right; else BUG(); } rb_link_node(& new ->nd, parent, p); rb_insert_color(& new ->nd, &sp->root); pr_debug( "inserting %lx-%lx: %d\n" , new ->start, new ->end, new ->policy ? new ->policy->mode : 0); } |