| 1 |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
| 2 |
<html> |
| 3 |
<head> |
| 4 |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| 5 |
<title>UDisksState: UDisks Reference Manual</title> |
| 6 |
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot"> |
| 7 |
<link rel="home" href="index.html" title="UDisks Reference Manual"> |
| 8 |
<link rel="up" href="ref-daemon-core.html" title="Core"> |
| 9 |
<link rel="prev" href="UDisksProvider.html" title="UDisksProvider"> |
| 10 |
<link rel="next" href="udisks2-ATA-commands.html" title="ATA commands"> |
| 11 |
<meta name="generator" content="GTK-Doc V1.35.1 (XML mode)"> |
| 12 |
<link rel="stylesheet" href="style.css" type="text/css"> |
| 13 |
</head> |
| 14 |
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> |
| 15 |
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle"> |
| 16 |
<td width="100%" align="left" class="shortcuts"> |
| 17 |
<a href="#" class="shortcut">Top</a><span id="nav_description"> <span class="dim">|</span> |
| 18 |
<a href="#UDisksState.description" class="shortcut">Description</a></span><span id="nav_hierarchy"> <span class="dim">|</span> |
| 19 |
<a href="#UDisksState.object-hierarchy" class="shortcut">Object Hierarchy</a></span><span id="nav_properties"> <span class="dim">|</span> |
| 20 |
<a href="#UDisksState.properties" class="shortcut">Properties</a></span> |
| 21 |
</td> |
| 22 |
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td> |
| 23 |
<td><a accesskey="u" href="ref-daemon-core.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td> |
| 24 |
<td><a accesskey="p" href="UDisksProvider.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td> |
| 25 |
<td><a accesskey="n" href="udisks2-ATA-commands.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td> |
| 26 |
</tr></table> |
| 27 |
<div class="refentry"> |
| 28 |
<a name="UDisksState"></a><div class="titlepage"></div> |
| 29 |
<div class="refnamediv"><table width="100%"><tr> |
| 30 |
<td valign="top"> |
| 31 |
<h2><span class="refentrytitle"><a name="UDisksState.top_of_page"></a>UDisksState</span></h2> |
| 32 |
<p>UDisksState — Object used for recording state and cleaning up</p> |
| 33 |
</td> |
| 34 |
<td class="gallery_image" valign="top" align="right"></td> |
| 35 |
</tr></table></div> |
| 36 |
<div class="refsect1"> |
| 37 |
<a name="UDisksState.functions"></a><h2>Functions</h2> |
| 38 |
<div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| 39 |
<colgroup> |
| 40 |
<col width="150px" class="functions_proto_type"> |
| 41 |
<col class="functions_proto_name"> |
| 42 |
</colgroup> |
| 43 |
<tbody> |
| 44 |
<tr> |
| 45 |
<td class="function_type"> |
| 46 |
<a class="link" href="UDisksState.html" title="UDisksState"><span class="returnvalue">UDisksState</span></a> * |
| 47 |
</td> |
| 48 |
<td class="function_name"> |
| 49 |
<a class="link" href="UDisksState.html#udisks-state-new" title="udisks_state_new ()">udisks_state_new</a> <span class="c_punctuation">()</span> |
| 50 |
</td> |
| 51 |
</tr> |
| 52 |
<tr> |
| 53 |
<td class="function_type"> |
| 54 |
<span class="returnvalue">void</span> |
| 55 |
</td> |
| 56 |
<td class="function_name"> |
| 57 |
<a class="link" href="UDisksState.html#udisks-state-start-cleanup" title="udisks_state_start_cleanup ()">udisks_state_start_cleanup</a> <span class="c_punctuation">()</span> |
| 58 |
</td> |
| 59 |
</tr> |
| 60 |
<tr> |
| 61 |
<td class="function_type"> |
| 62 |
<span class="returnvalue">void</span> |
| 63 |
</td> |
| 64 |
<td class="function_name"> |
| 65 |
<a class="link" href="UDisksState.html#udisks-state-stop-cleanup" title="udisks_state_stop_cleanup ()">udisks_state_stop_cleanup</a> <span class="c_punctuation">()</span> |
| 66 |
</td> |
| 67 |
</tr> |
| 68 |
<tr> |
| 69 |
<td class="function_type"> |
| 70 |
<span class="returnvalue">void</span> |
| 71 |
</td> |
| 72 |
<td class="function_name"> |
| 73 |
<a class="link" href="UDisksState.html#udisks-state-check" title="udisks_state_check ()">udisks_state_check</a> <span class="c_punctuation">()</span> |
| 74 |
</td> |
| 75 |
</tr> |
| 76 |
<tr> |
| 77 |
<td class="function_type"> |
| 78 |
<span class="returnvalue">void</span> |
| 79 |
</td> |
| 80 |
<td class="function_name"> |
| 81 |
<a class="link" href="UDisksState.html#udisks-state-check-block" title="udisks_state_check_block ()">udisks_state_check_block</a> <span class="c_punctuation">()</span> |
| 82 |
</td> |
| 83 |
</tr> |
| 84 |
<tr> |
| 85 |
<td class="function_type"> |
| 86 |
<a class="link" href="UDisksDaemon.html" title="UDisksDaemon"><span class="returnvalue">UDisksDaemon</span></a> * |
| 87 |
</td> |
| 88 |
<td class="function_name"> |
| 89 |
<a class="link" href="UDisksState.html#udisks-state-get-daemon" title="udisks_state_get_daemon ()">udisks_state_get_daemon</a> <span class="c_punctuation">()</span> |
| 90 |
</td> |
| 91 |
</tr> |
| 92 |
<tr> |
| 93 |
<td class="function_type"> |
| 94 |
<span class="returnvalue">void</span> |
| 95 |
</td> |
| 96 |
<td class="function_name"> |
| 97 |
<a class="link" href="UDisksState.html#udisks-state-add-mounted-fs" title="udisks_state_add_mounted_fs ()">udisks_state_add_mounted_fs</a> <span class="c_punctuation">()</span> |
| 98 |
</td> |
| 99 |
</tr> |
| 100 |
<tr> |
| 101 |
<td class="function_type"> |
| 102 |
<span class="returnvalue">gchar</span> * |
| 103 |
</td> |
| 104 |
<td class="function_name"> |
| 105 |
<a class="link" href="UDisksState.html#udisks-state-find-mounted-fs" title="udisks_state_find_mounted_fs ()">udisks_state_find_mounted_fs</a> <span class="c_punctuation">()</span> |
| 106 |
</td> |
| 107 |
</tr> |
| 108 |
<tr> |
| 109 |
<td class="function_type"> |
| 110 |
<span class="returnvalue">void</span> |
| 111 |
</td> |
| 112 |
<td class="function_name"> |
| 113 |
<a class="link" href="UDisksState.html#udisks-state-add-unlocked-crypto-dev" title="udisks_state_add_unlocked_crypto_dev ()">udisks_state_add_unlocked_crypto_dev</a> <span class="c_punctuation">()</span> |
| 114 |
</td> |
| 115 |
</tr> |
| 116 |
<tr> |
| 117 |
<td class="function_type"> |
| 118 |
<span class="returnvalue">dev_t</span> |
| 119 |
</td> |
| 120 |
<td class="function_name"> |
| 121 |
<a class="link" href="UDisksState.html#udisks-state-find-unlocked-crypto-dev" title="udisks_state_find_unlocked_crypto_dev ()">udisks_state_find_unlocked_crypto_dev</a> <span class="c_punctuation">()</span> |
| 122 |
</td> |
| 123 |
</tr> |
| 124 |
<tr> |
| 125 |
<td class="function_type"> |
| 126 |
<span class="returnvalue">void</span> |
| 127 |
</td> |
| 128 |
<td class="function_name"> |
| 129 |
<a class="link" href="UDisksState.html#udisks-state-add-loop" title="udisks_state_add_loop ()">udisks_state_add_loop</a> <span class="c_punctuation">()</span> |
| 130 |
</td> |
| 131 |
</tr> |
| 132 |
<tr> |
| 133 |
<td class="function_type"> |
| 134 |
<span class="returnvalue">gboolean</span> |
| 135 |
</td> |
| 136 |
<td class="function_name"> |
| 137 |
<a class="link" href="UDisksState.html#udisks-state-has-loop" title="udisks_state_has_loop ()">udisks_state_has_loop</a> <span class="c_punctuation">()</span> |
| 138 |
</td> |
| 139 |
</tr> |
| 140 |
<tr> |
| 141 |
<td class="function_type"> |
| 142 |
<span class="returnvalue">void</span> |
| 143 |
</td> |
| 144 |
<td class="function_name"> |
| 145 |
<a class="link" href="UDisksState.html#udisks-state-add-mdraid" title="udisks_state_add_mdraid ()">udisks_state_add_mdraid</a> <span class="c_punctuation">()</span> |
| 146 |
</td> |
| 147 |
</tr> |
| 148 |
<tr> |
| 149 |
<td class="function_type"> |
| 150 |
<span class="returnvalue">gboolean</span> |
| 151 |
</td> |
| 152 |
<td class="function_name"> |
| 153 |
<a class="link" href="UDisksState.html#udisks-state-has-mdraid" title="udisks_state_has_mdraid ()">udisks_state_has_mdraid</a> <span class="c_punctuation">()</span> |
| 154 |
</td> |
| 155 |
</tr> |
| 156 |
<tr> |
| 157 |
<td class="function_type"> |
| 158 |
<span class="returnvalue">void</span> |
| 159 |
</td> |
| 160 |
<td class="function_name"> |
| 161 |
<a class="link" href="UDisksState.html#udisks-state-add-module" title="udisks_state_add_module ()">udisks_state_add_module</a> <span class="c_punctuation">()</span> |
| 162 |
</td> |
| 163 |
</tr> |
| 164 |
<tr> |
| 165 |
<td class="function_type"> |
| 166 |
<span class="returnvalue">void</span> |
| 167 |
</td> |
| 168 |
<td class="function_name"> |
| 169 |
<a class="link" href="UDisksState.html#udisks-state-clear-modules" title="udisks_state_clear_modules ()">udisks_state_clear_modules</a> <span class="c_punctuation">()</span> |
| 170 |
</td> |
| 171 |
</tr> |
| 172 |
<tr> |
| 173 |
<td class="function_type"> |
| 174 |
<span class="returnvalue">gchar</span> ** |
| 175 |
</td> |
| 176 |
<td class="function_name"> |
| 177 |
<a class="link" href="UDisksState.html#udisks-state-get-modules" title="udisks_state_get_modules ()">udisks_state_get_modules</a> <span class="c_punctuation">()</span> |
| 178 |
</td> |
| 179 |
</tr> |
| 180 |
</tbody> |
| 181 |
</table></div> |
| 182 |
</div> |
| 183 |
<div class="refsect1"> |
| 184 |
<a name="UDisksState.properties"></a><h2>Properties</h2> |
| 185 |
<div class="informaltable"><table class="informaltable" border="0"> |
| 186 |
<colgroup> |
| 187 |
<col width="150px" class="properties_type"> |
| 188 |
<col width="300px" class="properties_name"> |
| 189 |
<col width="200px" class="properties_flags"> |
| 190 |
</colgroup> |
| 191 |
<tbody><tr> |
| 192 |
<td class="property_type"> |
| 193 |
<a class="link" href="UDisksDaemon.html" title="UDisksDaemon"><span class="type">UDisksDaemon</span></a> *</td> |
| 194 |
<td class="property_name"><a class="link" href="UDisksState.html#UDisksState--daemon" title="The “daemon” property">daemon</a></td> |
| 195 |
<td class="property_flags">Read / Write / Construct Only</td> |
| 196 |
</tr></tbody> |
| 197 |
</table></div> |
| 198 |
</div> |
| 199 |
<div class="refsect1"> |
| 200 |
<a name="UDisksState.other"></a><h2>Types and Values</h2> |
| 201 |
<div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| 202 |
<colgroup> |
| 203 |
<col width="150px" class="other_proto_type"> |
| 204 |
<col class="other_proto_name"> |
| 205 |
</colgroup> |
| 206 |
<tbody><tr> |
| 207 |
<td class="datatype_keyword"> </td> |
| 208 |
<td class="function_name"><a class="link" href="UDisksState.html#UDisksState-struct" title="UDisksState">UDisksState</a></td> |
| 209 |
</tr></tbody> |
| 210 |
</table></div> |
| 211 |
</div> |
| 212 |
<div class="refsect1"> |
| 213 |
<a name="UDisksState.object-hierarchy"></a><h2>Object Hierarchy</h2> |
| 214 |
<pre class="screen"> GObject |
| 215 |
<span class="lineart">╰──</span> UDisksState |
| 216 |
</pre> |
| 217 |
</div> |
| 218 |
<div class="refsect1"> |
| 219 |
<a name="UDisksState.description"></a><h2>Description</h2> |
| 220 |
<p>This type is used for recording actions done by users and cleaning |
| 221 |
up when devices set up via the udisks interfaces are removed while |
| 222 |
still in use - for example, a USB stick being yanked.</p> |
| 223 |
<p>The following files are used:</p> |
| 224 |
<div class="table"> |
| 225 |
<a name="id-1.5.2.6.7.4"></a><p class="title"><b>Table 3. Persistent information and state</b></p> |
| 226 |
<div class="table-contents"><table class="table" summary="Persistent information and state" border="1"> |
| 227 |
<colgroup> |
| 228 |
<col> |
| 229 |
<col> |
| 230 |
</colgroup> |
| 231 |
<thead><tr> |
| 232 |
<th align="left">File</th> |
| 233 |
<th align="left">Usage</th> |
| 234 |
</tr></thead> |
| 235 |
<tbody> |
| 236 |
<tr> |
| 237 |
<td align="left"><code class="filename">/run/udisks2/mounted-fs</code></td> |
| 238 |
<td align="left"> |
| 239 |
A serialized 'a{sa{sv}}' <span class="type">GVariant</span> mapping from the |
| 240 |
mount point (e.g. <code class="filename">/media/EOS_DIGITAL</code>) into a set of details. |
| 241 |
Known details include |
| 242 |
<code class="literal">block-device</code> |
| 243 |
(of type 't') that is the <span class="type">dev_t</span> |
| 244 |
for the mounted device, |
| 245 |
<code class="literal">mounted-by-uid</code> |
| 246 |
(of type 'u') that is the <span class="type">uid_t</span> |
| 247 |
of the user who mounted the device, and |
| 248 |
<code class="literal">fstab-mount</code> |
| 249 |
(of type 'b') that is <code class="literal">TRUE</code> |
| 250 |
if the device was mounted via an entry in /etc/fstab. |
| 251 |
|
| 252 |
Contains only non-persistent mount points. This state file is typically stored on |
| 253 |
a non-persistent filesystem. |
| 254 |
</td> |
| 255 |
</tr> |
| 256 |
<tr> |
| 257 |
<td align="left"><code class="filename">/var/lib/udisks2/mounted-fs-persistent</code></td> |
| 258 |
<td align="left"> |
| 259 |
Similar in contents and data structure to <code class="filename">/run/udisks2/mounted-fs</code> |
| 260 |
except that only persistent mount points are stored there. This state file is |
| 261 |
typically stored on a persistent filesystem. |
| 262 |
</td> |
| 263 |
</tr> |
| 264 |
<tr> |
| 265 |
<td align="left"><code class="filename">/run/udisks2/unlocked-crypto-dev</code></td> |
| 266 |
<td align="left"> |
| 267 |
A serialized 'a{ta{sv}}' <span class="type">GVariant</span> mapping from the |
| 268 |
<span class="type">dev_t</span> of the clear-text device (e.g. <code class="filename">/dev/dm-0</code>) into a set of details. |
| 269 |
Known details include |
| 270 |
<code class="literal">crypto-device</code> |
| 271 |
(of type 't') that is the <span class="type">dev_t</span> |
| 272 |
for the crypto-text device, |
| 273 |
<code class="literal">dm-uuid</code> |
| 274 |
(of type 'ay') that is the device mapper UUID |
| 275 |
for the clear-text device and |
| 276 |
<code class="literal">unlocked-by-uid</code> |
| 277 |
(of type 'u') that is the <span class="type">uid_t</span> |
| 278 |
of the user who unlocked the device. |
| 279 |
</td> |
| 280 |
</tr> |
| 281 |
<tr> |
| 282 |
<td align="left"><code class="filename">/run/udisks2/loop</code></td> |
| 283 |
<td align="left"> |
| 284 |
A serialized 'a{sa{sv}}' <span class="type">GVariant</span> mapping from the |
| 285 |
loop device name (e.g. <code class="filename">/dev/loop0</code>) into a set of details. |
| 286 |
Known details include |
| 287 |
<code class="literal">backing-file</code> |
| 288 |
(of type 'ay') for the name of the backing file and |
| 289 |
<code class="literal">backing-file-device</code> |
| 290 |
(of type 't') for the <span class="type">dev_t</span> |
| 291 |
for of the device holding the backing file (or 0 if unknown) and |
| 292 |
<code class="literal">setup-by-uid</code> |
| 293 |
(of type 'u') that is the <span class="type">uid_t</span> |
| 294 |
of the user who set up the loop device. |
| 295 |
</td> |
| 296 |
</tr> |
| 297 |
<tr> |
| 298 |
<td align="left"><code class="filename">/run/udisks2/mdraid</code></td> |
| 299 |
<td align="left"> |
| 300 |
A serialized 'a{ta{sv}}' <span class="type">GVariant</span> mapping from the |
| 301 |
<span class="type">dev_t</span> of the raid device (e.g. <code class="filename">/dev/md127</code>) into a set of details. |
| 302 |
Known details include |
| 303 |
<code class="literal">started-by-uid</code> |
| 304 |
(of type 'u') that is the <span class="type">uid_t</span> |
| 305 |
of the user who started the array. |
| 306 |
</td> |
| 307 |
</tr> |
| 308 |
<tr> |
| 309 |
<td align="left"><code class="filename">/run/udisks2/modules</code></td> |
| 310 |
<td align="left"> |
| 311 |
A serialized 'a{sa{sv}}' <span class="type">GVariant</span> mapping from the |
| 312 |
module name (e.g. <code class="filename">lvm2</code>) into a set of details. |
| 313 |
No details are defined at this point, reserved for future use. |
| 314 |
|
| 315 |
Contains currently active module names primarily for the purpose |
| 316 |
of crash recovery upon next daemon start. |
| 317 |
</td> |
| 318 |
</tr> |
| 319 |
</tbody> |
| 320 |
</table></div> |
| 321 |
</div> |
| 322 |
<br class="table-break"><p>Cleaning up is implemented by running a thread (to ensure that |
| 323 |
actions are serialized) that checks all data in the files mentioned |
| 324 |
above and cleans up the entry in question by e.g. unmounting a |
| 325 |
filesystem, removing a mount point or tearing down a device-mapper |
| 326 |
device when needed. The clean-up thread itself needs to be manually |
| 327 |
kicked using e.g. <a class="link" href="UDisksState.html#udisks-state-check" title="udisks_state_check ()"><code class="function">udisks_state_check()</code></a> from suitable places in |
| 328 |
the <a class="link" href="UDisksDaemon.html" title="UDisksDaemon"><span class="type">UDisksDaemon</span></a> and <a class="link" href="UDisksProvider.html" title="UDisksProvider"><span class="type">UDisksProvider</span></a> implementations.</p> |
| 329 |
<p>Since cleaning up is only necessary when a device has been removed |
| 330 |
without having been properly stopped or shut down, the fact that it |
| 331 |
was cleaned up is logged to ensure that the information is brought |
| 332 |
to the attention of the system administrator.</p> |
| 333 |
</div> |
| 334 |
<div class="refsect1"> |
| 335 |
<a name="UDisksState.functions_details"></a><h2>Functions</h2> |
| 336 |
<div class="refsect2"> |
| 337 |
<a name="udisks-state-new"></a><h3>udisks_state_new ()</h3> |
| 338 |
<pre class="programlisting"><a class="link" href="UDisksState.html" title="UDisksState"><span class="returnvalue">UDisksState</span></a> * |
| 339 |
udisks_state_new (<em class="parameter"><code><a class="link" href="UDisksDaemon.html" title="UDisksDaemon"><span class="type">UDisksDaemon</span></a> *daemon</code></em>);</pre> |
| 340 |
<p>Creates a new <a class="link" href="UDisksState.html" title="UDisksState"><span class="type">UDisksState</span></a> object.</p> |
| 341 |
<div class="refsect3"> |
| 342 |
<a name="udisks-state-new.parameters"></a><h4>Parameters</h4> |
| 343 |
<div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| 344 |
<colgroup> |
| 345 |
<col width="150px" class="parameters_name"> |
| 346 |
<col class="parameters_description"> |
| 347 |
<col width="200px" class="parameters_annotations"> |
| 348 |
</colgroup> |
| 349 |
<tbody><tr> |
| 350 |
<td class="parameter_name"><p>daemon</p></td> |
| 351 |
<td class="parameter_description"><p>A <a class="link" href="UDisksDaemon.html" title="UDisksDaemon"><span class="type">UDisksDaemon</span></a>.</p></td> |
| 352 |
<td class="parameter_annotations"> </td> |
| 353 |
</tr></tbody> |
| 354 |
</table></div> |
| 355 |
</div> |
| 356 |
<div class="refsect3"> |
| 357 |
<a name="udisks-state-new.returns"></a><h4>Returns</h4> |
| 358 |
<p> A <a class="link" href="UDisksState.html" title="UDisksState"><span class="type">UDisksState</span></a> that should be freed with <code class="function">g_object_unref()</code>.</p> |
| 359 |
</div> |
| 360 |
</div> |
| 361 |
<hr> |
| 362 |
<div class="refsect2"> |
| 363 |
<a name="udisks-state-start-cleanup"></a><h3>udisks_state_start_cleanup ()</h3> |
| 364 |
<pre class="programlisting"><span class="returnvalue">void</span> |
| 365 |
udisks_state_start_cleanup (<em class="parameter"><code><a class="link" href="UDisksState.html" title="UDisksState"><span class="type">UDisksState</span></a> *state</code></em>);</pre> |
| 366 |
<p>Starts the clean-up thread.</p> |
| 367 |
<p>The clean-up thread will hold a reference to <em class="parameter"><code>state</code></em> |
| 368 |
for as long as |
| 369 |
it's running - use <a class="link" href="UDisksState.html#udisks-state-stop-cleanup" title="udisks_state_stop_cleanup ()"><code class="function">udisks_state_stop_cleanup()</code></a> to stop it.</p> |
| 370 |
<div class="refsect3"> |
| 371 |
<a name="udisks-state-start-cleanup.parameters"></a><h4>Parameters</h4> |
| 372 |
<div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| 373 |
<colgroup> |
| 374 |
<col width="150px" class="parameters_name"> |
| 375 |
<col class="parameters_description"> |
| 376 |
<col width="200px" class="parameters_annotations"> |
| 377 |
</colgroup> |
| 378 |
<tbody><tr> |
| 379 |
<td class="parameter_name"><p>state</p></td> |
| 380 |
<td class="parameter_description"><p>A <a class="link" href="UDisksState.html" title="UDisksState"><span class="type">UDisksState</span></a>.</p></td> |
| 381 |
<td class="parameter_annotations"> </td> |
| 382 |
</tr></tbody> |
| 383 |
</table></div> |
| 384 |
</div> |
| 385 |
</div> |
| 386 |
<hr> |
| 387 |
<div class="refsect2"> |
| 388 |
<a name="udisks-state-stop-cleanup"></a><h3>udisks_state_stop_cleanup ()</h3> |
| 389 |
<pre class="programlisting"><span class="returnvalue">void</span> |
| 390 |
udisks_state_stop_cleanup (<em class="parameter"><code><a class="link" href="UDisksState.html" title="UDisksState"><span class="type">UDisksState</span></a> *state</code></em>);</pre> |
| 391 |
<p>Stops the clean-up thread. Blocks the calling thread until it has stopped.</p> |
| 392 |
<div class="refsect3"> |
| 393 |
<a name="udisks-state-stop-cleanup.parameters"></a><h4>Parameters</h4> |
| 394 |
<div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| 395 |
<colgroup> |
| 396 |
<col width="150px" class="parameters_name"> |
| 397 |
<col class="parameters_description"> |
| 398 |
<col width="200px" class="parameters_annotations"> |
| 399 |
</colgroup> |
| 400 |
<tbody><tr> |
| 401 |
<td class="parameter_name"><p>state</p></td> |
| 402 |
<td class="parameter_description"><p>A <a class="link" href="UDisksState.html" title="UDisksState"><span class="type">UDisksState</span></a>.</p></td> |
| 403 |
<td class="parameter_annotations"> </td> |
| 404 |
</tr></tbody> |
| 405 |
</table></div> |
| 406 |
</div> |
| 407 |
</div> |
| 408 |
<hr> |
| 409 |
<div class="refsect2"> |
| 410 |
<a name="udisks-state-check"></a><h3>udisks_state_check ()</h3> |
| 411 |
<pre class="programlisting"><span class="returnvalue">void</span> |
| 412 |
udisks_state_check (<em class="parameter"><code><a class="link" href="UDisksState.html" title="UDisksState"><span class="type">UDisksState</span></a> *state</code></em>);</pre> |
| 413 |
<p>Causes the clean-up thread for <em class="parameter"><code>state</code></em> |
| 414 |
to check if anything should be cleaned up.</p> |
| 415 |
<p>This can be called from any thread and will not block the calling thread.</p> |
| 416 |
<div class="refsect3"> |
| 417 |
<a name="udisks-state-check.parameters"></a><h4>Parameters</h4> |
| 418 |
<div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| 419 |
<colgroup> |
| 420 |
<col width="150px" class="parameters_name"> |
| 421 |
<col class="parameters_description"> |
| 422 |
<col width="200px" class="parameters_annotations"> |
| 423 |
</colgroup> |
| 424 |
<tbody><tr> |
| 425 |
<td class="parameter_name"><p>state</p></td> |
| 426 |
<td class="parameter_description"><p>A <a class="link" href="UDisksState.html" title="UDisksState"><span class="type">UDisksState</span></a>.</p></td> |
| 427 |
<td class="parameter_annotations"> </td> |
| 428 |
</tr></tbody> |
| 429 |
</table></div> |
| 430 |
</div> |
| 431 |
</div> |
| 432 |
<hr> |
| 433 |
<div class="refsect2"> |
| 434 |
<a name="udisks-state-check-block"></a><h3>udisks_state_check_block ()</h3> |
| 435 |
<pre class="programlisting"><span class="returnvalue">void</span> |
| 436 |
udisks_state_check_block (<em class="parameter"><code><a class="link" href="UDisksState.html" title="UDisksState"><span class="type">UDisksState</span></a> *state</code></em>, |
| 437 |
<em class="parameter"><code><span class="type">dev_t</span> block_device</code></em>);</pre> |
| 438 |
<p>Performs cleanup of a mounted filesystem over a single block device. In case |
| 439 |
the clean-up thread is busy, waits until the current iteration is finished.</p> |
| 440 |
<p>This can be called from any thread and will block the calling thread until |
| 441 |
cleanup is finished. Note that this ignores <a class="link" href="UDisksLinuxBlockObject.html" title="UDisksLinuxBlockObject"><span class="type">UDisksLinuxBlockObject</span></a> cleanup lock |
| 442 |
that is supposed to be held by the caller.</p> |
| 443 |
<div class="refsect3"> |
| 444 |
<a name="udisks-state-check-block.parameters"></a><h4>Parameters</h4> |
| 445 |
<div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| 446 |
<colgroup> |
| 447 |
<col width="150px" class="parameters_name"> |
| 448 |
<col class="parameters_description"> |
| 449 |
<col width="200px" class="parameters_annotations"> |
| 450 |
</colgroup> |
| 451 |
<tbody> |
| 452 |
<tr> |
| 453 |
<td class="parameter_name"><p>state</p></td> |
| 454 |
<td class="parameter_description"><p>A <a class="link" href="UDisksState.html" title="UDisksState"><span class="type">UDisksState</span></a>.</p></td> |
| 455 |
<td class="parameter_annotations"> </td> |
| 456 |
</tr> |
| 457 |
<tr> |
| 458 |
<td class="parameter_name"><p>block_device</p></td> |
| 459 |
<td class="parameter_description"><p>Device number of the block device to check.</p></td> |
| 460 |
<td class="parameter_annotations"> </td> |
| 461 |
</tr> |
| 462 |
</tbody> |
| 463 |
</table></div> |
| 464 |
</div> |
| 465 |
</div> |
| 466 |
<hr> |
| 467 |
<div class="refsect2"> |
| 468 |
<a name="udisks-state-get-daemon"></a><h3>udisks_state_get_daemon ()</h3> |
| 469 |
<pre class="programlisting"><a class="link" href="UDisksDaemon.html" title="UDisksDaemon"><span class="returnvalue">UDisksDaemon</span></a> * |
| 470 |
udisks_state_get_daemon (<em class="parameter"><code><a class="link" href="UDisksState.html" title="UDisksState"><span class="type">UDisksState</span></a> *state</code></em>);</pre> |
| 471 |
<p>Gets the daemon used by <em class="parameter"><code>state</code></em> |
| 472 |
.</p> |
| 473 |
<div class="refsect3"> |
| 474 |
<a name="udisks-state-get-daemon.parameters"></a><h4>Parameters</h4> |
| 475 |
<div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| 476 |
<colgroup> |
| 477 |
<col width="150px" class="parameters_name"> |
| 478 |
<col class="parameters_description"> |
| 479 |
<col width="200px" class="parameters_annotations"> |
| 480 |
</colgroup> |
| 481 |
<tbody><tr> |
| 482 |
<td class="parameter_name"><p>state</p></td> |
| 483 |
<td class="parameter_description"><p>A <a class="link" href="UDisksState.html" title="UDisksState"><span class="type">UDisksState</span></a>.</p></td> |
| 484 |
<td class="parameter_annotations"> </td> |
| 485 |
</tr></tbody> |
| 486 |
</table></div> |
| 487 |
</div> |
| 488 |
<div class="refsect3"> |
| 489 |
<a name="udisks-state-get-daemon.returns"></a><h4>Returns</h4> |
| 490 |
<p> A <a class="link" href="UDisksDaemon.html" title="UDisksDaemon"><span class="type">UDisksDaemon</span></a>. Do not free, the object is owned by <em class="parameter"><code>state</code></em> |
| 491 |
.</p> |
| 492 |
</div> |
| 493 |
</div> |
| 494 |
<hr> |
| 495 |
<div class="refsect2"> |
| 496 |
<a name="udisks-state-add-mounted-fs"></a><h3>udisks_state_add_mounted_fs ()</h3> |
| 497 |
<pre class="programlisting"><span class="returnvalue">void</span> |
| 498 |
udisks_state_add_mounted_fs (<em class="parameter"><code><a class="link" href="UDisksState.html" title="UDisksState"><span class="type">UDisksState</span></a> *state</code></em>, |
| 499 |
<em class="parameter"><code>const <span class="type">gchar</span> *mount_point</code></em>, |
| 500 |
<em class="parameter"><code><span class="type">dev_t</span> block_device</code></em>, |
| 501 |
<em class="parameter"><code><span class="type">uid_t</span> uid</code></em>, |
| 502 |
<em class="parameter"><code><span class="type">gboolean</span> fstab_mount</code></em>, |
| 503 |
<em class="parameter"><code><span class="type">gboolean</span> persistent</code></em>);</pre> |
| 504 |
<p>Adds a new entry to the |
| 505 |
<code class="filename">/run/udisks2/mounted-fs</code> file.</p> |
| 506 |
<div class="refsect3"> |
| 507 |
<a name="udisks-state-add-mounted-fs.parameters"></a><h4>Parameters</h4> |
| 508 |
<div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| 509 |
<colgroup> |
| 510 |
<col width="150px" class="parameters_name"> |
| 511 |
<col class="parameters_description"> |
| 512 |
<col width="200px" class="parameters_annotations"> |
| 513 |
</colgroup> |
| 514 |
<tbody> |
| 515 |
<tr> |
| 516 |
<td class="parameter_name"><p>state</p></td> |
| 517 |
<td class="parameter_description"><p>A <a class="link" href="UDisksState.html" title="UDisksState"><span class="type">UDisksState</span></a>.</p></td> |
| 518 |
<td class="parameter_annotations"> </td> |
| 519 |
</tr> |
| 520 |
<tr> |
| 521 |
<td class="parameter_name"><p>block_device</p></td> |
| 522 |
<td class="parameter_description"><p>The block device.</p></td> |
| 523 |
<td class="parameter_annotations"> </td> |
| 524 |
</tr> |
| 525 |
<tr> |
| 526 |
<td class="parameter_name"><p>mount_point</p></td> |
| 527 |
<td class="parameter_description"><p>The mount point.</p></td> |
| 528 |
<td class="parameter_annotations"> </td> |
| 529 |
</tr> |
| 530 |
<tr> |
| 531 |
<td class="parameter_name"><p>uid</p></td> |
| 532 |
<td class="parameter_description"><p>The user id of the process requesting the device to be mounted.</p></td> |
| 533 |
<td class="parameter_annotations"> </td> |
| 534 |
</tr> |
| 535 |
<tr> |
| 536 |
<td class="parameter_name"><p>fstab_mount</p></td> |
| 537 |
<td class="parameter_description"><p><code class="literal">TRUE</code> if the device was mounted via /etc/fstab.</p></td> |
| 538 |
<td class="parameter_annotations"> </td> |
| 539 |
</tr> |
| 540 |
<tr> |
| 541 |
<td class="parameter_name"><p>persistent</p></td> |
| 542 |
<td class="parameter_description"><p><code class="literal">TRUE</code> if the mount point is on a persistent filesystem.</p></td> |
| 543 |
<td class="parameter_annotations"> </td> |
| 544 |
</tr> |
| 545 |
</tbody> |
| 546 |
</table></div> |
| 547 |
</div> |
| 548 |
</div> |
| 549 |
<hr> |
| 550 |
<div class="refsect2"> |
| 551 |
<a name="udisks-state-find-mounted-fs"></a><h3>udisks_state_find_mounted_fs ()</h3> |
| 552 |
<pre class="programlisting"><span class="returnvalue">gchar</span> * |
| 553 |
udisks_state_find_mounted_fs (<em class="parameter"><code><a class="link" href="UDisksState.html" title="UDisksState"><span class="type">UDisksState</span></a> *state</code></em>, |
| 554 |
<em class="parameter"><code><span class="type">dev_t</span> block_device</code></em>, |
| 555 |
<em class="parameter"><code><span class="type">uid_t</span> *out_uid</code></em>, |
| 556 |
<em class="parameter"><code><span class="type">gboolean</span> *out_fstab_mount</code></em>);</pre> |
| 557 |
<p>Gets the mount point for <em class="parameter"><code>block_device</code></em> |
| 558 |
, if it exists in the |
| 559 |
<code class="filename">/run/udisks2/mounted-fs</code> file.</p> |
| 560 |
<div class="refsect3"> |
| 561 |
<a name="udisks-state-find-mounted-fs.parameters"></a><h4>Parameters</h4> |
| 562 |
<div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| 563 |
<colgroup> |
| 564 |
<col width="150px" class="parameters_name"> |
| 565 |
<col class="parameters_description"> |
| 566 |
<col width="200px" class="parameters_annotations"> |
| 567 |
</colgroup> |
| 568 |
<tbody> |
| 569 |
<tr> |
| 570 |
<td class="parameter_name"><p>state</p></td> |
| 571 |
<td class="parameter_description"><p>A <a class="link" href="UDisksState.html" title="UDisksState"><span class="type">UDisksState</span></a>.</p></td> |
| 572 |
<td class="parameter_annotations"> </td> |
| 573 |
</tr> |
| 574 |
<tr> |
| 575 |
<td class="parameter_name"><p>block_device</p></td> |
| 576 |
<td class="parameter_description"><p>The block device.</p></td> |
| 577 |
<td class="parameter_annotations"> </td> |
| 578 |
</tr> |
| 579 |
<tr> |
| 580 |
<td class="parameter_name"><p>out_uid</p></td> |
| 581 |
<td class="parameter_description"><p>Return location for the user id who mounted the device or <code class="literal">NULL</code>.</p></td> |
| 582 |
<td class="parameter_annotations"> </td> |
| 583 |
</tr> |
| 584 |
<tr> |
| 585 |
<td class="parameter_name"><p>out_fstab_mount</p></td> |
| 586 |
<td class="parameter_description"><p>Return location for whether the device was a fstab mount or <code class="literal">NULL</code>.</p></td> |
| 587 |
<td class="parameter_annotations"> </td> |
| 588 |
</tr> |
| 589 |
</tbody> |
| 590 |
</table></div> |
| 591 |
</div> |
| 592 |
<div class="refsect3"> |
| 593 |
<a name="udisks-state-find-mounted-fs.returns"></a><h4>Returns</h4> |
| 594 |
<p> The mount point for <em class="parameter"><code>block_device</code></em> |
| 595 |
or <code class="literal">NULL</code> if not found.</p> |
| 596 |
</div> |
| 597 |
</div> |
| 598 |
<hr> |
| 599 |
<div class="refsect2"> |
| 600 |
<a name="udisks-state-add-unlocked-crypto-dev"></a><h3>udisks_state_add_unlocked_crypto_dev ()</h3> |
| 601 |
<pre class="programlisting"><span class="returnvalue">void</span> |
| 602 |
udisks_state_add_unlocked_crypto_dev (<em class="parameter"><code><a class="link" href="UDisksState.html" title="UDisksState"><span class="type">UDisksState</span></a> *state</code></em>, |
| 603 |
<em class="parameter"><code><span class="type">dev_t</span> cleartext_device</code></em>, |
| 604 |
<em class="parameter"><code><span class="type">dev_t</span> crypto_device</code></em>, |
| 605 |
<em class="parameter"><code>const <span class="type">gchar</span> *dm_uuid</code></em>, |
| 606 |
<em class="parameter"><code><span class="type">uid_t</span> uid</code></em>);</pre> |
| 607 |
<p>Adds a new entry to the |
| 608 |
<code class="filename">/run/udisks2/unlocked-crypto-dev</code> file.</p> |
| 609 |
<div class="refsect3"> |
| 610 |
<a name="udisks-state-add-unlocked-crypto-dev.parameters"></a><h4>Parameters</h4> |
| 611 |
<div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| 612 |
<colgroup> |
| 613 |
<col width="150px" class="parameters_name"> |
| 614 |
<col class="parameters_description"> |
| 615 |
<col width="200px" class="parameters_annotations"> |
| 616 |
</colgroup> |
| 617 |
<tbody> |
| 618 |
<tr> |
| 619 |
<td class="parameter_name"><p>state</p></td> |
| 620 |
<td class="parameter_description"><p>A <a class="link" href="UDisksState.html" title="UDisksState"><span class="type">UDisksState</span></a>.</p></td> |
| 621 |
<td class="parameter_annotations"> </td> |
| 622 |
</tr> |
| 623 |
<tr> |
| 624 |
<td class="parameter_name"><p>cleartext_device</p></td> |
| 625 |
<td class="parameter_description"><p>The clear-text device.</p></td> |
| 626 |
<td class="parameter_annotations"> </td> |
| 627 |
</tr> |
| 628 |
<tr> |
| 629 |
<td class="parameter_name"><p>crypto_device</p></td> |
| 630 |
<td class="parameter_description"><p>The crypto device.</p></td> |
| 631 |
<td class="parameter_annotations"> </td> |
| 632 |
</tr> |
| 633 |
<tr> |
| 634 |
<td class="parameter_name"><p>dm_uuid</p></td> |
| 635 |
<td class="parameter_description"><p>The UUID of the unlocked dm device.</p></td> |
| 636 |
<td class="parameter_annotations"> </td> |
| 637 |
</tr> |
| 638 |
<tr> |
| 639 |
<td class="parameter_name"><p>uid</p></td> |
| 640 |
<td class="parameter_description"><p>The user id of the process requesting the device to be unlocked.</p></td> |
| 641 |
<td class="parameter_annotations"> </td> |
| 642 |
</tr> |
| 643 |
</tbody> |
| 644 |
</table></div> |
| 645 |
</div> |
| 646 |
</div> |
| 647 |
<hr> |
| 648 |
<div class="refsect2"> |
| 649 |
<a name="udisks-state-find-unlocked-crypto-dev"></a><h3>udisks_state_find_unlocked_crypto_dev ()</h3> |
| 650 |
<pre class="programlisting"><span class="returnvalue">dev_t</span> |
| 651 |
udisks_state_find_unlocked_crypto_dev (<em class="parameter"><code><a class="link" href="UDisksState.html" title="UDisksState"><span class="type">UDisksState</span></a> *state</code></em>, |
| 652 |
<em class="parameter"><code><span class="type">dev_t</span> crypto_device</code></em>, |
| 653 |
<em class="parameter"><code><span class="type">uid_t</span> *out_uid</code></em>);</pre> |
| 654 |
<p>Gets the clear-text device for <em class="parameter"><code>crypto_device</code></em> |
| 655 |
, if it exists in the |
| 656 |
<code class="filename">/run/udisks2/unlocked-crypto-dev</code> file.</p> |
| 657 |
<div class="refsect3"> |
| 658 |
<a name="udisks-state-find-unlocked-crypto-dev.parameters"></a><h4>Parameters</h4> |
| 659 |
<div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| 660 |
<colgroup> |
| 661 |
<col width="150px" class="parameters_name"> |
| 662 |
<col class="parameters_description"> |
| 663 |
<col width="200px" class="parameters_annotations"> |
| 664 |
</colgroup> |
| 665 |
<tbody> |
| 666 |
<tr> |
| 667 |
<td class="parameter_name"><p>state</p></td> |
| 668 |
<td class="parameter_description"><p>A <a class="link" href="UDisksState.html" title="UDisksState"><span class="type">UDisksState</span></a>.</p></td> |
| 669 |
<td class="parameter_annotations"> </td> |
| 670 |
</tr> |
| 671 |
<tr> |
| 672 |
<td class="parameter_name"><p>crypto_device</p></td> |
| 673 |
<td class="parameter_description"><p>The block device.</p></td> |
| 674 |
<td class="parameter_annotations"> </td> |
| 675 |
</tr> |
| 676 |
<tr> |
| 677 |
<td class="parameter_name"><p>out_uid</p></td> |
| 678 |
<td class="parameter_description"><p>Return location for the user id who mounted the device or <code class="literal">NULL</code>.</p></td> |
| 679 |
<td class="parameter_annotations"> </td> |
| 680 |
</tr> |
| 681 |
</tbody> |
| 682 |
</table></div> |
| 683 |
</div> |
| 684 |
<div class="refsect3"> |
| 685 |
<a name="udisks-state-find-unlocked-crypto-dev.returns"></a><h4>Returns</h4> |
| 686 |
<p> The cleartext device for <em class="parameter"><code>crypto_device</code></em> |
| 687 |
or 0 if not found.</p> |
| 688 |
</div> |
| 689 |
</div> |
| 690 |
<hr> |
| 691 |
<div class="refsect2"> |
| 692 |
<a name="udisks-state-add-loop"></a><h3>udisks_state_add_loop ()</h3> |
| 693 |
<pre class="programlisting"><span class="returnvalue">void</span> |
| 694 |
udisks_state_add_loop (<em class="parameter"><code><a class="link" href="UDisksState.html" title="UDisksState"><span class="type">UDisksState</span></a> *state</code></em>, |
| 695 |
<em class="parameter"><code>const <span class="type">gchar</span> *device_file</code></em>, |
| 696 |
<em class="parameter"><code>const <span class="type">gchar</span> *backing_file</code></em>, |
| 697 |
<em class="parameter"><code><span class="type">dev_t</span> backing_file_device</code></em>, |
| 698 |
<em class="parameter"><code><span class="type">uid_t</span> uid</code></em>);</pre> |
| 699 |
<p>Adds a new entry to the <code class="filename">/run/udisks2/loop</code> |
| 700 |
file.</p> |
| 701 |
<div class="refsect3"> |
| 702 |
<a name="udisks-state-add-loop.parameters"></a><h4>Parameters</h4> |
| 703 |
<div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| 704 |
<colgroup> |
| 705 |
<col width="150px" class="parameters_name"> |
| 706 |
<col class="parameters_description"> |
| 707 |
<col width="200px" class="parameters_annotations"> |
| 708 |
</colgroup> |
| 709 |
<tbody> |
| 710 |
<tr> |
| 711 |
<td class="parameter_name"><p>state</p></td> |
| 712 |
<td class="parameter_description"><p>A <a class="link" href="UDisksState.html" title="UDisksState"><span class="type">UDisksState</span></a>.</p></td> |
| 713 |
<td class="parameter_annotations"> </td> |
| 714 |
</tr> |
| 715 |
<tr> |
| 716 |
<td class="parameter_name"><p>device_file</p></td> |
| 717 |
<td class="parameter_description"><p>The loop device file.</p></td> |
| 718 |
<td class="parameter_annotations"> </td> |
| 719 |
</tr> |
| 720 |
<tr> |
| 721 |
<td class="parameter_name"><p>backing_file</p></td> |
| 722 |
<td class="parameter_description"><p>The backing file.</p></td> |
| 723 |
<td class="parameter_annotations"> </td> |
| 724 |
</tr> |
| 725 |
<tr> |
| 726 |
<td class="parameter_name"><p>backing_file_device</p></td> |
| 727 |
<td class="parameter_description"><p>The <span class="type">dev_t</span> of the backing file or 0 if unknown.</p></td> |
| 728 |
<td class="parameter_annotations"> </td> |
| 729 |
</tr> |
| 730 |
<tr> |
| 731 |
<td class="parameter_name"><p>uid</p></td> |
| 732 |
<td class="parameter_description"><p>The user id of the process requesting the loop device.</p></td> |
| 733 |
<td class="parameter_annotations"> </td> |
| 734 |
</tr> |
| 735 |
</tbody> |
| 736 |
</table></div> |
| 737 |
</div> |
| 738 |
</div> |
| 739 |
<hr> |
| 740 |
<div class="refsect2"> |
| 741 |
<a name="udisks-state-has-loop"></a><h3>udisks_state_has_loop ()</h3> |
| 742 |
<pre class="programlisting"><span class="returnvalue">gboolean</span> |
| 743 |
udisks_state_has_loop (<em class="parameter"><code><a class="link" href="UDisksState.html" title="UDisksState"><span class="type">UDisksState</span></a> *state</code></em>, |
| 744 |
<em class="parameter"><code>const <span class="type">gchar</span> *device_file</code></em>, |
| 745 |
<em class="parameter"><code><span class="type">uid_t</span> *out_uid</code></em>);</pre> |
| 746 |
<p>Checks if <em class="parameter"><code>device_file</code></em> |
| 747 |
is set up via udisks.</p> |
| 748 |
<div class="refsect3"> |
| 749 |
<a name="udisks-state-has-loop.parameters"></a><h4>Parameters</h4> |
| 750 |
<div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| 751 |
<colgroup> |
| 752 |
<col width="150px" class="parameters_name"> |
| 753 |
<col class="parameters_description"> |
| 754 |
<col width="200px" class="parameters_annotations"> |
| 755 |
</colgroup> |
| 756 |
<tbody> |
| 757 |
<tr> |
| 758 |
<td class="parameter_name"><p>state</p></td> |
| 759 |
<td class="parameter_description"><p>A <a class="link" href="UDisksState.html" title="UDisksState"><span class="type">UDisksState</span></a></p></td> |
| 760 |
<td class="parameter_annotations"> </td> |
| 761 |
</tr> |
| 762 |
<tr> |
| 763 |
<td class="parameter_name"><p>device_file</p></td> |
| 764 |
<td class="parameter_description"><p>A loop device file.</p></td> |
| 765 |
<td class="parameter_annotations"> </td> |
| 766 |
</tr> |
| 767 |
<tr> |
| 768 |
<td class="parameter_name"><p>out_uid</p></td> |
| 769 |
<td class="parameter_description"><p>Return location for the user id who setup the loop device or <code class="literal">NULL</code>.</p></td> |
| 770 |
<td class="parameter_annotations"> </td> |
| 771 |
</tr> |
| 772 |
</tbody> |
| 773 |
</table></div> |
| 774 |
</div> |
| 775 |
<div class="refsect3"> |
| 776 |
<a name="udisks-state-has-loop.returns"></a><h4>Returns</h4> |
| 777 |
<p> <code class="literal">TRUE</code> if set up via udisks, otherwise <code class="literal">FALSE</code> or if <em class="parameter"><code>error</code></em> |
| 778 |
is set.</p> |
| 779 |
</div> |
| 780 |
</div> |
| 781 |
<hr> |
| 782 |
<div class="refsect2"> |
| 783 |
<a name="udisks-state-add-mdraid"></a><h3>udisks_state_add_mdraid ()</h3> |
| 784 |
<pre class="programlisting"><span class="returnvalue">void</span> |
| 785 |
udisks_state_add_mdraid (<em class="parameter"><code><a class="link" href="UDisksState.html" title="UDisksState"><span class="type">UDisksState</span></a> *state</code></em>, |
| 786 |
<em class="parameter"><code><span class="type">dev_t</span> raid_device</code></em>, |
| 787 |
<em class="parameter"><code><span class="type">uid_t</span> uid</code></em>);</pre> |
| 788 |
<p>Adds a new entry to the <code class="filename">/run/udisks2/mdraid</code> |
| 789 |
file.</p> |
| 790 |
<div class="refsect3"> |
| 791 |
<a name="udisks-state-add-mdraid.parameters"></a><h4>Parameters</h4> |
| 792 |
<div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| 793 |
<colgroup> |
| 794 |
<col width="150px" class="parameters_name"> |
| 795 |
<col class="parameters_description"> |
| 796 |
<col width="200px" class="parameters_annotations"> |
| 797 |
</colgroup> |
| 798 |
<tbody> |
| 799 |
<tr> |
| 800 |
<td class="parameter_name"><p>state</p></td> |
| 801 |
<td class="parameter_description"><p>A <a class="link" href="UDisksState.html" title="UDisksState"><span class="type">UDisksState</span></a>.</p></td> |
| 802 |
<td class="parameter_annotations"> </td> |
| 803 |
</tr> |
| 804 |
<tr> |
| 805 |
<td class="parameter_name"><p>raid_device</p></td> |
| 806 |
<td class="parameter_description"><p>The <span class="type">dev_t</span> for the RAID device.</p></td> |
| 807 |
<td class="parameter_annotations"> </td> |
| 808 |
</tr> |
| 809 |
<tr> |
| 810 |
<td class="parameter_name"><p>uid</p></td> |
| 811 |
<td class="parameter_description"><p>The user id of the process requesting the loop device.</p></td> |
| 812 |
<td class="parameter_annotations"> </td> |
| 813 |
</tr> |
| 814 |
</tbody> |
| 815 |
</table></div> |
| 816 |
</div> |
| 817 |
</div> |
| 818 |
<hr> |
| 819 |
<div class="refsect2"> |
| 820 |
<a name="udisks-state-has-mdraid"></a><h3>udisks_state_has_mdraid ()</h3> |
| 821 |
<pre class="programlisting"><span class="returnvalue">gboolean</span> |
| 822 |
udisks_state_has_mdraid (<em class="parameter"><code><a class="link" href="UDisksState.html" title="UDisksState"><span class="type">UDisksState</span></a> *state</code></em>, |
| 823 |
<em class="parameter"><code><span class="type">dev_t</span> raid_device</code></em>, |
| 824 |
<em class="parameter"><code><span class="type">uid_t</span> *out_uid</code></em>);</pre> |
| 825 |
<p>Checks if <em class="parameter"><code>raid_device</code></em> |
| 826 |
is set up via udisks.</p> |
| 827 |
<div class="refsect3"> |
| 828 |
<a name="udisks-state-has-mdraid.parameters"></a><h4>Parameters</h4> |
| 829 |
<div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| 830 |
<colgroup> |
| 831 |
<col width="150px" class="parameters_name"> |
| 832 |
<col class="parameters_description"> |
| 833 |
<col width="200px" class="parameters_annotations"> |
| 834 |
</colgroup> |
| 835 |
<tbody> |
| 836 |
<tr> |
| 837 |
<td class="parameter_name"><p>state</p></td> |
| 838 |
<td class="parameter_description"><p>A <a class="link" href="UDisksState.html" title="UDisksState"><span class="type">UDisksState</span></a></p></td> |
| 839 |
<td class="parameter_annotations"> </td> |
| 840 |
</tr> |
| 841 |
<tr> |
| 842 |
<td class="parameter_name"><p>raid_device</p></td> |
| 843 |
<td class="parameter_description"><p>A <span class="type">dev_t</span> for the RAID device.</p></td> |
| 844 |
<td class="parameter_annotations"> </td> |
| 845 |
</tr> |
| 846 |
<tr> |
| 847 |
<td class="parameter_name"><p>out_uid</p></td> |
| 848 |
<td class="parameter_description"><p>Return location for the user id who setup the loop device or <code class="literal">NULL</code>.</p></td> |
| 849 |
<td class="parameter_annotations"> </td> |
| 850 |
</tr> |
| 851 |
</tbody> |
| 852 |
</table></div> |
| 853 |
</div> |
| 854 |
<div class="refsect3"> |
| 855 |
<a name="udisks-state-has-mdraid.returns"></a><h4>Returns</h4> |
| 856 |
<p> <code class="literal">TRUE</code> if set up via udisks, otherwise <code class="literal">FALSE</code> or if <em class="parameter"><code>error</code></em> |
| 857 |
is set.</p> |
| 858 |
</div> |
| 859 |
</div> |
| 860 |
<hr> |
| 861 |
<div class="refsect2"> |
| 862 |
<a name="udisks-state-add-module"></a><h3>udisks_state_add_module ()</h3> |
| 863 |
<pre class="programlisting"><span class="returnvalue">void</span> |
| 864 |
udisks_state_add_module (<em class="parameter"><code><a class="link" href="UDisksState.html" title="UDisksState"><span class="type">UDisksState</span></a> *state</code></em>, |
| 865 |
<em class="parameter"><code>const <span class="type">gchar</span> *module_name</code></em>);</pre> |
| 866 |
<p>Adds a new entry to the <code class="filename">/run/udisks2/modules</code> |
| 867 |
file. The <em class="parameter"><code>module_name</code></em> |
| 868 |
string should be the one returned by |
| 869 |
<a class="link" href="udisks2-UDisksModule.html#udisks-module-get-name" title="udisks_module_get_name ()"><code class="function">udisks_module_get_name()</code></a>.</p> |
| 870 |
<div class="refsect3"> |
| 871 |
<a name="udisks-state-add-module.parameters"></a><h4>Parameters</h4> |
| 872 |
<div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| 873 |
<colgroup> |
| 874 |
<col width="150px" class="parameters_name"> |
| 875 |
<col class="parameters_description"> |
| 876 |
<col width="200px" class="parameters_annotations"> |
| 877 |
</colgroup> |
| 878 |
<tbody> |
| 879 |
<tr> |
| 880 |
<td class="parameter_name"><p>state</p></td> |
| 881 |
<td class="parameter_description"><p>A <a class="link" href="UDisksState.html" title="UDisksState"><span class="type">UDisksState</span></a>.</p></td> |
| 882 |
<td class="parameter_annotations"> </td> |
| 883 |
</tr> |
| 884 |
<tr> |
| 885 |
<td class="parameter_name"><p>module_name</p></td> |
| 886 |
<td class="parameter_description"><p>The <a class="link" href="udisks2-UDisksModule.html#UDisksModule" title="struct UDisksModule"><span class="type">UDisksModule</span></a> name.</p></td> |
| 887 |
<td class="parameter_annotations"> </td> |
| 888 |
</tr> |
| 889 |
</tbody> |
| 890 |
</table></div> |
| 891 |
</div> |
| 892 |
</div> |
| 893 |
<hr> |
| 894 |
<div class="refsect2"> |
| 895 |
<a name="udisks-state-clear-modules"></a><h3>udisks_state_clear_modules ()</h3> |
| 896 |
<pre class="programlisting"><span class="returnvalue">void</span> |
| 897 |
udisks_state_clear_modules (<em class="parameter"><code><a class="link" href="UDisksState.html" title="UDisksState"><span class="type">UDisksState</span></a> *state</code></em>);</pre> |
| 898 |
<p>Removes all entries from the <code class="filename">/run/udisks2/modules</code> |
| 899 |
state file.</p> |
| 900 |
<div class="refsect3"> |
| 901 |
<a name="udisks-state-clear-modules.parameters"></a><h4>Parameters</h4> |
| 902 |
<div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| 903 |
<colgroup> |
| 904 |
<col width="150px" class="parameters_name"> |
| 905 |
<col class="parameters_description"> |
| 906 |
<col width="200px" class="parameters_annotations"> |
| 907 |
</colgroup> |
| 908 |
<tbody><tr> |
| 909 |
<td class="parameter_name"><p>state</p></td> |
| 910 |
<td class="parameter_description"><p>A <a class="link" href="UDisksState.html" title="UDisksState"><span class="type">UDisksState</span></a>.</p></td> |
| 911 |
<td class="parameter_annotations"> </td> |
| 912 |
</tr></tbody> |
| 913 |
</table></div> |
| 914 |
</div> |
| 915 |
</div> |
| 916 |
<hr> |
| 917 |
<div class="refsect2"> |
| 918 |
<a name="udisks-state-get-modules"></a><h3>udisks_state_get_modules ()</h3> |
| 919 |
<pre class="programlisting"><span class="returnvalue">gchar</span> ** |
| 920 |
udisks_state_get_modules (<em class="parameter"><code><a class="link" href="UDisksState.html" title="UDisksState"><span class="type">UDisksState</span></a> *state</code></em>);</pre> |
| 921 |
<p>Retrieves list of modules recorded in the <code class="filename">/run/udisks2/modules</code> |
| 922 |
state file.</p> |
| 923 |
<div class="refsect3"> |
| 924 |
<a name="udisks-state-get-modules.parameters"></a><h4>Parameters</h4> |
| 925 |
<div class="informaltable"><table class="informaltable" width="100%" border="0"> |
| 926 |
<colgroup> |
| 927 |
<col width="150px" class="parameters_name"> |
| 928 |
<col class="parameters_description"> |
| 929 |
<col width="200px" class="parameters_annotations"> |
| 930 |
</colgroup> |
| 931 |
<tbody><tr> |
| 932 |
<td class="parameter_name"><p>state</p></td> |
| 933 |
<td class="parameter_description"><p>A <a class="link" href="UDisksState.html" title="UDisksState"><span class="type">UDisksState</span></a></p></td> |
| 934 |
<td class="parameter_annotations"> </td> |
| 935 |
</tr></tbody> |
| 936 |
</table></div> |
| 937 |
</div> |
| 938 |
<div class="refsect3"> |
| 939 |
<a name="udisks-state-get-modules.returns"></a><h4>Returns</h4> |
| 940 |
<p>A list of module names. Free with <code class="function">g_strfreev()</code>. </p> |
| 941 |
<p><span class="annotation">[<acronym title="The caller owns the data, and is responsible for free it."><span class="acronym">transfer full</span></acronym>][<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> zero-terminated=1]</span></p> |
| 942 |
</div> |
| 943 |
</div> |
| 944 |
</div> |
| 945 |
<div class="refsect1"> |
| 946 |
<a name="UDisksState.other_details"></a><h2>Types and Values</h2> |
| 947 |
<div class="refsect2"> |
| 948 |
<a name="UDisksState-struct"></a><h3>UDisksState</h3> |
| 949 |
<pre class="programlisting">typedef struct _UDisksState UDisksState;</pre> |
| 950 |
<p>The <a class="link" href="UDisksState.html" title="UDisksState"><span class="type">UDisksState</span></a> structure contains only private data and should |
| 951 |
only be accessed using the provided API.</p> |
| 952 |
</div> |
| 953 |
</div> |
| 954 |
<div class="refsect1"> |
| 955 |
<a name="UDisksState.property-details"></a><h2>Property Details</h2> |
| 956 |
<div class="refsect2"> |
| 957 |
<a name="UDisksState--daemon"></a><h3>The <code class="literal">“daemon”</code> property</h3> |
| 958 |
<pre class="programlisting"> “daemon” <a class="link" href="UDisksDaemon.html" title="UDisksDaemon"><span class="type">UDisksDaemon</span></a> *</pre> |
| 959 |
<p>The <a class="link" href="UDisksDaemon.html" title="UDisksDaemon"><span class="type">UDisksDaemon</span></a> object.</p> |
| 960 |
<p>Owner: UDisksState</p> |
| 961 |
<p>Flags: Read / Write / Construct Only</p> |
| 962 |
</div> |
| 963 |
</div> |
| 964 |
</div> |
| 965 |
<div class="footer"> |
| 966 |
<hr>Generated by GTK-Doc V1.35.1</div> |
| 967 |
</body> |
| 968 |
</html> |