]> www.infradead.org Git - users/hch/xfsprogs.git/commitdiff
libxfs: convert libxfs_log_clear to use uncached buffers
authorDarrick J. Wong <darrick.wong@oracle.com>
Sun, 1 Mar 2020 17:34:10 +0000 (12:34 -0500)
committerEric Sandeen <sandeen@sandeen.net>
Sun, 1 Mar 2020 17:34:10 +0000 (12:34 -0500)
Convert the log clearing function to use uncached buffers like
everything else, instead of using the raw buffer get/put functions.
This will eventually enable us to hide them more effectively.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
libxfs/rdwr.c

index f76ac228316c0182b34b1a85994e7e60df777f1f..cc7db73b4500887a26f47edd8a0f10bdaaa3d71b 100644 (file)
@@ -1420,15 +1420,13 @@ libxfs_log_clear(
        /* write out the first log record */
        ptr = dptr;
        if (btp) {
-               bp = libxfs_getbufr(btp, start, len);
+               bp = libxfs_getbufr_uncached(btp, start, len);
                ptr = bp->b_addr;
        }
        libxfs_log_header(ptr, fs_uuid, version, sunit, fmt, lsn, tail_lsn,
                          next, bp);
-       if (bp) {
-               bp->b_flags |= LIBXFS_B_DIRTY;
-               libxfs_putbufr(bp);
-       }
+       if (bp)
+               libxfs_writebuf(bp, 0);
 
        /*
         * There's nothing else to do if this is a log reset. The kernel detects
@@ -1468,7 +1466,7 @@ libxfs_log_clear(
 
                ptr = dptr;
                if (btp) {
-                       bp = libxfs_getbufr(btp, blk, len);
+                       bp = libxfs_getbufr_uncached(btp, blk, len);
                        ptr = bp->b_addr;
                }
                /*
@@ -1477,10 +1475,8 @@ libxfs_log_clear(
                 */
                libxfs_log_header(ptr, fs_uuid, version, BBTOB(len), fmt, lsn,
                                  tail_lsn, next, bp);
-               if (bp) {
-                       bp->b_flags |= LIBXFS_B_DIRTY;
-                       libxfs_putbufr(bp);
-               }
+               if (bp)
+                       libxfs_writebuf(bp, 0);
 
                blk += len;
                if (dptr)