svn commit: r227817 - head/sys/fs/msdosfs

Konstantin Belousov kib at FreeBSD.org
Tue Nov 22 13:30:37 UTC 2011


Author: kib
Date: Tue Nov 22 13:30:36 2011
New Revision: 227817
URL: http://svn.freebsd.org/changeset/base/227817

Log:
  Put all the messages from msdosfs under the MSDOSFS_DEBUG ifdef.
  They are confusing to user, and not informative for general consumption.
  
  MFC after:	1 week

Modified:
  head/sys/fs/msdosfs/msdosfs_conv.c
  head/sys/fs/msdosfs/msdosfs_denode.c
  head/sys/fs/msdosfs/msdosfs_fat.c
  head/sys/fs/msdosfs/msdosfs_lookup.c
  head/sys/fs/msdosfs/msdosfs_vfsops.c

Modified: head/sys/fs/msdosfs/msdosfs_conv.c
==============================================================================
--- head/sys/fs/msdosfs/msdosfs_conv.c	Tue Nov 22 13:27:53 2011	(r227816)
+++ head/sys/fs/msdosfs/msdosfs_conv.c	Tue Nov 22 13:30:36 2011	(r227817)
@@ -1036,8 +1036,10 @@ mbnambuf_write(struct mbnambuf *nbp, cha
 	size_t count, newlen;
 
 	if (nbp->nb_len != 0 && id != nbp->nb_last_id - 1) {
+#ifdef MSDOSFS_DEBUG
 		printf("msdosfs: non-decreasing id: id %d, last id %d\n",
 		    id, nbp->nb_last_id);
+#endif
 		return;
 	}
 
@@ -1046,7 +1048,9 @@ mbnambuf_write(struct mbnambuf *nbp, cha
 	count = strlen(name);
 	newlen = nbp->nb_len + count;
 	if (newlen > WIN_MAXLEN || newlen > MAXNAMLEN) {
+#ifdef MSDOSFS_DEBUG
 		printf("msdosfs: file name length %zu too large\n", newlen);
+#endif
 		return;
 	}
 

Modified: head/sys/fs/msdosfs/msdosfs_denode.c
==============================================================================
--- head/sys/fs/msdosfs/msdosfs_denode.c	Tue Nov 22 13:27:53 2011	(r227816)
+++ head/sys/fs/msdosfs/msdosfs_denode.c	Tue Nov 22 13:30:36 2011	(r227817)
@@ -263,8 +263,10 @@ deget(pmp, dirclust, diroffset, depp)
 		 * instead of what is written in directory entry.
 		 */
 		if (diroffset == 0 && ldep->de_StartCluster != dirclust) {
+#ifdef MSDOSFS_DEBUG
 			printf("deget(): \".\" entry at clust %lu != %lu\n",
 			    dirclust, ldep->de_StartCluster);
+#endif
 			ldep->de_StartCluster = dirclust;
 		}
 
@@ -274,8 +276,11 @@ deget(pmp, dirclust, diroffset, depp)
 			if (error == E2BIG) {
 				ldep->de_FileSize = de_cn2off(pmp, size);
 				error = 0;
-			} else
+			} else {
+#ifdef MSDOSFS_DEBUG
 				printf("deget(): pcbmap returned %d\n", error);
+#endif
+			}
 		}
 	} else
 		nvp->v_type = VREG;
@@ -351,8 +356,10 @@ detrunc(dep, length, flags, cred, td)
 	 * directory's life.
 	 */
 	if ((DETOV(dep)->v_vflag & VV_ROOT) && !FAT32(pmp)) {
+#ifdef MSDOSFS_DEBUG
 		printf("detrunc(): can't truncate root directory, clust %ld, offset %ld\n",
 		    dep->de_dirclust, dep->de_diroffset);
+#endif
 		return (EINVAL);
 	}
 

Modified: head/sys/fs/msdosfs/msdosfs_fat.c
==============================================================================
--- head/sys/fs/msdosfs/msdosfs_fat.c	Tue Nov 22 13:27:53 2011	(r227816)
+++ head/sys/fs/msdosfs/msdosfs_fat.c	Tue Nov 22 13:30:36 2011	(r227817)
@@ -503,7 +503,9 @@ fatentry(function, pmp, cn, oldcontents,
 	 * Be sure they asked us to do something.
 	 */
 	if ((function & (FAT_SET | FAT_GET)) == 0) {
+#ifdef MSDOSFS_DEBUG
 		printf("fatentry(): function code doesn't specify get or set\n");
+#endif
 		return (EINVAL);
 	}
 
@@ -512,7 +514,9 @@ fatentry(function, pmp, cn, oldcontents,
 	 * where to put it, give them an error.
 	 */
 	if ((function & FAT_GET) && oldcontents == NULL) {
+#ifdef MSDOSFS_DEBUG
 		printf("fatentry(): get function with no place to put result\n");
+#endif
 		return (EINVAL);
 	}
 #endif
@@ -997,7 +1001,9 @@ extendfile(dep, count, bpp, ncp, flags)
 	 */
 	if (dep->de_StartCluster == MSDOSFSROOT
 	    && (dep->de_Attributes & ATTR_DIRECTORY)) {
+#ifdef MSDOSFS_DEBUG
 		printf("extendfile(): attempt to extend root directory\n");
+#endif
 		return (ENOSPC);
 	}
 

Modified: head/sys/fs/msdosfs/msdosfs_lookup.c
==============================================================================
--- head/sys/fs/msdosfs/msdosfs_lookup.c	Tue Nov 22 13:27:53 2011	(r227816)
+++ head/sys/fs/msdosfs/msdosfs_lookup.c	Tue Nov 22 13:30:36 2011	(r227817)
@@ -902,8 +902,10 @@ doscheckpath(source, target)
 out:;
 	if (bp)
 		brelse(bp);
+#ifdef MSDOSFS_DEBUG
 	if (error == ENOTDIR)
 		printf("doscheckpath(): .. not a directory?\n");
+#endif
 	if (dep != NULL)
 		vput(DETOV(dep));
 	return (error);

Modified: head/sys/fs/msdosfs/msdosfs_vfsops.c
==============================================================================
--- head/sys/fs/msdosfs/msdosfs_vfsops.c	Tue Nov 22 13:27:53 2011	(r227816)
+++ head/sys/fs/msdosfs/msdosfs_vfsops.c	Tue Nov 22 13:30:36 2011	(r227817)
@@ -555,7 +555,9 @@ mountmsdosfs(struct vnode *devvp, struct
 		    || pmp->pm_FATsecs
 		    || getushort(b710->bpbFSVers)) {
 			error = EINVAL;
+#ifdef MSDOSFS_DEBUG
 			printf("mountmsdosfs(): bad FAT32 filesystem\n");
+#endif
 			goto error_exit;
 		}
 		pmp->pm_fatmask = FAT32_MASK;
@@ -633,8 +635,10 @@ mountmsdosfs(struct vnode *devvp, struct
 
 	clusters = (pmp->pm_fatsize / pmp->pm_fatmult) * pmp->pm_fatdiv;
 	if (pmp->pm_maxcluster >= clusters) {
+#ifdef MSDOSFS_DEBUG
 		printf("Warning: number of clusters (%ld) exceeds FAT "
 		    "capacity (%ld)\n", pmp->pm_maxcluster + 1, clusters);
+#endif
 		pmp->pm_maxcluster = clusters - 1;
 	}
 


More information about the svn-src-head mailing list