mirror of
https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git
synced 2024-12-02 22:43:48 +08:00
Merge branch 'maint' into next
This commit is contained in:
commit
0a7baccf61
4
configure
vendored
4
configure
vendored
@ -11370,8 +11370,8 @@ if test "${with_multiarch+set}" = set; then :
|
||||
root_libdir=$root_libdir/$withval
|
||||
|
||||
fi
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether linker accepts -static" >&5
|
||||
$as_echo_n "checking whether linker accepts -static... " >&6; }
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we can link with -static" >&5
|
||||
$as_echo_n "checking whether we can link with -static... " >&6; }
|
||||
if ${ac_cv_e2fsprogs_use_static+:} false; then :
|
||||
$as_echo_n "(cached) " >&6
|
||||
else
|
||||
|
@ -1234,9 +1234,11 @@ libdir=$libdir/$withval
|
||||
root_libdir=$root_libdir/$withval
|
||||
)dnl
|
||||
dnl
|
||||
dnl See if -static works.
|
||||
dnl See if -static works. This could fail if the linker does not
|
||||
dnl support -static, or if required external libraries are not available
|
||||
dnl in static form.
|
||||
dnl
|
||||
AC_MSG_CHECKING([whether linker accepts -static])
|
||||
AC_MSG_CHECKING([whether we can link with -static])
|
||||
AC_CACHE_VAL(ac_cv_e2fsprogs_use_static,
|
||||
[SAVE_LDFLAGS=$LDFLAGS; LDFLAGS="$LDFLAGS -static"
|
||||
AC_TRY_LINK([#include <stdio.h>],[fflush(stdout);],
|
||||
|
@ -35,6 +35,7 @@
|
||||
|
||||
// #include <linux/falloc.h>
|
||||
#define FALLOC_FL_KEEP_SIZE 0x01
|
||||
#define FALLOC_FL_PUNCH_HOLE 0x02 /* de-allocates range */
|
||||
|
||||
void usage(void)
|
||||
{
|
||||
@ -94,12 +95,17 @@ int main(int argc, char **argv)
|
||||
int error;
|
||||
int tflag = 0;
|
||||
|
||||
while ((opt = getopt(argc, argv, "nl:ot")) != -1) {
|
||||
while ((opt = getopt(argc, argv, "npl:o:t")) != -1) {
|
||||
switch(opt) {
|
||||
case 'n':
|
||||
/* do not change filesize */
|
||||
falloc_mode = FALLOC_FL_KEEP_SIZE;
|
||||
break;
|
||||
case 'p':
|
||||
/* punch mode */
|
||||
falloc_mode = (FALLOC_FL_PUNCH_HOLE |
|
||||
FALLOC_FL_KEEP_SIZE);
|
||||
break;
|
||||
case 'l':
|
||||
length = cvtnum(optarg);
|
||||
break;
|
||||
|
@ -430,7 +430,7 @@ redo_counts:
|
||||
n = ext2fs_bitcount(actual_buf, nbytes);
|
||||
group_free = fs->super->s_clusters_per_group - n;
|
||||
free_blocks += group_free;
|
||||
i += fs->super->s_clusters_per_group - 1;
|
||||
i += EXT2FS_C2B(fs, fs->super->s_clusters_per_group - 1);
|
||||
goto next_group;
|
||||
no_optimize:
|
||||
|
||||
|
@ -200,7 +200,7 @@ extern errcode_t ext2fs_find_first_zero_generic_bmap(ext2fs_generic_bitmap bitma
|
||||
*/
|
||||
#ifdef NO_INLINE_FUNCS
|
||||
#if (defined(__GNUC__) && (defined(__i386__) || defined(__i486__) || \
|
||||
defined(__i586__) || defined(__mc68000__)))
|
||||
defined(__i586__)))
|
||||
/* This prevents bitops.c from trying to include the C */
|
||||
/* function version of these functions */
|
||||
#define _EXT2_HAVE_ASM_BITOPS_
|
||||
@ -345,43 +345,6 @@ _INLINE_ __u16 ext2fs_swab16(__u16 val)
|
||||
|
||||
#endif /* i386 */
|
||||
|
||||
#if ((defined __GNUC__) && !defined(_EXT2_USE_C_VERSIONS_) && \
|
||||
(defined(__mc68000__)))
|
||||
|
||||
#define _EXT2_HAVE_ASM_BITOPS_
|
||||
|
||||
_INLINE_ int ext2fs_set_bit(unsigned int nr,void * addr)
|
||||
{
|
||||
char retval;
|
||||
|
||||
__asm__ __volatile__ ("bfset %2@{%1:#1}; sne %0"
|
||||
: "=d" (retval) : "d" (nr^7), "a" (addr));
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
_INLINE_ int ext2fs_clear_bit(unsigned int nr, void * addr)
|
||||
{
|
||||
char retval;
|
||||
|
||||
__asm__ __volatile__ ("bfclr %2@{%1:#1}; sne %0"
|
||||
: "=d" (retval) : "d" (nr^7), "a" (addr));
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
_INLINE_ int ext2fs_test_bit(unsigned int nr, const void * addr)
|
||||
{
|
||||
char retval;
|
||||
|
||||
__asm__ __volatile__ ("bftst %2@{%1:#1}; sne %0"
|
||||
: "=d" (retval) : "d" (nr^7), "a" (addr));
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
#endif /* __mc68000__ */
|
||||
|
||||
|
||||
#if !defined(_EXT2_HAVE_ASM_SWAB_)
|
||||
|
||||
|
@ -241,6 +241,8 @@ errcode_t ext2fs_initialize(const char *name, int flags,
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
set_field(s_mmp_update_interval, 0);
|
||||
|
||||
/*
|
||||
* If we're creating an external journal device, we don't need
|
||||
* to bother with the rest.
|
||||
|
@ -505,6 +505,7 @@ static errcode_t unix_open(const char *name, int flags, io_channel *channel)
|
||||
memset(data, 0, sizeof(struct unix_private_data));
|
||||
data->magic = EXT2_ET_MAGIC_UNIX_IO_CHANNEL;
|
||||
data->io_stats.num_fields = 2;
|
||||
data->dev = -1;
|
||||
|
||||
open_flags = (flags & IO_FLAG_RW) ? O_RDWR : O_RDONLY;
|
||||
if (flags & IO_FLAG_EXCLUSIVE)
|
||||
@ -575,7 +576,6 @@ static errcode_t unix_open(const char *name, int flags, io_channel *channel)
|
||||
/* Is the block device actually writable? */
|
||||
error = ioctl(data->dev, BLKROGET, &readonly);
|
||||
if (!error && readonly) {
|
||||
close(data->dev);
|
||||
retval = EPERM;
|
||||
goto cleanup;
|
||||
}
|
||||
@ -621,11 +621,17 @@ static errcode_t unix_open(const char *name, int flags, io_channel *channel)
|
||||
|
||||
cleanup:
|
||||
if (data) {
|
||||
if (data->dev >= 0)
|
||||
close(data->dev);
|
||||
free_cache(data);
|
||||
ext2fs_free_mem(&data);
|
||||
}
|
||||
if (io)
|
||||
if (io) {
|
||||
if (io->name) {
|
||||
ext2fs_free_mem(&io->name);
|
||||
}
|
||||
ext2fs_free_mem(&io);
|
||||
}
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user