summaryrefslogtreecommitdiffstats
path: root/sys/fs
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2016-11-11 20:01:56 +0000
committerkib <kib@FreeBSD.org>2016-11-11 20:01:56 +0000
commite5dd6e7c333bd81d14c2e058b9a635fb2f661398 (patch)
treed29e5688c7f3f1b4e4cbe5cbbd21f1824af219d6 /sys/fs
parenteea03a787ad564deb61e963254403dca71f279e8 (diff)
downloadFreeBSD-src-e5dd6e7c333bd81d14c2e058b9a635fb2f661398.zip
FreeBSD-src-e5dd6e7c333bd81d14c2e058b9a635fb2f661398.tar.gz
MFC r308022:
Use symbolic name for the value of fully free word in pm_inusemap.
Diffstat (limited to 'sys/fs')
-rw-r--r--sys/fs/msdosfs/msdosfs_fat.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/fs/msdosfs/msdosfs_fat.c b/sys/fs/msdosfs/msdosfs_fat.c
index e5e8275..5229aea 100644
--- a/sys/fs/msdosfs/msdosfs_fat.c
+++ b/sys/fs/msdosfs/msdosfs_fat.c
@@ -60,6 +60,8 @@
#include <fs/msdosfs/fat.h>
#include <fs/msdosfs/msdosfsmount.h>
+#define FULL_RUN ((u_int)0xffffffff)
+
static int chainalloc(struct msdosfsmount *pmp, u_long start,
u_long count, u_long fillwith, u_long *retcluster,
u_long *got);
@@ -792,8 +794,8 @@ clusteralloc1(struct msdosfsmount *pmp, u_long start, u_long count,
idx = cn / N_INUSEBITS;
map = pmp->pm_inusemap[idx];
map |= (1 << (cn % N_INUSEBITS)) - 1;
- if (map != (u_int)-1) {
- cn = idx * N_INUSEBITS + ffs(map^(u_int)-1) - 1;
+ if (map != FULL_RUN) {
+ cn = idx * N_INUSEBITS + ffs(map ^ FULL_RUN) - 1;
if ((l = chainlength(pmp, cn, count)) >= count)
return (chainalloc(pmp, cn, count, fillwith, retcluster, got));
if (l > foundl) {
@@ -809,8 +811,8 @@ clusteralloc1(struct msdosfsmount *pmp, u_long start, u_long count,
idx = cn / N_INUSEBITS;
map = pmp->pm_inusemap[idx];
map |= (1 << (cn % N_INUSEBITS)) - 1;
- if (map != (u_int)-1) {
- cn = idx * N_INUSEBITS + ffs(map^(u_int)-1) - 1;
+ if (map != FULL_RUN) {
+ cn = idx * N_INUSEBITS + ffs(map ^ FULL_RUN) - 1;
if ((l = chainlength(pmp, cn, count)) >= count)
return (chainalloc(pmp, cn, count, fillwith, retcluster, got));
if (l > foundl) {
@@ -921,7 +923,7 @@ fillinusemap(pmp)
* loop further down.
*/
for (cn = 0; cn < (pmp->pm_maxcluster + N_INUSEBITS) / N_INUSEBITS; cn++)
- pmp->pm_inusemap[cn] = (u_int)-1;
+ pmp->pm_inusemap[cn] = FULL_RUN;
/*
* Figure how many free clusters are in the filesystem by ripping
OpenPOWER on IntegriCloud