Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 20 Oct 2013 21:11:41 +0000 (UTC)
From:      Kirk McKusick <mckusick@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r256808 - head/sys/ufs/ffs
Message-ID:  <201310202111.r9KLBfq5076008@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mckusick
Date: Sun Oct 20 21:11:40 2013
New Revision: 256808
URL: http://svnweb.freebsd.org/changeset/base/256808

Log:
  Third of several cleanups to soft dependency implementation.
  Ensure that softdep_unmount() and softdep_setup_sbupdate()
  only get called for filesystems running with soft dependencies.
  
  No functional change.
  
  Tested by:    Peter Holm and Scott Long
  Sponsored by: Netflix

Modified:
  head/sys/ufs/ffs/ffs_softdep.c
  head/sys/ufs/ffs/ffs_vfsops.c

Modified: head/sys/ufs/ffs/ffs_softdep.c
==============================================================================
--- head/sys/ufs/ffs/ffs_softdep.c	Sun Oct 20 21:11:36 2013	(r256807)
+++ head/sys/ufs/ffs/ffs_softdep.c	Sun Oct 20 21:11:40 2013	(r256808)
@@ -13686,6 +13686,17 @@ DB_SHOW_COMMAND(mkdirs, db_show_mkdirs)
 	}
 }
 
+/* exported to ffs_vfsops.c */
+extern void db_print_ffs(struct ufsmount *ump);
+void
+db_print_ffs(struct ufsmount *ump)
+{
+	db_printf("mp %p %s devvp %p fs %p su_wl %d su_deps %d su_req %d\n",
+	    ump->um_mountp, ump->um_mountp->mnt_stat.f_mntonname,
+	    ump->um_devvp, ump->um_fs, ump->softdep_on_worklist,
+	    ump->softdep_deps, ump->softdep_req);
+}
+
 #endif /* DDB */
 
 #endif /* SOFTUPDATES */

Modified: head/sys/ufs/ffs/ffs_vfsops.c
==============================================================================
--- head/sys/ufs/ffs/ffs_vfsops.c	Sun Oct 20 21:11:36 2013	(r256807)
+++ head/sys/ufs/ffs/ffs_vfsops.c	Sun Oct 20 21:11:40 2013	(r256808)
@@ -1286,7 +1286,8 @@ ffs_unmount(mp, mntflags)
 		fs->fs_pendinginodes = 0;
 	}
 	UFS_UNLOCK(ump);
-	softdep_unmount(mp);
+	if (MOUNTEDSOFTDEP(mp))
+		softdep_unmount(mp);
 	if (fs->fs_ronly == 0 || ump->um_fsckpid > 0) {
 		fs->fs_clean = fs->fs_flags & (FS_UNCLEAN|FS_NEEDSFSCK) ? 0 : 1;
 		error = ffs_sbupdate(ump, MNT_WAIT, 0);
@@ -1943,7 +1944,7 @@ ffs_sbupdate(ump, waitfor, suspended)
 	}
 	fs->fs_fmod = 0;
 	fs->fs_time = time_second;
-	if (fs->fs_flags & FS_DOSOFTDEP)
+	if (MOUNTEDSOFTDEP(ump->um_mountp))
 		softdep_setup_sbupdate(ump, (struct fs *)bp->b_data, bp);
 	bcopy((caddr_t)fs, bp->b_data, (u_int)fs->fs_sbsize);
 	ffs_oldfscompat_write((struct fs *)bp->b_data, ump);
@@ -2221,14 +2222,8 @@ ffs_own_mount(const struct mount *mp)
 
 #ifdef	DDB
 
-static void
-db_print_ffs(struct ufsmount *ump)
-{
-	db_printf("mp %p %s devvp %p fs %p su_wl %d su_deps %d su_req %d\n",
-	    ump->um_mountp, ump->um_mountp->mnt_stat.f_mntonname,
-	    ump->um_devvp, ump->um_fs, ump->softdep_on_worklist,
-	    ump->softdep_deps, ump->softdep_req);
-}
+/* defined in ffs_softdep.c */
+extern void db_print_ffs(struct ufsmount *ump);
 
 DB_SHOW_COMMAND(ffs, db_show_ffs)
 {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201310202111.r9KLBfq5076008>