- if(time_after(now,next_gc) &&
- ! dev->isCheckpointed){
- gcResult = yaffs_BackgroundGarbageCollect(dev);
- urgency = yaffs_bg_gc_urgency(dev);
- if(urgency > 1)
- next_gc = now + HZ/50+1;
- else if(urgency > 0)
- next_gc = now + HZ/20+1;
- else
- next_gc = now + HZ * 2;
+ if(time_after(now,next_gc)){
+ if(!dev->isCheckpointed){
+ urgency = yaffs_bg_gc_urgency(dev);
+ gcResult = yaffs_BackgroundGarbageCollect(dev, urgency);
+ if(urgency > 1)
+ next_gc = now + HZ/20+1;
+ else if(urgency > 0)
+ next_gc = now + HZ/10+1;
+ else
+ next_gc = now + HZ * 2;
+ } else /*
+ * gc not running so set to next_dir_update
+ * to cut down on wake ups
+ */
+ next_gc = next_dir_update;