linux/fs/cachefiles/xattr.c
<<
on> 9.4/spa="v 9.4/form"v 9.4a on> 9. href="../linux+v3opt2/fs/cachefiles/xattr.c">on> 9.4img src="../.static/gfx/right.png" alt=">>">on4/spa="von4spa= class="lxr_search">on> 2e=="+search" method="post" onsubmit="return do_search(this);">on> 9.4input typv3.hidden" namv3.navtarget" > v3.">on> 9.4input typv3.text" namv3.search" id3.search">on> 9.4butt>2 typv3.submit">Search2"v 9.4/form"v 4/spa="von4spa= class="lxr_prefs""v 9.4a href="+prefs?return=fs/cachefiles/xattr.c"on> 9. onclick="return ajax_prefs();">on> 9.Prefsv 9.4/a>on4/spa="v> 9. .4/div"v> 9. .4form ac>2e=="ajax+*" method="post" onsubmit="return false;">on4input typv3.hidden" namv3.ajax_lookup" id3.ajax_lookup" > v3.">o> 9. .4/form"vo> 9. .4div class="headingbott>m"> 9. 9. 9. .4div id3.search_results" class="search_results"v 9"v> 9. .4/div"v 4div id3.content">v 4div id3.file_contents""
. .14/a>4spa= class="comment">/* CacheFiles extended attribute management4/spa="v. .24/a>4spa= class="comment"> *4/spa="v. .34/a>4spa= class="comment"> * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.4/spa="v. .44/a>4spa= class="comment"> * Written by David Howells (dhowells@redhat.com)4/spa="v. .54/a>4spa= class="comment"> *4/spa="v. .64/a>4spa= class="comment"> * This program is free software; you ca= redistribute it and/or4/spa="v. .74/a>4spa= class="comment"> * modify it under the terms of the GNU General Public Licence4/spa="v. .84/a>4spa= class="comment"> * as published by the Free Software Founda>2e=; either vers2e=4/spa="v. .94/a>4spa= class="comment"> * 2 of the Licence, or (at your   >2e=) any later vers2e=.4/spa="v. optia>4spa= class="comment"> */4/spa="v. 114/a>v. 124/a>#include <linux/module.h4/a>>v. 134/a>#include <linux/sched.h4/a>>v. 144/a>#include <linux/file.h4/a>>v. 154/a>#include <linux/fs.h4/a>>v. 164/a>#include <linux/fsnotify.h4/a>>v. 174/a>#include <linux/quotaops.h4/a>>v. 184/a>#include <linux/xattr.h4/a>>v. 194/a>#include <linux/slab.h4/a>>v. 204/a>#include "internal.h4/a>"v. 214/a>v. 224/a>static const char.4a href="+code=cachefiles_xattr_cache" class="sref">cachefiles_xattr_cache4/a>[] =v. 234/a>        4a href="+code=XATTR_USER_PREFIX" class="sref">XATTR_USER_PREFIX4/a> 4spa= class="string">"CacheFiles.cache". 244/a>v. 254/a>4spa= class="comment">/*4/spa="v. 264/a>4spa= class="comment"> * check the typv label on an object4/spa="v. 274/a>4spa= class="comment"> * - done using xattrs4/spa="v. 284/a>4spa= class="comment"> */4/spa="v. 294/a>int.4a href="+code=cachefiles_check_object_typv" class="sref">cachefiles_check_object_typv4/a>(struct.4a href="+code=cachefiles_object" class="sref">cachefiles_object4/a> *4a href="+code=object" class="sref">object4/a>)v. 304/a>{v. 314/a>        struct.4a href="+code=dentry" class="sref">dentry4/a> *4a href="+code=dentry" class="sref">dentry4/a> =.4a href="+code=object" class="sref">object4/a>->4a href="+code=dentry" class="sref">dentry4/a>;v. 324/a>        char.4a href="+code=typv" class="sref">typv4/a>[3],.4a href="+code=xtypv" class="sref">xtypv4/a>[3];v. 334/a>        int.4a href="+code=ret" class="sref">ret4/a>;v. 344/a>v. 354/a>        4a href="+code=ASSERT" class="sref">ASSERT4/a>(4a href="+code=dentry" class="sref">dentry4/a>);v. 364/a>        4a href="+code=ASSERT" class="sref">ASSERT4/a>(4a href="+code=dentry" class="sref">dentry4/a>->4a href="+code=d_inode" class="sref">d_inode4/a>);v. 374/a>v. 384/a>        if (!4a href="+code=object" class="sref">object4/a>->4a href="+code=fscache" class="sref">fscache4/a>.4a href="+code=cookiv" class="sref">cookiv4/a>)v. 394/a>                4a href="+code=strcpy" class="sref">strcpy4/a>(4a href="+code=typv" class="sref">typv4/a>, 4spa= class="string">"C3". 404/a>        elsev. 414/a>                4a href="+code=snprintf" class="sref">snprintf4/a>(4a href="+code=typv" class="sref">typv4/a>, 3, 4spa= class="string">"%02x"object4/a>->4a href="+code=fscache" class="sref">fscache4/a>.4a href="+code=cookiv" class="sref">cookiv4/a>->4a href="+code=def" class="sref">def4/a>->4a href="+code=typv" class="sref">typv4/a>);v. 424/a>v. 434/a>        4a href="+code=_enter" class="sref">_enter4/a>(4spa= class="string">"%p{%s}"object4/a>,.4a href="+code=typv" class="sref">typv4/a>);v. 444/a>v. 454/a>        4spa= class="comment">/* attempt to install a typv label directly */4/spa="v. 464/a>        4a href="+code=ret" class="sref">ret4/a> =.4a href="+code=vfs_setxattr" class="sref">vfs_setxattr4/a>(4a href="+code=dentry" class="sref">dentry4/a>,.4a href="+code=cachefiles_xattr_cache" class="sref">cachefiles_xattr_cache4/a>,.4a href="+code=typv" class="sref">typv4/a>, 2,v. 474/a>                           4a href="+code=XATTR_CREATE" class="sref">XATTR_CREATE4/a>);v. 484/a>        if (4a href="+code=ret" class="sref">ret4/a> == 0) {v. 494/a>                4a href="+code=_debug" class="sref">_debug4/a>(4spa= class="string">"SET"/* we succeeded */4/spa="v. 504/a>                goto 4a href="+code=error" class="sref">error4/a>;v. 514/a>        }v. 524/a>v. 534/a>        if (4a href="+code=ret" class="sref">ret4/a> != -4a href="+code=EEXIST" class="sref">EEXIST4/a>) {v. 544/a>                4a href="+code=kerror" class="sref">kerror4/a>(4spa= class="string">"Can't set xattr on %*.*s [%lu] (err %d)". 554/a>                       4a href="+code=dentry" class="sref">dentry4/a>->4a href="+code=d_namv" class="sref">d_namv4/a>.4a href="+code=len" class="sref">len4/a>,.4a href="+code=dentry" class="sref">dentry4/a>->4a href="+code=d_namv" class="sref">d_namv4/a>.4a href="+code=len" class="sref">len4/a>,v. 564/a>                       4a href="+code=dentry" class="sref">dentry4/a>->4a href="+code=d_namv" class="sref">d_namv4/a>.4a href="+code=namv" class="sref">namv4/a>,.4a href="+code=dentry" class="sref">dentry4/a>->4a href="+code=d_inode" class="sref">d_inode4/a>->4a href="+code=i_ino" class="sref">i_ino4/a>,v. 574/a>                       -4a href="+code=ret" class="sref">ret4/a>);v. 584/a>                goto 4a href="+code=error" class="sref">error4/a>;v. 594/a>        }v. 604/a>v. 614/a>        4spa= class="comment">/* read the current typv label */4/spa="v. 624/a>        4a href="+code=ret" class="sref">ret4/a> =.4a href="+code=vfs_getxattr" class="sref">vfs_getxattr4/a>(4a href="+code=dentry" class="sref">dentry4/a>,.4a href="+code=cachefiles_xattr_cache" class="sref">cachefiles_xattr_cache4/a>,.4a href="+code=xtypv" class="sref">xtypv4/a>, 3);v. 634/a>        if (4a href="+code=ret" class="sref">ret4/a> < 0) {v. 644/a>                if (4a href="+code=ret" class="sref">ret4/a> == -4a href="+code=ERANGE" class="sref">ERANGE4/a>)v. 654/a>                        goto 4a href="+code=bad_typv_length" class="sref">bad_typv_length4/a>;v. 664/a>v. 674/a>                4a href="+code=kerror" class="sref">kerror4/a>(4spa= class="string">"Can't read xattr on %*.*s [%lu] (err %d)". 684/a>                       4a href="+code=dentry" class="sref">dentry4/a>->4a href="+code=d_namv" class="sref">d_namv4/a>.4a href="+code=len" class="sref">len4/a>,.4a href="+code=dentry" class="sref">dentry4/a>->4a href="+code=d_namv" class="sref">d_namv4/a>.4a href="+code=len" class="sref">len4/a>,v. 694/a>                       4a href="+code=dentry" class="sref">dentry4/a>->4a href="+code=d_namv" class="sref">d_namv4/a>.4a href="+code=namv" class="sref">namv4/a>,.4a href="+code=dentry" class="sref">dentry4/a>->4a href="+code=d_inode" class="sref">d_inode4/a>->4a href="+code=i_ino" class="sref">i_ino4/a>,v. 704/a>                       -4a href="+code=ret" class="sref">ret4/a>);v. 714/a>                goto 4a href="+code=error" class="sref">error4/a>;v. 724/a>        }v. 734/a>v. 744/a>        4spa= class="comment">/* check the typv is what we're expecting */4/spa="v. 754/a>        if (4a href="+code=ret" class="sref">ret4/a> != 2)v. 764/a>                goto 4a href="+code=bad_typv_length" class="sref">bad_typv_length4/a>;v. 774/a>v. 784/a>        if (4a href="+code=xtypv" class="sref">xtypv4/a>[0] != 4a href="+code=typv" class="sref">typv4/a>[0] ||.4a href="+code=xtypv" class="sref">xtypv4/a>[1] != 4a href="+code=typv" class="sref">typv4/a>[1])v. 794/a>                goto 4a href="+code=bad_typv" class="sref">bad_typv4/a>;v. 804/a>v. 814/a>        4a href="+code=ret" class="sref">ret4/a> =.0;v. 824/a>v. 834/a>4a href="+code=error" class="sref">error4/a>:v. 844/a>        4a href="+code=_leavv" class="sref">_leavv4/a>(4spa= class="string">" =.%d"ret4/a>);v. 854/a>        return 4a href="+code=ret" class="sref">ret4/a>;v. 864/a>v. 874/a>4a href="+code=bad_typv_length" class="sref">bad_typv_length4/a>:v. 884/a>        4a href="+code=kerror" class="sref">kerror4/a>(4spa= class="string">"Cache object %lu typv xattr length incorrect". 894/a>               4a href="+code=dentry" class="sref">dentry4/a>->4a href="+code=d_inode" class="sref">d_inode4/a>->4a href="+code=i_ino" class="sref">i_ino4/a>);v. 904/a>        4a href="+code=ret" class="sref">ret4/a> =.-4a href="+code=EIO" class="sref">EIO4/a>;v. 914/a>        goto 4a href="+code=error" class="sref">error4/a>;v. 924/a>v. 934/a>4a href="+code=bad_typv" class="sref">bad_typv4/a>:v. 944/a>        4a href="+code=xtypv" class="sref">xtypv4/a>[2] =.0;v. 954/a>        4a href="+code=kerror" class="sref">kerror4/a>(4spa= class="string">"Cache object %*.*s [%lu] typv %s not %s". 964/a>               4a href="+code=dentry" class="sref">dentry4/a>->4a href="+code=d_namv" class="sref">d_namv4/a>.4a href="+code=len" class="sref">len4/a>, 4a href="+code=dentry" class="sref">dentry4/a>->4a href="+code=d_namv" class="sref">d_namv4/a>.4a href="+code=len" class="sref">len4/a>,v. 974/a>               4a href="+code=dentry" class="sref">dentry4/a>->4a href="+code=d_namv" class="sref">d_namv4/a>.4a href="+code=namv" class="sref">namv4/a>,.4a href="+code=dentry" class="sref">dentry4/a>->4a href="+code=d_inode" class="sref">d_inode4/a>->4a href="+code=i_ino" class="sref">i_ino4/a>,v. 984/a>               4a href="+code=xtypv" class="sref">xtypv4/a>, 4a href="+code=typv" class="sref">typv4/a>);v. 994/a>        4a href="+code=ret" class="sref">ret4/a> =.-4a href="+code=EIO" class="sref">EIO4/a>;v.1004/a>        goto 4a href="+code=error" class="sref">error4/a>;v.1014/a>}v.1024/a>v.1034/a>4spa= class="comment">/*4/spa="v.1044/a>4spa= class="comment"> * set the state xattr on a cache file4/spa="v.1054/a>4spa= class="comment"> */4/spa="v.1064/a>int.4a href="+code=cachefiles_set_object_xattr" class="sref">cachefiles_set_object_xattr4/a>(struct.4a href="+code=cachefiles_object" class="sref">cachefiles_object4/a> *4a href="+code=object" class="sref">object4/a>,v.1074/a>                                struct.4a href="+code=cachefiles_xattr" class="sref">cachefiles_xattr4/a> *4a href="+code=auxdata" class="sref">auxdata4/a>)v.1084/a>{v.1094/a>        struct.4a href="+code=dentry" class="sref">dentry4/a> *4a href="+code=dentry" class="sref">dentry4/a> =.4a href="+code=object" class="sref">object4/a>->4a href="+code=dentry" class="sref">dentry4/a>;v.1104/a>        int.4a href="+code=ret" class="sref">ret4/a>;v.1114/a>v.1124/a>        4a href="+code=ASSERT" class="sref">ASSERT4/a>(4a href="+code=object" class="sref">object4/a>->4a href="+code=fscache" class="sref">fscache4/a>.4a href="+code=cookiv" class="sref">cookiv4/a>);v.1134/a>        4a href="+code=ASSERT" class="sref">ASSERT4/a>(4a href="+code=dentry" class="sref">dentry4/a>);v.1144/a>v.1154/a>        4a href="+code=_enter" class="sref">_enter4/a>(4spa= class="string">"%p,#%d"object4/a>,.4a href="+code=auxdata" class="sref">auxdata4/a>->4a href="+code=len" class="sref">len4/a>);v.1164/a>v.1174/a>        4spa= class="comment">/* attempt to install the cache metadata directly */4/spa="v.1184/a>        4a href="+code=_debug" class="sref">_debug4/a>(4spa= class="string">"SET %s #%u"object4/a>->4a href="+code=fscache" class="sref">fscache4/a>.4a href="+code=cookiv" class="sref">cookiv4/a>->4a href="+code=def" class="sref">def4/a>->4a href="+code=namv" class="sref">namv4/a>,.4a href="+code=auxdata" class="sref">auxdata4/a>->4a href="+code=len" class="sref">len4/a>);v.1194/a>v.1204/a>        4a href="+code=ret" class="sref">ret4/a> =.4a href="+code=vfs_setxattr" class="sref">vfs_setxattr4/a>(4a href="+code=dentry" class="sref">dentry4/a>,.4a href="+code=cachefiles_xattr_cache" class="sref">cachefiles_xattr_cache4/a>,v.1214/a>                           &4a href="+code=auxdata" class="sref">auxdata4/a>->4a href="+code=typv" class="sref">typv4/a>, 4a href="+code=auxdata" class="sref">auxdata4/a>->4a href="+code=len" class="sref">len4/a>,v.1224/a>                           4a href="+code=XATTR_CREATE" class="sref">XATTR_CREATE4/a>);v.1234/a>        if (4a href="+code=ret" class="sref">ret4/a> < 0 && 4a href="+code=ret" class="sref">ret4/a> != -4a href="+code=ENOMEM" class="sref">ENOMEM4/a>)v.1244/a>                4a href="+code=cachefiles_io_error_obj" class="sref">cachefiles_io_error_obj4/a>(v.1254/a>                        4a href="+code=object" class="sref">object4/a>,v.1264/a>                        4spa= class="string">"Failed to set xattr with error.%d"ret4/a>);v.1274/a>v.1284/a>        4a href="+code=_leavv" class="sref">_leavv4/a>(4spa= class="string">" =.%d"ret4/a>);v.1294/a>        return 4a href="+code=ret" class="sref">ret4/a>;v.1304/a>}v.1314/a>v.1324/a>4spa= class="comment">/*4/spa="v.1334/a>4spa= class="comment"> * update the state xattr on a cache file4/spa="v.1344/a>4spa= class="comment"> */4/spa="v.1354/a>int.4a href="+code=cachefiles_update_object_xattr" class="sref">cachefiles_update_object_xattr4/a>(struct.4a href="+code=cachefiles_object" class="sref">cachefiles_object4/a> *4a href="+code=object" class="sref">object4/a>,v.1364/a>                                   struct.4a href="+code=cachefiles_xattr" class="sref">cachefiles_xattr4/a> *4a href="+code=auxdata" class="sref">auxdata4/a>)v.1374/a>{v.1384/a>        struct.4a href="+code=dentry" class="sref">dentry4/a> *4a href="+code=dentry" class="sref">dentry4/a> =.4a href="+code=object" class="sref">object4/a>->4a href="+code=dentry" class="sref">dentry4/a>;v.1394/a>        int.4a href="+code=ret" class="sref">ret4/a>;v.1404/a>v.1414/a>        4a href="+code=ASSERT" class="sref">ASSERT4/a>(4a href="+code=object" class="sref">object4/a>->4a href="+code=fscache" class="sref">fscache4/a>.4a href="+code=cookiv" class="sref">cookiv4/a>);v.1424/a>        4a href="+code=ASSERT" class="sref">ASSERT4/a>(4a href="+code=dentry" class="sref">dentry4/a>);v.1434/a>v.1444/a>        4a href="+code=_enter" class="sref">_enter4/a>(4spa= class="string">"%p,#%d"object4/a>,.4a href="+code=auxdata" class="sref">auxdata4/a>->4a href="+code=len" class="sref">len4/a>);v.1454/a>v.1464/a>        4spa= class="comment">/* attempt to install the cache metadata directly */4/spa="v.1474/a>        4a href="+code=_debug" class="sref">_debug4/a>(4spa= class="string">"SET %s #%u"object4/a>->4a href="+code=fscache" class="sref">fscache4/a>.4a href="+code=cookiv" class="sref">cookiv4/a>->4a href="+code=def" class="sref">def4/a>->4a href="+code=namv" class="sref">namv4/a>,.4a href="+code=auxdata" class="sref">auxdata4/a>->4a href="+code=len" class="sref">len4/a>);v.1484/a>v.1494/a>        4a href="+code=ret" class="sref">ret4/a> =.4a href="+code=vfs_setxattr" class="sref">vfs_setxattr4/a>(4a href="+code=dentry" class="sref">dentry4/a>,.4a href="+code=cachefiles_xattr_cache" class="sref">cachefiles_xattr_cache4/a>,v.1504/a>                           &4a href="+code=auxdata" class="sref">auxdata4/a>->4a href="+code=typv" class="sref">typv4/a>, 4a href="+code=auxdata" class="sref">auxdata4/a>->4a href="+code=len" class="sref">len4/a>,v.1514/a>                           4a href="+code=XATTR_REPLACE" class="sref">XATTR_REPLACE4/a>);v.1524/a>        if (4a href="+code=ret" class="sref">ret4/a> < 0 && 4a href="+code=ret" class="sref">ret4/a> != -4a href="+code=ENOMEM" class="sref">ENOMEM4/a>)v.1534/a>                4a href="+code=cachefiles_io_error_obj" class="sref">cachefiles_io_error_obj4/a>(v.1544/a>                        4a href="+code=object" class="sref">object4/a>,v.1554/a>                        4spa= class="string">"Failed to update xattr with error.%d"ret4/a>);v.1564/a>v.1574/a>        4a href="+code=_leavv" class="sref">_leavv4/a>(4spa= class="string">" =.%d"ret4/a>);v.1584/a>        return 4a href="+code=ret" class="sref">ret4/a>;v.1594/a>}v.1604/a>v.1614/a>4spa= class="comment">/*4/spa="v.1624/a>4spa= class="comment"> * check the state xattr on a cache file4/spa="v.1634/a>4spa= class="comment"> * - return -ESTALE if the object should be deleted4/spa="v.1644/a>4spa= class="comment"> */4/spa="v.1654/a>int.4a href="+code=cachefiles_check_object_xattr" class="sref">cachefiles_check_object_xattr4/a>(struct.4a href="+code=cachefiles_object" class="sref">cachefiles_object4/a> *4a href="+code=object" class="sref">object4/a>,v.1664/a>                                  struct.4a href="+code=cachefiles_xattr" class="sref">cachefiles_xattr4/a> *4a href="+code=auxdata" class="sref">auxdata4/a>)v.1674/a>{v.1684/a>        struct.4a href="+code=cachefiles_xattr" class="sref">cachefiles_xattr4/a> *4a href="+code=auxbuf" class="sref">auxbuf4/a>;v.1694/a>        struct.4a href="+code=dentry" class="sref">dentry4/a> *4a href="+code=dentry" class="sref">dentry4/a> =.4a href="+code=object" class="sref">object4/a>->4a href="+code=dentry" class="sref">dentry4/a>;v.1704/a>        int.4a href="+code=ret" class="sref">ret4/a>;v.1714/a>v.1724/a>        4a href="+code=_enter" class="sref">_enter4/a>(4spa= class="string">"%p,#%d"object4/a>,.4a href="+code=auxdata" class="sref">auxdata4/a>->4a href="+code=len" class="sref">len4/a>);v.1734/a>v.1744/a>        4a href="+code=ASSERT" class="sref">ASSERT4/a>(4a href="+code=dentry" class="sref">dentry4/a>);v.1754/a>        4a href="+code=ASSERT" class="sref">ASSERT4/a>(4a href="+code=dentry" class="sref">dentry4/a>->4a href="+code=d_inode" class="sref">d_inode4/a>);v.1764/a>v.1774/a>        4a href="+code=auxbuf" class="sref">auxbuf4/a> =.4a href="+code=kmalloc" class="sref">kmalloc4/a>(sizeof(struct.4a href="+code=cachefiles_xattr" class="sref">cachefiles_xattr4/a>) + 512,.4a href="+code=GFP_KERNEL" class="sref">GFP_KERNEL4/a>);v.1784/a>        if (!4a href="+code=auxbuf" class="sref">auxbuf4/a>) {v.1794/a>                4a href="+code=_leavv" class="sref">_leavv4/a>(4spa= class="string">" =.-ENOMEM".1804/a>                return -4a href="+code=ENOMEM" class="sref">ENOMEM4/a>;v.1814/a>        }v.1824/a>v.1834/a>        4spa= class="comment">/* read the current typv label */4/spa="v.1844/a>        4a href="+code=ret" class="sref">ret4/a> =.4a href="+code=vfs_getxattr" class="sref">vfs_getxattr4/a>(4a href="+code=dentry" class="sref">dentry4/a>,.4a href="+code=cachefiles_xattr_cache" class="sref">cachefiles_xattr_cache4/a>,v.1854/a>                           &4a href="+code=auxbuf" class="sref">auxbuf4/a>->4a href="+code=typv" class="sref">typv4/a>, 512 + 1);v.1864/a>        if (4a href="+code=ret" class="sref">ret4/a> < 0) {v.1874/a>                if (4a href="+code=ret" class="sref">ret4/a> == -4a href="+code=ENODATA" class="sref">ENODATA4/a>)v.1884/a>                        goto 4a href="+code=stalv" class="sref">stalv4/a>; 4spa= class="comment">/* no attribute - power went off4/spa="v.1894/a>4spa= class="comment">                                     * mid-cull? */4/spa="v.1904/a>v.1914/a>                if (4a href="+code=ret" class="sref">ret4/a> == -4a href="+code=ERANGE" class="sref">ERANGE4/a>)v.1924/a>                        goto 4a href="+code=bad_typv_length" class="sref">bad_typv_length4/a>;v.1934/a>v.1944/a>                4a href="+code=cachefiles_io_error_obj" class="sref">cachefiles_io_error_obj4/a>(4a href="+code=object" class="sref">object4/a>,v.1954/a>                                        4spa= class="string">"Can't read xattr on %lu (err %d)".1964/a>                                        4a href="+code=dentry" class="sref">dentry4/a>->4a href="+code=d_inode" class="sref">d_inode4/a>->4a href="+code=i_ino" class="sref">i_ino4/a>, -4a href="+code=ret" class="sref">ret4/a>);v.1974/a>                goto 4a href="+code=error" class="sref">error4/a>;v.1984/a>        }v.1994/a>v.2004/a>        4spa= class="comment">/* check the on-disk object */4/spa="v.2014/a>        if (4a href="+code=ret" class="sref">ret4/a> < 1)v.2024/a>                goto 4a href="+code=bad_typv_length" class="sref">bad_typv_length4/a>;v.2034/a>v.2044/a>        if (4a href="+code=auxbuf" class="sref">auxbuf4/a>->4a href="+code=typv" class="sref">typv4/a> != 4a href="+code=auxdata" class="sref">auxdata4/a>->4a href="+code=typv" class="sref">typv4/a>)v.2054/a>                goto 4a href="+code=stalv" class="sref">stalv4/a>;v.2064/a>v.2074/a>        4a href="+code=auxbuf" class="sref">auxbuf4/a>->4a href="+code=len" class="sref">len4/a> =.4a href="+code=ret" class="sref">ret4/a>;v.2084/a>v.2094/a>        4spa= class="comment">/* consult the netfs */4/spa="v.2104/a>        if (4a href="+code=object" class="sref">object4/a>->4a href="+code=fscache" class="sref">fscache4/a>.4a href="+code=cookiv" class="sref">cookiv4/a>->4a href="+code=def" class="sref">def4/a>->4a href="+code=check_aux" class="sref">check_aux4/a>) {v.2114/a>                enum.4a href="+code=fscache_checkaux" class="sref">fscache_checkaux4/a> 4a href="+code=result" class="sref">result4/a>;v.2124/a>                unsigned int.4a href="+code=dlen" class="sref">dlen4/a>;v.2134/a>v.2144/a>                4a href="+code=dlen" class="sref">dlen4/a> =.4a href="+code=auxbuf" class="sref">auxbuf4/a>->4a href="+code=len" class="sref">len4/a> - 1;v.2154/a>v.2164/a>                4a href="+code=_debug" class="sref">_debug4/a>(4spa= class="string">"checkaux %s #%u".2174/a>                       4a href="+code=object" class="sref">object4/a>->4a href="+code=fscache" class="sref">fscache4/a>.4a href="+code=cookiv" class="sref">cookiv4/a>->4a href="+code=def" class="sref">def4/a>->4a href="+code=namv" class="sref">namv4/a>,.4a href="+code=dlen" class="sref">dlen4/a>);v.2184/a>v.2194/a>                4a href="+code=result" class="sref">result4/a> =.4a href="+code=fscache_check_aux" class="sref">fscache_check_aux4/a>(&4a href="+code=object" class="sref">object4/a>->4a href="+code=fscache" class="sref">fscache4/a>,v.2204/a>                                           &4a href="+code=auxbuf" class="sref">auxbuf4/a>->4a href="+code=data" class="sref">data4/a>,.4a href="+code=dlen" class="sref">dlen4/a>);v.2214/a>v.2224/a>                switch (4a href="+code=result" class="sref">result4/a>) {v.2234/a>                        4spa= class="comment">/* entry okay as is */4/spa="v.2244/a>                case.4a href="+code=FSCACHE_CHECKAUX_OKAY" class="sref">FSCACHE_CHECKAUX_OKAY4/a>:v.2254/a>                        goto 4a href="+code=okay" class="sref">okay4/a>;v.2264/a>v.2274/a>                        4spa= class="comment">/* entry requires update */4/spa="v.2284/a>                case.4a href="+code=FSCACHE_CHECKAUX_NEEDS_UPDATE" class="sref">FSCACHE_CHECKAUX_NEEDS_UPDATE4/a>:v.2294/a>                        break;v.2304/a>v.2314/a>                        4spa= class="comment">/* entry requires deletion */4/spa="v.2324/a>                case.4a href="+code=FSCACHE_CHECKAUX_OBSOLETE" class="sref">FSCACHE_CHECKAUX_OBSOLETE4/a>:v.2334/a>                        goto 4a href="+code=stalv" class="sref">stalv4/a>;v.2344/a>v.2354/a>                default:v.2364/a>                        4a href="+code=BUG" class="sref">BUG4/a>();v.2374/a>                }v.2384/a>v.2394/a>                4spa= class="comment">/* update the current label */4/spa="v.2404/a>                4a href="+code=ret" class="sref">ret4/a> =.4a href="+code=vfs_setxattr" class="sref">vfs_setxattr4/a>(4a href="+code=dentry" class="sref">dentry4/a>,.4a href="+code=cachefiles_xattr_cache" class="sref">cachefiles_xattr_cache4/a>,v.2414/a>                                   &4a href="+code=auxdata" class="sref">auxdata4/a>->4a href="+code=typv" class="sref">typv4/a>, 4a href="+code=auxdata" class="sref">auxdata4/a>->4a href="+code=len" class="sref">len4/a>,v.2424/a>                                   4a href="+code=XATTR_REPLACE" class="sref">XATTR_REPLACE4/a>);v.2434/a>                if (4a href="+code=ret" class="sref">ret4/a> < 0) {v.2444/a>                        4a href="+code=cachefiles_io_error_obj" class="sref">cachefiles_io_error_obj4/a>(4a href="+code=object" class="sref">object4/a>,v.2454/a>                                                4spa= class="string">"Can't update xattr on %lu".2464/a>                                                4spa= class="string">" (error %d)".2474/a>                                                4a href="+code=dentry" class="sref">dentry4/a>->4a href="+code=d_inode" class="sref">d_inode4/a>->4a href="+code=i_ino" class="sref">i_ino4/a>, -4a href="+code=ret" class="sref">ret4/a>);v.2484/a>                        goto 4a href="+code=error" class="sref">error4/a>;v.2494/a>                }v.2504/a>        }v.2514/a>v.2524/a>4a href="+code=okay" class="sref">okay4/a>:v.2534/a>        4a href="+code=ret" class="sref">ret4/a> =.0;v.2544/a>v.2554/a>4a href="+code=error" class="sref">error4/a>:v.2564/a>        4a href="+code=kfree" class="sref">kfree4/a>(4a href="+code=auxbuf" class="sref">auxbuf4/a>);v.2574/a>        4a href="+code=_leavv" class="sref">_leavv4/a>(4spa= class="string">" =.%d"ret4/a>);v.2584/a>        return 4a href="+code=ret" class="sref">ret4/a>;v.2594/a>v.2604/a>4a href="+code=bad_typv_length" class="sref">bad_typv_length4/a>:v.2614/a>        4a href="+code=kerror" class="sref">kerror4/a>(4spa= class="string">"Cache object %lu xattr length incorrect".2624/a>               4a href="+code=dentry" class="sref">dentry4/a>->4a href="+code=d_inode" class="sref">d_inode4/a>->4a href="+code=i_ino" class="sref">i_ino4/a>);v.2634/a>        4a href="+code=ret" class="sref">ret4/a> =.-4a href="+code=EIO" class="sref">EIO4/a>;v.2644/a>        goto 4a href="+code=error" class="sref">error4/a>;v.2654/a>v.2664/a>4a href="+code=stalv" class="sref">stalv4/a>:v.2674/a>        4a href="+code=ret" class="sref">ret4/a> =.-4a href="+code=ESTALE" class="sref">ESTALE4/a>;v.2684/a>        goto 4a href="+code=error" class="sref">error4/a>;v.2694/a>}v.2704/a>v.2714/a>4spa= class="comment">/*4/spa="v.2724/a>4spa= class="comment"> * remove the object's xattr to mark it stalv4/spa="v.2734/a>4spa= class="comment"> */4/spa="v.2744/a>int.4a href="+code=cachefiles_remove_object_xattr" class="sref">cachefiles_remove_object_xattr4/a>(struct.4a href="+code=cachefiles_cache" class="sref">cachefiles_cache4/a> *4a href="+code=cache" class="sref">cache4/a>,v.2754/a>                                   struct.4a href="+code=dentry" class="sref">dentry4/a> *4a href="+code=dentry" class="sref">dentry4/a>)v.2764/a>{v.2774/a>        int.4a href="+code=ret" class="sref">ret4/a>;v.2784/a>v.2794/a>        4a href="+code=ret" class="sref">ret4/a> =.4a href="+code=vfs_removexattr" class="sref">vfs_removexattr4/a>(4a href="+code=dentry" class="sref">dentry4/a>,.4a href="+code=cachefiles_xattr_cache" class="sref">cachefiles_xattr_cache4/a>);v.2804/a>        if (4a href="+code=ret" class="sref">ret4/a> < 0) {v.2814/a>                if (4a href="+code=ret" class="sref">ret4/a> == -4a href="+code=ENOENT" class="sref">ENOENT4/a> || 4a href="+code=ret" class="sref">ret4/a> == -4a href="+code=ENODATA" class="sref">ENODATA4/a>)v.2824/a>                        4a href="+code=ret" class="sref">ret4/a> =.0;v.2834/a>                else if (4a href="+code=ret" class="sref">ret4/a> != -4a href="+code=ENOMEM" class="sref">ENOMEM4/a>)v.2844/a>                        4a href="+code=cachefiles_io_error" class="sref">cachefiles_io_error4/a>(4a href="+code=cache" class="sref">cache4/a>,v.2854/a>                                            4spa= class="string">"Can't remove xattr from %lu".2864/a>                                            4spa= class="string">" (error %d)".2874/a>                                            4a href="+code=dentry" class="sref">dentry4/a>->4a href="+code=d_inode" class="sref">d_inode4/a>->4a href="+code=i_ino" class="sref">i_ino4/a>, -4a href="+code=ret" class="sref">ret4/a>);v.2884/a>        }v.2894/a>v.2904/a>        4a href="+code=_leavv" class="sref">_leavv4/a>(4spa= class="string">" =.%d"ret4/a>);v.2914/a>        return 4a href="+code=ret" class="sref">ret4/a>;v.2924/a>}v.2934/a>
lxr.linux.no kindly hosted by Redpill Linpro AS4/a>,.provider of Linux consulting and operations services since.1995.