<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">
From: OGAWA Hirofumi &lt;hirofumi@mail.parknet.co.jp&gt;

Signed-off-by: OGAWA Hirofumi &lt;hirofumi@mail.parknet.co.jp&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
---

 25-akpm/fs/fat/cache.c |   35 +++++------------------------------
 1 files changed, 5 insertions(+), 30 deletions(-)

diff -puN fs/fat/cache.c~fat-remove-debug_pr-6-6 fs/fat/cache.c
--- 25/fs/fat/cache.c~fat-remove-debug_pr-6-6	2004-09-11 17:07:46.100932632 -0700
+++ 25-akpm/fs/fat/cache.c	2004-09-11 17:07:46.105931872 -0700
@@ -12,12 +12,6 @@
 #include &lt;linux/msdos_fs.h&gt;
 #include &lt;linux/buffer_head.h&gt;
 
-#if 0
-#define debug_pr(fmt, args...)	printk(fmt, ##args)
-#else
-#define debug_pr(fmt, args...)
-#endif
-
 /* this must be &gt; 0. */
 #define FAT_MAX_CACHE	8
 
@@ -96,18 +90,14 @@ static int fat_cache_lookup(struct inode
 	int offset = -1;
 
 	spin_lock(&amp;MSDOS_I(inode)-&gt;cache_lru_lock);
-	debug_pr("FAT: %s, fclus %d", __FUNCTION__, fclus);
 	list_for_each_entry(p, &amp;MSDOS_I(inode)-&gt;cache_lru, cache_list) {
+		/* Find the cache of "fclus" or nearest cache. */
 		if (p-&gt;fcluster &lt;= fclus &amp;&amp; hit-&gt;fcluster &lt; p-&gt;fcluster) {
 			hit = p;
-			debug_pr(", fclus %d, dclus %d, cont %d",
-				 p-&gt;fcluster, p-&gt;dcluster, p-&gt;nr_contig);
 			if ((hit-&gt;fcluster + hit-&gt;nr_contig) &lt; fclus) {
 				offset = hit-&gt;nr_contig;
-				debug_pr(" (off %d, hit)", offset);
 			} else {
 				offset = fclus - hit-&gt;fcluster;
-				debug_pr(" (off %d, full hit)", offset);
 				break;
 			}
 		}
@@ -122,7 +112,6 @@ static int fat_cache_lookup(struct inode
 		*cached_fclus = cid-&gt;fcluster + offset;
 		*cached_dclus = cid-&gt;dcluster + offset;
 	}
-	debug_pr("\n");
 	spin_unlock(&amp;MSDOS_I(inode)-&gt;cache_lru_lock);
 
 	return offset;
@@ -131,31 +120,24 @@ static int fat_cache_lookup(struct inode
 static struct fat_cache *fat_cache_merge(struct inode *inode,
 					 struct fat_cache_id *new)
 {
-	struct fat_cache *p, *hit = NULL;
+	struct fat_cache *p;
 
 	list_for_each_entry(p, &amp;MSDOS_I(inode)-&gt;cache_lru, cache_list) {
+		/* Find the same part as "new" in cluster-chain. */
 		if (p-&gt;fcluster == new-&gt;fcluster) {
 			BUG_ON(p-&gt;dcluster != new-&gt;dcluster);
-			debug_pr("FAT: %s: merged fclus %d, dclus %d, "
-				 "cur cont %d =&gt; new cont %d\n", __FUNCTION__,
-				 p-&gt;fcluster, p-&gt;dcluster, p-&gt;nr_contig,
-				 new-&gt;nr_contig);
 			if (new-&gt;nr_contig &gt; p-&gt;nr_contig)
 				p-&gt;nr_contig = new-&gt;nr_contig;
-			hit = p;
-			break;
+			return p;
 		}
 	}
-	return hit;
+	return NULL;
 }
 
 static void fat_cache_add(struct inode *inode, struct fat_cache_id *new)
 {
 	struct fat_cache *cache, *tmp;
 
-	debug_pr("FAT: %s: fclus %d, dclus %d, cont %d\n", __FUNCTION__,
-		 new-&gt;fcluster, new-&gt;dcluster, new-&gt;nr_contig);
-
 	if (new-&gt;fcluster == -1) /* dummy cache */
 		return;
 
@@ -191,12 +173,6 @@ static void fat_cache_add(struct inode *
 out_update_lru:
 	fat_cache_update_lru(inode, cache);
 out:
-	debug_pr("FAT: ");
-	list_for_each_entry(cache, &amp;MSDOS_I(inode)-&gt;cache_lru, cache_list) {
-		debug_pr("(fclus %d, dclus %d, cont %d), ",
-		       cache-&gt;fcluster, cache-&gt;dcluster, cache-&gt;nr_contig);
-	}
-	debug_pr("\n");
 	spin_unlock(&amp;MSDOS_I(inode)-&gt;cache_lru_lock);
 }
 
@@ -219,7 +195,6 @@ static void __fat_cache_inval_inode(stru
 	i-&gt;cache_valid_id++;
 	if (i-&gt;cache_valid_id == FAT_CACHE_VALID)
 		i-&gt;cache_valid_id++;
-	debug_pr("FAT: %s\n", __FUNCTION__);
 }
 
 void fat_cache_inval_inode(struct inode *inode)
_
</pre></body></html>