From owner-freebsd-hackers Tue Aug 25 08:34:30 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id IAA14059 for freebsd-hackers-outgoing; Tue, 25 Aug 1998 08:34:30 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from bingsun2.cc.binghamton.edu (bingsun2.cc.binghamton.edu [128.226.1.6]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id IAA14044 for ; Tue, 25 Aug 1998 08:34:24 -0700 (PDT) (envelope-from bf20761@binghamton.edu) Received: from localhost (bf20761@localhost) by bingsun2.cc.binghamton.edu (8.8.7/8.6.9) with SMTP id LAA13014 for ; Tue, 25 Aug 1998 11:33:33 -0400 (EDT) Date: Tue, 25 Aug 1998 11:33:33 -0400 (EDT) From: zhihuizhang X-Sender: bf20761@bingsun2 Reply-To: zhihuizhang To: hackers Subject: fs_cs() macro in FFS Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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