ffs_softdep.c (283604) | ffs_softdep.c (283735) |
---|---|
1/*- 2 * Copyright 1998, 2000 Marshall Kirk McKusick. 3 * Copyright 2009, 2010 Jeffrey W. Roberson <jeff@FreeBSD.org> 4 * All rights reserved. 5 * 6 * The soft updates code is derived from the appendix of a University 7 * of Michigan technical report (Gregory R. Ganger and Yale N. Patt, 8 * "Soft Updates: A Solution to the Metadata Update Problem in File --- 26 unchanged lines hidden (view full) --- 35 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR 36 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE 37 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 38 * 39 * from: @(#)ffs_softdep.c 9.59 (McKusick) 6/21/00 40 */ 41 42#include <sys/cdefs.h> | 1/*- 2 * Copyright 1998, 2000 Marshall Kirk McKusick. 3 * Copyright 2009, 2010 Jeffrey W. Roberson <jeff@FreeBSD.org> 4 * All rights reserved. 5 * 6 * The soft updates code is derived from the appendix of a University 7 * of Michigan technical report (Gregory R. Ganger and Yale N. Patt, 8 * "Soft Updates: A Solution to the Metadata Update Problem in File --- 26 unchanged lines hidden (view full) --- 35 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR 36 * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE 37 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 38 * 39 * from: @(#)ffs_softdep.c 9.59 (McKusick) 6/21/00 40 */ 41 42#include <sys/cdefs.h> |
43__FBSDID("$FreeBSD: head/sys/ufs/ffs/ffs_softdep.c 283604 2015-05-27 09:49:04Z kib $"); | 43__FBSDID("$FreeBSD: head/sys/ufs/ffs/ffs_softdep.c 283735 2015-05-29 13:24:17Z kib $"); |
44 45#include "opt_ffs.h" 46#include "opt_quota.h" 47#include "opt_ddb.h" 48 49/* 50 * For now we want the safety net that the DEBUG flag provides. 51 */ --- 4634 unchanged lines hidden (view full) --- 4686void 4687softdep_setup_dotdot_link(dp, ip) 4688 struct inode *dp; 4689 struct inode *ip; 4690{ 4691 struct inodedep *inodedep; 4692 struct jaddref *jaddref; 4693 struct vnode *dvp; | 44 45#include "opt_ffs.h" 46#include "opt_quota.h" 47#include "opt_ddb.h" 48 49/* 50 * For now we want the safety net that the DEBUG flag provides. 51 */ --- 4634 unchanged lines hidden (view full) --- 4686void 4687softdep_setup_dotdot_link(dp, ip) 4688 struct inode *dp; 4689 struct inode *ip; 4690{ 4691 struct inodedep *inodedep; 4692 struct jaddref *jaddref; 4693 struct vnode *dvp; |
4694 struct vnode *vp; | |
4695 4696 KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(dp->i_ump)) != 0, 4697 ("softdep_setup_dotdot_link called on non-softdep filesystem")); 4698 dvp = ITOV(dp); | 4694 4695 KASSERT(MOUNTEDSOFTDEP(UFSTOVFS(dp->i_ump)) != 0, 4696 ("softdep_setup_dotdot_link called on non-softdep filesystem")); 4697 dvp = ITOV(dp); |
4699 vp = ITOV(ip); | |
4700 jaddref = NULL; 4701 /* 4702 * We don't set MKDIR_PARENT as this is not tied to a mkdir and 4703 * is used as a normal link would be. 4704 */ 4705 if (DOINGSUJ(dvp)) 4706 jaddref = newjaddref(ip, dp->i_number, DOTDOT_OFFSET, 4707 dp->i_effnlink - 1, dp->i_mode); --- 2339 unchanged lines hidden (view full) --- 7047 struct freeblks *freeblks; 7048 ufs_lbn_t lastlbn; 7049 int lastoff; 7050 int flags; 7051{ 7052 struct bufobj *bo; 7053 struct vnode *vp; 7054 struct buf *bp; | 4698 jaddref = NULL; 4699 /* 4700 * We don't set MKDIR_PARENT as this is not tied to a mkdir and 4701 * is used as a normal link would be. 4702 */ 4703 if (DOINGSUJ(dvp)) 4704 jaddref = newjaddref(ip, dp->i_number, DOTDOT_OFFSET, 4705 dp->i_effnlink - 1, dp->i_mode); --- 2339 unchanged lines hidden (view full) --- 7045 struct freeblks *freeblks; 7046 ufs_lbn_t lastlbn; 7047 int lastoff; 7048 int flags; 7049{ 7050 struct bufobj *bo; 7051 struct vnode *vp; 7052 struct buf *bp; |
7055 struct fs *fs; | |
7056 int blkoff; 7057 7058 /* 7059 * We must wait for any I/O in progress to finish so that 7060 * all potential buffers on the dirty list will be visible. 7061 * Once they are all there, walk the list and get rid of 7062 * any dependencies. 7063 */ | 7053 int blkoff; 7054 7055 /* 7056 * We must wait for any I/O in progress to finish so that 7057 * all potential buffers on the dirty list will be visible. 7058 * Once they are all there, walk the list and get rid of 7059 * any dependencies. 7060 */ |
7064 fs = ip->i_fs; | |
7065 vp = ITOV(ip); 7066 bo = &vp->v_bufobj; 7067 BO_LOCK(bo); 7068 drain_output(vp); 7069 TAILQ_FOREACH(bp, &bo->bo_dirty.bv_hd, b_bobufs) 7070 bp->b_vflags &= ~BV_SCANNED; 7071restart: 7072 TAILQ_FOREACH(bp, &bo->bo_dirty.bv_hd, b_bobufs) { --- 2415 unchanged lines hidden (view full) --- 9488 * due to a changing unlinked list head. 9489 */ 9490static int 9491handle_written_sbdep(sbdep, bp) 9492 struct sbdep *sbdep; 9493 struct buf *bp; 9494{ 9495 struct inodedep *inodedep; | 7061 vp = ITOV(ip); 7062 bo = &vp->v_bufobj; 7063 BO_LOCK(bo); 7064 drain_output(vp); 7065 TAILQ_FOREACH(bp, &bo->bo_dirty.bv_hd, b_bobufs) 7066 bp->b_vflags &= ~BV_SCANNED; 7067restart: 7068 TAILQ_FOREACH(bp, &bo->bo_dirty.bv_hd, b_bobufs) { --- 2415 unchanged lines hidden (view full) --- 9484 * due to a changing unlinked list head. 9485 */ 9486static int 9487handle_written_sbdep(sbdep, bp) 9488 struct sbdep *sbdep; 9489 struct buf *bp; 9490{ 9491 struct inodedep *inodedep; |
9496 struct mount *mp; | |
9497 struct fs *fs; 9498 9499 LOCK_OWNED(sbdep->sb_ump); 9500 fs = sbdep->sb_fs; | 9492 struct fs *fs; 9493 9494 LOCK_OWNED(sbdep->sb_ump); 9495 fs = sbdep->sb_fs; |
9501 mp = UFSTOVFS(sbdep->sb_ump); | |
9502 /* 9503 * If the superblock doesn't match the in-memory list start over. 9504 */ 9505 inodedep = first_unlinked_inodedep(sbdep->sb_ump); 9506 if ((inodedep && fs->fs_sujfree != inodedep->id_ino) || 9507 (inodedep == NULL && fs->fs_sujfree != 0)) { 9508 bdirty(bp); 9509 return (1); --- 4742 unchanged lines hidden --- | 9496 /* 9497 * If the superblock doesn't match the in-memory list start over. 9498 */ 9499 inodedep = first_unlinked_inodedep(sbdep->sb_ump); 9500 if ((inodedep && fs->fs_sujfree != inodedep->id_ino) || 9501 (inodedep == NULL && fs->fs_sujfree != 0)) { 9502 bdirty(bp); 9503 return (1); --- 4742 unchanged lines hidden --- |