# Some questions about ufs and ffs



## coopci (Apr 13, 2009)

Q1. According to ã€ŠThe Design and Implementation of the FreeBSD Operating Systemã€‹, ffs_read determines the physical block number by ufs_bmap, but I saw no calling to ufs_bmap in ffs_vnops.c, neither in bread.

Q2. ufs's read and write are panic, which confuses me so much.


----------



## trasz@ (Feb 5, 2010)

A1: http://fxr.watson.org/fxr/ident?i=ufs_bmap

A2: UFS consists of two parts - UFS and FFS.  This division of functionality is not there in other filesystems; that's why it confused you.  You can think of it as if UFS (sys/ufs/ufs/) was the above the FFS (sys/ufs/ffs/); UFS handling things like file paths or access permissions, and FFS handling data allocation on the disk.

Thus, VOP_READ(9) and VOP_WRITE(9) are handled by FFS, in sys/ufs/ffs/ffs_vnops.c:ffs_read() and ffs_write().  The UFS counterparts are never supposed to be called - thus the panic.


----------

