Skip to content

Commit

Permalink
ufs: make solaris fsck happy
Browse files Browse the repository at this point in the history
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 <dushistov@mail.ru>
Reported-by: Alex Viskovatoff <viskovatoff@imap.cc>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Evgeniy Dushistov authored and Linus Torvalds committed Mar 12, 2010
1 parent b3a0fd4 commit ad25ad9
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions fs/ufs/ufs_fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ad25ad9

Please sign in to comment.