svn commit: r233072 - projects/nand/sys/kern
Grzegorz Bernacki
gber at FreeBSD.org
Sat Mar 17 03:18:29 UTC 2012
Author: gber
Date: Sat Mar 17 03:18:28 2012
New Revision: 233072
URL: http://svn.freebsd.org/changeset/base/233072
Log:
Add VFS changes necessary for NANDFS to work.
Ignore B_MANAGED buffer by syncer and ignore signal when msleep as it
can cause file system inconsistency.
Obtained from: Semihalf
Supported by: FreeBSD Foundation, Juniper Networks
Modified:
projects/nand/sys/kern/vfs_bio.c
projects/nand/sys/kern/vfs_subr.c
projects/nand/sys/kern/vfs_vnops.c
Modified: projects/nand/sys/kern/vfs_bio.c
==============================================================================
--- projects/nand/sys/kern/vfs_bio.c Sat Mar 17 03:02:10 2012 (r233071)
+++ projects/nand/sys/kern/vfs_bio.c Sat Mar 17 03:18:28 2012 (r233072)
@@ -2672,7 +2672,8 @@ loop:
else if ((bp->b_flags & (B_VMIO | B_INVAL)) == 0)
bp->b_flags |= B_CACHE;
BO_LOCK(bo);
- bremfree(bp);
+ if (!(bp->b_flags & B_MANAGED))
+ bremfree(bp);
BO_UNLOCK(bo);
/*
Modified: projects/nand/sys/kern/vfs_subr.c
==============================================================================
--- projects/nand/sys/kern/vfs_subr.c Sat Mar 17 03:02:10 2012 (r233071)
+++ projects/nand/sys/kern/vfs_subr.c Sat Mar 17 03:18:28 2012 (r233072)
@@ -2018,7 +2018,8 @@ reassignbuf(struct buf *bp)
* of clean buffers.
*/
if (bp->b_flags & B_DELWRI) {
- if ((bo->bo_flag & BO_ONWORKLST) == 0) {
+ if (!(bp->b_flags & B_MANAGED) &&
+ (bo->bo_flag & BO_ONWORKLST) == 0) {
switch (vp->v_type) {
case VDIR:
delay = dirdelay;
@@ -2034,13 +2035,15 @@ reassignbuf(struct buf *bp)
buf_vlist_add(bp, bo, BX_VNDIRTY);
} else {
buf_vlist_add(bp, bo, BX_VNCLEAN);
-
- if ((bo->bo_flag & BO_ONWORKLST) && bo->bo_dirty.bv_cnt == 0) {
- mtx_lock(&sync_mtx);
- LIST_REMOVE(bo, bo_synclist);
- syncer_worklist_len--;
- mtx_unlock(&sync_mtx);
- bo->bo_flag &= ~BO_ONWORKLST;
+ if (!(bp->b_flags & B_MANAGED)) {
+ if ((bo->bo_flag & BO_ONWORKLST) &&
+ bo->bo_dirty.bv_cnt == 0) {
+ mtx_lock(&sync_mtx);
+ LIST_REMOVE(bo, bo_synclist);
+ syncer_worklist_len--;
+ mtx_unlock(&sync_mtx);
+ bo->bo_flag &= ~BO_ONWORKLST;
+ }
}
}
#ifdef INVARIANTS
Modified: projects/nand/sys/kern/vfs_vnops.c
==============================================================================
--- projects/nand/sys/kern/vfs_vnops.c Sat Mar 17 03:02:10 2012 (r233071)
+++ projects/nand/sys/kern/vfs_vnops.c Sat Mar 17 03:18:28 2012 (r233072)
@@ -1055,6 +1055,8 @@ vn_start_write(vp, mpp, flags)
error = EWOULDBLOCK;
goto unlock;
}
+ if (strcmp(mp->mnt_stat.f_fstypename, "nandfs") == 0)
+ flags &= ~PCATCH;
error = msleep(&mp->mnt_flag, MNT_MTX(mp),
(PUSER - 1) | (flags & PCATCH), "suspfs", 0);
if (error)
More information about the svn-src-projects
mailing list