首页 > *nix技术, 文件系统 > Xfs文件系统磁盘布局之十:inode节点管理(续)

Xfs文件系统磁盘布局之十:inode节点管理(续)

2012年1月4日 发表评论 阅读评论 4,435 次浏览

再来看深度为2的IABT类型B+tree,这意味着该B+tree有中间节点:

[root@localhost xfsprogs]# ./db/xfs_db /dev/sdb1
xfs_db> agi
xfs_db> p
magicnum = 0x58414749
versionnum = 1
seqno = 0
length = 262059
count = 17216
root = 153945
level = 2
freecount = 8337
newino = 2712224
dirino = null
unlinked[0-63] = 
xfs_db> fsblock 153945
xfs_db> type inobt
xfs_db> p
magic = 0x49414254
level = 1
numrecs = 2
leftsib = null
rightsib = null
keys[1-2] = [startino] 1:[128] 2:[1557376]
ptrs[1-2] = 1:3 2:153893
xfs_db> fsblock 3
xfs_db> type inobt
xfs_db> p
magic = 0x49414254
level = 0
numrecs = 127
leftsib = null
rightsib = 153893
recs[1-127] = [startino,freecount,free] 1:[128,37,0x7df4ffbb16ec1e0] 2:[224,25,0x137551fd67500] 3:[320,17,0xa07611981000a804] 4:[448,42,0xd52a8fefffff366] 5:[576,25,0xa7d5811171a40198] 6:[704,32,0x657c8fd13f0107f0] 7:[864,27,0x7a00b8e69874a506] 8:[960,29,0xece2a1702427cd32] 9:[1088,29,0x792d3126ba0e6831] 10:[1152,24,0x4c86309169106876] 11:[1216,33,0xae133c71367ac387] 12:[1312,33,0xb7a5cbd5c3805566] 13:[1376,37,0x859df31fde65a8f4] 14:[1440,28,0xa6ed30e21ac05836] 15:[1504,30,0xb0d0da190fd74aa4] 16:[1600,36,0x29bffbfef0122e9] 17:[148448,18,0x80a0024b2388b50] 18:[148544,34,0xf11be655e967ae10] 19:[743232,20,0x2008e2a40095252e] 20:[743328,20,0x7cb5061004250184] 21:[764352,23,0x43d08c842b251509] 22:[764416,35,0xaebffdde9ac1058] 23:[798144,48,0x3bf7bfbffdabd7d2] 24:[903232,22,0x8ce531826c01c108] 25:[903296,28,0xc38203d4fa5608ea] 26:[903392,33,0xb0fa7782527c893d] 27:[903456,27,0xb019303c66656895] 28:[903552,27,0x5495808f44f9203d] 29:[903616,31,0x24668b2252db36be] 30:[903680,24,0xa88974490a86996] 31:[903744,26,0x59341846dea7482] 32:[903904,23,0x1110bb2201106f69] 33:[903968,35,0xebb95b71e084f3a5] 34:[904064,40,0xffefbf6f5c960115] 35:[1090624,30,0x7a606d0822798d7b] 36:[1120000,30,0x352260c6399cbfe] 37:[1120096,36,0xd2f6b0ace3cad9ec] 38:[1120192,33,0xc45b654ded9e86d0] 39:[1124064,38,0x7ff33b3b8a4c3778] 40:[1124160,39,0x837b1ddcc7ba9bf5] 41:[1124224,30,0xe050e4b0c75cb5a9] 42:[1124320,19,0x2061500a402a196a] 43:[1124416,26,0x7867870a9410b452] 44:[1124480,26,0xb4b306a931968c02] 45:[1124608,27,0x60b1560bae862e11] 46:[1124704,38,0x3cffe6a3212f4fea] 47:[1124800,35,0xfffdc0794035992d] 48:[1124896,46,0x9aee755373cfffff] 49:[1125024,41,0xffdabbb716c9768d] 50:[1125120,34,0x7b00005bb5f0ffe7] 51:[1125248,31,0x474c7a4e83ad474c] 52:[1125344,32,0x83ad474c7a4e83ad] 53:[1125440,39,0x30f7ef9878efda4e] 54:[1125536,31,0x237a6bcd00bd113b] 55:[1125696,34,0x5c0f519128fbfd2e] 56:[1125792,34,0xff8ede09958452ae] 57:[1125984,54,0xaa6cbdffffffffff] 58:[1126112,42,0xfdfeb99675e63dd1] 59:[1126240,47,0xaf6d7fe23beffa7f] 60:[1126336,55,0xfef7effffbfb77f9] 61:[1126400,46,0xdef5fd1e9657dffd] 62:[1126528,40,0xefe6993f1e33f38b] 63:[1126624,33,0xb00c0ffc776d9711] 64:[1126720,34,0xe0e805bf1856f3e7] 65:[1126848,34,0xd4782a5a93dcfb51] 66:[1126976,30,0x4dee910cb83d0a3c] 67:[1127072,36,0xc0cff3a5a0db36dd] 68:[1127200,42,0xffdffa0df73c1995] 69:[1127360,36,0xea8b8bb525ea8baf] 70:[1127424,32,0x4101db756fa017eb] 71:[1133728,41,0x1bb229c3bfef75ef] 72:[1133856,37,0x4d2bd7afdad43d7] 73:[1133984,21,0x7a1c36c00005e140] 74:[1134112,29,0x921e580a75610fb9] 75:[1142432,23,0x1b97c9e298008404] 76:[1142560,31,0x1b1d140c6b9c75b5] 77:[1142624,37,0xfdec1a3bb72aba8c] 78:[1142752,34,0xb0b970fe095db749] 79:[1142848,32,0xf3f77b8c82414943] 80:[1156448,52,0x9dffffbf3ff6ebeb] 81:[1156544,57,0x5df4fffffffffffb] 82:[1167040,27,0xca719322228d217a] 83:[1167136,35,0xc35336aa757ebf20] 84:[1167232,40,0xb7fd91679ff2ba94] 85:[1167360,35,0x76769abef4de802a] 86:[1167424,32,0x1db9d16925dc4396] 87:[1183680,40,0x3578bbef333fe798] 88:[1183776,30,0x7be77b7718003300] 89:[1183872,39,0xfffffe0e18a33a0e] 90:[1194368,50,0xf7fbfaffd57b7c9f] 91:[1194464,45,0xf5fabb87f5ff6a97] 92:[1239872,47,0xf5ffdd9dade7f17e] 93:[1239936,53,0x83befffffcf7fdff] 94:[1240032,26,0x84fb6fee00e00081] 95:[1423264,27,0x7effff856] 96:[1423360,29,0xff6fdeedc0000001] 97:[1423488,60,0xbdbffffffbffffff] 98:[1423584,49,0xfbffbb7fef155f3b] 99:[1423680,59,0xaffdfffeffefffff] 100:[1423808,55,0x7f5afffffbbfffd7] 101:[1423936,40,0x310bf2b7fb5fe93b] 102:[1424032,32,0xb9ebd5a318958a89] 103:[1451840,40,0xdb6ddb19dfd370d5] 104:[1451936,38,0x9e6db0b27796db6e] 105:[1452032,40,0xdb67f07593fde1da] 106:[1461568,43,0xb75eddb34f8dbddb] 107:[1461664,39,0x79b8ddb6db6db6d] 108:[1461760,49,0xffff7ffeb7899e1f] 109:[1461856,44,0x55555554fffe3fff] 110:[1470656,31,0xd523195555555555] 111:[1505664,38,0xfffffaa12a05948f] 112:[1505760,31,0xe5c288b2c2d65967] 113:[1505952,34,0xccffff0f420b280e] 114:[1506112,35,0xeed806dd21dec3ab] 115:[1533280,57,0xbf3f7ffffdffffbe] 116:[1533408,30,0x2434415aa234e3ff] 117:[1533536,23,0x9d22e093e1054024] 118:[1533632,25,0x36f90800d3390bc] 119:[1533760,18,0x72932000aaa20900] 120:[1556608,30,0x530ece40df0cd0ad] 121:[1556736,32,0x404cf3e9c5ad694b] 122:[1556832,22,0x2100d32001ac33d9] 123:[1556896,13,0x400002418b25011] 124:[1556992,18,0x83806cc00311e4] 125:[1557088,20,0x88b268d442123200] 126:[1557216,33,0xa6ee1b050ed26b97] 127:[1557312,30,0xd88cc1dd5d5503a8]
xfs_db> fsblock 153893
xfs_db> type inobt
xfs_db> p
magic = 0x49414254
level = 0
numrecs = 142
leftsib = 3
rightsib = null
recs[1-142] = [startino,freecount,free] 1:[1557376,35,0x8fd81b18aff5d4d8] 2:[1557472,25,0xefcd60900040f826] 3:[1557568,32,0x800003ff59e37be7] 4:[1557664,15,0x1428c01101261900] 5:[1557760,10,0x2200208408440090] 6:[1557824,18,0x81e0d000061c5211] 7:[1557920,20,0x21e800129128aa83] 8:[1558048,51,0xbaffdfffffd7789e] 9:[1639680,52,0xfffbbbffffb5fb98] 10:[1639776,39,0xe63593977fd0b7cb] 11:[1639872,23,0x11e0680215a1fb4] 12:[1674912,44,0xfffffffff8808e05] 13:[1677472,55,0xaa87ffffffffdfff] 14:[1677568,29,0xf7a76137b809a080] 15:[1692448,41,0xe7b75b6db238b5df] 16:[1692544,33,0x260851855fffbbb] 17:[1802240,26,0xac44022483ec0fce] 18:[1802368,25,0x8bd92018a4209f94] 19:[1802464,26,0xc68063ab51298ea0] 20:[1802560,29,0x42f06844dfa07ed] 21:[1802688,29,0x1f6e15420f0bba12] 22:[1802816,29,0xca714b5038b38c2b] 23:[1802880,27,0xde8ce91300cd0d06] 24:[1802976,20,0x287044c918816098] 25:[1803072,27,0xef76437044435102] 26:[1803168,33,0xf187b0a064742f7f] 27:[1803232,19,0xa314451207100c82] 28:[1803328,27,0x87660c6ce864a09c] 29:[1803392,24,0x36a61ce00924cd1] 30:[1857664,33,0xaf84d380f74aea65] 31:[1857760,34,0xf8f1c2c0c01fbede] 32:[1926112,26,0x603471c8bf208391] 33:[1926208,28,0x5b2707594e99204c] 34:[1926272,12,0x1821120500405004] 35:[1926400,25,0x46da084831d1f62] 36:[2036960,21,0xa44f19402a80141c] 37:[2065952,34,0xab6be38a3a495c6b] 38:[2066016,35,0x956963b6ecda1bf0] 39:[2066080,26,0xf6e694990008b416] 40:[2146560,45,0xf3851ab8f3ffefff] 41:[2166784,29,0xe59598e394526458] 42:[2166880,29,0x662c1465ba1b03da] 43:[2166944,27,0x81a0ad96bfb84048] 44:[2167008,31,0xab489e3296d54396] 45:[2167104,28,0xb828e4d990f07a81] 46:[2167168,32,0xf58644129c8f35be] 47:[2167264,38,0xf67cfcf1a558f827] 48:[2167328,37,0xf911ebc99ee95f32] 49:[2167424,27,0x70010219d65eb41f] 50:[2357728,24,0x4fa76102241b8850] 51:[2357824,32,0x8424e92f42b7b9e5] 52:[2357952,23,0x6703108c1b20506d] 53:[2358048,24,0x8b11041679918532] 54:[2358144,23,0xa026f900184b0395] 55:[2358208,30,0x24400b3b4ed6734f] 56:[2358336,22,0x8a04e3b420858aa] 57:[2358432,20,0xd224039129900452] 58:[2358528,19,0x205413092854c224] 59:[2358624,20,0xa14a4918940d805] 60:[2358688,20,0xea15a200140f000e] 61:[2358784,14,0x24046e180200809] 62:[2358848,11,0x480240244002800a] 63:[2358912,15,0x464111012080ca8] 64:[2358976,12,0x3000043d40050200] 65:[2359072,14,0x1240a1048aa0410] 66:[2359136,19,0x20a860825c029116] 67:[2359232,24,0xc1c4d18011591963] 68:[2359328,24,0x5141301929c5cd11] 69:[2359456,27,0xd2b44d401ba80fa2] 70:[2359584,24,0x54f0a144fc000bb] 71:[2359680,13,0x101040c800182a41] 72:[2359744,15,0x342b0010d4c00001] 73:[2359840,30,0x527f3967c01b881a] 74:[2359904,23,0xbb2032c605104b28] 75:[2360000,26,0xd3ac536c5442981] 76:[2360096,25,0xa989b22b23949009] 77:[2360256,24,0x475807bc08b0c43] 78:[2360384,19,0x3040c84aa6c14900] 79:[2360480,26,0x453711625c38bc04] 80:[2360576,26,0x20ccf00561a20beb] 81:[2360704,29,0x584dd8f5086e8e60] 82:[2360800,27,0x94c43efc6860440d] 83:[2360928,54,0xdfeffbcd9f7ffeff] 84:[2360992,28,0x21400fb8841e5ddb] 85:[2361088,20,0x2940238398093203] 86:[2361184,24,0x94869c280aec0a62] 87:[2361312,31,0x583fcc71ea1011be] 88:[2361408,32,0x51846807f7d46bba] 89:[2361504,27,0x34618fd428d885c4] 90:[2361632,24,0x83b089703aa4250a] 91:[2361728,33,0x5e5bbe1b96a41631] 92:[2361824,41,0xdf5fc8e0ffc2e9db] 93:[2361920,28,0x9c35697502caa489] 94:[2361984,34,0x17b54c1d378a63af] 95:[2362080,37,0xd09f9115f8fdde53] 96:[2362144,27,0x3c8f3109a8ab12a4] 97:[2377760,30,0x46812f4c8f46bf06] 98:[2377856,26,0xa54ad29443a3a188] 99:[2377920,30,0x3ee49a4a1a224e9b] 100:[2378048,27,0x4c96b452aaa188d4] 101:[2378176,32,0x3dcf881d78194973] 102:[2378272,27,0x569e433d3c2211a0] 103:[2378336,31,0x6182412698aaeffb] 104:[2382816,36,0xffff983165d11117] 105:[2382944,38,0x82fe18b575d7f7f] 106:[2383040,23,0x3b9e1508c484446] 107:[2383168,38,0x4dffabae4677cc46] 108:[2383232,24,0x203b1a762804c469] 109:[2383328,41,0xa7cbfafafdd12e93] 110:[2383424,28,0x414aa26281c42ffd] 111:[2383520,42,0x773f376fbfdd7142] 112:[2390080,37,0x9f26b6b49f839ebc] 113:[2390144,26,0xc4228420f116ba9e] 114:[2390240,21,0x2270964d4a264200] 115:[2390336,27,0x2de11831e0b1688e] 116:[2392832,27,0xd272539312a15d20] 117:[2416576,22,0xe210f0808233b448] 118:[2462304,18,0xb0e920081a800382] 119:[2462400,23,0x824c21a09371aca0] 120:[2462528,18,0x80284888022de122] 121:[2462624,34,0x207fbf0b677985a4] 122:[2462720,25,0xe004325203701b77] 123:[2462816,35,0xa01903fdffbbfd] 124:[2462912,16,0x840c198192610400] 125:[2463008,17,0xa1aa4001110b2110] 126:[2463136,26,0x6900203eda4d0b55] 127:[2463200,33,0x3a4fc667111bfb03] 128:[2463296,30,0xcf484d46f9200f72] 129:[2463360,41,0xbeee1b1f93f37dac] 130:[2463424,28,0xc871265ba51e8452] 131:[2463520,38,0x60ff25e7e748b73e] 132:[2469856,33,0x4b0a1f19bbbbf7] 133:[2563488,26,0x3118076d78888ea4] 134:[2563584,34,0x4a98ffd54f209cbc] 135:[2563648,30,0xc68e010c3ca37be9] 136:[2563776,18,0x7c2d21ca8100001] 137:[2646432,33,0xc05100f6daf89f6f] 138:[2648864,34,0x1aa23beffe435154] 139:[2662304,34,0xf5e55ab1c61a17c9] 140:[2662400,36,0x18835fcbcbebb935] 141:[2662464,37,0x977db55ec1bcc707] 142:[2712224,38,0xffe2edda7f2804da]
xfs_db>

IABT类型B+tree的叶子节点和中间节点内存布局如下所示:

和前面所讲过的ABTB/ABTC类型的B+tree的中间节点一样,对于xfs_inobt_ptr[0]的起始地址为:16+510*4=2056=0x808,其中510=(4096-16)/(4+4)。
看实际数据验证我们的分析:

xfs_db> fsblock 153945
xfs_db> type text
xfs_db> p
000:  49 41 42 54 00 01 00 02 ff ff ff ff ff ff ff ff  IABT............
010:  00 00 00 80 00 17 c3 80 01 00 7e 85 7f 00 00 00  ................
020:  14 00 10 0c c9 00 00 18 7f 12 e9 b5 00 00 0f bb  ................
030:  3b 01 00 7f 13 26 30 00 00 00 0f fb ef 00 00 7f  ......0.........
040:  14 ea 00 00 00 04 0f 18 c2 00 00 7f 16 7d 03 00  ................
*
800:  00 a4 01 00 06 ae af 00 00 00 00 03 00 02 59 25  ..............Y.
810:  00 00 01 00 06 2f b9 00 00 ae bd 00 00 07 8a 00  ................
820:  00 00 01 00 06 18 bd 00 00 be bd 00 00 07 8a 00  ................
830:  00 00 01 00 08 04 c4 bd 00 00 09 ef 58 00 00 29  ............X...
840:  04 41 31 02 eb bd 00 00 34 62 75 66 00 41 32 02  .A1.....4buf.A2.
*
xfs_db> 

其它的关于这个B+tree的整体组织,前面已经描述过ABTB/ABTC类型的B+tree,所以不再多讲,下一篇开始inode本身结构的分析。

转载请保留地址:http://www.lenky.info/archives/2012/01/788http://lenky.info/?p=788


备注:如无特殊说明,文章内容均出自Lenky个人的真实理解而并非存心妄自揣测来故意愚人耳目。由于个人水平有限,虽力求内容正确无误,但仍然难免出错,请勿见怪,如果可以则请留言告之,并欢迎来讨论。另外值得说明的是,Lenky的部分文章以及部分内容参考借鉴了网络上各位网友的热心分享,特别是一些带有完全参考的文章,其后附带的链接内容也许更直接、更丰富,而我只是做了一下归纳&转述,在此也一并表示感谢。关于本站的所有技术文章,欢迎转载,但请遵从CC创作共享协议,而一些私人性质较强的心情随笔,建议不要转载。

法律:根据最新颁布的《信息网络传播权保护条例》,如果您认为本文章的任何内容侵犯了您的权利,请以Email或书面等方式告知,本站将及时删除相关内容或链接。

  1. 本文目前尚无任何评论.
  1. 本文目前尚无任何 trackbacks 和 pingbacks.