From: Evgeniy Dushistov Date: Wed, 10 Mar 2010 23:21:55 +0000 (-0800) Subject: ufs: make solaris fsck happy X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ad25ad979a309963e580015d57e4ec7da72bb7d4;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git ufs: make solaris fsck happy Alex Viskovatoff let me know that after copying data to solaris's ufs from linux, solaris's fsck sees some errors in cylinder summary information. This is because of solaris expects find some data on another places, then curernt implementation save it. This patch fixes this issue. It is tested by me, and also Alex reported that it works for him. Signed-off-by: Evgeniy Dushistov Reported-by: Alex Viskovatoff Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/ufs/ufs_fs.h b/fs/ufs/ufs_fs.h index eb9c0f2d19e..6943ec677c0 100644 --- a/fs/ufs/ufs_fs.h +++ b/fs/ufs/ufs_fs.h @@ -233,11 +233,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)) /* * The following macros optimize certain frequently calculated