Skip to contentSkip to conversation

e4defrag: Use get_fragment_score() for decision of whether to defrag

PATCH RESEND Superseded Kazuya Mio 1 participant 1 message Jun 15, 2011

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Kazuya Mio

author
#0 lore raw

PATCH RESEND 5/11 e4defrag: Use get_fragment_score() for decision of whether to defrag

This makes e4defrag use get_fragment_score() to calculate fragmentation score. If fragmentation score of the target file is zero or less than the destination file's one, e4defrag stops defragmentation.

The threshold that shows whether a fragment is good or not comes from "blocksize * 8 - 2048". It's the same value as filefrag.

---
 misc/Makefile.in |    4 +--
 misc/e4defrag.c  |   64 +++++++++++++++++++++++++++++++++++++++++++++++++------
 2 files changed, 60 insertions(+), 8 deletions(-)
misc/Makefile.in +2 -2
index 19eaa43..681475b 100644
@@ -196,9 +196,9 @@ e2undo.profiled: $(PROFILED_E2UNDO_OBJS) $(PROFILED_DEPLIBS)
 	$(Q) $(CC) $(ALL_LDFLAGS) -g -pg -o e2undo.profiled \
 		$(PROFILED_E2UNDO_OBJS) $(PROFILED_LIBS) $(LIBINTL)
 
-e4defrag: $(E4DEFRAG_OBJS) $(DEPLIBS)
+e4defrag: $(E4DEFRAG_OBJS) $(DEPLIBS) $(DEPLIBS_E2P)
 	$(E) "	LD $@"
-	$(Q) $(CC) $(ALL_LDFLAGS) -o e4defrag $(E4DEFRAG_OBJS) $(LIBS)
+	$(Q) $(CC) $(ALL_LDFLAGS) -o e4defrag $(E4DEFRAG_OBJS) $(LIBS) $(LIBE2P)
 
 e4defrag.profiled: $(PROFILED_E4DEFRAG_OBJS) $(PROFILED_DEPLIBS)
 	$(E) "	LD $@"
misc/e4defrag.c +58 -6

123 lines not on this page · raw message