]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
Enable threaded support for e2fsprogs' applications.
authorTheodore Ts'o <tytso@mit.edu>
Thu, 14 Jan 2021 00:27:23 +0000 (16:27 -0800)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 21 Jan 2021 15:50:40 +0000 (10:50 -0500)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
debugfs/debugfs.c
e2fsck/unix.c
misc/dumpe2fs.c
misc/e2freefrag.c
misc/e2fuzz.c
misc/e2image.c
misc/fuse2fs.c
misc/tune2fs.c
resize/main.c

index 78e557792fe1d849993ec5161d9accfd30503d12..132c5f9d983962dad6c5a0a624853c20bd142309 100644 (file)
@@ -231,7 +231,8 @@ void do_open_filesys(int argc, char **argv, int sci_idx EXT2FS_ATTR((unused)),
        int     catastrophic = 0;
        blk64_t superblock = 0;
        blk64_t blocksize = 0;
-       int     open_flags = EXT2_FLAG_SOFTSUPP_FEATURES | EXT2_FLAG_64BITS; 
+       int     open_flags = EXT2_FLAG_SOFTSUPP_FEATURES | EXT2_FLAG_64BITS |
+               EXT2_FLAG_THREADS;
        char    *data_filename = 0;
        char    *undo_file = NULL;
 
@@ -2532,7 +2533,8 @@ int main(int argc, char **argv)
 #endif
                "[-c]] [device]";
        int             c;
-       int             open_flags = EXT2_FLAG_SOFTSUPP_FEATURES | EXT2_FLAG_64BITS;
+       int             open_flags = EXT2_FLAG_SOFTSUPP_FEATURES |
+                               EXT2_FLAG_64BITS | EXT2_FLAG_THREADS;
        char            *request = 0;
        int             exit_status = 0;
        char            *cmd_file = 0;
index 1cb516721a7d4a46cb850c2fbcc6f760013032a3..dbeaeef5ae9eaa8251f104ebb1e7d325babea975 100644 (file)
@@ -1474,7 +1474,7 @@ int main (int argc, char *argv[])
        }
        ctx->superblock = ctx->use_superblock;
 
-       flags = EXT2_FLAG_SKIP_MMP;
+       flags = EXT2_FLAG_SKIP_MMP | EXT2_FLAG_THREADS;
 restart:
 #ifdef CONFIG_TESTIO_DEBUG
        if (getenv("TEST_IO_FLAGS") || getenv("TEST_IO_BLOCK")) {
index d295ba4d4ae751e215c429f369cd358d14e3121b..82fb4e63088ffc369094c062f6565baa275a08bf 100644 (file)
@@ -665,7 +665,7 @@ int main (int argc, char ** argv)
 
        device_name = argv[optind++];
        flags = EXT2_FLAG_JOURNAL_DEV_OK | EXT2_FLAG_SOFTSUPP_FEATURES |
-               EXT2_FLAG_64BITS;
+               EXT2_FLAG_64BITS | EXT2_FLAG_THREADS;
        if (force)
                flags |= EXT2_FLAG_FORCE;
        if (image_dump)
index 9c23fadcec255fe526854c65380a4448c3a7c4a0..a9d16fc418813580a0c86f97fe10d853c4f08041 100644 (file)
@@ -363,7 +363,7 @@ static void collect_info(ext2_filsys fs, struct chunk_info *chunk_info, FILE *f)
 static void open_device(char *device_name, ext2_filsys *fs)
 {
        int retval;
-       int flag = EXT2_FLAG_FORCE | EXT2_FLAG_64BITS;
+       int flag = EXT2_FLAG_FORCE | EXT2_FLAG_64BITS | EXT2_FLAG_THREADS;
 
        retval = ext2fs_open(device_name, flag, 0, 0, unix_io_manager, fs);
        if (retval) {
index 685cdbe297bd954698920d1d59624f8cda181e4e..1ace1df5adb9469e0ccf0f9c87defd013256441b 100644 (file)
@@ -201,8 +201,8 @@ static int process_fs(const char *fsname)
        }
 
        /* Ensure the fs is clean and does not have errors */
-       ret = ext2fs_open(fsname, EXT2_FLAG_64BITS, 0, 0, unix_io_manager,
-                         &fs);
+       ret = ext2fs_open(fsname, EXT2_FLAG_64BITS | EXT2_FLAG_THREADS,
+                         0, 0, unix_io_manager, &fs);
        if (ret) {
                fprintf(stderr, "%s: failed to open filesystem.\n",
                        fsname);
index 892c5371e71a9141d45e217fca11c653cb0d89c1..e5e47565360a5152e2e6bf55ff70f2c483203019 100644 (file)
@@ -1482,7 +1482,8 @@ int main (int argc, char ** argv)
        ext2_filsys fs;
        char *image_fn, offset_opt[64];
        struct ext2_qcow2_hdr *header = NULL;
-       int open_flag = EXT2_FLAG_64BITS | EXT2_FLAG_IGNORE_CSUM_ERRORS;
+       int open_flag = EXT2_FLAG_64BITS | EXT2_FLAG_THREADS |
+               EXT2_FLAG_IGNORE_CSUM_ERRORS;
        int img_type = 0;
        int flags = 0;
        int mount_flags = 0;
index 4005894d3ff5faab83e67bcbad762f90283e6625..c595721298f2f29143e76cbff5b5cb48256d83c9 100644 (file)
@@ -3727,7 +3727,8 @@ int main(int argc, char *argv[])
        errcode_t err;
        char *logfile;
        char extra_args[BUFSIZ];
-       int ret = 0, flags = EXT2_FLAG_64BITS | EXT2_FLAG_EXCLUSIVE;
+       int ret = 0;
+       int flags = EXT2_FLAG_64BITS | EXT2_FLAG_THREADS | EXT2_FLAG_EXCLUSIVE;
 
        memset(&fctx, 0, sizeof(fctx));
        fctx.magic = FUSE2FS_MAGIC;
index f942c698ae31742f91f568ec2ce36e3483c20107..e5186fe0ca480a237eb6fff2e37313e5df38ed78 100644 (file)
@@ -2950,7 +2950,8 @@ retry_open:
        if ((open_flag & EXT2_FLAG_RW) == 0 || f_flag)
                open_flag |= EXT2_FLAG_SKIP_MMP;
 
-       open_flag |= EXT2_FLAG_64BITS | EXT2_FLAG_JOURNAL_DEV_OK;
+       open_flag |= EXT2_FLAG_64BITS | EXT2_FLAG_THREADS |
+               EXT2_FLAG_JOURNAL_DEV_OK;
 
        /* keep the filesystem struct around to dump MMP data */
        open_flag |= EXT2_FLAG_NOFREE_ON_ERROR;
index ef0336e207d3fa64ab13d5713b86649ae2d67032..dce03f930bf3733df987d76343326069146fdd1e 100644 (file)
@@ -404,7 +404,7 @@ int main (int argc, char ** argv)
        if (!(mount_flags & EXT2_MF_MOUNTED))
                io_flags = EXT2_FLAG_RW | EXT2_FLAG_EXCLUSIVE;
 
-       io_flags |= EXT2_FLAG_64BITS;
+       io_flags |= EXT2_FLAG_64BITS | EXT2_FLAG_THREADS;
        if (undo_file) {
                retval = resize2fs_setup_tdb(device_name, undo_file, &io_ptr);
                if (retval)