/usr/share/doc/e2fslibs/html-info/libext2fs.html is in e2fslibs-dev 1.42.9-3ubuntu1.2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Created by GNU Texinfo 5.2, http://www.gnu.org/software/texinfo/ -->
<head>
<title>The EXT2FS Library (version 1.42.9)</title>
<meta name="description" content="The EXT2FS Library (version 1.42.9)">
<meta name="keywords" content="The EXT2FS Library (version 1.42.9)">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="#Top" rel="start" title="Top">
<link href="#Concept-Index" rel="index" title="Concept Index">
<link href="#SEC_Contents" rel="contents" title="Table of Contents">
<link href="dir.html#Top" rel="up" title="(dir)">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.indentedblock {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
div.smalllisp {margin-left: 3.2em}
kbd {font-style:oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nocodebreak {white-space:nowrap}
span.nolinebreak {white-space:nowrap}
span.roman {font-family:serif; font-weight:normal}
span.sansserif {font-family:sans-serif; font-weight:normal}
ul.no-bullet {list-style: none}
-->
</style>
</head>
<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
<h1 class="settitle" align="center">The EXT2FS Library (version 1.42.9)</h1>
<a name="Top"></a>
<div class="header">
<p>
Next: <a href="#Introduction-to-the-EXT2FS-Library" accesskey="n" rel="next">Introduction to the EXT2FS Library</a>, Previous: <a href="dir.html#Top" accesskey="p" rel="prev">(dir)</a>, Up: <a href="dir.html#Top" accesskey="u" rel="up">(dir)</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="The-EXT2FS-Library"></a>
<h1 class="top">The EXT2FS Library</h1>
<p>This manual documents the EXT2FS Library, version 1.42.9.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top">• <a href="#Introduction-to-the-EXT2FS-Library" accesskey="1">Introduction to the EXT2FS Library</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#EXT2FS-Library-Functions" accesskey="2">EXT2FS Library Functions</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Concept-Index" accesskey="3">Concept Index</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Function-Index" accesskey="4">Function Index</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
</table>
<hr>
<a name="Introduction-to-the-EXT2FS-Library"></a>
<div class="header">
<p>
Next: <a href="#EXT2FS-Library-Functions" accesskey="n" rel="next">EXT2FS Library Functions</a>, Previous: <a href="#Top" accesskey="p" rel="prev">Top</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Introduction-to-the-EXT2FS-Library-1"></a>
<h2 class="chapter">1 Introduction to the EXT2FS Library</h2>
<p>The EXT2FS library is designed to allow user-level programs to
manipulate an ext2 filesystem.
</p>
<hr>
<a name="EXT2FS-Library-Functions"></a>
<div class="header">
<p>
Next: <a href="#Concept-Index" accesskey="n" rel="next">Concept Index</a>, Previous: <a href="#Introduction-to-the-EXT2FS-Library" accesskey="p" rel="prev">Introduction to the EXT2FS Library</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="EXT2FS-Library-Functions-1"></a>
<h2 class="chapter">2 EXT2FS Library Functions</h2>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top">• <a href="#Filesystem_002dlevel-functions" accesskey="1">Filesystem-level functions</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#File-I_002fO-Functions" accesskey="2">File I/O Functions</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Inode-Functions" accesskey="3">Inode Functions</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Directory-functions" accesskey="4">Directory functions</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Bitmap-Functions" accesskey="5">Bitmap Functions</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#EXT2-data-abstractions" accesskey="6">EXT2 data abstractions</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Byte_002dswapping-functions" accesskey="7">Byte-swapping functions</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Other-functions" accesskey="8">Other functions</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
</table>
<hr>
<a name="Filesystem_002dlevel-functions"></a>
<div class="header">
<p>
Next: <a href="#File-I_002fO-Functions" accesskey="n" rel="next">File I/O Functions</a>, Previous: <a href="#EXT2FS-Library-Functions" accesskey="p" rel="prev">EXT2FS Library Functions</a>, Up: <a href="#EXT2FS-Library-Functions" accesskey="u" rel="up">EXT2FS Library Functions</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Filesystem_002dlevel-functions-1"></a>
<h3 class="section">2.1 Filesystem-level functions</h3>
<p>The following functions operate on a filesystem handle. Most EXT2FS
Library functions require a filesystem handle as their first argument.
There are two functions which create a filesystem handle,
<code>ext2fs_open</code> and <code>ext2fs_initialize</code>.
</p>
<p>The filesystem can also be closed using <code>ext2fs_close</code>, and any
changes to the superblock and group descripts can be written out to disk
using <code>ext2fs_flush</code>.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top">• <a href="#Opening-an-ext2-filesystem" accesskey="1">Opening an ext2 filesystem</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Closing-and-flushing-out-changes" accesskey="2">Closing and flushing out changes</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Initializing-a-filesystem" accesskey="3">Initializing a filesystem</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Filesystem-flag-functions" accesskey="4">Filesystem flag functions</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
</table>
<hr>
<a name="Opening-an-ext2-filesystem"></a>
<div class="header">
<p>
Next: <a href="#Closing-and-flushing-out-changes" accesskey="n" rel="next">Closing and flushing out changes</a>, Previous: <a href="#Filesystem_002dlevel-functions" accesskey="p" rel="prev">Filesystem-level functions</a>, Up: <a href="#Filesystem_002dlevel-functions" accesskey="u" rel="up">Filesystem-level functions</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Opening-an-ext2-filesystem-1"></a>
<h4 class="subsection">2.1.1 Opening an ext2 filesystem</h4>
<p>Most libext2fs functions take a filesystem handle of type
<code>ext2_filsys</code>. A filesystem handle is created either by opening
an existing function using <code>ext2fs_open</code>, or by initializing a new
filesystem using <code>ext2fs_initialize</code>.
</p>
<dl>
<dt><a name="index-ext2fs_005fopen"></a>Function: <em>errcode_t</em> <strong>ext2fs_open</strong> <em>(const char *<var>name</var>, int <var>flags</var>, int <var>superblock</var>, int <var>block_size</var>, io_manager <var>manager</var>, ext2_filsys *<var>ret_fs</var>)</em></dt>
<dd>
<p>Opens a filesystem named <var>name</var>, using the the io_manager
<var>manager</var> to define the input/output routines needed to read and
write the filesystem. In the case of the <code>unix_io</code> io_manager,
<var>name</var> is interpreted as the Unix filename of the filesystem image.
This is often a device file, such as <samp>/dev/hda1</samp>.
</p>
<p>The <var>superblock</var> parameter specifies the block number of the
superblock which should be used when opening the filesystem.
If <var>superblock</var> is zero, <code>ext2fs_open</code> will use the primary
superblock located at offset 1024 bytes from the start of the filesystem
image.
</p>
<p>The <var>block_size</var> parameter specifies the block size used by the
filesystem. Normally this is determined automatically from the
filesystem uperblock. If <var>block_size</var> is non-zero, it must match
the block size found in the superblock, or the error
<code>EXT2_ET_UNEXPECTED_BLOCK_SIZE</code> will be returned. The
<var>block_size</var> parameter is also used to help fund the superblock when
<var>superblock</var> is non-zero.
</p>
<p>The <var>flags</var> argument contains a bitmask of flags which control how
the filesystem open should be handled.
</p>
<dl compact="compact">
<dt><code>EXT2_FLAG_RW</code></dt>
<dd><p>Open the filesystem for reading and writing. Without this flag, the
filesystem is opened for reading only.
</p>
</dd>
<dt><code>EXT2_FLAG_FORCE</code></dt>
<dd><p>Open the filesystem regardless of the feature sets listed in the
superblock.
</p>
</dd>
</dl>
</dd></dl>
<hr>
<a name="Closing-and-flushing-out-changes"></a>
<div class="header">
<p>
Next: <a href="#Initializing-a-filesystem" accesskey="n" rel="next">Initializing a filesystem</a>, Previous: <a href="#Opening-an-ext2-filesystem" accesskey="p" rel="prev">Opening an ext2 filesystem</a>, Up: <a href="#Filesystem_002dlevel-functions" accesskey="u" rel="up">Filesystem-level functions</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Closing-and-flushing-out-changes-1"></a>
<h4 class="subsection">2.1.2 Closing and flushing out changes</h4>
<dl>
<dt><a name="index-ext2fs_005fflush"></a>Function: <em>errcode_t</em> <strong>ext2fs_flush</strong> <em>(ext2_filsys <var>fs</var>)</em></dt>
<dd>
<p>Write any changes to the high-level filesystem data structures in the
<var>fs</var> filesystem. The following data structures will be written out:
</p>
<ul>
<li> The filesystem superblock
</li><li> The filesystem group descriptors
</li><li> The filesystem bitmaps, if read in via <code>ext2fs_read_bitmaps</code>.
</li></ul>
</dd></dl>
<dl>
<dt><a name="index-ext2fs_005ffree"></a>Function: <em>void</em> <strong>ext2fs_free</strong> <em>(ext2_filsys <var>fs</var>)</em></dt>
<dd>
<p>Close the io_manager abstraction for <var>fs</var> and release all memory
associated with the filesystem handle.
</p></dd></dl>
<dl>
<dt><a name="index-ext2fs_005fclose"></a>Function: <em>errcode_t</em> <strong>ext2fs_close</strong> <em>(ext2_filsys <var>fs</var>)</em></dt>
<dd>
<p>Flush out any changes to the high-level filesystem data structures using
<code>ext2fs_flush</code> if the filesystem is marked dirty; then close and
free the filesystem using <code>ext2fs_free</code>.
</p>
</dd></dl>
<hr>
<a name="Initializing-a-filesystem"></a>
<div class="header">
<p>
Next: <a href="#Filesystem-flag-functions" accesskey="n" rel="next">Filesystem flag functions</a>, Previous: <a href="#Closing-and-flushing-out-changes" accesskey="p" rel="prev">Closing and flushing out changes</a>, Up: <a href="#Filesystem_002dlevel-functions" accesskey="u" rel="up">Filesystem-level functions</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Initializing-a-filesystem-1"></a>
<h4 class="subsection">2.1.3 Initializing a filesystem</h4>
<p>An ext2 filesystem is initializing by the <code>mke2fs</code> program. The
two functions described here, <code>ext2fs_initialize</code> and
<code>ext2fs_allocate_tables</code> do much of the initial work for setting up
a filesystem. However, they don’t do the whole job. <code>mke2fs</code>
calls <code>ext2fs_initialize</code> to set up the filesystem superblock, and
calls <code>ext2fs_allocate_tables</code> to allocate space for the inode
table, and the inode and block bitmaps. In addition, <code>mke2fs</code> must
also initialize the inode tables by clearing them with zeros, create the
root and lost+found directories, and reserve the reserved inodes.
</p>
<dl>
<dt><a name="index-ext2fs_005finitialize"></a>Function: <em>errcode_t</em> <strong>ext2fs_initialize</strong> <em>(const char *<var>name</var>, int <var>flags</var>, struct ext2_super_block *<var>param</var>, io_manager <var>manager</var>, ext2_filsys *<var>ret_fs</var>)</em></dt>
<dd>
<p>This function is used by the <code>mke2fs</code> program to initialize a
filesystem. The <code>ext2fs_initialize</code> function creates a filesystem
handle which is returned in <var>ret_fs</var> that has been properly setup
for a filesystem to be located in <var>name</var>, using the io_manager
<var>manager</var>. The prototype superblock in <var>param</var> is used to
supply parameters such as the number of blocks in the filesystem, the
block size, etc.
</p>
<p>The <code>ext2fs_initialize</code> function does not actually do any I/O; that
will be done when the application program calls <code>ext2fs_close</code> or
<code>ext2fs_flush</code>. Also, this function only initializes the
superblock and group descriptor structures. It does not create the
inode table or the root directory. This must be done by the calling
application, such as <code>mke2fs</code>.
</p>
<p>The following values may be set in the <var>param</var> prototype superblock;
if a value of 0 is found in a field, <code>ext2fs_initialize</code> will use a
default value. The calling application should zero out the prototype
entire superblock, and then fill in any appropriate values.
</p>
<dl compact="compact">
<dt><code>s_blocks_count</code></dt>
<dd><p>The number of blocks in the filesystem. This parameter is mandatory and
must be set by the calling application.
</p>
</dd>
<dt><code>s_inodes_count</code></dt>
<dd><p>The number of inodes in the filesystem. The
default value is determined by calculating the size of the filesystem,
and creating one inode for every 4096 bytes.
</p>
</dd>
<dt><code>s_r_blocks_count</code></dt>
<dd><p>The number of blocks which should be reserved for the superuser. The
default value is zero blocks.
</p>
</dd>
<dt><code>s_log_block_size</code></dt>
<dd><p>The blocksize of the filesystem. Valid values are 0 (1024 bytes), 1
(2048 bytes), or 2 (4096 bytes). The default blocksize is 1024 bytes.
</p>
</dd>
<dt><code>s_log_frag_size</code></dt>
<dd><p>The size of fragments. The ext2 filesystem does not support fragments
(and may never support fragments). Currently this field must be the
same as <code>s_log_block_size</code>.
</p>
</dd>
<dt><code>s_first_data_block</code></dt>
<dd><p>The first data block for the filesystem. For filesystem with a
blocksize of 1024 bytes, this value must be at least 1, since the
superblock is located in block number 1. For filesystems with larger
blocksizes, the superblock is still located at an offset of 1024 bytes,
so the superblock is located in block number 0. By default, this value
is set to 1 for filesystems with a block size of 1024 bytes, or 0 for
filesystems with larger blocksizes.
</p>
</dd>
<dt><code>s_max_mnt_count</code></dt>
<dd><p>This field defines the number of times that the filesystem can be
mounted before it should be checked using <code>e2fsck</code>. When
<code>e2fsck</code> is run without the ‘<samp>-f</samp>’ option, <code>e2fsck</code> will
skip the filesystem check if the number of times that the filesystem has
been mounted is less than <code>s_max_mnt_count</code> and if the interval
between the last time a filesystem check was performed and the current
time is less than <code>s_checkinterval</code> (see below). The default value
of <code>s_max_mnt_count</code> is 20.
</p>
</dd>
<dt><code>s_checkinterval</code></dt>
<dd><p>This field defines the minimal interval between filesystem checks. See
the previous entry for a discussion of how this field is used by
<code>e2fsck</code>. The default value of this field is 180 days (six
months).
</p>
</dd>
<dt><code>s_errors</code></dt>
<dd><p>This field defines the behavior which should be used by the kernel of
errors are detected in the filesystem. Possible values include:
</p>
<dl compact="compact">
<dt>‘<samp>EXT2_ERRORS_CONTINUE</samp>’</dt>
<dd><p>Continue execution when errors are detected.
</p>
</dd>
<dt>‘<samp>EXT2_ERRORS_RO</samp>’</dt>
<dd><p>Remount the filesystem read-only.
</p>
</dd>
<dt>‘<samp>EXT2_ERRORS_PANIC</samp>’</dt>
<dd><p>Panic.
</p>
</dd>
</dl>
<p>The default behavior is ‘<samp>EXT2_ERRORS_CONTINUE</samp>’.
</p>
</dd>
</dl>
</dd></dl>
<dl>
<dt><a name="index-ext2fs_005fallocate_005ftables"></a>Function: <em>errcode_t</em> <strong>ext2fs_allocate_tables</strong> <em>(ext2_filsys <var>fs</var>)</em></dt>
<dd><p>Allocate space for the inode table and the block and inode bitmaps. The
inode tables and block and inode bitmaps aren’t actually initialized;
this function just allocates the space for them.
</p></dd></dl>
<hr>
<a name="Filesystem-flag-functions"></a>
<div class="header">
<p>
Previous: <a href="#Initializing-a-filesystem" accesskey="p" rel="prev">Initializing a filesystem</a>, Up: <a href="#Filesystem_002dlevel-functions" accesskey="u" rel="up">Filesystem-level functions</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Filesystem-flag-functions-1"></a>
<h4 class="subsection">2.1.4 Filesystem flag functions</h4>
<p>The filesystem handle has a number of flags which can be manipulated
using the following function. Some of these flags affect how the
libext2fs filesystem behaves; others are provided solely for the
application’s convenience.
</p>
<dl>
<dt><a name="index-ext2fs_005fmark_005fchanged"></a>Function: <em>void</em> <strong>ext2fs_mark_changed</strong> <em>(ext2_filsys <var>fs</var>)</em></dt>
<dt><a name="index-ext2fs_005ftest_005fchanged"></a>Function: <em>int</em> <strong>ext2fs_test_changed</strong> <em>(ext2_filsys <var>fs</var>)</em></dt>
<dd><p>This flag indicates whether or not the filesystem has been changed.
It is not used by the ext2fs library.
</p></dd></dl>
<dl>
<dt><a name="index-ext2fs_005fmark_005fsuper_005fdirty"></a>Function: <em>void</em> <strong>ext2fs_mark_super_dirty</strong> <em>(ext2_filsys <var>fs</var>)</em></dt>
<dd><p>Mark the filesystem <var>fs</var> as being dirty; this will cause
the superblock information to be flushed out when <code>ext2fs_close</code> is
called. <code>ext2fs_mark_super_dirty</code> will also set the filesystem
changed flag. The dirty flag is automatically cleared by
<code>ext2fs_flush</code> when the superblock is written to disk.
</p></dd></dl>
<dl>
<dt><a name="index-ext2fs_005fmark_005fvalid"></a>Function: <em>void</em> <strong>ext2fs_mark_valid</strong> <em>(ext2_filsys <var>fs</var>)</em></dt>
<dt><a name="index-ext2fs_005funmark_005fvalid"></a>Function: <em>void</em> <strong>ext2fs_unmark_valid</strong> <em>(ext2_filsys <var>fs</var>)</em></dt>
<dt><a name="index-ext2fs_005ftest_005fvalid"></a>Function: <em>int</em> <strong>ext2fs_test_valid</strong> <em>(ext2_filsys <var>fs</var>)</em></dt>
<dd><p>This flag indicates whether or not the filesystem is free of errors.
It is not used by libext2fs, and is solely for the application’s
convenience.
</p></dd></dl>
<dl>
<dt><a name="index-ext2fs_005fmark_005fib_005fdirty"></a>Function: <em>void</em> <strong>ext2fs_mark_ib_dirty</strong> <em>(ext2_filsys <var>fs</var>)</em></dt>
<dt><a name="index-ext2fs_005fmark_005fbb_005fdirty"></a>Function: <em>void</em> <strong>ext2fs_mark_bb_dirty</strong> <em>(ext2_filsys <var>fs</var>)</em></dt>
<dt><a name="index-ext2fs_005ftest_005fib_005fdirty"></a>Function: <em>int</em> <strong>ext2fs_test_ib_dirty</strong> <em>(ext2_filsys <var>fs</var>)</em></dt>
<dt><a name="index-ext2fs_005ftest_005fbb_005fdirty"></a>Function: <em>int</em> <strong>ext2fs_test_bb_dirty</strong> <em>(ext2_filsys <var>fs</var>)</em></dt>
<dd><p>These flags indicate whether or not the inode or block bitmaps have been
modified. If the flag is set, it will cause the appropriate bitmap
to be written when the filesystem is closed or flushed.
</p></dd></dl>
<hr>
<a name="File-I_002fO-Functions"></a>
<div class="header">
<p>
Next: <a href="#Inode-Functions" accesskey="n" rel="next">Inode Functions</a>, Previous: <a href="#Filesystem_002dlevel-functions" accesskey="p" rel="prev">Filesystem-level functions</a>, Up: <a href="#EXT2FS-Library-Functions" accesskey="u" rel="up">EXT2FS Library Functions</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="File-I_002fO-Functions-1"></a>
<h3 class="section">2.2 File I/O Functions</h3>
<p>The following functions provide a convenient abstraction to read or
write a file in an filesystem. The interface is similar in spirit to
the Linux/POSIX file I/O system calls.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top">• <a href="#File-handle-manipulation" accesskey="1">File handle manipulation</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Reading-and-writing-data" accesskey="2">Reading and writing data</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Changing-the-file-offset" accesskey="3">Changing the file offset </a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Getting-the-file-size" accesskey="4">Getting the file size</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
</table>
<hr>
<a name="File-handle-manipulation"></a>
<div class="header">
<p>
Next: <a href="#Reading-and-writing-data" accesskey="n" rel="next">Reading and writing data</a>, Previous: <a href="#File-I_002fO-Functions" accesskey="p" rel="prev">File I/O Functions</a>, Up: <a href="#File-I_002fO-Functions" accesskey="u" rel="up">File I/O Functions</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="File-handle-manipulation-1"></a>
<h4 class="subsection">2.2.1 File handle manipulation</h4>
<p>The file handle functions much like a file descriptor in the Linux/POSIX
file I/O system calls. Unlike the Linux/POSIX system calls, files are
opened via inode numbers instead of via pathnames. To resolve a
pathname to an inode number, use the function <code>ext2fs_namei</code> or to
create a new file, use <code>ext2fs_new_inode</code> and <code>ext2fs_link</code>.
</p>
<dl>
<dt><a name="index-ext2fs_005ffile_005fopen2"></a>Function: <em>errcode_t</em> <strong>ext2fs_file_open2</strong> <em>(ext2_filsys <var>fs</var>, ext2_ino_t <var>ino</var>, struct ext2_inode *<var>inode</var>, int <var>flags</var>, ext2_file_t *<var>ret</var>)</em></dt>
<dt><a name="index-ext2fs_005ffile_005fopen"></a>Function: <em>errcode_t</em> <strong>ext2fs_file_open</strong> <em>(ext2_filsys <var>fs</var>, ext2_ino_t <var>ino</var>, int <var>flags</var>, ext2_file_t *<var>ret</var>)</em></dt>
<dd>
<p>Opens a file identified by inode number <var>ino</var> in filesystem <var>fs</var>
and returns a file handle in <var>ret</var>. If an inode structure is
provided in <var>inode</var>, then it is used instead of reading the inode
from the filesystem.
</p>
<p>The <var>flags</var> argument contains a bitmask of flags which control how
the file should be opened.
</p>
<dl compact="compact">
<dt><code>EXT2_FILE_WRITE</code></dt>
<dd><p>Open the file for reading and writing. Without this flag, the file is
opened for writing only.
</p>
</dd>
<dt><code>EXT2_FILE_CREATE</code></dt>
<dd><p>Create the file if it is not already present.
</p>
</dd>
</dl>
</dd></dl>
<dl>
<dt><a name="index-ext2fs_005ffile_005fget_005ffs"></a>Function: <em>ext2_filsys</em> <strong>ext2fs_file_get_fs</strong> <em>(ext2_file_t <var>file</var>)</em></dt>
<dd><p>Return the filesystem handle where the open file <var>file</var> was opened.
</p></dd></dl>
<dl>
<dt><a name="index-ext2fs_005ffile_005fclose"></a>Function: <em>errcode_t</em> <strong>ext2fs_file_close</strong> <em>(ext2_file_t <var>file</var>)</em></dt>
<dd><p>Close the file handle <var>file</var>.
</p></dd></dl>
<dl>
<dt><a name="index-ext2fs_005ffile_005fflush"></a>Function: <em>errcode_t</em> <strong>ext2fs_file_flush</strong> <em>(ext2_file_t <var>file</var>)</em></dt>
<dd><p>Force any data written via <code>ext2fs_file_write</code> to disk.
</p></dd></dl>
<hr>
<a name="Reading-and-writing-data"></a>
<div class="header">
<p>
Next: <a href="#Changing-the-file-offset" accesskey="n" rel="next">Changing the file offset</a>, Previous: <a href="#File-handle-manipulation" accesskey="p" rel="prev">File handle manipulation</a>, Up: <a href="#File-I_002fO-Functions" accesskey="u" rel="up">File I/O Functions</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Reading-and-writing-data-1"></a>
<h4 class="subsection">2.2.2 Reading and writing data</h4>
<dl>
<dt><a name="index-ext2fs_005ffile_005fread"></a>Function: <em>errcode_t</em> <strong>ext2fs_file_read</strong> <em>(ext2_file_t <var>file</var>, void *<var>buf</var>, unsigned int <var>wanted</var>, unsigned int *<var>got</var>)</em></dt>
<dd><p>Read <var>wanted</var> bytes of data from <var>file</var> store it in the buffer
<var>buf</var>. The number of bytes that was actually read is returned
via <var>got</var>.
</p></dd></dl>
<dl>
<dt><a name="index-ext2fs_005ffile_005fwrite"></a>Function: <em>errcode_t</em> <strong>ext2fs_file_write</strong> <em>(ext2_file_t <var>file</var>, const void *<var>buf</var>, unsigned int <var>nbytes</var>, unsigned int *<var>written</var>)</em></dt>
<dd><p>Write <var>wanted</var> bytes of data from the buffer <var>buf</var> to the
current file position of <var>file</var>. The number of bytes that was
actually written is returned via <var>got</var>.
</p></dd></dl>
<hr>
<a name="Changing-the-file-offset"></a>
<div class="header">
<p>
Next: <a href="#Getting-the-file-size" accesskey="n" rel="next">Getting the file size</a>, Previous: <a href="#Reading-and-writing-data" accesskey="p" rel="prev">Reading and writing data</a>, Up: <a href="#File-I_002fO-Functions" accesskey="u" rel="up">File I/O Functions</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Changing-the-file-offset-1"></a>
<h4 class="subsection">2.2.3 Changing the file offset</h4>
<dl>
<dt><a name="index-ext2fs_005ffile_005fllseek"></a>Function: <em>errcode_t</em> <strong>ext2fs_file_llseek</strong> <em>(ext2_file_t <var>file</var>, __u64 <var>offset</var>, int <var>whence</var>, __u64 *<var>ret_pos</var>)</em></dt>
<dt><a name="index-ext2fs_005ffile_005flseek"></a>Function: <em>errcode_t</em> <strong>ext2fs_file_lseek</strong> <em>(ext2_file_t <var>file</var>, ext2_off_t <var>offset</var>, int <var>whence</var>, ext2_off_t *<var>ret_pos</var>)</em></dt>
<dd><p>Change the current file position of <var>file</var> according to the
directive <var>whence</var> as follows:
</p>
<dl compact="compact">
<dt><code>EXT2_SEEK_SET</code></dt>
<dd><p>The file position is set to <var>offset</var> bytes from the beginning of the
file.
</p>
</dd>
<dt><code>EXT2_SEEK_CUR</code></dt>
<dd><p>The file position set to its current location plus <var>offset</var> bytes.
</p>
</dd>
<dt><code>EXT2_SEEK_END</code></dt>
<dd><p>The file position is set to the size of the file plus <var>offset</var>
bytes.
</p></dd>
</dl>
<p>The current offset is returned via <var>ret_pos</var>.
</p></dd></dl>
<hr>
<a name="Getting-the-file-size"></a>
<div class="header">
<p>
Previous: <a href="#Changing-the-file-offset" accesskey="p" rel="prev">Changing the file offset</a>, Up: <a href="#File-I_002fO-Functions" accesskey="u" rel="up">File I/O Functions</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Getting-the-file-size-1"></a>
<h4 class="subsection">2.2.4 Getting the file size</h4>
<dl>
<dt><a name="index-ext2fs_005ffile_005fget_005flsize"></a>Function: <em>errcode_t</em> <strong>ext2fs_file_get_lsize</strong> <em>(ext2_file_t <var>file</var>, __u64 *<var>ret_size</var>)</em></dt>
<dd><p>Return the size of the file <var>file</var> in <var>ret_size</var>.
</p></dd></dl>
<dl>
<dt><a name="index-ext2fs_005ffile_005fget_005fsize"></a>Function: <em>ext2_off_t</em> <strong>ext2fs_file_get_size</strong> <em>(ext2_file_t <var>file</var>)</em></dt>
<dd><p>Return the size of the file <var>file</var>.
</p></dd></dl>
<hr>
<a name="Inode-Functions"></a>
<div class="header">
<p>
Next: <a href="#Directory-functions" accesskey="n" rel="next">Directory functions</a>, Previous: <a href="#File-I_002fO-Functions" accesskey="p" rel="prev">File I/O Functions</a>, Up: <a href="#EXT2FS-Library-Functions" accesskey="u" rel="up">EXT2FS Library Functions</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Inode-Functions-1"></a>
<h3 class="section">2.3 Inode Functions</h3>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top">• <a href="#Reading-and-writing-inodes" accesskey="1">Reading and writing inodes</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Iterating-over-inodes-in-a-filesystem" accesskey="2">Iterating over inodes in a filesystem</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Iterating-over-blocks-in-an-inode" accesskey="3">Iterating over blocks in an inode</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Inode-Convenience-Functions" accesskey="4">Inode Convenience Functions</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
</table>
<hr>
<a name="Reading-and-writing-inodes"></a>
<div class="header">
<p>
Next: <a href="#Iterating-over-inodes-in-a-filesystem" accesskey="n" rel="next">Iterating over inodes in a filesystem</a>, Previous: <a href="#Inode-Functions" accesskey="p" rel="prev">Inode Functions</a>, Up: <a href="#Inode-Functions" accesskey="u" rel="up">Inode Functions</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Reading-and-writing-inodes-1"></a>
<h4 class="subsection">2.3.1 Reading and writing inodes</h4>
<dl>
<dt><a name="index-ext2fs_005fread_005finode"></a>Function: <em>errcode_t</em> <strong>ext2fs_read_inode</strong> <em>(ext2_filsys <var>fs</var>, ext2_ino_t <var>ino</var>, struct ext2_inode *<var>inode</var>)</em></dt>
<dd><p>Read the inode number <var>ino</var> into <var>inode</var>.
</p></dd></dl>
<dl>
<dt><a name="index-ext2fs_005fwrite_005finode"></a>Function: <em>errcode_t</em> <strong>ext2fs_write_inode</strong> <em>(ext2_filsys <var>fs</var>, ext2_ino_t <var>ino</var>, struct ext2_inode *<var>inode</var>)</em></dt>
<dd><p>Write <var>inode</var> to inode <var>ino</var>.
</p></dd></dl>
<hr>
<a name="Iterating-over-inodes-in-a-filesystem"></a>
<div class="header">
<p>
Next: <a href="#Iterating-over-blocks-in-an-inode" accesskey="n" rel="next">Iterating over blocks in an inode</a>, Previous: <a href="#Reading-and-writing-inodes" accesskey="p" rel="prev">Reading and writing inodes</a>, Up: <a href="#Inode-Functions" accesskey="u" rel="up">Inode Functions</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Iterating-over-inodes-in-a-filesystem-1"></a>
<h4 class="subsection">2.3.2 Iterating over inodes in a filesystem</h4>
<p>The inode_scan abstraction is useful for iterating over all the inodes
in a filesystem.
</p>
<dl>
<dt><a name="index-ext2fs_005fopen_005finode_005fscan"></a>Function: <em>errcode_t</em> <strong>ext2fs_open_inode_scan</strong> <em>(ext2_filsys <var>fs</var>, int <var>buffer_blocks</var>, ext2_inode_scan *<var>scan</var>)</em></dt>
<dd><p>Initialize the iteration variable <var>scan</var>. This variable is used by
<code>ext2fs_get_next_inode</code>. The <var>buffer_blocks</var> parameter
controls how many blocks of the inode table are read in at a time. A
large number of blocks requires more memory, but reduces the overhead in
seeking and reading from the disk. If <var>buffer_blocks</var> is zero, a
suitable default value will be used.
</p></dd></dl>
<dl>
<dt><a name="index-ext2fs_005fclose_005finode_005fscan"></a>Function: <em>void</em> <strong>ext2fs_close_inode_scan</strong> <em>(ext2_inode_scan <var>scan</var>)</em></dt>
<dd><p>Release the memory associated with <var>scan</var> and invalidate it.
</p></dd></dl>
<dl>
<dt><a name="index-ext2fs_005fget_005fnext_005finode"></a>Function: <em>errcode_t</em> <strong>ext2fs_get_next_inode</strong> <em>(ext2_inode_scan <var>scan</var>, ext2_ino_t *<var>ino</var>, struct ext2_inode *<var>inode</var>)</em></dt>
<dd>
<p>This function returns the next inode from the filesystem; the inode
number of the inode is stored in <var>ino</var>, and the inode is stored in
<var>inode</var>.
</p>
<p>If the inode is located in a block that has been marked as bad,
<code>ext2fs_get_next_inode</code> will return the error
<code>EXT2_ET_BAD_BLOCK_IN_INODE_TABLE</code>.
</p></dd></dl>
<dl>
<dt><a name="index-ext2fs_005finode_005fscan_005fgoto_005fblockgroup"></a>Function: <em>errcode_t</em> <strong>ext2fs_inode_scan_goto_blockgroup</strong> <em>(ext2_inode_scan <var>scan</var>, int <var>group</var>)</em></dt>
<dd><p>Start the inode scan at a particular ext2 blockgroup, <var>group</var>.
This function may be safely called at any time while <var>scan</var> is valid.
</p></dd></dl>
<dl>
<dt><a name="index-ext2fs_005fset_005finode_005fcallback"></a>Function: <em>void</em> <strong>ext2fs_set_inode_callback</strong> <em>(ext2_inode_scan <var>scan</var>, errcode_t (*done_group)(ext2_filsys <var>fs</var>, ext2_inode_scan <var>scan</var>, dgrp_t <var>group</var>, void * <var>private</var>), void *<var>done_group_data</var>)</em></dt>
<dd><p>Register a callback function which will be called by
<code>ext2_get_next_inode</code> when all of the inodes in a block group have
been processed.
</p></dd></dl>
<dl>
<dt><a name="index-ext2fs_005finode_005fscan_005fflags"></a>Function: <em>int</em> <strong>ext2fs_inode_scan_flags</strong> <em>(ext2_inode_scan <var>scan</var>, int <var>set_flags</var>, int <var>clear_flags</var>)</em></dt>
<dd>
<p>Set the scan_flags <var>set_flags</var> and clear the scan_flags <var>clear_flags</var>.
The following flags can be set using this interface:
</p>
<dl compact="compact">
<dt>‘<samp>EXT2_SF_SKIP_MISSING_ITABLE</samp>’</dt>
<dd><p>When a block group is missing an inode table, skip it. If this flag is
not set <code>ext2fs_get_next_inode</code> will return the error
EXT2_ET_MISSING_INODE_TABLE.
</p>
</dd>
</dl>
</dd></dl>
<hr>
<a name="Iterating-over-blocks-in-an-inode"></a>
<div class="header">
<p>
Next: <a href="#Inode-Convenience-Functions" accesskey="n" rel="next">Inode Convenience Functions</a>, Previous: <a href="#Iterating-over-inodes-in-a-filesystem" accesskey="p" rel="prev">Iterating over inodes in a filesystem</a>, Up: <a href="#Inode-Functions" accesskey="u" rel="up">Inode Functions</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Iterating-over-blocks-in-an-inode-1"></a>
<h4 class="subsection">2.3.3 Iterating over blocks in an inode</h4>
<dl>
<dt><a name="index-ext2fs_005fblock_005fiterate"></a>Function: <em>errcode_t</em> <strong>ext2fs_block_iterate</strong> <em>(ext2_filsys <var>fs</var>, ext2_ino_t <var>ino</var>, int <var>flags</var>, char *block_buf, int (*func)(ext2_filsys <var>fs</var>, blk_t *<var>blocknr</var>, int <var>blockcnt</var>, void *<var>private</var>), void *<var>private</var>)</em></dt>
<dd>
<p>Iterate over all of the blocks in inode number <var>ino</var> in filesystem
<var>fs</var>, by calling the function <var>func</var> for each block in the
inode. The <var>block_buf</var> parameter should either be NULL, or if the
<code>ext2fs_block_iterate</code> function is called repeatedly, the overhead
of allocating and freeing scratch memory can be avoided by passing a
pointer to a scratch buffer which must be at least as big as three times the
filesystem’s blocksize.
</p>
<p>The <var>flags</var> parameter controls how the iterator will function:
</p>
<dl compact="compact">
<dt>‘<samp>BLOCK_FLAG_HOLE</samp>’</dt>
<dd><p>This flag indiciates that the interator function should be called on
blocks where the block number is zero (also known as “holes”.) It is
also known as BLOCK_FLAG_APPEND, since it is also used by functions
such as ext2fs_expand_dir() to add a new block to an inode.
</p>
</dd>
<dt>‘<samp>BLOCK_FLAG_DEPTH_TRAVERSE</samp>’</dt>
<dd><p>This flag indicates that the iterator function for the
indirect, doubly indirect, etc. blocks should be called after all
of the blocks containined in the indirect blocks are processed.
This is useful if you are going to be deallocating blocks from an
inode.
</p>
</dd>
<dt>‘<samp>BLOCK_FLAG_DATA_ONLY</samp>’</dt>
<dd><p>This flag indicates that the iterator function should be
called for data blocks only.
</p>
</dd>
</dl>
<p>The callback function <var>func</var> is called with a number of parameters;
the <var>fs</var> and <var>private</var> parameters are self-explanatory, and
their values are taken from the parameters to
<code>ext2fs_block_iterate</code>. (The <var>private</var> data structure is
generally used by callers to <code>ext2fs_block_iterate</code> so that some
private data structure can be passed to the callback function. The
<var>blockcnt</var> parameter, if non-negative, indicates the logical block
number of a data block in the inode. If <var>blockcnt</var> is less than
zero, then <var>func</var> was called on a metadata block, and <var>blockcnt</var>
will be one of the following values: BLOCK_COUNT_IND, BLOCK_COUNT_DIND,
BLOCK_COUNT_TIND, or BLOCK_COUNT_TRANSLATOR. The <var>blocknr</var> is a
pointer to the inode or indirect block entry listing physical block
number. The callback function may modify the physical block number, if
it returns the <var>BLOCK_CHANGED</var> flag.
</p>
<p>The callback function <var>func</var> returns a result code which is composed of
the logical OR of the following flags:
</p>
<dl compact="compact">
<dt>‘<samp>BLOCK_CHANGED</samp>’</dt>
<dd>
<p>This flag indicates that callback function has modified the physical
block number pointed to by <var>blocknr</var>.
</p>
</dd>
<dt>‘<samp>BLOCK_ABORT</samp>’</dt>
<dd>
<p>This flag requests that <code>ext2fs_block_iterate</code> to stop immediately
and return to the caller.
</p>
</dd>
</dl>
</dd></dl>
<dl>
<dt><a name="index-ext2fs_005fblock_005fiterate2"></a>Function: <em>errcode_t</em> <strong>ext2fs_block_iterate2</strong> <em>(ext2_filsys <var>fs</var>, ext2_ino_t <var>ino</var>, int <var>flags</var>, char *<var>block</var>_buf, int (*func)(ext2_filsys <var>fs</var>, blk_t *<var>blocknr</var>, e2_blkcnt_t <var>blockcnt</var>, blk_t <var>ref_blk</var>, int <var>ref_offset</var>, void *<var>private</var>), void *<var>private</var>)</em></dt>
<dd>
<p>This function is much like <code>ext2fs_block_iterate</code>, except that the
<var>blockcnt</var> type is a 64-bit signed quantity, to support larger
files, and the addition of the <var>ref_blk</var> and <var>ref_offset</var>
arguments passed to the callback function, which identify the location
of the physical block pointed to by pointer <var>blocknr</var>. If
<var>ref_blk</var> is zero, then <var>ref_offset</var> contains the offset into
the <code>i_blocks</code> array. If <var>ref_blk</var> is non-zero, then the physical
block location is contained inside an indirect block group, and
<var>ref_offset</var> contains the offset into the indirect block.
</p>
</dd></dl>
<hr>
<a name="Inode-Convenience-Functions"></a>
<div class="header">
<p>
Previous: <a href="#Iterating-over-blocks-in-an-inode" accesskey="p" rel="prev">Iterating over blocks in an inode</a>, Up: <a href="#Inode-Functions" accesskey="u" rel="up">Inode Functions</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Convenience-functions-for-Inodes"></a>
<h4 class="subsection">2.3.4 Convenience functions for Inodes</h4>
<dl>
<dt><a name="index-ext2fs_005fget_005fblocks"></a>Function: <em>errcode_t</em> <strong>ext2fs_get_blocks</strong> <em>(ext2_filsys <var>fs</var>, ext2_ino_t <var>ino</var>, blk_t *<var>blocks</var>)</em></dt>
<dd>
<p>Returns an array of blocks corresponding to the direct,
indirect, doubly indirect, and triply indirect blocks as stored in the
inode structure.
</p></dd></dl>
<dl>
<dt><a name="index-ext2fs_005fcheck_005fdirectory"></a>Function: <em>errcode_t</em> <strong>ext2fs_check_directory</strong> <em>(ext2_filsys <var>fs</var>, ext2_ino_t <var>ino</var>)</em></dt>
<dd><p>Returns 0 if <var>ino</var> is a directory, and <code>ENOTDIR</code> if it is not.
</p></dd></dl>
<dl>
<dt><a name="index-ext2fs_005finode_005fhas_005fvalid_005fblocks"></a>Function: <em>int</em> <strong>ext2fs_inode_has_valid_blocks</strong> <em>(struct ext2_inode *<var>inode</var>)</em></dt>
<dd>
<p>Returns 1 if the inode’s block entries actually valid block entries, and
0 if not. Inodes which represent devices and fast symbolic links do not
contain valid block entries.
</p></dd></dl>
<hr>
<a name="Directory-functions"></a>
<div class="header">
<p>
Next: <a href="#Bitmap-Functions" accesskey="n" rel="next">Bitmap Functions</a>, Previous: <a href="#Inode-Functions" accesskey="p" rel="prev">Inode Functions</a>, Up: <a href="#EXT2FS-Library-Functions" accesskey="u" rel="up">EXT2FS Library Functions</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Directory-functions-1"></a>
<h3 class="section">2.4 Directory functions</h3>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top">• <a href="#Directory-block-functions" accesskey="1">Directory block functions</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Iterating-over-a-directory" accesskey="2">Iterating over a directory</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Creating-and-expanding-directories" accesskey="3">Creating and expanding directories</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Creating-and-removing-directory-entries" accesskey="4">Creating and removing directory entries</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Looking-up-filenames" accesskey="5">Looking up filenames</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Translating-inode-numbers-to-filenames" accesskey="6">Translating inode numbers to filenames</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
</table>
<hr>
<a name="Directory-block-functions"></a>
<div class="header">
<p>
Next: <a href="#Iterating-over-a-directory" accesskey="n" rel="next">Iterating over a directory</a>, Previous: <a href="#Directory-functions" accesskey="p" rel="prev">Directory functions</a>, Up: <a href="#Directory-functions" accesskey="u" rel="up">Directory functions</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Directory-block-functions-1"></a>
<h4 class="subsection">2.4.1 Directory block functions</h4>
<dl>
<dt><a name="index-ext2fs_005fread_005fdir_005fblock"></a>Function: <em>errcode_t</em> <strong>ext2fs_read_dir_block</strong> <em>(ext2_filsys <var>fs</var>, blk_t <var>block</var>, void *<var>buf</var>)</em></dt>
<dd>
<p>This function reads a directory block, performing any necessary
byte swapping if necessary.
</p></dd></dl>
<dl>
<dt><a name="index-ext2fs_005fwrite_005fdir_005fblock"></a>Function: <em>errcode_t</em> <strong>ext2fs_write_dir_block</strong> <em>(ext2_filsys <var>fs</var>, blk_t <var>block</var>, void *<var>buf</var>)</em></dt>
<dd>
<p>This function writes a directory block, performing any necessary
byte swapping if necessary.
</p></dd></dl>
<dl>
<dt><a name="index-ext2fs_005fnew_005fdir_005fblock"></a>Function: <em>errcode_t</em> <strong>ext2fs_new_dir_block</strong> <em>(ext2_filsys <var>fs</var>, ext2_ino_t <var>dir_ino</var>, ext2_ino_t <var>parent_ino</var>, char **<var>block</var>)</em></dt>
<dd>
<p>This function creates a new directory block in <var>block</var>. If
<var>dir_ino</var> is non-zero, then <var>dir_info</var> and <var>parent_ino</var> is used
to initialize directory entries for <samp>.</samp> and <samp>..</samp>, respectively.
</p></dd></dl>
<hr>
<a name="Iterating-over-a-directory"></a>
<div class="header">
<p>
Next: <a href="#Creating-and-expanding-directories" accesskey="n" rel="next">Creating and expanding directories</a>, Previous: <a href="#Directory-block-functions" accesskey="p" rel="prev">Directory block functions</a>, Up: <a href="#Directory-functions" accesskey="u" rel="up">Directory functions</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Iterating-over-a-directory-1"></a>
<h4 class="subsection">2.4.2 Iterating over a directory</h4>
<dl>
<dt><a name="index-ext2fs_005fdir_005fiterate"></a>Function: <em>errcode_t</em> <strong>ext2fs_dir_iterate</strong> <em>(ext2_filsys <var>fs</var>, ext2_ino_t <var>dir</var>, int <var>flags</var>, char *<var>block_buf</var>, int (*<var>func</var>)(struct ext2_dir_entry *<var>dirent</var>, int <var>offset</var>, int <var>blocksize</var>, char *<var>buf</var>, void *<var>private</var>), void *<var>private</var>)</em></dt>
<dd>
<p>This function iterates over all of the directory entries in the
directory <var>dir</var>, calling the callback function <var>func</var> for each
directory entry in the directory. The <var>block_buf</var> parameter should
either be NULL, or if the <code>ext2fs_dir_iterate</code> function is
called repeatedly, the overhead of allocating and freeing
scratch memory can be avoided by passing a pointer to a scratch buffer
which must be at least as big as the filesystem’s blocksize.
</p>
<p>The <var>flags</var> parameter controls how the iterator will function:
</p>
<dl compact="compact">
<dt>‘<samp>DIRENT_FLAG_INCLUDE_EMPTY</samp>’</dt>
<dd>
<p>This flag indicates that the callback function should be called even
for deleted or empty directory entries.
</p>
</dd>
</dl>
</dd></dl>
<hr>
<a name="Creating-and-expanding-directories"></a>
<div class="header">
<p>
Next: <a href="#Creating-and-removing-directory-entries" accesskey="n" rel="next">Creating and removing directory entries</a>, Previous: <a href="#Iterating-over-a-directory" accesskey="p" rel="prev">Iterating over a directory</a>, Up: <a href="#Directory-functions" accesskey="u" rel="up">Directory functions</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Creating-and-expanding-directories-1"></a>
<h4 class="subsection">2.4.3 Creating and expanding directories</h4>
<dl>
<dt><a name="index-ext2fs_005fmkdir"></a>Function: <em>errcode_t</em> <strong>ext2fs_mkdir</strong> <em>(ext2_filsys <var>fs</var>, ext2_ino_t <var>parent</var>, ext2_ino_t <var>inum</var>, const char *<var>name</var>)</em></dt>
<dd>
<p>This function creates a new directory. If <var>inum</var> is zero, then a
new inode will be allocated; otherwise, the directory will be created in
the inode specified by <var>inum</var>. If <var>name</var> specifies the name of
the new directory; if it is non-NULL, then the new directory will be
linked into the parent directory <var>parent</var>.
</p></dd></dl>
<dl>
<dt><a name="index-ext2fs_005fexpand_005fdir"></a>Function: <em>errcode_t</em> <strong>ext2fs_expand_dir</strong> <em>(ext2_filsys <var>fs</var>, ext2_ino_t <var>dir</var>)</em></dt>
<dd>
<p>This function adds a new empty directory block and appends it to
the directory <var>dir</var>. This allows functions such as
<code>ext2fs_link</code> to add new directory entries to a directory which is full.
</p>
</dd></dl>
<hr>
<a name="Creating-and-removing-directory-entries"></a>
<div class="header">
<p>
Next: <a href="#Looking-up-filenames" accesskey="n" rel="next">Looking up filenames</a>, Previous: <a href="#Creating-and-expanding-directories" accesskey="p" rel="prev">Creating and expanding directories</a>, Up: <a href="#Directory-functions" accesskey="u" rel="up">Directory functions</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Creating-and-removing-directory-entries-1"></a>
<h4 class="subsection">2.4.4 Creating and removing directory entries</h4>
<dl>
<dt><a name="index-ext2fs_005flink"></a>Function: <em>errcode_t</em> <strong>ext2fs_link</strong> <em>(ext2_filsys <var>fs</var>, ext2_ino_t <var>dir</var>, const char *<var>name</var>, ext2_ino_t <var>ino</var>, int flags)</em></dt>
<dd>
<p>This function adds a new directory entry to the directory <var>dir</var>,
with <var>name</var> and <var>ino</var> specifying the name and inode number in
the directory entry, respectively.
</p>
<p>The low 3 bits of the flags field is used to specify the file type of
inode: (No other flags are currently defined.)
</p>
<dl compact="compact">
<dt>‘<samp>EXT2_FT_UNKNOWN</samp>’</dt>
<dd>
<p>The file type is unknown.
</p>
</dd>
<dt>‘<samp>EXT2_FT_REG_FILE</samp>’</dt>
<dd>
<p>The file type is a normal file.
</p>
</dd>
<dt>‘<samp>EXT2_FT_DIR</samp>’</dt>
<dd>
<p>The file type is a directory.
</p>
</dd>
<dt>‘<samp>EXT2_FT_CHRDEV</samp>’</dt>
<dd>
<p>The file type is a character device.
</p>
</dd>
<dt>‘<samp>EXT2_FT_BLKDEV</samp>’</dt>
<dd>
<p>The file type is a block device.
</p>
</dd>
<dt>‘<samp>EXT2_FT_FIFO</samp>’</dt>
<dd>
<p>The file type is a named pipe.
</p>
</dd>
<dt>‘<samp>EXT2_FT_SOCK</samp>’</dt>
<dd>
<p>The file type is a unix domain socket.
</p>
</dd>
<dt>‘<samp>EXT2_FT_SYMLINK</samp>’</dt>
<dd>
<p>The file type is a symbolic link.
</p></dd>
</dl>
</dd></dl>
<dl>
<dt><a name="index-ext2fs_005funlink"></a>Function: <em>errcode_t</em> <strong>ext2fs_unlink</strong> <em>(ext2_filsys <var>fs</var>, ext2_ino_t <var>dir</var>, const char *<var>name</var>, ext2_ino_t <var>ino</var>, int <var>flags</var>)</em></dt>
<dd>
<p>This function removes a directory entry from <var>dir</var>.
The directory entry to be removed is the first one which is
matched by <var>name</var> and <var>ino</var>. If <var>name</var> is non-NULL,
the directory entry’s name must match <var>name</var>. If <var>ino</var> is
non-zero, the directory entry’s inode number must match <var>ino</var>.
No flags are currently defined for <code>ext2fs_unlink</code>; callers should
pass in zero to this parameter.
</p>
</dd></dl>
<hr>
<a name="Looking-up-filenames"></a>
<div class="header">
<p>
Next: <a href="#Translating-inode-numbers-to-filenames" accesskey="n" rel="next">Translating inode numbers to filenames</a>, Previous: <a href="#Creating-and-removing-directory-entries" accesskey="p" rel="prev">Creating and removing directory entries</a>, Up: <a href="#Directory-functions" accesskey="u" rel="up">Directory functions</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Looking-up-filenames-1"></a>
<h4 class="subsection">2.4.5 Looking up filenames</h4>
<dl>
<dt><a name="index-ext2fs_005flookup"></a>Function: <em>errcode_t</em> <strong>ext2fs_lookup</strong> <em>(ext2_filsys <var>fs</var>, ext2_ino_t <var>dir</var>, const char *<var>name</var>, int <var>namelen</var>, char *<var>buf</var>, ext2_ino_t *<var>inode</var>)</em></dt>
</dl>
<dl>
<dt><a name="index-ext2fs_005fnamei"></a>Function: <em>errcode_t</em> <strong>ext2fs_namei</strong> <em>(ext2_filsys <var>fs</var>, ext2_ino_t <var>root</var>, ext2_ino_t <var>cwd</var>, const char *<var>name</var>, ext2_ino_t *<var>inode</var>)</em></dt>
</dl>
<dl>
<dt><a name="index-ext2fs_005fnamei_005ffollow"></a>Function: <em>errcode_t</em> <strong>ext2fs_namei_follow</strong> <em>(ext2_filsys <var>fs</var>, ext2_ino_t <var>root</var>, ext2_ino_t <var>cwd</var>, const char *<var>name</var>, ext2_ino_t *<var>inode</var>)</em></dt>
</dl>
<dl>
<dt><a name="index-ext2fs_005ffollow_005flink"></a>Function: <em>errcode_t</em> <strong>ext2fs_follow_link</strong> <em>(ext2_filsys <var>fs</var>, ext2_ino_t <var>root</var>, ext2_ino_t <var>cwd</var>, ext2_ino_t <var>inode</var>, ext2_ino_t *<var>res</var>_inode)</em></dt>
</dl>
<hr>
<a name="Translating-inode-numbers-to-filenames"></a>
<div class="header">
<p>
Previous: <a href="#Looking-up-filenames" accesskey="p" rel="prev">Looking up filenames</a>, Up: <a href="#Directory-functions" accesskey="u" rel="up">Directory functions</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Translating-inode-numbers-to-filenames-1"></a>
<h4 class="subsection">2.4.6 Translating inode numbers to filenames</h4>
<dl>
<dt><a name="index-ext2fs_005fget_005fpathname"></a>Function: <em>errcode_t</em> <strong>ext2fs_get_pathname</strong> <em>(ext2_filsys <var>fs</var>, ext2_ino_t <var>dir</var>, ext2_ino_t <var>ino</var>, char **<var>name</var>)</em></dt>
</dl>
<hr>
<a name="Bitmap-Functions"></a>
<div class="header">
<p>
Next: <a href="#EXT2-data-abstractions" accesskey="n" rel="next">EXT2 data abstractions</a>, Previous: <a href="#Directory-functions" accesskey="p" rel="prev">Directory functions</a>, Up: <a href="#EXT2FS-Library-Functions" accesskey="u" rel="up">EXT2FS Library Functions</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Bitmap-Functions-1"></a>
<h3 class="section">2.5 Bitmap Functions</h3>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top">• <a href="#Reading-and-Writing-Bitmaps" accesskey="1">Reading and Writing Bitmaps</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Allocating-Bitmaps" accesskey="2">Allocating Bitmaps</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Free-bitmaps" accesskey="3">Free bitmaps</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Bitmap-Operations" accesskey="4">Bitmap Operations</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Comparing-bitmaps" accesskey="5">Comparing bitmaps</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Modifying-Bitmaps" accesskey="6">Modifying Bitmaps</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Resizing-Bitmaps" accesskey="7">Resizing Bitmaps</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Clearing-Bitmaps" accesskey="8">Clearing Bitmaps</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
</table>
<hr>
<a name="Reading-and-Writing-Bitmaps"></a>
<div class="header">
<p>
Next: <a href="#Allocating-Bitmaps" accesskey="n" rel="next">Allocating Bitmaps</a>, Previous: <a href="#Bitmap-Functions" accesskey="p" rel="prev">Bitmap Functions</a>, Up: <a href="#Bitmap-Functions" accesskey="u" rel="up">Bitmap Functions</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Reading-and-Writing-Bitmaps-1"></a>
<h4 class="subsection">2.5.1 Reading and Writing Bitmaps</h4>
<dl>
<dt><a name="index-ext2fs_005fwrite_005finode_005fbitmap"></a>Function: <em>errcode_t</em> <strong>ext2fs_write_inode_bitmap</strong> <em>(ext2_filsys <var>fs</var>)</em></dt>
</dl>
<dl>
<dt><a name="index-ext2fs_005fwrite_005fblock_005fbitmap"></a>Function: <em>errcode_t</em> <strong>ext2fs_write_block_bitmap</strong> <em>(ext2_filsys <var>fs</var>)</em></dt>
</dl>
<dl>
<dt><a name="index-ext2fs_005fread_005finode_005fbitmap"></a>Function: <em>errcode_t</em> <strong>ext2fs_read_inode_bitmap</strong> <em>(ext2_filsys <var>fs</var>)</em></dt>
</dl>
<dl>
<dt><a name="index-ext2fs_005fread_005fblock_005fbitmap"></a>Function: <em>errcode_t</em> <strong>ext2fs_read_block_bitmap</strong> <em>(ext2_filsys <var>fs</var>)</em></dt>
</dl>
<dl>
<dt><a name="index-ext2fs_005fread_005fbitmaps"></a>Function: <em>errcode_t</em> <strong>ext2fs_read_bitmaps</strong> <em>(ext2_filsys <var>fs</var>)</em></dt>
</dl>
<dl>
<dt><a name="index-ext2fs_005fwrite_005fbitmaps"></a>Function: <em>errcode_t</em> <strong>ext2fs_write_bitmaps</strong> <em>(ext2_filsys <var>fs</var>)</em></dt>
</dl>
<hr>
<a name="Allocating-Bitmaps"></a>
<div class="header">
<p>
Next: <a href="#Free-bitmaps" accesskey="n" rel="next">Free bitmaps</a>, Previous: <a href="#Reading-and-Writing-Bitmaps" accesskey="p" rel="prev">Reading and Writing Bitmaps</a>, Up: <a href="#Bitmap-Functions" accesskey="u" rel="up">Bitmap Functions</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Allocating-Bitmaps-1"></a>
<h4 class="subsection">2.5.2 Allocating Bitmaps</h4>
<dl>
<dt><a name="index-ext2fs_005fallocate_005fgeneric_005fbitmap"></a>Function: <em>errcode_t</em> <strong>ext2fs_allocate_generic_bitmap</strong> <em>(__u32 <var>start</var>, __u32 <var>end</var>, _u32 <var>real_end</var>, const char *<var>descr</var>, ext2fs_generic_bitmap *<var>ret</var>)</em></dt>
</dl>
<dl>
<dt><a name="index-ext2fs_005fallocate_005fblock_005fbitmap"></a>Function: <em>errcode_t</em> <strong>ext2fs_allocate_block_bitmap</strong> <em>(ext2_filsys <var>fs</var>, const char *<var>descr</var>, ext2fs_block_bitmap *<var>ret</var>)</em></dt>
</dl>
<dl>
<dt><a name="index-ext2fs_005fallocate_005finode_005fbitmap"></a>Function: <em>errcode_t</em> <strong>ext2fs_allocate_inode_bitmap</strong> <em>(ext2_filsys <var>fs</var>, const char *<var>descr</var>, ext2fs_inode_bitmap *<var>ret</var>)</em></dt>
</dl>
<hr>
<a name="Free-bitmaps"></a>
<div class="header">
<p>
Next: <a href="#Bitmap-Operations" accesskey="n" rel="next">Bitmap Operations</a>, Previous: <a href="#Allocating-Bitmaps" accesskey="p" rel="prev">Allocating Bitmaps</a>, Up: <a href="#Bitmap-Functions" accesskey="u" rel="up">Bitmap Functions</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Freeing-bitmaps"></a>
<h4 class="subsection">2.5.3 Freeing bitmaps</h4>
<dl>
<dt><a name="index-ext2fs_005ffree_005fgeneric_005fbitmap"></a>Function: <em>void</em> <strong>ext2fs_free_generic_bitmap</strong> <em>(ext2fs_inode_bitmap <var>bitmap</var>)</em></dt>
</dl>
<dl>
<dt><a name="index-ext2fs_005ffree_005fblock_005fbitmap"></a>Function: <em>void</em> <strong>ext2fs_free_block_bitmap</strong> <em>(ext2fs_block_bitmap <var>bitmap</var>)</em></dt>
</dl>
<dl>
<dt><a name="index-ext2fs_005ffree_005finode_005fbitmap"></a>Function: <em>void</em> <strong>ext2fs_free_inode_bitmap</strong> <em>(ext2fs_inode_bitmap <var>bitmap</var>)</em></dt>
</dl>
<hr>
<a name="Bitmap-Operations"></a>
<div class="header">
<p>
Next: <a href="#Comparing-bitmaps" accesskey="n" rel="next">Comparing bitmaps</a>, Previous: <a href="#Free-bitmaps" accesskey="p" rel="prev">Free bitmaps</a>, Up: <a href="#Bitmap-Functions" accesskey="u" rel="up">Bitmap Functions</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Bitmap-Operations-1"></a>
<h4 class="subsection">2.5.4 Bitmap Operations</h4>
<dl>
<dt><a name="index-ext2fs_005fmark_005fblock_005fbitmap"></a>Function: <em>void</em> <strong>ext2fs_mark_block_bitmap</strong> <em>(ext2fs_block_bitmap <var>bitmap</var>, blk_t <var>block</var>)</em></dt>
<dt><a name="index-ext2fs_005funmark_005fblock_005fbitmap"></a>Function: <em>void</em> <strong>ext2fs_unmark_block_bitmap</strong> <em>(ext2fs_block_bitmap <var>bitmap</var>, blk_t <var>block</var>)</em></dt>
<dt><a name="index-ext2fs_005ftest_005fblock_005fbitmap"></a>Function: <em>int</em> <strong>ext2fs_test_block_bitmap</strong> <em>(ext2fs_block_bitmap <var>bitmap</var>, blk_t <var>block</var>)</em></dt>
<dd>
<p>These functions set, clear, and test bits in a block bitmap <var>bitmap</var>.
</p></dd></dl>
<dl>
<dt><a name="index-ext2fs_005fmark_005finode_005fbitmap"></a>Function: <em>void</em> <strong>ext2fs_mark_inode_bitmap</strong> <em>(ext2fs_inode_bitmap <var>bitmap</var>, ext2_ino_t <var>inode</var>)</em></dt>
<dt><a name="index-ext2fs_005funmark_005finode_005fbitmap"></a>Function: <em>void</em> <strong>ext2fs_unmark_inode_bitmap</strong> <em>(ext2fs_inode_bitmap <var>bitmap</var>, ext2_ino_t <var>inode</var>)</em></dt>
<dt><a name="index-ext2fs_005ftest_005finode_005fbitmap"></a>Function: <em>int</em> <strong>ext2fs_test_inode_bitmap</strong> <em>(ext2fs_inode_bitmap <var>bitmap</var>, ext2_ino_t <var>inode</var>)</em></dt>
<dd>
<p>These functions set, clear, and test bits in an inode bitmap <var>bitmap</var>.
</p></dd></dl>
<dl>
<dt><a name="index-ext2fs_005ffast_005fmark_005fblock_005fbitmap"></a>Function: <em>void</em> <strong>ext2fs_fast_mark_block_bitmap</strong> <em>(ext2fs_block_bitmap <var>bitmap</var>, blk_t <var>block</var>)</em></dt>
<dt><a name="index-ext2fs_005ffast_005funmark_005fblock_005fbitmap"></a>Function: <em>void</em> <strong>ext2fs_fast_unmark_block_bitmap</strong> <em>(ext2fs_block_bitmap <var>bitmap</var>, blk_t <var>block</var>)</em></dt>
<dt><a name="index-ext2fs_005ffast_005ftest_005fblock_005fbitmap"></a>Function: <em>int</em> <strong>ext2fs_fast_test_block_bitmap</strong> <em>(ext2fs_block_bitmap <var>bitmap</var>, blk_t <var>block</var>)</em></dt>
<dt><a name="index-ext2fs_005ffast_005fmark_005finode_005fbitmap"></a>Function: <em>void</em> <strong>ext2fs_fast_mark_inode_bitmap</strong> <em>(ext2fs_inode_bitmap <var>bitmap</var>, ext2_ino_t <var>inode</var>)</em></dt>
<dt><a name="index-ext2fs_005ffast_005funmark_005finode_005fbitmap"></a>Function: <em>void</em> <strong>ext2fs_fast_unmark_inode_bitmap</strong> <em>(ext2fs_inode_bitmap <var>bitmap</var>, ext2_ino_t <var>inode</var>)</em></dt>
<dt><a name="index-ext2fs_005ffast_005ftest_005finode_005fbitmap"></a>Function: <em>int</em> <strong>ext2fs_fast_test_inode_bitmap</strong> <em>(ext2fs_inode_bitmap <var>bitmap</var>, ext2_ino_t <var>inode</var>)</em></dt>
<dd>
<p>These “fast” functions are like their normal counterparts; however,
they are implemented as inline functions and do not perform bounds
checks on the inode number or block number; they are assumed to be
correct. They should only be used in speed-critical applications, where
the inode or block number has already been validated by other means.
</p></dd></dl>
<dl>
<dt><a name="index-ext2fs_005fget_005fblock_005fbitmap_005fstart"></a>Function: <em>blk_t</em> <strong>ext2fs_get_block_bitmap_start</strong> <em>(ext2fs_block_bitmap <var>bitmap</var>)</em></dt>
<dt><a name="index-ext2fs_005fget_005finode_005fbitmap_005fstart"></a>Function: <em>ext2_ino_t</em> <strong>ext2fs_get_inode_bitmap_start</strong> <em>(ext2fs_inode_bitmap <var>bitmap</var>)</em></dt>
<dd><p>Return the first inode or block which is stored in the bitmap.
</p></dd></dl>
<dl>
<dt><a name="index-ext2fs_005fget_005fblock_005fbitmap_005fend"></a>Function: <em>blk_t</em> <strong>ext2fs_get_block_bitmap_end</strong> <em>(ext2fs_block_bitmap <var>bitmap</var>)</em></dt>
<dt><a name="index-ext2fs_005fget_005finode_005fbitmap_005fend"></a>Function: <em>ext2_ino_t</em> <strong>ext2fs_get_inode_bitmap_end</strong> <em>(ext2fs_inode_bitmap <var>bitmap</var>)</em></dt>
<dd>
<p>Return the last inode or block which is stored in the bitmap.
</p></dd></dl>
<hr>
<a name="Comparing-bitmaps"></a>
<div class="header">
<p>
Next: <a href="#Modifying-Bitmaps" accesskey="n" rel="next">Modifying Bitmaps</a>, Previous: <a href="#Bitmap-Operations" accesskey="p" rel="prev">Bitmap Operations</a>, Up: <a href="#Bitmap-Functions" accesskey="u" rel="up">Bitmap Functions</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Comparing-bitmaps-1"></a>
<h4 class="subsection">2.5.5 Comparing bitmaps</h4>
<dl>
<dt><a name="index-ext2fs_005fcompare_005fblock_005fbitmap"></a>Function: <em>errcode_t</em> <strong>ext2fs_compare_block_bitmap</strong> <em>(ext2fs_block_bitmap <var>bm1</var>, ext2fs_block_bitmap <var>bm2</var>)</em></dt>
</dl>
<dl>
<dt><a name="index-ext2fs_005fcompare_005finode_005fbitmap"></a>Function: <em>errcode_t</em> <strong>ext2fs_compare_inode_bitmap</strong> <em>(ext2fs_inode_bitmap <var>bm1</var>, ext2fs_inode_bitmap <var>bm2</var>)</em></dt>
</dl>
<hr>
<a name="Modifying-Bitmaps"></a>
<div class="header">
<p>
Next: <a href="#Resizing-Bitmaps" accesskey="n" rel="next">Resizing Bitmaps</a>, Previous: <a href="#Comparing-bitmaps" accesskey="p" rel="prev">Comparing bitmaps</a>, Up: <a href="#Bitmap-Functions" accesskey="u" rel="up">Bitmap Functions</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Modifying-Bitmaps-1"></a>
<h4 class="subsection">2.5.6 Modifying Bitmaps</h4>
<dl>
<dt><a name="index-ext2fs_005ffudge_005finode_005fbitmap_005fend"></a>Function: <em>errcode_t</em> <strong>ext2fs_fudge_inode_bitmap_end</strong> <em>(ext2fs_inode_bitmap <var>bitmap</var>, ext2_ino_t <var>end</var>, ext2_ino_t *<var>oend</var>)</em></dt>
</dl>
<dl>
<dt><a name="index-ext2fs_005ffudge_005fblock_005fbitmap_005fend"></a>Function: <em>errcode_t</em> <strong>ext2fs_fudge_block_bitmap_end</strong> <em>(ext2fs_block_bitmap <var>bitmap</var>, blk_t <var>end</var>, blk_t *<var>oend</var>)</em></dt>
</dl>
<hr>
<a name="Resizing-Bitmaps"></a>
<div class="header">
<p>
Next: <a href="#Clearing-Bitmaps" accesskey="n" rel="next">Clearing Bitmaps</a>, Previous: <a href="#Modifying-Bitmaps" accesskey="p" rel="prev">Modifying Bitmaps</a>, Up: <a href="#Bitmap-Functions" accesskey="u" rel="up">Bitmap Functions</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Resizing-Bitmaps-1"></a>
<h4 class="subsection">2.5.7 Resizing Bitmaps</h4>
<dl>
<dt><a name="index-ext2fs_005fresize_005fgeneric_005fbitmap"></a>Function: <em>errcode_t</em> <strong>ext2fs_resize_generic_bitmap</strong> <em>(__u32 <var>new_end</var>, __u32 <var>new_real_end</var>, ext2fs_generic_bitmap <var>bmap</var>)</em></dt>
</dl>
<dl>
<dt><a name="index-ext2fs_005fresize_005finode_005fbitmap"></a>Function: <em>errcode_t</em> <strong>ext2fs_resize_inode_bitmap</strong> <em>(__u32 <var>new_end</var>, __u32 <var>new_real_end</var>, ext2fs_inode_bitmap <var>bmap</var>)</em></dt>
</dl>
<dl>
<dt><a name="index-ext2fs_005fresize_005fblock_005fbitmap"></a>Function: <em>errcode_t</em> <strong>ext2fs_resize_block_bitmap</strong> <em>(__u32 <var>new_end</var>, __u32 <var>new_real_end</var>, ext2fs_block_bitmap <var>bmap</var>)</em></dt>
</dl>
<hr>
<a name="Clearing-Bitmaps"></a>
<div class="header">
<p>
Previous: <a href="#Resizing-Bitmaps" accesskey="p" rel="prev">Resizing Bitmaps</a>, Up: <a href="#Bitmap-Functions" accesskey="u" rel="up">Bitmap Functions</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Clearing-Bitmaps-1"></a>
<h4 class="subsection">2.5.8 Clearing Bitmaps</h4>
<dl>
<dt><a name="index-ext2fs_005fclear_005finode_005fbitmap"></a>Function: <em>void</em> <strong>ext2fs_clear_inode_bitmap</strong> <em>(ext2fs_inode_bitmap <var>bitmap</var>)</em></dt>
<dd>
<p>This function sets all of the bits in the inode bitmap <var>bitmap</var> to
be zero.
</p>
</dd></dl>
<dl>
<dt><a name="index-ext2fs_005fclear_005fblock_005fbitmap"></a>Function: <em>void</em> <strong>ext2fs_clear_block_bitmap</strong> <em>(ext2fs_block_bitmap <var>bitmap</var>)</em></dt>
<dd>
<p>This function sets all of the bits in the block bitmap <var>bitmap</var> to
be zero.
</p></dd></dl>
<hr>
<a name="EXT2-data-abstractions"></a>
<div class="header">
<p>
Next: <a href="#Byte_002dswapping-functions" accesskey="n" rel="next">Byte-swapping functions</a>, Previous: <a href="#Bitmap-Functions" accesskey="p" rel="prev">Bitmap Functions</a>, Up: <a href="#EXT2FS-Library-Functions" accesskey="u" rel="up">EXT2FS Library Functions</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="EXT2-data-abstractions-1"></a>
<h3 class="section">2.6 EXT2 data abstractions</h3>
<p>The ext2 library has a number of abstractions which are useful for ext2
utility programs.
</p>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top">• <a href="#Badblocks-list-management" accesskey="1">Badblocks list management</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Directory_002dblock-list-management" accesskey="2">Directory-block list management</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="#Inode-count-functions" accesskey="3">Inode count functions</a>:</td><td> </td><td align="left" valign="top">
</td></tr>
</table>
<hr>
<a name="Badblocks-list-management"></a>
<div class="header">
<p>
Next: <a href="#Directory_002dblock-list-management" accesskey="n" rel="next">Directory-block list management</a>, Previous: <a href="#EXT2-data-abstractions" accesskey="p" rel="prev">EXT2 data abstractions</a>, Up: <a href="#EXT2-data-abstractions" accesskey="u" rel="up">EXT2 data abstractions</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Badblocks-list-management-1"></a>
<h4 class="subsection">2.6.1 Badblocks list management</h4>
<dl>
<dt><a name="index-ext2fs_005fbadblocks_005flist_005fcreate"></a>Function: <em>errcode_t</em> <strong>ext2fs_badblocks_list_create</strong> <em>(ext2_badblocks_list *<var>ret</var>, int <var>size</var>)</em></dt>
</dl>
<dl>
<dt><a name="index-ext2fs_005fbadblocks_005flist_005ffree"></a>Function: <em>void</em> <strong>ext2fs_badblocks_list_free</strong> <em>(ext2_badblocks_list <var>bb</var>)</em></dt>
</dl>
<dl>
<dt><a name="index-ext2fs_005fbadblocks_005flist_005fadd"></a>Function: <em>errcode_t</em> <strong>ext2fs_badblocks_list_add</strong> <em>(ext2_badblocks_list <var>bb</var>, blk_t <var>blk</var>)</em></dt>
</dl>
<dl>
<dt><a name="index-ext2fs_005fbadblocks_005flist_005ftest"></a>Function: <em>int</em> <strong>ext2fs_badblocks_list_test</strong> <em>(ext2_badblocks_list <var>bb</var>, blk_t <var>blk</var>)</em></dt>
</dl>
<dl>
<dt><a name="index-ext2fs_005fbadblocks_005flist_005fiterate_005fbegin"></a>Function: <em>errcode_t</em> <strong>ext2fs_badblocks_list_iterate_begin</strong> <em>(ext2_badblocks_list <var>bb</var>, ext2_badblocks_iterate *<var>ret</var>)</em></dt>
</dl>
<dl>
<dt><a name="index-ext2fs_005fbadblocks_005flist_005fiterate"></a>Function: <em>int</em> <strong>ext2fs_badblocks_list_iterate</strong> <em>(ext2_badblocks_iterate iter, blk_t *<var>blk</var>)</em></dt>
</dl>
<dl>
<dt><a name="index-ext2fs_005fbadblocks_005flist_005fiterate_005fend"></a>Function: <em>void</em> <strong>ext2fs_badblocks_list_iterate_end</strong> <em>(ext2_badblocks_iterate <var>iter</var>)</em></dt>
</dl>
<dl>
<dt><a name="index-ext2fs_005fupdate_005fbb_005finode"></a>Function: <em>errcode_t</em> <strong>ext2fs_update_bb_inode</strong> <em>(ext2_filsys <var>fs</var>, ext2_badblocks_list <var>bb_list</var>)</em></dt>
</dl>
<dl>
<dt><a name="index-ext2fs_005fread_005fbb_005finode"></a>Function: <em>errcode_t</em> <strong>ext2fs_read_bb_inode</strong> <em>(ext2_filsys <var>fs</var>, ext2_badblocks_list *<var>bb_list</var>)</em></dt>
</dl>
<dl>
<dt><a name="index-ext2fs_005fread_005fbb_005fFILE"></a>Function: <em>errcode_t</em> <strong>ext2fs_read_bb_FILE</strong> <em>(ext2_filsys <var>fs</var>, FILE *f, ext2_badblocks_list *<var>bb_list</var>, void (*invalid)(ext2_filsys <var>fs</var>, blk_t <var>blk</var>))</em></dt>
</dl>
<hr>
<a name="Directory_002dblock-list-management"></a>
<div class="header">
<p>
Next: <a href="#Inode-count-functions" accesskey="n" rel="next">Inode count functions</a>, Previous: <a href="#Badblocks-list-management" accesskey="p" rel="prev">Badblocks list management</a>, Up: <a href="#EXT2-data-abstractions" accesskey="u" rel="up">EXT2 data abstractions</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Directory_002dblock-list-management-1"></a>
<h4 class="subsection">2.6.2 Directory-block list management</h4>
<p>The dblist abstraction stores a list of blocks belonging to
directories. This list can be useful when a program needs to interate
over all directory entries in a filesystem; <code>e2fsck</code> does this in
pass 2 of its operations, and <code>debugfs</code> needs to do this when it is
trying to turn an inode number into a pathname.
</p>
<dl>
<dt><a name="index-ext2fs_005finit_005fdblist"></a>Function: <em>errcode_t</em> <strong>ext2fs_init_dblist</strong> <em>(ext2_filsys <var>fs</var>, ext2_dblist *<var>ret_dblist</var>)</em></dt>
<dd>
<p>Creates a dblist data structure and return it in <var>ret_dblist</var>.
</p></dd></dl>
<dl>
<dt><a name="index-ext2fs_005ffree_005fdblist"></a>Function: <em>void</em> <strong>ext2fs_free_dblist</strong> <em>(ext2_dblist <var>dblist</var>)</em></dt>
<dd>
<p>Free a dblist data structure.
</p></dd></dl>
<dl>
<dt><a name="index-ext2fs_005fadd_005fdir_005fblock"></a>Function: <em>errcode_t</em> <strong>ext2fs_add_dir_block</strong> <em>(ext2_dblist <var>dblist</var>, ext2_ino_t <var>ino</var>, blk_t <var>blk</var>, int <var>blockcnt</var>)</em></dt>
<dd>
<p>Add an entry to the dblist data structure. This call records the fact
that block number <var>blockcnt</var> of directory inode <var>ino</var> is stored
in block <var>blk</var>.
</p></dd></dl>
<dl>
<dt><a name="index-ext2fs_005fset_005fdir_005fblock"></a>Function: <em>errcode_t</em> <strong>ext2fs_set_dir_block</strong> <em>(ext2_dblist <var>dblist</var>, ext2_ino_t <var>ino</var>, blk_t <var>blk</var>, int <var>blockcnt</var>)</em></dt>
<dd>
<p>Change an entry in the dblist data structure; this changes the location
of block number <var>blockcnt</var> of directory indoe <var>ino</var> to be block
<var>blk</var>.
</p></dd></dl>
<dl>
<dt><a name="index-ext2fs_005fdblist_005fiterate"></a>Function: <em>errcode_t</em> <strong>ext2fs_dblist_iterate</strong> <em>(ext2_dblist <var>dblist</var>, int (*func)(ext2_filsys <var>fs</var>, struct ext2_db_entry *<var>db_info</var>, void *<var>private</var>), void *<var>private</var>)</em></dt>
<dd>
<p>This iterator calls <var>func</var> for every entry in the dblist data structure.
</p></dd></dl>
<dl>
<dt><a name="index-ext2fs_005fdblist_005fdir_005fiterate"></a>Function: <em>errcode_t</em> <strong>ext2fs_dblist_dir_iterate</strong> <em>(ext2_dblist <var>dblist</var>, int flags, char *<var>block_buf</var>, int (*func)(ext2_ino_t <var>dir</var>, int <var>entry</var>, struct ext2_dir_entry *<var>dirent</var>, int <var>offset</var>, int <var>blocksize</var>, char *<var>buf</var>, void *<var>private</var>), void *<var>private</var>)</em></dt>
<dd>
<p>This iterator takes reads in the directory block indicated in each
dblist entry, and calls <var>func</var> for each directory entry in each
directory block. If <var>dblist</var> contains all the directory blocks in a
filesystem, this function provides a convenient way to iterate over all
directory entries for that filesystem.
</p></dd></dl>
<hr>
<a name="Inode-count-functions"></a>
<div class="header">
<p>
Previous: <a href="#Directory_002dblock-list-management" accesskey="p" rel="prev">Directory-block list management</a>, Up: <a href="#EXT2-data-abstractions" accesskey="u" rel="up">EXT2 data abstractions</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Inode-count-functions-1"></a>
<h4 class="subsection">2.6.3 Inode count functions</h4>
<p>The icount abstraction is a specialized data type used by <code>e2fsck</code>
to store how many times a particular inode is referenced by the
filesystem. This is used twice; once to store the actual number of times
that the inode is reference; and once to store the claimed number of times
the inode is referenced according to the inode structure.
</p>
<p>This abstraction is designed to be extremely efficient for storing this
sort of information, by taking advantage of the following properties of
inode counts, namely (1) inode counts are very often zero (because
the inode is currrently not in use), and (2) many files have a inode
count of 1 (because they are a file which has no additional hard links).
</p>
<dl>
<dt><a name="index-ext2fs_005fcreate_005ficount2"></a>Function: <em>errcode_t</em> <strong>ext2fs_create_icount2</strong> <em>(ext2_filsys <var>fs</var>, int <var>flags</var>, int <var>size</var>, ext2_icount_t <var>hint</var>, ext2_icount_t *<var>ret</var>)</em></dt>
<dd>
<p>Creates an icount stucture for a filesystem <var>fs</var>, with initial space
for <var>size</var> inodes whose count is greater than 1. The <var>flags</var>
parameter is either 0 or <code>EXT2_ICOUNT_OPT_INCREMENT</code>, which
indicates that icount structure should be able to increment inode counts
quickly. The icount structure is returned in <var>ret</var>. The returned
icount structure initially has a count of zero for all inodes.
</p>
<p>The <var>hint</var> parameter allows the caller to optionally pass in another
icount structure which is used to initialize the array of inodes whose
count is greater than 1. It is used purely as a speed optimization so
that the icount structure can determine in advance which inodes are
likely to contain a count grater than 1.
</p></dd></dl>
<dl>
<dt><a name="index-ext2fs_005ffree_005ficount"></a>Function: <em>void</em> <strong>ext2fs_free_icount</strong> <em>(ext2_icount_t <var>icount</var>)</em></dt>
<dd>
<p>Frees an icount structure.
</p></dd></dl>
<dl>
<dt><a name="index-ext2fs_005ficount_005ffetch"></a>Function: <em>errcode_t</em> <strong>ext2fs_icount_fetch</strong> <em>(ext2_icount_t <var>icount</var>, ext2_ino_t <var>ino</var>, __u16 *<var>ret</var>)</em></dt>
<dd>
<p>Returns in <var>ret</var> fetches the count for a particular inode <var>ino</var>.
</p></dd></dl>
<dl>
<dt><a name="index-ext2fs_005ficount_005fincrement"></a>Function: <em>errcode_t</em> <strong>ext2fs_icount_increment</strong> <em>(ext2_icount_t <var>icount</var>, ext2_ino_t <var>ino</var>, __u16 *<var>ret</var>)</em></dt>
<dd>
<p>Increments the ref count for inode <var>ino</var>.
</p></dd></dl>
<dl>
<dt><a name="index-ext2fs_005ficount_005fdecrement"></a>Function: <em>errcode_t</em> <strong>ext2fs_icount_decrement</strong> <em>(ext2_icount_t <var>icount</var>, ext2_ino_t <var>ino</var>, __u16 *<var>ret</var>)</em></dt>
<dd>
<p>Decrements the ref count for inode <var>ino</var>.
</p></dd></dl>
<dl>
<dt><a name="index-ext2fs_005ficount_005fstore"></a>Function: <em>errcode_t</em> <strong>ext2fs_icount_store</strong> <em>(ext2_icount_t <var>icount</var>, ext2_ino_t <var>ino</var>, __u16 <var>count</var>)</em></dt>
<dd>
<p>Sets the reference count for inode <var>ino</var> to be <var>count</var>.
</p></dd></dl>
<dl>
<dt><a name="index-ext2fs_005fget_005ficount_005fsize"></a>Function: <em>ext2_ino_t</em> <strong>ext2fs_get_icount_size</strong> <em>(ext2_icount_t <var>icount</var>)</em></dt>
<dd>
<p>Returns the current number of inodes in <var>icount</var> which has a count
greater than 1.
</p></dd></dl>
<dl>
<dt><a name="index-ext2fs_005ficount_005fvalidate"></a>Function: <em>errcode_t</em> <strong>ext2fs_icount_validate</strong> <em>(ext2_icount_t <var>icount</var>, FILE *<var>f</var>)</em></dt>
<dd>
<p>Validates the internal rep invariant of <var>icount</var>; if there are any
problems, print out debugging information to <var>f</var>. This function is
intended for debugging and testing use only.
</p></dd></dl>
<hr>
<a name="Byte_002dswapping-functions"></a>
<div class="header">
<p>
Next: <a href="#Other-functions" accesskey="n" rel="next">Other functions</a>, Previous: <a href="#EXT2-data-abstractions" accesskey="p" rel="prev">EXT2 data abstractions</a>, Up: <a href="#EXT2FS-Library-Functions" accesskey="u" rel="up">EXT2FS Library Functions</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Byte_002dswapping-functions-1"></a>
<h3 class="section">2.7 Byte-swapping functions</h3>
<dl>
<dt><a name="index-ext2fs_005fswap_005fsuper"></a>Function: <em>void</em> <strong>ext2fs_swap_super</strong> <em>(struct ext2_super_block * <var>super</var>)</em></dt>
</dl>
<dl>
<dt><a name="index-ext2fs_005fswap_005fgroup_005fdesc"></a>Function: <em>void</em> <strong>ext2fs_swap_group_desc</strong> <em>(struct ext2_group_desc *<var>gdp</var>)</em></dt>
</dl>
<dl>
<dt><a name="index-ext2fs_005fswap_005finode"></a>Function: <em>void</em> <strong>ext2fs_swap_inode</strong> <em>(ext2_filsys <var>fs</var>, struct ext2_inode *<var>to</var>, struct ext2_inode *<var>from</var>, int <var>hostorder</var>)</em></dt>
</dl>
<dl>
<dt><a name="index-ext2fs_005fnative_005fflag"></a>Function: <em>int</em> <strong>ext2fs_native_flag</strong> <em>(void)</em></dt>
</dl>
<hr>
<a name="Other-functions"></a>
<div class="header">
<p>
Previous: <a href="#Byte_002dswapping-functions" accesskey="p" rel="prev">Byte-swapping functions</a>, Up: <a href="#EXT2FS-Library-Functions" accesskey="u" rel="up">EXT2FS Library Functions</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Other-functions-1"></a>
<h3 class="section">2.8 Other functions</h3>
<p>/* alloc.c */
</p><dl>
<dt><a name="index-ext2fs_005fnew_005finode"></a>Function: <em>errcode_t</em> <strong>ext2fs_new_inode</strong> <em>(ext2_filsys <var>fs</var>, ext2_ino_t <var>dir</var>, int <var>mode</var>, ext2fs_inode_bitmap <var>map</var>, ext2_ino_t *<var>ret</var>)</em></dt>
</dl>
<dl>
<dt><a name="index-ext2fs_005fnew_005fblock"></a>Function: <em>errcode_t</em> <strong>ext2fs_new_block</strong> <em>(ext2_filsys <var>fs</var>, blk_t <var>goal</var>, ext2fs_block_bitmap <var>map</var>, blk_t *<var>ret</var>)</em></dt>
</dl>
<dl>
<dt><a name="index-ext2fs_005fget_005ffree_005fblocks"></a>Function: <em>errcode_t</em> <strong>ext2fs_get_free_blocks</strong> <em>(ext2_filsys <var>fs</var>, blk_t <var>start</var>, blk_t <var>finish</var>, int <var>num</var>, ext2fs_block_bitmap <var>map</var>, blk_t *<var>ret</var>)</em></dt>
</dl>
<p>/* check_desc.c */
</p><dl>
<dt><a name="index-ext2fs_005fcheck_005fdesc"></a>Function: <em>errcode_t</em> <strong>ext2fs_check_desc</strong> <em>(ext2_filsys <var>fs</var>)</em></dt>
</dl>
<dl>
<dt><a name="index-ext2fs_005fget_005fnum_005fdirs"></a>Function: <em>errcode_t</em> <strong>ext2fs_get_num_dirs</strong> <em>(ext2_filsys <var>fs</var>, ext2_ino_t *<var>ret_num_dirs</var>)</em></dt>
</dl>
<p>/* getsize.c */
</p><dl>
<dt><a name="index-ext2fs_005fget_005fdevice_005fsize"></a>Function: <em>errcode_t</em> <strong>ext2fs_get_device_size</strong> <em>(const char *<var>file</var>, int <var>blocksize</var>, blk_t *<var>retblocks</var>)</em></dt>
</dl>
<p>/* ismounted.c */
</p><dl>
<dt><a name="index-ext2fs_005fcheck_005fif_005fmounted"></a>Function: <em>errcode_t</em> <strong>ext2fs_check_if_mounted</strong> <em>(const char *<var>file</var>, int *<var>mount_flags</var>)</em></dt>
</dl>
<p>/* version.c */
</p>
<dl>
<dt><a name="index-ext2fs_005fget_005flibrary_005fversion"></a>Function: <em>int</em> <strong>ext2fs_get_library_version</strong> <em>(const char **<var>ver_string</var>, const char **<var>date_string</var>)</em></dt>
<dd>
<p>This function returns the current version of the ext2 library. The
return value contains an integer version code, which consists of the
major version number of the library multiplied by 100, plus the minor
version number of the library. Hence, if the library version is 1.08,
the returned value will be 108.
</p>
<p>If <var>ver_string</var> and/or <var>date_string</var> are non-NULL, they will be
set to point at a constant string containing the library version and/or
release date, respectively.
</p></dd></dl>
<dl>
<dt><a name="index-ext2fs_005fparse_005fversion_005fstring"></a>Function: <em>int</em> <strong>ext2fs_parse_version_string</strong> <em>(const char *<var>ver_string</var>)</em></dt>
<dd>
<p>This function takes a version string which may included in an
application and returns a version code using the same algorithm used by
<code>ext2fs_get_library_version</code>. It can be used by programs included
in the <code>e2fsprogs</code> distribution to assure that they are using an
up-to-date ext2 shared library.
</p></dd></dl>
<p>/* inline functions */
</p><dl>
<dt><a name="index-ext2fs_005fgroup_005fof_005fblk"></a>Function: <em>int</em> <strong>ext2fs_group_of_blk</strong> <em>(ext2_filsys <var>fs</var>, blk_t <var>blk</var>)</em></dt>
<dd>
<p>This function returns the block group which contains the block <var>blk</var>.
</p>
</dd></dl>
<dl>
<dt><a name="index-ext2fs_005fgroup_005fof_005fino"></a>Function: <em>int</em> <strong>ext2fs_group_of_ino</strong> <em>(ext2_filsys <var>fs</var>, ext2_ino_t <var>ino</var>)</em></dt>
<dd>
<p>This function returns the block group which contains the inode <var>ino</var>.
</p></dd></dl>
<hr>
<a name="Concept-Index"></a>
<div class="header">
<p>
Next: <a href="#Function-Index" accesskey="n" rel="next">Function Index</a>, Previous: <a href="#EXT2FS-Library-Functions" accesskey="p" rel="prev">EXT2FS Library Functions</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Concept-Index-1"></a>
<h2 class="unnumbered">Concept Index</h2>
<hr>
<a name="Function-Index"></a>
<div class="header">
<p>
Previous: <a href="#Concept-Index" accesskey="p" rel="prev">Concept Index</a>, Up: <a href="#Top" accesskey="u" rel="up">Top</a> [<a href="#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<a name="Function-and-Type-Index"></a>
<h2 class="unnumbered">Function and Type Index</h2>
<table><tr><th valign="top">Jump to: </th><td><a class="summary-letter" href="#Function-Index_fn_letter-E"><b>E</b></a>
</td></tr></table>
<table class="index-fn" border="0">
<tr><td></td><th align="left">Index Entry</th><td> </td><th align="left"> Section</th></tr>
<tr><td colspan="4"> <hr></td></tr>
<tr><th><a name="Function-Index_fn_letter-E">E</a></th><td></td><td></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fadd_005fdir_005fblock"><code>ext2fs_add_dir_block</code></a>:</td><td> </td><td valign="top"><a href="#Directory_002dblock-list-management">Directory-block list management</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fallocate_005fblock_005fbitmap"><code>ext2fs_allocate_block_bitmap</code></a>:</td><td> </td><td valign="top"><a href="#Allocating-Bitmaps">Allocating Bitmaps</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fallocate_005fgeneric_005fbitmap"><code>ext2fs_allocate_generic_bitmap</code></a>:</td><td> </td><td valign="top"><a href="#Allocating-Bitmaps">Allocating Bitmaps</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fallocate_005finode_005fbitmap"><code>ext2fs_allocate_inode_bitmap</code></a>:</td><td> </td><td valign="top"><a href="#Allocating-Bitmaps">Allocating Bitmaps</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fallocate_005ftables"><code>ext2fs_allocate_tables</code></a>:</td><td> </td><td valign="top"><a href="#Initializing-a-filesystem">Initializing a filesystem</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fbadblocks_005flist_005fadd"><code>ext2fs_badblocks_list_add</code></a>:</td><td> </td><td valign="top"><a href="#Badblocks-list-management">Badblocks list management</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fbadblocks_005flist_005fcreate"><code>ext2fs_badblocks_list_create</code></a>:</td><td> </td><td valign="top"><a href="#Badblocks-list-management">Badblocks list management</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fbadblocks_005flist_005ffree"><code>ext2fs_badblocks_list_free</code></a>:</td><td> </td><td valign="top"><a href="#Badblocks-list-management">Badblocks list management</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fbadblocks_005flist_005fiterate"><code>ext2fs_badblocks_list_iterate</code></a>:</td><td> </td><td valign="top"><a href="#Badblocks-list-management">Badblocks list management</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fbadblocks_005flist_005fiterate_005fbegin"><code>ext2fs_badblocks_list_iterate_begin</code></a>:</td><td> </td><td valign="top"><a href="#Badblocks-list-management">Badblocks list management</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fbadblocks_005flist_005fiterate_005fend"><code>ext2fs_badblocks_list_iterate_end</code></a>:</td><td> </td><td valign="top"><a href="#Badblocks-list-management">Badblocks list management</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fbadblocks_005flist_005ftest"><code>ext2fs_badblocks_list_test</code></a>:</td><td> </td><td valign="top"><a href="#Badblocks-list-management">Badblocks list management</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fblock_005fiterate"><code>ext2fs_block_iterate</code></a>:</td><td> </td><td valign="top"><a href="#Iterating-over-blocks-in-an-inode">Iterating over blocks in an inode</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fblock_005fiterate2"><code>ext2fs_block_iterate2</code></a>:</td><td> </td><td valign="top"><a href="#Iterating-over-blocks-in-an-inode">Iterating over blocks in an inode</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fcheck_005fdesc"><code>ext2fs_check_desc</code></a>:</td><td> </td><td valign="top"><a href="#Other-functions">Other functions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fcheck_005fdirectory"><code>ext2fs_check_directory</code></a>:</td><td> </td><td valign="top"><a href="#Inode-Convenience-Functions">Inode Convenience Functions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fcheck_005fif_005fmounted"><code>ext2fs_check_if_mounted</code></a>:</td><td> </td><td valign="top"><a href="#Other-functions">Other functions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fclear_005fblock_005fbitmap"><code>ext2fs_clear_block_bitmap</code></a>:</td><td> </td><td valign="top"><a href="#Clearing-Bitmaps">Clearing Bitmaps</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fclear_005finode_005fbitmap"><code>ext2fs_clear_inode_bitmap</code></a>:</td><td> </td><td valign="top"><a href="#Clearing-Bitmaps">Clearing Bitmaps</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fclose"><code>ext2fs_close</code></a>:</td><td> </td><td valign="top"><a href="#Closing-and-flushing-out-changes">Closing and flushing out changes</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fclose_005finode_005fscan"><code>ext2fs_close_inode_scan</code></a>:</td><td> </td><td valign="top"><a href="#Iterating-over-inodes-in-a-filesystem">Iterating over inodes in a filesystem</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fcompare_005fblock_005fbitmap"><code>ext2fs_compare_block_bitmap</code></a>:</td><td> </td><td valign="top"><a href="#Comparing-bitmaps">Comparing bitmaps</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fcompare_005finode_005fbitmap"><code>ext2fs_compare_inode_bitmap</code></a>:</td><td> </td><td valign="top"><a href="#Comparing-bitmaps">Comparing bitmaps</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fcreate_005ficount2"><code>ext2fs_create_icount2</code></a>:</td><td> </td><td valign="top"><a href="#Inode-count-functions">Inode count functions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fdblist_005fdir_005fiterate"><code>ext2fs_dblist_dir_iterate</code></a>:</td><td> </td><td valign="top"><a href="#Directory_002dblock-list-management">Directory-block list management</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fdblist_005fiterate"><code>ext2fs_dblist_iterate</code></a>:</td><td> </td><td valign="top"><a href="#Directory_002dblock-list-management">Directory-block list management</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fdir_005fiterate"><code>ext2fs_dir_iterate</code></a>:</td><td> </td><td valign="top"><a href="#Iterating-over-a-directory">Iterating over a directory</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fexpand_005fdir"><code>ext2fs_expand_dir</code></a>:</td><td> </td><td valign="top"><a href="#Creating-and-expanding-directories">Creating and expanding directories</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005ffast_005fmark_005fblock_005fbitmap"><code>ext2fs_fast_mark_block_bitmap</code></a>:</td><td> </td><td valign="top"><a href="#Bitmap-Operations">Bitmap Operations</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005ffast_005fmark_005finode_005fbitmap"><code>ext2fs_fast_mark_inode_bitmap</code></a>:</td><td> </td><td valign="top"><a href="#Bitmap-Operations">Bitmap Operations</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005ffast_005ftest_005fblock_005fbitmap"><code>ext2fs_fast_test_block_bitmap</code></a>:</td><td> </td><td valign="top"><a href="#Bitmap-Operations">Bitmap Operations</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005ffast_005ftest_005finode_005fbitmap"><code>ext2fs_fast_test_inode_bitmap</code></a>:</td><td> </td><td valign="top"><a href="#Bitmap-Operations">Bitmap Operations</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005ffast_005funmark_005fblock_005fbitmap"><code>ext2fs_fast_unmark_block_bitmap</code></a>:</td><td> </td><td valign="top"><a href="#Bitmap-Operations">Bitmap Operations</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005ffast_005funmark_005finode_005fbitmap"><code>ext2fs_fast_unmark_inode_bitmap</code></a>:</td><td> </td><td valign="top"><a href="#Bitmap-Operations">Bitmap Operations</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005ffile_005fclose"><code>ext2fs_file_close</code></a>:</td><td> </td><td valign="top"><a href="#File-handle-manipulation">File handle manipulation</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005ffile_005fflush"><code>ext2fs_file_flush</code></a>:</td><td> </td><td valign="top"><a href="#File-handle-manipulation">File handle manipulation</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005ffile_005fget_005ffs"><code>ext2fs_file_get_fs</code></a>:</td><td> </td><td valign="top"><a href="#File-handle-manipulation">File handle manipulation</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005ffile_005fget_005flsize"><code>ext2fs_file_get_lsize</code></a>:</td><td> </td><td valign="top"><a href="#Getting-the-file-size">Getting the file size</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005ffile_005fget_005fsize"><code>ext2fs_file_get_size</code></a>:</td><td> </td><td valign="top"><a href="#Getting-the-file-size">Getting the file size</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005ffile_005fllseek"><code>ext2fs_file_llseek</code></a>:</td><td> </td><td valign="top"><a href="#Changing-the-file-offset">Changing the file offset</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005ffile_005flseek"><code>ext2fs_file_lseek</code></a>:</td><td> </td><td valign="top"><a href="#Changing-the-file-offset">Changing the file offset</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005ffile_005fopen"><code>ext2fs_file_open</code></a>:</td><td> </td><td valign="top"><a href="#File-handle-manipulation">File handle manipulation</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005ffile_005fopen2"><code>ext2fs_file_open2</code></a>:</td><td> </td><td valign="top"><a href="#File-handle-manipulation">File handle manipulation</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005ffile_005fread"><code>ext2fs_file_read</code></a>:</td><td> </td><td valign="top"><a href="#Reading-and-writing-data">Reading and writing data</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005ffile_005fwrite"><code>ext2fs_file_write</code></a>:</td><td> </td><td valign="top"><a href="#Reading-and-writing-data">Reading and writing data</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fflush"><code>ext2fs_flush</code></a>:</td><td> </td><td valign="top"><a href="#Closing-and-flushing-out-changes">Closing and flushing out changes</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005ffollow_005flink"><code>ext2fs_follow_link</code></a>:</td><td> </td><td valign="top"><a href="#Looking-up-filenames">Looking up filenames</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005ffree"><code>ext2fs_free</code></a>:</td><td> </td><td valign="top"><a href="#Closing-and-flushing-out-changes">Closing and flushing out changes</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005ffree_005fblock_005fbitmap"><code>ext2fs_free_block_bitmap</code></a>:</td><td> </td><td valign="top"><a href="#Free-bitmaps">Free bitmaps</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005ffree_005fdblist"><code>ext2fs_free_dblist</code></a>:</td><td> </td><td valign="top"><a href="#Directory_002dblock-list-management">Directory-block list management</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005ffree_005fgeneric_005fbitmap"><code>ext2fs_free_generic_bitmap</code></a>:</td><td> </td><td valign="top"><a href="#Free-bitmaps">Free bitmaps</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005ffree_005ficount"><code>ext2fs_free_icount</code></a>:</td><td> </td><td valign="top"><a href="#Inode-count-functions">Inode count functions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005ffree_005finode_005fbitmap"><code>ext2fs_free_inode_bitmap</code></a>:</td><td> </td><td valign="top"><a href="#Free-bitmaps">Free bitmaps</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005ffudge_005fblock_005fbitmap_005fend"><code>ext2fs_fudge_block_bitmap_end</code></a>:</td><td> </td><td valign="top"><a href="#Modifying-Bitmaps">Modifying Bitmaps</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005ffudge_005finode_005fbitmap_005fend"><code>ext2fs_fudge_inode_bitmap_end</code></a>:</td><td> </td><td valign="top"><a href="#Modifying-Bitmaps">Modifying Bitmaps</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fget_005fblocks"><code>ext2fs_get_blocks</code></a>:</td><td> </td><td valign="top"><a href="#Inode-Convenience-Functions">Inode Convenience Functions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fget_005fblock_005fbitmap_005fend"><code>ext2fs_get_block_bitmap_end</code></a>:</td><td> </td><td valign="top"><a href="#Bitmap-Operations">Bitmap Operations</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fget_005fblock_005fbitmap_005fstart"><code>ext2fs_get_block_bitmap_start</code></a>:</td><td> </td><td valign="top"><a href="#Bitmap-Operations">Bitmap Operations</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fget_005fdevice_005fsize"><code>ext2fs_get_device_size</code></a>:</td><td> </td><td valign="top"><a href="#Other-functions">Other functions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fget_005ffree_005fblocks"><code>ext2fs_get_free_blocks</code></a>:</td><td> </td><td valign="top"><a href="#Other-functions">Other functions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fget_005ficount_005fsize"><code>ext2fs_get_icount_size</code></a>:</td><td> </td><td valign="top"><a href="#Inode-count-functions">Inode count functions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fget_005finode_005fbitmap_005fend"><code>ext2fs_get_inode_bitmap_end</code></a>:</td><td> </td><td valign="top"><a href="#Bitmap-Operations">Bitmap Operations</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fget_005finode_005fbitmap_005fstart"><code>ext2fs_get_inode_bitmap_start</code></a>:</td><td> </td><td valign="top"><a href="#Bitmap-Operations">Bitmap Operations</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fget_005flibrary_005fversion"><code>ext2fs_get_library_version</code></a>:</td><td> </td><td valign="top"><a href="#Other-functions">Other functions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fget_005fnext_005finode"><code>ext2fs_get_next_inode</code></a>:</td><td> </td><td valign="top"><a href="#Iterating-over-inodes-in-a-filesystem">Iterating over inodes in a filesystem</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fget_005fnum_005fdirs"><code>ext2fs_get_num_dirs</code></a>:</td><td> </td><td valign="top"><a href="#Other-functions">Other functions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fget_005fpathname"><code>ext2fs_get_pathname</code></a>:</td><td> </td><td valign="top"><a href="#Translating-inode-numbers-to-filenames">Translating inode numbers to filenames</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fgroup_005fof_005fblk"><code>ext2fs_group_of_blk</code></a>:</td><td> </td><td valign="top"><a href="#Other-functions">Other functions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fgroup_005fof_005fino"><code>ext2fs_group_of_ino</code></a>:</td><td> </td><td valign="top"><a href="#Other-functions">Other functions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005ficount_005fdecrement"><code>ext2fs_icount_decrement</code></a>:</td><td> </td><td valign="top"><a href="#Inode-count-functions">Inode count functions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005ficount_005ffetch"><code>ext2fs_icount_fetch</code></a>:</td><td> </td><td valign="top"><a href="#Inode-count-functions">Inode count functions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005ficount_005fincrement"><code>ext2fs_icount_increment</code></a>:</td><td> </td><td valign="top"><a href="#Inode-count-functions">Inode count functions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005ficount_005fstore"><code>ext2fs_icount_store</code></a>:</td><td> </td><td valign="top"><a href="#Inode-count-functions">Inode count functions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005ficount_005fvalidate"><code>ext2fs_icount_validate</code></a>:</td><td> </td><td valign="top"><a href="#Inode-count-functions">Inode count functions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005finitialize"><code>ext2fs_initialize</code></a>:</td><td> </td><td valign="top"><a href="#Initializing-a-filesystem">Initializing a filesystem</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005finit_005fdblist"><code>ext2fs_init_dblist</code></a>:</td><td> </td><td valign="top"><a href="#Directory_002dblock-list-management">Directory-block list management</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005finode_005fhas_005fvalid_005fblocks"><code>ext2fs_inode_has_valid_blocks</code></a>:</td><td> </td><td valign="top"><a href="#Inode-Convenience-Functions">Inode Convenience Functions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005finode_005fscan_005fflags"><code>ext2fs_inode_scan_flags</code></a>:</td><td> </td><td valign="top"><a href="#Iterating-over-inodes-in-a-filesystem">Iterating over inodes in a filesystem</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005finode_005fscan_005fgoto_005fblockgroup"><code>ext2fs_inode_scan_goto_blockgroup</code></a>:</td><td> </td><td valign="top"><a href="#Iterating-over-inodes-in-a-filesystem">Iterating over inodes in a filesystem</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005flink"><code>ext2fs_link</code></a>:</td><td> </td><td valign="top"><a href="#Creating-and-removing-directory-entries">Creating and removing directory entries</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005flookup"><code>ext2fs_lookup</code></a>:</td><td> </td><td valign="top"><a href="#Looking-up-filenames">Looking up filenames</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fmark_005fbb_005fdirty"><code>ext2fs_mark_bb_dirty</code></a>:</td><td> </td><td valign="top"><a href="#Filesystem-flag-functions">Filesystem flag functions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fmark_005fblock_005fbitmap"><code>ext2fs_mark_block_bitmap</code></a>:</td><td> </td><td valign="top"><a href="#Bitmap-Operations">Bitmap Operations</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fmark_005fchanged"><code>ext2fs_mark_changed</code></a>:</td><td> </td><td valign="top"><a href="#Filesystem-flag-functions">Filesystem flag functions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fmark_005fib_005fdirty"><code>ext2fs_mark_ib_dirty</code></a>:</td><td> </td><td valign="top"><a href="#Filesystem-flag-functions">Filesystem flag functions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fmark_005finode_005fbitmap"><code>ext2fs_mark_inode_bitmap</code></a>:</td><td> </td><td valign="top"><a href="#Bitmap-Operations">Bitmap Operations</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fmark_005fsuper_005fdirty"><code>ext2fs_mark_super_dirty</code></a>:</td><td> </td><td valign="top"><a href="#Filesystem-flag-functions">Filesystem flag functions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fmark_005fvalid"><code>ext2fs_mark_valid</code></a>:</td><td> </td><td valign="top"><a href="#Filesystem-flag-functions">Filesystem flag functions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fmkdir"><code>ext2fs_mkdir</code></a>:</td><td> </td><td valign="top"><a href="#Creating-and-expanding-directories">Creating and expanding directories</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fnamei"><code>ext2fs_namei</code></a>:</td><td> </td><td valign="top"><a href="#Looking-up-filenames">Looking up filenames</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fnamei_005ffollow"><code>ext2fs_namei_follow</code></a>:</td><td> </td><td valign="top"><a href="#Looking-up-filenames">Looking up filenames</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fnative_005fflag"><code>ext2fs_native_flag</code></a>:</td><td> </td><td valign="top"><a href="#Byte_002dswapping-functions">Byte-swapping functions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fnew_005fblock"><code>ext2fs_new_block</code></a>:</td><td> </td><td valign="top"><a href="#Other-functions">Other functions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fnew_005fdir_005fblock"><code>ext2fs_new_dir_block</code></a>:</td><td> </td><td valign="top"><a href="#Directory-block-functions">Directory block functions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fnew_005finode"><code>ext2fs_new_inode</code></a>:</td><td> </td><td valign="top"><a href="#Other-functions">Other functions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fopen"><code>ext2fs_open</code></a>:</td><td> </td><td valign="top"><a href="#Opening-an-ext2-filesystem">Opening an ext2 filesystem</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fopen_005finode_005fscan"><code>ext2fs_open_inode_scan</code></a>:</td><td> </td><td valign="top"><a href="#Iterating-over-inodes-in-a-filesystem">Iterating over inodes in a filesystem</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fparse_005fversion_005fstring"><code>ext2fs_parse_version_string</code></a>:</td><td> </td><td valign="top"><a href="#Other-functions">Other functions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fread_005fbb_005fFILE"><code>ext2fs_read_bb_FILE</code></a>:</td><td> </td><td valign="top"><a href="#Badblocks-list-management">Badblocks list management</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fread_005fbb_005finode"><code>ext2fs_read_bb_inode</code></a>:</td><td> </td><td valign="top"><a href="#Badblocks-list-management">Badblocks list management</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fread_005fbitmaps"><code>ext2fs_read_bitmaps</code></a>:</td><td> </td><td valign="top"><a href="#Reading-and-Writing-Bitmaps">Reading and Writing Bitmaps</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fread_005fblock_005fbitmap"><code>ext2fs_read_block_bitmap</code></a>:</td><td> </td><td valign="top"><a href="#Reading-and-Writing-Bitmaps">Reading and Writing Bitmaps</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fread_005fdir_005fblock"><code>ext2fs_read_dir_block</code></a>:</td><td> </td><td valign="top"><a href="#Directory-block-functions">Directory block functions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fread_005finode"><code>ext2fs_read_inode</code></a>:</td><td> </td><td valign="top"><a href="#Reading-and-writing-inodes">Reading and writing inodes</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fread_005finode_005fbitmap"><code>ext2fs_read_inode_bitmap</code></a>:</td><td> </td><td valign="top"><a href="#Reading-and-Writing-Bitmaps">Reading and Writing Bitmaps</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fresize_005fblock_005fbitmap"><code>ext2fs_resize_block_bitmap</code></a>:</td><td> </td><td valign="top"><a href="#Resizing-Bitmaps">Resizing Bitmaps</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fresize_005fgeneric_005fbitmap"><code>ext2fs_resize_generic_bitmap</code></a>:</td><td> </td><td valign="top"><a href="#Resizing-Bitmaps">Resizing Bitmaps</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fresize_005finode_005fbitmap"><code>ext2fs_resize_inode_bitmap</code></a>:</td><td> </td><td valign="top"><a href="#Resizing-Bitmaps">Resizing Bitmaps</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fset_005fdir_005fblock"><code>ext2fs_set_dir_block</code></a>:</td><td> </td><td valign="top"><a href="#Directory_002dblock-list-management">Directory-block list management</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fset_005finode_005fcallback"><code>ext2fs_set_inode_callback</code></a>:</td><td> </td><td valign="top"><a href="#Iterating-over-inodes-in-a-filesystem">Iterating over inodes in a filesystem</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fswap_005fgroup_005fdesc"><code>ext2fs_swap_group_desc</code></a>:</td><td> </td><td valign="top"><a href="#Byte_002dswapping-functions">Byte-swapping functions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fswap_005finode"><code>ext2fs_swap_inode</code></a>:</td><td> </td><td valign="top"><a href="#Byte_002dswapping-functions">Byte-swapping functions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fswap_005fsuper"><code>ext2fs_swap_super</code></a>:</td><td> </td><td valign="top"><a href="#Byte_002dswapping-functions">Byte-swapping functions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005ftest_005fbb_005fdirty"><code>ext2fs_test_bb_dirty</code></a>:</td><td> </td><td valign="top"><a href="#Filesystem-flag-functions">Filesystem flag functions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005ftest_005fblock_005fbitmap"><code>ext2fs_test_block_bitmap</code></a>:</td><td> </td><td valign="top"><a href="#Bitmap-Operations">Bitmap Operations</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005ftest_005fchanged"><code>ext2fs_test_changed</code></a>:</td><td> </td><td valign="top"><a href="#Filesystem-flag-functions">Filesystem flag functions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005ftest_005fib_005fdirty"><code>ext2fs_test_ib_dirty</code></a>:</td><td> </td><td valign="top"><a href="#Filesystem-flag-functions">Filesystem flag functions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005ftest_005finode_005fbitmap"><code>ext2fs_test_inode_bitmap</code></a>:</td><td> </td><td valign="top"><a href="#Bitmap-Operations">Bitmap Operations</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005ftest_005fvalid"><code>ext2fs_test_valid</code></a>:</td><td> </td><td valign="top"><a href="#Filesystem-flag-functions">Filesystem flag functions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005funlink"><code>ext2fs_unlink</code></a>:</td><td> </td><td valign="top"><a href="#Creating-and-removing-directory-entries">Creating and removing directory entries</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005funmark_005fblock_005fbitmap"><code>ext2fs_unmark_block_bitmap</code></a>:</td><td> </td><td valign="top"><a href="#Bitmap-Operations">Bitmap Operations</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005funmark_005finode_005fbitmap"><code>ext2fs_unmark_inode_bitmap</code></a>:</td><td> </td><td valign="top"><a href="#Bitmap-Operations">Bitmap Operations</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005funmark_005fvalid"><code>ext2fs_unmark_valid</code></a>:</td><td> </td><td valign="top"><a href="#Filesystem-flag-functions">Filesystem flag functions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fupdate_005fbb_005finode"><code>ext2fs_update_bb_inode</code></a>:</td><td> </td><td valign="top"><a href="#Badblocks-list-management">Badblocks list management</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fwrite_005fbitmaps"><code>ext2fs_write_bitmaps</code></a>:</td><td> </td><td valign="top"><a href="#Reading-and-Writing-Bitmaps">Reading and Writing Bitmaps</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fwrite_005fblock_005fbitmap"><code>ext2fs_write_block_bitmap</code></a>:</td><td> </td><td valign="top"><a href="#Reading-and-Writing-Bitmaps">Reading and Writing Bitmaps</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fwrite_005fdir_005fblock"><code>ext2fs_write_dir_block</code></a>:</td><td> </td><td valign="top"><a href="#Directory-block-functions">Directory block functions</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fwrite_005finode"><code>ext2fs_write_inode</code></a>:</td><td> </td><td valign="top"><a href="#Reading-and-writing-inodes">Reading and writing inodes</a></td></tr>
<tr><td></td><td valign="top"><a href="#index-ext2fs_005fwrite_005finode_005fbitmap"><code>ext2fs_write_inode_bitmap</code></a>:</td><td> </td><td valign="top"><a href="#Reading-and-Writing-Bitmaps">Reading and Writing Bitmaps</a></td></tr>
<tr><td colspan="4"> <hr></td></tr>
</table>
<table><tr><th valign="top">Jump to: </th><td><a class="summary-letter" href="#Function-Index_fn_letter-E"><b>E</b></a>
</td></tr></table>
<a name="SEC_Contents"></a>
<h2 class="contents-heading">Table of Contents</h2>
<div class="contents">
<ul class="no-bullet">
<li><a name="toc-Introduction-to-the-EXT2FS-Library-1" href="#Introduction-to-the-EXT2FS-Library">1 Introduction to the EXT2FS Library</a></li>
<li><a name="toc-EXT2FS-Library-Functions-1" href="#EXT2FS-Library-Functions">2 EXT2FS Library Functions</a>
<ul class="no-bullet">
<li><a name="toc-Filesystem_002dlevel-functions-1" href="#Filesystem_002dlevel-functions">2.1 Filesystem-level functions</a>
<ul class="no-bullet">
<li><a name="toc-Opening-an-ext2-filesystem-1" href="#Opening-an-ext2-filesystem">2.1.1 Opening an ext2 filesystem</a></li>
<li><a name="toc-Closing-and-flushing-out-changes-1" href="#Closing-and-flushing-out-changes">2.1.2 Closing and flushing out changes</a></li>
<li><a name="toc-Initializing-a-filesystem-1" href="#Initializing-a-filesystem">2.1.3 Initializing a filesystem</a></li>
<li><a name="toc-Filesystem-flag-functions-1" href="#Filesystem-flag-functions">2.1.4 Filesystem flag functions</a></li>
</ul></li>
<li><a name="toc-File-I_002fO-Functions-1" href="#File-I_002fO-Functions">2.2 File I/O Functions</a>
<ul class="no-bullet">
<li><a name="toc-File-handle-manipulation-1" href="#File-handle-manipulation">2.2.1 File handle manipulation</a></li>
<li><a name="toc-Reading-and-writing-data-1" href="#Reading-and-writing-data">2.2.2 Reading and writing data</a></li>
<li><a name="toc-Changing-the-file-offset-1" href="#Changing-the-file-offset">2.2.3 Changing the file offset</a></li>
<li><a name="toc-Getting-the-file-size-1" href="#Getting-the-file-size">2.2.4 Getting the file size</a></li>
</ul></li>
<li><a name="toc-Inode-Functions-1" href="#Inode-Functions">2.3 Inode Functions</a>
<ul class="no-bullet">
<li><a name="toc-Reading-and-writing-inodes-1" href="#Reading-and-writing-inodes">2.3.1 Reading and writing inodes</a></li>
<li><a name="toc-Iterating-over-inodes-in-a-filesystem-1" href="#Iterating-over-inodes-in-a-filesystem">2.3.2 Iterating over inodes in a filesystem</a></li>
<li><a name="toc-Iterating-over-blocks-in-an-inode-1" href="#Iterating-over-blocks-in-an-inode">2.3.3 Iterating over blocks in an inode</a></li>
<li><a name="toc-Convenience-functions-for-Inodes" href="#Inode-Convenience-Functions">2.3.4 Convenience functions for Inodes</a></li>
</ul></li>
<li><a name="toc-Directory-functions-1" href="#Directory-functions">2.4 Directory functions</a>
<ul class="no-bullet">
<li><a name="toc-Directory-block-functions-1" href="#Directory-block-functions">2.4.1 Directory block functions</a></li>
<li><a name="toc-Iterating-over-a-directory-1" href="#Iterating-over-a-directory">2.4.2 Iterating over a directory</a></li>
<li><a name="toc-Creating-and-expanding-directories-1" href="#Creating-and-expanding-directories">2.4.3 Creating and expanding directories</a></li>
<li><a name="toc-Creating-and-removing-directory-entries-1" href="#Creating-and-removing-directory-entries">2.4.4 Creating and removing directory entries</a></li>
<li><a name="toc-Looking-up-filenames-1" href="#Looking-up-filenames">2.4.5 Looking up filenames</a></li>
<li><a name="toc-Translating-inode-numbers-to-filenames-1" href="#Translating-inode-numbers-to-filenames">2.4.6 Translating inode numbers to filenames</a></li>
</ul></li>
<li><a name="toc-Bitmap-Functions-1" href="#Bitmap-Functions">2.5 Bitmap Functions</a>
<ul class="no-bullet">
<li><a name="toc-Reading-and-Writing-Bitmaps-1" href="#Reading-and-Writing-Bitmaps">2.5.1 Reading and Writing Bitmaps</a></li>
<li><a name="toc-Allocating-Bitmaps-1" href="#Allocating-Bitmaps">2.5.2 Allocating Bitmaps</a></li>
<li><a name="toc-Freeing-bitmaps" href="#Free-bitmaps">2.5.3 Freeing bitmaps</a></li>
<li><a name="toc-Bitmap-Operations-1" href="#Bitmap-Operations">2.5.4 Bitmap Operations</a></li>
<li><a name="toc-Comparing-bitmaps-1" href="#Comparing-bitmaps">2.5.5 Comparing bitmaps</a></li>
<li><a name="toc-Modifying-Bitmaps-1" href="#Modifying-Bitmaps">2.5.6 Modifying Bitmaps</a></li>
<li><a name="toc-Resizing-Bitmaps-1" href="#Resizing-Bitmaps">2.5.7 Resizing Bitmaps</a></li>
<li><a name="toc-Clearing-Bitmaps-1" href="#Clearing-Bitmaps">2.5.8 Clearing Bitmaps</a></li>
</ul></li>
<li><a name="toc-EXT2-data-abstractions-1" href="#EXT2-data-abstractions">2.6 EXT2 data abstractions</a>
<ul class="no-bullet">
<li><a name="toc-Badblocks-list-management-1" href="#Badblocks-list-management">2.6.1 Badblocks list management</a></li>
<li><a name="toc-Directory_002dblock-list-management-1" href="#Directory_002dblock-list-management">2.6.2 Directory-block list management</a></li>
<li><a name="toc-Inode-count-functions-1" href="#Inode-count-functions">2.6.3 Inode count functions</a></li>
</ul></li>
<li><a name="toc-Byte_002dswapping-functions-1" href="#Byte_002dswapping-functions">2.7 Byte-swapping functions</a></li>
<li><a name="toc-Other-functions-1" href="#Other-functions">2.8 Other functions</a></li>
</ul></li>
<li><a name="toc-Concept-Index-1" href="#Concept-Index">Concept Index</a></li>
<li><a name="toc-Function-and-Type-Index" href="#Function-Index">Function and Type Index</a></li>
</ul>
</div>
<hr>
</body>
</html>
|