Ticket #10140: report-3027b6.html

File report-3027b6.html, 194.4 KB (added by mt, 11 years ago)

Report by Clang Static Analyzer

Line 
1<!doctype html>
2<html>
3<head>
4<title>/home/haiku/haiku/haiku/src/add-ons/kernel/file_systems/nfs4/kernel_interface.cpp</title>
5<style type="text/css">
6 body { color:#000000; background-color:#ffffff }
7 body { font-family:Helvetica, sans-serif; font-size:10pt }
8 h1 { font-size:14pt }
9 .code { border-collapse:collapse; width:100%; }
10 .code { font-family: "Monospace", monospace; font-size:10pt }
11 .code { line-height: 1.2em }
12 .comment { color: green; font-style: oblique }
13 .keyword { color: blue }
14 .string_literal { color: red }
15 .directive { color: darkmagenta }
16 .expansion { display: none; }
17 .macro:hover .expansion { display: block; border: 2px solid #FF0000; padding: 2px; background-color:#FFF0F0; font-weight: normal; -webkit-border-radius:5px; -webkit-box-shadow:1px 1px 7px #000; position: absolute; top: -1em; left:10em; z-index: 1 }
18 .macro { color: darkmagenta; background-color:LemonChiffon; position: relative }
19 .num { width:2.5em; padding-right:2ex; background-color:#eeeeee }
20 .num { text-align:right; font-size:8pt }
21 .num { color:#444444 }
22 .line { padding-left: 1ex; border-left: 3px solid #ccc }
23 .line { white-space: pre }
24 .msg { -webkit-box-shadow:1px 1px 7px #000 }
25 .msg { -webkit-border-radius:5px }
26 .msg { font-family:Helvetica, sans-serif; font-size:8pt }
27 .msg { float:left }
28 .msg { padding:0.25em 1ex 0.25em 1ex }
29 .msg { margin-top:10px; margin-bottom:10px }
30 .msg { font-weight:bold }
31 .msg { max-width:60em; word-wrap: break-word; white-space: pre-wrap }
32 .msgT { padding:0x; spacing:0x }
33 .msgEvent { background-color:#fff8b4; color:#000000 }
34 .msgControl { background-color:#bbbbbb; color:#000000 }
35 .mrange { background-color:#dfddf3 }
36 .mrange { border-bottom:1px solid #6F9DBE }
37 .PathIndex { font-weight: bold; padding:0px 5px; margin-right:5px; }
38 .PathIndex { -webkit-border-radius:8px }
39 .PathIndexEvent { background-color:#bfba87 }
40 .PathIndexControl { background-color:#8c8c8c }
41 .PathNav a { text-decoration:none; font-size: larger }
42 .CodeInsertionHint { font-weight: bold; background-color: #10dd10 }
43 .CodeRemovalHint { background-color:#de1010 }
44 .CodeRemovalHint { border-bottom:1px solid #6F9DBE }
45 table.simpletable {
46 padding: 5px;
47 font-size:12pt;
48 margin:20px;
49 border-collapse: collapse; border-spacing: 0px;
50 }
51 td.rowname {
52 text-align:right; font-weight:bold; color:#444444;
53 padding-right:2ex; }
54</style>
55</head>
56<body>
57<!-- BUGDESC Memory allocated by strdup() should be deallocated by free(), not 'delete' -->
58
59<!-- BUGTYPE Bad deallocator -->
60
61<!-- BUGCATEGORY Memory Error -->
62
63<!-- BUGFILE /home/haiku/haiku/haiku/src/add-ons/kernel/file_systems/nfs4/kernel_interface.cpp -->
64
65<!-- BUGLINE 108 -->
66
67<!-- BUGPATHLENGTH 13 -->
68
69<!-- BUGMETAEND -->
70<!-- REPORTHEADER -->
71<h3>Bug Summary</h3>
72<table class="simpletable">
73<tr><td class="rowname">File:</td><td>src/add-ons/kernel/file_systems/nfs4/kernel_interface.cpp</td></tr>
74<tr><td class="rowname">Location:</td><td><a href="#EndPath">line 108, column 3</a></td></tr>
75<tr><td class="rowname">Description:</td><td>Memory allocated by strdup() should be deallocated by free(), not 'delete'</td></tr>
76</table>
77<!-- REPORTSUMMARYEXTRA -->
78<h3>Annotated Source Code</h3>
79<table class="code">
80<tr><td class="num" id="LN1">1</td><td class="line"><span class='comment'>/*</span></td></tr>
81<tr><td class="num" id="LN2">2</td><td class="line"> <span class='comment'>* Copyright 2012 Haiku, Inc. All rights reserved.</span></td></tr>
82<tr><td class="num" id="LN3">3</td><td class="line"> <span class='comment'>* Distributed under the terms of the MIT License.</span></td></tr>
83<tr><td class="num" id="LN4">4</td><td class="line"> <span class='comment'>*</span></td></tr>
84<tr><td class="num" id="LN5">5</td><td class="line"> <span class='comment'>* Authors:</span></td></tr>
85<tr><td class="num" id="LN6">6</td><td class="line"> <span class='comment'>* Paweł Dziepak, pdziepak@quarnos.org</span></td></tr>
86<tr><td class="num" id="LN7">7</td><td class="line"> <span class='comment'>*/</span></td></tr>
87<tr><td class="num" id="LN8">8</td><td class="line"> </td></tr>
88<tr><td class="num" id="LN9">9</td><td class="line"> </td></tr>
89<tr><td class="num" id="LN10">10</td><td class="line"><span class='directive'>#include &lt;stdio.h&gt;</span></td></tr>
90<tr><td class="num" id="LN11">11</td><td class="line"> </td></tr>
91<tr><td class="num" id="LN12">12</td><td class="line"><span class='directive'>#include &lt;AutoDeleter.h&gt;</span></td></tr>
92<tr><td class="num" id="LN13">13</td><td class="line"><span class='directive'>#include &lt;fs_cache.h&gt;</span></td></tr>
93<tr><td class="num" id="LN14">14</td><td class="line"><span class='directive'>#include &lt;fs_interface.h&gt;</span></td></tr>
94<tr><td class="num" id="LN15">15</td><td class="line"> </td></tr>
95<tr><td class="num" id="LN16">16</td><td class="line"><span class='directive'>#include "Connection.h"</span></td></tr>
96<tr><td class="num" id="LN17">17</td><td class="line"><span class='directive'>#include "FileSystem.h"</span></td></tr>
97<tr><td class="num" id="LN18">18</td><td class="line"><span class='directive'>#include "IdMap.h"</span></td></tr>
98<tr><td class="num" id="LN19">19</td><td class="line"><span class='directive'>#include "Inode.h"</span></td></tr>
99<tr><td class="num" id="LN20">20</td><td class="line"><span class='directive'>#include "NFS4Defs.h"</span></td></tr>
100<tr><td class="num" id="LN21">21</td><td class="line"><span class='directive'>#include "RequestBuilder.h"</span></td></tr>
101<tr><td class="num" id="LN22">22</td><td class="line"><span class='directive'>#include "ReplyInterpreter.h"</span></td></tr>
102<tr><td class="num" id="LN23">23</td><td class="line"><span class='directive'>#include "RootInode.h"</span></td></tr>
103<tr><td class="num" id="LN24">24</td><td class="line"><span class='directive'>#include "RPCCallbackServer.h"</span></td></tr>
104<tr><td class="num" id="LN25">25</td><td class="line"><span class='directive'>#include "RPCServer.h"</span></td></tr>
105<tr><td class="num" id="LN26">26</td><td class="line"><span class='directive'>#include "VnodeToInode.h"</span></td></tr>
106<tr><td class="num" id="LN27">27</td><td class="line"><span class='directive'>#include "WorkQueue.h"</span></td></tr>
107<tr><td class="num" id="LN28">28</td><td class="line"> </td></tr>
108<tr><td class="num" id="LN29">29</td><td class="line"><span class='directive'>#ifdef DEBUG</span></td></tr>
109<tr><td class="num" id="LN30">30</td><td class="line"><span class='directive'>#define TRACE_NFS4</span></td></tr>
110<tr><td class="num" id="LN31">31</td><td class="line"><span class='directive'>#endif</span></td></tr>
111<tr><td class="num" id="LN32">32</td><td class="line"> </td></tr>
112<tr><td class="num" id="LN33">33</td><td class="line"><span class='directive'>#ifdef TRACE_NFS4</span></td></tr>
113<tr><td class="num" id="LN34">34</td><td class="line"><span class='keyword'>static</span> mutex gTraceLock = <span class='macro'>MUTEX_INITIALIZER(NULL)<span class='expansion'>{ __null, __null, -1, 0 }</span></span>;</td></tr>
114<tr><td class="num" id="LN35">35</td><td class="line"> </td></tr>
115<tr><td class="num" id="LN36">36</td><td class="line"><span class='directive'>#define <span class='macro'>TRACE(x...)<span class='expansion'>(void)0</span></span> \</span></td></tr>
116<tr><td class="num" id="LN37">37</td><td class="line"> <span class='directive'>{ \</span></td></tr>
117<tr><td class="num" id="LN38">38</td><td class="line"> <span class='directive'>mutex_lock(&amp;gTraceLock); \</span></td></tr>
118<tr><td class="num" id="LN39">39</td><td class="line"> <span class='directive'>dprintf("nfs4: %s(): ", __FUNCTION__); \</span></td></tr>
119<tr><td class="num" id="LN40">40</td><td class="line"> <span class='directive'>dprintf(x); \</span></td></tr>
120<tr><td class="num" id="LN41">41</td><td class="line"> <span class='directive'>dprintf("\n"); \</span></td></tr>
121<tr><td class="num" id="LN42">42</td><td class="line"> <span class='directive'>mutex_unlock(&amp;gTraceLock); \</span></td></tr>
122<tr><td class="num" id="LN43">43</td><td class="line"> <span class='directive'>}</span></td></tr>
123<tr><td class="num" id="LN44">44</td><td class="line"><span class='directive'>#else</span></td></tr>
124<tr><td class="num" id="LN45">45</td><td class="line"><span class='directive'>#define <span class='macro'>TRACE(x...)<span class='expansion'>(void)0</span></span> (void)0</span></td></tr>
125<tr><td class="num" id="LN46">46</td><td class="line"><span class='directive'>#endif</span></td></tr>
126<tr><td class="num" id="LN47">47</td><td class="line"> </td></tr>
127<tr><td class="num" id="LN48">48</td><td class="line"><span class='keyword'>extern</span> fs_volume_ops gNFSv4VolumeOps;</td></tr>
128<tr><td class="num" id="LN49">49</td><td class="line"><span class='keyword'>extern</span> fs_vnode_ops gNFSv4VnodeOps;</td></tr>
129<tr><td class="num" id="LN50">50</td><td class="line"> </td></tr>
130<tr><td class="num" id="LN51">51</td><td class="line"> </td></tr>
131<tr><td class="num" id="LN52">52</td><td class="line">RPC::ServerManager* gRPCServerManager;</td></tr>
132<tr><td class="num" id="LN53">53</td><td class="line"> </td></tr>
133<tr><td class="num" id="LN54">54</td><td class="line"> </td></tr>
134<tr><td class="num" id="LN55">55</td><td class="line">RPC::ProgramData*</td></tr>
135<tr><td class="num" id="LN56">56</td><td class="line">CreateNFS4Server(RPC::Server* serv)</td></tr>
136<tr><td class="num" id="LN57">57</td><td class="line">{</td></tr>
137<tr><td class="num" id="LN58">58</td><td class="line"> <span class='keyword'>return</span> <span class='keyword'>new</span> NFS4Server(serv);</td></tr>
138<tr><td class="num" id="LN59">59</td><td class="line">}</td></tr>
139<tr><td class="num" id="LN60">60</td><td class="line"> </td></tr>
140<tr><td class="num" id="LN61">61</td><td class="line"> </td></tr>
141<tr><td class="num" id="LN62">62</td><td class="line"><span class='comment'>// Format: ip{4,6}_address:path options</span></td></tr>
142<tr><td class="num" id="LN63">63</td><td class="line"><span class='comment'>// Available options:</span></td></tr>
143<tr><td class="num" id="LN64">64</td><td class="line"><span class='comment'>// hard - retry requests until success</span></td></tr>
144<tr><td class="num" id="LN65">65</td><td class="line"><span class='comment'>// soft - retry requests no more than retrans times (default)</span></td></tr>
145<tr><td class="num" id="LN66">66</td><td class="line"><span class='comment'>// timeo=X - request time limit before next retransmission (default: 60s)</span></td></tr>
146<tr><td class="num" id="LN67">67</td><td class="line"><span class='comment'>// retrans=X - retry requests X times (default: 5)</span></td></tr>
147<tr><td class="num" id="LN68">68</td><td class="line"><span class='comment'>// ac - use metadata cache (default)</span></td></tr>
148<tr><td class="num" id="LN69">69</td><td class="line"><span class='comment'>// noac - do not use metadata cache</span></td></tr>
149<tr><td class="num" id="LN70">70</td><td class="line"><span class='comment'>// xattr-emu - emulate named attributes</span></td></tr>
150<tr><td class="num" id="LN71">71</td><td class="line"><span class='comment'>// noxattr-emu - do not emulate named attributes (default)</span></td></tr>
151<tr><td class="num" id="LN72">72</td><td class="line"><span class='comment'>// port=X - connect to port X (default: 2049)</span></td></tr>
152<tr><td class="num" id="LN73">73</td><td class="line"><span class='comment'>// proto=X - user transport protocol X (default: tcp)</span></td></tr>
153<tr><td class="num" id="LN74">74</td><td class="line"><span class='comment'>// dirtime=X - attempt revalidate directory cache not more often than each X</span></td></tr>
154<tr><td class="num" id="LN75">75</td><td class="line"><span class='comment'>// seconds</span></td></tr>
155<tr><td class="num" id="LN76">76</td><td class="line"><span class='keyword'>static</span> status_t</td></tr>
156<tr><td class="num" id="LN77">77</td><td class="line">ParseArguments(<span class='keyword'>const</span> <span class='keyword'>char</span>* _args, AddressResolver** address, <span class='keyword'>char</span>** _server,</td></tr>
157<tr><td class="num" id="LN78">78</td><td class="line"> <span class='keyword'>char</span>** _path, MountConfiguration* conf)</td></tr>
158<tr><td class="num" id="LN79">79</td><td class="line">{</td></tr>
159<tr><td class="num" id="LN80">80</td><td class="line"> <span class='keyword'>if</span> (_args == <span class='macro'>NULL<span class='expansion'>__null</span></span>)</td></tr>
160<tr><td class="num"></td><td class="line"><div id="Path5" class="msg msgControl" style="margin-left:9ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexControl">5</div></td><td><div class="PathNav"><a href="#Path4" title="Previous event (4)">&#x2190;</a></div></td></td><td>Taking false branch</td><td><div class="PathNav"><a href="#Path6" title="Next event (6)">&#x2192;</a></div></td></tr></table></div></td></tr>
161<tr><td class="num" id="LN81">81</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_BAD_VALUE<span class='expansion'>((-2147483647 - 1) + 5)</span></span>;</td></tr>
162<tr><td class="num" id="LN82">82</td><td class="line"> </td></tr>
163<tr><td class="num" id="LN83">83</td><td class="line"> <span class='keyword'>char</span>* args = strdup(_args);</td></tr>
164<tr><td class="num" id="LN84">84</td><td class="line"> <span class='keyword'>if</span> (args == <span class='macro'>NULL<span class='expansion'>__null</span></span>)</td></tr>
165<tr><td class="num"></td><td class="line"><div id="Path6" class="msg msgControl" style="margin-left:9ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexControl">6</div></td><td><div class="PathNav"><a href="#Path5" title="Previous event (5)">&#x2190;</a></div></td></td><td>Taking false branch</td><td><div class="PathNav"><a href="#Path7" title="Next event (7)">&#x2192;</a></div></td></tr></table></div></td></tr>
166<tr><td class="num" id="LN85">85</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_NO_MEMORY<span class='expansion'>((-2147483647 - 1) + 0)</span></span>;</td></tr>
167<tr><td class="num" id="LN86">86</td><td class="line"> MemoryDeleter argsDeleter(args);</td></tr>
168<tr><td class="num" id="LN87">87</td><td class="line"> </td></tr>
169<tr><td class="num" id="LN88">88</td><td class="line"> <span class='keyword'>char</span>* options = strchr(args, ' ');</td></tr>
170<tr><td class="num" id="LN89">89</td><td class="line"> <span class='keyword'>if</span> (options != <span class='macro'>NULL<span class='expansion'>__null</span></span>)</td></tr>
171<tr><td class="num"></td><td class="line"><div id="Path7" class="msg msgControl" style="margin-left:9ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexControl">7</div></td><td><div class="PathNav"><a href="#Path6" title="Previous event (6)">&#x2190;</a></div></td></td><td>Taking false branch</td><td><div class="PathNav"><a href="#Path8" title="Next event (8)">&#x2192;</a></div></td></tr></table></div></td></tr>
172<tr><td class="num" id="LN90">90</td><td class="line"> *options++ = '\0';</td></tr>
173<tr><td class="num" id="LN91">91</td><td class="line"> </td></tr>
174<tr><td class="num" id="LN92">92</td><td class="line"> <span class='keyword'>char</span>* path = strrchr(args, ':');</td></tr>
175<tr><td class="num" id="LN93">93</td><td class="line"> <span class='keyword'>if</span> (path == <span class='macro'>NULL<span class='expansion'>__null</span></span>)</td></tr>
176<tr><td class="num"></td><td class="line"><div id="Path8" class="msg msgControl" style="margin-left:9ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexControl">8</div></td><td><div class="PathNav"><a href="#Path7" title="Previous event (7)">&#x2190;</a></div></td></td><td>Taking false branch</td><td><div class="PathNav"><a href="#Path9" title="Next event (9)">&#x2192;</a></div></td></tr></table></div></td></tr>
177<tr><td class="num" id="LN94">94</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_MISMATCHED_VALUES<span class='expansion'>((-2147483647 - 1) + 6)</span></span>;</td></tr>
178<tr><td class="num" id="LN95">95</td><td class="line"> *path++ = '\0';</td></tr>
179<tr><td class="num" id="LN96">96</td><td class="line"> </td></tr>
180<tr><td class="num" id="LN97">97</td><td class="line"> *_server = <span class="mrange">strdup(args)</span>;</td></tr>
181<tr><td class="num"></td><td class="line"><div id="Path9" class="msg msgEvent" style="margin-left:20ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexEvent">9</div></td><td><div class="PathNav"><a href="#Path8" title="Previous event (8)">&#x2190;</a></div></td></td><td>Memory is allocated</td><td><div class="PathNav"><a href="#Path10" title="Next event (10)">&#x2192;</a></div></td></tr></table></div></td></tr>
182<tr><td class="num" id="LN98">98</td><td class="line"> <span class='keyword'>if</span> (*_server == <span class='macro'>NULL<span class='expansion'>__null</span></span>)</td></tr>
183<tr><td class="num"></td><td class="line"><div id="Path10" class="msg msgControl" style="margin-left:9ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexControl">10</div></td><td><div class="PathNav"><a href="#Path9" title="Previous event (9)">&#x2190;</a></div></td></td><td>Taking false branch</td><td><div class="PathNav"><a href="#Path11" title="Next event (11)">&#x2192;</a></div></td></tr></table></div></td></tr>
184<tr><td class="num" id="LN99">99</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_NO_MEMORY<span class='expansion'>((-2147483647 - 1) + 0)</span></span>;</td></tr>
185<tr><td class="num" id="LN100">100</td><td class="line"> *address = <span class='keyword'>new</span> AddressResolver(args);</td></tr>
186<tr><td class="num" id="LN101">101</td><td class="line"> <span class='keyword'>if</span> (*address == <span class='macro'>NULL<span class='expansion'>__null</span></span>) {</td></tr>
187<tr><td class="num"></td><td class="line"><div id="Path11" class="msg msgControl" style="margin-left:9ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexControl">11</div></td><td><div class="PathNav"><a href="#Path10" title="Previous event (10)">&#x2190;</a></div></td></td><td>Taking false branch</td><td><div class="PathNav"><a href="#Path12" title="Next event (12)">&#x2192;</a></div></td></tr></table></div></td></tr>
188<tr><td class="num" id="LN102">102</td><td class="line"> <span class='keyword'>delete</span> *_server;</td></tr>
189<tr><td class="num" id="LN103">103</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_NO_MEMORY<span class='expansion'>((-2147483647 - 1) + 0)</span></span>;</td></tr>
190<tr><td class="num" id="LN104">104</td><td class="line"> }</td></tr>
191<tr><td class="num" id="LN105">105</td><td class="line"> </td></tr>
192<tr><td class="num" id="LN106">106</td><td class="line"> *_path = strdup(path);</td></tr>
193<tr><td class="num" id="LN107">107</td><td class="line"> <span class='keyword'>if</span> (*_path == <span class='macro'>NULL<span class='expansion'>__null</span></span>) {</td></tr>
194<tr><td class="num"></td><td class="line"><div id="Path12" class="msg msgControl" style="margin-left:9ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexControl">12</div></td><td><div class="PathNav"><a href="#Path11" title="Previous event (11)">&#x2190;</a></div></td></td><td>Taking true branch</td><td><div class="PathNav"><a href="#EndPath" title="Next event (13)">&#x2192;</a></div></td></tr></table></div></td></tr>
195<tr><td class="num" id="LN108">108</td><td class="line"> <span class='keyword'>delete</span> <span class="mrange">*_server</span>;</td></tr>
196<tr><td class="num"></td><td class="line"><div id="EndPath" class="msg msgEvent" style="margin-left:17ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexEvent">13</div></td><td><div class="PathNav"><a href="#Path12" title="Previous event (12)">&#x2190;</a></div></td></td><td>Memory allocated by strdup() should be deallocated by free(), not 'delete'</td></tr></table></div></td></tr>
197<tr><td class="num" id="LN109">109</td><td class="line"> <span class='keyword'>delete</span> *address;</td></tr>
198<tr><td class="num" id="LN110">110</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_NO_MEMORY<span class='expansion'>((-2147483647 - 1) + 0)</span></span>;</td></tr>
199<tr><td class="num" id="LN111">111</td><td class="line"> }</td></tr>
200<tr><td class="num" id="LN112">112</td><td class="line"> </td></tr>
201<tr><td class="num" id="LN113">113</td><td class="line"> conf-&gt;fHard = <span class='keyword'>false</span>;</td></tr>
202<tr><td class="num" id="LN114">114</td><td class="line"> conf-&gt;fRetryLimit = 5;</td></tr>
203<tr><td class="num" id="LN115">115</td><td class="line"> conf-&gt;fRequestTimeout = sSecToBigTime(60);</td></tr>
204<tr><td class="num" id="LN116">116</td><td class="line"> conf-&gt;fEmulateNamedAttrs = <span class='keyword'>false</span>;</td></tr>
205<tr><td class="num" id="LN117">117</td><td class="line"> conf-&gt;fCacheMetadata = <span class='keyword'>true</span>;</td></tr>
206<tr><td class="num" id="LN118">118</td><td class="line"> conf-&gt;fDirectoryCacheTime = sSecToBigTime(5);</td></tr>
207<tr><td class="num" id="LN119">119</td><td class="line"> </td></tr>
208<tr><td class="num" id="LN120">120</td><td class="line"> <span class='keyword'>char</span>* optionsEnd = <span class='macro'>NULL<span class='expansion'>__null</span></span>;</td></tr>
209<tr><td class="num" id="LN121">121</td><td class="line"> <span class='keyword'>if</span> (options != <span class='macro'>NULL<span class='expansion'>__null</span></span>)</td></tr>
210<tr><td class="num" id="LN122">122</td><td class="line"> optionsEnd = strchr(options, ' ');</td></tr>
211<tr><td class="num" id="LN123">123</td><td class="line"> <span class='keyword'>while</span> (options != <span class='macro'>NULL<span class='expansion'>__null</span></span> &amp;&amp; *options != '\0') {</td></tr>
212<tr><td class="num" id="LN124">124</td><td class="line"> <span class='keyword'>if</span> (optionsEnd != <span class='macro'>NULL<span class='expansion'>__null</span></span>)</td></tr>
213<tr><td class="num" id="LN125">125</td><td class="line"> *optionsEnd++ = '\0';</td></tr>
214<tr><td class="num" id="LN126">126</td><td class="line"> </td></tr>
215<tr><td class="num" id="LN127">127</td><td class="line"> <span class='keyword'>if</span> (strcmp(options, <span class='string_literal'>"hard"</span>) == 0)</td></tr>
216<tr><td class="num" id="LN128">128</td><td class="line"> conf-&gt;fHard = <span class='keyword'>true</span>;</td></tr>
217<tr><td class="num" id="LN129">129</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (strncmp(options, <span class='string_literal'>"retrans="</span>, 8) == 0) {</td></tr>
218<tr><td class="num" id="LN130">130</td><td class="line"> options += strlen(<span class='string_literal'>"retrans="</span>);</td></tr>
219<tr><td class="num" id="LN131">131</td><td class="line"> conf-&gt;fRetryLimit = atoi(options);</td></tr>
220<tr><td class="num" id="LN132">132</td><td class="line"> } <span class='keyword'>else</span> <span class='keyword'>if</span> (strncmp(options, <span class='string_literal'>"timeo="</span>, 6) == 0) {</td></tr>
221<tr><td class="num" id="LN133">133</td><td class="line"> options += strlen(<span class='string_literal'>"timeo="</span>);</td></tr>
222<tr><td class="num" id="LN134">134</td><td class="line"> conf-&gt;fRequestTimeout = atoi(options);</td></tr>
223<tr><td class="num" id="LN135">135</td><td class="line"> } <span class='keyword'>else</span> <span class='keyword'>if</span> (strcmp(options, <span class='string_literal'>"noac"</span>) == 0)</td></tr>
224<tr><td class="num" id="LN136">136</td><td class="line"> conf-&gt;fCacheMetadata = <span class='keyword'>false</span>;</td></tr>
225<tr><td class="num" id="LN137">137</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (strcmp(options, <span class='string_literal'>"xattr-emu"</span>) == 0)</td></tr>
226<tr><td class="num" id="LN138">138</td><td class="line"> conf-&gt;fEmulateNamedAttrs = <span class='keyword'>true</span>;</td></tr>
227<tr><td class="num" id="LN139">139</td><td class="line"> <span class='keyword'>else</span> <span class='keyword'>if</span> (strncmp(options, <span class='string_literal'>"port="</span>, 5) == 0) {</td></tr>
228<tr><td class="num" id="LN140">140</td><td class="line"> options += strlen(<span class='string_literal'>"port="</span>);</td></tr>
229<tr><td class="num" id="LN141">141</td><td class="line"> (*address)-&gt;ForcePort(atoi(options));</td></tr>
230<tr><td class="num" id="LN142">142</td><td class="line"> } <span class='keyword'>else</span> <span class='keyword'>if</span> (strncmp(options, <span class='string_literal'>"proto="</span>, 6) == 0) {</td></tr>
231<tr><td class="num" id="LN143">143</td><td class="line"> options += strlen(<span class='string_literal'>"proto="</span>);</td></tr>
232<tr><td class="num" id="LN144">144</td><td class="line"> (*address)-&gt;ForceProtocol(options);</td></tr>
233<tr><td class="num" id="LN145">145</td><td class="line"> } <span class='keyword'>else</span> <span class='keyword'>if</span> (strncmp(options, <span class='string_literal'>"dirtime="</span>, 8) == 0) {</td></tr>
234<tr><td class="num" id="LN146">146</td><td class="line"> options += strlen(<span class='string_literal'>"dirtime="</span>);</td></tr>
235<tr><td class="num" id="LN147">147</td><td class="line"> conf-&gt;fDirectoryCacheTime = sSecToBigTime(atoi(options));</td></tr>
236<tr><td class="num" id="LN148">148</td><td class="line"> }</td></tr>
237<tr><td class="num" id="LN149">149</td><td class="line"> </td></tr>
238<tr><td class="num" id="LN150">150</td><td class="line"> options = optionsEnd;</td></tr>
239<tr><td class="num" id="LN151">151</td><td class="line"> <span class='keyword'>if</span> (options != <span class='macro'>NULL<span class='expansion'>__null</span></span>)</td></tr>
240<tr><td class="num" id="LN152">152</td><td class="line"> optionsEnd = strchr(options, ' ');</td></tr>
241<tr><td class="num" id="LN153">153</td><td class="line"> }</td></tr>
242<tr><td class="num" id="LN154">154</td><td class="line"> </td></tr>
243<tr><td class="num" id="LN155">155</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_OK<span class='expansion'>((int)0)</span></span>;</td></tr>
244<tr><td class="num" id="LN156">156</td><td class="line">}</td></tr>
245<tr><td class="num" id="LN157">157</td><td class="line"> </td></tr>
246<tr><td class="num" id="LN158">158</td><td class="line"> </td></tr>
247<tr><td class="num" id="LN159">159</td><td class="line"><span class='keyword'>static</span> status_t</td></tr>
248<tr><td class="num" id="LN160">160</td><td class="line">nfs4_mount(fs_volume* volume, <span class='keyword'>const</span> <span class='keyword'>char</span>* device, uint32 flags,</td></tr>
249<tr><td class="num" id="LN161">161</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span>* args, ino_t* _rootVnodeID)</td></tr>
250<tr><td class="num" id="LN162">162</td><td class="line">{</td></tr>
251<tr><td class="num" id="LN163">163</td><td class="line"> <span class='macro'>TRACE(<span class='string_literal'>"volume = %p, device = %s, flags = %"</span> B_PRIu32 <span class='string_literal'>", args = %s"</span>, volume,<span class='expansion'>(void)0</span></span></td></tr>
252<tr><td class="num" id="LN164">164</td><td class="line"> <span class='macro'>device, flags, args)<span class='expansion'>(void)0</span></span>;</td></tr>
253<tr><td class="num" id="LN165">165</td><td class="line"> </td></tr>
254<tr><td class="num" id="LN166">166</td><td class="line"> status_t result;</td></tr>
255<tr><td class="num" id="LN167">167</td><td class="line"> </td></tr>
256<tr><td class="num" id="LN168">168</td><td class="line"> <span class='comment'>/* prepare idmapper server */</span></td></tr>
257<tr><td class="num" id="LN169">169</td><td class="line"> MutexLocker locker(gIdMapperLock);</td></tr>
258<tr><td class="num" id="LN170">170</td><td class="line"> gIdMapper = <span class='keyword'>new</span>(std::nothrow) IdMap;</td></tr>
259<tr><td class="num" id="LN171">171</td><td class="line"> <span class='keyword'>if</span> (gIdMapper == <span class='macro'>NULL<span class='expansion'>__null</span></span>)</td></tr>
260<tr><td class="num"></td><td class="line"><div id="Path1" class="msg msgControl" style="margin-left:9ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexControl">1</div></td><td>Taking false branch</td><td><div class="PathNav"><a href="#Path2" title="Next event (2)">&#x2192;</a></div></td></tr></table></div></td></tr>
261<tr><td class="num" id="LN172">172</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_NO_MEMORY<span class='expansion'>((-2147483647 - 1) + 0)</span></span>;</td></tr>
262<tr><td class="num" id="LN173">173</td><td class="line"> </td></tr>
263<tr><td class="num" id="LN174">174</td><td class="line"> result = gIdMapper-&gt;InitStatus();</td></tr>
264<tr><td class="num" id="LN175">175</td><td class="line"> <span class='keyword'>if</span> (<span class="mrange">result != <span class='macro'>B_OK<span class='expansion'>((int)0)</span></span></span>) {</td></tr>
265<tr><td class="num"></td><td class="line"><div id="Path2" class="msg msgEvent" style="margin-left:13ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexEvent">2</div></td><td><div class="PathNav"><a href="#Path1" title="Previous event (1)">&#x2190;</a></div></td></td><td>Assuming 'result' is equal to 0</td><td><div class="PathNav"><a href="#Path3" title="Next event (3)">&#x2192;</a></div></td></tr></table></div></td></tr>
266<tr><td class="num"></td><td class="line"><div id="Path3" class="msg msgControl" style="margin-left:9ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexControl">3</div></td><td><div class="PathNav"><a href="#Path2" title="Previous event (2)">&#x2190;</a></div></td></td><td>Taking false branch</td><td><div class="PathNav"><a href="#Path4" title="Next event (4)">&#x2192;</a></div></td></tr></table></div></td></tr>
267<tr><td class="num" id="LN176">176</td><td class="line"> <span class='keyword'>delete</span> gIdMapper;</td></tr>
268<tr><td class="num" id="LN177">177</td><td class="line"> gIdMapper = <span class='macro'>NULL<span class='expansion'>__null</span></span>;</td></tr>
269<tr><td class="num" id="LN178">178</td><td class="line"> <span class='keyword'>return</span> result;</td></tr>
270<tr><td class="num" id="LN179">179</td><td class="line"> }</td></tr>
271<tr><td class="num" id="LN180">180</td><td class="line"> locker.Unlock();</td></tr>
272<tr><td class="num" id="LN181">181</td><td class="line"> </td></tr>
273<tr><td class="num" id="LN182">182</td><td class="line"> AddressResolver* resolver;</td></tr>
274<tr><td class="num" id="LN183">183</td><td class="line"> MountConfiguration config;</td></tr>
275<tr><td class="num" id="LN184">184</td><td class="line"> <span class='keyword'>char</span>* path;</td></tr>
276<tr><td class="num" id="LN185">185</td><td class="line"> <span class='keyword'>char</span>* serverName;</td></tr>
277<tr><td class="num" id="LN186">186</td><td class="line"> result = <span class="mrange">ParseArguments(args, &amp;resolver, &amp;serverName, &amp;path, &amp;config)</span>;</td></tr>
278<tr><td class="num"></td><td class="line"><div id="Path4" class="msg msgEvent" style="margin-left:18ex"><table class="msgT"><tr><td valign="top"><div class="PathIndex PathIndexEvent">4</div></td><td><div class="PathNav"><a href="#Path3" title="Previous event (3)">&#x2190;</a></div></td></td><td>Calling 'ParseArguments'</td><td><div class="PathNav"><a href="#Path5" title="Next event (5)">&#x2192;</a></div></td></tr></table></div></td></tr>
279<tr><td class="num" id="LN187">187</td><td class="line"> <span class='keyword'>if</span> (result != <span class='macro'>B_OK<span class='expansion'>((int)0)</span></span>)</td></tr>
280<tr><td class="num" id="LN188">188</td><td class="line"> <span class='keyword'>return</span> result;</td></tr>
281<tr><td class="num" id="LN189">189</td><td class="line"> MemoryDeleter pathDeleter(path);</td></tr>
282<tr><td class="num" id="LN190">190</td><td class="line"> </td></tr>
283<tr><td class="num" id="LN191">191</td><td class="line"> RPC::Server* server;</td></tr>
284<tr><td class="num" id="LN192">192</td><td class="line"> result = gRPCServerManager-&gt;Acquire(&amp;server, resolver, CreateNFS4Server);</td></tr>
285<tr><td class="num" id="LN193">193</td><td class="line"> <span class='keyword'>delete</span> resolver;</td></tr>
286<tr><td class="num" id="LN194">194</td><td class="line"> <span class='keyword'>if</span> (result != <span class='macro'>B_OK<span class='expansion'>((int)0)</span></span>)</td></tr>
287<tr><td class="num" id="LN195">195</td><td class="line"> <span class='keyword'>return</span> result;</td></tr>
288<tr><td class="num" id="LN196">196</td><td class="line"> </td></tr>
289<tr><td class="num" id="LN197">197</td><td class="line"> FileSystem* fs;</td></tr>
290<tr><td class="num" id="LN198">198</td><td class="line"> result = FileSystem::Mount(&amp;fs, server, serverName, path, volume-&gt;id,</td></tr>
291<tr><td class="num" id="LN199">199</td><td class="line"> config);</td></tr>
292<tr><td class="num" id="LN200">200</td><td class="line"> free(serverName);</td></tr>
293<tr><td class="num" id="LN201">201</td><td class="line"> <span class='keyword'>if</span> (result != <span class='macro'>B_OK<span class='expansion'>((int)0)</span></span>) {</td></tr>
294<tr><td class="num" id="LN202">202</td><td class="line"> gRPCServerManager-&gt;Release(server);</td></tr>
295<tr><td class="num" id="LN203">203</td><td class="line"> <span class='keyword'>return</span> result;</td></tr>
296<tr><td class="num" id="LN204">204</td><td class="line"> }</td></tr>
297<tr><td class="num" id="LN205">205</td><td class="line"> </td></tr>
298<tr><td class="num" id="LN206">206</td><td class="line"> Inode* inode = fs-&gt;Root();</td></tr>
299<tr><td class="num" id="LN207">207</td><td class="line"> <span class='keyword'>if</span> (inode == <span class='macro'>NULL<span class='expansion'>__null</span></span>) {</td></tr>
300<tr><td class="num" id="LN208">208</td><td class="line"> <span class='keyword'>delete</span> fs;</td></tr>
301<tr><td class="num" id="LN209">209</td><td class="line"> gRPCServerManager-&gt;Release(server);</td></tr>
302<tr><td class="num" id="LN210">210</td><td class="line"> </td></tr>
303<tr><td class="num" id="LN211">211</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_IO_ERROR<span class='expansion'>((-2147483647 - 1) + 1)</span></span>;</td></tr>
304<tr><td class="num" id="LN212">212</td><td class="line"> }</td></tr>
305<tr><td class="num" id="LN213">213</td><td class="line"> </td></tr>
306<tr><td class="num" id="LN214">214</td><td class="line"> volume-&gt;private_volume = fs;</td></tr>
307<tr><td class="num" id="LN215">215</td><td class="line"> volume-&gt;ops = &amp;gNFSv4VolumeOps;</td></tr>
308<tr><td class="num" id="LN216">216</td><td class="line"> </td></tr>
309<tr><td class="num" id="LN217">217</td><td class="line"> VnodeToInode* vti = <span class='keyword'>new</span> VnodeToInode(inode-&gt;ID(), fs);</td></tr>
310<tr><td class="num" id="LN218">218</td><td class="line"> <span class='keyword'>if</span> (vti == <span class='macro'>NULL<span class='expansion'>__null</span></span>) {</td></tr>
311<tr><td class="num" id="LN219">219</td><td class="line"> <span class='keyword'>delete</span> fs;</td></tr>
312<tr><td class="num" id="LN220">220</td><td class="line"> gRPCServerManager-&gt;Release(server);</td></tr>
313<tr><td class="num" id="LN221">221</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_NO_MEMORY<span class='expansion'>((-2147483647 - 1) + 0)</span></span>;</td></tr>
314<tr><td class="num" id="LN222">222</td><td class="line"> }</td></tr>
315<tr><td class="num" id="LN223">223</td><td class="line"> </td></tr>
316<tr><td class="num" id="LN224">224</td><td class="line"> vti-&gt;Replace(inode);</td></tr>
317<tr><td class="num" id="LN225">225</td><td class="line"> result = publish_vnode(volume, inode-&gt;ID(), vti, &amp;gNFSv4VnodeOps,</td></tr>
318<tr><td class="num" id="LN226">226</td><td class="line"> inode-&gt;Type(), 0);</td></tr>
319<tr><td class="num" id="LN227">227</td><td class="line"> <span class='keyword'>if</span> (result != <span class='macro'>B_OK<span class='expansion'>((int)0)</span></span>)</td></tr>
320<tr><td class="num" id="LN228">228</td><td class="line"> <span class='keyword'>return</span> result;</td></tr>
321<tr><td class="num" id="LN229">229</td><td class="line"> </td></tr>
322<tr><td class="num" id="LN230">230</td><td class="line"> *_rootVnodeID = inode-&gt;ID();</td></tr>
323<tr><td class="num" id="LN231">231</td><td class="line"> </td></tr>
324<tr><td class="num" id="LN232">232</td><td class="line"> <span class='macro'>TRACE(<span class='string_literal'>"*_rootVnodeID = %"</span> B_PRIi64, inode-&gt;ID())<span class='expansion'>(void)0</span></span>;</td></tr>
325<tr><td class="num" id="LN233">233</td><td class="line"> </td></tr>
326<tr><td class="num" id="LN234">234</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_OK<span class='expansion'>((int)0)</span></span>;</td></tr>
327<tr><td class="num" id="LN235">235</td><td class="line">}</td></tr>
328<tr><td class="num" id="LN236">236</td><td class="line"> </td></tr>
329<tr><td class="num" id="LN237">237</td><td class="line"> </td></tr>
330<tr><td class="num" id="LN238">238</td><td class="line"><span class='keyword'>static</span> status_t</td></tr>
331<tr><td class="num" id="LN239">239</td><td class="line">nfs4_get_vnode(fs_volume* volume, ino_t id, fs_vnode* vnode, <span class='keyword'>int</span>* _type,</td></tr>
332<tr><td class="num" id="LN240">240</td><td class="line"> uint32* _flags, <span class='keyword'>bool</span> reenter)</td></tr>
333<tr><td class="num" id="LN241">241</td><td class="line">{</td></tr>
334<tr><td class="num" id="LN242">242</td><td class="line"> FileSystem* fs = <span class='keyword'>reinterpret_cast</span>&lt;FileSystem*&gt;(volume-&gt;private_volume);</td></tr>
335<tr><td class="num" id="LN243">243</td><td class="line"> <span class='macro'>TRACE(<span class='string_literal'>"volume = %p, id = %"</span> B_PRIi64, volume, id)<span class='expansion'>(void)0</span></span>;</td></tr>
336<tr><td class="num" id="LN244">244</td><td class="line"> </td></tr>
337<tr><td class="num" id="LN245">245</td><td class="line"> VnodeToInode* vnodeToInode = <span class='keyword'>new</span> VnodeToInode(id, fs);</td></tr>
338<tr><td class="num" id="LN246">246</td><td class="line"> <span class='keyword'>if</span> (vnodeToInode == <span class='macro'>NULL<span class='expansion'>__null</span></span>)</td></tr>
339<tr><td class="num" id="LN247">247</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_NO_MEMORY<span class='expansion'>((-2147483647 - 1) + 0)</span></span>;</td></tr>
340<tr><td class="num" id="LN248">248</td><td class="line"> </td></tr>
341<tr><td class="num" id="LN249">249</td><td class="line"> Inode* inode; </td></tr>
342<tr><td class="num" id="LN250">250</td><td class="line"> status_t result = fs-&gt;GetInode(id, &amp;inode);</td></tr>
343<tr><td class="num" id="LN251">251</td><td class="line"> <span class='keyword'>if</span> (result != <span class='macro'>B_OK<span class='expansion'>((int)0)</span></span>) {</td></tr>
344<tr><td class="num" id="LN252">252</td><td class="line"> <span class='keyword'>delete</span> vnodeToInode;</td></tr>
345<tr><td class="num" id="LN253">253</td><td class="line"> <span class='keyword'>return</span> result;</td></tr>
346<tr><td class="num" id="LN254">254</td><td class="line"> }</td></tr>
347<tr><td class="num" id="LN255">255</td><td class="line"> </td></tr>
348<tr><td class="num" id="LN256">256</td><td class="line"> vnodeToInode-&gt;Replace(inode);</td></tr>
349<tr><td class="num" id="LN257">257</td><td class="line"> vnode-&gt;ops = &amp;gNFSv4VnodeOps;</td></tr>
350<tr><td class="num" id="LN258">258</td><td class="line"> vnode-&gt;private_node = vnodeToInode;</td></tr>
351<tr><td class="num" id="LN259">259</td><td class="line"> </td></tr>
352<tr><td class="num" id="LN260">260</td><td class="line"> *_type = inode-&gt;Type();</td></tr>
353<tr><td class="num" id="LN261">261</td><td class="line"> *_flags = 0;</td></tr>
354<tr><td class="num" id="LN262">262</td><td class="line"> </td></tr>
355<tr><td class="num" id="LN263">263</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_OK<span class='expansion'>((int)0)</span></span>;</td></tr>
356<tr><td class="num" id="LN264">264</td><td class="line">}</td></tr>
357<tr><td class="num" id="LN265">265</td><td class="line"> </td></tr>
358<tr><td class="num" id="LN266">266</td><td class="line"> </td></tr>
359<tr><td class="num" id="LN267">267</td><td class="line"><span class='keyword'>static</span> status_t</td></tr>
360<tr><td class="num" id="LN268">268</td><td class="line">nfs4_unmount(fs_volume* volume)</td></tr>
361<tr><td class="num" id="LN269">269</td><td class="line">{</td></tr>
362<tr><td class="num" id="LN270">270</td><td class="line"> <span class='macro'>TRACE(<span class='string_literal'>"volume = %p"</span>, volume)<span class='expansion'>(void)0</span></span>;</td></tr>
363<tr><td class="num" id="LN271">271</td><td class="line"> FileSystem* fs = <span class='keyword'>reinterpret_cast</span>&lt;FileSystem*&gt;(volume-&gt;private_volume);</td></tr>
364<tr><td class="num" id="LN272">272</td><td class="line"> RPC::Server* server = fs-&gt;Server();</td></tr>
365<tr><td class="num" id="LN273">273</td><td class="line"> </td></tr>
366<tr><td class="num" id="LN274">274</td><td class="line"> <span class='keyword'>delete</span> fs;</td></tr>
367<tr><td class="num" id="LN275">275</td><td class="line"> gRPCServerManager-&gt;Release(server);</td></tr>
368<tr><td class="num" id="LN276">276</td><td class="line"> </td></tr>
369<tr><td class="num" id="LN277">277</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_OK<span class='expansion'>((int)0)</span></span>;</td></tr>
370<tr><td class="num" id="LN278">278</td><td class="line">}</td></tr>
371<tr><td class="num" id="LN279">279</td><td class="line"> </td></tr>
372<tr><td class="num" id="LN280">280</td><td class="line"> </td></tr>
373<tr><td class="num" id="LN281">281</td><td class="line"><span class='keyword'>static</span> status_t</td></tr>
374<tr><td class="num" id="LN282">282</td><td class="line">nfs4_read_fs_info(fs_volume* volume, <span class='keyword'>struct</span> fs_info* info)</td></tr>
375<tr><td class="num" id="LN283">283</td><td class="line">{</td></tr>
376<tr><td class="num" id="LN284">284</td><td class="line"> <span class='macro'>TRACE(<span class='string_literal'>"volume = %p"</span>, volume)<span class='expansion'>(void)0</span></span>;</td></tr>
377<tr><td class="num" id="LN285">285</td><td class="line"> </td></tr>
378<tr><td class="num" id="LN286">286</td><td class="line"> FileSystem* fs = <span class='keyword'>reinterpret_cast</span>&lt;FileSystem*&gt;(volume-&gt;private_volume);</td></tr>
379<tr><td class="num" id="LN287">287</td><td class="line"> RootInode* inode = <span class='keyword'>reinterpret_cast</span>&lt;RootInode*&gt;(fs-&gt;Root());</td></tr>
380<tr><td class="num" id="LN288">288</td><td class="line"> <span class='keyword'>return</span> inode-&gt;ReadInfo(info);</td></tr>
381<tr><td class="num" id="LN289">289</td><td class="line">}</td></tr>
382<tr><td class="num" id="LN290">290</td><td class="line"> </td></tr>
383<tr><td class="num" id="LN291">291</td><td class="line"> </td></tr>
384<tr><td class="num" id="LN292">292</td><td class="line"><span class='keyword'>static</span> status_t</td></tr>
385<tr><td class="num" id="LN293">293</td><td class="line">nfs4_lookup(fs_volume* volume, fs_vnode* dir, <span class='keyword'>const</span> <span class='keyword'>char</span>* name, ino_t* _id)</td></tr>
386<tr><td class="num" id="LN294">294</td><td class="line">{</td></tr>
387<tr><td class="num" id="LN295">295</td><td class="line"> VnodeToInode* vti = <span class='keyword'>reinterpret_cast</span>&lt;VnodeToInode*&gt;(dir-&gt;private_node);</td></tr>
388<tr><td class="num" id="LN296">296</td><td class="line"> </td></tr>
389<tr><td class="num" id="LN297">297</td><td class="line"> <span class='keyword'>if</span> (!strcmp(name, <span class='string_literal'>"."</span>)) {</td></tr>
390<tr><td class="num" id="LN298">298</td><td class="line"> *_id = vti-&gt;ID();</td></tr>
391<tr><td class="num" id="LN299">299</td><td class="line"> <span class='keyword'>void</span>* ptr;</td></tr>
392<tr><td class="num" id="LN300">300</td><td class="line"> <span class='keyword'>return</span> get_vnode(volume, *_id, &amp;ptr);</td></tr>
393<tr><td class="num" id="LN301">301</td><td class="line"> }</td></tr>
394<tr><td class="num" id="LN302">302</td><td class="line"> </td></tr>
395<tr><td class="num" id="LN303">303</td><td class="line"> VnodeToInodeLocker locker(vti);</td></tr>
396<tr><td class="num" id="LN304">304</td><td class="line"> </td></tr>
397<tr><td class="num" id="LN305">305</td><td class="line"> Inode* inode = vti-&gt;Get();</td></tr>
398<tr><td class="num" id="LN306">306</td><td class="line"> <span class='keyword'>if</span> (inode == <span class='macro'>NULL<span class='expansion'>__null</span></span>)</td></tr>
399<tr><td class="num" id="LN307">307</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_ENTRY_NOT_FOUND<span class='expansion'>(((-2147483647 - 1) + 0x6000) + 3)</span></span>;</td></tr>
400<tr><td class="num" id="LN308">308</td><td class="line"> </td></tr>
401<tr><td class="num" id="LN309">309</td><td class="line"> <span class='macro'>TRACE(<span class='string_literal'>"volume = %p, dir = %"</span> B_PRIi64 <span class='string_literal'>", name = %s"</span>, volume, vti-&gt;ID(),<span class='expansion'>(void)0</span></span></td></tr>
402<tr><td class="num" id="LN310">310</td><td class="line"> <span class='macro'>name)<span class='expansion'>(void)0</span></span>;</td></tr>
403<tr><td class="num" id="LN311">311</td><td class="line"> </td></tr>
404<tr><td class="num" id="LN312">312</td><td class="line"> status_t result = inode-&gt;LookUp(name, _id);</td></tr>
405<tr><td class="num" id="LN313">313</td><td class="line"> <span class='keyword'>if</span> (result != <span class='macro'>B_OK<span class='expansion'>((int)0)</span></span>)</td></tr>
406<tr><td class="num" id="LN314">314</td><td class="line"> <span class='keyword'>return</span> result;</td></tr>
407<tr><td class="num" id="LN315">315</td><td class="line"> locker.Unlock();</td></tr>
408<tr><td class="num" id="LN316">316</td><td class="line"> </td></tr>
409<tr><td class="num" id="LN317">317</td><td class="line"> <span class='macro'>TRACE(<span class='string_literal'>"*_id = %"</span> B_PRIi64, *_id)<span class='expansion'>(void)0</span></span>;</td></tr>
410<tr><td class="num" id="LN318">318</td><td class="line"> </td></tr>
411<tr><td class="num" id="LN319">319</td><td class="line"> <span class='comment'>// If VTI holds an outdated Inode next operation performed on it will</span></td></tr>
412<tr><td class="num" id="LN320">320</td><td class="line"> <span class='comment'>// return either ERR_STALE or ERR_FHEXPIRED. Both of these error codes</span></td></tr>
413<tr><td class="num" id="LN321">321</td><td class="line"> <span class='comment'>// will cause FileInfo data to be updated (the former will also cause Inode</span></td></tr>
414<tr><td class="num" id="LN322">322</td><td class="line"> <span class='comment'>// object to be recreated). We are taking an optimistic (an lazy) approach</span></td></tr>
415<tr><td class="num" id="LN323">323</td><td class="line"> <span class='comment'>// here. The following code just ensures VTI won't be removed too soon.</span></td></tr>
416<tr><td class="num" id="LN324">324</td><td class="line"> <span class='keyword'>void</span>* ptr;</td></tr>
417<tr><td class="num" id="LN325">325</td><td class="line"> result = get_vnode(volume, *_id, &amp;ptr);</td></tr>
418<tr><td class="num" id="LN326">326</td><td class="line"> <span class='keyword'>if</span> (result == <span class='macro'>B_OK<span class='expansion'>((int)0)</span></span>)</td></tr>
419<tr><td class="num" id="LN327">327</td><td class="line"> unremove_vnode(volume, *_id);</td></tr>
420<tr><td class="num" id="LN328">328</td><td class="line"> </td></tr>
421<tr><td class="num" id="LN329">329</td><td class="line"> <span class='keyword'>return</span> result;</td></tr>
422<tr><td class="num" id="LN330">330</td><td class="line">}</td></tr>
423<tr><td class="num" id="LN331">331</td><td class="line"> </td></tr>
424<tr><td class="num" id="LN332">332</td><td class="line"> </td></tr>
425<tr><td class="num" id="LN333">333</td><td class="line"><span class='keyword'>static</span> status_t</td></tr>
426<tr><td class="num" id="LN334">334</td><td class="line">nfs4_put_vnode(fs_volume* volume, fs_vnode* vnode, <span class='keyword'>bool</span> reenter)</td></tr>
427<tr><td class="num" id="LN335">335</td><td class="line">{</td></tr>
428<tr><td class="num" id="LN336">336</td><td class="line"> VnodeToInode* vti = <span class='keyword'>reinterpret_cast</span>&lt;VnodeToInode*&gt;(vnode-&gt;private_node);</td></tr>
429<tr><td class="num" id="LN337">337</td><td class="line"> <span class='macro'>TRACE(<span class='string_literal'>"volume = %p, vnode = %"</span> B_PRIi64, volume, vti-&gt;ID())<span class='expansion'>(void)0</span></span>;</td></tr>
430<tr><td class="num" id="LN338">338</td><td class="line"> </td></tr>
431<tr><td class="num" id="LN339">339</td><td class="line"> <span class='keyword'>delete</span> vti;</td></tr>
432<tr><td class="num" id="LN340">340</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_OK<span class='expansion'>((int)0)</span></span>;</td></tr>
433<tr><td class="num" id="LN341">341</td><td class="line">}</td></tr>
434<tr><td class="num" id="LN342">342</td><td class="line"> </td></tr>
435<tr><td class="num" id="LN343">343</td><td class="line"> </td></tr>
436<tr><td class="num" id="LN344">344</td><td class="line"><span class='keyword'>static</span> status_t</td></tr>
437<tr><td class="num" id="LN345">345</td><td class="line">nfs4_remove_vnode(fs_volume* volume, fs_vnode* vnode, <span class='keyword'>bool</span> reenter)</td></tr>
438<tr><td class="num" id="LN346">346</td><td class="line">{</td></tr>
439<tr><td class="num" id="LN347">347</td><td class="line"> FileSystem* fs = <span class='keyword'>reinterpret_cast</span>&lt;FileSystem*&gt;(volume-&gt;private_volume);</td></tr>
440<tr><td class="num" id="LN348">348</td><td class="line"> VnodeToInode* vti = <span class='keyword'>reinterpret_cast</span>&lt;VnodeToInode*&gt;(vnode-&gt;private_node);</td></tr>
441<tr><td class="num" id="LN349">349</td><td class="line"> <span class='macro'>TRACE(<span class='string_literal'>"volume = %p, vnode = %"</span> B_PRIi64, volume, vti-&gt;ID())<span class='expansion'>(void)0</span></span>;</td></tr>
442<tr><td class="num" id="LN350">350</td><td class="line"> </td></tr>
443<tr><td class="num" id="LN351">351</td><td class="line"> <span class='keyword'>if</span> (fs-&gt;Root() == vti-&gt;GetPointer())</td></tr>
444<tr><td class="num" id="LN352">352</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_OK<span class='expansion'>((int)0)</span></span>;</td></tr>
445<tr><td class="num" id="LN353">353</td><td class="line"> </td></tr>
446<tr><td class="num" id="LN354">354</td><td class="line"> <span class='macro'>ASSERT(vti-&gt;GetPointer() == NULL)<span class='expansion'>do { if (!(vti-&gt;GetPointer() == __null)) { panic("ASSERT FAILED (%s:%d): %s"<br>, "/home/haiku/haiku/haiku/src/add-ons/kernel/file_systems/nfs4/kernel_interface.cpp"<br>, 354, "vti-&gt;GetPointer() == __null"); } } while (0)</span></span>;</td></tr>
447<tr><td class="num" id="LN355">355</td><td class="line"> <span class='keyword'>delete</span> vti;</td></tr>
448<tr><td class="num" id="LN356">356</td><td class="line"> </td></tr>
449<tr><td class="num" id="LN357">357</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_OK<span class='expansion'>((int)0)</span></span>;</td></tr>
450<tr><td class="num" id="LN358">358</td><td class="line">}</td></tr>
451<tr><td class="num" id="LN359">359</td><td class="line"> </td></tr>
452<tr><td class="num" id="LN360">360</td><td class="line"> </td></tr>
453<tr><td class="num" id="LN361">361</td><td class="line"><span class='keyword'>static</span> status_t</td></tr>
454<tr><td class="num" id="LN362">362</td><td class="line">nfs4_read_pages(fs_volume* _volume, fs_vnode* vnode, <span class='keyword'>void</span>* _cookie, off_t pos,</td></tr>
455<tr><td class="num" id="LN363">363</td><td class="line"> <span class='keyword'>const</span> iovec* vecs, size_t count, size_t* _numBytes)</td></tr>
456<tr><td class="num" id="LN364">364</td><td class="line">{</td></tr>
457<tr><td class="num" id="LN365">365</td><td class="line"> VnodeToInode* vti = <span class='keyword'>reinterpret_cast</span>&lt;VnodeToInode*&gt;(vnode-&gt;private_node);</td></tr>
458<tr><td class="num" id="LN366">366</td><td class="line"> <span class='macro'>TRACE(<span class='string_literal'>"volume = %p, vnode = %"</span> B_PRIi64 <span class='string_literal'>", cookie = %p, pos = %"</span> B_PRIi64 \<span class='expansion'>(void)0</span></span></td></tr>
459<tr><td class="num" id="LN367">367</td><td class="line"> <span class='string_literal'><span class='macro'>", count = %lu, numBytes = %lu"</span>, _volume, vti-&gt;ID(), _cookie, pos,<span class='expansion'>(void)0</span></span></td></tr>
460<tr><td class="num" id="LN368">368</td><td class="line"> <span class='macro'>count, *_numBytes)<span class='expansion'>(void)0</span></span>;</td></tr>
461<tr><td class="num" id="LN369">369</td><td class="line"> </td></tr>
462<tr><td class="num" id="LN370">370</td><td class="line"> VnodeToInodeLocker _(vti);</td></tr>
463<tr><td class="num" id="LN371">371</td><td class="line"> Inode* inode = vti-&gt;Get();</td></tr>
464<tr><td class="num" id="LN372">372</td><td class="line"> <span class='keyword'>if</span> (inode == <span class='macro'>NULL<span class='expansion'>__null</span></span>)</td></tr>
465<tr><td class="num" id="LN373">373</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_ENTRY_NOT_FOUND<span class='expansion'>(((-2147483647 - 1) + 0x6000) + 3)</span></span>;</td></tr>
466<tr><td class="num" id="LN374">374</td><td class="line"> </td></tr>
467<tr><td class="num" id="LN375">375</td><td class="line"> OpenFileCookie* cookie = <span class='keyword'>reinterpret_cast</span>&lt;OpenFileCookie*&gt;(_cookie);</td></tr>
468<tr><td class="num" id="LN376">376</td><td class="line"> </td></tr>
469<tr><td class="num" id="LN377">377</td><td class="line"> status_t result;</td></tr>
470<tr><td class="num" id="LN378">378</td><td class="line"> size_t totalRead = 0;</td></tr>
471<tr><td class="num" id="LN379">379</td><td class="line"> <span class='keyword'>bool</span> eof = <span class='keyword'>false</span>;</td></tr>
472<tr><td class="num" id="LN380">380</td><td class="line"> <span class='keyword'>for</span> (size_t i = 0; i &lt; count &amp;&amp; !eof; i++) {</td></tr>
473<tr><td class="num" id="LN381">381</td><td class="line"> size_t bytesLeft = vecs[i].iov_len;</td></tr>
474<tr><td class="num" id="LN382">382</td><td class="line"> <span class='keyword'>char</span>* buffer = <span class='keyword'>reinterpret_cast</span>&lt;<span class='keyword'>char</span>*&gt;(vecs[i].iov_base);</td></tr>
475<tr><td class="num" id="LN383">383</td><td class="line"> </td></tr>
476<tr><td class="num" id="LN384">384</td><td class="line"> <span class='keyword'>do</span> {</td></tr>
477<tr><td class="num" id="LN385">385</td><td class="line"> size_t bytesRead = bytesLeft;</td></tr>
478<tr><td class="num" id="LN386">386</td><td class="line"> result = inode-&gt;ReadDirect(cookie, pos, buffer, &amp;bytesRead, &amp;eof);</td></tr>
479<tr><td class="num" id="LN387">387</td><td class="line"> <span class='keyword'>if</span> (result != <span class='macro'>B_OK<span class='expansion'>((int)0)</span></span>)</td></tr>
480<tr><td class="num" id="LN388">388</td><td class="line"> <span class='keyword'>return</span> result;</td></tr>
481<tr><td class="num" id="LN389">389</td><td class="line"> </td></tr>
482<tr><td class="num" id="LN390">390</td><td class="line"> totalRead += bytesRead;</td></tr>
483<tr><td class="num" id="LN391">391</td><td class="line"> pos += bytesRead;</td></tr>
484<tr><td class="num" id="LN392">392</td><td class="line"> buffer += bytesRead;</td></tr>
485<tr><td class="num" id="LN393">393</td><td class="line"> bytesLeft -= bytesRead;</td></tr>
486<tr><td class="num" id="LN394">394</td><td class="line"> } <span class='keyword'>while</span> (bytesLeft &gt; 0 &amp;&amp; !eof);</td></tr>
487<tr><td class="num" id="LN395">395</td><td class="line"> }</td></tr>
488<tr><td class="num" id="LN396">396</td><td class="line"> </td></tr>
489<tr><td class="num" id="LN397">397</td><td class="line"> *_numBytes = totalRead;</td></tr>
490<tr><td class="num" id="LN398">398</td><td class="line"> </td></tr>
491<tr><td class="num" id="LN399">399</td><td class="line"> <span class='macro'>TRACE(<span class='string_literal'>"*numBytes = %lu"</span>, totalRead)<span class='expansion'>(void)0</span></span>;</td></tr>
492<tr><td class="num" id="LN400">400</td><td class="line"> </td></tr>
493<tr><td class="num" id="LN401">401</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_OK<span class='expansion'>((int)0)</span></span>;</td></tr>
494<tr><td class="num" id="LN402">402</td><td class="line">}</td></tr>
495<tr><td class="num" id="LN403">403</td><td class="line"> </td></tr>
496<tr><td class="num" id="LN404">404</td><td class="line"> </td></tr>
497<tr><td class="num" id="LN405">405</td><td class="line"><span class='keyword'>static</span> status_t</td></tr>
498<tr><td class="num" id="LN406">406</td><td class="line">nfs4_write_pages(fs_volume* _volume, fs_vnode* vnode, <span class='keyword'>void</span>* _cookie, off_t pos,</td></tr>
499<tr><td class="num" id="LN407">407</td><td class="line"> <span class='keyword'>const</span> iovec* vecs, size_t count, size_t* _numBytes)</td></tr>
500<tr><td class="num" id="LN408">408</td><td class="line">{</td></tr>
501<tr><td class="num" id="LN409">409</td><td class="line"> VnodeToInode* vti = <span class='keyword'>reinterpret_cast</span>&lt;VnodeToInode*&gt;(vnode-&gt;private_node);</td></tr>
502<tr><td class="num" id="LN410">410</td><td class="line"> <span class='macro'>TRACE(<span class='string_literal'>"volume = %p, vnode = %"</span> B_PRIi64 <span class='string_literal'>", cookie = %p, pos = %"</span> B_PRIi64 \<span class='expansion'>(void)0</span></span></td></tr>
503<tr><td class="num" id="LN411">411</td><td class="line"> <span class='string_literal'><span class='macro'>", count = %lu, numBytes = %lu"</span>, _volume, vti-&gt;ID(), _cookie, pos,<span class='expansion'>(void)0</span></span></td></tr>
504<tr><td class="num" id="LN412">412</td><td class="line"> <span class='macro'>count, *_numBytes)<span class='expansion'>(void)0</span></span>;</td></tr>
505<tr><td class="num" id="LN413">413</td><td class="line"> </td></tr>
506<tr><td class="num" id="LN414">414</td><td class="line"> VnodeToInodeLocker _(vti);</td></tr>
507<tr><td class="num" id="LN415">415</td><td class="line"> Inode* inode = vti-&gt;Get();</td></tr>
508<tr><td class="num" id="LN416">416</td><td class="line"> <span class='keyword'>if</span> (inode == <span class='macro'>NULL<span class='expansion'>__null</span></span>)</td></tr>
509<tr><td class="num" id="LN417">417</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_ENTRY_NOT_FOUND<span class='expansion'>(((-2147483647 - 1) + 0x6000) + 3)</span></span>;</td></tr>
510<tr><td class="num" id="LN418">418</td><td class="line"> </td></tr>
511<tr><td class="num" id="LN419">419</td><td class="line"> OpenFileCookie* cookie = <span class='keyword'>reinterpret_cast</span>&lt;OpenFileCookie*&gt;(_cookie);</td></tr>
512<tr><td class="num" id="LN420">420</td><td class="line"> </td></tr>
513<tr><td class="num" id="LN421">421</td><td class="line"> status_t result;</td></tr>
514<tr><td class="num" id="LN422">422</td><td class="line"> <span class='keyword'>for</span> (size_t i = 0; i &lt; count; i++) {</td></tr>
515<tr><td class="num" id="LN423">423</td><td class="line"> uint64 bytesLeft = vecs[i].iov_len;</td></tr>
516<tr><td class="num" id="LN424">424</td><td class="line"> <span class='keyword'>if</span> (pos + bytesLeft &gt; inode-&gt;MaxFileSize())</td></tr>
517<tr><td class="num" id="LN425">425</td><td class="line"> bytesLeft = inode-&gt;MaxFileSize() - pos;</td></tr>
518<tr><td class="num" id="LN426">426</td><td class="line"> </td></tr>
519<tr><td class="num" id="LN427">427</td><td class="line"> <span class='keyword'>char</span>* buffer = <span class='keyword'>reinterpret_cast</span>&lt;<span class='keyword'>char</span>*&gt;(vecs[i].iov_base);</td></tr>
520<tr><td class="num" id="LN428">428</td><td class="line"> </td></tr>
521<tr><td class="num" id="LN429">429</td><td class="line"> <span class='keyword'>do</span> {</td></tr>
522<tr><td class="num" id="LN430">430</td><td class="line"> size_t bytesWritten = bytesLeft;</td></tr>
523<tr><td class="num" id="LN431">431</td><td class="line"> </td></tr>
524<tr><td class="num" id="LN432">432</td><td class="line"> result = inode-&gt;WriteDirect(cookie, pos, buffer, &amp;bytesWritten);</td></tr>
525<tr><td class="num" id="LN433">433</td><td class="line"> <span class='keyword'>if</span> (result != <span class='macro'>B_OK<span class='expansion'>((int)0)</span></span>)</td></tr>
526<tr><td class="num" id="LN434">434</td><td class="line"> <span class='keyword'>return</span> result;</td></tr>
527<tr><td class="num" id="LN435">435</td><td class="line"> </td></tr>
528<tr><td class="num" id="LN436">436</td><td class="line"> bytesLeft -= bytesWritten;</td></tr>
529<tr><td class="num" id="LN437">437</td><td class="line"> pos += bytesWritten;</td></tr>
530<tr><td class="num" id="LN438">438</td><td class="line"> buffer += bytesWritten;</td></tr>
531<tr><td class="num" id="LN439">439</td><td class="line"> } <span class='keyword'>while</span> (bytesLeft &gt; 0);</td></tr>
532<tr><td class="num" id="LN440">440</td><td class="line"> }</td></tr>
533<tr><td class="num" id="LN441">441</td><td class="line"> </td></tr>
534<tr><td class="num" id="LN442">442</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_OK<span class='expansion'>((int)0)</span></span>;</td></tr>
535<tr><td class="num" id="LN443">443</td><td class="line">}</td></tr>
536<tr><td class="num" id="LN444">444</td><td class="line"> </td></tr>
537<tr><td class="num" id="LN445">445</td><td class="line"> </td></tr>
538<tr><td class="num" id="LN446">446</td><td class="line"><span class='keyword'>static</span> status_t</td></tr>
539<tr><td class="num" id="LN447">447</td><td class="line">nfs4_io(fs_volume* volume, fs_vnode* vnode, <span class='keyword'>void</span>* cookie, io_request* request)</td></tr>
540<tr><td class="num" id="LN448">448</td><td class="line">{</td></tr>
541<tr><td class="num" id="LN449">449</td><td class="line"> VnodeToInode* vti = <span class='keyword'>reinterpret_cast</span>&lt;VnodeToInode*&gt;(vnode-&gt;private_node);</td></tr>
542<tr><td class="num" id="LN450">450</td><td class="line"> <span class='macro'>TRACE(<span class='string_literal'>"volume = %p, vnode = %"</span> B_PRIi64 <span class='string_literal'>", cookie = %p"</span>, volume, vti-&gt;ID(),<span class='expansion'>(void)0</span></span></td></tr>
543<tr><td class="num" id="LN451">451</td><td class="line"> <span class='macro'>cookie)<span class='expansion'>(void)0</span></span>;</td></tr>
544<tr><td class="num" id="LN452">452</td><td class="line"> </td></tr>
545<tr><td class="num" id="LN453">453</td><td class="line"> VnodeToInodeLocker _(vti);</td></tr>
546<tr><td class="num" id="LN454">454</td><td class="line"> Inode* inode = vti-&gt;Get();</td></tr>
547<tr><td class="num" id="LN455">455</td><td class="line"> <span class='keyword'>if</span> (inode == <span class='macro'>NULL<span class='expansion'>__null</span></span>)</td></tr>
548<tr><td class="num" id="LN456">456</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_ENTRY_NOT_FOUND<span class='expansion'>(((-2147483647 - 1) + 0x6000) + 3)</span></span>;</td></tr>
549<tr><td class="num" id="LN457">457</td><td class="line"> </td></tr>
550<tr><td class="num" id="LN458">458</td><td class="line"> IORequestArgs* args = <span class='keyword'>new</span>(std::nothrow) IORequestArgs;</td></tr>
551<tr><td class="num" id="LN459">459</td><td class="line"> <span class='keyword'>if</span> (args == <span class='macro'>NULL<span class='expansion'>__null</span></span>) {</td></tr>
552<tr><td class="num" id="LN460">460</td><td class="line"> notify_io_request(request, <span class='macro'>B_NO_MEMORY<span class='expansion'>((-2147483647 - 1) + 0)</span></span>);</td></tr>
553<tr><td class="num" id="LN461">461</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_NO_MEMORY<span class='expansion'>((-2147483647 - 1) + 0)</span></span>;</td></tr>
554<tr><td class="num" id="LN462">462</td><td class="line"> }</td></tr>
555<tr><td class="num" id="LN463">463</td><td class="line"> args-&gt;fRequest = request;</td></tr>
556<tr><td class="num" id="LN464">464</td><td class="line"> args-&gt;fInode = inode;</td></tr>
557<tr><td class="num" id="LN465">465</td><td class="line"> </td></tr>
558<tr><td class="num" id="LN466">466</td><td class="line"> status_t result = gWorkQueue-&gt;EnqueueJob(IORequest, args);</td></tr>
559<tr><td class="num" id="LN467">467</td><td class="line"> <span class='keyword'>if</span> (result != <span class='macro'>B_OK<span class='expansion'>((int)0)</span></span>)</td></tr>
560<tr><td class="num" id="LN468">468</td><td class="line"> notify_io_request(request, result);</td></tr>
561<tr><td class="num" id="LN469">469</td><td class="line"> </td></tr>
562<tr><td class="num" id="LN470">470</td><td class="line"> <span class='keyword'>return</span> result;</td></tr>
563<tr><td class="num" id="LN471">471</td><td class="line">}</td></tr>
564<tr><td class="num" id="LN472">472</td><td class="line"> </td></tr>
565<tr><td class="num" id="LN473">473</td><td class="line"> </td></tr>
566<tr><td class="num" id="LN474">474</td><td class="line"><span class='keyword'>static</span> status_t</td></tr>
567<tr><td class="num" id="LN475">475</td><td class="line">nfs4_get_file_map(fs_volume* volume, fs_vnode* vnode, off_t _offset,</td></tr>
568<tr><td class="num" id="LN476">476</td><td class="line"> size_t size, <span class='keyword'>struct</span> file_io_vec* vecs, size_t* _count)</td></tr>
569<tr><td class="num" id="LN477">477</td><td class="line">{</td></tr>
570<tr><td class="num" id="LN478">478</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_ERROR<span class='expansion'>(-1)</span></span>;</td></tr>
571<tr><td class="num" id="LN479">479</td><td class="line">}</td></tr>
572<tr><td class="num" id="LN480">480</td><td class="line"> </td></tr>
573<tr><td class="num" id="LN481">481</td><td class="line"> </td></tr>
574<tr><td class="num" id="LN482">482</td><td class="line"><span class='keyword'>static</span> status_t</td></tr>
575<tr><td class="num" id="LN483">483</td><td class="line">nfs4_set_flags(fs_volume* volume, fs_vnode* vnode, <span class='keyword'>void</span>* _cookie, <span class='keyword'>int</span> flags)</td></tr>
576<tr><td class="num" id="LN484">484</td><td class="line">{</td></tr>
577<tr><td class="num" id="LN485">485</td><td class="line"> <span class='macro'>TRACE(<span class='string_literal'>"volume = %p, vnode = %"</span> B_PRIi64 <span class='string_literal'>", cookie = %p, flags = %d"</span>, volume,<span class='expansion'>(void)0</span></span></td></tr>
578<tr><td class="num" id="LN486">486</td><td class="line"> <span class='keyword'><span class='macro'>reinterpret_cast</span>&lt;VnodeToInode*&gt;(vnode-&gt;private_node)-&gt;ID(), _cookie,<span class='expansion'>(void)0</span></span></td></tr>
579<tr><td class="num" id="LN487">487</td><td class="line"> <span class='macro'>flags)<span class='expansion'>(void)0</span></span>;</td></tr>
580<tr><td class="num" id="LN488">488</td><td class="line"> </td></tr>
581<tr><td class="num" id="LN489">489</td><td class="line"> OpenFileCookie* cookie = <span class='keyword'>reinterpret_cast</span>&lt;OpenFileCookie*&gt;(_cookie);</td></tr>
582<tr><td class="num" id="LN490">490</td><td class="line"> cookie-&gt;fMode = (cookie-&gt;fMode &amp; ~(<span class='macro'>O_APPEND<span class='expansion'>0x00000800</span></span> | <span class='macro'>O_NONBLOCK<span class='expansion'>0x00000080</span></span>)) | flags;</td></tr>
583<tr><td class="num" id="LN491">491</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_OK<span class='expansion'>((int)0)</span></span>;</td></tr>
584<tr><td class="num" id="LN492">492</td><td class="line">}</td></tr>
585<tr><td class="num" id="LN493">493</td><td class="line"> </td></tr>
586<tr><td class="num" id="LN494">494</td><td class="line"> </td></tr>
587<tr><td class="num" id="LN495">495</td><td class="line"><span class='keyword'>static</span> status_t</td></tr>
588<tr><td class="num" id="LN496">496</td><td class="line">nfs4_fsync(fs_volume* volume, fs_vnode* vnode)</td></tr>
589<tr><td class="num" id="LN497">497</td><td class="line">{</td></tr>
590<tr><td class="num" id="LN498">498</td><td class="line"> VnodeToInode* vti = <span class='keyword'>reinterpret_cast</span>&lt;VnodeToInode*&gt;(vnode-&gt;private_node);</td></tr>
591<tr><td class="num" id="LN499">499</td><td class="line"> <span class='macro'>TRACE(<span class='string_literal'>"volume = %p, vnode = %"</span> B_PRIi64, volume, vti-&gt;ID())<span class='expansion'>(void)0</span></span>;</td></tr>
592<tr><td class="num" id="LN500">500</td><td class="line"> </td></tr>
593<tr><td class="num" id="LN501">501</td><td class="line"> VnodeToInodeLocker _(vti);</td></tr>
594<tr><td class="num" id="LN502">502</td><td class="line"> Inode* inode = vti-&gt;Get();</td></tr>
595<tr><td class="num" id="LN503">503</td><td class="line"> <span class='keyword'>if</span> (inode == <span class='macro'>NULL<span class='expansion'>__null</span></span>)</td></tr>
596<tr><td class="num" id="LN504">504</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_ENTRY_NOT_FOUND<span class='expansion'>(((-2147483647 - 1) + 0x6000) + 3)</span></span>;</td></tr>
597<tr><td class="num" id="LN505">505</td><td class="line"> </td></tr>
598<tr><td class="num" id="LN506">506</td><td class="line"> <span class='keyword'>return</span> inode-&gt;SyncAndCommit();</td></tr>
599<tr><td class="num" id="LN507">507</td><td class="line">}</td></tr>
600<tr><td class="num" id="LN508">508</td><td class="line"> </td></tr>
601<tr><td class="num" id="LN509">509</td><td class="line"> </td></tr>
602<tr><td class="num" id="LN510">510</td><td class="line"><span class='keyword'>static</span> status_t</td></tr>
603<tr><td class="num" id="LN511">511</td><td class="line">nfs4_read_symlink(fs_volume* volume, fs_vnode* link, <span class='keyword'>char</span>* buffer,</td></tr>
604<tr><td class="num" id="LN512">512</td><td class="line"> size_t* _bufferSize)</td></tr>
605<tr><td class="num" id="LN513">513</td><td class="line">{</td></tr>
606<tr><td class="num" id="LN514">514</td><td class="line"> VnodeToInode* vti = <span class='keyword'>reinterpret_cast</span>&lt;VnodeToInode*&gt;(link-&gt;private_node);</td></tr>
607<tr><td class="num" id="LN515">515</td><td class="line"> <span class='macro'>TRACE(<span class='string_literal'>"volume = %p, link = %"</span> B_PRIi64, volume, vti-&gt;ID())<span class='expansion'>(void)0</span></span>;</td></tr>
608<tr><td class="num" id="LN516">516</td><td class="line"> </td></tr>
609<tr><td class="num" id="LN517">517</td><td class="line"> VnodeToInodeLocker _(vti);</td></tr>
610<tr><td class="num" id="LN518">518</td><td class="line"> Inode* inode = vti-&gt;Get();</td></tr>
611<tr><td class="num" id="LN519">519</td><td class="line"> <span class='keyword'>if</span> (inode == <span class='macro'>NULL<span class='expansion'>__null</span></span>)</td></tr>
612<tr><td class="num" id="LN520">520</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_ENTRY_NOT_FOUND<span class='expansion'>(((-2147483647 - 1) + 0x6000) + 3)</span></span>;</td></tr>
613<tr><td class="num" id="LN521">521</td><td class="line"> </td></tr>
614<tr><td class="num" id="LN522">522</td><td class="line"> <span class='keyword'>return</span> inode-&gt;ReadLink(buffer, _bufferSize);</td></tr>
615<tr><td class="num" id="LN523">523</td><td class="line">}</td></tr>
616<tr><td class="num" id="LN524">524</td><td class="line"> </td></tr>
617<tr><td class="num" id="LN525">525</td><td class="line"> </td></tr>
618<tr><td class="num" id="LN526">526</td><td class="line"><span class='keyword'>static</span> status_t</td></tr>
619<tr><td class="num" id="LN527">527</td><td class="line">nfs4_create_symlink(fs_volume* volume, fs_vnode* dir, <span class='keyword'>const</span> <span class='keyword'>char</span>* name,</td></tr>
620<tr><td class="num" id="LN528">528</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>char</span>* path, <span class='keyword'>int</span> mode)</td></tr>
621<tr><td class="num" id="LN529">529</td><td class="line">{</td></tr>
622<tr><td class="num" id="LN530">530</td><td class="line"> VnodeToInode* vti = <span class='keyword'>reinterpret_cast</span>&lt;VnodeToInode*&gt;(dir-&gt;private_node);</td></tr>
623<tr><td class="num" id="LN531">531</td><td class="line"> <span class='macro'>TRACE(<span class='string_literal'>"volume = %p, dir = %"</span> B_PRIi64 <span class='string_literal'>", name = %s, path = %s, mode = %d"</span>,<span class='expansion'>(void)0</span></span></td></tr>
624<tr><td class="num" id="LN532">532</td><td class="line"> <span class='macro'>volume, vti-&gt;ID(), name, path, mode)<span class='expansion'>(void)0</span></span>;</td></tr>
625<tr><td class="num" id="LN533">533</td><td class="line"> </td></tr>
626<tr><td class="num" id="LN534">534</td><td class="line"> VnodeToInodeLocker _(vti);</td></tr>
627<tr><td class="num" id="LN535">535</td><td class="line"> Inode* inode = vti-&gt;Get();</td></tr>
628<tr><td class="num" id="LN536">536</td><td class="line"> <span class='keyword'>if</span> (inode == <span class='macro'>NULL<span class='expansion'>__null</span></span>)</td></tr>
629<tr><td class="num" id="LN537">537</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_ENTRY_NOT_FOUND<span class='expansion'>(((-2147483647 - 1) + 0x6000) + 3)</span></span>;</td></tr>
630<tr><td class="num" id="LN538">538</td><td class="line"> </td></tr>
631<tr><td class="num" id="LN539">539</td><td class="line"> ino_t id;</td></tr>
632<tr><td class="num" id="LN540">540</td><td class="line"> status_t result = inode-&gt;CreateLink(name, path, mode, &amp;id);</td></tr>
633<tr><td class="num" id="LN541">541</td><td class="line"> <span class='keyword'>if</span> (result != <span class='macro'>B_OK<span class='expansion'>((int)0)</span></span>)</td></tr>
634<tr><td class="num" id="LN542">542</td><td class="line"> <span class='keyword'>return</span> result;</td></tr>
635<tr><td class="num" id="LN543">543</td><td class="line"> </td></tr>
636<tr><td class="num" id="LN544">544</td><td class="line"> result = get_vnode(volume, id, <span class='keyword'>reinterpret_cast</span>&lt;<span class='keyword'>void</span>**&gt;(&amp;vti));</td></tr>
637<tr><td class="num" id="LN545">545</td><td class="line"> <span class='keyword'>if</span> (result == <span class='macro'>B_OK<span class='expansion'>((int)0)</span></span>) {</td></tr>
638<tr><td class="num" id="LN546">546</td><td class="line"> unremove_vnode(volume, id);</td></tr>
639<tr><td class="num" id="LN547">547</td><td class="line"> vti-&gt;Clear();</td></tr>
640<tr><td class="num" id="LN548">548</td><td class="line"> put_vnode(volume, id);</td></tr>
641<tr><td class="num" id="LN549">549</td><td class="line"> }</td></tr>
642<tr><td class="num" id="LN550">550</td><td class="line"> </td></tr>
643<tr><td class="num" id="LN551">551</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_OK<span class='expansion'>((int)0)</span></span>;</td></tr>
644<tr><td class="num" id="LN552">552</td><td class="line">}</td></tr>
645<tr><td class="num" id="LN553">553</td><td class="line"> </td></tr>
646<tr><td class="num" id="LN554">554</td><td class="line"> </td></tr>
647<tr><td class="num" id="LN555">555</td><td class="line"><span class='keyword'>static</span> status_t</td></tr>
648<tr><td class="num" id="LN556">556</td><td class="line">nfs4_link(fs_volume* volume, fs_vnode* dir, <span class='keyword'>const</span> <span class='keyword'>char</span>* name, fs_vnode* vnode)</td></tr>
649<tr><td class="num" id="LN557">557</td><td class="line">{</td></tr>
650<tr><td class="num" id="LN558">558</td><td class="line"> VnodeToInode* vti = <span class='keyword'>reinterpret_cast</span>&lt;VnodeToInode*&gt;(vnode-&gt;private_node);</td></tr>
651<tr><td class="num" id="LN559">559</td><td class="line"> VnodeToInode* dirVti = <span class='keyword'>reinterpret_cast</span>&lt;VnodeToInode*&gt;(dir-&gt;private_node);</td></tr>
652<tr><td class="num" id="LN560">560</td><td class="line"> <span class='macro'>TRACE(<span class='string_literal'>"volume = %p, dir = %"</span> B_PRIi64 <span class='string_literal'>", name = %s, vnode = %"</span> B_PRIi64,<span class='expansion'>(void)0</span></span></td></tr>
653<tr><td class="num" id="LN561">561</td><td class="line"> <span class='macro'>volume, dirVti-&gt;ID(), name, vti-&gt;ID())<span class='expansion'>(void)0</span></span>;</td></tr>
654<tr><td class="num" id="LN562">562</td><td class="line"> </td></tr>
655<tr><td class="num" id="LN563">563</td><td class="line"> VnodeToInodeLocker _dir(dirVti);</td></tr>
656<tr><td class="num" id="LN564">564</td><td class="line"> Inode* dirInode = dirVti-&gt;Get();</td></tr>
657<tr><td class="num" id="LN565">565</td><td class="line"> <span class='keyword'>if</span> (dirInode == <span class='macro'>NULL<span class='expansion'>__null</span></span>)</td></tr>
658<tr><td class="num" id="LN566">566</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_ENTRY_NOT_FOUND<span class='expansion'>(((-2147483647 - 1) + 0x6000) + 3)</span></span>;</td></tr>
659<tr><td class="num" id="LN567">567</td><td class="line"> </td></tr>
660<tr><td class="num" id="LN568">568</td><td class="line"> </td></tr>
661<tr><td class="num" id="LN569">569</td><td class="line"> VnodeToInodeLocker _(vti);</td></tr>
662<tr><td class="num" id="LN570">570</td><td class="line"> Inode* inode = vti-&gt;Get();</td></tr>
663<tr><td class="num" id="LN571">571</td><td class="line"> <span class='keyword'>if</span> (inode == <span class='macro'>NULL<span class='expansion'>__null</span></span>)</td></tr>
664<tr><td class="num" id="LN572">572</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_ENTRY_NOT_FOUND<span class='expansion'>(((-2147483647 - 1) + 0x6000) + 3)</span></span>;</td></tr>
665<tr><td class="num" id="LN573">573</td><td class="line"> </td></tr>
666<tr><td class="num" id="LN574">574</td><td class="line"> <span class='keyword'>return</span> inode-&gt;Link(dirInode, name);</td></tr>
667<tr><td class="num" id="LN575">575</td><td class="line">}</td></tr>
668<tr><td class="num" id="LN576">576</td><td class="line"> </td></tr>
669<tr><td class="num" id="LN577">577</td><td class="line"> </td></tr>
670<tr><td class="num" id="LN578">578</td><td class="line"><span class='keyword'>static</span> status_t</td></tr>
671<tr><td class="num" id="LN579">579</td><td class="line">nfs4_unlink(fs_volume* volume, fs_vnode* dir, <span class='keyword'>const</span> <span class='keyword'>char</span>* name)</td></tr>
672<tr><td class="num" id="LN580">580</td><td class="line">{</td></tr>
673<tr><td class="num" id="LN581">581</td><td class="line"> VnodeToInode* vti = <span class='keyword'>reinterpret_cast</span>&lt;VnodeToInode*&gt;(dir-&gt;private_node);</td></tr>
674<tr><td class="num" id="LN582">582</td><td class="line"> </td></tr>
675<tr><td class="num" id="LN583">583</td><td class="line"> VnodeToInodeLocker locker(vti);</td></tr>
676<tr><td class="num" id="LN584">584</td><td class="line"> Inode* inode = vti-&gt;Get();</td></tr>
677<tr><td class="num" id="LN585">585</td><td class="line"> <span class='keyword'>if</span> (inode == <span class='macro'>NULL<span class='expansion'>__null</span></span>)</td></tr>
678<tr><td class="num" id="LN586">586</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_ENTRY_NOT_FOUND<span class='expansion'>(((-2147483647 - 1) + 0x6000) + 3)</span></span>;</td></tr>
679<tr><td class="num" id="LN587">587</td><td class="line"> </td></tr>
680<tr><td class="num" id="LN588">588</td><td class="line"> <span class='macro'>TRACE(<span class='string_literal'>"volume = %p, dir = %"</span> B_PRIi64 <span class='string_literal'>", name = %s"</span>, volume, vti-&gt;ID(),<span class='expansion'>(void)0</span></span></td></tr>
681<tr><td class="num" id="LN589">589</td><td class="line"> <span class='macro'>name)<span class='expansion'>(void)0</span></span>;</td></tr>
682<tr><td class="num" id="LN590">590</td><td class="line"> </td></tr>
683<tr><td class="num" id="LN591">591</td><td class="line"> ino_t id;</td></tr>
684<tr><td class="num" id="LN592">592</td><td class="line"> status_t result = inode-&gt;Remove(name, NF4REG, &amp;id);</td></tr>
685<tr><td class="num" id="LN593">593</td><td class="line"> <span class='keyword'>if</span> (result != <span class='macro'>B_OK<span class='expansion'>((int)0)</span></span>)</td></tr>
686<tr><td class="num" id="LN594">594</td><td class="line"> <span class='keyword'>return</span> result;</td></tr>
687<tr><td class="num" id="LN595">595</td><td class="line"> locker.Unlock();</td></tr>
688<tr><td class="num" id="LN596">596</td><td class="line"> </td></tr>
689<tr><td class="num" id="LN597">597</td><td class="line"> result = acquire_vnode(volume, id);</td></tr>
690<tr><td class="num" id="LN598">598</td><td class="line"> <span class='keyword'>if</span> (result == <span class='macro'>B_OK<span class='expansion'>((int)0)</span></span>) {</td></tr>
691<tr><td class="num" id="LN599">599</td><td class="line"> result = get_vnode(volume, id, <span class='keyword'>reinterpret_cast</span>&lt;<span class='keyword'>void</span>**&gt;(&amp;vti));</td></tr>
692<tr><td class="num" id="LN600">600</td><td class="line"> <span class='macro'>ASSERT(result == B_OK)<span class='expansion'>do { if (!(result == ((int)0))) { panic("ASSERT FAILED (%s:%d): %s"<br>, "/home/haiku/haiku/haiku/src/add-ons/kernel/file_systems/nfs4/kernel_interface.cpp"<br>, 600, "result == ((int)0)"); } } while (0)</span></span>;</td></tr>
693<tr><td class="num" id="LN601">601</td><td class="line"> </td></tr>
694<tr><td class="num" id="LN602">602</td><td class="line"> <span class='keyword'>if</span> (vti-&gt;Unlink(inode-&gt;fInfo.fNames, name))</td></tr>
695<tr><td class="num" id="LN603">603</td><td class="line"> remove_vnode(volume, id);</td></tr>
696<tr><td class="num" id="LN604">604</td><td class="line"> </td></tr>
697<tr><td class="num" id="LN605">605</td><td class="line"> put_vnode(volume, id);</td></tr>
698<tr><td class="num" id="LN606">606</td><td class="line"> put_vnode(volume, id);</td></tr>
699<tr><td class="num" id="LN607">607</td><td class="line"> }</td></tr>
700<tr><td class="num" id="LN608">608</td><td class="line"> </td></tr>
701<tr><td class="num" id="LN609">609</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_OK<span class='expansion'>((int)0)</span></span>;</td></tr>
702<tr><td class="num" id="LN610">610</td><td class="line">}</td></tr>
703<tr><td class="num" id="LN611">611</td><td class="line"> </td></tr>
704<tr><td class="num" id="LN612">612</td><td class="line"> </td></tr>
705<tr><td class="num" id="LN613">613</td><td class="line"><span class='keyword'>static</span> status_t</td></tr>
706<tr><td class="num" id="LN614">614</td><td class="line">nfs4_rename(fs_volume* volume, fs_vnode* fromDir, <span class='keyword'>const</span> <span class='keyword'>char</span>* fromName,</td></tr>
707<tr><td class="num" id="LN615">615</td><td class="line"> fs_vnode* toDir, <span class='keyword'>const</span> <span class='keyword'>char</span>* toName)</td></tr>
708<tr><td class="num" id="LN616">616</td><td class="line">{</td></tr>
709<tr><td class="num" id="LN617">617</td><td class="line"> VnodeToInode* fromVti</td></tr>
710<tr><td class="num" id="LN618">618</td><td class="line"> = <span class='keyword'>reinterpret_cast</span>&lt;VnodeToInode*&gt;(fromDir-&gt;private_node);</td></tr>
711<tr><td class="num" id="LN619">619</td><td class="line"> VnodeToInode* toVti = <span class='keyword'>reinterpret_cast</span>&lt;VnodeToInode*&gt;(toDir-&gt;private_node);</td></tr>
712<tr><td class="num" id="LN620">620</td><td class="line"> <span class='macro'>TRACE(<span class='string_literal'>"volume = %p, fromDir = %"</span> B_PRIi64 <span class='string_literal'>", toDir = %"</span> B_PRIi64 <span class='string_literal'>","</span> \<span class='expansion'>(void)0</span></span></td></tr>
713<tr><td class="num" id="LN621">621</td><td class="line"> <span class='string_literal'><span class='macro'>" fromName = %s, toName = %s"</span>, volume, fromVti-&gt;ID(), toVti-&gt;ID(), \<span class='expansion'>(void)0</span></span></td></tr>
714<tr><td class="num" id="LN622">622</td><td class="line"> <span class='macro'>fromName, toName)<span class='expansion'>(void)0</span></span>;</td></tr>
715<tr><td class="num" id="LN623">623</td><td class="line"> </td></tr>
716<tr><td class="num" id="LN624">624</td><td class="line"> VnodeToInodeLocker _from(fromVti);</td></tr>
717<tr><td class="num" id="LN625">625</td><td class="line"> Inode* fromInode = fromVti-&gt;Get();</td></tr>
718<tr><td class="num" id="LN626">626</td><td class="line"> <span class='keyword'>if</span> (fromInode == <span class='macro'>NULL<span class='expansion'>__null</span></span>)</td></tr>
719<tr><td class="num" id="LN627">627</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_ENTRY_NOT_FOUND<span class='expansion'>(((-2147483647 - 1) + 0x6000) + 3)</span></span>;</td></tr>
720<tr><td class="num" id="LN628">628</td><td class="line"> </td></tr>
721<tr><td class="num" id="LN629">629</td><td class="line"> </td></tr>
722<tr><td class="num" id="LN630">630</td><td class="line"> VnodeToInodeLocker _to(toVti);</td></tr>
723<tr><td class="num" id="LN631">631</td><td class="line"> Inode* toInode = toVti-&gt;Get();</td></tr>
724<tr><td class="num" id="LN632">632</td><td class="line"> <span class='keyword'>if</span> (toInode == <span class='macro'>NULL<span class='expansion'>__null</span></span>)</td></tr>
725<tr><td class="num" id="LN633">633</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_ENTRY_NOT_FOUND<span class='expansion'>(((-2147483647 - 1) + 0x6000) + 3)</span></span>;</td></tr>
726<tr><td class="num" id="LN634">634</td><td class="line"> </td></tr>
727<tr><td class="num" id="LN635">635</td><td class="line"> ino_t id;</td></tr>
728<tr><td class="num" id="LN636">636</td><td class="line"> ino_t oldID;</td></tr>
729<tr><td class="num" id="LN637">637</td><td class="line"> status_t result = Inode::Rename(fromInode, toInode, fromName, toName, <span class='keyword'>false</span>,</td></tr>
730<tr><td class="num" id="LN638">638</td><td class="line"> &amp;id, &amp;oldID);</td></tr>
731<tr><td class="num" id="LN639">639</td><td class="line"> <span class='keyword'>if</span> (result != <span class='macro'>B_OK<span class='expansion'>((int)0)</span></span>)</td></tr>
732<tr><td class="num" id="LN640">640</td><td class="line"> <span class='keyword'>return</span> result;</td></tr>
733<tr><td class="num" id="LN641">641</td><td class="line"> </td></tr>
734<tr><td class="num" id="LN642">642</td><td class="line"> VnodeToInode* vti;</td></tr>
735<tr><td class="num" id="LN643">643</td><td class="line"> </td></tr>
736<tr><td class="num" id="LN644">644</td><td class="line"> <span class='keyword'>if</span> (oldID != 0) {</td></tr>
737<tr><td class="num" id="LN645">645</td><td class="line"> <span class='comment'>// we have overriden an inode</span></td></tr>
738<tr><td class="num" id="LN646">646</td><td class="line"> result = acquire_vnode(volume, oldID);</td></tr>
739<tr><td class="num" id="LN647">647</td><td class="line"> <span class='keyword'>if</span> (result == <span class='macro'>B_OK<span class='expansion'>((int)0)</span></span>) {</td></tr>
740<tr><td class="num" id="LN648">648</td><td class="line"> result = get_vnode(volume, oldID, <span class='keyword'>reinterpret_cast</span>&lt;<span class='keyword'>void</span>**&gt;(&amp;vti));</td></tr>
741<tr><td class="num" id="LN649">649</td><td class="line"> <span class='macro'>ASSERT(result == B_OK)<span class='expansion'>do { if (!(result == ((int)0))) { panic("ASSERT FAILED (%s:%d): %s"<br>, "/home/haiku/haiku/haiku/src/add-ons/kernel/file_systems/nfs4/kernel_interface.cpp"<br>, 649, "result == ((int)0)"); } } while (0)</span></span>;</td></tr>
742<tr><td class="num" id="LN650">650</td><td class="line"> <span class='keyword'>if</span> (vti-&gt;Unlink(toInode-&gt;fInfo.fNames, toName))</td></tr>
743<tr><td class="num" id="LN651">651</td><td class="line"> remove_vnode(volume, oldID);</td></tr>
744<tr><td class="num" id="LN652">652</td><td class="line"> </td></tr>
745<tr><td class="num" id="LN653">653</td><td class="line"> put_vnode(volume, oldID);</td></tr>
746<tr><td class="num" id="LN654">654</td><td class="line"> put_vnode(volume, oldID);</td></tr>
747<tr><td class="num" id="LN655">655</td><td class="line"> }</td></tr>
748<tr><td class="num" id="LN656">656</td><td class="line"> }</td></tr>
749<tr><td class="num" id="LN657">657</td><td class="line"> </td></tr>
750<tr><td class="num" id="LN658">658</td><td class="line"> result = get_vnode(volume, id, <span class='keyword'>reinterpret_cast</span>&lt;<span class='keyword'>void</span>**&gt;(&amp;vti));</td></tr>
751<tr><td class="num" id="LN659">659</td><td class="line"> <span class='keyword'>if</span> (result == <span class='macro'>B_OK<span class='expansion'>((int)0)</span></span>) {</td></tr>
752<tr><td class="num" id="LN660">660</td><td class="line"> Inode* child = vti-&gt;Get();</td></tr>
753<tr><td class="num" id="LN661">661</td><td class="line"> <span class='keyword'>if</span> (child == <span class='macro'>NULL<span class='expansion'>__null</span></span>) {</td></tr>
754<tr><td class="num" id="LN662">662</td><td class="line"> put_vnode(volume, id);</td></tr>
755<tr><td class="num" id="LN663">663</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_ENTRY_NOT_FOUND<span class='expansion'>(((-2147483647 - 1) + 0x6000) + 3)</span></span>;</td></tr>
756<tr><td class="num" id="LN664">664</td><td class="line"> }</td></tr>
757<tr><td class="num" id="LN665">665</td><td class="line"> </td></tr>
758<tr><td class="num" id="LN666">666</td><td class="line"> unremove_vnode(volume, id);</td></tr>
759<tr><td class="num" id="LN667">667</td><td class="line"> child-&gt;fInfo.fNames-&gt;RemoveName(fromInode-&gt;fInfo.fNames, fromName);</td></tr>
760<tr><td class="num" id="LN668">668</td><td class="line"> child-&gt;fInfo.fNames-&gt;AddName(toInode-&gt;fInfo.fNames, toName);</td></tr>
761<tr><td class="num" id="LN669">669</td><td class="line"> put_vnode(volume, id);</td></tr>
762<tr><td class="num" id="LN670">670</td><td class="line"> }</td></tr>
763<tr><td class="num" id="LN671">671</td><td class="line"> </td></tr>
764<tr><td class="num" id="LN672">672</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_OK<span class='expansion'>((int)0)</span></span>;</td></tr>
765<tr><td class="num" id="LN673">673</td><td class="line">}</td></tr>
766<tr><td class="num" id="LN674">674</td><td class="line"> </td></tr>
767<tr><td class="num" id="LN675">675</td><td class="line"> </td></tr>
768<tr><td class="num" id="LN676">676</td><td class="line"><span class='keyword'>static</span> status_t</td></tr>
769<tr><td class="num" id="LN677">677</td><td class="line">nfs4_access(fs_volume* volume, fs_vnode* vnode, <span class='keyword'>int</span> mode)</td></tr>
770<tr><td class="num" id="LN678">678</td><td class="line">{</td></tr>
771<tr><td class="num" id="LN679">679</td><td class="line"> VnodeToInode* vti = <span class='keyword'>reinterpret_cast</span>&lt;VnodeToInode*&gt;(vnode-&gt;private_node);</td></tr>
772<tr><td class="num" id="LN680">680</td><td class="line"> <span class='macro'>TRACE(<span class='string_literal'>"volume = %p, vnode = %"</span> B_PRIi64 <span class='string_literal'>", mode = %d"</span>, volume, vti-&gt;ID(),<span class='expansion'>(void)0</span></span></td></tr>
773<tr><td class="num" id="LN681">681</td><td class="line"> <span class='macro'>mode)<span class='expansion'>(void)0</span></span>;</td></tr>
774<tr><td class="num" id="LN682">682</td><td class="line"> </td></tr>
775<tr><td class="num" id="LN683">683</td><td class="line"> VnodeToInodeLocker _(vti);</td></tr>
776<tr><td class="num" id="LN684">684</td><td class="line"> Inode* inode = vti-&gt;Get();</td></tr>
777<tr><td class="num" id="LN685">685</td><td class="line"> <span class='keyword'>if</span> (inode == <span class='macro'>NULL<span class='expansion'>__null</span></span>)</td></tr>
778<tr><td class="num" id="LN686">686</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_ENTRY_NOT_FOUND<span class='expansion'>(((-2147483647 - 1) + 0x6000) + 3)</span></span>;</td></tr>
779<tr><td class="num" id="LN687">687</td><td class="line"> </td></tr>
780<tr><td class="num" id="LN688">688</td><td class="line"> <span class='keyword'>return</span> inode-&gt;Access(mode);</td></tr>
781<tr><td class="num" id="LN689">689</td><td class="line">}</td></tr>
782<tr><td class="num" id="LN690">690</td><td class="line"> </td></tr>
783<tr><td class="num" id="LN691">691</td><td class="line"> </td></tr>
784<tr><td class="num" id="LN692">692</td><td class="line"><span class='keyword'>static</span> status_t</td></tr>
785<tr><td class="num" id="LN693">693</td><td class="line">nfs4_read_stat(fs_volume* volume, fs_vnode* vnode, <span class='keyword'>struct</span> stat* stat)</td></tr>
786<tr><td class="num" id="LN694">694</td><td class="line">{</td></tr>
787<tr><td class="num" id="LN695">695</td><td class="line"> VnodeToInode* vti = <span class='keyword'>reinterpret_cast</span>&lt;VnodeToInode*&gt;(vnode-&gt;private_node);</td></tr>
788<tr><td class="num" id="LN696">696</td><td class="line"> <span class='macro'>TRACE(<span class='string_literal'>"volume = %p, vnode = %"</span> B_PRIi64, volume, vti-&gt;ID())<span class='expansion'>(void)0</span></span>;</td></tr>
789<tr><td class="num" id="LN697">697</td><td class="line"> </td></tr>
790<tr><td class="num" id="LN698">698</td><td class="line"> VnodeToInodeLocker _(vti);</td></tr>
791<tr><td class="num" id="LN699">699</td><td class="line"> Inode* inode = vti-&gt;Get();</td></tr>
792<tr><td class="num" id="LN700">700</td><td class="line"> <span class='keyword'>if</span> (inode == <span class='macro'>NULL<span class='expansion'>__null</span></span>)</td></tr>
793<tr><td class="num" id="LN701">701</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_ENTRY_NOT_FOUND<span class='expansion'>(((-2147483647 - 1) + 0x6000) + 3)</span></span>;</td></tr>
794<tr><td class="num" id="LN702">702</td><td class="line"> </td></tr>
795<tr><td class="num" id="LN703">703</td><td class="line"> status_t result = inode-&gt;Stat(stat);</td></tr>
796<tr><td class="num" id="LN704">704</td><td class="line"> <span class='keyword'>if</span> (inode-&gt;GetOpenState() != <span class='macro'>NULL<span class='expansion'>__null</span></span>)</td></tr>
797<tr><td class="num" id="LN705">705</td><td class="line"> stat-&gt;st_size = inode-&gt;MaxFileSize();</td></tr>
798<tr><td class="num" id="LN706">706</td><td class="line"> <span class='keyword'>return</span> result;</td></tr>
799<tr><td class="num" id="LN707">707</td><td class="line">}</td></tr>
800<tr><td class="num" id="LN708">708</td><td class="line"> </td></tr>
801<tr><td class="num" id="LN709">709</td><td class="line"> </td></tr>
802<tr><td class="num" id="LN710">710</td><td class="line"><span class='keyword'>static</span> status_t</td></tr>
803<tr><td class="num" id="LN711">711</td><td class="line">nfs4_write_stat(fs_volume* volume, fs_vnode* vnode, <span class='keyword'>const</span> <span class='keyword'>struct</span> stat* stat,</td></tr>
804<tr><td class="num" id="LN712">712</td><td class="line"> uint32 statMask)</td></tr>
805<tr><td class="num" id="LN713">713</td><td class="line">{</td></tr>
806<tr><td class="num" id="LN714">714</td><td class="line"> VnodeToInode* vti = <span class='keyword'>reinterpret_cast</span>&lt;VnodeToInode*&gt;(vnode-&gt;private_node);</td></tr>
807<tr><td class="num" id="LN715">715</td><td class="line"> <span class='macro'>TRACE(<span class='string_literal'>"volume = %p, vnode = %"</span> B_PRIi64 <span class='string_literal'>", statMask = %"</span> B_PRIu32, volume,<span class='expansion'>(void)0</span></span></td></tr>
808<tr><td class="num" id="LN716">716</td><td class="line"> <span class='macro'>vti-&gt;ID(), statMask)<span class='expansion'>(void)0</span></span>;</td></tr>
809<tr><td class="num" id="LN717">717</td><td class="line"> </td></tr>
810<tr><td class="num" id="LN718">718</td><td class="line"> VnodeToInodeLocker _(vti);</td></tr>
811<tr><td class="num" id="LN719">719</td><td class="line"> Inode* inode = vti-&gt;Get();</td></tr>
812<tr><td class="num" id="LN720">720</td><td class="line"> <span class='keyword'>if</span> (inode == <span class='macro'>NULL<span class='expansion'>__null</span></span>)</td></tr>
813<tr><td class="num" id="LN721">721</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_ENTRY_NOT_FOUND<span class='expansion'>(((-2147483647 - 1) + 0x6000) + 3)</span></span>;</td></tr>
814<tr><td class="num" id="LN722">722</td><td class="line"> </td></tr>
815<tr><td class="num" id="LN723">723</td><td class="line"> <span class='keyword'>return</span> inode-&gt;WriteStat(stat, statMask);</td></tr>
816<tr><td class="num" id="LN724">724</td><td class="line">}</td></tr>
817<tr><td class="num" id="LN725">725</td><td class="line"> </td></tr>
818<tr><td class="num" id="LN726">726</td><td class="line"> </td></tr>
819<tr><td class="num" id="LN727">727</td><td class="line"><span class='keyword'>static</span> status_t</td></tr>
820<tr><td class="num" id="LN728">728</td><td class="line">get_new_vnode(fs_volume* volume, ino_t id, VnodeToInode** _vti)</td></tr>
821<tr><td class="num" id="LN729">729</td><td class="line">{</td></tr>
822<tr><td class="num" id="LN730">730</td><td class="line"> FileSystem* fs = <span class='keyword'>reinterpret_cast</span>&lt;FileSystem*&gt;(volume-&gt;private_volume);</td></tr>
823<tr><td class="num" id="LN731">731</td><td class="line"> Inode* inode;</td></tr>
824<tr><td class="num" id="LN732">732</td><td class="line"> VnodeToInode* vti;</td></tr>
825<tr><td class="num" id="LN733">733</td><td class="line"> </td></tr>
826<tr><td class="num" id="LN734">734</td><td class="line"> status_t result = acquire_vnode(volume, id);</td></tr>
827<tr><td class="num" id="LN735">735</td><td class="line"> <span class='keyword'>if</span> (result == <span class='macro'>B_OK<span class='expansion'>((int)0)</span></span>) {</td></tr>
828<tr><td class="num" id="LN736">736</td><td class="line"> <span class='macro'>ASSERT(get_vnode(volume, id, <span class='keyword'>reinterpret_cast</span>&lt;<span class='keyword'>void</span>**&gt;(_vti)) == B_OK)<span class='expansion'>do { if (!(get_vnode(volume, id, reinterpret_cast&lt;void**&gt;<br>(_vti)) == ((int)0))) { panic("ASSERT FAILED (%s:%d): %s", "/home/haiku/haiku/haiku/src/add-ons/kernel/file_systems/nfs4/kernel_interface.cpp"<br>, 736, "get_vnode(volume, id, reinterpret_cast&lt;void**&gt;(_vti)) == ((int)0)"<br>); } } while (0)</span></span>;</td></tr>
829<tr><td class="num" id="LN737">737</td><td class="line"> unremove_vnode(volume, id);</td></tr>
830<tr><td class="num" id="LN738">738</td><td class="line"> </td></tr>
831<tr><td class="num" id="LN739">739</td><td class="line"> <span class='comment'>// Release after acquire</span></td></tr>
832<tr><td class="num" id="LN740">740</td><td class="line"> put_vnode(volume, id);</td></tr>
833<tr><td class="num" id="LN741">741</td><td class="line"> </td></tr>
834<tr><td class="num" id="LN742">742</td><td class="line"> vti = *_vti;</td></tr>
835<tr><td class="num" id="LN743">743</td><td class="line"> </td></tr>
836<tr><td class="num" id="LN744">744</td><td class="line"> <span class='keyword'>if</span> (vti-&gt;Get() == <span class='macro'>NULL<span class='expansion'>__null</span></span>) {</td></tr>
837<tr><td class="num" id="LN745">745</td><td class="line"> result = fs-&gt;GetInode(id, &amp;inode);</td></tr>
838<tr><td class="num" id="LN746">746</td><td class="line"> <span class='keyword'>if</span> (result != <span class='macro'>B_OK<span class='expansion'>((int)0)</span></span>) {</td></tr>
839<tr><td class="num" id="LN747">747</td><td class="line"> put_vnode(volume, id);</td></tr>
840<tr><td class="num" id="LN748">748</td><td class="line"> <span class='keyword'>return</span> result;</td></tr>
841<tr><td class="num" id="LN749">749</td><td class="line"> }</td></tr>
842<tr><td class="num" id="LN750">750</td><td class="line"> </td></tr>
843<tr><td class="num" id="LN751">751</td><td class="line"> vti-&gt;Replace(inode);</td></tr>
844<tr><td class="num" id="LN752">752</td><td class="line"> }</td></tr>
845<tr><td class="num" id="LN753">753</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_OK<span class='expansion'>((int)0)</span></span>;</td></tr>
846<tr><td class="num" id="LN754">754</td><td class="line"> }</td></tr>
847<tr><td class="num" id="LN755">755</td><td class="line"> </td></tr>
848<tr><td class="num" id="LN756">756</td><td class="line"> <span class='keyword'>return</span> get_vnode(volume, id, <span class='keyword'>reinterpret_cast</span>&lt;<span class='keyword'>void</span>**&gt;(_vti));</td></tr>
849<tr><td class="num" id="LN757">757</td><td class="line">}</td></tr>
850<tr><td class="num" id="LN758">758</td><td class="line"> </td></tr>
851<tr><td class="num" id="LN759">759</td><td class="line"> </td></tr>
852<tr><td class="num" id="LN760">760</td><td class="line"><span class='keyword'>static</span> status_t</td></tr>
853<tr><td class="num" id="LN761">761</td><td class="line">nfs4_create(fs_volume* volume, fs_vnode* dir, <span class='keyword'>const</span> <span class='keyword'>char</span>* name, <span class='keyword'>int</span> openMode,</td></tr>
854<tr><td class="num" id="LN762">762</td><td class="line"> <span class='keyword'>int</span> perms, <span class='keyword'>void</span>** _cookie, ino_t* _newVnodeID)</td></tr>
855<tr><td class="num" id="LN763">763</td><td class="line">{</td></tr>
856<tr><td class="num" id="LN764">764</td><td class="line"> FileSystem* fs = <span class='keyword'>reinterpret_cast</span>&lt;FileSystem*&gt;(volume-&gt;private_volume);</td></tr>
857<tr><td class="num" id="LN765">765</td><td class="line"> </td></tr>
858<tr><td class="num" id="LN766">766</td><td class="line"> OpenFileCookie* cookie = <span class='keyword'>new</span> OpenFileCookie(fs);</td></tr>
859<tr><td class="num" id="LN767">767</td><td class="line"> <span class='keyword'>if</span> (cookie == <span class='macro'>NULL<span class='expansion'>__null</span></span>)</td></tr>
860<tr><td class="num" id="LN768">768</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_NO_MEMORY<span class='expansion'>((-2147483647 - 1) + 0)</span></span>;</td></tr>
861<tr><td class="num" id="LN769">769</td><td class="line"> *_cookie = cookie;</td></tr>
862<tr><td class="num" id="LN770">770</td><td class="line"> </td></tr>
863<tr><td class="num" id="LN771">771</td><td class="line"> VnodeToInode* vti = <span class='keyword'>reinterpret_cast</span>&lt;VnodeToInode*&gt;(dir-&gt;private_node);</td></tr>
864<tr><td class="num" id="LN772">772</td><td class="line"> <span class='macro'>TRACE(<span class='string_literal'>"volume = %p, dir = %"</span> B_PRIi64 <span class='string_literal'>", name = %s, openMode = %d,"</span> \<span class='expansion'>(void)0</span></span></td></tr>
865<tr><td class="num" id="LN773">773</td><td class="line"> <span class='string_literal'><span class='macro'>" perms = %d"</span>, volume, vti-&gt;ID(), name, openMode, perms)<span class='expansion'>(void)0</span></span>;</td></tr>
866<tr><td class="num" id="LN774">774</td><td class="line"> </td></tr>
867<tr><td class="num" id="LN775">775</td><td class="line"> VnodeToInodeLocker _(vti);</td></tr>
868<tr><td class="num" id="LN776">776</td><td class="line"> Inode* inode = vti-&gt;Get();</td></tr>
869<tr><td class="num" id="LN777">777</td><td class="line"> <span class='keyword'>if</span> (inode == <span class='macro'>NULL<span class='expansion'>__null</span></span>)</td></tr>
870<tr><td class="num" id="LN778">778</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_ENTRY_NOT_FOUND<span class='expansion'>(((-2147483647 - 1) + 0x6000) + 3)</span></span>;</td></tr>
871<tr><td class="num" id="LN779">779</td><td class="line"> </td></tr>
872<tr><td class="num" id="LN780">780</td><td class="line"> MutexLocker createLocker(fs-&gt;CreateFileLock());</td></tr>
873<tr><td class="num" id="LN781">781</td><td class="line"> </td></tr>
874<tr><td class="num" id="LN782">782</td><td class="line"> OpenDelegationData data;</td></tr>
875<tr><td class="num" id="LN783">783</td><td class="line"> status_t result = inode-&gt;Create(name, openMode, perms, cookie, &amp;data,</td></tr>
876<tr><td class="num" id="LN784">784</td><td class="line"> _newVnodeID);</td></tr>
877<tr><td class="num" id="LN785">785</td><td class="line"> <span class='keyword'>if</span> (result != <span class='macro'>B_OK<span class='expansion'>((int)0)</span></span>) {</td></tr>
878<tr><td class="num" id="LN786">786</td><td class="line"> <span class='keyword'>delete</span> cookie;</td></tr>
879<tr><td class="num" id="LN787">787</td><td class="line"> <span class='keyword'>return</span> result;</td></tr>
880<tr><td class="num" id="LN788">788</td><td class="line"> }</td></tr>
881<tr><td class="num" id="LN789">789</td><td class="line"> </td></tr>
882<tr><td class="num" id="LN790">790</td><td class="line"> result = get_new_vnode(volume, *_newVnodeID, &amp;vti);</td></tr>
883<tr><td class="num" id="LN791">791</td><td class="line"> <span class='keyword'>if</span> (result != <span class='macro'>B_OK<span class='expansion'>((int)0)</span></span>) {</td></tr>
884<tr><td class="num" id="LN792">792</td><td class="line"> <span class='keyword'>delete</span> cookie;</td></tr>
885<tr><td class="num" id="LN793">793</td><td class="line"> <span class='keyword'>return</span> result;</td></tr>
886<tr><td class="num" id="LN794">794</td><td class="line"> }</td></tr>
887<tr><td class="num" id="LN795">795</td><td class="line"> </td></tr>
888<tr><td class="num" id="LN796">796</td><td class="line"> VnodeToInodeLocker _child(vti);</td></tr>
889<tr><td class="num" id="LN797">797</td><td class="line"> Inode* child = vti-&gt;Get();</td></tr>
890<tr><td class="num" id="LN798">798</td><td class="line"> <span class='keyword'>if</span> (child == <span class='macro'>NULL<span class='expansion'>__null</span></span>) {</td></tr>
891<tr><td class="num" id="LN799">799</td><td class="line"> <span class='keyword'>delete</span> cookie;</td></tr>
892<tr><td class="num" id="LN800">800</td><td class="line"> put_vnode(volume, *_newVnodeID);</td></tr>
893<tr><td class="num" id="LN801">801</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_ENTRY_NOT_FOUND<span class='expansion'>(((-2147483647 - 1) + 0x6000) + 3)</span></span>;</td></tr>
894<tr><td class="num" id="LN802">802</td><td class="line"> }</td></tr>
895<tr><td class="num" id="LN803">803</td><td class="line"> </td></tr>
896<tr><td class="num" id="LN804">804</td><td class="line"> child-&gt;SetOpenState(cookie-&gt;fOpenState);</td></tr>
897<tr><td class="num" id="LN805">805</td><td class="line"> </td></tr>
898<tr><td class="num" id="LN806">806</td><td class="line"> <span class='keyword'>if</span> (data.fType != OPEN_DELEGATE_NONE) {</td></tr>
899<tr><td class="num" id="LN807">807</td><td class="line"> Delegation* delegation</td></tr>
900<tr><td class="num" id="LN808">808</td><td class="line"> = <span class='keyword'>new</span>(std::nothrow) Delegation(data, child,</td></tr>
901<tr><td class="num" id="LN809">809</td><td class="line"> cookie-&gt;fOpenState-&gt;fClientID);</td></tr>
902<tr><td class="num" id="LN810">810</td><td class="line"> <span class='keyword'>if</span> (delegation != <span class='macro'>NULL<span class='expansion'>__null</span></span>) {</td></tr>
903<tr><td class="num" id="LN811">811</td><td class="line"> delegation-&gt;fInfo = cookie-&gt;fOpenState-&gt;fInfo;</td></tr>
904<tr><td class="num" id="LN812">812</td><td class="line"> delegation-&gt;fFileSystem = child-&gt;GetFileSystem();</td></tr>
905<tr><td class="num" id="LN813">813</td><td class="line"> child-&gt;SetDelegation(delegation);</td></tr>
906<tr><td class="num" id="LN814">814</td><td class="line"> }</td></tr>
907<tr><td class="num" id="LN815">815</td><td class="line"> }</td></tr>
908<tr><td class="num" id="LN816">816</td><td class="line"> </td></tr>
909<tr><td class="num" id="LN817">817</td><td class="line"> <span class='macro'>TRACE(<span class='string_literal'>"*cookie = %p, *newVnodeID = %"</span> B_PRIi64, *_cookie, *_newVnodeID)<span class='expansion'>(void)0</span></span>;</td></tr>
910<tr><td class="num" id="LN818">818</td><td class="line"> <span class='keyword'>return</span> result;</td></tr>
911<tr><td class="num" id="LN819">819</td><td class="line">}</td></tr>
912<tr><td class="num" id="LN820">820</td><td class="line"> </td></tr>
913<tr><td class="num" id="LN821">821</td><td class="line"> </td></tr>
914<tr><td class="num" id="LN822">822</td><td class="line"><span class='keyword'>static</span> status_t</td></tr>
915<tr><td class="num" id="LN823">823</td><td class="line">nfs4_open(fs_volume* volume, fs_vnode* vnode, <span class='keyword'>int</span> openMode, <span class='keyword'>void</span>** _cookie)</td></tr>
916<tr><td class="num" id="LN824">824</td><td class="line">{</td></tr>
917<tr><td class="num" id="LN825">825</td><td class="line"> VnodeToInode* vti = <span class='keyword'>reinterpret_cast</span>&lt;VnodeToInode*&gt;(vnode-&gt;private_node);</td></tr>
918<tr><td class="num" id="LN826">826</td><td class="line"> <span class='macro'>TRACE(<span class='string_literal'>"volume = %p, vnode = %"</span> B_PRIi64 <span class='string_literal'>", openMode = %d"</span>, volume,<span class='expansion'>(void)0</span></span></td></tr>
919<tr><td class="num" id="LN827">827</td><td class="line"> <span class='macro'>vti-&gt;ID(), openMode)<span class='expansion'>(void)0</span></span>;</td></tr>
920<tr><td class="num" id="LN828">828</td><td class="line"> </td></tr>
921<tr><td class="num" id="LN829">829</td><td class="line"> VnodeToInodeLocker _(vti);</td></tr>
922<tr><td class="num" id="LN830">830</td><td class="line"> Inode* inode = vti-&gt;Get();</td></tr>
923<tr><td class="num" id="LN831">831</td><td class="line"> <span class='keyword'>if</span> (inode == <span class='macro'>NULL<span class='expansion'>__null</span></span>)</td></tr>
924<tr><td class="num" id="LN832">832</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_ENTRY_NOT_FOUND<span class='expansion'>(((-2147483647 - 1) + 0x6000) + 3)</span></span>;</td></tr>
925<tr><td class="num" id="LN833">833</td><td class="line"> </td></tr>
926<tr><td class="num" id="LN834">834</td><td class="line"> <span class='keyword'>if</span> (inode-&gt;Type() == <span class='macro'>S_IFDIR<span class='expansion'>00000040000</span></span> || inode-&gt;Type() == <span class='macro'>S_IFLNK<span class='expansion'>00000120000</span></span>) {</td></tr>
927<tr><td class="num" id="LN835">835</td><td class="line"> *_cookie = <span class='macro'>NULL<span class='expansion'>__null</span></span>;</td></tr>
928<tr><td class="num" id="LN836">836</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_OK<span class='expansion'>((int)0)</span></span>;</td></tr>
929<tr><td class="num" id="LN837">837</td><td class="line"> }</td></tr>
930<tr><td class="num" id="LN838">838</td><td class="line"> </td></tr>
931<tr><td class="num" id="LN839">839</td><td class="line"> FileSystem* fs = <span class='keyword'>reinterpret_cast</span>&lt;FileSystem*&gt;(volume-&gt;private_volume);</td></tr>
932<tr><td class="num" id="LN840">840</td><td class="line"> OpenFileCookie* cookie = <span class='keyword'>new</span> OpenFileCookie(fs);</td></tr>
933<tr><td class="num" id="LN841">841</td><td class="line"> <span class='keyword'>if</span> (cookie == <span class='macro'>NULL<span class='expansion'>__null</span></span>)</td></tr>
934<tr><td class="num" id="LN842">842</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_NO_MEMORY<span class='expansion'>((-2147483647 - 1) + 0)</span></span>;</td></tr>
935<tr><td class="num" id="LN843">843</td><td class="line"> *_cookie = cookie;</td></tr>
936<tr><td class="num" id="LN844">844</td><td class="line"> </td></tr>
937<tr><td class="num" id="LN845">845</td><td class="line"> status_t result = inode-&gt;Open(openMode, cookie);</td></tr>
938<tr><td class="num" id="LN846">846</td><td class="line"> <span class='keyword'>if</span> (result != <span class='macro'>B_OK<span class='expansion'>((int)0)</span></span>)</td></tr>
939<tr><td class="num" id="LN847">847</td><td class="line"> <span class='keyword'>delete</span> cookie;</td></tr>
940<tr><td class="num" id="LN848">848</td><td class="line"> </td></tr>
941<tr><td class="num" id="LN849">849</td><td class="line"> <span class='macro'>TRACE(<span class='string_literal'>"*cookie = %p"</span>, *_cookie)<span class='expansion'>(void)0</span></span>;</td></tr>
942<tr><td class="num" id="LN850">850</td><td class="line"> </td></tr>
943<tr><td class="num" id="LN851">851</td><td class="line"> <span class='keyword'>return</span> result;</td></tr>
944<tr><td class="num" id="LN852">852</td><td class="line">}</td></tr>
945<tr><td class="num" id="LN853">853</td><td class="line"> </td></tr>
946<tr><td class="num" id="LN854">854</td><td class="line"> </td></tr>
947<tr><td class="num" id="LN855">855</td><td class="line"><span class='keyword'>static</span> status_t</td></tr>
948<tr><td class="num" id="LN856">856</td><td class="line">nfs4_close(fs_volume* volume, fs_vnode* vnode, <span class='keyword'>void</span>* _cookie)</td></tr>
949<tr><td class="num" id="LN857">857</td><td class="line">{</td></tr>
950<tr><td class="num" id="LN858">858</td><td class="line"> VnodeToInode* vti = <span class='keyword'>reinterpret_cast</span>&lt;VnodeToInode*&gt;(vnode-&gt;private_node);</td></tr>
951<tr><td class="num" id="LN859">859</td><td class="line"> </td></tr>
952<tr><td class="num" id="LN860">860</td><td class="line"> <span class='macro'>TRACE(<span class='string_literal'>"volume = %p, vnode = %"</span> B_PRIi64 <span class='string_literal'>", cookie = %p"</span>, volume, vti-&gt;ID(),<span class='expansion'>(void)0</span></span></td></tr>
953<tr><td class="num" id="LN861">861</td><td class="line"> <span class='macro'>_cookie)<span class='expansion'>(void)0</span></span>;</td></tr>
954<tr><td class="num" id="LN862">862</td><td class="line"> </td></tr>
955<tr><td class="num" id="LN863">863</td><td class="line"> VnodeToInodeLocker _(vti);</td></tr>
956<tr><td class="num" id="LN864">864</td><td class="line"> Inode* inode = vti-&gt;Get();</td></tr>
957<tr><td class="num" id="LN865">865</td><td class="line"> <span class='keyword'>if</span> (inode == <span class='macro'>NULL<span class='expansion'>__null</span></span>)</td></tr>
958<tr><td class="num" id="LN866">866</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_ENTRY_NOT_FOUND<span class='expansion'>(((-2147483647 - 1) + 0x6000) + 3)</span></span>;</td></tr>
959<tr><td class="num" id="LN867">867</td><td class="line"> </td></tr>
960<tr><td class="num" id="LN868">868</td><td class="line"> </td></tr>
961<tr><td class="num" id="LN869">869</td><td class="line"> <span class='keyword'>if</span> (inode-&gt;Type() == <span class='macro'>S_IFDIR<span class='expansion'>00000040000</span></span> || inode-&gt;Type() == <span class='macro'>S_IFLNK<span class='expansion'>00000120000</span></span>)</td></tr>
962<tr><td class="num" id="LN870">870</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_OK<span class='expansion'>((int)0)</span></span>;</td></tr>
963<tr><td class="num" id="LN871">871</td><td class="line"> </td></tr>
964<tr><td class="num" id="LN872">872</td><td class="line"> Cookie* cookie = <span class='keyword'>reinterpret_cast</span>&lt;Cookie*&gt;(_cookie);</td></tr>
965<tr><td class="num" id="LN873">873</td><td class="line"> <span class='keyword'>return</span> cookie-&gt;CancelAll();</td></tr>
966<tr><td class="num" id="LN874">874</td><td class="line">}</td></tr>
967<tr><td class="num" id="LN875">875</td><td class="line"> </td></tr>
968<tr><td class="num" id="LN876">876</td><td class="line"> </td></tr>
969<tr><td class="num" id="LN877">877</td><td class="line"><span class='keyword'>static</span> status_t</td></tr>
970<tr><td class="num" id="LN878">878</td><td class="line">nfs4_free_cookie(fs_volume* volume, fs_vnode* vnode, <span class='keyword'>void</span>* _cookie)</td></tr>
971<tr><td class="num" id="LN879">879</td><td class="line">{</td></tr>
972<tr><td class="num" id="LN880">880</td><td class="line"> VnodeToInode* vti = <span class='keyword'>reinterpret_cast</span>&lt;VnodeToInode*&gt;(vnode-&gt;private_node);</td></tr>
973<tr><td class="num" id="LN881">881</td><td class="line"> </td></tr>
974<tr><td class="num" id="LN882">882</td><td class="line"> <span class='macro'>TRACE(<span class='string_literal'>"volume = %p, vnode = %"</span> B_PRIi64 <span class='string_literal'>", cookie = %p"</span>, volume, vti-&gt;ID(),<span class='expansion'>(void)0</span></span></td></tr>
975<tr><td class="num" id="LN883">883</td><td class="line"> <span class='macro'>_cookie)<span class='expansion'>(void)0</span></span>;</td></tr>
976<tr><td class="num" id="LN884">884</td><td class="line"> </td></tr>
977<tr><td class="num" id="LN885">885</td><td class="line"> VnodeToInodeLocker _(vti);</td></tr>
978<tr><td class="num" id="LN886">886</td><td class="line"> Inode* inode = vti-&gt;Get();</td></tr>
979<tr><td class="num" id="LN887">887</td><td class="line"> <span class='keyword'>if</span> (inode == <span class='macro'>NULL<span class='expansion'>__null</span></span>)</td></tr>
980<tr><td class="num" id="LN888">888</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_ENTRY_NOT_FOUND<span class='expansion'>(((-2147483647 - 1) + 0x6000) + 3)</span></span>;</td></tr>
981<tr><td class="num" id="LN889">889</td><td class="line"> </td></tr>
982<tr><td class="num" id="LN890">890</td><td class="line"> <span class='keyword'>if</span> (inode-&gt;Type() == <span class='macro'>S_IFDIR<span class='expansion'>00000040000</span></span> || inode-&gt;Type() == <span class='macro'>S_IFLNK<span class='expansion'>00000120000</span></span>)</td></tr>
983<tr><td class="num" id="LN891">891</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_OK<span class='expansion'>((int)0)</span></span>;</td></tr>
984<tr><td class="num" id="LN892">892</td><td class="line"> </td></tr>
985<tr><td class="num" id="LN893">893</td><td class="line"> OpenFileCookie* cookie = <span class='keyword'>reinterpret_cast</span>&lt;OpenFileCookie*&gt;(_cookie);</td></tr>
986<tr><td class="num" id="LN894">894</td><td class="line"> </td></tr>
987<tr><td class="num" id="LN895">895</td><td class="line"> inode-&gt;Close(cookie);</td></tr>
988<tr><td class="num" id="LN896">896</td><td class="line"> <span class='keyword'>delete</span> cookie;</td></tr>
989<tr><td class="num" id="LN897">897</td><td class="line"> </td></tr>
990<tr><td class="num" id="LN898">898</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_OK<span class='expansion'>((int)0)</span></span>;</td></tr>
991<tr><td class="num" id="LN899">899</td><td class="line">}</td></tr>
992<tr><td class="num" id="LN900">900</td><td class="line"> </td></tr>
993<tr><td class="num" id="LN901">901</td><td class="line"> </td></tr>
994<tr><td class="num" id="LN902">902</td><td class="line"><span class='keyword'>static</span> status_t</td></tr>
995<tr><td class="num" id="LN903">903</td><td class="line">nfs4_read(fs_volume* volume, fs_vnode* vnode, <span class='keyword'>void</span>* _cookie, off_t pos,</td></tr>
996<tr><td class="num" id="LN904">904</td><td class="line"> <span class='keyword'>void</span>* buffer, size_t* length)</td></tr>
997<tr><td class="num" id="LN905">905</td><td class="line">{</td></tr>
998<tr><td class="num" id="LN906">906</td><td class="line"> VnodeToInode* vti = <span class='keyword'>reinterpret_cast</span>&lt;VnodeToInode*&gt;(vnode-&gt;private_node);</td></tr>
999<tr><td class="num" id="LN907">907</td><td class="line"> <span class='macro'>TRACE(<span class='string_literal'>"volume = %p, vnode = %"</span> B_PRIi64 <span class='string_literal'>", cookie = %p, pos = %"</span> B_PRIi64 \<span class='expansion'>(void)0</span></span></td></tr>
1000<tr><td class="num" id="LN908">908</td><td class="line"> <span class='string_literal'><span class='macro'>", length = %lu"</span>, volume, vti-&gt;ID(), _cookie, pos, *length)<span class='expansion'>(void)0</span></span>;</td></tr>
1001<tr><td class="num" id="LN909">909</td><td class="line"> </td></tr>
1002<tr><td class="num" id="LN910">910</td><td class="line"> VnodeToInodeLocker _(vti);</td></tr>
1003<tr><td class="num" id="LN911">911</td><td class="line"> Inode* inode = vti-&gt;Get();</td></tr>
1004<tr><td class="num" id="LN912">912</td><td class="line"> <span class='keyword'>if</span> (inode == <span class='macro'>NULL<span class='expansion'>__null</span></span>)</td></tr>
1005<tr><td class="num" id="LN913">913</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_ENTRY_NOT_FOUND<span class='expansion'>(((-2147483647 - 1) + 0x6000) + 3)</span></span>;</td></tr>
1006<tr><td class="num" id="LN914">914</td><td class="line"> </td></tr>
1007<tr><td class="num" id="LN915">915</td><td class="line"> <span class='keyword'>if</span> (inode-&gt;Type() == <span class='macro'>S_IFDIR<span class='expansion'>00000040000</span></span>)</td></tr>
1008<tr><td class="num" id="LN916">916</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_IS_A_DIRECTORY<span class='expansion'>(((-2147483647 - 1) + 0x6000) + 9)</span></span>;</td></tr>
1009<tr><td class="num" id="LN917">917</td><td class="line"> </td></tr>
1010<tr><td class="num" id="LN918">918</td><td class="line"> <span class='keyword'>if</span> (inode-&gt;Type() == <span class='macro'>S_IFLNK<span class='expansion'>00000120000</span></span>)</td></tr>
1011<tr><td class="num" id="LN919">919</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_BAD_VALUE<span class='expansion'>((-2147483647 - 1) + 5)</span></span>;</td></tr>
1012<tr><td class="num" id="LN920">920</td><td class="line"> </td></tr>
1013<tr><td class="num" id="LN921">921</td><td class="line"> OpenFileCookie* cookie = <span class='keyword'>reinterpret_cast</span>&lt;OpenFileCookie*&gt;(_cookie);</td></tr>
1014<tr><td class="num" id="LN922">922</td><td class="line"> </td></tr>
1015<tr><td class="num" id="LN923">923</td><td class="line"> <span class='keyword'>return</span> inode-&gt;Read(cookie, pos, buffer, length);;</td></tr>
1016<tr><td class="num" id="LN924">924</td><td class="line">}</td></tr>
1017<tr><td class="num" id="LN925">925</td><td class="line"> </td></tr>
1018<tr><td class="num" id="LN926">926</td><td class="line"> </td></tr>
1019<tr><td class="num" id="LN927">927</td><td class="line"><span class='keyword'>static</span> status_t</td></tr>
1020<tr><td class="num" id="LN928">928</td><td class="line">nfs4_write(fs_volume* volume, fs_vnode* vnode, <span class='keyword'>void</span>* _cookie, off_t pos,</td></tr>
1021<tr><td class="num" id="LN929">929</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>void</span>* _buffer, size_t* length)</td></tr>
1022<tr><td class="num" id="LN930">930</td><td class="line">{</td></tr>
1023<tr><td class="num" id="LN931">931</td><td class="line"> VnodeToInode* vti = <span class='keyword'>reinterpret_cast</span>&lt;VnodeToInode*&gt;(vnode-&gt;private_node);</td></tr>
1024<tr><td class="num" id="LN932">932</td><td class="line"> <span class='macro'>TRACE(<span class='string_literal'>"volume = %p, vnode = %"</span> B_PRIi64 <span class='string_literal'>", cookie = %p, pos = %"</span> B_PRIi64 \<span class='expansion'>(void)0</span></span></td></tr>
1025<tr><td class="num" id="LN933">933</td><td class="line"> <span class='string_literal'><span class='macro'>", length = %lu"</span>, volume, vti-&gt;ID(), _cookie, pos, *length)<span class='expansion'>(void)0</span></span>;</td></tr>
1026<tr><td class="num" id="LN934">934</td><td class="line"> </td></tr>
1027<tr><td class="num" id="LN935">935</td><td class="line"> VnodeToInodeLocker _(vti);</td></tr>
1028<tr><td class="num" id="LN936">936</td><td class="line"> Inode* inode = vti-&gt;Get();</td></tr>
1029<tr><td class="num" id="LN937">937</td><td class="line"> <span class='keyword'>if</span> (inode == <span class='macro'>NULL<span class='expansion'>__null</span></span>)</td></tr>
1030<tr><td class="num" id="LN938">938</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_ENTRY_NOT_FOUND<span class='expansion'>(((-2147483647 - 1) + 0x6000) + 3)</span></span>;</td></tr>
1031<tr><td class="num" id="LN939">939</td><td class="line"> </td></tr>
1032<tr><td class="num" id="LN940">940</td><td class="line"> <span class='keyword'>if</span> (inode-&gt;Type() == <span class='macro'>S_IFDIR<span class='expansion'>00000040000</span></span>)</td></tr>
1033<tr><td class="num" id="LN941">941</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_IS_A_DIRECTORY<span class='expansion'>(((-2147483647 - 1) + 0x6000) + 9)</span></span>;</td></tr>
1034<tr><td class="num" id="LN942">942</td><td class="line"> </td></tr>
1035<tr><td class="num" id="LN943">943</td><td class="line"> <span class='keyword'>if</span> (inode-&gt;Type() == <span class='macro'>S_IFLNK<span class='expansion'>00000120000</span></span>)</td></tr>
1036<tr><td class="num" id="LN944">944</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_BAD_VALUE<span class='expansion'>((-2147483647 - 1) + 5)</span></span>;</td></tr>
1037<tr><td class="num" id="LN945">945</td><td class="line"> </td></tr>
1038<tr><td class="num" id="LN946">946</td><td class="line"> OpenFileCookie* cookie = <span class='keyword'>reinterpret_cast</span>&lt;OpenFileCookie*&gt;(_cookie);</td></tr>
1039<tr><td class="num" id="LN947">947</td><td class="line"> </td></tr>
1040<tr><td class="num" id="LN948">948</td><td class="line"> <span class='keyword'>return</span> inode-&gt;Write(cookie, pos, _buffer, length);</td></tr>
1041<tr><td class="num" id="LN949">949</td><td class="line">}</td></tr>
1042<tr><td class="num" id="LN950">950</td><td class="line"> </td></tr>
1043<tr><td class="num" id="LN951">951</td><td class="line"> </td></tr>
1044<tr><td class="num" id="LN952">952</td><td class="line"><span class='keyword'>static</span> status_t</td></tr>
1045<tr><td class="num" id="LN953">953</td><td class="line">nfs4_create_dir(fs_volume* volume, fs_vnode* parent, <span class='keyword'>const</span> <span class='keyword'>char</span>* name,</td></tr>
1046<tr><td class="num" id="LN954">954</td><td class="line"> <span class='keyword'>int</span> mode)</td></tr>
1047<tr><td class="num" id="LN955">955</td><td class="line">{</td></tr>
1048<tr><td class="num" id="LN956">956</td><td class="line"> VnodeToInode* vti = <span class='keyword'>reinterpret_cast</span>&lt;VnodeToInode*&gt;(parent-&gt;private_node);</td></tr>
1049<tr><td class="num" id="LN957">957</td><td class="line"> <span class='macro'>TRACE(<span class='string_literal'>"volume = %p, parent = %"</span> B_PRIi64 <span class='string_literal'>", mode = %d"</span>, volume, vti-&gt;ID(),<span class='expansion'>(void)0</span></span></td></tr>
1050<tr><td class="num" id="LN958">958</td><td class="line"> <span class='macro'>mode)<span class='expansion'>(void)0</span></span>;</td></tr>
1051<tr><td class="num" id="LN959">959</td><td class="line"> </td></tr>
1052<tr><td class="num" id="LN960">960</td><td class="line"> VnodeToInodeLocker _(vti);</td></tr>
1053<tr><td class="num" id="LN961">961</td><td class="line"> Inode* inode = vti-&gt;Get();</td></tr>
1054<tr><td class="num" id="LN962">962</td><td class="line"> <span class='keyword'>if</span> (inode == <span class='macro'>NULL<span class='expansion'>__null</span></span>)</td></tr>
1055<tr><td class="num" id="LN963">963</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_ENTRY_NOT_FOUND<span class='expansion'>(((-2147483647 - 1) + 0x6000) + 3)</span></span>;</td></tr>
1056<tr><td class="num" id="LN964">964</td><td class="line"> </td></tr>
1057<tr><td class="num" id="LN965">965</td><td class="line"> ino_t id;</td></tr>
1058<tr><td class="num" id="LN966">966</td><td class="line"> status_t result = inode-&gt;CreateDir(name, mode, &amp;id);</td></tr>
1059<tr><td class="num" id="LN967">967</td><td class="line"> <span class='keyword'>if</span> (result != <span class='macro'>B_OK<span class='expansion'>((int)0)</span></span>)</td></tr>
1060<tr><td class="num" id="LN968">968</td><td class="line"> <span class='keyword'>return</span> result;</td></tr>
1061<tr><td class="num" id="LN969">969</td><td class="line"> </td></tr>
1062<tr><td class="num" id="LN970">970</td><td class="line"> result = get_vnode(volume, id, <span class='keyword'>reinterpret_cast</span>&lt;<span class='keyword'>void</span>**&gt;(&amp;vti));</td></tr>
1063<tr><td class="num" id="LN971">971</td><td class="line"> <span class='keyword'>if</span> (result == <span class='macro'>B_OK<span class='expansion'>((int)0)</span></span>) {</td></tr>
1064<tr><td class="num" id="LN972">972</td><td class="line"> unremove_vnode(volume, id);</td></tr>
1065<tr><td class="num" id="LN973">973</td><td class="line"> vti-&gt;Clear();</td></tr>
1066<tr><td class="num" id="LN974">974</td><td class="line"> put_vnode(volume, id);</td></tr>
1067<tr><td class="num" id="LN975">975</td><td class="line"> }</td></tr>
1068<tr><td class="num" id="LN976">976</td><td class="line"> </td></tr>
1069<tr><td class="num" id="LN977">977</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_OK<span class='expansion'>((int)0)</span></span>;</td></tr>
1070<tr><td class="num" id="LN978">978</td><td class="line">}</td></tr>
1071<tr><td class="num" id="LN979">979</td><td class="line"> </td></tr>
1072<tr><td class="num" id="LN980">980</td><td class="line"> </td></tr>
1073<tr><td class="num" id="LN981">981</td><td class="line"><span class='keyword'>static</span> status_t</td></tr>
1074<tr><td class="num" id="LN982">982</td><td class="line">nfs4_remove_dir(fs_volume* volume, fs_vnode* parent, <span class='keyword'>const</span> <span class='keyword'>char</span>* name)</td></tr>
1075<tr><td class="num" id="LN983">983</td><td class="line">{</td></tr>
1076<tr><td class="num" id="LN984">984</td><td class="line"> VnodeToInode* vti = <span class='keyword'>reinterpret_cast</span>&lt;VnodeToInode*&gt;(parent-&gt;private_node);</td></tr>
1077<tr><td class="num" id="LN985">985</td><td class="line"> <span class='macro'>TRACE(<span class='string_literal'>"volume = %p, parent = %"</span> B_PRIi64 <span class='string_literal'>", name = %s"</span>, volume, vti-&gt;ID(),<span class='expansion'>(void)0</span></span></td></tr>
1078<tr><td class="num" id="LN986">986</td><td class="line"> <span class='macro'>name)<span class='expansion'>(void)0</span></span>;</td></tr>
1079<tr><td class="num" id="LN987">987</td><td class="line"> </td></tr>
1080<tr><td class="num" id="LN988">988</td><td class="line"> VnodeToInodeLocker _(vti);</td></tr>
1081<tr><td class="num" id="LN989">989</td><td class="line"> Inode* inode = vti-&gt;Get();</td></tr>
1082<tr><td class="num" id="LN990">990</td><td class="line"> <span class='keyword'>if</span> (inode == <span class='macro'>NULL<span class='expansion'>__null</span></span>)</td></tr>
1083<tr><td class="num" id="LN991">991</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_ENTRY_NOT_FOUND<span class='expansion'>(((-2147483647 - 1) + 0x6000) + 3)</span></span>;</td></tr>
1084<tr><td class="num" id="LN992">992</td><td class="line"> </td></tr>
1085<tr><td class="num" id="LN993">993</td><td class="line"> ino_t id;</td></tr>
1086<tr><td class="num" id="LN994">994</td><td class="line"> status_t result = inode-&gt;Remove(name, NF4DIR, &amp;id);</td></tr>
1087<tr><td class="num" id="LN995">995</td><td class="line"> <span class='keyword'>if</span> (result != <span class='macro'>B_OK<span class='expansion'>((int)0)</span></span>)</td></tr>
1088<tr><td class="num" id="LN996">996</td><td class="line"> <span class='keyword'>return</span> result;</td></tr>
1089<tr><td class="num" id="LN997">997</td><td class="line"> </td></tr>
1090<tr><td class="num" id="LN998">998</td><td class="line"> result = acquire_vnode(volume, id);</td></tr>
1091<tr><td class="num" id="LN999">999</td><td class="line"> <span class='keyword'>if</span> (result == <span class='macro'>B_OK<span class='expansion'>((int)0)</span></span>) {</td></tr>
1092<tr><td class="num" id="LN1000">1000</td><td class="line"> result = get_vnode(volume, id, <span class='keyword'>reinterpret_cast</span>&lt;<span class='keyword'>void</span>**&gt;(&amp;vti));</td></tr>
1093<tr><td class="num" id="LN1001">1001</td><td class="line"> <span class='macro'>ASSERT(result == B_OK)<span class='expansion'>do { if (!(result == ((int)0))) { panic("ASSERT FAILED (%s:%d): %s"<br>, "/home/haiku/haiku/haiku/src/add-ons/kernel/file_systems/nfs4/kernel_interface.cpp"<br>, 1001, "result == ((int)0)"); } } while (0)</span></span>;</td></tr>
1094<tr><td class="num" id="LN1002">1002</td><td class="line"> </td></tr>
1095<tr><td class="num" id="LN1003">1003</td><td class="line"> <span class='keyword'>if</span> (vti-&gt;Unlink(inode-&gt;fInfo.fNames, name))</td></tr>
1096<tr><td class="num" id="LN1004">1004</td><td class="line"> remove_vnode(volume, id);</td></tr>
1097<tr><td class="num" id="LN1005">1005</td><td class="line"> </td></tr>
1098<tr><td class="num" id="LN1006">1006</td><td class="line"> put_vnode(volume, id);</td></tr>
1099<tr><td class="num" id="LN1007">1007</td><td class="line"> put_vnode(volume, id);</td></tr>
1100<tr><td class="num" id="LN1008">1008</td><td class="line"> }</td></tr>
1101<tr><td class="num" id="LN1009">1009</td><td class="line"> </td></tr>
1102<tr><td class="num" id="LN1010">1010</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_OK<span class='expansion'>((int)0)</span></span>;</td></tr>
1103<tr><td class="num" id="LN1011">1011</td><td class="line">}</td></tr>
1104<tr><td class="num" id="LN1012">1012</td><td class="line"> </td></tr>
1105<tr><td class="num" id="LN1013">1013</td><td class="line"> </td></tr>
1106<tr><td class="num" id="LN1014">1014</td><td class="line"><span class='keyword'>static</span> status_t</td></tr>
1107<tr><td class="num" id="LN1015">1015</td><td class="line">nfs4_open_dir(fs_volume* volume, fs_vnode* vnode, <span class='keyword'>void</span>** _cookie)</td></tr>
1108<tr><td class="num" id="LN1016">1016</td><td class="line">{</td></tr>
1109<tr><td class="num" id="LN1017">1017</td><td class="line"> FileSystem* fs = <span class='keyword'>reinterpret_cast</span>&lt;FileSystem*&gt;(volume-&gt;private_volume);</td></tr>
1110<tr><td class="num" id="LN1018">1018</td><td class="line"> OpenDirCookie* cookie = <span class='keyword'>new</span>(std::nothrow) OpenDirCookie(fs);</td></tr>
1111<tr><td class="num" id="LN1019">1019</td><td class="line"> <span class='keyword'>if</span> (cookie == <span class='macro'>NULL<span class='expansion'>__null</span></span>)</td></tr>
1112<tr><td class="num" id="LN1020">1020</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_NO_MEMORY<span class='expansion'>((-2147483647 - 1) + 0)</span></span>;</td></tr>
1113<tr><td class="num" id="LN1021">1021</td><td class="line"> *_cookie = cookie;</td></tr>
1114<tr><td class="num" id="LN1022">1022</td><td class="line"> </td></tr>
1115<tr><td class="num" id="LN1023">1023</td><td class="line"> VnodeToInode* vti = <span class='keyword'>reinterpret_cast</span>&lt;VnodeToInode*&gt;(vnode-&gt;private_node);</td></tr>
1116<tr><td class="num" id="LN1024">1024</td><td class="line"> <span class='macro'>TRACE(<span class='string_literal'>"volume = %p, vnode = %"</span> B_PRIi64, volume, vti-&gt;ID())<span class='expansion'>(void)0</span></span>;</td></tr>
1117<tr><td class="num" id="LN1025">1025</td><td class="line"> </td></tr>
1118<tr><td class="num" id="LN1026">1026</td><td class="line"> VnodeToInodeLocker _(vti);</td></tr>
1119<tr><td class="num" id="LN1027">1027</td><td class="line"> Inode* inode = vti-&gt;Get();</td></tr>
1120<tr><td class="num" id="LN1028">1028</td><td class="line"> <span class='keyword'>if</span> (inode == <span class='macro'>NULL<span class='expansion'>__null</span></span>)</td></tr>
1121<tr><td class="num" id="LN1029">1029</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_ENTRY_NOT_FOUND<span class='expansion'>(((-2147483647 - 1) + 0x6000) + 3)</span></span>;</td></tr>
1122<tr><td class="num" id="LN1030">1030</td><td class="line"> </td></tr>
1123<tr><td class="num" id="LN1031">1031</td><td class="line"> status_t result = inode-&gt;OpenDir(cookie);</td></tr>
1124<tr><td class="num" id="LN1032">1032</td><td class="line"> <span class='keyword'>if</span> (result != <span class='macro'>B_OK<span class='expansion'>((int)0)</span></span>)</td></tr>
1125<tr><td class="num" id="LN1033">1033</td><td class="line"> <span class='keyword'>delete</span> cookie;</td></tr>
1126<tr><td class="num" id="LN1034">1034</td><td class="line"> </td></tr>
1127<tr><td class="num" id="LN1035">1035</td><td class="line"> <span class='macro'>TRACE(<span class='string_literal'>"*cookie = %p"</span>, *_cookie)<span class='expansion'>(void)0</span></span>;</td></tr>
1128<tr><td class="num" id="LN1036">1036</td><td class="line"> </td></tr>
1129<tr><td class="num" id="LN1037">1037</td><td class="line"> <span class='keyword'>return</span> result;</td></tr>
1130<tr><td class="num" id="LN1038">1038</td><td class="line">}</td></tr>
1131<tr><td class="num" id="LN1039">1039</td><td class="line"> </td></tr>
1132<tr><td class="num" id="LN1040">1040</td><td class="line"> </td></tr>
1133<tr><td class="num" id="LN1041">1041</td><td class="line"><span class='keyword'>static</span> status_t </td></tr>
1134<tr><td class="num" id="LN1042">1042</td><td class="line">nfs4_close_dir(fs_volume* volume, fs_vnode* vnode, <span class='keyword'>void</span>* _cookie)</td></tr>
1135<tr><td class="num" id="LN1043">1043</td><td class="line">{</td></tr>
1136<tr><td class="num" id="LN1044">1044</td><td class="line"> <span class='macro'>TRACE(<span class='string_literal'>"volume = %p, vnode = %"</span> B_PRIi64 <span class='string_literal'>", cookie = %p"</span>, volume,<span class='expansion'>(void)0</span></span></td></tr>
1137<tr><td class="num" id="LN1045">1045</td><td class="line"> <span class='keyword'><span class='macro'>reinterpret_cast</span>&lt;VnodeToInode*&gt;(vnode-&gt;private_node)-&gt;ID(), _cookie)<span class='expansion'>(void)0</span></span>;</td></tr>
1138<tr><td class="num" id="LN1046">1046</td><td class="line"> </td></tr>
1139<tr><td class="num" id="LN1047">1047</td><td class="line"> Cookie* cookie = <span class='keyword'>reinterpret_cast</span>&lt;Cookie*&gt;(_cookie);</td></tr>
1140<tr><td class="num" id="LN1048">1048</td><td class="line"> <span class='keyword'>return</span> cookie-&gt;CancelAll();</td></tr>
1141<tr><td class="num" id="LN1049">1049</td><td class="line">}</td></tr>
1142<tr><td class="num" id="LN1050">1050</td><td class="line"> </td></tr>
1143<tr><td class="num" id="LN1051">1051</td><td class="line"> </td></tr>
1144<tr><td class="num" id="LN1052">1052</td><td class="line"><span class='keyword'>static</span> status_t</td></tr>
1145<tr><td class="num" id="LN1053">1053</td><td class="line">nfs4_free_dir_cookie(fs_volume* volume, fs_vnode* vnode, <span class='keyword'>void</span>* cookie)</td></tr>
1146<tr><td class="num" id="LN1054">1054</td><td class="line">{</td></tr>
1147<tr><td class="num" id="LN1055">1055</td><td class="line"> <span class='macro'>TRACE(<span class='string_literal'>"volume = %p, vnode = %"</span> B_PRIi64 <span class='string_literal'>", cookie = %p"</span>, volume,<span class='expansion'>(void)0</span></span></td></tr>
1148<tr><td class="num" id="LN1056">1056</td><td class="line"> <span class='keyword'><span class='macro'>reinterpret_cast</span>&lt;VnodeToInode*&gt;(vnode-&gt;private_node)-&gt;ID(), cookie)<span class='expansion'>(void)0</span></span>;</td></tr>
1149<tr><td class="num" id="LN1057">1057</td><td class="line"> </td></tr>
1150<tr><td class="num" id="LN1058">1058</td><td class="line"> <span class='keyword'>delete</span> <span class='keyword'>reinterpret_cast</span>&lt;OpenDirCookie*&gt;(cookie);</td></tr>
1151<tr><td class="num" id="LN1059">1059</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_OK<span class='expansion'>((int)0)</span></span>;</td></tr>
1152<tr><td class="num" id="LN1060">1060</td><td class="line">}</td></tr>
1153<tr><td class="num" id="LN1061">1061</td><td class="line"> </td></tr>
1154<tr><td class="num" id="LN1062">1062</td><td class="line"> </td></tr>
1155<tr><td class="num" id="LN1063">1063</td><td class="line"><span class='keyword'>static</span> status_t</td></tr>
1156<tr><td class="num" id="LN1064">1064</td><td class="line">nfs4_read_dir(fs_volume* volume, fs_vnode* vnode, <span class='keyword'>void</span>* _cookie,</td></tr>
1157<tr><td class="num" id="LN1065">1065</td><td class="line"> <span class='keyword'>struct</span> dirent* buffer, size_t bufferSize, uint32* _num)</td></tr>
1158<tr><td class="num" id="LN1066">1066</td><td class="line">{</td></tr>
1159<tr><td class="num" id="LN1067">1067</td><td class="line"> OpenDirCookie* cookie = <span class='keyword'>reinterpret_cast</span>&lt;OpenDirCookie*&gt;(_cookie);</td></tr>
1160<tr><td class="num" id="LN1068">1068</td><td class="line"> VnodeToInode* vti = <span class='keyword'>reinterpret_cast</span>&lt;VnodeToInode*&gt;(vnode-&gt;private_node);</td></tr>
1161<tr><td class="num" id="LN1069">1069</td><td class="line"> <span class='macro'>TRACE(<span class='string_literal'>"volume = %p, vnode = %"</span> B_PRIi64 <span class='string_literal'>", cookie = %p"</span>, volume, vti-&gt;ID(),<span class='expansion'>(void)0</span></span></td></tr>
1162<tr><td class="num" id="LN1070">1070</td><td class="line"> <span class='macro'>_cookie)<span class='expansion'>(void)0</span></span>;</td></tr>
1163<tr><td class="num" id="LN1071">1071</td><td class="line"> </td></tr>
1164<tr><td class="num" id="LN1072">1072</td><td class="line"> VnodeToInodeLocker _(vti);</td></tr>
1165<tr><td class="num" id="LN1073">1073</td><td class="line"> Inode* inode = vti-&gt;Get();</td></tr>
1166<tr><td class="num" id="LN1074">1074</td><td class="line"> <span class='keyword'>if</span> (inode == <span class='macro'>NULL<span class='expansion'>__null</span></span>)</td></tr>
1167<tr><td class="num" id="LN1075">1075</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_ENTRY_NOT_FOUND<span class='expansion'>(((-2147483647 - 1) + 0x6000) + 3)</span></span>;</td></tr>
1168<tr><td class="num" id="LN1076">1076</td><td class="line"> </td></tr>
1169<tr><td class="num" id="LN1077">1077</td><td class="line"> <span class='keyword'>return</span> inode-&gt;ReadDir(buffer, bufferSize, _num, cookie);</td></tr>
1170<tr><td class="num" id="LN1078">1078</td><td class="line">}</td></tr>
1171<tr><td class="num" id="LN1079">1079</td><td class="line"> </td></tr>
1172<tr><td class="num" id="LN1080">1080</td><td class="line"> </td></tr>
1173<tr><td class="num" id="LN1081">1081</td><td class="line"><span class='keyword'>static</span> status_t</td></tr>
1174<tr><td class="num" id="LN1082">1082</td><td class="line">nfs4_rewind_dir(fs_volume* volume, fs_vnode* vnode, <span class='keyword'>void</span>* _cookie)</td></tr>
1175<tr><td class="num" id="LN1083">1083</td><td class="line">{</td></tr>
1176<tr><td class="num" id="LN1084">1084</td><td class="line"> <span class='macro'>TRACE(<span class='string_literal'>"volume = %p, vnode = %"</span> B_PRIi64 <span class='string_literal'>", cookie = %p"</span>, volume,<span class='expansion'>(void)0</span></span></td></tr>
1177<tr><td class="num" id="LN1085">1085</td><td class="line"> <span class='keyword'><span class='macro'>reinterpret_cast</span>&lt;VnodeToInode*&gt;(vnode-&gt;private_node)-&gt;ID(), _cookie)<span class='expansion'>(void)0</span></span>;</td></tr>
1178<tr><td class="num" id="LN1086">1086</td><td class="line"> </td></tr>
1179<tr><td class="num" id="LN1087">1087</td><td class="line"> OpenDirCookie* cookie = <span class='keyword'>reinterpret_cast</span>&lt;OpenDirCookie*&gt;(_cookie);</td></tr>
1180<tr><td class="num" id="LN1088">1088</td><td class="line"> cookie-&gt;fSpecial = 0;</td></tr>
1181<tr><td class="num" id="LN1089">1089</td><td class="line"> <span class='keyword'>if</span> (cookie-&gt;fSnapshot != <span class='macro'>NULL<span class='expansion'>__null</span></span>)</td></tr>
1182<tr><td class="num" id="LN1090">1090</td><td class="line"> cookie-&gt;fSnapshot-&gt;ReleaseReference();</td></tr>
1183<tr><td class="num" id="LN1091">1091</td><td class="line"> cookie-&gt;fSnapshot = <span class='macro'>NULL<span class='expansion'>__null</span></span>;</td></tr>
1184<tr><td class="num" id="LN1092">1092</td><td class="line"> cookie-&gt;fCurrent = <span class='macro'>NULL<span class='expansion'>__null</span></span>;</td></tr>
1185<tr><td class="num" id="LN1093">1093</td><td class="line"> cookie-&gt;fEOF = <span class='keyword'>false</span>;</td></tr>
1186<tr><td class="num" id="LN1094">1094</td><td class="line"> </td></tr>
1187<tr><td class="num" id="LN1095">1095</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_OK<span class='expansion'>((int)0)</span></span>;</td></tr>
1188<tr><td class="num" id="LN1096">1096</td><td class="line">}</td></tr>
1189<tr><td class="num" id="LN1097">1097</td><td class="line"> </td></tr>
1190<tr><td class="num" id="LN1098">1098</td><td class="line"> </td></tr>
1191<tr><td class="num" id="LN1099">1099</td><td class="line"><span class='keyword'>static</span> status_t</td></tr>
1192<tr><td class="num" id="LN1100">1100</td><td class="line">nfs4_open_attr_dir(fs_volume* volume, fs_vnode* vnode, <span class='keyword'>void</span>** _cookie)</td></tr>
1193<tr><td class="num" id="LN1101">1101</td><td class="line">{</td></tr>
1194<tr><td class="num" id="LN1102">1102</td><td class="line"> FileSystem* fs = <span class='keyword'>reinterpret_cast</span>&lt;FileSystem*&gt;(volume-&gt;private_volume);</td></tr>
1195<tr><td class="num" id="LN1103">1103</td><td class="line"> OpenDirCookie* cookie = <span class='keyword'>new</span>(std::nothrow) OpenDirCookie(fs);</td></tr>
1196<tr><td class="num" id="LN1104">1104</td><td class="line"> <span class='keyword'>if</span> (cookie == <span class='macro'>NULL<span class='expansion'>__null</span></span>)</td></tr>
1197<tr><td class="num" id="LN1105">1105</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_NO_MEMORY<span class='expansion'>((-2147483647 - 1) + 0)</span></span>;</td></tr>
1198<tr><td class="num" id="LN1106">1106</td><td class="line"> *_cookie = cookie;</td></tr>
1199<tr><td class="num" id="LN1107">1107</td><td class="line"> </td></tr>
1200<tr><td class="num" id="LN1108">1108</td><td class="line"> VnodeToInode* vti = <span class='keyword'>reinterpret_cast</span>&lt;VnodeToInode*&gt;(vnode-&gt;private_node);</td></tr>
1201<tr><td class="num" id="LN1109">1109</td><td class="line"> <span class='macro'>TRACE(<span class='string_literal'>"volume = %p, vnode = %"</span> B_PRIi64, volume, vti-&gt;ID())<span class='expansion'>(void)0</span></span>;</td></tr>
1202<tr><td class="num" id="LN1110">1110</td><td class="line"> </td></tr>
1203<tr><td class="num" id="LN1111">1111</td><td class="line"> VnodeToInodeLocker _(vti);</td></tr>
1204<tr><td class="num" id="LN1112">1112</td><td class="line"> Inode* inode = vti-&gt;Get();</td></tr>
1205<tr><td class="num" id="LN1113">1113</td><td class="line"> <span class='keyword'>if</span> (inode == <span class='macro'>NULL<span class='expansion'>__null</span></span>)</td></tr>
1206<tr><td class="num" id="LN1114">1114</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_ENTRY_NOT_FOUND<span class='expansion'>(((-2147483647 - 1) + 0x6000) + 3)</span></span>;</td></tr>
1207<tr><td class="num" id="LN1115">1115</td><td class="line"> </td></tr>
1208<tr><td class="num" id="LN1116">1116</td><td class="line"> status_t result = inode-&gt;OpenAttrDir(cookie);</td></tr>
1209<tr><td class="num" id="LN1117">1117</td><td class="line"> <span class='keyword'>if</span> (result != <span class='macro'>B_OK<span class='expansion'>((int)0)</span></span>)</td></tr>
1210<tr><td class="num" id="LN1118">1118</td><td class="line"> <span class='keyword'>delete</span> cookie;</td></tr>
1211<tr><td class="num" id="LN1119">1119</td><td class="line"> </td></tr>
1212<tr><td class="num" id="LN1120">1120</td><td class="line"> <span class='keyword'>return</span> result;</td></tr>
1213<tr><td class="num" id="LN1121">1121</td><td class="line">}</td></tr>
1214<tr><td class="num" id="LN1122">1122</td><td class="line"> </td></tr>
1215<tr><td class="num" id="LN1123">1123</td><td class="line"> </td></tr>
1216<tr><td class="num" id="LN1124">1124</td><td class="line"><span class='keyword'>static</span> status_t</td></tr>
1217<tr><td class="num" id="LN1125">1125</td><td class="line">nfs4_close_attr_dir(fs_volume* volume, fs_vnode* vnode, <span class='keyword'>void</span>* cookie)</td></tr>
1218<tr><td class="num" id="LN1126">1126</td><td class="line">{</td></tr>
1219<tr><td class="num" id="LN1127">1127</td><td class="line"> <span class='keyword'>return</span> nfs4_close_dir(volume, vnode, cookie);</td></tr>
1220<tr><td class="num" id="LN1128">1128</td><td class="line">}</td></tr>
1221<tr><td class="num" id="LN1129">1129</td><td class="line"> </td></tr>
1222<tr><td class="num" id="LN1130">1130</td><td class="line"> </td></tr>
1223<tr><td class="num" id="LN1131">1131</td><td class="line"><span class='keyword'>static</span> status_t</td></tr>
1224<tr><td class="num" id="LN1132">1132</td><td class="line">nfs4_free_attr_dir_cookie(fs_volume* volume, fs_vnode* vnode, <span class='keyword'>void</span>* cookie)</td></tr>
1225<tr><td class="num" id="LN1133">1133</td><td class="line">{</td></tr>
1226<tr><td class="num" id="LN1134">1134</td><td class="line"> <span class='keyword'>return</span> nfs4_free_dir_cookie(volume, vnode, cookie);</td></tr>
1227<tr><td class="num" id="LN1135">1135</td><td class="line">}</td></tr>
1228<tr><td class="num" id="LN1136">1136</td><td class="line"> </td></tr>
1229<tr><td class="num" id="LN1137">1137</td><td class="line"> </td></tr>
1230<tr><td class="num" id="LN1138">1138</td><td class="line"><span class='keyword'>static</span> status_t</td></tr>
1231<tr><td class="num" id="LN1139">1139</td><td class="line">nfs4_read_attr_dir(fs_volume* volume, fs_vnode* vnode, <span class='keyword'>void</span>* cookie,</td></tr>
1232<tr><td class="num" id="LN1140">1140</td><td class="line"> <span class='keyword'>struct</span> dirent* buffer, size_t bufferSize, uint32* _num)</td></tr>
1233<tr><td class="num" id="LN1141">1141</td><td class="line">{</td></tr>
1234<tr><td class="num" id="LN1142">1142</td><td class="line"> <span class='keyword'>return</span> nfs4_read_dir(volume, vnode, cookie, buffer, bufferSize, _num);</td></tr>
1235<tr><td class="num" id="LN1143">1143</td><td class="line">}</td></tr>
1236<tr><td class="num" id="LN1144">1144</td><td class="line"> </td></tr>
1237<tr><td class="num" id="LN1145">1145</td><td class="line"> </td></tr>
1238<tr><td class="num" id="LN1146">1146</td><td class="line"><span class='keyword'>static</span> status_t</td></tr>
1239<tr><td class="num" id="LN1147">1147</td><td class="line">nfs4_rewind_attr_dir(fs_volume* volume, fs_vnode* vnode, <span class='keyword'>void</span>* cookie)</td></tr>
1240<tr><td class="num" id="LN1148">1148</td><td class="line">{</td></tr>
1241<tr><td class="num" id="LN1149">1149</td><td class="line"> <span class='keyword'>return</span> nfs4_rewind_dir(volume, vnode, cookie);</td></tr>
1242<tr><td class="num" id="LN1150">1150</td><td class="line">}</td></tr>
1243<tr><td class="num" id="LN1151">1151</td><td class="line"> </td></tr>
1244<tr><td class="num" id="LN1152">1152</td><td class="line"> </td></tr>
1245<tr><td class="num" id="LN1153">1153</td><td class="line"><span class='keyword'>static</span> status_t</td></tr>
1246<tr><td class="num" id="LN1154">1154</td><td class="line">nfs4_create_attr(fs_volume* volume, fs_vnode* vnode, <span class='keyword'>const</span> <span class='keyword'>char</span>* name,</td></tr>
1247<tr><td class="num" id="LN1155">1155</td><td class="line"> uint32 type, <span class='keyword'>int</span> openMode, <span class='keyword'>void</span>** _cookie)</td></tr>
1248<tr><td class="num" id="LN1156">1156</td><td class="line">{</td></tr>
1249<tr><td class="num" id="LN1157">1157</td><td class="line"> VnodeToInode* vti = <span class='keyword'>reinterpret_cast</span>&lt;VnodeToInode*&gt;(vnode-&gt;private_node);</td></tr>
1250<tr><td class="num" id="LN1158">1158</td><td class="line"> </td></tr>
1251<tr><td class="num" id="LN1159">1159</td><td class="line"> VnodeToInodeLocker _(vti);</td></tr>
1252<tr><td class="num" id="LN1160">1160</td><td class="line"> Inode* inode = vti-&gt;Get();</td></tr>
1253<tr><td class="num" id="LN1161">1161</td><td class="line"> <span class='keyword'>if</span> (inode == <span class='macro'>NULL<span class='expansion'>__null</span></span>)</td></tr>
1254<tr><td class="num" id="LN1162">1162</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_ENTRY_NOT_FOUND<span class='expansion'>(((-2147483647 - 1) + 0x6000) + 3)</span></span>;</td></tr>
1255<tr><td class="num" id="LN1163">1163</td><td class="line"> </td></tr>
1256<tr><td class="num" id="LN1164">1164</td><td class="line"> FileSystem* fs = <span class='keyword'>reinterpret_cast</span>&lt;FileSystem*&gt;(volume-&gt;private_volume);</td></tr>
1257<tr><td class="num" id="LN1165">1165</td><td class="line"> OpenAttrCookie* cookie = <span class='keyword'>new</span> OpenAttrCookie(fs);</td></tr>
1258<tr><td class="num" id="LN1166">1166</td><td class="line"> <span class='keyword'>if</span> (cookie == <span class='macro'>NULL<span class='expansion'>__null</span></span>)</td></tr>
1259<tr><td class="num" id="LN1167">1167</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_NO_MEMORY<span class='expansion'>((-2147483647 - 1) + 0)</span></span>;</td></tr>
1260<tr><td class="num" id="LN1168">1168</td><td class="line"> *_cookie = cookie;</td></tr>
1261<tr><td class="num" id="LN1169">1169</td><td class="line"> </td></tr>
1262<tr><td class="num" id="LN1170">1170</td><td class="line"> status_t result = inode-&gt;OpenAttr(name, openMode, cookie, <span class='keyword'>true</span>, type);</td></tr>
1263<tr><td class="num" id="LN1171">1171</td><td class="line"> <span class='keyword'>if</span> (result != <span class='macro'>B_OK<span class='expansion'>((int)0)</span></span>)</td></tr>
1264<tr><td class="num" id="LN1172">1172</td><td class="line"> <span class='keyword'>delete</span> cookie;</td></tr>
1265<tr><td class="num" id="LN1173">1173</td><td class="line"> </td></tr>
1266<tr><td class="num" id="LN1174">1174</td><td class="line"> <span class='keyword'>return</span> result;</td></tr>
1267<tr><td class="num" id="LN1175">1175</td><td class="line">}</td></tr>
1268<tr><td class="num" id="LN1176">1176</td><td class="line"> </td></tr>
1269<tr><td class="num" id="LN1177">1177</td><td class="line"> </td></tr>
1270<tr><td class="num" id="LN1178">1178</td><td class="line"><span class='keyword'>static</span> status_t</td></tr>
1271<tr><td class="num" id="LN1179">1179</td><td class="line">nfs4_open_attr(fs_volume* volume, fs_vnode* vnode, <span class='keyword'>const</span> <span class='keyword'>char</span>* name,</td></tr>
1272<tr><td class="num" id="LN1180">1180</td><td class="line"> <span class='keyword'>int</span> openMode, <span class='keyword'>void</span>** _cookie)</td></tr>
1273<tr><td class="num" id="LN1181">1181</td><td class="line">{</td></tr>
1274<tr><td class="num" id="LN1182">1182</td><td class="line"> VnodeToInode* vti = <span class='keyword'>reinterpret_cast</span>&lt;VnodeToInode*&gt;(vnode-&gt;private_node);</td></tr>
1275<tr><td class="num" id="LN1183">1183</td><td class="line"> </td></tr>
1276<tr><td class="num" id="LN1184">1184</td><td class="line"> VnodeToInodeLocker _(vti);</td></tr>
1277<tr><td class="num" id="LN1185">1185</td><td class="line"> Inode* inode = vti-&gt;Get();</td></tr>
1278<tr><td class="num" id="LN1186">1186</td><td class="line"> <span class='keyword'>if</span> (inode == <span class='macro'>NULL<span class='expansion'>__null</span></span>)</td></tr>
1279<tr><td class="num" id="LN1187">1187</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_ENTRY_NOT_FOUND<span class='expansion'>(((-2147483647 - 1) + 0x6000) + 3)</span></span>;</td></tr>
1280<tr><td class="num" id="LN1188">1188</td><td class="line"> </td></tr>
1281<tr><td class="num" id="LN1189">1189</td><td class="line"> FileSystem* fs = <span class='keyword'>reinterpret_cast</span>&lt;FileSystem*&gt;(volume-&gt;private_volume);</td></tr>
1282<tr><td class="num" id="LN1190">1190</td><td class="line"> OpenAttrCookie* cookie = <span class='keyword'>new</span> OpenAttrCookie(fs);</td></tr>
1283<tr><td class="num" id="LN1191">1191</td><td class="line"> <span class='keyword'>if</span> (cookie == <span class='macro'>NULL<span class='expansion'>__null</span></span>)</td></tr>
1284<tr><td class="num" id="LN1192">1192</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_NO_MEMORY<span class='expansion'>((-2147483647 - 1) + 0)</span></span>;</td></tr>
1285<tr><td class="num" id="LN1193">1193</td><td class="line"> *_cookie = cookie;</td></tr>
1286<tr><td class="num" id="LN1194">1194</td><td class="line"> </td></tr>
1287<tr><td class="num" id="LN1195">1195</td><td class="line"> status_t result = inode-&gt;OpenAttr(name, openMode, cookie, <span class='keyword'>false</span>);</td></tr>
1288<tr><td class="num" id="LN1196">1196</td><td class="line"> <span class='keyword'>if</span> (result != <span class='macro'>B_OK<span class='expansion'>((int)0)</span></span>)</td></tr>
1289<tr><td class="num" id="LN1197">1197</td><td class="line"> <span class='keyword'>delete</span> cookie;</td></tr>
1290<tr><td class="num" id="LN1198">1198</td><td class="line"> </td></tr>
1291<tr><td class="num" id="LN1199">1199</td><td class="line"> <span class='keyword'>return</span> result;</td></tr>
1292<tr><td class="num" id="LN1200">1200</td><td class="line">}</td></tr>
1293<tr><td class="num" id="LN1201">1201</td><td class="line"> </td></tr>
1294<tr><td class="num" id="LN1202">1202</td><td class="line"> </td></tr>
1295<tr><td class="num" id="LN1203">1203</td><td class="line"><span class='keyword'>static</span> status_t</td></tr>
1296<tr><td class="num" id="LN1204">1204</td><td class="line">nfs4_close_attr(fs_volume* volume, fs_vnode* vnode, <span class='keyword'>void</span>* _cookie)</td></tr>
1297<tr><td class="num" id="LN1205">1205</td><td class="line">{</td></tr>
1298<tr><td class="num" id="LN1206">1206</td><td class="line"> Cookie* cookie = <span class='keyword'>reinterpret_cast</span>&lt;Cookie*&gt;(_cookie);</td></tr>
1299<tr><td class="num" id="LN1207">1207</td><td class="line"> <span class='keyword'>return</span> cookie-&gt;CancelAll();</td></tr>
1300<tr><td class="num" id="LN1208">1208</td><td class="line">}</td></tr>
1301<tr><td class="num" id="LN1209">1209</td><td class="line"> </td></tr>
1302<tr><td class="num" id="LN1210">1210</td><td class="line"> </td></tr>
1303<tr><td class="num" id="LN1211">1211</td><td class="line"><span class='keyword'>static</span> status_t</td></tr>
1304<tr><td class="num" id="LN1212">1212</td><td class="line">nfs4_free_attr_cookie(fs_volume* volume, fs_vnode* vnode, <span class='keyword'>void</span>* _cookie)</td></tr>
1305<tr><td class="num" id="LN1213">1213</td><td class="line">{</td></tr>
1306<tr><td class="num" id="LN1214">1214</td><td class="line"> VnodeToInode* vti = <span class='keyword'>reinterpret_cast</span>&lt;VnodeToInode*&gt;(vnode-&gt;private_node);</td></tr>
1307<tr><td class="num" id="LN1215">1215</td><td class="line"> </td></tr>
1308<tr><td class="num" id="LN1216">1216</td><td class="line"> VnodeToInodeLocker _(vti);</td></tr>
1309<tr><td class="num" id="LN1217">1217</td><td class="line"> Inode* inode = vti-&gt;Get();</td></tr>
1310<tr><td class="num" id="LN1218">1218</td><td class="line"> <span class='keyword'>if</span> (inode == <span class='macro'>NULL<span class='expansion'>__null</span></span>)</td></tr>
1311<tr><td class="num" id="LN1219">1219</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_ENTRY_NOT_FOUND<span class='expansion'>(((-2147483647 - 1) + 0x6000) + 3)</span></span>;</td></tr>
1312<tr><td class="num" id="LN1220">1220</td><td class="line"> </td></tr>
1313<tr><td class="num" id="LN1221">1221</td><td class="line"> OpenAttrCookie* cookie = <span class='keyword'>reinterpret_cast</span>&lt;OpenAttrCookie*&gt;(_cookie);</td></tr>
1314<tr><td class="num" id="LN1222">1222</td><td class="line"> inode-&gt;CloseAttr(cookie);</td></tr>
1315<tr><td class="num" id="LN1223">1223</td><td class="line"> <span class='keyword'>delete</span> cookie;</td></tr>
1316<tr><td class="num" id="LN1224">1224</td><td class="line"> </td></tr>
1317<tr><td class="num" id="LN1225">1225</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_OK<span class='expansion'>((int)0)</span></span>;</td></tr>
1318<tr><td class="num" id="LN1226">1226</td><td class="line">}</td></tr>
1319<tr><td class="num" id="LN1227">1227</td><td class="line"> </td></tr>
1320<tr><td class="num" id="LN1228">1228</td><td class="line"> </td></tr>
1321<tr><td class="num" id="LN1229">1229</td><td class="line"><span class='keyword'>static</span> status_t</td></tr>
1322<tr><td class="num" id="LN1230">1230</td><td class="line">nfs4_read_attr(fs_volume* volume, fs_vnode* vnode, <span class='keyword'>void</span>* _cookie, off_t pos,</td></tr>
1323<tr><td class="num" id="LN1231">1231</td><td class="line"> <span class='keyword'>void</span>* buffer, size_t* length)</td></tr>
1324<tr><td class="num" id="LN1232">1232</td><td class="line">{</td></tr>
1325<tr><td class="num" id="LN1233">1233</td><td class="line"> VnodeToInode* vti = <span class='keyword'>reinterpret_cast</span>&lt;VnodeToInode*&gt;(vnode-&gt;private_node);</td></tr>
1326<tr><td class="num" id="LN1234">1234</td><td class="line"> OpenAttrCookie* cookie = <span class='keyword'>reinterpret_cast</span>&lt;OpenAttrCookie*&gt;(_cookie);</td></tr>
1327<tr><td class="num" id="LN1235">1235</td><td class="line"> <span class='keyword'>bool</span> eof;</td></tr>
1328<tr><td class="num" id="LN1236">1236</td><td class="line"> </td></tr>
1329<tr><td class="num" id="LN1237">1237</td><td class="line"> VnodeToInodeLocker _(vti);</td></tr>
1330<tr><td class="num" id="LN1238">1238</td><td class="line"> Inode* inode = vti-&gt;Get();</td></tr>
1331<tr><td class="num" id="LN1239">1239</td><td class="line"> <span class='keyword'>if</span> (inode == <span class='macro'>NULL<span class='expansion'>__null</span></span>)</td></tr>
1332<tr><td class="num" id="LN1240">1240</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_ENTRY_NOT_FOUND<span class='expansion'>(((-2147483647 - 1) + 0x6000) + 3)</span></span>;</td></tr>
1333<tr><td class="num" id="LN1241">1241</td><td class="line"> </td></tr>
1334<tr><td class="num" id="LN1242">1242</td><td class="line"> <span class='keyword'>return</span> inode-&gt;ReadDirect(cookie, pos, buffer, length, &amp;eof);</td></tr>
1335<tr><td class="num" id="LN1243">1243</td><td class="line">}</td></tr>
1336<tr><td class="num" id="LN1244">1244</td><td class="line"> </td></tr>
1337<tr><td class="num" id="LN1245">1245</td><td class="line"> </td></tr>
1338<tr><td class="num" id="LN1246">1246</td><td class="line"><span class='keyword'>static</span> status_t</td></tr>
1339<tr><td class="num" id="LN1247">1247</td><td class="line">nfs4_write_attr(fs_volume* volume, fs_vnode* vnode, <span class='keyword'>void</span>* _cookie, off_t pos,</td></tr>
1340<tr><td class="num" id="LN1248">1248</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>void</span>* buffer, size_t* length)</td></tr>
1341<tr><td class="num" id="LN1249">1249</td><td class="line">{</td></tr>
1342<tr><td class="num" id="LN1250">1250</td><td class="line"> VnodeToInode* vti = <span class='keyword'>reinterpret_cast</span>&lt;VnodeToInode*&gt;(vnode-&gt;private_node);</td></tr>
1343<tr><td class="num" id="LN1251">1251</td><td class="line"> OpenAttrCookie* cookie = <span class='keyword'>reinterpret_cast</span>&lt;OpenAttrCookie*&gt;(_cookie);</td></tr>
1344<tr><td class="num" id="LN1252">1252</td><td class="line"> </td></tr>
1345<tr><td class="num" id="LN1253">1253</td><td class="line"> VnodeToInodeLocker _(vti);</td></tr>
1346<tr><td class="num" id="LN1254">1254</td><td class="line"> Inode* inode = vti-&gt;Get();</td></tr>
1347<tr><td class="num" id="LN1255">1255</td><td class="line"> <span class='keyword'>if</span> (inode == <span class='macro'>NULL<span class='expansion'>__null</span></span>)</td></tr>
1348<tr><td class="num" id="LN1256">1256</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_ENTRY_NOT_FOUND<span class='expansion'>(((-2147483647 - 1) + 0x6000) + 3)</span></span>;</td></tr>
1349<tr><td class="num" id="LN1257">1257</td><td class="line"> </td></tr>
1350<tr><td class="num" id="LN1258">1258</td><td class="line"> <span class='keyword'>return</span> inode-&gt;WriteDirect(cookie, pos, buffer, length);</td></tr>
1351<tr><td class="num" id="LN1259">1259</td><td class="line">}</td></tr>
1352<tr><td class="num" id="LN1260">1260</td><td class="line"> </td></tr>
1353<tr><td class="num" id="LN1261">1261</td><td class="line"> </td></tr>
1354<tr><td class="num" id="LN1262">1262</td><td class="line"><span class='keyword'>static</span> status_t</td></tr>
1355<tr><td class="num" id="LN1263">1263</td><td class="line">nfs4_read_attr_stat(fs_volume* volume, fs_vnode* vnode, <span class='keyword'>void</span>* _cookie,</td></tr>
1356<tr><td class="num" id="LN1264">1264</td><td class="line"> <span class='keyword'>struct</span> stat* stat)</td></tr>
1357<tr><td class="num" id="LN1265">1265</td><td class="line">{</td></tr>
1358<tr><td class="num" id="LN1266">1266</td><td class="line"> VnodeToInode* vti = <span class='keyword'>reinterpret_cast</span>&lt;VnodeToInode*&gt;(vnode-&gt;private_node);</td></tr>
1359<tr><td class="num" id="LN1267">1267</td><td class="line"> OpenAttrCookie* cookie = <span class='keyword'>reinterpret_cast</span>&lt;OpenAttrCookie*&gt;(_cookie);</td></tr>
1360<tr><td class="num" id="LN1268">1268</td><td class="line"> </td></tr>
1361<tr><td class="num" id="LN1269">1269</td><td class="line"> VnodeToInodeLocker _(vti);</td></tr>
1362<tr><td class="num" id="LN1270">1270</td><td class="line"> Inode* inode = vti-&gt;Get();</td></tr>
1363<tr><td class="num" id="LN1271">1271</td><td class="line"> <span class='keyword'>if</span> (inode == <span class='macro'>NULL<span class='expansion'>__null</span></span>)</td></tr>
1364<tr><td class="num" id="LN1272">1272</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_ENTRY_NOT_FOUND<span class='expansion'>(((-2147483647 - 1) + 0x6000) + 3)</span></span>;</td></tr>
1365<tr><td class="num" id="LN1273">1273</td><td class="line"> </td></tr>
1366<tr><td class="num" id="LN1274">1274</td><td class="line"> <span class='keyword'>return</span> inode-&gt;Stat(stat, cookie);</td></tr>
1367<tr><td class="num" id="LN1275">1275</td><td class="line">}</td></tr>
1368<tr><td class="num" id="LN1276">1276</td><td class="line"> </td></tr>
1369<tr><td class="num" id="LN1277">1277</td><td class="line"> </td></tr>
1370<tr><td class="num" id="LN1278">1278</td><td class="line"><span class='keyword'>static</span> status_t</td></tr>
1371<tr><td class="num" id="LN1279">1279</td><td class="line">nfs4_write_attr_stat(fs_volume* volume, fs_vnode* vnode, <span class='keyword'>void</span>* _cookie,</td></tr>
1372<tr><td class="num" id="LN1280">1280</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>struct</span> stat* stat, <span class='keyword'>int</span> statMask)</td></tr>
1373<tr><td class="num" id="LN1281">1281</td><td class="line">{</td></tr>
1374<tr><td class="num" id="LN1282">1282</td><td class="line"> VnodeToInode* vti = <span class='keyword'>reinterpret_cast</span>&lt;VnodeToInode*&gt;(vnode-&gt;private_node);</td></tr>
1375<tr><td class="num" id="LN1283">1283</td><td class="line"> OpenAttrCookie* cookie = <span class='keyword'>reinterpret_cast</span>&lt;OpenAttrCookie*&gt;(_cookie);</td></tr>
1376<tr><td class="num" id="LN1284">1284</td><td class="line"> </td></tr>
1377<tr><td class="num" id="LN1285">1285</td><td class="line"> VnodeToInodeLocker _(vti);</td></tr>
1378<tr><td class="num" id="LN1286">1286</td><td class="line"> Inode* inode = vti-&gt;Get();</td></tr>
1379<tr><td class="num" id="LN1287">1287</td><td class="line"> <span class='keyword'>if</span> (inode == <span class='macro'>NULL<span class='expansion'>__null</span></span>)</td></tr>
1380<tr><td class="num" id="LN1288">1288</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_ENTRY_NOT_FOUND<span class='expansion'>(((-2147483647 - 1) + 0x6000) + 3)</span></span>;</td></tr>
1381<tr><td class="num" id="LN1289">1289</td><td class="line"> </td></tr>
1382<tr><td class="num" id="LN1290">1290</td><td class="line"> <span class='keyword'>return</span> inode-&gt;WriteStat(stat, statMask, cookie);</td></tr>
1383<tr><td class="num" id="LN1291">1291</td><td class="line">}</td></tr>
1384<tr><td class="num" id="LN1292">1292</td><td class="line"> </td></tr>
1385<tr><td class="num" id="LN1293">1293</td><td class="line"> </td></tr>
1386<tr><td class="num" id="LN1294">1294</td><td class="line"><span class='keyword'>static</span> status_t</td></tr>
1387<tr><td class="num" id="LN1295">1295</td><td class="line">nfs4_rename_attr(fs_volume* volume, fs_vnode* fromVnode, <span class='keyword'>const</span> <span class='keyword'>char</span>* fromName,</td></tr>
1388<tr><td class="num" id="LN1296">1296</td><td class="line"> fs_vnode* toVnode, <span class='keyword'>const</span> <span class='keyword'>char</span>* toName)</td></tr>
1389<tr><td class="num" id="LN1297">1297</td><td class="line">{</td></tr>
1390<tr><td class="num" id="LN1298">1298</td><td class="line"> VnodeToInode* vti = <span class='keyword'>reinterpret_cast</span>&lt;VnodeToInode*&gt;(toVnode-&gt;private_node);</td></tr>
1391<tr><td class="num" id="LN1299">1299</td><td class="line"> VnodeToInodeLocker to(vti);</td></tr>
1392<tr><td class="num" id="LN1300">1300</td><td class="line"> Inode* toInode = vti-&gt;Get();</td></tr>
1393<tr><td class="num" id="LN1301">1301</td><td class="line"> <span class='keyword'>if</span> (toInode == <span class='macro'>NULL<span class='expansion'>__null</span></span>)</td></tr>
1394<tr><td class="num" id="LN1302">1302</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_ENTRY_NOT_FOUND<span class='expansion'>(((-2147483647 - 1) + 0x6000) + 3)</span></span>;</td></tr>
1395<tr><td class="num" id="LN1303">1303</td><td class="line"> </td></tr>
1396<tr><td class="num" id="LN1304">1304</td><td class="line"> vti = <span class='keyword'>reinterpret_cast</span>&lt;VnodeToInode*&gt;(fromVnode-&gt;private_node);</td></tr>
1397<tr><td class="num" id="LN1305">1305</td><td class="line"> VnodeToInodeLocker from(vti);</td></tr>
1398<tr><td class="num" id="LN1306">1306</td><td class="line"> Inode* fromInode = vti-&gt;Get();</td></tr>
1399<tr><td class="num" id="LN1307">1307</td><td class="line"> <span class='keyword'>if</span> (fromInode == <span class='macro'>NULL<span class='expansion'>__null</span></span>)</td></tr>
1400<tr><td class="num" id="LN1308">1308</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_ENTRY_NOT_FOUND<span class='expansion'>(((-2147483647 - 1) + 0x6000) + 3)</span></span>;</td></tr>
1401<tr><td class="num" id="LN1309">1309</td><td class="line"> </td></tr>
1402<tr><td class="num" id="LN1310">1310</td><td class="line"> <span class='keyword'>return</span> Inode::Rename(fromInode, toInode, fromName, toName, <span class='keyword'>true</span>);</td></tr>
1403<tr><td class="num" id="LN1311">1311</td><td class="line">}</td></tr>
1404<tr><td class="num" id="LN1312">1312</td><td class="line"> </td></tr>
1405<tr><td class="num" id="LN1313">1313</td><td class="line"> </td></tr>
1406<tr><td class="num" id="LN1314">1314</td><td class="line"><span class='keyword'>static</span> status_t</td></tr>
1407<tr><td class="num" id="LN1315">1315</td><td class="line">nfs4_remove_attr(fs_volume* volume, fs_vnode* vnode, <span class='keyword'>const</span> <span class='keyword'>char</span>* name)</td></tr>
1408<tr><td class="num" id="LN1316">1316</td><td class="line">{</td></tr>
1409<tr><td class="num" id="LN1317">1317</td><td class="line"> VnodeToInode* vti = <span class='keyword'>reinterpret_cast</span>&lt;VnodeToInode*&gt;(vnode-&gt;private_node);</td></tr>
1410<tr><td class="num" id="LN1318">1318</td><td class="line"> </td></tr>
1411<tr><td class="num" id="LN1319">1319</td><td class="line"> VnodeToInodeLocker _(vti);</td></tr>
1412<tr><td class="num" id="LN1320">1320</td><td class="line"> Inode* inode = vti-&gt;Get();</td></tr>
1413<tr><td class="num" id="LN1321">1321</td><td class="line"> <span class='keyword'>if</span> (inode == <span class='macro'>NULL<span class='expansion'>__null</span></span>)</td></tr>
1414<tr><td class="num" id="LN1322">1322</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_ENTRY_NOT_FOUND<span class='expansion'>(((-2147483647 - 1) + 0x6000) + 3)</span></span>;</td></tr>
1415<tr><td class="num" id="LN1323">1323</td><td class="line"> </td></tr>
1416<tr><td class="num" id="LN1324">1324</td><td class="line"> <span class='keyword'>return</span> inode-&gt;Remove(name, NF4NAMEDATTR, <span class='macro'>NULL<span class='expansion'>__null</span></span>);</td></tr>
1417<tr><td class="num" id="LN1325">1325</td><td class="line">}</td></tr>
1418<tr><td class="num" id="LN1326">1326</td><td class="line"> </td></tr>
1419<tr><td class="num" id="LN1327">1327</td><td class="line"> </td></tr>
1420<tr><td class="num" id="LN1328">1328</td><td class="line"><span class='keyword'>static</span> status_t</td></tr>
1421<tr><td class="num" id="LN1329">1329</td><td class="line">nfs4_test_lock(fs_volume* volume, fs_vnode* vnode, <span class='keyword'>void</span>* _cookie,</td></tr>
1422<tr><td class="num" id="LN1330">1330</td><td class="line"> <span class='keyword'>struct</span> flock* lock)</td></tr>
1423<tr><td class="num" id="LN1331">1331</td><td class="line">{</td></tr>
1424<tr><td class="num" id="LN1332">1332</td><td class="line"> VnodeToInode* vti = <span class='keyword'>reinterpret_cast</span>&lt;VnodeToInode*&gt;(vnode-&gt;private_node);</td></tr>
1425<tr><td class="num" id="LN1333">1333</td><td class="line"> OpenFileCookie* cookie = <span class='keyword'>reinterpret_cast</span>&lt;OpenFileCookie*&gt;(_cookie);</td></tr>
1426<tr><td class="num" id="LN1334">1334</td><td class="line"> <span class='macro'>TRACE(<span class='string_literal'>"volume = %p, vnode = %"</span> B_PRIi64 <span class='string_literal'>", cookie = %p, lock = %p"</span>, volume,<span class='expansion'>(void)0</span></span></td></tr>
1427<tr><td class="num" id="LN1335">1335</td><td class="line"> <span class='macro'>vti-&gt;ID(), _cookie, lock)<span class='expansion'>(void)0</span></span>;</td></tr>
1428<tr><td class="num" id="LN1336">1336</td><td class="line"> </td></tr>
1429<tr><td class="num" id="LN1337">1337</td><td class="line"> VnodeToInodeLocker _(vti);</td></tr>
1430<tr><td class="num" id="LN1338">1338</td><td class="line"> Inode* inode = vti-&gt;Get();</td></tr>
1431<tr><td class="num" id="LN1339">1339</td><td class="line"> <span class='keyword'>if</span> (inode == <span class='macro'>NULL<span class='expansion'>__null</span></span>)</td></tr>
1432<tr><td class="num" id="LN1340">1340</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_ENTRY_NOT_FOUND<span class='expansion'>(((-2147483647 - 1) + 0x6000) + 3)</span></span>;</td></tr>
1433<tr><td class="num" id="LN1341">1341</td><td class="line"> </td></tr>
1434<tr><td class="num" id="LN1342">1342</td><td class="line"> <span class='keyword'>return</span> inode-&gt;TestLock(cookie, lock);</td></tr>
1435<tr><td class="num" id="LN1343">1343</td><td class="line">}</td></tr>
1436<tr><td class="num" id="LN1344">1344</td><td class="line"> </td></tr>
1437<tr><td class="num" id="LN1345">1345</td><td class="line"> </td></tr>
1438<tr><td class="num" id="LN1346">1346</td><td class="line"><span class='keyword'>static</span> status_t</td></tr>
1439<tr><td class="num" id="LN1347">1347</td><td class="line">nfs4_acquire_lock(fs_volume* volume, fs_vnode* vnode, <span class='keyword'>void</span>* _cookie,</td></tr>
1440<tr><td class="num" id="LN1348">1348</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>struct</span> flock* lock, <span class='keyword'>bool</span> wait)</td></tr>
1441<tr><td class="num" id="LN1349">1349</td><td class="line">{</td></tr>
1442<tr><td class="num" id="LN1350">1350</td><td class="line"> VnodeToInode* vti = <span class='keyword'>reinterpret_cast</span>&lt;VnodeToInode*&gt;(vnode-&gt;private_node);</td></tr>
1443<tr><td class="num" id="LN1351">1351</td><td class="line"> OpenFileCookie* cookie = <span class='keyword'>reinterpret_cast</span>&lt;OpenFileCookie*&gt;(_cookie);</td></tr>
1444<tr><td class="num" id="LN1352">1352</td><td class="line"> <span class='macro'>TRACE(<span class='string_literal'>"volume = %p, vnode = %"</span> B_PRIi64 <span class='string_literal'>", cookie = %p, lock = %p"</span>, volume,<span class='expansion'>(void)0</span></span></td></tr>
1445<tr><td class="num" id="LN1353">1353</td><td class="line"> <span class='macro'>vti-&gt;ID(), _cookie, lock)<span class='expansion'>(void)0</span></span>;</td></tr>
1446<tr><td class="num" id="LN1354">1354</td><td class="line"> </td></tr>
1447<tr><td class="num" id="LN1355">1355</td><td class="line"> </td></tr>
1448<tr><td class="num" id="LN1356">1356</td><td class="line"> VnodeToInodeLocker _(vti);</td></tr>
1449<tr><td class="num" id="LN1357">1357</td><td class="line"> Inode* inode = vti-&gt;Get();</td></tr>
1450<tr><td class="num" id="LN1358">1358</td><td class="line"> <span class='keyword'>if</span> (inode == <span class='macro'>NULL<span class='expansion'>__null</span></span>)</td></tr>
1451<tr><td class="num" id="LN1359">1359</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_ENTRY_NOT_FOUND<span class='expansion'>(((-2147483647 - 1) + 0x6000) + 3)</span></span>;</td></tr>
1452<tr><td class="num" id="LN1360">1360</td><td class="line"> </td></tr>
1453<tr><td class="num" id="LN1361">1361</td><td class="line"> inode-&gt;RevalidateFileCache();</td></tr>
1454<tr><td class="num" id="LN1362">1362</td><td class="line"> <span class='keyword'>return</span> inode-&gt;AcquireLock(cookie, lock, wait);</td></tr>
1455<tr><td class="num" id="LN1363">1363</td><td class="line">}</td></tr>
1456<tr><td class="num" id="LN1364">1364</td><td class="line"> </td></tr>
1457<tr><td class="num" id="LN1365">1365</td><td class="line"> </td></tr>
1458<tr><td class="num" id="LN1366">1366</td><td class="line"><span class='keyword'>static</span> status_t</td></tr>
1459<tr><td class="num" id="LN1367">1367</td><td class="line">nfs4_release_lock(fs_volume* volume, fs_vnode* vnode, <span class='keyword'>void</span>* _cookie,</td></tr>
1460<tr><td class="num" id="LN1368">1368</td><td class="line"> <span class='keyword'>const</span> <span class='keyword'>struct</span> flock* lock)</td></tr>
1461<tr><td class="num" id="LN1369">1369</td><td class="line">{</td></tr>
1462<tr><td class="num" id="LN1370">1370</td><td class="line"> VnodeToInode* vti = <span class='keyword'>reinterpret_cast</span>&lt;VnodeToInode*&gt;(vnode-&gt;private_node);</td></tr>
1463<tr><td class="num" id="LN1371">1371</td><td class="line"> <span class='macro'>TRACE(<span class='string_literal'>"volume = %p, vnode = %"</span> B_PRIi64 <span class='string_literal'>", cookie = %p, lock = %p"</span>, volume,<span class='expansion'>(void)0</span></span></td></tr>
1464<tr><td class="num" id="LN1372">1372</td><td class="line"> <span class='macro'>vti-&gt;ID(), _cookie, lock)<span class='expansion'>(void)0</span></span>;</td></tr>
1465<tr><td class="num" id="LN1373">1373</td><td class="line"> </td></tr>
1466<tr><td class="num" id="LN1374">1374</td><td class="line"> VnodeToInodeLocker _(vti);</td></tr>
1467<tr><td class="num" id="LN1375">1375</td><td class="line"> Inode* inode = vti-&gt;Get();</td></tr>
1468<tr><td class="num" id="LN1376">1376</td><td class="line"> <span class='keyword'>if</span> (inode == <span class='macro'>NULL<span class='expansion'>__null</span></span>)</td></tr>
1469<tr><td class="num" id="LN1377">1377</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_ENTRY_NOT_FOUND<span class='expansion'>(((-2147483647 - 1) + 0x6000) + 3)</span></span>;</td></tr>
1470<tr><td class="num" id="LN1378">1378</td><td class="line"> </td></tr>
1471<tr><td class="num" id="LN1379">1379</td><td class="line"> <span class='keyword'>if</span> (inode-&gt;Type() == <span class='macro'>S_IFDIR<span class='expansion'>00000040000</span></span> || inode-&gt;Type() == <span class='macro'>S_IFLNK<span class='expansion'>00000120000</span></span>)</td></tr>
1472<tr><td class="num" id="LN1380">1380</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_OK<span class='expansion'>((int)0)</span></span>;</td></tr>
1473<tr><td class="num" id="LN1381">1381</td><td class="line"> </td></tr>
1474<tr><td class="num" id="LN1382">1382</td><td class="line"> OpenFileCookie* cookie = <span class='keyword'>reinterpret_cast</span>&lt;OpenFileCookie*&gt;(_cookie);</td></tr>
1475<tr><td class="num" id="LN1383">1383</td><td class="line"> </td></tr>
1476<tr><td class="num" id="LN1384">1384</td><td class="line"> <span class='keyword'>if</span> (lock != <span class='macro'>NULL<span class='expansion'>__null</span></span>)</td></tr>
1477<tr><td class="num" id="LN1385">1385</td><td class="line"> <span class='keyword'>return</span> inode-&gt;ReleaseLock(cookie, lock);</td></tr>
1478<tr><td class="num" id="LN1386">1386</td><td class="line"> <span class='keyword'>else</span></td></tr>
1479<tr><td class="num" id="LN1387">1387</td><td class="line"> <span class='keyword'>return</span> inode-&gt;ReleaseAllLocks(cookie);</td></tr>
1480<tr><td class="num" id="LN1388">1388</td><td class="line">}</td></tr>
1481<tr><td class="num" id="LN1389">1389</td><td class="line"> </td></tr>
1482<tr><td class="num" id="LN1390">1390</td><td class="line"> </td></tr>
1483<tr><td class="num" id="LN1391">1391</td><td class="line">status_t</td></tr>
1484<tr><td class="num" id="LN1392">1392</td><td class="line">nfs4_init()</td></tr>
1485<tr><td class="num" id="LN1393">1393</td><td class="line">{</td></tr>
1486<tr><td class="num" id="LN1394">1394</td><td class="line"> gRPCServerManager = <span class='keyword'>new</span>(std::nothrow) RPC::ServerManager;</td></tr>
1487<tr><td class="num" id="LN1395">1395</td><td class="line"> <span class='keyword'>if</span> (gRPCServerManager == <span class='macro'>NULL<span class='expansion'>__null</span></span>)</td></tr>
1488<tr><td class="num" id="LN1396">1396</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_NO_MEMORY<span class='expansion'>((-2147483647 - 1) + 0)</span></span>;</td></tr>
1489<tr><td class="num" id="LN1397">1397</td><td class="line"> </td></tr>
1490<tr><td class="num" id="LN1398">1398</td><td class="line"> mutex_init(&amp;gIdMapperLock, <span class='string_literal'>"idmapper Init Lock"</span>);</td></tr>
1491<tr><td class="num" id="LN1399">1399</td><td class="line"> gIdMapper = <span class='macro'>NULL<span class='expansion'>__null</span></span>;</td></tr>
1492<tr><td class="num" id="LN1400">1400</td><td class="line"> </td></tr>
1493<tr><td class="num" id="LN1401">1401</td><td class="line"> gWorkQueue = <span class='keyword'>new</span>(std::nothrow) WorkQueue;</td></tr>
1494<tr><td class="num" id="LN1402">1402</td><td class="line"> <span class='keyword'>if</span> (gWorkQueue == <span class='macro'>NULL<span class='expansion'>__null</span></span> || gWorkQueue-&gt;InitStatus() != <span class='macro'>B_OK<span class='expansion'>((int)0)</span></span>) {</td></tr>
1495<tr><td class="num" id="LN1403">1403</td><td class="line"> <span class='keyword'>delete</span> gWorkQueue;</td></tr>
1496<tr><td class="num" id="LN1404">1404</td><td class="line"> mutex_destroy(&amp;gIdMapperLock);</td></tr>
1497<tr><td class="num" id="LN1405">1405</td><td class="line"> <span class='keyword'>delete</span> gRPCServerManager;</td></tr>
1498<tr><td class="num" id="LN1406">1406</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_NO_MEMORY<span class='expansion'>((-2147483647 - 1) + 0)</span></span>;</td></tr>
1499<tr><td class="num" id="LN1407">1407</td><td class="line"> }</td></tr>
1500<tr><td class="num" id="LN1408">1408</td><td class="line"> </td></tr>
1501<tr><td class="num" id="LN1409">1409</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_OK<span class='expansion'>((int)0)</span></span>;</td></tr>
1502<tr><td class="num" id="LN1410">1410</td><td class="line">}</td></tr>
1503<tr><td class="num" id="LN1411">1411</td><td class="line"> </td></tr>
1504<tr><td class="num" id="LN1412">1412</td><td class="line"> </td></tr>
1505<tr><td class="num" id="LN1413">1413</td><td class="line">status_t</td></tr>
1506<tr><td class="num" id="LN1414">1414</td><td class="line">nfs4_uninit()</td></tr>
1507<tr><td class="num" id="LN1415">1415</td><td class="line">{</td></tr>
1508<tr><td class="num" id="LN1416">1416</td><td class="line"> RPC::CallbackServer::ShutdownAll();</td></tr>
1509<tr><td class="num" id="LN1417">1417</td><td class="line"> </td></tr>
1510<tr><td class="num" id="LN1418">1418</td><td class="line"> <span class='keyword'>delete</span> gIdMapper;</td></tr>
1511<tr><td class="num" id="LN1419">1419</td><td class="line"> <span class='keyword'>delete</span> gWorkQueue;</td></tr>
1512<tr><td class="num" id="LN1420">1420</td><td class="line"> <span class='keyword'>delete</span> gRPCServerManager;</td></tr>
1513<tr><td class="num" id="LN1421">1421</td><td class="line"> </td></tr>
1514<tr><td class="num" id="LN1422">1422</td><td class="line"> mutex_destroy(&amp;gIdMapperLock);</td></tr>
1515<tr><td class="num" id="LN1423">1423</td><td class="line"> </td></tr>
1516<tr><td class="num" id="LN1424">1424</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_OK<span class='expansion'>((int)0)</span></span>;</td></tr>
1517<tr><td class="num" id="LN1425">1425</td><td class="line">}</td></tr>
1518<tr><td class="num" id="LN1426">1426</td><td class="line"> </td></tr>
1519<tr><td class="num" id="LN1427">1427</td><td class="line"> </td></tr>
1520<tr><td class="num" id="LN1428">1428</td><td class="line"><span class='keyword'>static</span> status_t</td></tr>
1521<tr><td class="num" id="LN1429">1429</td><td class="line">nfs4_std_ops(int32 op, ...)</td></tr>
1522<tr><td class="num" id="LN1430">1430</td><td class="line">{</td></tr>
1523<tr><td class="num" id="LN1431">1431</td><td class="line"> <span class='keyword'>switch</span> (op) {</td></tr>
1524<tr><td class="num" id="LN1432">1432</td><td class="line"> <span class='keyword'>case</span> <span class='macro'>B_MODULE_INIT<span class='expansion'>1</span></span>:</td></tr>
1525<tr><td class="num" id="LN1433">1433</td><td class="line"> <span class='keyword'>return</span> nfs4_init();</td></tr>
1526<tr><td class="num" id="LN1434">1434</td><td class="line"> <span class='keyword'>case</span> <span class='macro'>B_MODULE_UNINIT<span class='expansion'>2</span></span>:</td></tr>
1527<tr><td class="num" id="LN1435">1435</td><td class="line"> <span class='keyword'>return</span> nfs4_uninit();</td></tr>
1528<tr><td class="num" id="LN1436">1436</td><td class="line"> <span class='keyword'>default</span>:</td></tr>
1529<tr><td class="num" id="LN1437">1437</td><td class="line"> <span class='keyword'>return</span> <span class='macro'>B_ERROR<span class='expansion'>(-1)</span></span>;</td></tr>
1530<tr><td class="num" id="LN1438">1438</td><td class="line"> }</td></tr>
1531<tr><td class="num" id="LN1439">1439</td><td class="line">}</td></tr>
1532<tr><td class="num" id="LN1440">1440</td><td class="line"> </td></tr>
1533<tr><td class="num" id="LN1441">1441</td><td class="line"> </td></tr>
1534<tr><td class="num" id="LN1442">1442</td><td class="line">fs_volume_ops gNFSv4VolumeOps = {</td></tr>
1535<tr><td class="num" id="LN1443">1443</td><td class="line"> nfs4_unmount,</td></tr>
1536<tr><td class="num" id="LN1444">1444</td><td class="line"> nfs4_read_fs_info,</td></tr>
1537<tr><td class="num" id="LN1445">1445</td><td class="line"> <span class='macro'>NULL<span class='expansion'>__null</span></span>,</td></tr>
1538<tr><td class="num" id="LN1446">1446</td><td class="line"> <span class='macro'>NULL<span class='expansion'>__null</span></span>,</td></tr>
1539<tr><td class="num" id="LN1447">1447</td><td class="line"> nfs4_get_vnode,</td></tr>
1540<tr><td class="num" id="LN1448">1448</td><td class="line">};</td></tr>
1541<tr><td class="num" id="LN1449">1449</td><td class="line"> </td></tr>
1542<tr><td class="num" id="LN1450">1450</td><td class="line">fs_vnode_ops gNFSv4VnodeOps = {</td></tr>
1543<tr><td class="num" id="LN1451">1451</td><td class="line"> nfs4_lookup,</td></tr>
1544<tr><td class="num" id="LN1452">1452</td><td class="line"> <span class='macro'>NULL<span class='expansion'>__null</span></span>, <span class='comment'>// get_vnode_name()</span></td></tr>
1545<tr><td class="num" id="LN1453">1453</td><td class="line"> nfs4_put_vnode,</td></tr>
1546<tr><td class="num" id="LN1454">1454</td><td class="line"> nfs4_remove_vnode,</td></tr>
1547<tr><td class="num" id="LN1455">1455</td><td class="line"> </td></tr>
1548<tr><td class="num" id="LN1456">1456</td><td class="line"> <span class='comment'>/* VM file access */</span></td></tr>
1549<tr><td class="num" id="LN1457">1457</td><td class="line"> <span class='macro'>NULL<span class='expansion'>__null</span></span>, <span class='comment'>// can_page()</span></td></tr>
1550<tr><td class="num" id="LN1458">1458</td><td class="line"> nfs4_read_pages,</td></tr>
1551<tr><td class="num" id="LN1459">1459</td><td class="line"> nfs4_write_pages,</td></tr>
1552<tr><td class="num" id="LN1460">1460</td><td class="line"> </td></tr>
1553<tr><td class="num" id="LN1461">1461</td><td class="line"> nfs4_io,</td></tr>
1554<tr><td class="num" id="LN1462">1462</td><td class="line"> <span class='macro'>NULL<span class='expansion'>__null</span></span>, <span class='comment'>// cancel_io()</span></td></tr>
1555<tr><td class="num" id="LN1463">1463</td><td class="line"> </td></tr>
1556<tr><td class="num" id="LN1464">1464</td><td class="line"> nfs4_get_file_map,</td></tr>
1557<tr><td class="num" id="LN1465">1465</td><td class="line"> </td></tr>
1558<tr><td class="num" id="LN1466">1466</td><td class="line"> <span class='macro'>NULL<span class='expansion'>__null</span></span>, <span class='comment'>// ioctl()</span></td></tr>
1559<tr><td class="num" id="LN1467">1467</td><td class="line"> nfs4_set_flags,</td></tr>
1560<tr><td class="num" id="LN1468">1468</td><td class="line"> <span class='macro'>NULL<span class='expansion'>__null</span></span>, <span class='comment'>// fs_select()</span></td></tr>
1561<tr><td class="num" id="LN1469">1469</td><td class="line"> <span class='macro'>NULL<span class='expansion'>__null</span></span>, <span class='comment'>// fs_deselect()</span></td></tr>
1562<tr><td class="num" id="LN1470">1470</td><td class="line"> nfs4_fsync,</td></tr>
1563<tr><td class="num" id="LN1471">1471</td><td class="line"> </td></tr>
1564<tr><td class="num" id="LN1472">1472</td><td class="line"> nfs4_read_symlink,</td></tr>
1565<tr><td class="num" id="LN1473">1473</td><td class="line"> nfs4_create_symlink,</td></tr>
1566<tr><td class="num" id="LN1474">1474</td><td class="line"> </td></tr>
1567<tr><td class="num" id="LN1475">1475</td><td class="line"> nfs4_link,</td></tr>
1568<tr><td class="num" id="LN1476">1476</td><td class="line"> nfs4_unlink,</td></tr>
1569<tr><td class="num" id="LN1477">1477</td><td class="line"> nfs4_rename,</td></tr>
1570<tr><td class="num" id="LN1478">1478</td><td class="line"> </td></tr>
1571<tr><td class="num" id="LN1479">1479</td><td class="line"> nfs4_access,</td></tr>
1572<tr><td class="num" id="LN1480">1480</td><td class="line"> nfs4_read_stat,</td></tr>
1573<tr><td class="num" id="LN1481">1481</td><td class="line"> nfs4_write_stat,</td></tr>
1574<tr><td class="num" id="LN1482">1482</td><td class="line"> <span class='macro'>NULL<span class='expansion'>__null</span></span>, <span class='comment'>// fs_preallocate()</span></td></tr>
1575<tr><td class="num" id="LN1483">1483</td><td class="line"> </td></tr>
1576<tr><td class="num" id="LN1484">1484</td><td class="line"> <span class='comment'>/* file operations */</span></td></tr>
1577<tr><td class="num" id="LN1485">1485</td><td class="line"> nfs4_create,</td></tr>
1578<tr><td class="num" id="LN1486">1486</td><td class="line"> nfs4_open,</td></tr>
1579<tr><td class="num" id="LN1487">1487</td><td class="line"> nfs4_close,</td></tr>
1580<tr><td class="num" id="LN1488">1488</td><td class="line"> nfs4_free_cookie,</td></tr>
1581<tr><td class="num" id="LN1489">1489</td><td class="line"> nfs4_read,</td></tr>
1582<tr><td class="num" id="LN1490">1490</td><td class="line"> nfs4_write,</td></tr>
1583<tr><td class="num" id="LN1491">1491</td><td class="line"> </td></tr>
1584<tr><td class="num" id="LN1492">1492</td><td class="line"> <span class='comment'>/* directory operations */</span></td></tr>
1585<tr><td class="num" id="LN1493">1493</td><td class="line"> nfs4_create_dir,</td></tr>
1586<tr><td class="num" id="LN1494">1494</td><td class="line"> nfs4_remove_dir,</td></tr>
1587<tr><td class="num" id="LN1495">1495</td><td class="line"> nfs4_open_dir,</td></tr>
1588<tr><td class="num" id="LN1496">1496</td><td class="line"> nfs4_close_dir,</td></tr>
1589<tr><td class="num" id="LN1497">1497</td><td class="line"> nfs4_free_dir_cookie,</td></tr>
1590<tr><td class="num" id="LN1498">1498</td><td class="line"> nfs4_read_dir,</td></tr>
1591<tr><td class="num" id="LN1499">1499</td><td class="line"> nfs4_rewind_dir,</td></tr>
1592<tr><td class="num" id="LN1500">1500</td><td class="line"> </td></tr>
1593<tr><td class="num" id="LN1501">1501</td><td class="line"> <span class='comment'>/* attribute directory operations */</span></td></tr>
1594<tr><td class="num" id="LN1502">1502</td><td class="line"> nfs4_open_attr_dir,</td></tr>
1595<tr><td class="num" id="LN1503">1503</td><td class="line"> nfs4_close_attr_dir,</td></tr>
1596<tr><td class="num" id="LN1504">1504</td><td class="line"> nfs4_free_attr_dir_cookie,</td></tr>
1597<tr><td class="num" id="LN1505">1505</td><td class="line"> nfs4_read_attr_dir,</td></tr>
1598<tr><td class="num" id="LN1506">1506</td><td class="line"> nfs4_rewind_attr_dir,</td></tr>
1599<tr><td class="num" id="LN1507">1507</td><td class="line"> </td></tr>
1600<tr><td class="num" id="LN1508">1508</td><td class="line"> <span class='comment'>/* attribute operations */</span></td></tr>
1601<tr><td class="num" id="LN1509">1509</td><td class="line"> nfs4_create_attr,</td></tr>
1602<tr><td class="num" id="LN1510">1510</td><td class="line"> nfs4_open_attr,</td></tr>
1603<tr><td class="num" id="LN1511">1511</td><td class="line"> nfs4_close_attr,</td></tr>
1604<tr><td class="num" id="LN1512">1512</td><td class="line"> nfs4_free_attr_cookie,</td></tr>
1605<tr><td class="num" id="LN1513">1513</td><td class="line"> nfs4_read_attr,</td></tr>
1606<tr><td class="num" id="LN1514">1514</td><td class="line"> nfs4_write_attr,</td></tr>
1607<tr><td class="num" id="LN1515">1515</td><td class="line"> </td></tr>
1608<tr><td class="num" id="LN1516">1516</td><td class="line"> nfs4_read_attr_stat,</td></tr>
1609<tr><td class="num" id="LN1517">1517</td><td class="line"> nfs4_write_attr_stat,</td></tr>
1610<tr><td class="num" id="LN1518">1518</td><td class="line"> nfs4_rename_attr,</td></tr>
1611<tr><td class="num" id="LN1519">1519</td><td class="line"> nfs4_remove_attr,</td></tr>
1612<tr><td class="num" id="LN1520">1520</td><td class="line"> </td></tr>
1613<tr><td class="num" id="LN1521">1521</td><td class="line"> <span class='comment'>/* support for node and FS layers */</span></td></tr>
1614<tr><td class="num" id="LN1522">1522</td><td class="line"> <span class='macro'>NULL<span class='expansion'>__null</span></span>, <span class='comment'>// create_special_node</span></td></tr>
1615<tr><td class="num" id="LN1523">1523</td><td class="line"> <span class='macro'>NULL<span class='expansion'>__null</span></span>, <span class='comment'>// get_super_vnode</span></td></tr>
1616<tr><td class="num" id="LN1524">1524</td><td class="line"> </td></tr>
1617<tr><td class="num" id="LN1525">1525</td><td class="line"> <span class='comment'>/* lock operations */</span></td></tr>
1618<tr><td class="num" id="LN1526">1526</td><td class="line"> nfs4_test_lock,</td></tr>
1619<tr><td class="num" id="LN1527">1527</td><td class="line"> nfs4_acquire_lock,</td></tr>
1620<tr><td class="num" id="LN1528">1528</td><td class="line"> nfs4_release_lock,</td></tr>
1621<tr><td class="num" id="LN1529">1529</td><td class="line">};</td></tr>
1622<tr><td class="num" id="LN1530">1530</td><td class="line"> </td></tr>
1623<tr><td class="num" id="LN1531">1531</td><td class="line"><span class='keyword'>static</span> file_system_module_info sNFSv4ModuleInfo = {</td></tr>
1624<tr><td class="num" id="LN1532">1532</td><td class="line"> {</td></tr>
1625<tr><td class="num" id="LN1533">1533</td><td class="line"> <span class='string_literal'>"file_systems/nfs4"</span> <span class='macro'>B_CURRENT_FS_API_VERSION<span class='expansion'>"/v1"</span></span>,</td></tr>
1626<tr><td class="num" id="LN1534">1534</td><td class="line"> 0,</td></tr>
1627<tr><td class="num" id="LN1535">1535</td><td class="line"> nfs4_std_ops,</td></tr>
1628<tr><td class="num" id="LN1536">1536</td><td class="line"> },</td></tr>
1629<tr><td class="num" id="LN1537">1537</td><td class="line"> </td></tr>
1630<tr><td class="num" id="LN1538">1538</td><td class="line"> <span class='string_literal'>"nfs4"</span>, <span class='comment'>// short_name</span></td></tr>
1631<tr><td class="num" id="LN1539">1539</td><td class="line"> <span class='string_literal'>"Network File System version 4"</span>, <span class='comment'>// pretty_name</span></td></tr>
1632<tr><td class="num" id="LN1540">1540</td><td class="line"> </td></tr>
1633<tr><td class="num" id="LN1541">1541</td><td class="line"> <span class='comment'>// DDM flags</span></td></tr>
1634<tr><td class="num" id="LN1542">1542</td><td class="line"> 0,</td></tr>
1635<tr><td class="num" id="LN1543">1543</td><td class="line"> </td></tr>
1636<tr><td class="num" id="LN1544">1544</td><td class="line"> <span class='comment'>// scanning</span></td></tr>
1637<tr><td class="num" id="LN1545">1545</td><td class="line"> <span class='macro'>NULL<span class='expansion'>__null</span></span>, <span class='comment'>// identify_partition()</span></td></tr>
1638<tr><td class="num" id="LN1546">1546</td><td class="line"> <span class='macro'>NULL<span class='expansion'>__null</span></span>, <span class='comment'>// scan_partition()</span></td></tr>
1639<tr><td class="num" id="LN1547">1547</td><td class="line"> <span class='macro'>NULL<span class='expansion'>__null</span></span>, <span class='comment'>// free_identify_partition_cookie()</span></td></tr>
1640<tr><td class="num" id="LN1548">1548</td><td class="line"> <span class='macro'>NULL<span class='expansion'>__null</span></span>, <span class='comment'>// free_partition_content_cookie()</span></td></tr>
1641<tr><td class="num" id="LN1549">1549</td><td class="line"> </td></tr>
1642<tr><td class="num" id="LN1550">1550</td><td class="line"> nfs4_mount,</td></tr>
1643<tr><td class="num" id="LN1551">1551</td><td class="line">};</td></tr>
1644<tr><td class="num" id="LN1552">1552</td><td class="line"> </td></tr>
1645<tr><td class="num" id="LN1553">1553</td><td class="line">module_info* modules[] = {</td></tr>
1646<tr><td class="num" id="LN1554">1554</td><td class="line"> (module_info*)&amp;sNFSv4ModuleInfo,</td></tr>
1647<tr><td class="num" id="LN1555">1555</td><td class="line"> <span class='macro'>NULL<span class='expansion'>__null</span></span>,</td></tr>
1648<tr><td class="num" id="LN1556">1556</td><td class="line">};</td></tr>
1649<tr><td class="num" id="LN1557">1557</td><td class="line"> </td></tr>
1650</table></body></html>