Lines Matching refs:inode

20  *	- The inode number in the directory entry should be within
22 * - The inode number should refer to a in-use inode.
23 * - The first entry should be '.', and its inode should be
24 * the inode of the directory.
31 * - The inode numbers of the subdirectories for each directory.
60 * Keeps track of how many times an inode is referenced.
357 if (!dirent->inode)
370 dirent->inode = ino;
378 if (dirent->inode != ino) {
380 dirent->inode = ino;
394 nextdir->inode = 0;
405 * directory entry is sane. We do not check the inode number of '..'
415 if (!dirent->inode)
430 * Note: we don't have the parent inode just
432 * inode. This will get fixed in pass 3.
434 dirent->inode = EXT2_ROOT_INO;
443 if (e2fsck_dir_info_set_dotdot(ctx, ino, dirent->inode)) {
487 struct ext2_inode inode;
498 if (ext2fs_test_inode_bitmap2(ctx->inode_dir_map, dirent->inode)) {
501 dirent->inode)) {
505 dirent->inode))
508 e2fsck_read_inode(ctx, dirent->inode, &inode,
510 should_be = ext2_file_type(inode.i_mode);
671 dirent->inode <= fs->super->s_inodes_count &&
704 dirent->inode = 0;
748 * Make sure the inode is still in use (could have been
777 printf("In process_dir_block block %lu, #%d, inode %lu\n", block_nr,
832 } else if ((dirent->inode == 0) &&
875 } else if (dirent->inode == ino) {
878 dirent->inode = 0;
883 if (!dirent->inode)
887 * Make sure the inode listed is a legal one.
889 if (((dirent->inode != EXT2_ROOT_INO) &&
890 (dirent->inode < EXT2_FIRST_INODE(fs->super))) ||
891 (dirent->inode > fs->super->s_inodes_count)) {
895 dirent->inode))) {
897 * If the inode is in a bad block, offer to
921 (dirent->inode == EXT2_ROOT_INO)) {
939 dirent->inode = 0;
950 * If the inode was marked as having bad fields in
957 dirent->inode)) {
959 dirent->inode,
961 dirent->inode = 0;
969 group = ext2fs_group_of_ino(fs, dirent->inode);
976 * Check if the inode was missed out because
984 pctx.num = dirent->inode;
996 } else if (dirent->inode >= first_unused_inode) {
997 pctx.num = dirent->inode;
1019 dirent->inode)))
1024 dirent->inode = 0;
1061 dirent->inode))) {
1062 if (e2fsck_dir_info_get_parent(ctx, dirent->inode,
1064 cd->pctx.ino = dirent->inode;
1072 dirent->inode = 0;
1079 dirent->inode, ino);
1098 ext2fs_icount_increment(ctx->inode_count, dirent->inode,
1157 * functioned called by deallocate inode via ext2fs_iterate_block().
1180 * This fuction deallocates an inode
1185 struct ext2_inode inode;
1190 e2fsck_read_inode(ctx, ino, &inode, "deallocate_inode");
1198 ext2fs_inode_alloc_stats2(fs, ino, -1, LINUX_S_ISDIR(inode.i_mode));
1200 if (ext2fs_file_acl_block(fs, &inode) &&
1203 ext2fs_file_acl_block(fs, &inode),
1210 pctx.blk = ext2fs_file_acl_block(fs, &inode);
1217 ext2fs_file_acl_block(fs, &inode));
1219 ext2fs_file_acl_block(fs, &inode), -1);
1221 ext2fs_file_acl_block_set(fs, &inode, 0);
1224 if (!ext2fs_inode_has_valid_blocks2(fs, &inode))
1227 if (LINUX_S_ISREG(inode.i_mode) &&
1228 ext2fs_needs_large_file_feature(EXT2_I_SIZE(&inode)))
1243 e2fsck_read_inode(ctx, ino, &inode, "deallocate_inode");
1244 e2fsck_clear_inode(ctx, ino, &inode, 0, "deallocate_inode");
1248 * This fuction clears the htree flag on an inode
1252 struct ext2_inode inode;
1254 e2fsck_read_inode(ctx, ino, &inode, "clear_htree");
1255 inode.i_flags = inode.i_flags & ~EXT2_INDEX_FL;
1256 e2fsck_write_inode(ctx, ino, &inode, "clear_htree");
1266 struct ext2_inode inode;
1273 e2fsck_read_inode(ctx, ino, &inode, "process_bad_inode");
1278 pctx.inode = &inode;
1280 if (ext2fs_file_acl_block(fs, &inode) &&
1283 ext2fs_file_acl_block_set(fs, &inode, 0);
1289 if (!LINUX_S_ISDIR(inode.i_mode) && !LINUX_S_ISREG(inode.i_mode) &&
1290 !LINUX_S_ISCHR(inode.i_mode) && !LINUX_S_ISBLK(inode.i_mode) &&
1291 !LINUX_S_ISLNK(inode.i_mode) && !LINUX_S_ISFIFO(inode.i_mode) &&
1292 !(LINUX_S_ISSOCK(inode.i_mode)))
1294 else if (LINUX_S_ISCHR(inode.i_mode)
1295 && !e2fsck_pass1_check_device_inode(fs, &inode))
1297 else if (LINUX_S_ISBLK(inode.i_mode)
1298 && !e2fsck_pass1_check_device_inode(fs, &inode))
1300 else if (LINUX_S_ISFIFO(inode.i_mode)
1301 && !e2fsck_pass1_check_device_inode(fs, &inode))
1303 else if (LINUX_S_ISSOCK(inode.i_mode)
1304 && !e2fsck_pass1_check_device_inode(fs, &inode))
1306 else if (LINUX_S_ISLNK(inode.i_mode)
1307 && !e2fsck_pass1_check_symlink(fs, ino, &inode, buf)) {
1322 if (inode.i_faddr) {
1324 inode.i_faddr = 0;
1332 frag = &inode.osd2.hurd2.h_i_frag;
1333 fsize = &inode.osd2.hurd2.h_i_fsize;
1360 (inode.osd2.linux2.l_i_blocks_hi != 0)) {
1361 pctx.num = inode.osd2.linux2.l_i_blocks_hi;
1363 inode.osd2.linux2.l_i_blocks_hi = 0;
1370 inode.osd2.linux2.l_i_file_acl_high != 0) {
1371 pctx.num = inode.osd2.linux2.l_i_file_acl_high;
1373 inode.osd2.linux2.l_i_file_acl_high = 0;
1379 if (ext2fs_file_acl_block(fs, &inode) &&
1380 ((ext2fs_file_acl_block(fs, &inode) < fs->super->s_first_data_block) ||
1381 (ext2fs_file_acl_block(fs, &inode) >= ext2fs_blocks_count(fs->super)))) {
1383 ext2fs_file_acl_block_set(fs, &inode, 0);
1388 if (inode.i_dir_acl &&
1389 LINUX_S_ISDIR(inode.i_mode)) {
1391 inode.i_dir_acl = 0;
1398 e2fsck_write_inode(ctx, ino, &inode, "process_bad_inode");
1407 * block for a particular inode; this is done if a directory has
1419 struct ext2_inode inode;
1425 * Read the inode and block bitmaps in; we'll be messing with
1444 * Now let's create the actual data block for the inode
1467 * Update the inode block count
1469 e2fsck_read_inode(ctx, db->ino, &inode, "allocate_dir_block");
1470 ext2fs_iblk_add_blocks(fs, &inode, 1);
1471 if (inode.i_size < (db->blockcnt+1) * fs->blocksize)
1472 inode.i_size = (db->blockcnt+1) * fs->blocksize;
1473 e2fsck_write_inode(ctx, db->ino, &inode, "allocate_dir_block");
1476 * Finally, update the block pointers for the inode
1479 pctx->errcode = ext2fs_bmap2(fs, db->ino, &inode, 0, BMAP_SET,