Date: Tue, 25 Aug 1998 11:33:33 -0400 (EDT) From: zhihuizhang <bf20761@binghamton.edu> To: hackers <freebsd-hackers@FreeBSD.ORG> Subject: fs_cs() macro in FFS Message-ID: <Pine.SOL.L3.93.980825112655.12734A-100000@bingsun2>
next in thread | raw e-mail | index | archive | help
The macro fs_cs() is defind in fs.h as:
/*
* N.B. This macro assumes that sizeof(struct csum) is a power of two.
*/
#define fs_cs(fs, indx) \
fs_csp[(indx) >> (fs)->fs_csshift] [(indx) & ~(fs)->fs_csmask]
Since fs_csp is defined as an array of pointers to csum structure, I can
not see why it is accessed as a two-dimension array (I just write a small
C program to test it and find it is legal to do so). I am more confused
with the shift/mask the macro uses and why the comment says the size of
csum structure should be power of two.
BTW, what does N.B. mean?
Any help is appreciated.
--------------------------------------------------
| Zhihui Zhang, http://cs.binghamton.edu/~zzhang |
| Dept. of Computer Science, SUNY at Binghamton |
--------------------------------------------------
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.SOL.L3.93.980825112655.12734A-100000>
