diff --git a/.gitignore b/.gitignore index b46a1ca2..bcc2dfb4 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,6 @@ *.txz *.deb *.rpm -*.zst # backups *~ @@ -64,7 +63,6 @@ pkg/.SRCINFO *.dst *.epr *.geany -session.conf # AFL makeafl.sh diff --git a/cmdline/elem.c b/cmdline/elem.c index 4b18fed1..bd92de0a 100644 --- a/cmdline/elem.c +++ b/cmdline/elem.c @@ -392,7 +392,6 @@ struct snapraid_file* file_alloc(unsigned block_size, const char* sub, data_off_ file->inode = inode; file->physical = physical; file->flag = 0; - file->shared_flag = 0; file->blockvec = malloc_nofail(file->blockmax * block_sizeof()); for (i = 0; i < file->blockmax; ++i) { diff --git a/cmdline/elem.h b/cmdline/elem.h index c5dcbed3..22602930 100644 --- a/cmdline/elem.h +++ b/cmdline/elem.h @@ -265,18 +265,6 @@ struct snapraid_block { */ #define FILE_IS_MISSING 0x800 -#define FILE_IS_HARDLINK 0x1000 /**< If it's an hardlink. */ -#define FILE_IS_SYMLINK 0x2000 /**< If it's a file symlink. */ -#define FILE_IS_SYMDIR 0x4000 /**< If it's a dir symlink for Windows. Not yet supported. */ -#define FILE_IS_JUNCTION 0x8000 /**< If it's a junction for Windows. Not yet supported. */ -#define FILE_IS_LINK_MASK 0xF000 /**< Mask for link type. */ - -/** - * Flags from this bit are shared between multiple threads - * and goes in the shared_flags instead of flags - */ -#define FILE_FLAGS_SHARED_BIT 16 - /** * During scan if the file is found missing and relocated to another place * @@ -285,7 +273,13 @@ struct snapraid_block { * This specific bit is written using protection from the stamp_mutex during * the multithread scan. */ -#define FILE_IS_RELOCATED 0x10000 +#define FILE_IS_RELOCATED 0x1000 + +#define FILE_IS_HARDLINK 0x10000 /**< If it's an hardlink. */ +#define FILE_IS_SYMLINK 0x20000 /**< If it's a file symlink. */ +#define FILE_IS_SYMDIR 0x40000 /**< If it's a dir symlink for Windows. Not yet supported. */ +#define FILE_IS_JUNCTION 0x80000 /**< If it's a junction for Windows. Not yet supported. */ +#define FILE_IS_LINK_MASK 0xF0000 /**< Mask for link type. */ /** * File. @@ -298,8 +292,7 @@ struct snapraid_file { struct snapraid_block* blockvec; /**< All the blocks of the file. */ int mtime_nsec; /**< Modification time nanoseconds. In the range 0 <= x < 1,000,000,000, or STAT_NSEC_INVALID if not present. */ block_off_t blockmax; /**< Number of blocks. */ - uint16_t flag; /**< FILE_IS_* flags. */ - uint16_t shared_flag; /**< FILE_IS_RELOCATED flag. Keep it separated as it's accessed by multiple threads */ + unsigned flag; /**< FILE_IS_* flags. */ char* sub; /**< Sub path of the file. Without the disk dir. The disk is implicit. */ /* nodes for data structures */ @@ -793,32 +786,17 @@ static inline int block_has_file_and_valid_parity(const struct snapraid_block* b static inline int file_flag_has(const struct snapraid_file* file, unsigned mask) { - if (mask >= (1 << FILE_FLAGS_SHARED_BIT)) { - mask >>= FILE_FLAGS_SHARED_BIT; - return (file->shared_flag & mask) == mask; - } else { - return (file->flag & mask) == mask; - } + return (file->flag & mask) == mask; } static inline void file_flag_set(struct snapraid_file* file, unsigned mask) { - if (mask >= (1 << FILE_FLAGS_SHARED_BIT)) { - mask >>= FILE_FLAGS_SHARED_BIT; - file->shared_flag |= mask; - } else { - file->flag |= mask; - } + file->flag |= mask; } static inline void file_flag_clear(struct snapraid_file* file, unsigned mask) { - if (mask >= (1 << FILE_FLAGS_SHARED_BIT)) { - mask >>= FILE_FLAGS_SHARED_BIT; - file->shared_flag &= ~mask; - } else { - file->flag &= ~mask; - } + file->flag &= ~mask; } /** diff --git a/cmdline/stream.c b/cmdline/stream.c index 9f18c067..999ac913 100644 --- a/cmdline/stream.c +++ b/cmdline/stream.c @@ -65,7 +65,7 @@ STREAM* sopen_read(const char* file, int flags) /* advise sequential access */ ret = posix_fadvise(s->handle[0].f, 0, 0, POSIX_FADV_SEQUENTIAL); if (ret == ENOSYS) { - log_error(errno, "WARNING! fadvise() is not supported in this platform. Performance may not be optimal!\n"); + log_fatal(errno, "WARNING! fadvise() is not supported in this platform. Performance may not be optimal!\n"); /* call is not supported, like in armhf, see posix_fadvise manpage */ ret = 0; } diff --git a/makecheck.sh b/makecheck.sh index a031f7ab..918f46a9 100755 --- a/makecheck.sh +++ b/makecheck.sh @@ -17,30 +17,6 @@ if ! $SOURCE/configure; then exit 1 fi -if ! make -j4; then - exit 1 -fi - -if ! make check; then - exit 1 -fi - -if ! make distclean; then - exit 1 -fi - -if ! $SOURCE/configure --host=x86_64-w64-mingw32.static --build=`$SOURCE/config.guess`; then - exit 1 -fi - -if ! make -j4; then - exit 1 -fi - -if ! make check; then - exit 1 -fi - -if ! make distclean; then +if ! time make check; then exit 1 fi diff --git a/makedist.sh b/makedist.sh index 952a2fe4..4188914e 100755 --- a/makedist.sh +++ b/makedist.sh @@ -1,6 +1,17 @@ #!/bin/sh # +CHECK=check +DEBUG= + +if test "x$1" = "x-f"; then +CHECK=all +fi + +if test "x$1" = "x-d"; then +DEBUG=--enable-debug +fi + # Ask root permissions at the start sudo echo We are root @@ -9,15 +20,7 @@ make distclean # Reconfigure (with force) to get the latest revision from git autoreconf -f -if ! ./configure ; then - exit 1 -fi - -if ! make dist; then - exit 1 -fi - -if ! ./configure.windows-x86; then +if ! ./configure.windows-x86 $DEBUG; then exit 1 fi @@ -29,11 +32,11 @@ if ! make distwindows-x86 distclean; then exit 1 fi -if ! ./configure.windows-x64; then +if ! ./configure.windows-x64 $DEBUG; then exit 1 fi -if ! make -j4; then +if ! make -j4 $CHECK; then exit 1 fi @@ -41,6 +44,14 @@ if ! make distwindows-x64 distclean; then exit 1 fi +if ! ./configure ; then + exit 1 +fi + +if ! make dist; then + exit 1 +fi + sh makeslackdist.sh sh makearchdist.sh sudo sh makeslackware.sh