{"id":55053,"date":"2025-08-13T15:30:22","date_gmt":"2025-08-13T07:30:22","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/55053.html"},"modified":"2025-08-13T15:30:22","modified_gmt":"2025-08-13T07:30:22","slug":"%e6%b7%b1%e5%85%a5%e5%88%86%e6%9e%90linux%e6%96%87%e4%bb%b6%e7%b3%bb%e7%bb%9f%e6%a0%b8%e5%bf%83%e5%8e%9f%e7%90%86%e6%9e%b6%e6%9e%84%e4%b8%8e%e5%ae%9e%e7%8e%b0%e6%9c%ba%e5%88%b6","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/55053.html","title":{"rendered":"\u6df1\u5165\u5206\u6790Linux\u6587\u4ef6\u7cfb\u7edf\u6838\u5fc3\u539f\u7406\u67b6\u6784\u4e0e\u5b9e\u73b0\u673a\u5236"},"content":{"rendered":"<h4>\u8be6\u7ec6\u6df1\u5165\u5206\u6790 Linux \u6587\u4ef6\u7cfb\u7edf\u548c\u8bbe\u5907\u6587\u4ef6<\/h4>\n<hr \/>\n<h5>1. \u6280\u672f\u6838\u5fc3\u6982\u5ff5<\/h5>\n<h6>1.1 \u6280\u672f\u5b9a\u4e49<\/h6>\n<p>Linux \u6587\u4ef6\u7cfb\u7edf\u662f\u64cd\u4f5c\u7cfb\u7edf\u7528\u4e8e\u7ec4\u7ec7\u3001\u5b58\u50a8\u548c\u8bbf\u95ee\u6570\u636e\u7684\u67b6\u6784&#xff0c;\u5305\u542b&#xff1a;<\/p>\n<ul>\n<li>\u5c42\u6b21\u5316\u76ee\u5f55\u7ed3\u6784&#xff08;\u6811\u72b6\u7ec4\u7ec7&#xff09;<\/li>\n<li>\u5143\u6570\u636e\u7ba1\u7406&#xff08;\u6743\u9650\u3001\u65f6\u95f4\u6233\u7b49&#xff09;<\/li>\n<li>\u7269\u7406\u5b58\u50a8\u5230\u903b\u8f91\u6620\u5c04<\/li>\n<li>\u8bbe\u5907\u62bd\u8c61\u5c42&#xff08;\u901a\u8fc7\u8bbe\u5907\u6587\u4ef6\u8bbf\u95ee\u786c\u4ef6&#xff09;<\/li>\n<\/ul>\n<p>\u8bbe\u5907\u6587\u4ef6&#xff08;\u4f4d\u4e8e \/dev&#xff09;\u662f\u786c\u4ef6\u8bbe\u5907\u7684\u62bd\u8c61\u63a5\u53e3&#xff0c;\u5206\u4e3a&#xff1a;<\/p>\n<ul>\n<li>\u5b57\u7b26\u8bbe\u5907&#xff08;c&#xff09;&#xff1a;\u6d41\u5f0f\u8bbf\u95ee&#xff08;\u5982\u952e\u76d8\u3001\u4e32\u53e3&#xff09;<\/li>\n<li>\u5757\u8bbe\u5907&#xff08;b&#xff09;&#xff1a;\u5757\u72b6\u8bbf\u95ee&#xff08;\u5982\u786c\u76d8\u3001SSD&#xff09;<\/li>\n<\/ul>\n<h6>1.2 \u6838\u5fc3\u57fa\u7840\u6982\u5ff5<\/h6>\n<table>\n<tr>\u6982\u5ff5\u8bf4\u660e\u793a\u4f8b<\/tr>\n<tbody>\n<tr>\n<td>Inode<\/td>\n<td>\u5b58\u50a8\u6587\u4ef6\u5143\u6570\u636e&#xff08;\u6743\u9650\u3001\u5927\u5c0f\u3001\u65f6\u95f4\u6233&#xff09;&#xff0c;\u552f\u4e00\u6807\u8bc6\u7b26<\/td>\n<td>stat file.txt \u67e5\u770b inode<\/td>\n<\/tr>\n<tr>\n<td>Dentry<\/td>\n<td>\u76ee\u5f55\u9879\u7f13\u5b58&#xff0c;\u52a0\u901f\u8def\u5f84\u67e5\u627e<\/td>\n<td>\u5185\u6838\u7ef4\u62a4\u7684\u8def\u5f84\u5230 inode \u6620\u5c04<\/td>\n<\/tr>\n<tr>\n<td>Superblock<\/td>\n<td>\u6587\u4ef6\u7cfb\u7edf\u5168\u5c40\u4fe1\u606f&#xff08;\u5757\u5927\u5c0f\u3001inode \u603b\u6570\u7b49&#xff09;<\/td>\n<td>Ext4 \u8d85\u7ea7\u5757\u5b58\u50a8\u5377\u4fe1\u606f<\/td>\n<\/tr>\n<tr>\n<td>VFS (Virtual File System)<\/td>\n<td>\u5185\u6838\u62bd\u8c61\u5c42&#xff0c;\u7edf\u4e00\u4e0d\u540c\u6587\u4ef6\u7cfb\u7edf\u7684\u63a5\u53e3<\/td>\n<td>\u6587\u4ef6\u64cd\u4f5c\u7684\u7cfb\u7edf\u8c03\u7528\u5165\u53e3<\/td>\n<\/tr>\n<tr>\n<td>Page Cache<\/td>\n<td>\u5185\u5b58\u7f13\u5b58&#xff0c;\u52a0\u901f\u6587\u4ef6 I\/O<\/td>\n<td>free -m \u67e5\u770b\u7f13\u5b58\u4f7f\u7528<\/td>\n<\/tr>\n<tr>\n<td>Block Layer<\/td>\n<td>\u7ba1\u7406\u5757\u8bbe\u5907 I\/O \u8bf7\u6c42&#xff0c;\u5305\u542b I\/O \u8c03\u5ea6\u5668<\/td>\n<td>CFQ\u3001Deadline \u8c03\u5ea6\u7b97\u6cd5<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h6>1.3 \u53d1\u5c55\u8109\u7edc<\/h6>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250813072948-689c3eece95f8.png\" alt=\"\" \/><\/p>\n<h6>1.4 \u6280\u672f\u5fc5\u8981\u6027<\/h6>\n<ul>\n<li>\u6570\u636e\u6301\u4e45\u5316&#xff1a;\u65ad\u7535\u540e\u6570\u636e\u4e0d\u4e22\u5931<\/li>\n<li>\u786c\u4ef6\u62bd\u8c61&#xff1a;\u7edf\u4e00\u8bbf\u95ee\u4e0d\u540c\u5b58\u50a8\u4ecb\u8d28&#xff08;HDD\/SSD\/NVMe&#xff09;<\/li>\n<li>\u6743\u9650\u63a7\u5236&#xff1a;\u901a\u8fc7 inode \u5b9e\u73b0\u7cbe\u7ec6\u6743\u9650\u7ba1\u7406<\/li>\n<li>\u6027\u80fd\u4f18\u5316&#xff1a;Page Cache \u51cf\u5c11\u78c1\u76d8 I\/O<\/li>\n<li>\u8bbe\u5907\u6807\u51c6\u5316&#xff1a;\u8bbe\u5907\u6587\u4ef6\u5141\u8bb8 read()\/write() \u64cd\u4f5c\u786c\u4ef6<\/li>\n<\/ul>\n<hr \/>\n<h5>2. \u77e5\u8bc6\u70b9\u903b\u8f91\u6846\u67b6<\/h5>\n<h6>2.1 \u6838\u5fc3\u673a\u5236\u6d41\u7a0b\u56fe<\/h6>\n<p>#mermaid-svg-N5GnlYoKbyvHdD7U {font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;fill:#333;}#mermaid-svg-N5GnlYoKbyvHdD7U .error-icon{fill:#552222;}#mermaid-svg-N5GnlYoKbyvHdD7U .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-N5GnlYoKbyvHdD7U .edge-thickness-normal{stroke-width:2px;}#mermaid-svg-N5GnlYoKbyvHdD7U .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-N5GnlYoKbyvHdD7U .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-N5GnlYoKbyvHdD7U .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-N5GnlYoKbyvHdD7U .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-N5GnlYoKbyvHdD7U .marker{fill:#333333;stroke:#333333;}#mermaid-svg-N5GnlYoKbyvHdD7U .marker.cross{stroke:#333333;}#mermaid-svg-N5GnlYoKbyvHdD7U svg{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-N5GnlYoKbyvHdD7U .label{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;color:#333;}#mermaid-svg-N5GnlYoKbyvHdD7U .cluster-label text{fill:#333;}#mermaid-svg-N5GnlYoKbyvHdD7U .cluster-label span{color:#333;}#mermaid-svg-N5GnlYoKbyvHdD7U .label text,#mermaid-svg-N5GnlYoKbyvHdD7U span{fill:#333;color:#333;}#mermaid-svg-N5GnlYoKbyvHdD7U .node rect,#mermaid-svg-N5GnlYoKbyvHdD7U .node circle,#mermaid-svg-N5GnlYoKbyvHdD7U .node ellipse,#mermaid-svg-N5GnlYoKbyvHdD7U .node polygon,#mermaid-svg-N5GnlYoKbyvHdD7U .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-N5GnlYoKbyvHdD7U .node .label{text-align:center;}#mermaid-svg-N5GnlYoKbyvHdD7U .node.clickable{cursor:pointer;}#mermaid-svg-N5GnlYoKbyvHdD7U .arrowheadPath{fill:#333333;}#mermaid-svg-N5GnlYoKbyvHdD7U .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-N5GnlYoKbyvHdD7U .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-N5GnlYoKbyvHdD7U .edgeLabel{background-color:#e8e8e8;text-align:center;}#mermaid-svg-N5GnlYoKbyvHdD7U .edgeLabel rect{opacity:0.5;background-color:#e8e8e8;fill:#e8e8e8;}#mermaid-svg-N5GnlYoKbyvHdD7U .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-N5GnlYoKbyvHdD7U .cluster text{fill:#333;}#mermaid-svg-N5GnlYoKbyvHdD7U .cluster span{color:#333;}#mermaid-svg-N5GnlYoKbyvHdD7U div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-N5GnlYoKbyvHdD7U :root{&#8211;mermaid-font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;}<span id=\"L-L-A-B\" class=\"edgeLabel L-LS-A&#039; L-LE-B\">\u7cfb\u7edf\u8c03\u7528read\/write<\/span><span id=\"L-L-B-C\" class=\"edgeLabel L-LS-B&#039; L-LE-C\"><\/span><span id=\"L-L-C-D\" class=\"edgeLabel L-LS-C&#039; L-LE-D\">\u666e\u901a\u6587\u4ef6<\/span><span id=\"L-L-C-E\" class=\"edgeLabel L-LS-C&#039; L-LE-E\">\u8bbe\u5907\u6587\u4ef6<\/span><span id=\"L-L-D-F\" class=\"edgeLabel L-LS-D&#039; L-LE-F\"><\/span><span id=\"L-L-E-G\" class=\"edgeLabel L-LS-E&#039; L-LE-G\"><\/span><span id=\"L-L-F-H\" class=\"edgeLabel L-LS-F&#039; L-LE-H\"><\/span><span id=\"L-L-G-H\" class=\"edgeLabel L-LS-G&#039; L-LE-H\"><\/span><span id=\"L-L-H-I\" class=\"edgeLabel L-LS-H&#039; L-LE-I\"><\/span><span id=\"L-L-I-J\" class=\"edgeLabel L-LS-I&#039; L-LE-J\"><\/span>\u7528\u6237\u8fdb\u7a0bVFS \u5c42\u6587\u4ef6\u7c7b\u578b?Ext4\/XFS \u7b49\u8bbe\u5907\u9a71\u52a8Page Cache\u5b57\u7b26\/\u5757\u8bbe\u5907\u9a71\u52a8Block LayerI\/O \u8c03\u5ea6\u5668\u7269\u7406\u8bbe\u5907<\/p>\n<h6>2.2 \u4ee3\u7801\u6267\u884c\u6d41\u7a0b<\/h6>\n<p>#mermaid-svg-R73mMULZ30DNGfLf {font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;fill:#333;}#mermaid-svg-R73mMULZ30DNGfLf .error-icon{fill:#552222;}#mermaid-svg-R73mMULZ30DNGfLf .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-R73mMULZ30DNGfLf .edge-thickness-normal{stroke-width:2px;}#mermaid-svg-R73mMULZ30DNGfLf .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-R73mMULZ30DNGfLf .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-R73mMULZ30DNGfLf .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-R73mMULZ30DNGfLf .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-R73mMULZ30DNGfLf .marker{fill:#333333;stroke:#333333;}#mermaid-svg-R73mMULZ30DNGfLf .marker.cross{stroke:#333333;}#mermaid-svg-R73mMULZ30DNGfLf svg{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-R73mMULZ30DNGfLf .actor{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;}#mermaid-svg-R73mMULZ30DNGfLf text.actor&gt;tspan{fill:black;stroke:none;}#mermaid-svg-R73mMULZ30DNGfLf .actor-line{stroke:grey;}#mermaid-svg-R73mMULZ30DNGfLf .messageLine0{stroke-width:1.5;stroke-dasharray:none;stroke:#333;}#mermaid-svg-R73mMULZ30DNGfLf .messageLine1{stroke-width:1.5;stroke-dasharray:2,2;stroke:#333;}#mermaid-svg-R73mMULZ30DNGfLf #arrowhead path{fill:#333;stroke:#333;}#mermaid-svg-R73mMULZ30DNGfLf .sequenceNumber{fill:white;}#mermaid-svg-R73mMULZ30DNGfLf #sequencenumber{fill:#333;}#mermaid-svg-R73mMULZ30DNGfLf #crosshead path{fill:#333;stroke:#333;}#mermaid-svg-R73mMULZ30DNGfLf .messageText{fill:#333;stroke:#333;}#mermaid-svg-R73mMULZ30DNGfLf .labelBox{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;}#mermaid-svg-R73mMULZ30DNGfLf .labelText,#mermaid-svg-R73mMULZ30DNGfLf .labelText&gt;tspan{fill:black;stroke:none;}#mermaid-svg-R73mMULZ30DNGfLf .loopText,#mermaid-svg-R73mMULZ30DNGfLf .loopText&gt;tspan{fill:black;stroke:none;}#mermaid-svg-R73mMULZ30DNGfLf .loopLine{stroke-width:2px;stroke-dasharray:2,2;stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);}#mermaid-svg-R73mMULZ30DNGfLf .note{stroke:#aaaa33;fill:#fff5ad;}#mermaid-svg-R73mMULZ30DNGfLf .noteText,#mermaid-svg-R73mMULZ30DNGfLf .noteText&gt;tspan{fill:black;stroke:none;}#mermaid-svg-R73mMULZ30DNGfLf .activation0{fill:#f4f4f4;stroke:#666;}#mermaid-svg-R73mMULZ30DNGfLf .activation1{fill:#f4f4f4;stroke:#666;}#mermaid-svg-R73mMULZ30DNGfLf .activation2{fill:#f4f4f4;stroke:#666;}#mermaid-svg-R73mMULZ30DNGfLf .actorPopupMenu{position:absolute;}#mermaid-svg-R73mMULZ30DNGfLf .actorPopupMenuPanel{position:absolute;fill:#ECECFF;box-shadow:0px 8px 16px 0px rgba(0,0,0,0.2);filter:drop-shadow(3px 5px 2px rgb(0 0 0 \/ 0.4));}#mermaid-svg-R73mMULZ30DNGfLf .actor-man line{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;}#mermaid-svg-R73mMULZ30DNGfLf .actor-man circle,#mermaid-svg-R73mMULZ30DNGfLf line{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;stroke-width:2px;}#mermaid-svg-R73mMULZ30DNGfLf :root{&#8211;mermaid-font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;}\u7528\u6237\u7a7a\u95f4VFSExt4BlockLayerSCSIDriverread(fd, buf, size)\u8c03\u7528 .read_iter()\u4ecePage Cache\u8fd4\u56de\u6570\u636e\u63d0\u4ea4submit_bio()\u53d1\u9001scsi_queue_rq()I\/O\u5b8c\u6210\u4e2d\u65ad\u586b\u5145Page Cachealt[\u7f13\u5b58\u547d\u4e2d][\u7f13\u5b58\u672a\u547d\u4e2d]\u8fd4\u56de\u6587\u4ef6\u6570\u636e\u590d\u5236\u6570\u636e\u5230\u7528\u6237\u7f13\u51b2\u533a\u7528\u6237\u7a7a\u95f4VFSExt4BlockLayerSCSIDriver<\/p>\n<h6>2.3 \u7cfb\u7edf\u4ea4\u4e92\u67b6\u6784<\/h6>\n<p>#mermaid-svg-1s11sx2pz2sW7yqi {font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;fill:#333;}#mermaid-svg-1s11sx2pz2sW7yqi .error-icon{fill:#552222;}#mermaid-svg-1s11sx2pz2sW7yqi .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-1s11sx2pz2sW7yqi .edge-thickness-normal{stroke-width:2px;}#mermaid-svg-1s11sx2pz2sW7yqi .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-1s11sx2pz2sW7yqi .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-1s11sx2pz2sW7yqi .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-1s11sx2pz2sW7yqi .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-1s11sx2pz2sW7yqi .marker{fill:#333333;stroke:#333333;}#mermaid-svg-1s11sx2pz2sW7yqi .marker.cross{stroke:#333333;}#mermaid-svg-1s11sx2pz2sW7yqi svg{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-1s11sx2pz2sW7yqi .label{font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;color:#333;}#mermaid-svg-1s11sx2pz2sW7yqi .cluster-label text{fill:#333;}#mermaid-svg-1s11sx2pz2sW7yqi .cluster-label span{color:#333;}#mermaid-svg-1s11sx2pz2sW7yqi .label text,#mermaid-svg-1s11sx2pz2sW7yqi span{fill:#333;color:#333;}#mermaid-svg-1s11sx2pz2sW7yqi .node rect,#mermaid-svg-1s11sx2pz2sW7yqi .node circle,#mermaid-svg-1s11sx2pz2sW7yqi .node ellipse,#mermaid-svg-1s11sx2pz2sW7yqi .node polygon,#mermaid-svg-1s11sx2pz2sW7yqi .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-1s11sx2pz2sW7yqi .node .label{text-align:center;}#mermaid-svg-1s11sx2pz2sW7yqi .node.clickable{cursor:pointer;}#mermaid-svg-1s11sx2pz2sW7yqi .arrowheadPath{fill:#333333;}#mermaid-svg-1s11sx2pz2sW7yqi .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-1s11sx2pz2sW7yqi .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-1s11sx2pz2sW7yqi .edgeLabel{background-color:#e8e8e8;text-align:center;}#mermaid-svg-1s11sx2pz2sW7yqi .edgeLabel rect{opacity:0.5;background-color:#e8e8e8;fill:#e8e8e8;}#mermaid-svg-1s11sx2pz2sW7yqi .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-1s11sx2pz2sW7yqi .cluster text{fill:#333;}#mermaid-svg-1s11sx2pz2sW7yqi .cluster span{color:#333;}#mermaid-svg-1s11sx2pz2sW7yqi div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-1s11sx2pz2sW7yqi :root{&#8211;mermaid-font-family:\\&#8221;trebuchet ms\\&#8221;,verdana,arial,sans-serif;}<span class=\"nodeLabel\">\u5185\u6838\u7a7a\u95f4<\/span><span class=\"nodeLabel\">\u7528\u6237\u7a7a\u95f4<\/span><span class=\"edgeLabel\"><\/span><span class=\"edgeLabel\"><\/span><span class=\"edgeLabel\"><\/span><span class=\"edgeLabel\"><\/span><span class=\"edgeLabel\"><\/span><span class=\"edgeLabel\"><\/span><span class=\"edgeLabel\"><\/span><span class=\"edgeLabel\"><\/span><span class=\"edgeLabel\"><\/span><span class=\"edgeLabel\"><\/span><span class=\"edgeLabel\"><\/span><span class=\"edgeLabel\"><\/span><span class=\"nodeLabel\">VFS<\/span><span class=\"nodeLabel\">\u6587\u4ef6\u7cfb\u7edf\u5c42<\/span><span class=\"nodeLabel\">\u8bbe\u5907\u6587\u4ef6\u5c42<\/span><span class=\"nodeLabel\">Page Cache<\/span><span class=\"nodeLabel\">\u5b57\u7b26\u8bbe\u5907\u9a71\u52a8<\/span><span class=\"nodeLabel\">\u5757\u8bbe\u5907\u9a71\u52a8<\/span><span class=\"nodeLabel\">Block Layer<\/span><span class=\"nodeLabel\">\u7269\u7406\u8bbe\u5907\u9a71\u52a8<\/span><span class=\"nodeLabel\">glibc<\/span><span class=\"nodeLabel\">\u5e94\u7528\u7a0b\u5e8f<\/span><span class=\"nodeLabel\">\u7cfb\u7edf\u8c03\u7528\u63a5\u53e3<\/span><span class=\"nodeLabel\">\u786c\u4ef6\u5c42<\/span><\/p>\n<hr \/>\n<h5>3. \u6838\u5fc3\u6570\u636e\u7ed3\u6784\u548c\u4ee3\u7801<\/h5>\n<h6>3.1 \u5173\u952e\u6570\u636e\u7ed3\u6784<\/h6>\n<li>VFS \u6838\u5fc3\u7ed3\u6784<\/li>\n<p><span class=\"token comment\">\/\/ include\/linux\/fs.h<\/span><br \/>\n<span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">inode<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token class-name\">umode_t<\/span> i_mode<span class=\"token punctuation\">;<\/span>       <span class=\"token comment\">\/\/ \u6587\u4ef6\u7c7b\u578b\u548c\u6743\u9650<\/span><br \/>\n    <span class=\"token class-name\">kdev_t<\/span> i_rdev<span class=\"token punctuation\">;<\/span>        <span class=\"token comment\">\/\/ \u8bbe\u5907\u53f7<\/span><br \/>\n    <span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">file_operations<\/span> <span class=\"token operator\">*<\/span>i_fop<span class=\"token punctuation\">;<\/span> <span class=\"token comment\">\/\/ \u6587\u4ef6\u64cd\u4f5c\u51fd\u6570<\/span><br \/>\n    <span class=\"token comment\">\/\/ &#8230;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">file<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">path<\/span> f_path<span class=\"token punctuation\">;<\/span>   <span class=\"token comment\">\/\/ \u8def\u5f84\u4fe1\u606f<\/span><br \/>\n    <span class=\"token class-name\">loff_t<\/span> f_pos<span class=\"token punctuation\">;<\/span>         <span class=\"token comment\">\/\/ \u5f53\u524d\u6587\u4ef6\u504f\u79fb<\/span><br \/>\n    <span class=\"token keyword\">const<\/span> <span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">file_operations<\/span> <span class=\"token operator\">*<\/span>f_op<span class=\"token punctuation\">;<\/span> <span class=\"token comment\">\/\/ \u64cd\u4f5c\u51fd\u6570\u8868<\/span><br \/>\n    <span class=\"token comment\">\/\/ &#8230;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">file_operations<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token class-name\">ssize_t<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token operator\">*<\/span>read<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">file<\/span> <span class=\"token operator\">*<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token keyword\">char<\/span> __user <span class=\"token operator\">*<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token class-name\">size_t<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token class-name\">loff_t<\/span> <span class=\"token operator\">*<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token class-name\">ssize_t<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token operator\">*<\/span>write<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">file<\/span> <span class=\"token operator\">*<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token keyword\">const<\/span> <span class=\"token keyword\">char<\/span> __user <span class=\"token operator\">*<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token class-name\">size_t<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token class-name\">loff_t<\/span> <span class=\"token operator\">*<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">int<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token operator\">*<\/span>open<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">inode<\/span> <span class=\"token operator\">*<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">file<\/span> <span class=\"token operator\">*<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token comment\">\/\/ &#8230;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<li>\u8bbe\u5907\u9a71\u52a8\u7ed3\u6784<\/li>\n<p><span class=\"token comment\">\/\/ include\/linux\/cdev.h<\/span><br \/>\n<span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">cdev<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">kobject<\/span> kobj<span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">const<\/span> <span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">file_operations<\/span> <span class=\"token operator\">*<\/span>ops<span class=\"token punctuation\">;<\/span> <span class=\"token comment\">\/\/ \u8bbe\u5907\u64cd\u4f5c\u51fd\u6570<\/span><br \/>\n    <span class=\"token class-name\">dev_t<\/span> dev<span class=\"token punctuation\">;<\/span>                         <span class=\"token comment\">\/\/ \u8bbe\u5907\u53f7<\/span><br \/>\n    <span class=\"token comment\">\/\/ &#8230;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token comment\">\/\/ \u5757\u8bbe\u5907\u64cd\u4f5c<\/span><br \/>\n<span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">block_device_operations<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token keyword\">int<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token operator\">*<\/span>open<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">block_device<\/span> <span class=\"token operator\">*<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token class-name\">fmode_t<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">void<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token operator\">*<\/span>release<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">gendisk<\/span> <span class=\"token operator\">*<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token class-name\">fmode_t<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">int<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token operator\">*<\/span>ioctl<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">block_device<\/span> <span class=\"token operator\">*<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token class-name\">fmode_t<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token keyword\">unsigned<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token keyword\">unsigned<\/span> <span class=\"token keyword\">long<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token comment\">\/\/ &#8230;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<h6>3.2 \u5173\u952e\u4ee3\u7801\u6d41\u7a0b<\/h6>\n<p>\u5757\u8bbe\u5907 I\/O \u63d0\u4ea4<\/p>\n<p><span class=\"token comment\">\/\/ fs\/block_dev.c<\/span><br \/>\n<span class=\"token class-name\">ssize_t<\/span> <span class=\"token function\">blkdev_write_iter<\/span><span class=\"token punctuation\">(<\/span><span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">kiocb<\/span> <span class=\"token operator\">*<\/span>iocb<span class=\"token punctuation\">,<\/span> <span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">iov_iter<\/span> <span class=\"token operator\">*<\/span>from<span class=\"token punctuation\">)<\/span><br \/>\n<span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">bio<\/span> <span class=\"token operator\">*<\/span>bio<span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token comment\">\/\/ 1. \u521b\u5efa BIO \u8bf7\u6c42<\/span><br \/>\n    bio <span class=\"token operator\">&#061;<\/span> <span class=\"token function\">bio_alloc<\/span><span class=\"token punctuation\">(<\/span>GFP_KERNEL<span class=\"token punctuation\">,<\/span> nr_pages<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>    <span class=\"token comment\">\/\/ 2. \u586b\u5145\u6570\u636e\u9875<\/span><br \/>\n    <span class=\"token function\">bio_add_page<\/span><span class=\"token punctuation\">(<\/span>bio<span class=\"token punctuation\">,<\/span> page<span class=\"token punctuation\">,<\/span> len<span class=\"token punctuation\">,<\/span> offset<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>    <span class=\"token comment\">\/\/ 3. \u8bbe\u7f6e\u56de\u8c03\u51fd\u6570<\/span><br \/>\n    bio<span class=\"token operator\">-&gt;<\/span>bi_end_io <span class=\"token operator\">&#061;<\/span> end_bio<span class=\"token punctuation\">;<\/span><\/p>\n<p>    <span class=\"token comment\">\/\/ 4. \u63d0\u4ea4\u5230 Block Layer<\/span><br \/>\n    <span class=\"token function\">submit_bio<\/span><span class=\"token punctuation\">(<\/span>REQ_OP_WRITE <span class=\"token operator\">|<\/span> REQ_SYNC<span class=\"token punctuation\">,<\/span> bio<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>\u5b57\u7b26\u8bbe\u5907\u6ce8\u518c<\/p>\n<p><span class=\"token comment\">\/\/ \u9a71\u52a8\u521d\u59cb\u5316<\/span><br \/>\n<span class=\"token keyword\">static<\/span> <span class=\"token keyword\">int<\/span> __init <span class=\"token function\">mychardev_init<\/span><span class=\"token punctuation\">(<\/span><span class=\"token keyword\">void<\/span><span class=\"token punctuation\">)<\/span><br \/>\n<span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token class-name\">dev_t<\/span> dev <span class=\"token operator\">&#061;<\/span> <span class=\"token function\">MKDEV<\/span><span class=\"token punctuation\">(<\/span>MAJOR_NUM<span class=\"token punctuation\">,<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token comment\">\/\/ 1. \u7533\u8bf7\u8bbe\u5907\u53f7<\/span><br \/>\n    <span class=\"token function\">register_chrdev_region<\/span><span class=\"token punctuation\">(<\/span>dev<span class=\"token punctuation\">,<\/span> <span class=\"token number\">1<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;mychardev&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>    <span class=\"token comment\">\/\/ 2. \u521d\u59cb\u5316 cdev \u7ed3\u6784<\/span><br \/>\n    <span class=\"token function\">cdev_init<\/span><span class=\"token punctuation\">(<\/span><span class=\"token operator\">&amp;<\/span>my_cdev<span class=\"token punctuation\">,<\/span> <span class=\"token operator\">&amp;<\/span>fops<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>    <span class=\"token comment\">\/\/ 3. \u6dfb\u52a0\u5230\u5185\u6838<\/span><br \/>\n    <span class=\"token function\">cdev_add<\/span><span class=\"token punctuation\">(<\/span><span class=\"token operator\">&amp;<\/span>my_cdev<span class=\"token punctuation\">,<\/span> dev<span class=\"token punctuation\">,<\/span> <span class=\"token number\">1<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<hr \/>\n<h5>4. \u7b80\u5355\u5b9e\u4f8b<\/h5>\n<h6>\u5b57\u7b26\u8bbe\u5907\u9a71\u52a8\u5b9e\u73b0<\/h6>\n<p><span class=\"token macro property\"><span class=\"token directive-hash\">#<\/span><span class=\"token directive keyword\">include<\/span> <span class=\"token string\">&lt;linux\/module.h&gt;<\/span><\/span><br \/>\n<span class=\"token macro property\"><span class=\"token directive-hash\">#<\/span><span class=\"token directive keyword\">include<\/span> <span class=\"token string\">&lt;linux\/fs.h&gt;<\/span><\/span><\/p>\n<p><span class=\"token macro property\"><span class=\"token directive-hash\">#<\/span><span class=\"token directive keyword\">define<\/span> <span class=\"token macro-name\">DEVICE_NAME<\/span> <span class=\"token string\">&#034;simple_char&#034;<\/span><\/span><br \/>\n<span class=\"token keyword\">static<\/span> <span class=\"token keyword\">int<\/span> major<span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token keyword\">static<\/span> <span class=\"token class-name\">ssize_t<\/span> <span class=\"token function\">simple_read<\/span><span class=\"token punctuation\">(<\/span><span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">file<\/span> <span class=\"token operator\">*<\/span>filp<span class=\"token punctuation\">,<\/span> <span class=\"token keyword\">char<\/span> __user <span class=\"token operator\">*<\/span>buf<span class=\"token punctuation\">,<\/span><br \/>\n                          <span class=\"token class-name\">size_t<\/span> len<span class=\"token punctuation\">,<\/span> <span class=\"token class-name\">loff_t<\/span> <span class=\"token operator\">*<\/span>off<span class=\"token punctuation\">)<\/span><br \/>\n<span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token keyword\">const<\/span> <span class=\"token keyword\">char<\/span> <span class=\"token operator\">*<\/span>msg <span class=\"token operator\">&#061;<\/span> <span class=\"token string\">&#034;Hello from kernel!\\\\n&#034;<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token class-name\">size_t<\/span> msg_len <span class=\"token operator\">&#061;<\/span> <span class=\"token function\">strlen<\/span><span class=\"token punctuation\">(<\/span>msg<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>    <span class=\"token comment\">\/\/ \u62f7\u8d1d\u6570\u636e\u5230\u7528\u6237\u7a7a\u95f4<\/span><br \/>\n    <span class=\"token keyword\">if<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token function\">copy_to_user<\/span><span class=\"token punctuation\">(<\/span>buf<span class=\"token punctuation\">,<\/span> msg<span class=\"token punctuation\">,<\/span> msg_len<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><br \/>\n        <span class=\"token keyword\">return<\/span> <span class=\"token operator\">&#8211;<\/span>EFAULT<span class=\"token punctuation\">;<\/span><\/p>\n<p>    <span class=\"token keyword\">return<\/span> msg_len<span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p><span class=\"token keyword\">static<\/span> <span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">file_operations<\/span> fops <span class=\"token operator\">&#061;<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token punctuation\">.<\/span>owner <span class=\"token operator\">&#061;<\/span> THIS_MODULE<span class=\"token punctuation\">,<\/span><br \/>\n    <span class=\"token punctuation\">.<\/span>read <span class=\"token operator\">&#061;<\/span> simple_read<span class=\"token punctuation\">,<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token keyword\">static<\/span> <span class=\"token keyword\">int<\/span> __init <span class=\"token function\">simple_init<\/span><span class=\"token punctuation\">(<\/span><span class=\"token keyword\">void<\/span><span class=\"token punctuation\">)<\/span><br \/>\n<span class=\"token punctuation\">{<\/span><br \/>\n    major <span class=\"token operator\">&#061;<\/span> <span class=\"token function\">register_chrdev<\/span><span class=\"token punctuation\">(<\/span><span class=\"token number\">0<\/span><span class=\"token punctuation\">,<\/span> DEVICE_NAME<span class=\"token punctuation\">,<\/span> <span class=\"token operator\">&amp;<\/span>fops<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token function\">printk<\/span><span class=\"token punctuation\">(<\/span>KERN_INFO <span class=\"token string\">&#034;Char device registered with major&#061;%d\\\\n&#034;<\/span><span class=\"token punctuation\">,<\/span> major<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">return<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p><span class=\"token keyword\">static<\/span> <span class=\"token keyword\">void<\/span> __exit <span class=\"token function\">simple_exit<\/span><span class=\"token punctuation\">(<\/span><span class=\"token keyword\">void<\/span><span class=\"token punctuation\">)<\/span><br \/>\n<span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token function\">unregister_chrdev<\/span><span class=\"token punctuation\">(<\/span>major<span class=\"token punctuation\">,<\/span> DEVICE_NAME<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p><span class=\"token function\">module_init<\/span><span class=\"token punctuation\">(<\/span>simple_init<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token function\">module_exit<\/span><span class=\"token punctuation\">(<\/span>simple_exit<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token function\">MODULE_LICENSE<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;GPL&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>\u7528\u6237\u7a7a\u95f4\u6d4b\u8bd5\u7a0b\u5e8f<\/p>\n<p><span class=\"token macro property\"><span class=\"token directive-hash\">#<\/span><span class=\"token directive keyword\">include<\/span> <span class=\"token string\">&lt;fcntl.h&gt;<\/span><\/span><br \/>\n<span class=\"token macro property\"><span class=\"token directive-hash\">#<\/span><span class=\"token directive keyword\">include<\/span> <span class=\"token string\">&lt;stdio.h&gt;<\/span><\/span><\/p>\n<p><span class=\"token keyword\">int<\/span> <span class=\"token function\">main<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token keyword\">char<\/span> buf<span class=\"token punctuation\">[<\/span><span class=\"token number\">256<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">int<\/span> fd <span class=\"token operator\">&#061;<\/span> <span class=\"token function\">open<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;\/dev\/simple_char&#034;<\/span><span class=\"token punctuation\">,<\/span> O_RDONLY<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token function\">read<\/span><span class=\"token punctuation\">(<\/span>fd<span class=\"token punctuation\">,<\/span> buf<span class=\"token punctuation\">,<\/span> <span class=\"token keyword\">sizeof<\/span><span class=\"token punctuation\">(<\/span>buf<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token function\">printf<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;Received: %s\\\\n&#034;<\/span><span class=\"token punctuation\">,<\/span> buf<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token function\">close<\/span><span class=\"token punctuation\">(<\/span>fd<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">return<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<hr \/>\n<h5>5. Debug \u548c\u5e38\u7528\u5de5\u5177<\/h5>\n<h6>5.1 \u6838\u5fc3\u5de5\u5177\u96c6<\/h6>\n<table>\n<tr>\u5de5\u5177\u7528\u9014\u793a\u4f8b\u547d\u4ee4<\/tr>\n<tbody>\n<tr>\n<td>lsblk<\/td>\n<td>\u5217\u51fa\u5757\u8bbe\u5907\u4fe1\u606f<\/td>\n<td>lsblk -o NAME,SIZE,TYPE,MOUNTPOINT<\/td>\n<\/tr>\n<tr>\n<td>blktrace<\/td>\n<td>\u5757\u8bbe\u5907 I\/O \u8ddf\u8e2a<\/td>\n<td>blktrace -d \/dev\/sda -o trace<\/td>\n<\/tr>\n<tr>\n<td>hdparm<\/td>\n<td>\u786c\u76d8\u53c2\u6570\u67e5\u770b\/\u8c03\u4f18<\/td>\n<td>hdparm -tT \/dev\/sda (\u6d4b\u901f)<\/td>\n<\/tr>\n<tr>\n<td>debugfs<\/td>\n<td>Ext \u6587\u4ef6\u7cfb\u7edf\u4ea4\u4e92\u8c03\u8bd5<\/td>\n<td>debugfs \/dev\/sda1<\/td>\n<\/tr>\n<tr>\n<td>lsof<\/td>\n<td>\u67e5\u770b\u6253\u5f00\u7684\u6587\u4ef6<\/td>\n<td>lsof \/mnt\/data<\/td>\n<\/tr>\n<tr>\n<td>strace<\/td>\n<td>\u8ddf\u8e2a\u7cfb\u7edf\u8c03\u7528<\/td>\n<td>strace -e file ls \/dev<\/td>\n<\/tr>\n<tr>\n<td>vfsstat<\/td>\n<td>\u5b9e\u65f6 VFS \u64cd\u4f5c\u7edf\u8ba1<\/td>\n<td>vfsstat 1 5 (\u6bcf\u79d21\u6b21, \u8f93\u51fa5\u6b21)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h6>5.2 Debug \u65b9\u6cd5<\/h6>\n<li>\n<p>\u6587\u4ef6\u7cfb\u7edf\u635f\u574f\u4fee\u590d<\/p>\n<p><span class=\"token comment\"># \u5378\u8f7d\u6587\u4ef6\u7cfb\u7edf<\/span><br \/>\n<span class=\"token function\">umount<\/span> \/dev\/sdb1<\/p>\n<p><span class=\"token comment\"># \u5f3a\u5236\u4fee\u590d Ext4<\/span><br \/>\n<span class=\"token function\">fsck<\/span> <span class=\"token parameter variable\">-y<\/span> \/dev\/sdb1<\/p>\n<p><span class=\"token comment\"># XFS \u4fee\u590d<\/span><br \/>\nxfs_repair \/dev\/sdb1<\/p>\n<\/li>\n<li>\n<p>\u8bbe\u5907\u9a71\u52a8\u95ee\u9898\u6392\u67e5<\/p>\n<ul>\n<li>\u67e5\u770b\u5185\u6838\u65e5\u5fd7&#xff1a;<span class=\"token function\">dmesg<\/span> <span class=\"token operator\">|<\/span> <span class=\"token function\">grep<\/span> <span class=\"token parameter variable\">-i<\/span> <span class=\"token string\">&#034;error\\\\|sda&#034;<\/span>\n<\/li>\n<li>\u8ddf\u8e2a\u8bbe\u5907\u6253\u5f00&#xff1a;<span class=\"token function\">strace<\/span> <span class=\"token parameter variable\">-e<\/span> <span class=\"token assign-left variable\">trace<\/span><span class=\"token operator\">&#061;<\/span>open,ioctl <span class=\"token function\">dd<\/span> <span class=\"token assign-left variable\">if<\/span><span class=\"token operator\">&#061;<\/span>\/dev\/sda <span class=\"token assign-left variable\">bs<\/span><span class=\"token operator\">&#061;<\/span>4k <span class=\"token assign-left variable\">count<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token number\">1<\/span>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>Page Cache \u8c03\u4f18<\/p>\n<p><span class=\"token comment\"># \u6e05\u7a7a Page Cache (\u6d4b\u8bd5\u7528)<\/span><br \/>\n<span class=\"token function\">sync<\/span><span class=\"token punctuation\">;<\/span> <span class=\"token builtin class-name\">echo<\/span> <span class=\"token number\">1<\/span> <span class=\"token operator\">&gt;<\/span> \/proc\/sys\/vm\/drop_caches<\/p>\n<p><span class=\"token comment\"># \u67e5\u770b\u7f13\u5b58\u7edf\u8ba1<\/span><br \/>\n<span class=\"token function\">cat<\/span> \/proc\/meminfo <span class=\"token operator\">|<\/span> <span class=\"token function\">grep<\/span> <span class=\"token parameter variable\">-i<\/span> <span class=\"token string\">&#034;cache&#034;<\/span><\/p>\n<\/li>\n<li>\n<p>I\/O \u8c03\u5ea6\u5668\u8c03\u6574<\/p>\n<p><span class=\"token comment\"># \u67e5\u770b\u5f53\u524d\u8c03\u5ea6\u5668<\/span><br \/>\n<span class=\"token function\">cat<\/span> \/sys\/block\/sda\/queue\/scheduler<\/p>\n<p><span class=\"token comment\"># \u5207\u6362\u4e3a deadline<\/span><br \/>\n<span class=\"token builtin class-name\">echo<\/span> deadline <span class=\"token operator\">&gt;<\/span> \/sys\/block\/sda\/queue\/scheduler<\/p>\n<\/li>\n<li>\n<p>\u5185\u5b58\u6620\u5c04\u8c03\u8bd5<\/p>\n<p><span class=\"token comment\"># \u67e5\u770b\u6587\u4ef6\u9875\u7f13\u5b58<\/span><br \/>\nvmtouch <span class=\"token parameter variable\">-v<\/span> \/var\/log\/syslog<\/p>\n<p><span class=\"token comment\"># \u76d1\u63a7\u9875\u7f13\u5b58\u547d\u4e2d\u7387<\/span><br \/>\nperf <span class=\"token function\">stat<\/span> <span class=\"token parameter variable\">-e<\/span> <span class=\"token string\">&#039;cache-references,cache-misses&#039;<\/span> <span class=\"token function\">ls<\/span> <span class=\"token parameter variable\">-R<\/span> \/<\/p>\n<\/li>\n<hr \/>\n<h4>\u603b\u7ed3<\/h4>\n<p>Linux \u6587\u4ef6\u7cfb\u7edf\u901a\u8fc7 VFS \u62bd\u8c61\u5c42\u7edf\u4e00\u63a5\u53e3&#xff0c;\u7ed3\u5408 Page Cache \u4f18\u5316\u6027\u80fd&#xff0c;\u5229\u7528 Inode\/Dentry \u7ba1\u7406\u5143\u6570\u636e\u3002\u8bbe\u5907\u6587\u4ef6\u5c06\u786c\u4ef6\u62bd\u8c61\u4e3a\u6587\u4ef6&#xff0c;\u901a\u8fc7\u8bbe\u5907\u53f7\u5173\u8054\u9a71\u52a8\u3002\u7406\u89e3\u5176\u67b6\u6784\u9700\u638c\u63e1&#xff1a;<\/p>\n<li>\u6570\u636e\u6d41&#xff1a;\u7528\u6237\u7a7a\u95f4 \u2192 VFS \u2192 \u6587\u4ef6\u7cfb\u7edf\/\u9a71\u52a8 \u2192 Block Layer \u2192 \u786c\u4ef6<\/li>\n<li>\u6838\u5fc3\u7ed3\u6784&#xff1a;inode, file, dentry, cdev<\/li>\n<li>\u8c03\u8bd5\u5de5\u5177\u94fe&#xff1a;blktrace\/strace\/debugfs \u7ec4\u5408\u4f7f\u7528<\/li>\n<p>\u901a\u8fc7\u6e90\u7801\u5206\u6790\u548c\u5de5\u5177\u5b9e\u8df5&#xff0c;\u53ef\u6df1\u5165\u638c\u63e1\u6587\u4ef6\u7cfb\u7edf\u4e0e\u8bbe\u5907\u4ea4\u4e92\u7684\u5e95\u5c42\u673a\u5236\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb69\u6b21\u3002Linux \u6587\u4ef6\u7cfb\u7edf\u901a\u8fc7VFS \u62bd\u8c61\u5c42\u7edf\u4e00\u63a5\u53e3\uff0c\u7ed3\u5408Page Cache \u4f18\u5316\u6027\u80fd\uff0c\u5229\u7528\u7ba1\u7406\u5143\u6570\u636e\u3002\u8bbe\u5907\u6587\u4ef6\u5c06\u786c\u4ef6\u62bd\u8c61\u4e3a\u6587\u4ef6\uff0c\u901a\u8fc7\u8bbe\u5907\u53f7\u5173\u8054\u9a71\u52a8\u3002\u6570\u636e\u6d41\uff1a\u7528\u6237\u7a7a\u95f4 \u2192 VFS \u2192 \u6587\u4ef6\u7cfb\u7edf\/\u9a71\u52a8 \u2192 Block Layer \u2192 \u786c\u4ef6inodefiledentrycdevblktracestracedebugfs\u7ec4\u5408\u4f7f\u7528\u901a\u8fc7\u6e90\u7801\u5206\u6790\u548c\u5de5\u5177\u5b9e\u8df5\uff0c\u53ef\u6df1\u5165\u638c\u63e1\u6587\u4ef6\u7cfb\u7edf\u4e0e\u8bbe\u5907\u4ea4\u4e92\u7684\u5e95\u5c42\u673a\u5236\u3002<\/p>\n","protected":false},"author":2,"featured_media":55052,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[58,5197,188,427,78],"topic":[],"class_list":["post-55053","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-linux","tag-linuxamp","tag-188","tag-427","tag-78"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u6df1\u5165\u5206\u6790Linux\u6587\u4ef6\u7cfb\u7edf\u6838\u5fc3\u539f\u7406\u67b6\u6784\u4e0e\u5b9e\u73b0\u673a\u5236 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/55053.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u6df1\u5165\u5206\u6790Linux\u6587\u4ef6\u7cfb\u7edf\u6838\u5fc3\u539f\u7406\u67b6\u6784\u4e0e\u5b9e\u73b0\u673a\u5236 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb69\u6b21\u3002Linux \u6587\u4ef6\u7cfb\u7edf\u901a\u8fc7VFS \u62bd\u8c61\u5c42\u7edf\u4e00\u63a5\u53e3\uff0c\u7ed3\u5408Page Cache \u4f18\u5316\u6027\u80fd\uff0c\u5229\u7528\u7ba1\u7406\u5143\u6570\u636e\u3002\u8bbe\u5907\u6587\u4ef6\u5c06\u786c\u4ef6\u62bd\u8c61\u4e3a\u6587\u4ef6\uff0c\u901a\u8fc7\u8bbe\u5907\u53f7\u5173\u8054\u9a71\u52a8\u3002\u6570\u636e\u6d41\uff1a\u7528\u6237\u7a7a\u95f4 \u2192 VFS \u2192 \u6587\u4ef6\u7cfb\u7edf\/\u9a71\u52a8 \u2192 Block Layer \u2192 \u786c\u4ef6inodefiledentrycdevblktracestracedebugfs\u7ec4\u5408\u4f7f\u7528\u901a\u8fc7\u6e90\u7801\u5206\u6790\u548c\u5de5\u5177\u5b9e\u8df5\uff0c\u53ef\u6df1\u5165\u638c\u63e1\u6587\u4ef6\u7cfb\u7edf\u4e0e\u8bbe\u5907\u4ea4\u4e92\u7684\u5e95\u5c42\u673a\u5236\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/55053.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-08-13T07:30:22+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250813072948-689c3eece95f8.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/55053.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/55053.html\",\"name\":\"\u6df1\u5165\u5206\u6790Linux\u6587\u4ef6\u7cfb\u7edf\u6838\u5fc3\u539f\u7406\u67b6\u6784\u4e0e\u5b9e\u73b0\u673a\u5236 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-08-13T07:30:22+00:00\",\"dateModified\":\"2025-08-13T07:30:22+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/55053.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/55053.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/55053.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u6df1\u5165\u5206\u6790Linux\u6587\u4ef6\u7cfb\u7edf\u6838\u5fc3\u539f\u7406\u67b6\u6784\u4e0e\u5b9e\u73b0\u673a\u5236\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u6df1\u5165\u5206\u6790Linux\u6587\u4ef6\u7cfb\u7edf\u6838\u5fc3\u539f\u7406\u67b6\u6784\u4e0e\u5b9e\u73b0\u673a\u5236 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/55053.html","og_locale":"zh_CN","og_type":"article","og_title":"\u6df1\u5165\u5206\u6790Linux\u6587\u4ef6\u7cfb\u7edf\u6838\u5fc3\u539f\u7406\u67b6\u6784\u4e0e\u5b9e\u73b0\u673a\u5236 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb69\u6b21\u3002Linux \u6587\u4ef6\u7cfb\u7edf\u901a\u8fc7VFS \u62bd\u8c61\u5c42\u7edf\u4e00\u63a5\u53e3\uff0c\u7ed3\u5408Page Cache \u4f18\u5316\u6027\u80fd\uff0c\u5229\u7528\u7ba1\u7406\u5143\u6570\u636e\u3002\u8bbe\u5907\u6587\u4ef6\u5c06\u786c\u4ef6\u62bd\u8c61\u4e3a\u6587\u4ef6\uff0c\u901a\u8fc7\u8bbe\u5907\u53f7\u5173\u8054\u9a71\u52a8\u3002\u6570\u636e\u6d41\uff1a\u7528\u6237\u7a7a\u95f4 \u2192 VFS \u2192 \u6587\u4ef6\u7cfb\u7edf\/\u9a71\u52a8 \u2192 Block Layer \u2192 \u786c\u4ef6inodefiledentrycdevblktracestracedebugfs\u7ec4\u5408\u4f7f\u7528\u901a\u8fc7\u6e90\u7801\u5206\u6790\u548c\u5de5\u5177\u5b9e\u8df5\uff0c\u53ef\u6df1\u5165\u638c\u63e1\u6587\u4ef6\u7cfb\u7edf\u4e0e\u8bbe\u5907\u4ea4\u4e92\u7684\u5e95\u5c42\u673a\u5236\u3002","og_url":"https:\/\/www.wsisp.com\/helps\/55053.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-08-13T07:30:22+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250813072948-689c3eece95f8.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"8 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/55053.html","url":"https:\/\/www.wsisp.com\/helps\/55053.html","name":"\u6df1\u5165\u5206\u6790Linux\u6587\u4ef6\u7cfb\u7edf\u6838\u5fc3\u539f\u7406\u67b6\u6784\u4e0e\u5b9e\u73b0\u673a\u5236 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-08-13T07:30:22+00:00","dateModified":"2025-08-13T07:30:22+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/55053.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/55053.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/55053.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u6df1\u5165\u5206\u6790Linux\u6587\u4ef6\u7cfb\u7edf\u6838\u5fc3\u539f\u7406\u67b6\u6784\u4e0e\u5b9e\u73b0\u673a\u5236"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/55053","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=55053"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/55053\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/55052"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=55053"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=55053"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=55053"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=55053"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}