{"id":208382,"date":"2025-08-26T10:23:57","date_gmt":"2025-08-26T02:23:57","guid":{"rendered":"https:\/\/www.server.hk\/blog\/?p=208382"},"modified":"2025-08-26T10:23:57","modified_gmt":"2025-08-26T02:23:57","slug":"%e7%b2%be%e9%80%9a-linux-%e6%96%87%e4%bb%b6%e7%b3%bb%e7%bb%9f%ef%bc%9a%e7%b4%a2%e5%bc%95%e8%8a%82%e7%82%b9%e4%b8%8e-ext4-%e7%bb%93%e6%9e%84%e7%9a%84%e6%b7%b1%e5%85%a5%e6%8c%87%e5%8d%97","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/208382\/","title":{"rendered":"\u7cbe\u901a Linux \u6587\u4ef6\u7cfb\u7edf\uff1a\u7d22\u5f15\u8282\u70b9\u4e0e ext4 \u7ed3\u6784\u7684\u6df1\u5165\u6307\u5357"},"content":{"rendered":"<p dir=\"auto\">\u672c\u6587\u6df1\u5165\u63a2\u8ba8\u4e86 Linux \u6587\u4ef6\u7cfb\u7edf\uff0c\u91cd\u70b9\u5206\u6790\u7d22\u5f15\u8282\u70b9\uff08inode\uff09\u4ee5\u53ca ext4 \u6587\u4ef6\u7cfb\u7edf\u7684\u7ed3\u6784\u3002\u672c\u6587\u4e3a IT \u4e13\u4e1a\u4eba\u58eb\u91cf\u8eab\u5b9a\u5236\uff0c\u63d0\u4f9b\u4e86\u5168\u9762\u3001\u51c6\u786e\u4e14\u5f15\u4eba\u5165\u80dc\u7684\u6587\u4ef6\u7cfb\u7edf\u8bbe\u8ba1\u3001\u5b58\u50a8\u673a\u5236\u548c\u5173\u952e\u7ec4\u4ef6\u6982\u8ff0\uff0c\u4f18\u5316\u4e86\u641c\u7d22\u53ef\u89c1\u6027\u548c\u6280\u672f\u6e05\u6670\u5ea6\u3002<\/p>\n<h2 dir=\"auto\">\u5f15\u8a00<\/h2>\n<p dir=\"auto\">Linux \u7684\u201c\u4e00\u5207\u7686\u6587\u4ef6\u201d\u54f2\u5b66\u662f\u5176\u6587\u4ef6\u7cfb\u7edf\u7684\u6838\u5fc3\uff0c\u6587\u4ef6\u7cfb\u7edf\u662f\u7ba1\u7406\u5b57\u7b26\u8bbe\u5907\u3001\u5757\u8bbe\u5907\u3001\u7ba1\u9053\u3001\u8fdb\u7a0b\u95f4\u901a\u4fe1\u548c\u7f51\u7edc\u7684\u5173\u952e\u7ec4\u4ef6\u3002\u672c\u6587\u4ecb\u7ecd\u4e86 Linux \u6587\u4ef6\u7cfb\u7edf\u7684\u57fa\u672c\u539f\u7406\uff0c\u91cd\u70b9\u63a2\u8ba8\u7d22\u5f15\u8282\u70b9\u7ed3\u6784\u548c ext4 \u6587\u4ef6\u7cfb\u7edf\u7684\u67b6\u6784\uff0c\u4e3a\u7cfb\u7edf\u7ba1\u7406\u5458\u548c\u5f00\u53d1\u8005\u63d0\u4f9b\u6df1\u5165\u4e86\u89e3\u6587\u4ef6\u7cfb\u7edf\u673a\u5236\u7684\u8be6\u5c3d\u5206\u6790\u3002<\/p>\n<h2 dir=\"auto\">\u6587\u4ef6\u7cfb\u7edf\u57fa\u7840<\/h2>\n<p dir=\"auto\">\u6587\u4ef6\u7cfb\u7edf\u65e8\u5728\u6ee1\u8db3\u4ee5\u4e0b\u57fa\u672c\u9700\u6c42\uff1a<\/p>\n<ul dir=\"auto\">\n<li><strong>\u6613\u7528\u6027<\/strong>\uff1a\u652f\u6301\u76f4\u89c2\u7684\u6587\u4ef6\u8bfb\u5199\u64cd\u4f5c\uff0c\u540c\u65f6\u907f\u514d\u547d\u540d\u51b2\u7a81\u3002<\/li>\n<li><strong>\u7ec4\u7ec7\u6027<\/strong>\uff1a\u4fbf\u4e8e\u9ad8\u6548\u7684\u6587\u4ef6\u67e5\u627e\u548c\u5206\u7c7b\u3002<\/li>\n<li><strong>\u7ba1\u7406\u6027<\/strong>\uff1a\u8ddf\u8e2a\u6587\u4ef6\u5728\u8fdb\u7a0b\u4e2d\u7684\u4f7f\u7528\u60c5\u51b5\u3002<\/li>\n<\/ul>\n<p dir=\"auto\">\u4e3a\u6ee1\u8db3\u8fd9\u4e9b\u9700\u6c42\uff0cLinux \u6587\u4ef6\u7cfb\u7edf\u91c7\u7528\u4e86\u4ee5\u4e0b\u7279\u6027\uff1a<\/p>\n<ul dir=\"auto\">\n<li><strong>\u6811\u5f62\u7ed3\u6784<\/strong>\uff1a\u901a\u8fc7\u5c42\u6b21\u5316\u7684\u76ee\u5f55\u7ed3\u6784\u7ec4\u7ec7\u6587\u4ef6\u3002<\/li>\n<li><strong>\u7f13\u5b58\u673a\u5236<\/strong>\uff1a\u52a0\u901f\u5bf9\u5e38\u7528\u6587\u4ef6\u7684\u8bbf\u95ee\u3002<\/li>\n<li><strong>\u7d22\u5f15\u673a\u5236<\/strong>\uff1a\u63d0\u5347\u6587\u4ef6\u67e5\u627e\u6548\u7387\u3002<\/li>\n<li><strong>\u5143\u6570\u636e\u8ddf\u8e2a<\/strong>\uff1a\u7ef4\u62a4\u6570\u636e\u7ed3\u6784\u4ee5\u76d1\u63a7\u6587\u4ef6\u4f7f\u7528\u60c5\u51b5\u3002<\/li>\n<\/ul>\n<p dir=\"auto\">\u8fd9\u4e9b\u539f\u5219\u6784\u6210\u4e86 Linux \u5f3a\u5927\u6587\u4ef6\u7cfb\u7edf\u67b6\u6784\u7684\u57fa\u7840\u3002<\/p>\n<h2 dir=\"auto\">\u7d22\u5f15\u8282\u70b9\u4e0e ext4 \u6587\u4ef6\u7cfb\u7edf<\/h2>\n<h3 dir=\"auto\">1. \u5757\u5b58\u50a8\u4e0e\u7d22\u5f15\u8282\u70b9<\/h3>\n<p dir=\"auto\">\u7d22\u5f15\u8282\u70b9\uff08inode\uff09\u662f Linux \u6587\u4ef6\u7cfb\u7edf\u7684\u57fa\u77f3\uff0c\u7528\u4e8e\u8868\u793a\u5b58\u50a8\u5728\u78c1\u76d8\u4e0a\u7684\u6587\u4ef6\u6216\u76ee\u5f55\u7684\u5143\u6570\u636e\u3002\u5b83\u5305\u542b\u4e86\u6743\u9650\u3001\u6240\u6709\u6743\u548c\u5757\u4f4d\u7f6e\u7b49\u5173\u952e\u4fe1\u606f\u3002<\/p>\n<h4 dir=\"auto\">\u7d22\u5f15\u8282\u70b9\u7ed3\u6784<\/h4>\n<p dir=\"auto\">ext4_inode \u7ed3\u6784\u5728 Linux \u5185\u6838\u4e2d\u5b9a\u4e49\uff0c\u5305\u542b\u4ee5\u4e0b\u5b57\u6bb5\uff1a<\/p>\n<div dir=\"auto\">\n<div>\n<div><\/div>\n<\/div>\n<table dir=\"auto\" data-wide=\"false\">\n<thead>\n<tr>\n<th data-col-size=\"md\">\u5b57\u6bb5<\/th>\n<th data-col-size=\"lg\">\u63cf\u8ff0<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td data-col-size=\"md\">i_mode<\/td>\n<td data-col-size=\"lg\">\u6587\u4ef6\u6743\u9650\u548c\u7c7b\u578b<\/td>\n<\/tr>\n<tr>\n<td data-col-size=\"md\">i_uid<\/td>\n<td data-col-size=\"lg\">\u6240\u6709\u8005\u7528\u6237 ID\uff08\u4f4e 16 \u4f4d\uff09<\/td>\n<\/tr>\n<tr>\n<td data-col-size=\"md\">i_gid<\/td>\n<td data-col-size=\"lg\">\u7ec4 ID\uff08\u4f4e 16 \u4f4d\uff09<\/td>\n<\/tr>\n<tr>\n<td data-col-size=\"md\">i_size_lo<\/td>\n<td data-col-size=\"lg\">\u6587\u4ef6\u5927\u5c0f\uff08\u5b57\u8282\uff09<\/td>\n<\/tr>\n<tr>\n<td data-col-size=\"md\">i_blocks_lo<\/td>\n<td data-col-size=\"lg\">\u5206\u914d\u7684\u5757\u6570<\/td>\n<\/tr>\n<tr>\n<td data-col-size=\"md\">i_atime<\/td>\n<td data-col-size=\"lg\">\u6700\u540e\u8bbf\u95ee\u65f6\u95f4<\/td>\n<\/tr>\n<tr>\n<td data-col-size=\"md\">i_mtime<\/td>\n<td data-col-size=\"lg\">\u6700\u540e\u4fee\u6539\u65f6\u95f4<\/td>\n<\/tr>\n<tr>\n<td data-col-size=\"md\">i_ctime<\/td>\n<td data-col-size=\"lg\">\u6700\u540e\u7d22\u5f15\u8282\u70b9\u66f4\u6539\u65f6\u95f4<\/td>\n<\/tr>\n<tr>\n<td data-col-size=\"md\">i_dtime<\/td>\n<td data-col-size=\"lg\">\u5220\u9664\u65f6\u95f4\uff08\u82e5\u9002\u7528\uff09<\/td>\n<\/tr>\n<tr>\n<td data-col-size=\"md\">i_block<\/td>\n<td data-col-size=\"lg\">\u5757\u6307\u9488\u6570\u7ec4\uff08EXT4_N_BLOCKS\uff09<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<ul dir=\"auto\">\n<li><strong>\u6e90\u7801\u8def\u5f84<\/strong>\uff1ainclude\/linux\/ext4_fs.h<\/li>\n<li><strong>\u5173\u952e\u5b57\u6bb5<\/strong>\uff1ai_block \u5b58\u50a8\u6570\u636e\u5757\u6307\u9488\u3002\u5728 ext2\/ext3 \u4e2d\uff0c\u524d 12 \u4e2a\u6761\u76ee\uff08EXT4_NDIR_BLOCKS\uff09\u76f4\u63a5\u6307\u5411 4KB \u6570\u636e\u5757\u3002\u5bf9\u4e8e\u5927\u6587\u4ef6\uff0c\u4f7f\u7528\u95f4\u63a5\u5757\uff08EXT4_IND_BLOCK\u3001EXT4_DIND_BLOCK\u3001EXT4_TIND_BLOCK\uff09\u5b9e\u73b0\u5c42\u6b21\u5316\u5757\u5bfb\u5740\u3002<\/li>\n<\/ul>\n<p dir=\"auto\"><strong>\u5c40\u9650\u6027<\/strong>\uff1a\u95f4\u63a5\u5757\u5bfb\u5740\u5bf9\u5927\u6587\u4ef6\u9700\u8981\u591a\u6b21\u78c1\u76d8\u8bbf\u95ee\uff0c\u964d\u4f4e\u6027\u80fd\u3002<\/p>\n<h4 dir=\"auto\">ext4 \u4e2d\u7684\u6269\u5c55\uff08Extents\uff09<\/h4>\n<p dir=\"auto\">\u4e3a\u4f18\u5316\u5927\u6587\u4ef6\u8bbf\u95ee\uff0cext4 \u5f15\u5165\u4e86<strong>\u6269\u5c55\uff08extents\uff09<\/strong>\uff0c\u4e00\u79cd\u57fa\u4e8e\u6811\u7684\u8fde\u7eed\u5757\u5b58\u50a8\u7ed3\u6784\u3002\u4e3b\u8981\u7ec4\u4ef6\u5305\u62ec\uff1a<\/p>\n<ul dir=\"auto\">\n<li><strong>ext4_extent_header<\/strong>\uff1a\u6269\u5c55\u6811\u7684\u5143\u6570\u636e\u3002\n<ul dir=\"auto\">\n<li>eh_entries\uff1a\u6709\u6548\u6761\u76ee\u6570\u3002<\/li>\n<li>eh_depth\uff1a\u6811\u6df1\u5ea6\uff08\u5c0f\u6587\u4ef6\u4e3a 0\uff0c\u8868\u793a\u53f6\u5b50\u8282\u70b9\uff09\u3002<\/li>\n<\/ul>\n<\/li>\n<li><strong>ext4_extent<\/strong>\uff1a\u6307\u5411\u8fde\u7eed\u78c1\u76d8\u5757\u7684\u53f6\u5b50\u8282\u70b9\u3002<\/li>\n<li><strong>ext4_extent_idx<\/strong>\uff1a\u6307\u5411\u4e0b\u7ea7\u8282\u70b9\u7684\u7d22\u5f15\u8282\u70b9\u3002<\/li>\n<\/ul>\n<p dir=\"auto\">\u5bf9\u4e8e\u5c0f\u6587\u4ef6\uff0ci_block \u53ef\u5bb9\u7eb3\u4e00\u4e2a\u5934\u90e8\u548c\u6700\u591a\u56db\u4e2a\u6269\u5c55\uff0c\u6bcf\u4e2a\u6269\u5c55\u53ef\u5bfb\u5740 128MB\u3002\u5bf9\u4e8e\u5927\u6587\u4ef6\uff0c\u521b\u5efa\u591a\u7ea7\u6269\u5c55\u6811\uff0c\u4e00\u4e2a 4KB \u5757\u53ef\u5bb9\u7eb3 340 \u4e2a\u6269\u5c55\uff0c\u652f\u6301\u9ad8\u8fbe 42.5GB \u7684\u6587\u4ef6\u3002\u66f4\u5927\u7684\u6587\u4ef6\u901a\u8fc7\u589e\u52a0\u6811\u6df1\u5ea6\u5904\u7406\u3002<\/p>\n<p dir=\"auto\"><strong>\u6e90\u7801\u8def\u5f84<\/strong>\uff1ainclude\/linux\/ext4_fs.h<\/p>\n<p dir=\"auto\"><strong>\u793a\u4f8b<\/strong>\uff1a<\/p>\n<div dir=\"auto\">\n<div>\n<div>c<\/div>\n<div>\n<div>\n<div><\/div>\n<\/div>\n<\/div>\n<div>\n<p><code><\/code><\/p>\n<div>\n<div>\n<div>struct ext4_extent_header {<\/div>\n<div>__le16 eh_magic; \/* \u683c\u5f0f\u6807\u8bc6\u7b26 *\/<\/div>\n<div>__le16 eh_entries; \/* \u6709\u6548\u6761\u76ee\u6570 *\/<\/div>\n<div>__le16 eh_max; \/* \u6700\u5927\u6761\u76ee\u5bb9\u91cf *\/<\/div>\n<div>__le16 eh_depth; \/* \u6811\u6df1\u5ea6 *\/<\/div>\n<div>__le32 eh_generation; \/* \u6811\u751f\u6210\u6807\u8bc6 *\/<\/div>\n<div>};<\/div>\n<div><\/div>\n<div>struct ext4_extent {<\/div>\n<div>__le32 ee_block; \/* \u7b2c\u4e00\u4e2a\u903b\u8f91\u5757 *\/<\/div>\n<div>__le16 ee_len; \/* \u5757\u6570 *\/<\/div>\n<div>__le16 ee_start_hi; \/* \u7269\u7406\u5757\u9ad8 16 \u4f4d *\/<\/div>\n<div>__le32 ee_start_lo; \/* \u7269\u7406\u5757\u4f4e 32 \u4f4d *\/<\/div>\n<div>};<\/div>\n<div><\/div>\n<div>struct ext4_extent_idx {<\/div>\n<div>__le32 ei_block; \/* \u903b\u8f91\u5757\u7d22\u5f15 *\/<\/div>\n<div>__le32 ei_leaf_lo; \/* \u6307\u5411\u4e0b\u4e00\u7ea7\u7684\u6307\u9488 *\/<\/div>\n<div>__le16 ei_leaf_hi; \/* \u7269\u7406\u5757\u9ad8 16 \u4f4d *\/<\/div>\n<div>__u16 ei_unused;<\/div>\n<div>};<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div><\/div>\n<div><\/div>\n<\/div>\n<\/div>\n<h4 dir=\"auto\">\u7d22\u5f15\u8282\u70b9\u5206\u914d<\/h4>\n<p dir=\"auto\">\u7d22\u5f15\u8282\u70b9\u901a\u8fc7\u4f4d\u56fe\u7ba1\u7406\uff0c\u8ddf\u8e2a\u7a7a\u95f2\u548c\u5df2\u5206\u914d\u7684\u8282\u70b9\u3002ext4_new_inode \u51fd\u6570\u5b9a\u4f4d\u4e0b\u4e00\u4e2a\u7a7a\u95f2\u7d22\u5f15\u8282\u70b9\uff1a<\/p>\n<div dir=\"auto\">\n<div>\n<div>c<\/div>\n<div>\n<div>\n<div><\/div>\n<\/div>\n<\/div>\n<div>\n<p><code><\/code><\/p>\n<div>\n<div>\n<div>struct inode *ext4_new_inode(&#8230;) {<\/div>\n<div>&#8230;<\/div>\n<div>inode_bitmap_bh = ext4_read_inode_bitmap(sb, group);<\/div>\n<div>ino = ext4_find_next_zero_bit((unsigned long *)inode_bitmap_bh-&gt;b_data,<\/div>\n<div>EXT4_INODES_PER_GROUP(sb), ino);<\/div>\n<div>&#8230;<\/div>\n<div>}<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div><\/div>\n<div><\/div>\n<\/div>\n<\/div>\n<h3 dir=\"auto\">2. \u6587\u4ef6\u7cfb\u7edf\u7ed3\u6784<\/h3>\n<p dir=\"auto\">ext4 \u6587\u4ef6\u7cfb\u7edf\u57fa\u4e8e\u7d22\u5f15\u8282\u70b9\u548c\u5757\uff0c\u7ec4\u7ec7\u6210\u66f4\u9ad8\u5c42\u6b21\u7684\u7ed3\u6784\uff1a<\/p>\n<ul dir=\"auto\">\n<li><strong>\u5757\u7ec4<\/strong>\uff1a\u5b58\u50a8\u5355\u5143\uff0c\u7531 ext4_group_desc \u5b9a\u4e49\uff0c\u5305\u542b\uff1a\n<ul dir=\"auto\">\n<li>bg_block_bitmap_lo\uff1a\u5757\u4f4d\u56fe\u3002<\/li>\n<li>bg_inode_bitmap_lo\uff1a\u7d22\u5f15\u8282\u70b9\u4f4d\u56fe\u3002<\/li>\n<li>bg_inode_table_lo\uff1a\u7d22\u5f15\u8282\u70b9\u8868\u3002<\/li>\n<\/ul>\n<\/li>\n<li><strong>\u5757\u7ec4\u63cf\u8ff0\u7b26\u8868<\/strong>\uff1a\u591a\u4e2a\u5757\u7ec4\u63cf\u8ff0\u7b26\u7684\u96c6\u5408\u3002<\/li>\n<li><strong>\u8d85\u7ea7\u5757<\/strong>\uff1a\u5b58\u50a8\u5168\u5c40\u6587\u4ef6\u7cfb\u7edf\u5143\u6570\u636e\uff08ext4_super_block\uff09\uff0c\u5305\u62ec\uff1a\n<ul dir=\"auto\">\n<li>\u603b\u7d22\u5f15\u8282\u70b9\u6570\uff08s_inodes_count\uff09\u3002<\/li>\n<li>\u603b\u5757\u6570\uff08s_blocks_count_lo\uff09\u3002<\/li>\n<li>\u6bcf\u4e2a\u5757\u7ec4\u7684\u7d22\u5f15\u8282\u70b9\u6570\uff08s_inodes_per_group\uff09\u3002<\/li>\n<li>\u6bcf\u4e2a\u5757\u7ec4\u7684\u5757\u6570\uff08s_blocks_per_group\uff09\u3002<\/li>\n<\/ul>\n<\/li>\n<li><strong>\u5f15\u5bfc\u5757<\/strong>\uff1a\u5728\u7b2c\u4e00\u4e2a\u5757\u7ec4\u4e2d\u9884\u7559 1KB \u7528\u4e8e\u5f15\u5bfc\u52a0\u8f7d\u7a0b\u5e8f\u3002<\/li>\n<\/ul>\n<p dir=\"auto\"><strong>\u5907\u4efd\u7b56\u7565<\/strong>\uff1a<\/p>\n<ul dir=\"auto\">\n<li><strong>\u9ed8\u8ba4<\/strong>\uff1a\u6bcf\u4e2a\u5757\u7ec4\u5b58\u50a8\u8d85\u7ea7\u5757\u548c\u63cf\u8ff0\u7b26\u8868\u5907\u4efd\u3002<\/li>\n<li><strong>\u7a00\u758f\u8d85\u7ea7\u5757\uff08Sparse Super\uff09<\/strong>\uff1a\u4ec5\u5728\u5757\u7ec4\u7d22\u5f15 0\u30013\u30015\u30017 \u53ca\u5176\u5e42\u6b21\u5b58\u50a8\u5907\u4efd\u3002<\/li>\n<li><strong>\u5143\u5757\u7ec4\uff08Meta Block Groups\uff09<\/strong>\uff1a\u5c06\u5757\u7ec4\u5206\u4e3a\u6bcf\u7ec4 64 \u4e2a\u7684\u5143\u5757\u7ec4\uff0c\u6bcf\u4e2a\u5143\u5757\u7ec4\u7684\u63cf\u8ff0\u7b26\u8868\u4ec5\u5305\u542b\u81ea\u8eab\u5185\u5bb9\uff0c\u6700\u591a 64 \u9879\uff0c\u4f18\u5316\u7a7a\u95f4\u4f7f\u7528\uff0c\u7c7b\u4f3c\u4e8e Merkle \u6811\u3002<\/li>\n<\/ul>\n<h3 dir=\"auto\">3. \u76ee\u5f55\u5b58\u50a8<\/h3>\n<p dir=\"auto\">\u76ee\u5f55\u662f\u5177\u6709\u7d22\u5f15\u8282\u70b9\u7684\u7279\u6b8a\u6587\u4ef6\uff0c\u5176\u5757\u5b58\u50a8\u6587\u4ef6\u5143\u6570\u636e\uff08ext4_dir_entry_2\uff09\uff1a<\/p>\n<div dir=\"auto\">\n<div>\n<div><\/div>\n<\/div>\n<table dir=\"auto\" data-wide=\"false\">\n<thead>\n<tr>\n<th data-col-size=\"lg\">\u5b57\u6bb5<\/th>\n<th data-col-size=\"lg\">\u63cf\u8ff0<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td data-col-size=\"lg\">inode<\/td>\n<td data-col-size=\"lg\">\u6587\u4ef6\u7684\u7d22\u5f15\u8282\u70b9\u53f7<\/td>\n<\/tr>\n<tr>\n<td data-col-size=\"lg\">rec_len<\/td>\n<td data-col-size=\"lg\">\u6761\u76ee\u957f\u5ea6<\/td>\n<\/tr>\n<tr>\n<td data-col-size=\"lg\">name_len<\/td>\n<td data-col-size=\"lg\">\u6587\u4ef6\u540d\u957f\u5ea6<\/td>\n<\/tr>\n<tr>\n<td data-col-size=\"lg\">file_type<\/td>\n<td data-col-size=\"lg\">\u6587\u4ef6\u7c7b\u578b\uff08\u5982\u5e38\u89c4\u6587\u4ef6\u3001\u76ee\u5f55\uff09<\/td>\n<\/tr>\n<tr>\n<td data-col-size=\"lg\">name<\/td>\n<td data-col-size=\"lg\">\u6587\u4ef6\u540d\uff08\u6700\u5927 EXT4_NAME_LEN\uff09<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<ul dir=\"auto\">\n<li><strong>\u7ebf\u6027\u5b58\u50a8<\/strong>\uff1a\u6761\u76ee\u4ee5\u5217\u8868\u5f62\u5f0f\u5b58\u50a8\uff0c\u9996\u4e24\u6761\u76ee\u4e3a .\uff08\u5f53\u524d\u76ee\u5f55\uff09\u548c ..\uff08\u4e0a\u7ea7\u76ee\u5f55\uff09\u3002<\/li>\n<li><strong>\u7d22\u5f15\u5b58\u50a8<\/strong>\uff1a\u5bf9\u4e8e\u5927\u76ee\u5f55\uff0c\u8bbe\u7f6e EXT4_INDEX_FL \u6807\u5fd7\u542f\u7528\u57fa\u4e8e\u54c8\u5e0c\u7684\u7d22\u5f15\u6811\uff08dx_root\uff09\uff1a\n<ul dir=\"auto\">\n<li>dx_root_info\uff1a\u8ddf\u8e2a\u7d22\u5f15\u5c42\u7ea7\uff08indirect_levels\uff09\u3002<\/li>\n<li>dx_entry\uff1a\u6587\u4ef6\u540d\u54c8\u5e0c\u4e0e\u6570\u636e\u5757\u7684\u6620\u5c04\u3002<\/li>\n<li>\u53f6\u5b50\u8282\u70b9\u5305\u542b ext4_dir_entry_2 \u5217\u8868\uff0c\u652f\u6301\u5feb\u901f\u67e5\u627e\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p dir=\"auto\"><strong>\u6e90\u7801\u8def\u5f84<\/strong>\uff1ainclude\/linux\/ext4_fs.h<\/p>\n<h3 dir=\"auto\">4. \u8f6f\u94fe\u63a5\u4e0e\u786c\u94fe\u63a5<\/h3>\n<ul dir=\"auto\">\n<li><strong>\u786c\u94fe\u63a5<\/strong>\uff1a\n<ul dir=\"auto\">\n<li>\u4e0e\u539f\u59cb\u6587\u4ef6\u5171\u4eab\u540c\u4e00\u7d22\u5f15\u8282\u70b9\u3002<\/li>\n<li>\u53d7\u9650\u4e8e\u540c\u4e00\u6587\u4ef6\u7cfb\u7edf\uff08\u7d22\u5f15\u8282\u70b9\u4e3a\u6587\u4ef6\u7cfb\u7edf\u7279\u6709\uff09\u3002<\/li>\n<li>\u4f7f\u7528 ln source target \u521b\u5efa\u3002<\/li>\n<\/ul>\n<\/li>\n<li><strong>\u8f6f\u94fe\u63a5<\/strong>\uff1a\n<ul dir=\"auto\">\n<li>\u5177\u6709\u72ec\u7acb\u7d22\u5f15\u8282\u70b9\uff0c\u6307\u5411\u53e6\u4e00\u6587\u4ef6\u7684\u8def\u5f84\u3002<\/li>\n<li>\u652f\u6301\u8de8\u6587\u4ef6\u7cfb\u7edf\u94fe\u63a5\u3002<\/li>\n<li>\u5373\u4f7f\u76ee\u6807\u6587\u4ef6\u88ab\u5220\u9664\uff0c\u94fe\u63a5\u6587\u4ef6\u4ecd\u5b58\u5728\uff08\u6210\u4e3a\u60ac\u7a7a\u94fe\u63a5\uff09\u3002<\/li>\n<li>\u4f7f\u7528 ln -s source target \u521b\u5efa\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h2 dir=\"auto\">\u7ed3\u8bba<\/h2>\n<p dir=\"auto\">\u4ee5 ext4 \u4e3a\u4ee3\u8868\u7684 Linux \u6587\u4ef6\u7cfb\u7edf\u56f4\u7ed5\u7d22\u5f15\u8282\u70b9\u6784\u5efa\uff0c\u901a\u8fc7\u7d22\u5f15\u8282\u70b9\u7ba1\u7406\u6587\u4ef6\u5143\u6570\u636e\u548c\u5757\u6307\u9488\uff0cext4 \u901a\u8fc7\u6269\u5c55\uff08extents\uff09\u63d0\u5347\u4e86\u5927\u6587\u4ef6\u6027\u80fd\u3002\u5757\u7ec4\u3001\u8d85\u7ea7\u5757\u548c\u63cf\u8ff0\u7b26\u8868\u7b49\u9ad8\u7ea7\u7ed3\u6784\u786e\u4fdd\u4e86\u9ad8\u6548\u7684\u5b58\u50a8\u548c\u7ba1\u7406\u3002\u76ee\u5f55\u901a\u8fc7\u7ebf\u6027\u6216\u7d22\u5f15\u5b58\u50a8\u5b9e\u73b0\u5feb\u901f\u67e5\u627e\uff0c\u94fe\u63a5\u5219\u63d0\u4f9b\u4e86\u7075\u6d3b\u7684\u6587\u4ef6\u5f15\u7528\u65b9\u5f0f\u3002\u8fd9\u4e00\u67b6\u6784\u4f53\u73b0\u4e86 Linux \u5728\u6587\u4ef6\u7ba1\u7406\u65b9\u9762\u7684\u5f3a\u5927\u4e0e\u53ef\u6269\u5c55\u6027\uff0c\u5bf9\u5f00\u53d1\u8005\u548c\u7ba1\u7406\u5458\u81f3\u5173\u91cd\u8981\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u672c\u6587\u6df1\u5165\u63a2\u8ba8\u4e86 Linux \u6587\u4ef6&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4924],"tags":[],"class_list":["post-208382","post","type-post","status-publish","format-standard","hentry","category-setup-tutorials"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/208382","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=208382"}],"version-history":[{"count":0,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/208382\/revisions"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=208382"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=208382"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=208382"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}