From 7b840cb1779089c3fa3d2296f5e20917dbff2988 Mon Sep 17 00:00:00 2001 From: kib Date: Wed, 10 Jun 2015 02:12:01 +0000 Subject: MFC r283604: Remove NODELAY flag. --- sys/ufs/ffs/ffs_softdep.c | 55 +++++++++++++++-------------------------------- 1 file changed, 17 insertions(+), 38 deletions(-) (limited to 'sys/ufs/ffs') diff --git a/sys/ufs/ffs/ffs_softdep.c b/sys/ufs/ffs/ffs_softdep.c index 8c6b89a..ec2c81d 100644 --- a/sys/ufs/ffs/ffs_softdep.c +++ b/sys/ufs/ffs/ffs_softdep.c @@ -2063,7 +2063,6 @@ retry_flush: * allocates a new structure if an existing one is not found. */ #define DEPALLOC 0x0001 /* allocate structure if lookup fails */ -#define NODELAY 0x0002 /* cannot do background work */ /* * Structures and routines associated with pagedep caching. @@ -4635,14 +4634,10 @@ inodedep_lookup_ip(ip) struct inode *ip; { struct inodedep *inodedep; - int dflags; KASSERT(ip->i_nlink >= ip->i_effnlink, ("inodedep_lookup_ip: bad delta")); - dflags = DEPALLOC; - if (IS_SNAPSHOT(ip)) - dflags |= NODELAY; - (void) inodedep_lookup(UFSTOVFS(ip->i_ump), ip->i_number, dflags, + (void) inodedep_lookup(UFSTOVFS(ip->i_ump), ip->i_number, DEPALLOC, &inodedep); inodedep->id_nlinkdelta = ip->i_nlink - ip->i_effnlink; KASSERT((inodedep->id_state & UNLINKED) == 0, ("inode unlinked")); @@ -5040,7 +5035,7 @@ softdep_setup_inomapdep(bp, ip, newinum, mode) M_BMSAFEMAP, M_SOFTDEP_FLAGS); workitem_alloc(&bmsafemap->sm_list, D_BMSAFEMAP, mp); ACQUIRE_LOCK(ip->i_ump); - if ((inodedep_lookup(mp, newinum, DEPALLOC | NODELAY, &inodedep))) + if ((inodedep_lookup(mp, newinum, DEPALLOC, &inodedep))) panic("softdep_setup_inomapdep: dependency %p for new" "inode already exists", inodedep); bmsafemap = bmsafemap_lookup(mp, bp, ino_to_cg(fs, newinum), bmsafemap); @@ -5337,7 +5332,7 @@ softdep_setup_allocdirect(ip, off, newblkno, oldblkno, newsize, oldsize, bp) if (freefrag && freefrag->ff_jdep != NULL && freefrag->ff_jdep->wk_type == D_JFREEFRAG) add_to_journal(freefrag->ff_jdep); - inodedep_lookup(mp, ip->i_number, DEPALLOC | NODELAY, &inodedep); + inodedep_lookup(mp, ip->i_number, DEPALLOC, &inodedep); adp->ad_inodedep = inodedep; WORKLIST_INSERT(&bp->b_dep, &newblk->nb_list); @@ -5695,7 +5690,7 @@ softdep_setup_allocext(ip, off, newblkno, oldblkno, newsize, oldsize, bp) if (freefrag && freefrag->ff_jdep != NULL && freefrag->ff_jdep->wk_type == D_JFREEFRAG) add_to_journal(freefrag->ff_jdep); - inodedep_lookup(mp, ip->i_number, DEPALLOC | NODELAY, &inodedep); + inodedep_lookup(mp, ip->i_number, DEPALLOC, &inodedep); adp->ad_inodedep = inodedep; WORKLIST_INSERT(&bp->b_dep, &newblk->nb_list); @@ -5820,7 +5815,6 @@ softdep_setup_allocindir_page(ip, lbn, bp, ptrno, newblkno, oldblkno, nbp) struct allocindir *aip; struct pagedep *pagedep; struct mount *mp; - int dflags; mp = UFSTOVFS(ip->i_ump); KASSERT(MOUNTEDSOFTDEP(mp) != 0, @@ -5833,10 +5827,7 @@ softdep_setup_allocindir_page(ip, lbn, bp, ptrno, newblkno, oldblkno, nbp) "lbn %jd", ip->i_number, newblkno, oldblkno, lbn); ASSERT_VOP_LOCKED(ITOV(ip), "softdep_setup_allocindir_page"); aip = newallocindir(ip, ptrno, newblkno, oldblkno, lbn); - dflags = DEPALLOC; - if (IS_SNAPSHOT(ip)) - dflags |= NODELAY; - (void) inodedep_lookup(mp, ip->i_number, dflags, &inodedep); + (void) inodedep_lookup(mp, ip->i_number, DEPALLOC, &inodedep); /* * If we are allocating a directory page, then we must * allocate an associated pagedep to track additions and @@ -5866,7 +5857,6 @@ softdep_setup_allocindir_meta(nbp, ip, bp, ptrno, newblkno) struct inodedep *inodedep; struct allocindir *aip; ufs_lbn_t lbn; - int dflags; KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(ip->i_ump)) != 0, ("softdep_setup_allocindir_meta called on non-softdep filesystem")); @@ -5876,10 +5866,8 @@ softdep_setup_allocindir_meta(nbp, ip, bp, ptrno, newblkno) lbn = nbp->b_lblkno; ASSERT_VOP_LOCKED(ITOV(ip), "softdep_setup_allocindir_meta"); aip = newallocindir(ip, ptrno, newblkno, 0, lbn); - dflags = DEPALLOC; - if (IS_SNAPSHOT(ip)) - dflags |= NODELAY; - inodedep_lookup(UFSTOVFS(ip->i_ump), ip->i_number, dflags, &inodedep); + inodedep_lookup(UFSTOVFS(ip->i_ump), ip->i_number, DEPALLOC, + &inodedep); WORKLIST_INSERT(&nbp->b_dep, &aip->ai_block.nb_list); if (setup_allocindir_phase2(bp, ip, inodedep, aip, lbn)) panic("softdep_setup_allocindir_meta: Block already existed"); @@ -6492,7 +6480,7 @@ softdep_journal_freeblocks(ip, cred, length, flags) struct mount *mp; ufs2_daddr_t extblocks, datablocks; ufs_lbn_t tmpval, lbn, lastlbn; - int frags, lastoff, iboff, allocblock, needj, dflags, error, i; + int frags, lastoff, iboff, allocblock, needj, error, i; fs = ip->i_fs; ump = ip->i_ump; @@ -6513,10 +6501,7 @@ softdep_journal_freeblocks(ip, cred, length, flags) * we don't need to journal the block frees. The canceled journals * for the allocations will suffice. */ - dflags = DEPALLOC; - if (IS_SNAPSHOT(ip)) - dflags |= NODELAY; - inodedep_lookup(mp, ip->i_number, dflags, &inodedep); + inodedep_lookup(mp, ip->i_number, DEPALLOC, &inodedep); if ((inodedep->id_state & (UNLINKED | DEPCOMPLETE)) == UNLINKED && length == 0) needj = 0; @@ -6646,7 +6631,7 @@ softdep_journal_freeblocks(ip, cred, length, flags) *((struct ufs2_dinode *)bp->b_data + ino_to_fsbo(fs, ip->i_number)) = *ip->i_din2; ACQUIRE_LOCK(ump); - (void) inodedep_lookup(mp, ip->i_number, dflags, &inodedep); + (void) inodedep_lookup(mp, ip->i_number, DEPALLOC, &inodedep); if ((inodedep->id_state & IOSTARTED) != 0) panic("softdep_setup_freeblocks: inode busy"); /* @@ -6739,7 +6724,7 @@ softdep_journal_freeblocks(ip, cred, length, flags) } ACQUIRE_LOCK(ump); - inodedep_lookup(mp, ip->i_number, dflags, &inodedep); + inodedep_lookup(mp, ip->i_number, DEPALLOC, &inodedep); TAILQ_INSERT_TAIL(&inodedep->id_freeblklst, freeblks, fb_next); freeblks->fb_state |= DEPCOMPLETE | ONDEPLIST; /* @@ -6830,7 +6815,7 @@ softdep_setup_freeblocks(ip, length, flags) struct fs *fs; ufs2_daddr_t extblocks, datablocks; struct mount *mp; - int i, delay, error, dflags; + int i, delay, error; ufs_lbn_t tmpval; ufs_lbn_t lbn; @@ -6899,10 +6884,7 @@ softdep_setup_freeblocks(ip, length, flags) * Find and eliminate any inode dependencies. */ ACQUIRE_LOCK(ump); - dflags = DEPALLOC; - if (IS_SNAPSHOT(ip)) - dflags |= NODELAY; - (void) inodedep_lookup(mp, ip->i_number, dflags, &inodedep); + (void) inodedep_lookup(mp, ip->i_number, DEPALLOC, &inodedep); if ((inodedep->id_state & IOSTARTED) != 0) panic("softdep_setup_freeblocks: inode busy"); /* @@ -8506,7 +8488,7 @@ softdep_setup_directory_add(bp, dp, diroffset, newinum, newdirbp, isnewblk) dap->da_pagedep = pagedep; LIST_INSERT_HEAD(&pagedep->pd_diraddhd[DIRADDHASH(offset)], dap, da_pdlist); - inodedep_lookup(mp, newinum, DEPALLOC | NODELAY, &inodedep); + inodedep_lookup(mp, newinum, DEPALLOC, &inodedep); /* * If we're journaling, link the diradd into the jaddref so it * may be completed after the journal entry is written. Otherwise, @@ -9367,7 +9349,7 @@ softdep_setup_directory_change(bp, dp, ip, newinum, isrmdir) * inode is not yet written. If it is written, do the post-inode * write processing to put it on the id_pendinghd list. */ - inodedep_lookup(mp, newinum, DEPALLOC | NODELAY, &inodedep); + inodedep_lookup(mp, newinum, DEPALLOC, &inodedep); if (MOUNTEDSUJ(mp)) { jaddref = (struct jaddref *)TAILQ_LAST(&inodedep->id_inoreflst, inoreflst); @@ -9409,15 +9391,12 @@ softdep_change_linkcnt(ip) struct inode *ip; /* the inode with the increased link count */ { struct inodedep *inodedep; - int dflags; KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(ip->i_ump)) != 0, ("softdep_change_linkcnt called on non-softdep filesystem")); ACQUIRE_LOCK(ip->i_ump); - dflags = DEPALLOC; - if (IS_SNAPSHOT(ip)) - dflags |= NODELAY; - inodedep_lookup(UFSTOVFS(ip->i_ump), ip->i_number, dflags, &inodedep); + inodedep_lookup(UFSTOVFS(ip->i_ump), ip->i_number, DEPALLOC, + &inodedep); if (ip->i_nlink < ip->i_effnlink) panic("softdep_change_linkcnt: bad delta"); inodedep->id_nlinkdelta = ip->i_nlink - ip->i_effnlink; -- cgit v1.1