Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/ufs/lfs Add missing b_cflags and b_oflags.



details:   https://anonhg.NetBSD.org/src/rev/add53f34174c
branches:  trunk
changeset: 362427:add53f34174c
user:      zafer <zafer%NetBSD.org@localhost>
date:      Sat Jun 09 18:48:31 2018 +0000

description:
Add missing b_cflags and b_oflags.
Ok dholland@
Addresses PR kern/42342 by Yoshihiro Nakajima

diffstat:

 sys/ufs/lfs/lfs_bio.c     |   7 +++----
 sys/ufs/lfs/lfs_segment.c |  25 ++++++++++++-------------
 2 files changed, 15 insertions(+), 17 deletions(-)

diffs (121 lines):

diff -r c52fb8e00198 -r add53f34174c sys/ufs/lfs/lfs_bio.c
--- a/sys/ufs/lfs/lfs_bio.c     Sat Jun 09 18:39:58 2018 +0000
+++ b/sys/ufs/lfs/lfs_bio.c     Sat Jun 09 18:48:31 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lfs_bio.c,v 1.141 2017/06/10 05:29:36 maya Exp $       */
+/*     $NetBSD: lfs_bio.c,v 1.142 2018/06/09 18:48:31 zafer Exp $      */
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2002, 2003, 2008 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lfs_bio.c,v 1.141 2017/06/10 05:29:36 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_bio.c,v 1.142 2018/06/09 18:48:31 zafer Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -420,8 +420,7 @@
        ASSERT_MAYBE_SEGLOCK(fs);
        KASSERT(bp->b_cflags & BC_BUSY);
        KASSERT(flags & BW_CLEAN || !LFS_IS_MALLOC_BUF(bp));
-       KASSERT(((bp->b_oflags | bp->b_flags) & (BO_DELWRI|B_LOCKED))
-           != BO_DELWRI);
+       KASSERT((bp->b_flags & B_LOCKED) || !(bp->b_oflags & BO_DELWRI));
 
        /*
         * Don't write *any* blocks if we're mounted read-only, or
diff -r c52fb8e00198 -r add53f34174c sys/ufs/lfs/lfs_segment.c
--- a/sys/ufs/lfs/lfs_segment.c Sat Jun 09 18:39:58 2018 +0000
+++ b/sys/ufs/lfs/lfs_segment.c Sat Jun 09 18:48:31 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lfs_segment.c,v 1.276 2018/06/06 01:49:09 maya Exp $   */
+/*     $NetBSD: lfs_segment.c,v 1.277 2018/06/09 18:48:31 zafer Exp $  */
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lfs_segment.c,v 1.276 2018/06/06 01:49:09 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_segment.c,v 1.277 2018/06/09 18:48:31 zafer Exp $");
 
 #ifdef DEBUG
 # define vndebug(vp, str) do {                                         \
@@ -1408,13 +1408,13 @@
                        continue;
                }
 #ifdef DIAGNOSTIC
-# ifdef LFS_USE_B_INVAL
-               if ((bp->b_flags & BC_INVAL) != 0 && bp->b_iodone == NULL) {
+# ifdef LFS_USE_BC_INVAL
+               if ((bp->b_cflags & BC_INVAL) != 0 && bp->b_iodone == NULL) {
                        DLOG((DLOG_SEG, "lfs_gather: lbn %" PRId64
                              " is BC_INVAL\n", bp->b_lblkno));
                        VOP_PRINT(bp->b_vp);
                }
-# endif /* LFS_USE_B_INVAL */
+# endif /* LFS_USE_BC_INVAL */
                if (!(bp->b_oflags & BO_DELWRI))
                        panic("lfs_gather: bp not BO_DELWRI");
                if (!(bp->b_flags & B_LOCKED)) {
@@ -2106,7 +2106,7 @@
        LFS_WRITESEGENTRY(sup, fs, sp->seg_number, bp); /* Ifile */
 
        /*
-        * Mark blocks B_BUSY, to prevent then from being changed between
+        * Mark blocks BC_BUSY, to prevent then from being changed between
         * the checksum computation and the actual write.
         *
         * If we are cleaning, check indirect blocks for UNWRITTEN, and if
@@ -2217,7 +2217,7 @@
                /* Loop through gop_write cluster blocks */
                for (byteoffset = 0; byteoffset < (*bpp)->b_bcount;
                     byteoffset += lfs_sb_getbsize(fs)) {
-#ifdef LFS_USE_B_INVAL
+#ifdef LFS_USE_BC_INVAL
                        if (((*bpp)->b_cflags & BC_INVAL) != 0 &&
                            (*bpp)->b_iodone != NULL) {
                                if (copyin((void *)(*bpp)->b_saveaddr +
@@ -2228,7 +2228,7 @@
                                                (*bpp)->b_lblkno);
                                }
                        } else
-#endif /* LFS_USE_B_INVAL */
+#endif /* LFS_USE_BC_INVAL */
                        {
                                sum = lfs_cksum_part((char *)
                                    (*bpp)->b_data + byteoffset, el_size, sum);
@@ -2320,9 +2320,9 @@
                            bp->b_bcount, bp->b_blkno,
                            sp->seg_number);
 
-#ifdef LFS_USE_B_INVAL
+#ifdef LFS_USE_BC_INVAL
                        /*
-                        * Fake buffers from the cleaner are marked as B_INVAL.
+                        * Fake buffers from the cleaner are marked as BC_INVAL.
                         * We need to copy the data from user space rather than
                         * from the buffer indicated.
                         * XXX == what do I do on an error?
@@ -2333,7 +2333,7 @@
                                        panic("lfs_writeseg: "
                                            "copyin failed [2]");
                        } else
-#endif /* LFS_USE_B_INVAL */
+#endif /* LFS_USE_BC_INVAL */
                        if (cl->flags & LFS_CL_MALLOC) {
                                /* copy data into our cluster. */
                                memcpy(p, bp->b_data, bp->b_bcount);
@@ -2590,8 +2590,7 @@
                        tbp->b_flags |= B_ASYNC; /* for biodone */
                }
 
-               if (((tbp->b_flags | tbp->b_oflags) &
-                   (B_LOCKED | BO_DELWRI)) == B_LOCKED)
+               if ((tbp->b_flags & B_LOCKED) && !(tbp->b_oflags & BO_DELWRI))
                        LFS_UNLOCK_BUF(tbp);
 
                if (tbp->b_oflags & BO_DONE) {



Home | Main Index | Thread Index | Old Index