Drop posix_fadvise(3) completely before unpacking.

Some systems with small memory might fail to make the preallocation,
as seen in the rpi. It doesn't give us too much gain anyway.
This commit is contained in:
Juan RP 2013-02-20 12:59:11 +01:00
parent 1f324a76a2
commit e525e2c251
2 changed files with 0 additions and 26 deletions

18
configure vendored
View File

@ -344,24 +344,6 @@ else
fi fi
rm -f _$func.c _$func rm -f _$func.c _$func
# Check for posix_fadvise(2)
func=posix_fadvise
printf "Checking for $func() ... "
cat <<EOF >_$func.c
#include <fcntl.h>
int main(void) {
posix_fadvise(0, 0, 0, POSIX_FADV_NORMAL);
return 0;
}
EOF
if $XCC _$func.c -o _$func 2>/dev/null; then
echo "yes."
echo "CPPFLAGS += -DHAVE_POSIX_FADVISE" >>$CONFIG_MK
else
echo "no."
fi
rm -f _$func _$func.c
# #
# Check for strcasestr(). # Check for strcasestr().
# #

View File

@ -586,7 +586,6 @@ int HIDDEN
xbps_unpack_binary_pkg(struct xbps_handle *xhp, prop_dictionary_t pkg_repod) xbps_unpack_binary_pkg(struct xbps_handle *xhp, prop_dictionary_t pkg_repod)
{ {
struct archive *ar = NULL; struct archive *ar = NULL;
struct stat pkg_stat;
const char *pkgname, *version, *pkgver; const char *pkgname, *version, *pkgver;
char *bpkg; char *bpkg;
int pkg_fd, rv = 0; int pkg_fd, rv = 0;
@ -634,10 +633,6 @@ xbps_unpack_binary_pkg(struct xbps_handle *xhp, prop_dictionary_t pkg_repod)
archive_read_open_fd(ar, pkg_fd, ARCHIVE_READ_BLOCKSIZE); archive_read_open_fd(ar, pkg_fd, ARCHIVE_READ_BLOCKSIZE);
free(bpkg); free(bpkg);
#ifdef HAVE_POSIX_FADVISE
fstat(pkg_fd, &pkg_stat);
posix_fadvise(pkg_fd, 0, pkg_stat.st_size, POSIX_FADV_SEQUENTIAL);
#endif
/* /*
* Extract archive files. * Extract archive files.
*/ */
@ -648,9 +643,6 @@ xbps_unpack_binary_pkg(struct xbps_handle *xhp, prop_dictionary_t pkg_repod)
pkgver, strerror(rv)); pkgver, strerror(rv));
goto out; goto out;
} }
#ifdef HAVE_POSIX_FADVISE
posix_fadvise(pkg_fd, 0, pkg_stat.st_size, POSIX_FADV_DONTNEED);
#endif
/* /*
* Set package state to unpacked. * Set package state to unpacked.
*/ */