From: Benjamin Kaduk Date: Wed, 14 Jan 2015 20:32:47 +0000 (-0500) Subject: vol: use ffs from opr instead of inline X-Git-Tag: upstream/1.8.0_pre1^2~330 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=6f1979c83a4357c82be2e011b79d993b21e545f9;p=packages%2Fo%2Fopenafs.git vol: use ffs from opr instead of inline volume.c defined its own ffs() macro if AFS_HAVE_FFS was not defined. Now that ffs() is in opr, just use it from there always. Change-Id: Ia80a439924541be236b3221b9480143b511c885a Reviewed-on: http://gerrit.openafs.org/11674 Reviewed-by: Benjamin Kaduk Tested-by: BuildBot --- diff --git a/src/vol/volume.c b/src/vol/volume.c index 9e8db4a17..a7c5d7521 100644 --- a/src/vol/volume.c +++ b/src/vol/volume.c @@ -36,6 +36,7 @@ #else # include #endif +#include #include @@ -237,24 +238,6 @@ VolumeHashTable_t VolumeHashTable = { static void VInitVolumeHash(void); -#ifndef AFS_HAVE_FFS -/* This macro is used where an ffs() call does not exist. Was in util/ffs.c */ -ffs(x) -{ - afs_int32 ffs_i; - afs_int32 ffs_tmp = x; - if (ffs_tmp == 0) - return (-1); - else - for (ffs_i = 1;; ffs_i++) { - if (ffs_tmp & 1) - return (ffs_i); - else - ffs_tmp >>= 1; - } -} -#endif /* !AFS_HAVE_FFS */ - #ifdef AFS_PTHREAD_ENV /** * disk partition queue element @@ -6435,7 +6418,7 @@ VAllocBitmapEntry_r(Error * ec, Volume * vp, index->bitmapOffset = (afs_uint32) (bp - index->bitmap); while (*bp == 0xff) bp++; - o = ffs(~*bp) - 1; /* ffs is documented in BSTRING(3) */ + o = opr_ffs(~*bp) - 1; *bp |= (1 << o); ret = ((bp - index->bitmap) * 8 + o); #ifdef AFS_DEMAND_ATTACH_FS