Skip to contentSkip to conversation

e4defrag: remove a lot of cruft

PATCH New Eric Sandeen 1 participant 1 message Jul 15, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 e4defrag: remove a lot of cruft

e4defrag.c had a lot of stuff copied into it from other places, redefinitions of existing interfaces, etc.

We should be able to remove most of this, as the tool only works on recent kernels anyway, we should just pick up definitions from recent kernel headers whenever possible.

I've left the local definitions of fallocate, fadvise (changed to posix_fadvise) and sync_file_range, and wrapped them in #ifdef configure-time tests - though really it seems like only fallocate should be necessary by now, and perhaps the others can be dropped.

We still need some Makefile work so that it won't try to build e4defrag if the right pieces aren't there (and if the local definitions won't work...)

---

configure +1 -1
index 769dc09..4b3d221 100755
@@ -15790,7 +15790,7 @@ fi
 
 
 
-for ac_func in chflags getrusage llseek lseek64 open64 fstat64 ftruncate64 getmntinfo strtoull strcasecmp srandom jrand48 fchown mallinfo fdatasync strnlen strptime strdup sysconf pathconf posix_memalign memalign valloc __secure_getenv prctl mmap utime setresuid setresgid usleep nanosleep getdtablesize getrlimit
+for ac_func in chflags getrusage llseek lseek64 open64 fstat64 ftruncate64 getmntinfo strtoull strcasecmp srandom jrand48 fchown mallinfo fdatasync strnlen strptime strdup sysconf pathconf posix_memalign memalign valloc __secure_getenv prctl mmap utime setresuid setresgid usleep nanosleep getdtablesize getrlimit sync_file_range posix_fadvise fallocate
 do
 as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5
configure.in +1 -1
index d11faec..22554a2 100644
@@ -828,7 +828,7 @@ AC_CHECK_MEMBER(struct sockaddr.sa_len,
 	[#include <sys/types.h>
 	 #include <sys/socket.h>])
 dnl
-AC_CHECK_FUNCS(chflags getrusage llseek lseek64 open64 fstat64 ftruncate64 getmntinfo strtoull strcasecmp srandom jrand48 fchown mallinfo fdatasync strnlen strptime strdup sysconf pathconf posix_memalign memalign valloc __secure_getenv prctl mmap utime setresuid setresgid usleep nanosleep getdtablesize getrlimit)
+AC_CHECK_FUNCS(chflags getrusage llseek lseek64 open64 fstat64 ftruncate64 getmntinfo strtoull strcasecmp srandom jrand48 fchown mallinfo fdatasync strnlen strptime strdup sysconf pathconf posix_memalign memalign valloc __secure_getenv prctl mmap utime setresuid setresgid usleep nanosleep getdtablesize getrlimit sync_file_range posix_fadvise fallocate)
 dnl
 dnl Check to see if -lsocket is required (solaris) to make something
 dnl that uses socket() to compile; this is needed for the UUID library
misc/e4defrag.c +34 -81

181 lines not on this page · raw message