Date: Fri, 11 Nov 2016 20:01:57 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r308549 - stable/10/sys/fs/msdosfs Message-ID: <201611112001.uABK1vLe013502@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Fri Nov 11 20:01:56 2016 New Revision: 308549 URL: https://svnweb.freebsd.org/changeset/base/308549 Log: MFC r308022: Use symbolic name for the value of fully free word in pm_inusemap. Modified: stable/10/sys/fs/msdosfs/msdosfs_fat.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/fs/msdosfs/msdosfs_fat.c ============================================================================== --- stable/10/sys/fs/msdosfs/msdosfs_fat.c Fri Nov 11 19:59:42 2016 (r308548) +++ stable/10/sys/fs/msdosfs/msdosfs_fat.c Fri Nov 11 20:01:56 2016 (r308549) @@ -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, 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, 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201611112001.uABK1vLe013502>