kernel - B_IODEBUG -> B_IOISSUED
authorMatthew Dillon <dillon@apollo.backplane.com>
Sat, 11 Jun 2016 22:10:22 +0000 (15:10 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Sat, 11 Jun 2016 22:10:22 +0000 (15:10 -0700)
* Rename this flag.  It still operates the same way.

  This flag is set by the kernel upon an actual I/O read into a buffer
  cache buffer and may be cleared by the filesystem code to allow the
  filesystem code to detect when re-reads of the block cause another I/O
  or not.  This allows HAMMER1 and HAMMER2 to avoid calculating the check
  code over and over again if it has already been calculated.

sys/kern/vfs_bio.c
sys/kern/vfs_cluster.c
sys/sys/buf.h
sys/vfs/hammer/hammer_io.c
sys/vfs/hammer/hammer_vnops.c

index 3b841f9..f94c970 100644 (file)
@@ -3586,7 +3586,7 @@ vn_strategy(struct vnode *vp, struct bio *bio)
         * (aka HAMMER), allowing the consumer to determine if I/O had
         * actually occurred.
         */
-       bp->b_flags |= B_IODEBUG;
+       bp->b_flags |= B_IOISSUED;
 
        /*
         * Handle the swap cache intercept.
index 0f36025..141bf53 100644 (file)
@@ -1115,12 +1115,12 @@ cluster_callback(struct bio *bio)
        while ((tbp = bio->bio_caller_info1.cluster_head) != NULL) {
                bio->bio_caller_info1.cluster_head = tbp->b_cluster_next;
                if (error) {
-                       tbp->b_flags |= B_ERROR | B_IODEBUG;
+                       tbp->b_flags |= B_ERROR | B_IOISSUED;
                        tbp->b_error = error;
                } else {
                        tbp->b_dirtyoff = tbp->b_dirtyend = 0;
                        tbp->b_flags &= ~(B_ERROR|B_INVAL);
-                       tbp->b_flags |= B_IODEBUG;
+                       tbp->b_flags |= B_IOISSUED;
                        /*
                         * XXX the bdwrite()/bqrelse() issued during
                         * cluster building clears B_RELBUF (see bqrelse()
index c212d4b..e7f1c1c 100644 (file)
@@ -296,7 +296,7 @@ struct buf {
 #define        B_HASBOGUS      0x00000200      /* Contains bogus pages */
 #define        B_EINTR         0x00000400      /* I/O was interrupted */
 #define        B_ERROR         0x00000800      /* I/O error occurred. */
-#define        B_IODEBUG       0x00001000      /* (Debugging only bread) */
+#define        B_IOISSUED      0x00001000      /* Flag when I/O issued (vfs can clr) */
 #define        B_INVAL         0x00002000      /* Does not contain valid info. */
 #define        B_LOCKED        0x00004000      /* Locked in core (not reusable). */
 #define        B_NOCACHE       0x00008000      /* Destroy buffer AND backing store */
index 7e84ef5..7fdb153 100644 (file)
@@ -321,7 +321,7 @@ hammer_io_read(struct vnode *devvp, struct hammer_io *io, int limit)
                 * even if we error out here.
                 */
                bp = io->bp;
-               if ((hammer_debug_io & 0x0001) && (bp->b_flags & B_IODEBUG)) {
+               if ((hammer_debug_io & 0x0001) && (bp->b_flags & B_IOISSUED)) {
                        const char *metatype;
 
                        switch(io->type) {
@@ -358,7 +358,7 @@ hammer_io_read(struct vnode *devvp, struct hammer_io *io, int limit)
                                (intmax_t)bp->b_bio2.bio_offset,
                                metatype);
                }
-               bp->b_flags &= ~B_IODEBUG;
+               bp->b_flags &= ~B_IOISSUED;
                bp->b_ops = &hammer_bioops;
 
                hammer_buf_attach_io(bp, io); /* locked by the io lock */
index 7d68fcf..e42288b 100644 (file)
@@ -423,13 +423,13 @@ hammer_vop_read(struct vop_read_args *ap)
                        break;
                }
 skip:
-               if ((hammer_debug_io & 0x0001) && (bp->b_flags & B_IODEBUG)) {
+               if ((hammer_debug_io & 0x0001) && (bp->b_flags & B_IOISSUED)) {
                        hdkprintf("zone2_offset %016jx read file %016jx@%016jx\n",
                                (intmax_t)bp->b_bio2.bio_offset,
                                (intmax_t)ip->obj_id,
                                (intmax_t)bp->b_loffset);
                }
-               bp->b_flags &= ~B_IODEBUG;
+               bp->b_flags &= ~B_IOISSUED;
                if (blksize == HAMMER_XBUFSIZE)
                        bp->b_flags |= B_CLUSTEROK;