projects
/
yaffs2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
yaffs New background garbage collector and related tweaks
[yaffs2.git]
/
yaffs_guts.c
diff --git
a/yaffs_guts.c
b/yaffs_guts.c
index 65e33a644b958c09b946f8a14c80d3bcbf933a05..42e234a73f56852b4d5760733c3f9ec59e3ae076 100644
(file)
--- a/
yaffs_guts.c
+++ b/
yaffs_guts.c
@@
-3428,8
+3428,10
@@
static unsigned yaffs_FindBlockForGarbageCollection(yaffs_Device *dev,
int maxThreshold = dev->param.nChunksPerBlock/2;
threshold = background ?
(dev->gcNotDone + 2) * 2 : 0;
int maxThreshold = dev->param.nChunksPerBlock/2;
threshold = background ?
(dev->gcNotDone + 2) * 2 : 0;
- threshold = max(threshold, YAFFS_GC_PASSIVE_THRESHOLD);
- threshold = min(threshold, maxThreshold);
+ if(threshold <YAFFS_GC_PASSIVE_THRESHOLD)
+ threshold = YAFFS_GC_PASSIVE_THRESHOLD;
+ if(threshold > maxThreshold)
+ threshold = maxThreshold;
iterations = nBlocks / 16 + 1;
if (iterations > 100)
iterations = nBlocks / 16 + 1;
if (iterations > 100)