From: Dave Chinner Date: Wed, 4 Sep 2013 22:05:40 +0000 (+0000) Subject: xfs: kill __KERNEL__ check for debug code in allocation code X-Git-Tag: v3.2.0-alpha1~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6beba453a386fa9496588661c2f2ac2e46bc427c;p=thirdparty%2Fxfsprogs-dev.git xfs: kill __KERNEL__ check for debug code in allocation code Userspace running debug builds is relatively rare, so there's need to special case the allocation algorithm code coverage debug switch. As it is, userspace defines random numbers to 0, so invert the logic of the switch so it is effectively a no-op in userspace. This kills another couple of __KERNEL__ users. Signed-off-by: Dave Chinner Reviewed-by: Mark Tinguely Signed-off-by: Rich Johnston --- diff --git a/libxfs/xfs_alloc.c b/libxfs/xfs_alloc.c index 757b43dce..e4fb1ada0 100644 --- a/libxfs/xfs_alloc.c +++ b/libxfs/xfs_alloc.c @@ -856,7 +856,7 @@ xfs_alloc_ag_vextent_near( xfs_agblock_t ltnew; /* useful start bno of left side */ xfs_extlen_t rlen; /* length of returned extent */ int forced = 0; -#if defined(DEBUG) && defined(__KERNEL__) +#ifdef DEBUG /* * Randomly don't execute the first algorithm. */ @@ -916,8 +916,8 @@ restart: xfs_extlen_t blen=0; xfs_agblock_t bnew=0; -#if defined(DEBUG) && defined(__KERNEL__) - if (!dofirst) +#ifdef DEBUG + if (dofirst) break; #endif /*