1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (c) 2000-2005 Silicon Graphics, Inc.
21 static int inode_a_bmbt_count(void *obj
, int startoff
);
22 static int inode_a_bmx_count(void *obj
, int startoff
);
23 static int inode_a_count(void *obj
, int startoff
);
24 static int inode_a_offset(void *obj
, int startoff
, int idx
);
25 static int inode_a_sfattr_count(void *obj
, int startoff
);
26 static int inode_core_nlinkv2_count(void *obj
, int startoff
);
27 static int inode_core_onlink_count(void *obj
, int startoff
);
28 static int inode_core_projid_count(void *obj
, int startoff
);
29 static int inode_core_nlinkv1_count(void *obj
, int startoff
);
30 static int inode_f(int argc
, char **argv
);
31 static int inode_u_offset(void *obj
, int startoff
, int idx
);
32 static int inode_u_bmbt_count(void *obj
, int startoff
);
33 static int inode_u_bmx_count(void *obj
, int startoff
);
34 static int inode_u_c_count(void *obj
, int startoff
);
35 static int inode_u_dev_count(void *obj
, int startoff
);
36 static int inode_u_muuid_count(void *obj
, int startoff
);
37 static int inode_u_sfdir2_count(void *obj
, int startoff
);
38 static int inode_u_sfdir3_count(void *obj
, int startoff
);
39 static int inode_u_symlink_count(void *obj
, int startoff
);
41 static const cmdinfo_t inode_cmd
=
42 { "inode", NULL
, inode_f
, 0, 1, 1, "[inode#]",
43 "set current inode", NULL
};
45 const field_t inode_hfld
[] = {
46 { "", FLDT_INODE
, OI(0), C1
, 0, TYP_NONE
},
49 const field_t inode_crc_hfld
[] = {
50 { "", FLDT_INODE_CRC
, OI(0), C1
, 0, TYP_NONE
},
54 /* XXX: fix this up! */
55 #define OFF(f) bitize(offsetof(xfs_dinode_t, di_ ## f))
56 const field_t inode_flds
[] = {
57 { "core", FLDT_DINODE_CORE
, OI(OFF(magic
)), C1
, 0, TYP_NONE
},
58 { "next_unlinked", FLDT_AGINO
, OI(OFF(next_unlinked
)), C1
, 0,
60 { "u", FLDT_DINODE_U
, inode_u_offset
, C1
, FLD_OFFSET
, TYP_NONE
},
61 { "a", FLDT_DINODE_A
, inode_a_offset
, inode_a_count
,
62 FLD_COUNT
|FLD_OFFSET
, TYP_NONE
},
65 const field_t inode_crc_flds
[] = {
66 { "core", FLDT_DINODE_CORE
, OI(OFF(magic
)), C1
, 0, TYP_NONE
},
67 { "next_unlinked", FLDT_AGINO
, OI(OFF(next_unlinked
)), C1
, 0,
69 { "v3", FLDT_DINODE_V3
, OI(OFF(magic
)), C1
, 0, TYP_NONE
},
70 { "u3", FLDT_DINODE_U
, inode_u_offset
, C1
, FLD_OFFSET
, TYP_NONE
},
71 { "a", FLDT_DINODE_A
, inode_a_offset
, inode_a_count
,
72 FLD_COUNT
|FLD_OFFSET
, TYP_NONE
},
77 #define COFF(f) bitize(offsetof(xfs_dinode_t, di_ ## f))
78 const field_t inode_core_flds
[] = {
79 { "magic", FLDT_UINT16X
, OI(COFF(magic
)), C1
, 0, TYP_NONE
},
80 { "mode", FLDT_UINT16O
, OI(COFF(mode
)), C1
, 0, TYP_NONE
},
81 { "version", FLDT_INT8D
, OI(COFF(version
)), C1
, 0, TYP_NONE
},
82 { "format", FLDT_DINODE_FMT
, OI(COFF(format
)), C1
, 0, TYP_NONE
},
83 { "nlinkv1", FLDT_UINT16D
, OI(COFF(onlink
)), inode_core_nlinkv1_count
,
84 FLD_COUNT
, TYP_NONE
},
85 { "nlinkv2", FLDT_UINT32D
, OI(COFF(nlink
)), inode_core_nlinkv2_count
,
86 FLD_COUNT
, TYP_NONE
},
87 { "onlink", FLDT_UINT16D
, OI(COFF(onlink
)), inode_core_onlink_count
,
88 FLD_COUNT
, TYP_NONE
},
89 { "projid_lo", FLDT_UINT16D
, OI(COFF(projid_lo
)),
90 inode_core_projid_count
, FLD_COUNT
, TYP_NONE
},
91 { "projid_hi", FLDT_UINT16D
, OI(COFF(projid_hi
)),
92 inode_core_projid_count
, FLD_COUNT
, TYP_NONE
},
93 { "pad", FLDT_UINT8X
, OI(OFF(pad
)), CI(6), FLD_ARRAY
|FLD_SKIPALL
, TYP_NONE
},
94 { "uid", FLDT_UINT32D
, OI(COFF(uid
)), C1
, 0, TYP_NONE
},
95 { "gid", FLDT_UINT32D
, OI(COFF(gid
)), C1
, 0, TYP_NONE
},
96 { "flushiter", FLDT_UINT16D
, OI(COFF(flushiter
)), C1
, 0, TYP_NONE
},
97 { "atime", FLDT_TIMESTAMP
, OI(COFF(atime
)), C1
, 0, TYP_NONE
},
98 { "mtime", FLDT_TIMESTAMP
, OI(COFF(mtime
)), C1
, 0, TYP_NONE
},
99 { "ctime", FLDT_TIMESTAMP
, OI(COFF(ctime
)), C1
, 0, TYP_NONE
},
100 { "size", FLDT_FSIZE
, OI(COFF(size
)), C1
, 0, TYP_NONE
},
101 { "nblocks", FLDT_DRFSBNO
, OI(COFF(nblocks
)), C1
, 0, TYP_NONE
},
102 { "extsize", FLDT_EXTLEN
, OI(COFF(extsize
)), C1
, 0, TYP_NONE
},
103 { "nextents", FLDT_EXTNUM
, OI(COFF(nextents
)), C1
, 0, TYP_NONE
},
104 { "naextents", FLDT_AEXTNUM
, OI(COFF(anextents
)), C1
, 0, TYP_NONE
},
105 { "forkoff", FLDT_UINT8D
, OI(COFF(forkoff
)), C1
, 0, TYP_NONE
},
106 { "aformat", FLDT_DINODE_FMT
, OI(COFF(aformat
)), C1
, 0, TYP_NONE
},
107 { "dmevmask", FLDT_UINT32X
, OI(COFF(dmevmask
)), C1
, 0, TYP_NONE
},
108 { "dmstate", FLDT_UINT16D
, OI(COFF(dmstate
)), C1
, 0, TYP_NONE
},
109 { "flags", FLDT_UINT16X
, OI(COFF(flags
)), C1
, FLD_SKIPALL
, TYP_NONE
},
110 { "newrtbm", FLDT_UINT1
,
111 OI(COFF(flags
) + bitsz(uint16_t) - XFS_DIFLAG_NEWRTBM_BIT
- 1), C1
,
113 { "prealloc", FLDT_UINT1
,
114 OI(COFF(flags
) + bitsz(uint16_t) - XFS_DIFLAG_PREALLOC_BIT
- 1), C1
,
116 { "realtime", FLDT_UINT1
,
117 OI(COFF(flags
) + bitsz(uint16_t) - XFS_DIFLAG_REALTIME_BIT
- 1), C1
,
119 { "immutable", FLDT_UINT1
,
120 OI(COFF(flags
) + bitsz(uint16_t) - XFS_DIFLAG_IMMUTABLE_BIT
-1), C1
,
122 { "append", FLDT_UINT1
,
123 OI(COFF(flags
) + bitsz(uint16_t) - XFS_DIFLAG_APPEND_BIT
- 1), C1
,
125 { "sync", FLDT_UINT1
,
126 OI(COFF(flags
) + bitsz(uint16_t) - XFS_DIFLAG_SYNC_BIT
- 1), C1
,
128 { "noatime", FLDT_UINT1
,
129 OI(COFF(flags
) + bitsz(uint16_t) - XFS_DIFLAG_NOATIME_BIT
- 1), C1
,
131 { "nodump", FLDT_UINT1
,
132 OI(COFF(flags
) + bitsz(uint16_t) - XFS_DIFLAG_NODUMP_BIT
- 1), C1
,
134 { "rtinherit", FLDT_UINT1
,
135 OI(COFF(flags
) + bitsz(uint16_t) - XFS_DIFLAG_RTINHERIT_BIT
-1), C1
,
137 { "projinherit", FLDT_UINT1
,
138 OI(COFF(flags
) + bitsz(uint16_t) - XFS_DIFLAG_PROJINHERIT_BIT
-1), C1
,
140 { "nosymlinks", FLDT_UINT1
,
141 OI(COFF(flags
) + bitsz(uint16_t) - XFS_DIFLAG_NOSYMLINKS_BIT
-1), C1
,
143 { "extsz", FLDT_UINT1
,
144 OI(COFF(flags
) + bitsz(uint16_t) - XFS_DIFLAG_EXTSIZE_BIT
-1), C1
,
146 { "extszinherit", FLDT_UINT1
,
147 OI(COFF(flags
) + bitsz(uint16_t) - XFS_DIFLAG_EXTSZINHERIT_BIT
-1), C1
,
149 { "nodefrag", FLDT_UINT1
,
150 OI(COFF(flags
) + bitsz(uint16_t) - XFS_DIFLAG_NODEFRAG_BIT
-1), C1
,
152 { "filestream", FLDT_UINT1
,
153 OI(COFF(flags
) + bitsz(uint16_t) - XFS_DIFLAG_FILESTREAM_BIT
-1), C1
,
155 { "gen", FLDT_UINT32D
, OI(COFF(gen
)), C1
, 0, TYP_NONE
},
159 const field_t inode_v3_flds
[] = {
160 { "crc", FLDT_CRC
, OI(COFF(crc
)), C1
, 0, TYP_NONE
},
161 { "change_count", FLDT_UINT64D
, OI(COFF(changecount
)), C1
, 0, TYP_NONE
},
162 { "lsn", FLDT_UINT64X
, OI(COFF(lsn
)), C1
, 0, TYP_NONE
},
163 { "flags2", FLDT_UINT64X
, OI(COFF(flags2
)), C1
, 0, TYP_NONE
},
164 { "cowextsize", FLDT_EXTLEN
, OI(COFF(cowextsize
)), C1
, 0, TYP_NONE
},
165 { "pad2", FLDT_UINT8X
, OI(OFF(pad2
)), CI(12), FLD_ARRAY
|FLD_SKIPALL
, TYP_NONE
},
166 { "crtime", FLDT_TIMESTAMP
, OI(COFF(crtime
)), C1
, 0, TYP_NONE
},
167 { "inumber", FLDT_INO
, OI(COFF(ino
)), C1
, 0, TYP_NONE
},
168 { "uuid", FLDT_UUID
, OI(COFF(uuid
)), C1
, 0, TYP_NONE
},
169 { "reflink", FLDT_UINT1
,
170 OI(COFF(flags2
) + bitsz(uint64_t) - XFS_DIFLAG2_REFLINK_BIT
-1), C1
,
172 { "cowextsz", FLDT_UINT1
,
173 OI(COFF(flags2
) + bitsz(uint64_t) - XFS_DIFLAG2_COWEXTSIZE_BIT
-1), C1
,
179 #define TOFF(f) bitize(offsetof(xfs_timestamp_t, t_ ## f))
180 const field_t timestamp_flds
[] = {
181 { "sec", FLDT_TIME
, OI(TOFF(sec
)), C1
, 0, TYP_NONE
},
182 { "nsec", FLDT_NSEC
, OI(TOFF(nsec
)), C1
, 0, TYP_NONE
},
186 const field_t inode_u_flds
[] = {
187 { "bmbt", FLDT_BMROOTD
, NULL
, inode_u_bmbt_count
, FLD_COUNT
, TYP_NONE
},
188 { "bmx", FLDT_BMAPBTDREC
, NULL
, inode_u_bmx_count
, FLD_ARRAY
|FLD_COUNT
,
190 { "c", FLDT_CHARNS
, NULL
, inode_u_c_count
, FLD_COUNT
, TYP_NONE
},
191 { "dev", FLDT_DEV
, NULL
, inode_u_dev_count
, FLD_COUNT
, TYP_NONE
},
192 { "muuid", FLDT_UUID
, NULL
, inode_u_muuid_count
, FLD_COUNT
, TYP_NONE
},
193 { "sfdir2", FLDT_DIR2SF
, NULL
, inode_u_sfdir2_count
, FLD_COUNT
, TYP_NONE
},
194 { "sfdir3", FLDT_DIR3SF
, NULL
, inode_u_sfdir3_count
, FLD_COUNT
, TYP_NONE
},
195 { "symlink", FLDT_CHARNS
, NULL
, inode_u_symlink_count
, FLD_COUNT
,
200 const field_t inode_a_flds
[] = {
201 { "bmbt", FLDT_BMROOTA
, NULL
, inode_a_bmbt_count
, FLD_COUNT
, TYP_NONE
},
202 { "bmx", FLDT_BMAPBTAREC
, NULL
, inode_a_bmx_count
, FLD_ARRAY
|FLD_COUNT
,
204 { "sfattr", FLDT_ATTRSHORT
, NULL
, inode_a_sfattr_count
, FLD_COUNT
,
209 static const char *dinode_fmt_name
[] =
210 { "dev", "local", "extents", "btree", "uuid" };
211 static const int dinode_fmt_name_size
=
212 sizeof(dinode_fmt_name
) / sizeof(dinode_fmt_name
[0]);
230 for (i
= 0, bitpos
= bit
; i
< count
; i
++, bitpos
+= size
) {
231 f
= (xfs_dinode_fmt_t
)getbitval(obj
, bitpos
, size
, BVUNSIGNED
);
233 dbprintf("%d:", i
+ base
);
234 if (f
< 0 || f
>= dinode_fmt_name_size
)
235 dbprintf("%d", (int)f
);
237 dbprintf("%d (%s)", (int)f
, dinode_fmt_name
[(int)f
]);
251 ASSERT(bitoffs(startoff
) == 0);
252 ASSERT(obj
== iocur_top
->data
);
254 if (!XFS_DFORK_Q(dip
))
256 ASSERT((char *)XFS_DFORK_APTR(dip
) - (char *)dip
== byteize(startoff
));
257 return dip
->di_aformat
== XFS_DINODE_FMT_BTREE
;
267 ASSERT(bitoffs(startoff
) == 0);
268 ASSERT(obj
== iocur_top
->data
);
270 if (!XFS_DFORK_Q(dip
))
272 ASSERT((char *)XFS_DFORK_APTR(dip
) - (char *)dip
== byteize(startoff
));
273 return dip
->di_aformat
== XFS_DINODE_FMT_EXTENTS
?
274 be16_to_cpu(dip
->di_anextents
) : 0;
284 ASSERT(startoff
== 0);
286 return XFS_DFORK_Q(dip
);
297 ASSERT(startoff
== 0);
300 ASSERT(XFS_DFORK_Q(dip
));
301 return bitize((int)((char *)XFS_DFORK_APTR(dip
) - (char *)dip
));
305 inode_a_sfattr_count(
311 ASSERT(bitoffs(startoff
) == 0);
312 ASSERT(obj
== iocur_top
->data
);
314 if (!XFS_DFORK_Q(dip
))
316 ASSERT((char *)XFS_DFORK_APTR(dip
) - (char *)dip
== byteize(startoff
));
317 return dip
->di_aformat
== XFS_DINODE_FMT_LOCAL
;
326 xfs_attr_shortform_t
*asf
;
329 ASSERT(startoff
== 0);
332 switch (dip
->di_aformat
) {
333 case XFS_DINODE_FMT_LOCAL
:
334 asf
= (xfs_attr_shortform_t
*)XFS_DFORK_APTR(dip
);
335 return bitize(be16_to_cpu(asf
->hdr
.totsize
));
336 case XFS_DINODE_FMT_EXTENTS
:
337 return (int)be16_to_cpu(dip
->di_anextents
) *
338 bitsz(xfs_bmbt_rec_t
);
339 case XFS_DINODE_FMT_BTREE
:
340 return bitize((int)XFS_DFORK_ASIZE(dip
, mp
));
347 inode_core_nlinkv1_count(
353 ASSERT(startoff
== 0);
354 ASSERT(obj
== iocur_top
->data
);
356 return dic
->di_version
== 1;
360 inode_core_nlinkv2_count(
366 ASSERT(startoff
== 0);
367 ASSERT(obj
== iocur_top
->data
);
369 return dic
->di_version
>= 2;
373 inode_core_onlink_count(
379 ASSERT(startoff
== 0);
380 ASSERT(obj
== iocur_top
->data
);
382 return dic
->di_version
>= 2;
386 inode_core_projid_count(
392 ASSERT(startoff
== 0);
393 ASSERT(obj
== iocur_top
->data
);
395 return dic
->di_version
>= 2;
407 ino
= strtoull(argv
[1], &p
, 0);
409 dbprintf(_("bad value for inode number %s\n"), argv
[1]);
413 } else if (iocur_top
->ino
== NULLFSINO
)
414 dbprintf(_("no current inode\n"));
416 dbprintf(_("current inode number is %lld\n"), iocur_top
->ino
);
423 add_command(&inode_cmd
);
427 inode_next_type(void)
429 switch (iocur_top
->mode
& S_IFMT
) {
435 if (iocur_top
->ino
== mp
->m_sb
.sb_rbmino
)
437 else if (iocur_top
->ino
== mp
->m_sb
.sb_rsumino
)
438 return TYP_RTSUMMARY
;
439 else if (iocur_top
->ino
== mp
->m_sb
.sb_uquotino
||
440 iocur_top
->ino
== mp
->m_sb
.sb_gquotino
||
441 iocur_top
->ino
== mp
->m_sb
.sb_pquotino
)
456 return bitize(mp
->m_sb
.sb_inodesize
);
467 ASSERT(startoff
== 0);
470 return bitize((int)((char *)XFS_DFORK_DPTR(dip
) - (char *)dip
));
480 ASSERT(bitoffs(startoff
) == 0);
481 ASSERT(obj
== iocur_top
->data
);
483 ASSERT((char *)XFS_DFORK_DPTR(dip
) - (char *)dip
== byteize(startoff
));
484 return dip
->di_format
== XFS_DINODE_FMT_BTREE
;
494 ASSERT(bitoffs(startoff
) == 0);
495 ASSERT(obj
== iocur_top
->data
);
497 ASSERT((char *)XFS_DFORK_DPTR(dip
) - (char *)dip
== byteize(startoff
));
498 return dip
->di_format
== XFS_DINODE_FMT_EXTENTS
?
499 be32_to_cpu(dip
->di_nextents
) : 0;
509 ASSERT(bitoffs(startoff
) == 0);
510 ASSERT(obj
== iocur_top
->data
);
512 ASSERT((char *)XFS_DFORK_DPTR(dip
) - (char *)dip
== byteize(startoff
));
513 return dip
->di_format
== XFS_DINODE_FMT_LOCAL
&&
514 (be16_to_cpu(dip
->di_mode
) & S_IFMT
) == S_IFREG
?
515 (int)be64_to_cpu(dip
->di_size
) : 0;
525 ASSERT(bitoffs(startoff
) == 0);
526 ASSERT(obj
== iocur_top
->data
);
528 ASSERT((char *)XFS_DFORK_DPTR(dip
) - (char *)dip
== byteize(startoff
));
529 return dip
->di_format
== XFS_DINODE_FMT_DEV
;
539 ASSERT(bitoffs(startoff
) == 0);
540 ASSERT(obj
== iocur_top
->data
);
542 ASSERT((char *)XFS_DFORK_DPTR(dip
) - (char *)dip
== byteize(startoff
));
543 return dip
->di_format
== XFS_DINODE_FMT_UUID
;
547 inode_u_sfdir2_count(
553 ASSERT(bitoffs(startoff
) == 0);
554 ASSERT(obj
== iocur_top
->data
);
556 ASSERT((char *)XFS_DFORK_DPTR(dip
) - (char *)dip
== byteize(startoff
));
557 return dip
->di_format
== XFS_DINODE_FMT_LOCAL
&&
558 (be16_to_cpu(dip
->di_mode
) & S_IFMT
) == S_IFDIR
&&
559 !xfs_sb_version_hasftype(&mp
->m_sb
);
563 inode_u_sfdir3_count(
569 ASSERT(bitoffs(startoff
) == 0);
570 ASSERT(obj
== iocur_top
->data
);
572 ASSERT((char *)XFS_DFORK_DPTR(dip
) - (char *)dip
== byteize(startoff
));
573 return dip
->di_format
== XFS_DINODE_FMT_LOCAL
&&
574 (be16_to_cpu(dip
->di_mode
) & S_IFMT
) == S_IFDIR
&&
575 xfs_sb_version_hasftype(&mp
->m_sb
);
586 ASSERT(startoff
== 0);
589 switch (dip
->di_format
) {
590 case XFS_DINODE_FMT_DEV
:
591 return bitsz(xfs_dev_t
);
592 case XFS_DINODE_FMT_LOCAL
:
593 return bitize((int)be64_to_cpu(dip
->di_size
));
594 case XFS_DINODE_FMT_EXTENTS
:
595 return (int)be32_to_cpu(dip
->di_nextents
) *
596 bitsz(xfs_bmbt_rec_t
);
597 case XFS_DINODE_FMT_BTREE
:
598 return bitize((int)XFS_DFORK_DSIZE(dip
, mp
));
599 case XFS_DINODE_FMT_UUID
:
600 return bitsz(uuid_t
);
607 inode_u_symlink_count(
613 ASSERT(bitoffs(startoff
) == 0);
614 ASSERT(obj
== iocur_top
->data
);
616 ASSERT((char *)XFS_DFORK_DPTR(dip
) - (char *)dip
== byteize(startoff
));
617 return dip
->di_format
== XFS_DINODE_FMT_LOCAL
&&
618 (be16_to_cpu(dip
->di_mode
) & S_IFMT
) == S_IFLNK
?
619 (int)be64_to_cpu(dip
->di_size
) : 0;
623 * We are now using libxfs for our IO backend, so we should always try to use
624 * inode cluster buffers rather than filesystem block sized buffers for reading
625 * inodes. This means that we always use the same buffers as libxfs operations
626 * does, and that avoids buffer cache issues caused by overlapping buffers. This
627 * can be seen clearly when trying to read the root inode. Much of this logic is
628 * similar to libxfs_imap().
640 xfs_agblock_t cluster_agbno
;
643 agno
= XFS_INO_TO_AGNO(mp
, ino
);
644 agino
= XFS_INO_TO_AGINO(mp
, ino
);
645 agbno
= XFS_AGINO_TO_AGBNO(mp
, agino
);
646 offset
= XFS_AGINO_TO_OFFSET(mp
, agino
);
647 if (agno
>= mp
->m_sb
.sb_agcount
|| agbno
>= mp
->m_sb
.sb_agblocks
||
648 offset
>= mp
->m_sb
.sb_inopblock
||
649 XFS_AGINO_TO_INO(mp
, agno
, agino
) != ino
) {
650 dbprintf(_("bad inode number %lld\n"), ino
);
655 if (mp
->m_inode_cluster_size
> mp
->m_sb
.sb_blocksize
&&
656 mp
->m_inoalign_mask
) {
657 xfs_agblock_t chunk_agbno
;
658 xfs_agblock_t offset_agbno
;
659 int blks_per_cluster
;
661 blks_per_cluster
= mp
->m_inode_cluster_size
>>
662 mp
->m_sb
.sb_blocklog
;
663 offset_agbno
= agbno
& mp
->m_inoalign_mask
;
664 chunk_agbno
= agbno
- offset_agbno
;
665 cluster_agbno
= chunk_agbno
+
666 ((offset_agbno
/ blks_per_cluster
) * blks_per_cluster
);
667 offset
+= ((agbno
- cluster_agbno
) * mp
->m_sb
.sb_inopblock
);
668 numblks
= XFS_FSB_TO_BB(mp
, blks_per_cluster
);
670 cluster_agbno
= agbno
;
673 * First set_cur to the block with the inode
674 * then use off_cur to get the right part of the buffer.
676 ASSERT(typtab
[TYP_INODE
].typnm
== TYP_INODE
);
678 /* ingore ring update here, do it explicitly below */
679 set_cur(&typtab
[TYP_INODE
], XFS_AGB_TO_DADDR(mp
, agno
, cluster_agbno
),
680 numblks
, DB_RING_IGN
, NULL
);
681 off_cur(offset
<< mp
->m_sb
.sb_inodelog
, mp
->m_sb
.sb_inodesize
);
682 if (!iocur_top
->data
)
684 dip
= iocur_top
->data
;
685 iocur_top
->ino_buf
= 1;
686 iocur_top
->ino
= ino
;
687 iocur_top
->mode
= be16_to_cpu(dip
->di_mode
);
688 if ((iocur_top
->mode
& S_IFMT
) == S_IFDIR
)
689 iocur_top
->dirino
= ino
;
691 if (xfs_sb_version_hascrc(&mp
->m_sb
)) {
692 iocur_top
->ino_crc_ok
= libxfs_verify_cksum((char *)dip
,
693 mp
->m_sb
.sb_inodesize
,
695 if (!iocur_top
->ino_crc_ok
)
697 _("Metadata CRC error detected for ino %lld\n"),
701 /* track updated info in ring */
709 ASSERT(iocur_top
->ino_buf
);
710 ASSERT(iocur_top
->bp
== bp
);
712 libxfs_dinode_calc_crc(mp
, iocur_top
->data
);
713 iocur_top
->ino_crc_ok
= 1;