Lines Matching refs:ip
98 struct inode *ip; in ffs_update() local
104 ip = VTOI(vp); in ffs_update()
105 if ((ip->i_flag & IN_MODIFIED) == 0 && waitfor == 0) in ffs_update()
107 ip->i_flag &= ~(IN_LAZYACCESS | IN_LAZYMOD | IN_MODIFIED); in ffs_update()
127 ip->i_flag &= ~(IN_SIZEMOD | IN_IBLKDATA); in ffs_update()
128 fs = ITOFS(ip); in ffs_update()
144 if (IS_SNAPSHOT(ip)) in ffs_update()
146 bn = fsbtodb(fs, ino_to_fsba(fs, ip->i_number)); in ffs_update()
147 error = ffs_breadz(VFSTOUFS(vp->v_mount), ITODEVVP(ip), bn, bn, in ffs_update()
186 softdep_update_inodeblock(ip, bp, waitfor); in ffs_update()
187 else if (ip->i_effnlink != ip->i_nlink) in ffs_update()
189 if (I_IS_UFS1(ip)) { in ffs_update()
191 ino_to_fsbo(fs, ip->i_number)) = *ip->i_din1; in ffs_update()
196 random_harvest_queue(&(ip->i_din1), sizeof(ip->i_din1), RANDOM_FS_ATIME); in ffs_update()
198 ffs_update_dinode_ckhash(fs, ip->i_din2); in ffs_update()
200 ino_to_fsbo(fs, ip->i_number)) = *ip->i_din2; in ffs_update()
205 random_harvest_queue(&(ip->i_din2), sizeof(ip->i_din2), RANDOM_FS_ATIME); in ffs_update()
236 struct inode *ip; in ffs_truncate() local
254 ip = VTOI(vp); in ffs_truncate()
266 error = getinoquota(ip); in ffs_truncate()
295 if (fs->fs_magic == FS_UFS2_MAGIC && ip->i_din2->di_extsize > 0) { in ffs_truncate()
296 extblocks = btodb(fragroundup(fs, ip->i_din2->di_extsize)); in ffs_truncate()
309 (void) chkdq(ip, -extblocks, NOCRED, FORCE); in ffs_truncate()
314 osize = ip->i_din2->di_extsize; in ffs_truncate()
315 ip->i_din2->di_blocks -= extblocks; in ffs_truncate()
316 ip->i_din2->di_extsize = 0; in ffs_truncate()
318 oldblks[i] = ip->i_din2->di_extb[i]; in ffs_truncate()
319 ip->i_din2->di_extb[i] = 0; in ffs_truncate()
321 UFS_INODE_SET_FLAG(ip, IN_SIZEMOD | IN_CHANGE); in ffs_truncate()
327 ffs_blkfree(ump, fs, ITODEVVP(ip), oldblks[i], in ffs_truncate()
328 sblksize(fs, osize, i), ip->i_number, in ffs_truncate()
335 if (vp->v_type == VLNK && ip->i_size < ump->um_maxsymlinklen) { in ffs_truncate()
340 bzero(DIP(ip, i_shortlink), (uint64_t)ip->i_size); in ffs_truncate()
341 ip->i_size = 0; in ffs_truncate()
342 DIP_SET(ip, i_size, 0); in ffs_truncate()
343 UFS_INODE_SET_FLAG(ip, IN_SIZEMOD | IN_CHANGE | IN_UPDATE); in ffs_truncate()
348 if (ip->i_size == length) { in ffs_truncate()
349 UFS_INODE_SET_FLAG(ip, IN_CHANGE | IN_UPDATE); in ffs_truncate()
356 if (IS_SNAPSHOT(ip)) in ffs_truncate()
358 cluster_init_vn(&ip->i_clusterw); in ffs_truncate()
359 osize = ip->i_size; in ffs_truncate()
373 ip->i_size = length; in ffs_truncate()
374 DIP_SET(ip, i_size, length); in ffs_truncate()
378 UFS_INODE_SET_FLAG(ip, IN_SIZEMOD | IN_CHANGE | IN_UPDATE); in ffs_truncate()
389 blkno = DIP(ip, i_db[lbn]); in ffs_truncate()
396 if (I_IS_UFS1(ip)) in ffs_truncate()
438 softdep_journal_freeblocks(ip, cred, length, in ffs_truncate()
441 softdep_setup_freeblocks(ip, length, flags); in ffs_truncate()
444 UFS_INODE_SET_FLAG(ip, IN_CHANGE | IN_UPDATE); in ffs_truncate()
462 ip->i_size = length; in ffs_truncate()
463 DIP_SET(ip, i_size, length); in ffs_truncate()
464 UFS_INODE_SET_FLAG(ip, IN_SIZEMOD | IN_CHANGE | IN_UPDATE); in ffs_truncate()
466 if (vp->v_type == VDIR && ip->i_dirhash != NULL) in ffs_truncate()
467 ufsdirhash_dirtrunc(ip, length); in ffs_truncate()
493 ip->i_size = length; in ffs_truncate()
494 DIP_SET(ip, i_size, length); in ffs_truncate()
496 if (vp->v_type == VDIR && ip->i_dirhash != NULL) in ffs_truncate()
497 ufsdirhash_dirtrunc(ip, length); in ffs_truncate()
499 size = blksize(fs, ip, lbn); in ffs_truncate()
508 UFS_INODE_SET_FLAG(ip, IN_SIZEMOD | IN_CHANGE | IN_UPDATE); in ffs_truncate()
528 oldblks[UFS_NDADDR + level] = DIP(ip, i_ib[level]); in ffs_truncate()
530 DIP_SET(ip, i_ib[level], 0); in ffs_truncate()
535 oldblks[i] = DIP(ip, i_db[i]); in ffs_truncate()
537 DIP_SET(ip, i_db[i], 0); in ffs_truncate()
539 UFS_INODE_SET_FLAG(ip, IN_CHANGE | IN_UPDATE); in ffs_truncate()
550 newblks[i] = DIP(ip, i_db[i]); in ffs_truncate()
552 DIP_SET(ip, i_db[i], oldblks[i]); in ffs_truncate()
556 newblks[UFS_NDADDR + i] = DIP(ip, i_ib[i]); in ffs_truncate()
558 DIP_SET(ip, i_ib[i], oldblks[UFS_NDADDR + i]); in ffs_truncate()
560 ip->i_size = osize; in ffs_truncate()
561 DIP_SET(ip, i_size, osize); in ffs_truncate()
562 UFS_INODE_SET_FLAG(ip, IN_SIZEMOD | IN_CHANGE | IN_UPDATE); in ffs_truncate()
575 bn = DIP(ip, i_ib[level]); in ffs_truncate()
577 error = ffs_indirtrunc(ip, indir_lbn[level], in ffs_truncate()
583 DIP_SET(ip, i_ib[level], 0); in ffs_truncate()
585 fs->fs_bsize, ip->i_number, in ffs_truncate()
597 key = ffs_blkrelease_start(ump, ump->um_devvp, ip->i_number); in ffs_truncate()
601 bn = DIP(ip, i_db[i]); in ffs_truncate()
604 DIP_SET(ip, i_db[i], 0); in ffs_truncate()
605 bsize = blksize(fs, ip, i); in ffs_truncate()
606 ffs_blkfree(ump, fs, ump->um_devvp, bn, bsize, ip->i_number, in ffs_truncate()
618 bn = DIP(ip, i_db[lastblock]); in ffs_truncate()
626 oldspace = blksize(fs, ip, lastblock); in ffs_truncate()
627 ip->i_size = length; in ffs_truncate()
628 DIP_SET(ip, i_size, length); in ffs_truncate()
629 UFS_INODE_SET_FLAG(ip, IN_SIZEMOD | IN_CHANGE | IN_UPDATE); in ffs_truncate()
630 newspace = blksize(fs, ip, lastblock); in ffs_truncate()
641 oldspace - newspace, ip->i_number, vp->v_type, in ffs_truncate()
649 if (newblks[UFS_NDADDR + level] != DIP(ip, i_ib[level])) in ffs_truncate()
652 (intmax_t)DIP(ip, i_ib[level])); in ffs_truncate()
654 if (newblks[i] != DIP(ip, i_db[i])) in ffs_truncate()
657 (intmax_t)DIP(ip, i_ib[level])); in ffs_truncate()
660 (fs->fs_magic != FS_UFS2_MAGIC || ip->i_din2->di_extsize == 0) && in ffs_truncate()
669 ip->i_size = length; in ffs_truncate()
670 DIP_SET(ip, i_size, length); in ffs_truncate()
671 if (DIP(ip, i_blocks) >= blocksreleased) in ffs_truncate()
672 DIP_SET(ip, i_blocks, DIP(ip, i_blocks) - blocksreleased); in ffs_truncate()
674 DIP_SET(ip, i_blocks, 0); in ffs_truncate()
675 UFS_INODE_SET_FLAG(ip, IN_SIZEMOD | IN_CHANGE); in ffs_truncate()
677 (void) chkdq(ip, -blocksreleased, NOCRED, FORCE); in ffs_truncate()
683 softdep_journal_freeblocks(ip, cred, length, IO_EXT); in ffs_truncate()
685 softdep_setup_freeblocks(ip, length, IO_EXT); in ffs_truncate()
697 ffs_indirtrunc(struct inode *ip, in ffs_indirtrunc() argument
715 #define BAP(ip, i) (I_IS_UFS1(ip) ? bap1[i] : bap2[i]) in ffs_indirtrunc() argument
717 fs = ITOFS(ip); in ffs_indirtrunc()
718 ump = ITOUMP(ip); in ffs_indirtrunc()
738 vp = ITOV(ip); in ffs_indirtrunc()
746 if (I_IS_UFS1(ip)) in ffs_indirtrunc()
754 if (I_IS_UFS1(ip)) in ffs_indirtrunc()
765 if (I_IS_UFS1(ip)) in ffs_indirtrunc()
774 key = ffs_blkrelease_start(ump, ITODEVVP(ip), ip->i_number); in ffs_indirtrunc()
777 nb = BAP(ip, i); in ffs_indirtrunc()
781 if ((error = ffs_indirtrunc(ip, nlbn, fsbtodb(fs, nb), in ffs_indirtrunc()
786 ffs_blkfree(ump, fs, ITODEVVP(ip), nb, fs->fs_bsize, in ffs_indirtrunc()
787 ip->i_number, vp->v_type, NULL, key); in ffs_indirtrunc()
797 nb = BAP(ip, i); in ffs_indirtrunc()
799 error = ffs_indirtrunc(ip, nlbn, fsbtodb(fs, nb), in ffs_indirtrunc()
818 ffs_rdonly(struct inode *ip) in ffs_rdonly() argument
821 return (ITOFS(ip)->fs_ronly != 0); in ffs_rdonly()