Re: [PATCH] ufs: make solaris fsck happy

From: Andrew Morton
Date: Mon Mar 01 2010 - 19:38:10 EST


On Thu, 25 Feb 2010 21:47:43 +0300
Evgeniy Dushistov <dushistov@xxxxxxx> wrote:

> --- a/fs/ufs/ufs_fs.h
> +++ b/fs/ufs/ufs_fs.h
> @@ -227,11 +227,16 @@ typedef __u16 __bitwise __fs16;
> */
> #define ufs_cbtocylno(bno) \
> ((bno) * uspi->s_nspf / uspi->s_spc)
> -#define ufs_cbtorpos(bno) \
> +#define ufs_cbtorpos(bno) \
> + ((UFS_SB(sb)->s_flags & UFS_CG_SUN) ? \
> + (((((bno) * uspi->s_nspf % uspi->s_spc) % \
> + uspi->s_nsect) * \
> + uspi->s_nrpos) / uspi->s_nsect) \
> + : \
> ((((bno) * uspi->s_nspf % uspi->s_spc / uspi->s_nsect \
> * uspi->s_trackskew + (bno) * uspi->s_nspf % uspi->s_spc \
> % uspi->s_nsect * uspi->s_interleave) % uspi->s_nsect \
> - * uspi->s_nrpos) / uspi->s_npsect)
> + * uspi->s_nrpos) / uspi->s_npsect))

yikes, that macro should be killed with a stick before it becomes
self-aware and starts breeding.

Or converted into a C function which humans have a chance of
understanding and maintaining.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/