Lines Matching refs:ip
158 softdep_setup_inomapdep(bp, ip, newinum, mode)
160 struct inode *ip;
181 softdep_setup_allocdirect(ip, lbn, newblkno, oldblkno, newsize, oldsize, bp)
182 struct inode *ip;
195 softdep_setup_allocext(ip, lbn, newblkno, oldblkno, newsize, oldsize, bp)
196 struct inode *ip;
209 softdep_setup_allocindir_page(ip, lbn, bp, ptrno, newblkno, oldblkno, nbp)
210 struct inode *ip;
223 softdep_setup_allocindir_meta(nbp, ip, bp, ptrno, newblkno)
225 struct inode *ip;
235 softdep_journal_freeblocks(ip, cred, length, flags)
236 struct inode *ip;
246 softdep_journal_fsync(ip)
247 struct inode *ip;
254 softdep_setup_freeblocks(ip, length, flags)
255 struct inode *ip;
300 softdep_setup_remove(bp, dp, ip, isrmdir)
303 struct inode *ip;
311 softdep_setup_directory_change(bp, dp, ip, newinum, isrmdir)
314 struct inode *ip;
346 softdep_setup_unlink(dp, ip)
348 struct inode *ip;
355 softdep_setup_link(dp, ip)
357 struct inode *ip;
364 softdep_revert_link(dp, ip)
366 struct inode *ip;
373 softdep_setup_rmdir(dp, ip)
375 struct inode *ip;
382 softdep_revert_rmdir(dp, ip)
384 struct inode *ip;
391 softdep_setup_create(dp, ip)
393 struct inode *ip;
400 softdep_revert_create(dp, ip)
402 struct inode *ip;
409 softdep_setup_mkdir(dp, ip)
411 struct inode *ip;
418 softdep_revert_mkdir(dp, ip)
420 struct inode *ip;
427 softdep_setup_dotdot_link(dp, ip)
429 struct inode *ip;
454 softdep_change_linkcnt(ip)
455 struct inode *ip;
462 softdep_load_inodeblock(ip)
463 struct inode *ip;
470 softdep_update_inodeblock(ip, bp, waitfor)
471 struct inode *ip;
601 softdep_inode_append(ip, cred, wkhd)
602 struct inode *ip;
936 struct inode *ip, off_t, nlink_t);
2769 struct inode *ip;
2786 ip = VTOI(vp);
2787 if (ip->i_size < SUJ_MIN) {
2791 bcount = lblkno(fs, ip->i_size); /* Only use whole blocks. */
2821 DIP_SET(ip, i_modrev, fs->fs_mtime);
2822 ip->i_flags |= IN_MODIFIED;
4010 * Allocate a new jremref that tracks the removal of ip from dp with the
4020 newjremref(struct dirrem *dirrem, struct inode *dp, struct inode *ip,
4028 newinoref(&jremref->jr_ref, ip->i_number, dp->i_number, diroff,
4029 nlink, ip->i_mode);
4643 inodedep_lookup_ip(ip)
4644 struct inode *ip;
4648 KASSERT(ip->i_nlink >= ip->i_effnlink,
4650 (void) inodedep_lookup(ITOVFS(ip), ip->i_number, DEPALLOC,
4652 inodedep->id_nlinkdelta = ip->i_nlink - ip->i_effnlink;
4665 softdep_setup_create(dp, ip)
4667 struct inode *ip;
4675 KASSERT(ip->i_nlink == 1,
4679 inodedep = inodedep_lookup_ip(ip);
4697 softdep_setup_dotdot_link(dp, ip)
4699 struct inode *ip;
4714 jaddref = newjaddref(ip, dp->i_number, DOTDOT_OFFSET,
4721 softdep_prelink(dvp, ITOV(ip));
4732 softdep_setup_link(dp, ip)
4734 struct inode *ip;
4745 jaddref = newjaddref(dp, ip->i_number, 0, ip->i_effnlink - 1,
4746 ip->i_mode);
4748 inodedep = inodedep_lookup_ip(ip);
4752 softdep_prelink(dvp, ITOV(ip));
4763 softdep_setup_mkdir(dp, ip)
4765 struct inode *ip;
4778 dotaddref = newjaddref(ip, ip->i_number, DOT_OFFSET, 1,
4779 ip->i_mode);
4781 dotdotaddref = newjaddref(ip, dp->i_number, DOTDOT_OFFSET,
4786 inodedep = inodedep_lookup_ip(ip);
4811 softdep_setup_rmdir(dp, ip)
4813 struct inode *ip;
4821 (void) inodedep_lookup_ip(ip);
4823 softdep_prelink(dvp, ITOV(ip));
4832 softdep_setup_unlink(dp, ip)
4834 struct inode *ip;
4842 (void) inodedep_lookup_ip(ip);
4844 softdep_prelink(dvp, ITOV(ip));
4853 softdep_revert_create(dp, ip)
4855 struct inode *ip;
4865 inodedep = inodedep_lookup_ip(ip);
4881 softdep_revert_link(dp, ip)
4883 struct inode *ip;
4893 inodedep = inodedep_lookup_ip(ip);
4909 softdep_revert_mkdir(dp, ip)
4911 struct inode *ip;
4927 KASSERT(jaddref->ja_parent == ip->i_number,
4931 inodedep = inodedep_lookup_ip(ip);
4940 KASSERT(dotaddref->ja_parent == ip->i_number,
4951 softdep_revert_rmdir(dp, ip)
4953 struct inode *ip;
4959 (void) inodedep_lookup_ip(ip);
5000 softdep_setup_inomapdep(bp, ip, newinum, mode)
5002 struct inode *ip; /* inode related to allocation */
5012 mp = ITOVFS(ip);
5023 jaddref = newjaddref(ip, newinum, 0, 0, mode);
5047 ACQUIRE_LOCK(ITOUMP(ip));
5062 FREE_LOCK(ITOUMP(ip));
5264 softdep_setup_allocdirect(ip, off, newblkno, oldblkno, newsize, oldsize, bp)
5265 struct inode *ip; /* inode to which block is being added */
5284 mp = ITOVFS(ip);
5302 freefrag = newfreefrag(ip, oldblkno, oldsize, lbn,
5310 ip->i_number, newblkno, oldblkno, off, newsize, oldsize);
5311 ACQUIRE_LOCK(ITOUMP(ip));
5330 if ((ip->i_mode & IFMT) == IFDIR)
5331 pagedep_lookup(mp, bp, ip->i_number, off, DEPALLOC,
5353 jnewblk->jn_ino = ip->i_number;
5360 inodedep_lookup(mp, ip->i_number, DEPALLOC, &inodedep);
5383 FREE_LOCK(ITOUMP(ip));
5397 FREE_LOCK(ITOUMP(ip));
5550 newjfreefrag(freefrag, ip, blkno, size, lbn)
5552 struct inode *ip;
5560 fs = ITOFS(ip);
5563 workitem_alloc(&jfreefrag->fr_list, D_JFREEFRAG, ITOVFS(ip));
5566 jfreefrag->fr_ino = ip->i_number;
5579 newfreefrag(ip, blkno, size, lbn, key)
5580 struct inode *ip;
5591 ip->i_number, blkno, size, lbn);
5592 ump = ITOUMP(ip);
5601 freefrag->ff_inum = ip->i_number;
5602 freefrag->ff_vtype = ITOV(ip)->v_type;
5609 newjfreefrag(freefrag, ip, blkno, size, lbn);
5664 softdep_setup_allocext(ip, off, newblkno, oldblkno, newsize, oldsize, bp)
5665 struct inode *ip;
5683 mp = ITOVFS(ip);
5706 freefrag = newfreefrag(ip, oldblkno, oldsize, lbn,
5732 jnewblk->jn_ino = ip->i_number;
5739 inodedep_lookup(mp, ip->i_number, DEPALLOC, &inodedep);
5807 newallocindir(ip, ptrno, newblkno, oldblkno, lbn)
5808 struct inode *ip; /* inode for file being extended */
5820 freefrag = newfreefrag(ip, oldblkno, ITOFS(ip)->fs_bsize, lbn,
5824 ACQUIRE_LOCK(ITOUMP(ip));
5825 if (newblk_lookup(ITOVFS(ip), newblkno, 0, &newblk) == 0)
5836 jnewblk->jn_ino = ip->i_number;
5851 softdep_setup_allocindir_page(ip, lbn, bp, ptrno, newblkno, oldblkno, nbp)
5852 struct inode *ip; /* inode for file being extended */
5867 mp = ITOVFS(ip);
5876 "lbn %jd", ip->i_number, newblkno, oldblkno, lbn);
5877 ASSERT_VOP_LOCKED(ITOV(ip), "softdep_setup_allocindir_page");
5878 aip = newallocindir(ip, ptrno, newblkno, oldblkno, lbn);
5879 (void) inodedep_lookup(mp, ip->i_number, DEPALLOC, &inodedep);
5885 if ((ip->i_mode & IFMT) == IFDIR)
5886 pagedep_lookup(mp, nbp, ip->i_number, lbn, DEPALLOC, &pagedep);
5888 freefrag = setup_allocindir_phase2(bp, ip, inodedep, aip, lbn);
5899 softdep_setup_allocindir_meta(nbp, ip, bp, ptrno, newblkno)
5901 struct inode *ip; /* inode for file being extended */
5911 ump = ITOUMP(ip);
5916 ip->i_number, newblkno, ptrno);
5918 ASSERT_VOP_LOCKED(ITOV(ip), "softdep_setup_allocindir_meta");
5919 aip = newallocindir(ip, ptrno, newblkno, 0, lbn);
5920 inodedep_lookup(UFSTOVFS(ump), ip->i_number, DEPALLOC, &inodedep);
5922 if (setup_allocindir_phase2(bp, ip, inodedep, aip, lbn))
5950 indirdep_lookup(mp, ip, bp)
5952 struct inode *ip;
5988 if (I_IS_UFS1(ip))
6029 setup_allocindir_phase2(bp, ip, inodedep, aip, lbn)
6031 struct inode *ip; /* inode for file being extended */
6032 struct inodedep *inodedep; /* Inodedep for ip */
6043 mp = ITOVFS(ip);
6051 indirdep = indirdep_lookup(mp, ip, bp);
6125 setup_freedirect(freeblks, ip, i, needj)
6127 struct inode *ip;
6135 blkno = DIP(ip, i_db[i]);
6138 DIP_SET(ip, i_db[i], 0);
6139 ump = ITOUMP(ip);
6140 frags = sblksize(ump->um_fs, ip->i_size, i);
6146 setup_freeext(freeblks, ip, i, needj)
6148 struct inode *ip;
6156 blkno = ip->i_din2->di_extb[i];
6159 ip->i_din2->di_extb[i] = 0;
6160 ump = ITOUMP(ip);
6161 frags = sblksize(ump->um_fs, ip->i_din2->di_extsize, i);
6167 setup_freeindir(freeblks, ip, i, lbn, needj)
6169 struct inode *ip;
6177 blkno = DIP(ip, i_ib[i]);
6180 DIP_SET(ip, i_ib[i], 0);
6181 ump = ITOUMP(ip);
6187 newfreeblks(mp, ip)
6189 struct inode *ip;
6201 freeblks->fb_uid = ip->i_uid;
6202 freeblks->fb_inum = ip->i_number;
6203 freeblks->fb_vtype = ITOV(ip)->v_type;
6204 freeblks->fb_modrev = DIP(ip, i_modrev);
6205 freeblks->fb_devvp = ITODEVVP(ip);
6248 setup_trunc_indir(freeblks, ip, lbn, lastlbn, blkno)
6250 struct inode *ip;
6275 bp = getblk(ITOV(ip), lbn, mp->mnt_stat.f_iosize, 0, 0, 0);
6314 indirdep = indirdep_lookup(mp, ip, bp);
6343 if (I_IS_UFS1(ip)) {
6361 return setup_trunc_indir(freeblks, ip, lbn, lastlbn, blkno);
6533 softdep_journal_freeblocks(ip, cred, length, flags)
6534 struct inode *ip; /* The inode whose length is to be reduced */
6553 ump = ITOUMP(ip);
6558 vp = ITOV(ip);
6565 freeblks = newfreeblks(mp, ip);
6572 inodedep_lookup(mp, ip->i_number, DEPALLOC, &inodedep);
6576 CTR3(KTR_SUJ, "softdep_journal_freeblks: ip %d length %ld needj %d",
6577 ip->i_number, length, needj);
6596 extblocks = btodb(fragroundup(fs, ip->i_din2->di_extsize));
6607 setup_freedirect(freeblks, ip, i, needj);
6613 setup_freeindir(freeblks, ip, i, -lbn -i,
6622 setup_trunc_indir(freeblks, ip, -lbn - i,
6623 lastlbn, DIP(ip, i_ib[i]));
6632 oldfrags = blksize(fs, ip, lastlbn);
6633 blkno = DIP(ip, i_db[lastlbn]);
6652 ip->i_flag |= IN_TRUNCATED;
6655 ip->i_size = length;
6656 DIP_SET(ip, i_size, ip->i_size);
6657 ip->i_flag |= IN_SIZEMOD | IN_CHANGE;
6658 datablocks = DIP(ip, i_blocks) - extblocks;
6665 setup_freeext(freeblks, ip, i, needj);
6666 ip->i_din2->di_extsize = 0;
6668 ip->i_flag |= IN_SIZEMOD | IN_CHANGE;
6673 (void) chkdq(ip, -datablocks, NOCRED, FORCE);
6679 DIP_SET(ip, i_blocks, DIP(ip, i_blocks) - datablocks);
6687 ip->i_flag &= ~(IN_LAZYACCESS | IN_LAZYMOD | IN_MODIFIED);
6688 error = bread(ump->um_devvp, fsbtodb(fs, ino_to_fsba(fs, ip->i_number)),
6697 softdep_update_inodeblock(ip, bp, 0);
6700 ino_to_fsbo(fs, ip->i_number)) = *ip->i_din1;
6703 ino_to_fsbo(fs, ip->i_number)) = *ip->i_din2;
6705 (void) inodedep_lookup(mp, ip->i_number, DEPALLOC, &inodedep);
6761 trunc_dependencies(ip, freeblks, lastlbn, frags, flags);
6768 ip->i_size = length - lastoff;
6769 DIP_SET(ip, i_size, ip->i_size);
6775 ip->i_size = length;
6776 DIP_SET(ip, i_size, length);
6777 ip->i_flag |= IN_SIZEMOD | IN_CHANGE | IN_UPDATE;
6798 inodedep_lookup(mp, ip->i_number, DEPALLOC, &inodedep);
6816 trunc_pages(ip, length, extblocks, flags);
6824 softdep_journal_fsync(ip)
6825 struct inode *ip;
6830 ump = ITOUMP(ip);
6833 if ((ip->i_flag & IN_TRUNCATED) == 0)
6835 ip->i_flag &= ~IN_TRUNCATED;
6838 jfsync->jfs_size = ip->i_size;
6839 jfsync->jfs_ino = ip->i_number;
6876 softdep_setup_freeblocks(ip, length, flags)
6877 struct inode *ip; /* The inode whose length is to be reduced */
6895 ump = ITOUMP(ip);
6899 CTR2(KTR_SUJ, "softdep_setup_freeblks: ip %d length %ld",
6900 ip->i_number, length);
6904 fsbtodb(fs, ino_to_fsba(fs, ip->i_number)),
6910 freeblks = newfreeblks(mp, ip);
6914 extblocks = btodb(fragroundup(fs, ip->i_din2->di_extsize));
6917 setup_freedirect(freeblks, ip, i, 0);
6921 setup_freeindir(freeblks, ip, i, -lbn -i, 0);
6922 ip->i_size = 0;
6923 DIP_SET(ip, i_size, 0);
6924 ip->i_flag |= IN_SIZEMOD | IN_CHANGE;
6925 datablocks = DIP(ip, i_blocks) - extblocks;
6929 setup_freeext(freeblks, ip, i, 0);
6930 ip->i_din2->di_extsize = 0;
6932 ip->i_flag |= IN_SIZEMOD | IN_CHANGE;
6936 quotaref(ITOV(ip), freeblks->fb_quota);
6937 (void) chkdq(ip, -datablocks, NOCRED, FORCE);
6943 DIP_SET(ip, i_blocks, DIP(ip, i_blocks) - datablocks);
6951 ino_to_fsbo(fs, ip->i_number));
6952 ip->i_din1->di_freelink = dp1->di_freelink;
6953 *dp1 = *ip->i_din1;
6956 ino_to_fsbo(fs, ip->i_number));
6957 ip->i_din2->di_freelink = dp2->di_freelink;
6958 *dp2 = *ip->i_din2;
6964 (void) inodedep_lookup(mp, ip->i_number, DEPALLOC, &inodedep);
7004 trunc_dependencies(ip, freeblks, -1, 0, flags);
7006 if (inodedep_lookup(mp, ip->i_number, 0, &inodedep) != 0)
7020 trunc_pages(ip, length, extblocks, flags);
7029 trunc_pages(ip, length, extblocks, flags)
7030 struct inode *ip;
7040 vp = ITOV(ip);
7041 fs = ITOFS(ip);
7120 trunc_dependencies(ip, freeblks, lastlbn, lastoff, flags)
7121 struct inode *ip;
7138 vp = ITOV(ip);
7572 struct inode *ip = VTOI(pvp);
7578 ump = ITOUMP(ip);
7646 if (ip->i_number == ino)
7647 ip->i_flag |= IN_MODIFIED;
8031 struct inode *ip;
8051 ip = VTOI(vp);
8052 if (ip->i_mode == 0) {
8054 } else if (DIP(ip, i_modrev) == freeblks->fb_modrev) {
8055 DIP_SET(ip, i_blocks, DIP(ip, i_blocks) - spare);
8056 ip->i_flag |= IN_CHANGE;
8970 softdep_setup_remove(bp, dp, ip, isrmdir)
8973 struct inode *ip; /* inode for directory entry being removed */
8981 ump = ITOUMP(ip);
8989 dirrem = newdirrem(bp, dp, ip, isrmdir, &prevdirrem);
8994 if (inodedep_lookup(UFSTOVFS(ump), ip->i_number, 0, &inodedep) == 0)
9054 cancel_diradd_dotdot(ip, dirrem, jremref)
9055 struct inode *ip;
9063 if (pagedep_lookup(ITOVFS(ip), NULL, ip->i_number, 0, 0, &pagedep) == 0)
9085 cancel_mkdir_dotdot(ip, dirrem, jremref)
9086 struct inode *ip;
9097 mp = ITOVFS(ip);
9098 if (inodedep_lookup(mp, ip->i_number, 0, &inodedep) == 0)
9168 newdirrem(bp, dp, ip, isrmdir, prevdirremp)
9171 struct inode *ip; /* inode for directory entry being removed */
9189 if (ip == NULL)
9202 if (!IS_SNAPSHOT(ip) && softdep_excess_items(ump, D_DIRREM))
9212 dirrem->dm_oldinum = ip->i_number;
9224 jremref = newjremref(dirrem, dp, ip, dp->i_offset,
9225 ip->i_effnlink + 2);
9226 dotremref = newjremref(dirrem, ip, ip, DOT_OFFSET,
9227 ip->i_effnlink + 1);
9228 dotdotremref = newjremref(dirrem, ip, dp, DOTDOT_OFFSET,
9232 jremref = newjremref(dirrem, dp, ip, dp->i_offset,
9233 ip->i_effnlink + 1);
9259 dotdotremref = cancel_diradd_dotdot(ip, dirrem, dotdotremref);
9281 if (dap->da_newinum != ip->i_number)
9283 (uintmax_t)ip->i_number, (uintmax_t)dap->da_newinum);
9331 softdep_setup_directory_change(bp, dp, ip, newinum, isrmdir)
9334 struct inode *ip; /* inode for directory entry being removed */
9369 dirrem = newdirrem(bp, dp, ip, isrmdir, &prevdirrem);
9407 if (inodedep_lookup(mp, ip->i_number, 0, &inodedep) == 0)
9483 softdep_change_linkcnt(ip)
9484 struct inode *ip; /* the inode with the increased link count */
9489 ump = ITOUMP(ip);
9493 inodedep_lookup(UFSTOVFS(ump), ip->i_number, DEPALLOC, &inodedep);
9494 if (ip->i_nlink < ip->i_effnlink)
9496 inodedep->id_nlinkdelta = ip->i_nlink - ip->i_effnlink;
9805 struct inode *ip;
9817 ip = VTOI(vp);
9818 MPASS(ip->i_mode != 0);
9855 ip->i_nlink--;
9856 DIP_SET(ip, i_nlink, ip->i_nlink);
9857 ip->i_flag |= IN_CHANGE;
9858 if (ip->i_nlink < ip->i_effnlink)
9860 if (ip->i_nlink == 0)
9862 inodedep->id_nlinkdelta = ip->i_nlink - ip->i_effnlink;
9876 ip->i_nlink -= 2;
9877 DIP_SET(ip, i_nlink, ip->i_nlink);
9878 ip->i_flag |= IN_CHANGE;
9879 if (ip->i_nlink < ip->i_effnlink)
9881 if (ip->i_nlink == 0)
9883 inodedep->id_nlinkdelta = ip->i_nlink - ip->i_effnlink;
9920 ip->i_flag |= IN_CHANGE;
12210 softdep_load_inodeblock(ip)
12211 struct inode *ip; /* the "in_core" copy of the inode */
12216 ump = ITOUMP(ip);
12222 ip->i_effnlink = ip->i_nlink;
12224 if (inodedep_lookup(UFSTOVFS(ump), ip->i_number, 0, &inodedep) == 0) {
12228 ip->i_effnlink -= inodedep->id_nlinkdelta;
12243 softdep_update_inodeblock(ip, bp, waitfor)
12244 struct inode *ip; /* the "in_core" copy of the inode */
12257 ump = ITOUMP(ip);
12264 * does not have access to the in-core ip so must write directly into
12268 DIP_SET(ip, i_freelink, ((struct ufs1_dinode *)bp->b_data +
12269 ino_to_fsbo(fs, ip->i_number))->di_freelink);
12271 DIP_SET(ip, i_freelink, ((struct ufs2_dinode *)bp->b_data +
12272 ino_to_fsbo(fs, ip->i_number))->di_freelink);
12282 if (inodedep_lookup(mp, ip->i_number, 0, &inodedep) == 0) {
12284 if (ip->i_effnlink != ip->i_nlink)
12288 if (inodedep->id_nlinkdelta != ip->i_nlink - ip->i_effnlink)
12358 if (inodedep_lookup(mp, ip->i_number, 0, &inodedep) != 0)
12418 struct inode *ip;
12426 ip = VTOI(vp);
12434 if (inodedep_lookup(mp, ip->i_number, 0, &inodedep) == 0) {
12530 if (inodedep_lookup(mp, ip->i_number, 0, &inodedep) != 0) {
12566 if (inodedep_lookup(mp, ip->i_number, 0, &inodedep) == 0)
12688 struct inode *ip;
12691 ip = VTOI(vp);
12704 error = flush_inodedep_deps(vp, vp->v_mount, ip->i_number);
12984 struct inode *ip;
12991 ip = VTOI(vp);
12992 blkno = DIP(ip, i_db[lbn]);
13909 softdep_inode_append(ip, cred, wkhd)
13910 struct inode *ip;
13919 ump = ITOUMP(ip);
13923 error = bread(ump->um_devvp, fsbtodb(fs, ino_to_fsba(fs, ip->i_number)),