Skip to content

Commit

Permalink
Merge pull request #88 from giuseppe/perf-improvements
Browse files Browse the repository at this point in the history
fuse-overlayfs: different performance tweaks
  • Loading branch information
rhatdan authored Jul 23, 2019
2 parents 7bc2dd9 + 9e20d96 commit 95e1d01
Show file tree
Hide file tree
Showing 33 changed files with 1,081 additions and 473 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ before_install:
- (git clone https://github.com/mesonbuild/meson.git; cd meson; sudo python3.5 ./setup.py install)
- (git clone https://github.com/sstephenson/bats.git; cd bats; sudo ./install.sh /usr/local)
- (go get github.com/containers/storage; cd $GOPATH/src/github.com/containers/storage; sed -i -e 's|^AUTOTAGS.*$|AUTOTAGS := exclude_graphdriver_devicemapper exclude_graphdriver_btrfs|' Makefile; make GO=$GO containers-storage)
- (wget https://github.com/libfuse/libfuse/releases/download/fuse-3.2.4/fuse-3.2.4.tar.xz; tar xf fuse-3.2.4.tar.xz; cd fuse-3.2.4; mkdir build; cd build; meson .. --prefix /usr && ninja && sudo ninja install)
- (wget https://github.com/libfuse/libfuse/releases/download/fuse-3.6.2/fuse-3.6.2.tar.xz; tar xf fuse-3.6.2.tar.xz; cd fuse-3.6.2; mkdir build; cd build; meson .. --prefix /usr && ninja && sudo ninja install)
script:
- ./autogen.sh || travis_terminate 1;
- ./configure || travis_terminate 1;
Expand Down
4 changes: 3 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@ AC_TYPE_UINT64_T
AC_TYPE_UINT8_T
AC_CHECK_TYPES([ptrdiff_t])

AC_DEFINE([USE_DIFF_HASH], 1, [Use the same hashing function as GNU diff])

PKG_CHECK_MODULES([FUSE], [fuse3 >= 3.2.1], [AC_DEFINE([HAVE_FUSE], 1, [Define if libfuse is available])], [AC_MSG_ERROR([*** libfuse not found])]])

AC_FUNC_ERROR_AT_LINE
AC_FUNC_MALLOC
AC_CHECK_FUNCS([open_by_handle_at error memset strdup])
AC_CHECK_FUNCS([open_by_handle_at error memset strdup copy_file_range])

AC_CONFIG_FILES([Makefile lib/Makefile])
AC_OUTPUT
2 changes: 1 addition & 1 deletion fuse-overlayfs.1
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,6 @@ Those are the same IDs visible from outside the user namespace.

.SH AVAILABILITY
.PP
The slirp4netns command is available from
The fuse\-overlayfs command is available from
\fB
\[la]https://github.com/containers/fuse-overlayfs\[ra]\fP under GNU GENERAL PUBLIC LICENSE Version 3 or later.
2 changes: 1 addition & 1 deletion fuse-overlayfs.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,5 @@ Those are the same IDs visible from outside the user namespace.

# AVAILABILITY

The slirp4netns command is available from
The fuse-overlayfs command is available from
**https://github.com/containers/fuse-overlayfs** under GNU GENERAL PUBLIC LICENSE Version 3 or later.
21 changes: 16 additions & 5 deletions lib/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## DO NOT EDIT! GENERATED AUTOMATICALLY!
## Process this file with automake to produce Makefile.in.
# Copyright (C) 2002-2017 Free Software Foundation, Inc.
# Copyright (C) 2002-2019 Free Software Foundation, Inc.
#
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand All @@ -13,17 +13,28 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this file. If not, see <http://www.gnu.org/licenses/>.
# along with this file. If not, see <https://www.gnu.org/licenses/>.
#
# As a special exception to the GNU General Public License,
# this file may be distributed as part of a program that
# contains a configuration script generated by Autoconf, under
# the same distribution terms as the rest of that program.
#
# Generated by gnulib-tool.
# Reproduce by: gnulib-tool --import --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=. --no-conditional-dependencies --no-libtool --macro-prefix=gl hash

AUTOMAKE_OPTIONS = 1.9.6 gnits
# Reproduce by:
# gnulib-tool --import \
# --lib=libgnu \
# --source-base=lib \
# --m4-base=m4 \
# --doc-base=doc \
# --tests-base=tests \
# --aux-dir=. \
# --no-conditional-dependencies \
# --no-libtool \
# --macro-prefix=gl \
# hash

AUTOMAKE_OPTIONS = 1.11 gnits

SUBDIRS =
noinst_HEADERS =
Expand Down
14 changes: 8 additions & 6 deletions lib/bitrotate.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* bitrotate.h - Rotate bits in integers
Copyright (C) 2008-2017 Free Software Foundation, Inc.
Copyright (C) 2008-2019 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand All @@ -12,7 +12,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
along with this program. If not, see <https://www.gnu.org/licenses/>. */

/* Written by Simon Josefsson <[email protected]>, 2008. */

Expand Down Expand Up @@ -95,7 +95,8 @@ rotr_sz (size_t x, int n)
BITROTATE_INLINE uint16_t
rotl16 (uint16_t x, int n)
{
return ((x << n) | (x >> (16 - n))) & UINT16_MAX;
return (((unsigned int) x << n) | ((unsigned int) x >> (16 - n)))
& UINT16_MAX;
}

/* Given an unsigned 16-bit argument X, return the value corresponding
Expand All @@ -106,7 +107,8 @@ rotl16 (uint16_t x, int n)
BITROTATE_INLINE uint16_t
rotr16 (uint16_t x, int n)
{
return ((x >> n) | (x << (16 - n))) & UINT16_MAX;
return (((unsigned int) x >> n) | ((unsigned int) x << (16 - n)))
& UINT16_MAX;
}

/* Given an unsigned 8-bit argument X, return the value corresponding
Expand All @@ -117,7 +119,7 @@ rotr16 (uint16_t x, int n)
BITROTATE_INLINE uint8_t
rotl8 (uint8_t x, int n)
{
return ((x << n) | (x >> (8 - n))) & UINT8_MAX;
return (((unsigned int) x << n) | ((unsigned int) x >> (8 - n))) & UINT8_MAX;
}

/* Given an unsigned 8-bit argument X, return the value corresponding
Expand All @@ -128,7 +130,7 @@ rotl8 (uint8_t x, int n)
BITROTATE_INLINE uint8_t
rotr8 (uint8_t x, int n)
{
return ((x >> n) | (x << (8 - n))) & UINT8_MAX;
return (((unsigned int) x >> n) | ((unsigned int) x << (8 - n))) & UINT8_MAX;
}

_GL_INLINE_HEADER_END
Expand Down
4 changes: 2 additions & 2 deletions lib/hash.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* hash - hashing table processing.
Copyright (C) 1998-2004, 2006-2007, 2009-2017 Free Software Foundation, Inc.
Copyright (C) 1998-2004, 2006-2007, 2009-2019 Free Software Foundation, Inc.
Written by Jim Meyering, 1992.
Expand All @@ -15,7 +15,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
along with this program. If not, see <https://www.gnu.org/licenses/>. */

/* A generic hash table package. */

Expand Down
4 changes: 2 additions & 2 deletions lib/hash.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* hash - hashing table processing.
Copyright (C) 1998-1999, 2001, 2003, 2009-2017 Free Software Foundation,
Copyright (C) 1998-1999, 2001, 2003, 2009-2019 Free Software Foundation,
Inc.
Written by Jim Meyering <[email protected]>, 1998.
Expand All @@ -14,7 +14,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
along with this program. If not, see <https://www.gnu.org/licenses/>. */

/* A generic hash table package. */

Expand Down
48 changes: 39 additions & 9 deletions lib/limits.in.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* A GNU-like <limits.h>.
Copyright 2016-2017 Free Software Foundation, Inc.
Copyright 2016-2019 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
Expand All @@ -13,7 +13,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>. */
along with this program; if not, see <https://www.gnu.org/licenses/>. */

#ifndef _@GUARD_PREFIX@_LIMITS_H

Expand All @@ -28,15 +28,32 @@
#ifndef _@GUARD_PREFIX@_LIMITS_H
#define _@GUARD_PREFIX@_LIMITS_H

/* For HP-UX 11.31. */
#if defined LONG_LONG_MIN && !defined LLONG_MIN
# define LLONG_MIN LONG_LONG_MIN
#ifndef LLONG_MIN
# if defined LONG_LONG_MIN /* HP-UX 11.31 */
# define LLONG_MIN LONG_LONG_MIN
# elif defined LONGLONG_MIN /* IRIX 6.5 */
# define LLONG_MIN LONGLONG_MIN
# elif defined __GNUC__
# define LLONG_MIN (- __LONG_LONG_MAX__ - 1LL)
# endif
#endif
#if defined LONG_LONG_MAX && !defined LLONG_MAX
# define LLONG_MAX LONG_LONG_MAX
#ifndef LLONG_MAX
# if defined LONG_LONG_MAX /* HP-UX 11.31 */
# define LLONG_MAX LONG_LONG_MAX
# elif defined LONGLONG_MAX /* IRIX 6.5 */
# define LLONG_MAX LONGLONG_MAX
# elif defined __GNUC__
# define LLONG_MAX __LONG_LONG_MAX__
# endif
#endif
#if defined ULONG_LONG_MAX && !defined ULLONG_MAX
# define ULLONG_MAX ULONG_LONG_MAX
#ifndef ULLONG_MAX
# if defined ULONG_LONG_MAX /* HP-UX 11.31 */
# define ULLONG_MAX ULONG_LONG_MAX
# elif defined ULONGLONG_MAX /* IRIX 6.5 */
# define ULLONG_MAX ULONGLONG_MAX
# elif defined __GNUC__
# define ULLONG_MAX (__LONG_LONG_MAX__ * 2ULL + 1ULL)
# endif
#endif

/* The number of usable bits in an unsigned or signed integer type
Expand All @@ -53,6 +70,19 @@
#define _GL_COB8(n) (_GL_COB4 ((n) >> 4) + _GL_COB4 (n))
#define _GL_COB4(n) (!!((n) & 8) + !!((n) & 4) + !!((n) & 2) + !!((n) & 1))

#ifndef WORD_BIT
/* Assume 'int' is 32 bits wide. */
# define WORD_BIT 32
#endif
#ifndef LONG_BIT
/* Assume 'long' is 32 or 64 bits wide. */
# if LONG_MAX == INT_MAX
# define LONG_BIT 32
# else
# define LONG_BIT 64
# endif
#endif

/* Macros specified by ISO/IEC TS 18661-1:2014. */

#if (! defined ULLONG_WIDTH \
Expand Down
10 changes: 5 additions & 5 deletions lib/stdbool.in.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (C) 2001-2003, 2006-2017 Free Software Foundation, Inc.
/* Copyright (C) 2001-2003, 2006-2019 Free Software Foundation, Inc.
Written by Bruno Haible <[email protected]>, 2001.
This program is free software; you can redistribute it and/or modify
Expand All @@ -12,7 +12,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>. */
along with this program; if not, see <https://www.gnu.org/licenses/>. */

#ifndef _GL_STDBOOL_H
#define _GL_STDBOOL_H
Expand Down Expand Up @@ -82,9 +82,9 @@ typedef bool _Bool;
/* If @HAVE__BOOL@:
Some HP-UX cc and AIX IBM C compiler versions have compiler bugs when
the built-in _Bool type is used. See
http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html
https://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
https://lists.gnu.org/r/bug-coreutils/2005-11/msg00161.html
https://lists.gnu.org/r/bug-coreutils/2005-10/msg00086.html
Similar bugs are likely with other compilers as well; this file
wouldn't be used if <stdbool.h> was working.
So we override the _Bool type.
Expand Down
4 changes: 2 additions & 2 deletions lib/stdint.in.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (C) 2001-2002, 2004-2017 Free Software Foundation, Inc.
/* Copyright (C) 2001-2002, 2004-2019 Free Software Foundation, Inc.
Written by Paul Eggert, Bruno Haible, Sam Steingold, Peter Burwood.
This file is part of gnulib.
Expand All @@ -13,7 +13,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>. */
along with this program; if not, see <https://www.gnu.org/licenses/>. */

/*
* ISO C 99 <stdint.h> for platforms that lack it.
Expand Down
19 changes: 15 additions & 4 deletions lib/sys_types.in.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* Provide a more complete sys/types.h.
Copyright (C) 2011-2017 Free Software Foundation, Inc.
Copyright (C) 2011-2019 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand All @@ -13,13 +13,24 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, see <http://www.gnu.org/licenses/>. */
along with this program; if not, see <https://www.gnu.org/licenses/>. */

#if __GNUC__ >= 3
@PRAGMA_SYSTEM_HEADER@
#endif
@PRAGMA_COLUMNS@

#if defined _WIN32 && !defined __CYGWIN__ \
&& (defined __need_off_t || defined __need___off64_t \
|| defined __need_ssize_t || defined __need_time_t)

/* Special invocation convention inside mingw header files. */

#@INCLUDE_NEXT@ @NEXT_SYS_TYPES_H@

#else
/* Normal invocation convention. */

#ifndef _@GUARD_PREFIX@_SYS_TYPES_H

/* The include_next requires a split double-inclusion guard. */
Expand Down Expand Up @@ -86,10 +97,10 @@ typedef unsigned long long int rpl_ino_t;

/* MSVC 9 defines size_t in <stddef.h>, not in <sys/types.h>. */
/* But avoid namespace pollution on glibc systems. */
#if ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) \
&& ! defined __GLIBC__
#if (defined _WIN32 && ! defined __CYGWIN__) && ! defined __GLIBC__
# include <stddef.h>
#endif

#endif /* _@GUARD_PREFIX@_SYS_TYPES_H */
#endif /* _@GUARD_PREFIX@_SYS_TYPES_H */
#endif /* __need_XXX */
4 changes: 2 additions & 2 deletions lib/xalloc-oversized.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* xalloc-oversized.h -- memory allocation size checking
Copyright (C) 1990-2000, 2003-2004, 2006-2017 Free Software Foundation, Inc.
Copyright (C) 1990-2000, 2003-2004, 2006-2019 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand All @@ -13,7 +13,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
along with this program. If not, see <https://www.gnu.org/licenses/>. */

#ifndef XALLOC_OVERSIZED_H_
#define XALLOC_OVERSIZED_H_
Expand Down
2 changes: 1 addition & 1 deletion m4/00gnulib.m4
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# 00gnulib.m4 serial 3
dnl Copyright (C) 2009-2017 Free Software Foundation, Inc.
dnl Copyright (C) 2009-2019 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
Expand Down
2 changes: 1 addition & 1 deletion m4/absolute-header.m4
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# absolute-header.m4 serial 16
dnl Copyright (C) 2006-2017 Free Software Foundation, Inc.
dnl Copyright (C) 2006-2019 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
Expand Down
Loading

0 comments on commit 95e1d01

Please sign in to comment.