summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/kern/vfs_bio.c6
-rw-r--r--sys/ufs/ffs/ffs_vfsops.c13
2 files changed, 18 insertions, 1 deletions
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c
index 8017e19..4705903 100644
--- a/sys/kern/vfs_bio.c
+++ b/sys/kern/vfs_bio.c
@@ -604,6 +604,10 @@ breadn(struct vnode * vp, daddr_t blkno, int size,
* or in biodone() since the I/O is synchronous. We put it
* here.
*/
+
+int dobkgrdwrite = 1;
+SYSCTL_INT(_debug, OID_AUTO, dobkgrdwrite, CTLFLAG_RW, &dobkgrdwrite, 0, "");
+
int
bwrite(struct buf * bp)
{
@@ -648,7 +652,7 @@ bwrite(struct buf * bp)
* This optimization eats a lot of memory. If we have a page
* or buffer shortfall we can't do it.
*/
- if ((bp->b_xflags & BX_BKGRDWRITE) &&
+ if (dobkgrdwrite && (bp->b_xflags & BX_BKGRDWRITE) &&
(bp->b_flags & B_ASYNC) &&
!vm_page_count_severe() &&
!buf_dirty_count_severe()) {
diff --git a/sys/ufs/ffs/ffs_vfsops.c b/sys/ufs/ffs/ffs_vfsops.c
index 80bed87..aa2960d 100644
--- a/sys/ufs/ffs/ffs_vfsops.c
+++ b/sys/ufs/ffs/ffs_vfsops.c
@@ -499,6 +499,10 @@ loop:
return (0);
}
+#include <sys/sysctl.h>
+int bigcgs = 0;
+SYSCTL_INT(_debug, OID_AUTO, bigcgs, CTLFLAG_RW, &bigcgs, 0, "");
+
/*
* Common code for mount and mountroot
*/
@@ -701,6 +705,11 @@ ffs_mountfs(devvp, mp, p, malloctype)
maxfilesize = (u_int64_t)0x40000000 * fs->fs_bsize - 1; /* XXX */
if (fs->fs_maxfilesize > maxfilesize) /* XXX */
fs->fs_maxfilesize = maxfilesize; /* XXX */
+ if (bigcgs) {
+ if (fs->fs_sparecon[0] <= 0)
+ fs->fs_sparecon[0] = fs->fs_cgsize;
+ fs->fs_cgsize = fs->fs_bsize;
+ }
if (ronly == 0) {
if ((fs->fs_flags & FS_DOSOFTDEP) &&
(error = softdep_mount(devvp, mp, fs, cred)) != 0) {
@@ -806,6 +815,10 @@ ffs_unmount(mp, mntflags, p)
return (error);
}
fs = ump->um_fs;
+ if (bigcgs) {
+ fs->fs_cgsize = fs->fs_sparecon[0];
+ fs->fs_sparecon[0] = 0;
+ }
if (fs->fs_ronly == 0) {
fs->fs_clean = fs->fs_flags & (FS_UNCLEAN|FS_NEEDSFSCK) ? 0 : 1;
error = ffs_sbupdate(ump, MNT_WAIT);
OpenPOWER on IntegriCloud