linux/fs/quota/compat.c
<<
ptiov3./spa > v3./form > v3.a ptiov3 href="../linux+v3.7.5/fs/quota/compat.c">ptiov3.img src="../.static/gfx/right.png" alt=">>">pt./spa >pt.spa class="lxr_search">ptioptiov3.input typon>hidden" namon>navtarget" option>">ptiov3.input typon>text" namon>search" idn>search">ptiov3.butt2submit">Search v3./form > ./spa >pt.spa class="lxr_prefs" > v3.a href="+prefs?return=fs/quota/compat.c"ptiov3 onclick="return ajax_prefs();">ptiov3Prefs> v3./a>pt./spa >iov3 3./div >iov3 3.form ac" ="ajax+*" method="post" onsubmit="return false;">pt.input typon>hidden" namon>ajax_lookup" idn>ajax_lookup" option>">piov3 3./form >piov3 3.div class="headingbott2m">
iov3
iov3 v3 3.div idn>search_results" class="search_results"> v >iov3 3./div > .div idn>content">> .div idn>file_contents"
bf/6c/31fe4caae4572949687e9e6113f520824206_3/0" L1" class="line" namon>L1">3 31./a>pL2" class="line" namon>L2">3 32./a>#include <linux/syscalls.h./a>>pL3" class="line" namon>L3">3 33./a>#include <linux/compat.h./a>>pL4" class="line" namon>L4">3 34./a>#include <linux/quotaops.h./a>>pL5" class="line" namon>L5">3 35./a>pL6" class="line" namon>L6">3 36./a>.spa  class="comment">/*./spa  >L7" class="line" namon>L7">3 37./a>.spa  class="comment"> * This code works only for 32 bit quota tools over 64 bit OS (x86_64, ia64)./spa  >L8" class="line" namon>L8">3 38./a>.spa  class="comment"> * and is necessary due to alignment problems../spa  >L9" class="line" namon>L9">3 39./a>.spa  class="comment"> */./spa  >L10" class="line" namon>L10">3 .18.a>struct3.a href="+code=compat_if_dqblk" class="sref">compat_if_dqblk8.a> {>L11" class="line" namon>L11">3 11./a>        .a href="+code=compat_u64" class="sref">compat_u64./a> .a href="+code=dqb_bhardlimit" class="sref">dqb_bhardlimit./a>;pL12" class="line" namon>L12">3 12./a>        .a href="+code=compat_u64" class="sref">compat_u64./a> .a href="+code=dqb_bsoftlimit" class="sref">dqb_bsoftlimit./a>;pL13" class="line" namon>L13">3 13./a>        .a href="+code=compat_u64" class="sref">compat_u64./a> .a href="+code=dqb_curspace" class="sref">dqb_curspace./a>;pL14" class="line" namon>L14">3 14./a>        .a href="+code=compat_u64" class="sref">compat_u64./a> .a href="+code=dqb_ihardlimit" class="sref">dqb_ihardlimit./a>;pL15" class="line" namon>L15">3 15./a>        .a href="+code=compat_u64" class="sref">compat_u64./a> .a href="+code=dqb_isoftlimit" class="sref">dqb_isoftlimit./a>;pL16" class="line" namon>L16">3 16./a>        .a href="+code=compat_u64" class="sref">compat_u64./a> .a href="+code=dqb_curinodes" class="sref">dqb_curinodes./a>;pL17" class="line" namon>L17">3 17./a>        .a href="+code=compat_u64" class="sref">compat_u64./a> .a href="+code=dqb_btime" class="sref">dqb_btime./a>;pL18" class="line" namon>L18">3 18./a>        .a href="+code=compat_u64" class="sref">compat_u64./a> .a href="+code=dqb_itime" class="sref">dqb_itime./a>;pL19" class="line" namon>L19">3 19./a>        .a href="+code=compat_uint_t" class="sref">compat_uint_t./a> .a href="+code=dqb_optid" class="sref">dqb_optid./a>;pL20" class="line" namon>L20">3 218.a>};pL21" class="line" namon>L21">3 21./a>pL22" class="line" namon>L22">3 22./a>.spa  class="comment">/* XFS structures */./spa  >L23" class="line" namon>L23">3 238.a>struct3.a href="+code=compat_fs_qfilestat" class="sref">compat_fs_qfilestat8.a> {>L24" class="line" namon>L24">3 24./a>        .a href="+code=compat_u64" class="sref">compat_u64./a> .a href="+code=dqb_bhardlimit" class="sref">dqb_bhardlimit./a>;pL25" class="line" namon>L25">3 25./a>        .a href="+code=compat_u64" class="sref">compat_u64./a> .a href="+code=qfs_nblks" class="sref">qfs_nblks./a>;pL26" class="line" namon>L26">3 26./a>        .a href="+code=compat_uint_t" class="sref">compat_uint_t./a> .a href="+code=qfs_nextents" class="sref">qfs_nextents./a>;pL27" class="line" namon>L27">3 278.a>};pL28" class="line" namon>L28">3 28./a>pL29" class="line" namon>L29">3 298.a>struct3.a href="+code=compat_fs_quota_stat" class="sref">compat_fs_quota_stat8.a> {>L30" class="line" namon>L30">3 30./a>        .a href="+code=__s8" class="sref">__s8./a>            .a href="+code=qs_version" class="sref">qs_version./a>;pL31" class="line" namon>L31">3 31./a>        .a href="+code=__u16" class="sref">__u16./a>           .a href="+code=qs_flags" class="sref">qs_flags./a>;pL32" class="line" namon>L32">3 32./a>        .a href="+code=__s8" class="sref">__s8./a>            .a href="+code=qs_pad" class="sref">qs_pad./a>;pL33" class="line" namon>L33">3 33./a>        struct3.a href="+code=compat_fs_qfilestat" class="sref">compat_fs_qfilestat8.a>      .a href="+code=qs_uquota" class="sref">qs_uquota./a>;pL34" class="line" namon>L34">3 34./a>        struct3.a href="+code=compat_fs_qfilestat" class="sref">compat_fs_qfilestat8.a>      .a href="+code=qs_gquota" class="sref">qs_gquota./a>;pL35" class="line" namon>L35">3 35./a>        .a href="+code=compat_uint_t" class="sref">compat_uint_t./a>   .a href="+code=qs_incoredqs" class="sref">qs_incoredqs./a>;pL36" class="line" namon>L36">3 36./a>        .a href="+code=compat_int_t" class="sref">compat_int_t./a>    .a href="+code=qs_btimelimit" class="sref">qs_btimelimit./a>;pL37" class="line" namon>L37">3 37./a>        .a href="+code=compat_int_t" class="sref">compat_int_t./a>    .a href="+code=qs_itimelimit" class="sref">qs_itimelimit./a>;pL38" class="line" namon>L38">3 38./a>        .a href="+code=compat_int_t" class="sref">compat_int_t./a>    .a href="+code=qs_rtbtimelimit" class="sref">qs_rtbtimelimit./a>;pL39" class="line" namon>L39">3 39./a>        .a href="+code=__u16" class="sref">__u16./a>           .a href="+code=qs_bwarnlimit" class="sref">qs_bwarnlimit./a>;pL40" class="line" namon>L40">3 40./a>        .a href="+code=__u16" class="sref">__u16./a>           .a href="+code=qs_iwarnlimit" class="sref">qs_iwarnlimit./a>;pL41" class="line" namon>L41">3 418.a>};pL42" class="line" namon>L42">3 42./a>pL43" class="line" namon>L43">3 43./a>.a href="+code=asmlinkage" class="sref">asmlinkage./a> long .a href="+code=sys32_quotactl" class="sref">sys32_quotactl./a>(unsigned int .a href="+code=cmd" class="sref">cmd./a>, const char .a href="+code=__user" class="sref">__user./a> *.a href="+code=special" class="sref">special./a>,pL44" class="line" namon>L44">3 44./a>                                                .a href="+code=qid_t" class="sref">qid_t./a> .a href="+code=id" class="sref">id./a>, void .a href="+code=__user" class="sref">__user./a> *.a href="+code=addr" class="sref">addr./a>)pL45" class="line" namon>L45">3 45./a>{>L46" class="line" namon>L46">3 46./a>        unsigned int .a href="+code=cmds" class="sref">cmds./a>;pL47" class="line" namon>L47">3 47./a>        struct3.a href="+code=if_dqblk" class="sref">if_dqblk8.a> .a href="+code=__user" class="sref">__user./a> *.a href="+code=dqblk" class="sref">dqblk8.a>;pL48" class="line" namon>L48">3 48./a>        struct3.a href="+code=compat_if_dqblk" class="sref">compat_if_dqblk8.a> .a href="+code=__user" class="sref">__user./a> *.a href="+code=compat_dqblk" class="sref">compat_dqblk8.a>;pL49" class="line" namon>L49">3 49./a>        struct3.a href="+code=fs_quota_stat" class="sref">fs_quota_stat8.a> .a href="+code=__user" class="sref">__user./a> *.a href="+code=fsqstat" class="sref">fsqstat8.a>;pL50" class="line" namon>L50">3 50./a>        struct3.a href="+code=compat_fs_quota_stat" class="sref">compat_fs_quota_stat8.a> .a href="+code=__user" class="sref">__user./a> *.a href="+code=compat_fsqstat" class="sref">compat_fsqstat8.a>;pL51" class="line" namon>L51">3 51./a>        .a href="+code=compat_uint_t" class="sref">compat_uint_t./a> .a href="+code=data" class="sref">data8.a>;pL52" class="line" namon>L52">3 52./a>        .a href="+code=u16" class="sref">u16./a> .a href="+code=xdata" class="sref">xdata8.a>;pL53" class="line" namon>L53">3 53./a>        long .a href="+code=ret" class="sref">ret8.a>;pL54" class="line" namon>L54">3 54./a>pL55" class="line" namon>L55">3 55./a>        .a href="+code=cmds" class="sref">cmds./a> = .a href="+code=cmd" class="sref">cmd./a> >> .a href="+code=SUBCMDSHIFT" class="sref">SUBCMDSHIFT8.a>;pL56" class="line" namon>L56">3 56./a>pL57" class="line" namon>L57">3 57./a>        switch (.a href="+code=cmds" class="sref">cmds./a>) {>L58" class="line" namon>L58">3 58./a>        case .a href="+code=Q_GETQUOTA" class="sref">Q_GETQUOTA./a>:>L59" class="line" namon>L59">3 59./a>                .a href="+code=dqblk" class="sref">dqblk8.a> = .a href="+code=compat_alloc_user_space" class="sref">compat_alloc_user_space./a>(sizeof(struct3.a href="+code=if_dqblk" class="sref">if_dqblk8.a>));pL60" class="line" namon>L60">3 60./a>                .a href="+code=compat_dqblk" class="sref">compat_dqblk8.a> = .a href="+code=addr" class="sref">addr./a>;pL61" class="line" namon>L61">3 61./a>                .a href="+code=ret" class="sref">ret8.a> = .a href="+code=sys_quotactl" class="sref">sys_quotactl./a>(.a href="+code=cmd" class="sref">cmd./a>, .a href="+code=special" class="sref">special./a>, .a href="+code=id" class="sref">id./a>, .a href="+code=dqblk" class="sref">dqblk8.a>);pL62" class="line" namon>L62">3 62./a>                if (.a href="+code=ret" class="sref">ret8.a>)pL63" class="line" namon>L63">3 63./a>                        break;pL64" class="line" namon>L64">3 64./a>                if (.a href="+code=copy_in_user" class="sref">copy_in_user./a>(.a href="+code=compat_dqblk" class="sref">compat_dqblk8.a>, .a href="+code=dqblk" class="sref">dqblk8.a>, sizeof(*.a href="+code=compat_dqblk" class="sref">compat_dqblk8.a>)) ||pL65" class="line" namon>L65">3 65./a>                        .a href="+code=get_user" class="sref">get_user./a>(.a href="+code=data" class="sref">data8.a>, &.a href="+code=dqblk" class="sref">dqblk8.a>->.a href="+code=dqb_optid" class="sref">dqb_optid./a>) ||pL66" class="line" namon>L66">3 66./a>                        .a href="+code=put_user" class="sref">put_user./a>(.a href="+code=data" class="sref">data8.a>, &.a href="+code=compat_dqblk" class="sref">compat_dqblk8.a>->.a href="+code=dqb_optid" class="sref">dqb_optid./a>))pL67" class="line" namon>L67">3 67./a>                        .a href="+code=ret" class="sref">ret8.a> = -.a href="+code=EFAULT" class="sref">EFAULT./a>;pL68" class="line" namon>L68">3 68./a>                break;pL69" class="line" namon>L69">3 69./a>        case .a href="+code=Q_SETQUOTA" class="sref">Q_SETQUOTA./a>:>L70" class="line" namon>L70">3 70./a>                .a href="+code=dqblk" class="sref">dqblk8.a> = .a href="+code=compat_alloc_user_space" class="sref">compat_alloc_user_space./a>(sizeof(struct3.a href="+code=if_dqblk" class="sref">if_dqblk8.a>));pL71" class="line" namon>L71">3 71./a>                .a href="+code=compat_dqblk" class="sref">compat_dqblk8.a> = .a href="+code=addr" class="sref">addr./a>;pL72" class="line" namon>L72">3 72./a>                .a href="+code=ret" class="sref">ret8.a> = -.a href="+code=EFAULT" class="sref">EFAULT./a>;pL73" class="line" namon>L73">3 73./a>                if (.a href="+code=copy_in_user" class="sref">copy_in_user./a>(.a href="+code=dqblk" class="sref">dqblk8.a>, .a href="+code=compat_dqblk" class="sref">compat_dqblk8.a>, sizeof(*.a href="+code=compat_dqblk" class="sref">compat_dqblk8.a>)) ||pL74" class="line" namon>L74">3 74./a>                        .a href="+code=get_user" class="sref">get_user./a>(.a href="+code=data" class="sref">data8.a>, &.a href="+code=compat_dqblk" class="sref">compat_dqblk8.a>->.a href="+code=dqb_optid" class="sref">dqb_optid./a>) ||pL75" class="line" namon>L75">3 75./a>                        .a href="+code=put_user" class="sref">put_user./a>(.a href="+code=data" class="sref">data8.a>, &.a href="+code=dqblk" class="sref">dqblk8.a>->.a href="+code=dqb_optid" class="sref">dqb_optid./a>))pL76" class="line" namon>L76">3 76./a>                        break;pL77" class="line" namon>L77">3 77./a>                .a href="+code=ret" class="sref">ret8.a> = .a href="+code=sys_quotactl" class="sref">sys_quotactl./a>(.a href="+code=cmd" class="sref">cmd./a>, .a href="+code=special" class="sref">special./a>, .a href="+code=id" class="sref">id./a>, .a href="+code=dqblk" class="sref">dqblk8.a>);pL78" class="line" namon>L78">3 78./a>                break;pL79" class="line" namon>L79">3 79./a>        case .a href="+code=Q_XGETQSTAT" class="sref">Q_XGETQSTAT./a>:>L80" class="line" namon>L80">3 80./a>                .a href="+code=fsqstat" class="sref">fsqstat8.a> = .a href="+code=compat_alloc_user_space" class="sref">compat_alloc_user_space./a>(sizeof(struct3.a href="+code=fs_quota_stat" class="sref">fs_quota_stat8.a>));pL81" class="line" namon>L81">3 81./a>                .a href="+code=compat_fsqstat" class="sref">compat_fsqstat8.a> = .a href="+code=addr" class="sref">addr./a>;pL82" class="line" namon>L82">3 82./a>                .a href="+code=ret" class="sref">ret8.a> = .a href="+code=sys_quotactl" class="sref">sys_quotactl./a>(.a href="+code=cmd" class="sref">cmd./a>, .a href="+code=special" class="sref">special./a>, .a href="+code=id" class="sref">id./a>, .a href="+code=fsqstat" class="sref">fsqstat8.a>);pL83" class="line" namon>L83">3 83./a>                if (.a href="+code=ret" class="sref">ret8.a>)pL84" class="line" namon>L84">3 84./a>                        break;pL85" class="line" namon>L85">3 85./a>                .a href="+code=ret" class="sref">ret8.a> = -.a href="+code=EFAULT" class="sref">EFAULT./a>;pL86" class="line" namon>L86">3 86./a>                .spa  class="comment">/* Copying qs_version, qs_flags, qs_pad */./spa  >L87" class="line" namon>L87">3 87./a>                if (.a href="+code=copy_in_user" class="sref">copy_in_user./a>(.a href="+code=compat_fsqstat" class="sref">compat_fsqstat8.a>, .a href="+code=fsqstat" class="sref">fsqstat8.a>,pL88" class="line" namon>L88">3 88./a>                        .a href="+code=offsetof" class="sref">offsetof./a>(struct3.a href="+code=compat_fs_quota_stat" class="sref">compat_fs_quota_stat8.a>, .a href="+code=qs_uquota" class="sref">qs_uquota./a>)))pL89" class="line" namon>L89">3 89./a>                        break;pL90" class="line" namon>L90">3 90./a>                .spa  class="comment">/* Copying qs_uquota */./spa  >L91" class="line" namon>L91">3 91./a>                if (.a href="+code=copy_in_user" class="sref">copy_in_user./a>(&.a href="+code=compat_fsqstat" class="sref">compat_fsqstat8.a>->.a href="+code=qs_uquota" class="sref">qs_uquota./a>,pL92" class="line" namon>L92">3 92./a>                        &.a href="+code=fsqstat" class="sref">fsqstat8.a>->.a href="+code=qs_uquota" class="sref">qs_uquota./a>,pL93" class="line" namon>L93">3 93./a>                        sizeof(.a href="+code=compat_fsqstat" class="sref">compat_fsqstat8.a>->.a href="+code=qs_uquota" class="sref">qs_uquota./a>)) ||pL94" class="line" namon>L94">3 94./a>                        .a href="+code=get_user" class="sref">get_user./a>(.a href="+code=data" class="sref">data8.a>, &.a href="+code=fsqstat" class="sref">fsqstat8.a>->.a href="+code=qs_uquota" class="sref">qs_uquota./a>..a href="+code=qfs_nextents" class="sref">qfs_nextents./a>) ||pL95" class="line" namon>L95">3 95./a>                        .a href="+code=put_user" class="sref">put_user./a>(.a href="+code=data" class="sref">data8.a>, &.a href="+code=compat_fsqstat" class="sref">compat_fsqstat8.a>->.a href="+code=qs_uquota" class="sref">qs_uquota./a>..a href="+code=qfs_nextents" class="sref">qfs_nextents./a>))pL96" class="line" namon>L96">3 96./a>                        break;pL97" class="line" namon>L97">3 97./a>                .spa  class="comment">/* Copying qs_gquota */./spa  >L98" class="line" namon>L98">3 98./a>                if (.a href="+code=copy_in_user" class="sref">copy_in_user./a>(&.a href="+code=compat_fsqstat" class="sref">compat_fsqstat8.a>->.a href="+code=qs_gquota" class="sref">qs_gquota./a>,pL99" class="line" namon>L99">3 99./a>                        &.a href="+code=fsqstat" class="sref">fsqstat8.a>->.a href="+code=qs_gquota" class="sref">qs_gquota./a>,pL100" class="line" namon>L100">3100./a>                        sizeof(.a href="+code=compat_fsqstat" class="sref">compat_fsqstat8.a>->.a href="+code=qs_gquota" class="sref">qs_gquota./a>)) ||pL101" class="line" namon>L101">3101./a>                        .a href="+code=get_user" class="sref">get_user./a>(.a href="+code=data" class="sref">data8.a>, &.a href="+code=fsqstat" class="sref">fsqstat8.a>->.a href="+code=qs_gquota" class="sref">qs_gquota./a>..a href="+code=qfs_nextents" class="sref">qfs_nextents./a>) ||pL102" class="line" namon>L102">3102./a>                        .a href="+code=put_user" class="sref">put_user./a>(.a href="+code=data" class="sref">data8.a>, &.a href="+code=compat_fsqstat" class="sref">compat_fsqstat8.a>->.a href="+code=qs_gquota" class="sref">qs_gquota./a>..a href="+code=qfs_nextents" class="sref">qfs_nextents./a>))pL103" class="line" namon>L103">3103./a>                        break;pL104" class="line" namon>L104">3104./a>                .spa  class="comment">/* Copying the rest */./spa  >L105" class="line" namon>L105">3105./a>                if (.a href="+code=copy_in_user" class="sref">copy_in_user./a>(&.a href="+code=compat_fsqstat" class="sref">compat_fsqstat8.a>->.a href="+code=qs_incoredqs" class="sref">qs_incoredqs./a>,pL106" class="line" namon>L106">3106./a>                        &.a href="+code=fsqstat" class="sref">fsqstat8.a>->.a href="+code=qs_incoredqs" class="sref">qs_incoredqs./a>,pL107" class="line" namon>L107">3107./a>                        sizeof(struct3.a href="+code=compat_fs_quota_stat" class="sref">compat_fs_quota_stat8.a>) -pL108" class="line" namon>L108">3108./a>                        .a href="+code=offsetof" class="sref">offsetof./a>(struct3.a href="+code=compat_fs_quota_stat" class="sref">compat_fs_quota_stat8.a>, .a href="+code=qs_incoredqs" class="sref">qs_incoredqs./a>)) ||pL109" class="line" namon>L109">3109./a>                        .a href="+code=get_user" class="sref">get_user./a>(.a href="+code=xdata" class="sref">xdata8.a>, &.a href="+code=fsqstat" class="sref">fsqstat8.a>->.a href="+code=qs_iwarnlimit" class="sref">qs_iwarnlimit./a>) ||pL110" class="line" namon>L110">3110./a>                        .a href="+code=put_user" class="sref">put_user./a>(.a href="+code=xdata" class="sref">xdata8.a>, &.a href="+code=compat_fsqstat" class="sref">compat_fsqstat8.a>->.a href="+code=qs_iwarnlimit" class="sref">qs_iwarnlimit./a>))pL111" class="line" namon>L111">3111./a>                        break;pL112" class="line" namon>L112">3112./a>                .a href="+code=ret" class="sref">ret8.a> = 0;pL113" class="line" namon>L113">3113./a>                break;pL114" class="line" namon>L114">3114./a>        default:>L115" class="line" namon>L115">3115./a>                .a href="+code=ret" class="sref">ret8.a> = .a href="+code=sys_quotactl" class="sref">sys_quotactl./a>(.a href="+code=cmd" class="sref">cmd./a>, .a href="+code=special" class="sref">special./a>, .a href="+code=id" class="sref">id./a>, .a href="+code=addr" class="sref">addr./a>);pL116" class="line" namon>L116">3116./a>        }pL117" class="line" namon>L117">3117./a>        return .a href="+code=ret" class="sref">ret8.a>;pL118" class="line" namon>L118">3118./a>}pL119" class="line" namon>L119">3119./a>
./div > .div class="footer"> The original LXR software by the LXR community./a>, this experimental version by lxr@linux.no./a>. ./div >.div class="subfooter"> lxr.linux.no kindly hosted by Redpill Linpro AS./a>, provider of Linux consulting and opera" s services since 1995. ./div > ./body >./html >