diff options
author | Konstantin Belousov <kib@FreeBSD.org> | 2022-01-04 14:43:02 +0000 |
---|---|---|
committer | Konstantin Belousov <kib@FreeBSD.org> | 2022-01-08 03:41:44 +0000 |
commit | 65990b68a2cd89a08f0350e187df1968b16f4255 (patch) | |
tree | 2a7c3f8ddc0a23c911aa91a697c67f1a83c61bf9 /usr.sbin | |
parent | aec97963cd03f10e04083537ed449a84a5e42f87 (diff) | |
download | src-65990b68a2cd89a08f0350e187df1968b16f4255.tar.gz src-65990b68a2cd89a08f0350e187df1968b16f4255.zip |
msdosfs: clusterfree() is used only in error handling cases
Change its return type to void, because its result is ignored in both
call sites. Remove oldcnp argument as well, it is NULL always.
Suggested and reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D33721
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/makefs/msdos/msdosfs_fat.c | 13 | ||||
-rw-r--r-- | usr.sbin/makefs/msdos/msdosfs_vnops.c | 2 |
2 files changed, 6 insertions, 9 deletions
diff --git a/usr.sbin/makefs/msdos/msdosfs_fat.c b/usr.sbin/makefs/msdos/msdosfs_fat.c index b5700d8c7d1d..0081e2d2d38c 100644 --- a/usr.sbin/makefs/msdos/msdosfs_fat.c +++ b/usr.sbin/makefs/msdos/msdosfs_fat.c @@ -408,24 +408,21 @@ usemap_free(struct msdosfsmount *pmp, u_long cn) pmp->pm_inusemap[cn / N_INUSEBITS] &= ~(1U << (cn % N_INUSEBITS)); } -int -clusterfree(struct msdosfsmount *pmp, u_long cluster, u_long *oldcnp) +void +clusterfree(struct msdosfsmount *pmp, u_long cluster) { int error; u_long oldcn; error = fatentry(FAT_GET_AND_SET, pmp, cluster, &oldcn, MSDOSFSFREE); - if (error) - return (error); + if (error != 0) + return; /* * If the cluster was successfully marked free, then update * the count of free clusters, and turn off the "allocated" * bit in the "in use" cluster bit map. */ usemap_free(pmp, cluster); - if (oldcnp) - *oldcnp = oldcn; - return (0); } /* @@ -1024,7 +1021,7 @@ m_extendfile(struct denode *dep, u_long count, struct m_buf **bpp, u_long *ncp, dep->de_fc[FC_LASTFC].fc_fsrcn, 0, cn); if (error) { - clusterfree(pmp, cn, NULL); + clusterfree(pmp, cn); return (error); } frcn = dep->de_fc[FC_LASTFC].fc_frcn + 1; diff --git a/usr.sbin/makefs/msdos/msdosfs_vnops.c b/usr.sbin/makefs/msdos/msdosfs_vnops.c index 7e927b4b99c7..ed33856716f1 100644 --- a/usr.sbin/makefs/msdos/msdosfs_vnops.c +++ b/usr.sbin/makefs/msdos/msdosfs_vnops.c @@ -636,7 +636,7 @@ msdosfs_mkdire(const char *path, struct denode *pdep, fsnode *node) { return dep; bad: - clusterfree(pmp, newcluster, NULL); + clusterfree(pmp, newcluster); bad2: errno = error; return NULL; |