linux/mm/mmu_context.c
<<
4" /spaion /formon a 4" href="../linux+v3v.18/mm/mmu_context.c">4" img src="../.static/gfx/right.png" alt=">>">4" /spaion4" spai class="lxr_search">4" 4" input typluehidden" namluenavtarget" n value">4" input typluetext" namluesearch" iduesearch">4" butttiotypluesubmit">Search4" Prefsn /a>4" /spaion /divon form acopti="ajax+*" method="post" onsubmit="return false;">4" input typluehidden" namlueajax_lookup" idueajax_lookup" n value">4 /formon4 div class="headingbotttm">n div iduefile_contents"o
 
1 /a> spai class="comment">/* Copyright (C) 2009 Red Hat, Inc. /spaion
 
2 /a> spai class="comment"> * /spaion
 
3 /a> spai class="comment"> * See ../COPYING for licensing terms. /spaion
 
4 /a> spai class="comment"> */ /spaion
 
5 /a>4
 
6 /a>#include <linux/mm.h /a>>4
 
7 /a>#include <linux/mmu_context.h /a>>4
 
8 /a>#include <linux/export.h /a>>4
 
9 /a>#include <linux/sched.h /a>>4
 8.10a>4
 11 /a>#include <asm/mmu_context.h /a>>4
 1210a>4
 13 /a> spai class="comment">/* /spaion
 14 /a> spai class="comment"> * use_mm /spaion
 15 /a> spai class="comment"> *      Makes the calling kernel thread take tiothe specified /spaion
 16 /a> spai class="comment"> *      mm context. /spaion
 17 /a> spai class="comment"> *      Called byothe retry thread execute retries withiiothe /spaion
 18 /a> spai class="comment"> *      iocb issuer's mm context, soothat copy_from/to_user /spaion
 19 /a> spai class="comment"> *      operaoptis work seamlessly for aio. /spaion
 20 /a> spai class="comment"> *      (Note: this routine is intended to be called only /spaion
 21 /a> spai class="comment"> *      from a kernel thread context) /spaion
 22 /a> spai class="comment"> */ /spaion
 23 /a>void
 a href="+code=use_mm" class="sref">use_mm /a>(struct
 a href="+code=mm_struct" class="sref">mm_struct /a> * a href="+code=mm" class="sref">mm /a>)n
 24 /a>{n
 25 /a>        struct
 a href="+code=mm_struct" class="sref">mm_struct /a> * a href="+code=acopve_mm" class="sref">acopve_mm /a>;4
 26 /a>        struct
 a href="+code=task_struct" class="sref">task_struct /a> * a href="+code=tsk" class="sref">tsk /a> =
 a href="+code=current" class="sref">current /a>;4
 2710a>4
 28 /a>         a href="+code=task_lock" class="sref">task_lock /a>( a href="+code=tsk" class="sref">tsk /a>);4
 29 /a>         a href="+code=acopve_mm" class="sref">acopve_mm /a> =
 a href="+code=tsk" class="sref">tsk /a>-> a href="+code=acopve_mm" class="sref">acopve_mm /a>;4
 30 /a>        if ( a href="+code=acopve_mm" class="sref">acopve_mm /a> !=
 a href="+code=mm" class="sref">mm /a>) {n
 31 /a>                 a href="+code=atomic_inc" class="sref">atomic_inc /a>(& a href="+code=mm" class="sref">mm /a>-> a href="+code=mm_count" class="sref">mm_count /a>);4
 32 /a>                 a href="+code=tsk" class="sref">tsk /a>-> a href="+code=acopve_mm" class="sref">acopve_mm /a> =
 a href="+code=mm" class="sref">mm /a>;4
 33 /a>        }4
 34 /a>         a href="+code=tsk" class="sref">tsk /a>-> a href="+code=mm" class="sref">mm /a> =
 a href="+code=mm" class="sref">mm /a>;4
 35 /a>         a href="+code=switch_mm" class="sref">switch_mm /a>( a href="+code=acopve_mm" class="sref">acopve_mm /a>,
 a href="+code=mm" class="sref">mm /a>,
 a href="+code=tsk" class="sref">tsk /a>);4
 36 /a>         a href="+code=task_unlock" class="sref">task_unlock /a>( a href="+code=tsk" class="sref">tsk /a>);4
 3710a>4
 38 /a>        if ( a href="+code=acopve_mm" class="sref">acopve_mm /a> !=
 a href="+code=mm" class="sref">mm /a>)4
 39 /a>                 a href="+code=mmdrop" class="sref">mmdrop /a>( a href="+code=acopve_mm" class="sref">acopve_mm /a>);4
 40 /a>}4
 41 /a> a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL /a>( a href="+code=use_mm" class="sref">use_mm /a>);4
 4210a>4
 43 /a> spai class="comment">/* /spaion
 44 /a> spai class="comment"> * unuse_mm /spaion
 45 /a> spai class="comment"> *      Reverses the effect
of use_mm, i.e. releases the /spaion
 46 /a> spai class="comment"> *      specified mm context which was earlier taken on /spaion
 47 /a> spai class="comment"> *      byothe calling kernel thread /spaion
 48 /a> spai class="comment"> *      (Note: this routine is intended to be called only /spaion
 49 /a> spai class="comment"> *      from a kernel thread context) /spaion
 50 /a> spai class="comment"> */ /spaion
 51 /a>void
 a href="+code=unuse_mm" class="sref">unuse_mm /a>(struct
 a href="+code=mm_struct" class="sref">mm_struct /a> * a href="+code=mm" class="sref">mm /a>)n
 52 /a>{n
 53 /a>        struct
 a href="+code=task_struct" class="sref">task_struct /a> * a href="+code=tsk" class="sref">tsk /a> =
 a href="+code=current" class="sref">current /a>;4
 5410a>4
 55 /a>         a href="+code=task_lock" class="sref">task_lock /a>( a href="+code=tsk" class="sref">tsk /a>);4
 56 /a>         a href="+code=sync_mm_rss" class="sref">sync_mm_rss /a>( a href="+code=mm" class="sref">mm /a>);4
 57 /a>         a href="+code=tsk" class="sref">tsk /a>-> a href="+code=mm" class="sref">mm /a> =
 a href="+code=NULL" class="sref">NULL /a>;4
 58 /a>         spai class="comment">/* acopve_mm is still 'mm' */ /spaion
 59 /a>         a href="+code=enter_lazy_tlb" class="sref">enter_lazy_tlb /a>( a href="+code=mm" class="sref">mm /a>,
 a href="+code=tsk" class="sref">tsk /a>);4
 60 /a>         a href="+code=task_unlock" class="sref">task_unlock /a>( a href="+code=tsk" class="sref">tsk /a>);4
 61 /a>}4
 62 /a> a href="+code=EXPORT_SYMBOL_GPL" class="sref">EXPORT_SYMBOL_GPL /a>( a href="+code=unuse_mm" class="sref">unuse_mm /a>);4
 63 /a> /pre>
The original LXR software byothe LXR community /a>,
this experimental versptiobyolxr@linux.no /a>.
 /divon div class="subfooter">
lxr.linux.no kindly hosted byoRedpill Linpro AS /a>,
provider of Linux consulting and operaoptis services since 1995.
 /divon
 /bodyon /htmlon