svn commit: r233072 - projects/nand/sys/kern
Pawel Jakub Dawidek
pjd at FreeBSD.org
Sat Mar 17 08:52:53 UTC 2012
On Sat, Mar 17, 2012 at 03:18:29AM +0000, Grzegorz Bernacki wrote:
> 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.
I'd suggest running these changes through kib at . Especially vn_start_write()
change below looks ugly, but maybe it is only temporary?
> 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)
--
Pawel Jakub Dawidek http://www.wheelsystems.com
FreeBSD committer http://www.FreeBSD.org
Am I Evil? Yes, I Am! http://tupytaj.pl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/svn-src-projects/attachments/20120317/8c6e18dd/attachment.pgp
More information about the svn-src-projects
mailing list