[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
> >I guess UCB guys put fsbtodb value into superblock to handle
> >variable hardware sector size. But in current implementation
> >some code uses fsbtodb() (ffs_alloccg() etc) and others use
> >btodb() (ffs_alloc() etc) so it's quite inconsistent.
> btodb() translates bytes to disk blocks (in DEV_BSIZE units).
> That's a different functionality, but of course needs to be
> aligned with the other block translations like fsbtodb().
> One more todo if you'd want to change the disk driver API from
> using DEV_BSIZE units to something else.
You changed fsbtodb() not to use fs_fsbtodb, but I'd prefer
to replace btodb() to ffs_btodb() defined like
#define ffs_btodb(fs, x) ((x) >> ((fs)->fs_fshift - (fs)->fs_fsbtodb))
if FFS disk block size is variable.
It depends on what "FFS disk block size stored in superblock" means
and it's independent from raw I/O size in kernel.
Why do you leave fsbtodb() to use fs_fsbtodb for userland?
To have less changes?
Main Index |
Thread Index |