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
This commit is contained in:
parent
3f850e6a25
commit
54cf919857
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=227817
@ -1036,8 +1036,10 @@ mbnambuf_write(struct mbnambuf *nbp, char *name, int id)
|
||||
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, char *name, int id)
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -503,7 +503,9 @@ fatentry(function, pmp, cn, oldcontents, newcontents)
|
||||
* 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, newcontents)
|
||||
* 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);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
@ -555,7 +555,9 @@ mountmsdosfs(struct vnode *devvp, struct mount *mp)
|
||||
|| 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 mount *mp)
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user