Changeset View
Changeset View
Standalone View
Standalone View
sys/fs/ext2fs/ext2_inode_cnv.c
Context not available. | |||||
printf("Inode: %5ju", (uintmax_t)in->i_number); | printf("Inode: %5ju", (uintmax_t)in->i_number); | ||||
printf( /* "Inode: %5d" */ | printf( /* "Inode: %5d" */ | ||||
" Type: %10s Mode: 0x%o Flags: 0x%x Version: %d acl: 0x%llx\n", | " Type: %10s Mode: 0x%o Flags: 0x%x Version: %d acl: 0x%lx\n", | ||||
"n/a", in->i_mode, in->i_flags, in->i_gen, in->i_facl); | "n/a", in->i_mode, in->i_flags, in->i_gen, in->i_facl); | ||||
printf("User: %5u Group: %5u Size: %ju\n", | printf("User: %5u Group: %5u Size: %ju\n", | ||||
in->i_uid, in->i_gid, (uintmax_t)in->i_size); | in->i_uid, in->i_gid, (uintmax_t)in->i_size); | ||||
Context not available. | |||||
printf("mtime: 0x%x", in->i_mtime); | printf("mtime: 0x%x", in->i_mtime); | ||||
if (E2DI_HAS_XTIME(in)) | if (E2DI_HAS_XTIME(in)) | ||||
printf("crtime %#x ", in->i_birthtime); | printf("crtime %#x ", in->i_birthtime); | ||||
printf("BLOCKS:"); | if (in->i_flag & IN_E4EXTENTS) { | ||||
for (i = 0; i < (in->i_blocks <= 24 ? (in->i_blocks + 1) / 2 : 12); i++) | printf("Extents:\n"); | ||||
printf(" %d", in->i_db[i]); | ehp = (struct ext4_extent_header *)in->i_db; | ||||
printf("\n"); | printf("Header (magic 0x%x entries %d max %d depth %d gen %d)\n", | ||||
printf("Extents:\n"); | ehp->eh_magic, ehp->eh_ecount, ehp->eh_max, ehp->eh_depth, | ||||
ehp = (struct ext4_extent_header *)in->i_db; | ehp->eh_gen); | ||||
printf("Header (magic 0x%x entries %d max %d depth %d gen %d)\n", | ep = (struct ext4_extent *)(char *)(ehp + 1); | ||||
ehp->eh_magic, ehp->eh_ecount, ehp->eh_max, ehp->eh_depth, | printf("Index (blk %d len %d start_lo %d start_hi %d)\n", ep->e_blk, | ||||
ehp->eh_gen); | ep->e_len, ep->e_start_lo, ep->e_start_hi); | ||||
ep = (struct ext4_extent *)(char *)(ehp + 1); | printf("\n"); | ||||
printf("Index (blk %d len %d start_lo %d start_hi %d)\n", ep->e_blk, | } else { | ||||
ep->e_len, ep->e_start_lo, ep->e_start_hi); | printf("BLOCKS:"); | ||||
printf("\n"); | for (i = 0; i < (in->i_blocks <= 24 ? (in->i_blocks + 1) / 2 : 12); i++) | ||||
printf(" %d", in->i_db[i]); | |||||
printf("\n"); | |||||
} | |||||
} | } | ||||
#endif /* EXT2FS_DEBUG */ | #endif /* EXT2FS_DEBUG */ | ||||
Context not available. | |||||
void | void | ||||
ext2_ei2i(struct ext2fs_dinode *ei, struct inode *ip) | ext2_ei2i(struct ext2fs_dinode *ei, struct inode *ip) | ||||
{ | { | ||||
int i; | |||||
ip->i_nlink = ei->e2di_nlink; | ip->i_nlink = ei->e2di_nlink; | ||||
/* | /* | ||||
* Godmar thinks - if the link count is zero, then the inode is | * Godmar thinks - if the link count is zero, then the inode is | ||||
Context not available. | |||||
ip->i_uid |= (uint32_t)ei->e2di_uid_high << 16; | ip->i_uid |= (uint32_t)ei->e2di_uid_high << 16; | ||||
ip->i_gid |= (uint32_t)ei->e2di_gid_high << 16; | ip->i_gid |= (uint32_t)ei->e2di_gid_high << 16; | ||||
for (i = 0; i < EXT2_NDADDR; i++) | memcpy(ip->i_data, ei->e2di_blocks, sizeof(ei->e2di_blocks)); | ||||
ip->i_db[i] = ei->e2di_blocks[i]; | |||||
for (i = 0; i < EXT2_NIADDR; i++) | |||||
ip->i_ib[i] = ei->e2di_blocks[EXT2_NDIR_BLOCKS + i]; | |||||
} | } | ||||
/* | /* | ||||
Context not available. | |||||
void | void | ||||
ext2_i2ei(struct inode *ip, struct ext2fs_dinode *ei) | ext2_i2ei(struct inode *ip, struct ext2fs_dinode *ei) | ||||
{ | { | ||||
int i; | |||||
ei->e2di_mode = ip->i_mode; | ei->e2di_mode = ip->i_mode; | ||||
ei->e2di_nlink = ip->i_nlink; | ei->e2di_nlink = ip->i_nlink; | ||||
/* | /* | ||||
Context not available. | |||||
ei->e2di_gid = ip->i_gid & 0xffff; | ei->e2di_gid = ip->i_gid & 0xffff; | ||||
ei->e2di_gid_high = ip->i_gid >> 16 & 0xffff; | ei->e2di_gid_high = ip->i_gid >> 16 & 0xffff; | ||||
for (i = 0; i < EXT2_NDADDR; i++) | memcpy(ei->e2di_blocks, ip->i_data, sizeof(ei->e2di_blocks)); | ||||
ei->e2di_blocks[i] = ip->i_db[i]; | |||||
for (i = 0; i < EXT2_NIADDR; i++) | |||||
ei->e2di_blocks[EXT2_NDIR_BLOCKS + i] = ip->i_ib[i]; | |||||
} | } | ||||
Context not available. |