]> www.infradead.org Git - users/hch/xfsprogs.git/commitdiff
libxfs: remove LIBXFS_EXIT_ON_FAILURE
authorDarrick J. Wong <darrick.wong@oracle.com>
Sun, 1 Mar 2020 17:33:38 +0000 (12:33 -0500)
committerEric Sandeen <sandeen@sandeen.net>
Sun, 1 Mar 2020 17:33:38 +0000 (12:33 -0500)
Now that the read-side users of LIBXFS_EXIT_ON_FAILURE are gone and the
only write-side callers are in mkfs which now checks for buffer write
failures, get rid of LIBXFS_EXIT_ON_FAILURE.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
include/libxfs.h
libxfs/libxfs_io.h
libxfs/rdwr.c
mkfs/proto.c
mkfs/xfs_mkfs.c

index 504f6e9cd1eb5ffb270f24bcafa23a5995e920df..12447835ef0017d9ff4e45342e3a10608552cc37 100644 (file)
@@ -126,7 +126,6 @@ typedef struct libxfs_xinit {
        int             bcache_flags;   /* cache init flags */
 } libxfs_init_t;
 
-#define LIBXFS_EXIT_ON_FAILURE 0x0001  /* exit the program if a call fails */
 #define LIBXFS_ISREADONLY      0x0002  /* disallow all mounted filesystems */
 #define LIBXFS_ISINACTIVE      0x0004  /* allow mounted only if mounted ro */
 #define LIBXFS_DANGEROUSLY     0x0008  /* repairing a device mounted ro    */
index 6bb75a671508a9672304cee9a71c24d6a2185ccf..87c6ea3e8f0a172667b5445532b347a6de68bcce 100644 (file)
@@ -91,7 +91,7 @@ bool xfs_verify_magic(struct xfs_buf *bp, __be32 dmagic);
 bool xfs_verify_magic16(struct xfs_buf *bp, __be16 dmagic);
 
 /* b_flags bits */
-#define LIBXFS_B_EXIT          0x0001  /* ==LIBXFS_EXIT_ON_FAILURE */
+#define LIBXFS_B_EXIT          0x0001  /* exit if write fails */
 #define LIBXFS_B_DIRTY         0x0002  /* buffer has been modified */
 #define LIBXFS_B_STALE         0x0004  /* buffer marked as invalid */
 #define LIBXFS_B_UPTODATE      0x0008  /* buffer is sync'd to disk */
index effcc7f0b8b969942e228d3936481b5027d0b0db..f775e67da5a15706ab803b536d5a9374f87501d2 100644 (file)
@@ -19,7 +19,7 @@
 #include "xfs_trans.h"
 #include "libfrog/platform.h"
 
-#include "libxfs.h"            /* for LIBXFS_EXIT_ON_FAILURE */
+#include "libxfs.h"
 
 /*
  * Important design/architecture note:
index 2ece593e677c0a75219f27233768c9f30eb0fc74..c3813ea2efc7d971c83dfaac1dea0588e34de8da 100644 (file)
@@ -262,7 +262,7 @@ newfile(
                if (logit)
                        libxfs_trans_log_buf(tp, bp, 0, bp->b_bcount - 1);
                else
-                       libxfs_writebuf(bp, LIBXFS_EXIT_ON_FAILURE);
+                       libxfs_writebuf(bp, 0);
        }
        ip->i_d.di_size = len;
        return flags;
index d06fc1acc10643d6dd9ac0392d0dd1763683505e..de6e0e2823a2ae578823de847e45977605be18af 100644 (file)
@@ -3402,7 +3402,7 @@ prepare_devices(
        buf = libxfs_getbuf(mp->m_ddev_targp, (xi->dsize - whack_blks),
                            whack_blks);
        memset(buf->b_addr, 0, WHACK_SIZE);
-       libxfs_writebuf(buf, LIBXFS_EXIT_ON_FAILURE);
+       libxfs_writebuf(buf, 0);
        libxfs_purgebuf(buf);
 
        /*
@@ -3413,7 +3413,7 @@ prepare_devices(
         */
        buf = libxfs_getbuf(mp->m_ddev_targp, 0, whack_blks);
        memset(buf->b_addr, 0, WHACK_SIZE);
-       libxfs_writebuf(buf, LIBXFS_EXIT_ON_FAILURE);
+       libxfs_writebuf(buf, 0);
        libxfs_purgebuf(buf);
 
        /* OK, now write the superblock... */
@@ -3421,7 +3421,7 @@ prepare_devices(
        buf->b_ops = &xfs_sb_buf_ops;
        memset(buf->b_addr, 0, cfg->sectorsize);
        libxfs_sb_to_disk(buf->b_addr, sbp);
-       libxfs_writebuf(buf, LIBXFS_EXIT_ON_FAILURE);
+       libxfs_writebuf(buf, 0);
        libxfs_purgebuf(buf);
 
        /* ...and zero the log.... */
@@ -3441,7 +3441,7 @@ prepare_devices(
                                    XFS_FSB_TO_BB(mp, cfg->rtblocks - 1LL),
                                    BTOBB(cfg->blocksize));
                memset(buf->b_addr, 0, cfg->blocksize);
-               libxfs_writebuf(buf, LIBXFS_EXIT_ON_FAILURE);
+               libxfs_writebuf(buf, 0);
                libxfs_purgebuf(buf);
        }
 
@@ -3538,7 +3538,7 @@ rewrite_secondary_superblocks(
                exit(1);
        }
        XFS_BUF_TO_SBP(buf)->sb_rootino = cpu_to_be64(mp->m_sb.sb_rootino);
-       libxfs_writebuf(buf, LIBXFS_EXIT_ON_FAILURE);
+       libxfs_writebuf(buf, 0);
 
        /* and one in the middle for luck if there's enough AGs for that */
        if (mp->m_sb.sb_agcount <= 2)
@@ -3554,7 +3554,7 @@ rewrite_secondary_superblocks(
                exit(1);
        }
        XFS_BUF_TO_SBP(buf)->sb_rootino = cpu_to_be64(mp->m_sb.sb_rootino);
-       libxfs_writebuf(buf, LIBXFS_EXIT_ON_FAILURE);
+       libxfs_writebuf(buf, 0);
 }
 
 static void
@@ -3901,7 +3901,7 @@ main(
        if (!buf || buf->b_error)
                exit(1);
        (XFS_BUF_TO_SBP(buf))->sb_inprogress = 0;
-       libxfs_writebuf(buf, LIBXFS_EXIT_ON_FAILURE);
+       libxfs_writebuf(buf, 0);
 
        /* Exit w/ failure if anything failed to get written to our new fs. */
        error = -libxfs_umount(mp);