From owner-freebsd-hackers Tue Aug 25 09:12:39 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id JAA19155 for freebsd-hackers-outgoing; Tue, 25 Aug 1998 09:12:39 -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 JAA19150 for ; Tue, 25 Aug 1998 09:12:37 -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 MAA14189; Tue, 25 Aug 1998 12:11:39 -0400 (EDT) Date: Tue, 25 Aug 1998 12:11:39 -0400 (EDT) From: zhihuizhang X-Sender: bf20761@bingsun2 Reply-To: zhihuizhang To: Marius Bendiksen cc: freebsd-hackers@FreeBSD.ORG Subject: Re: fs_cs() macro in FFS In-Reply-To: <3.0.5.32.19980825175533.0091e570@mail.scancall.no> 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 On Tue, 25 Aug 1998, Marius Bendiksen wrote: > >not see why it is accessed as a two-dimension array (I just write a small > > They're accessing a part of the data which is pointed to, not a 2d array. > > index1 => array \ > index2 => => struct > > >csum structure should be power of two. > > Because they use the << operator in it, not multiplication. > Thank for your help. But I am still confused with the macro. The fs_csp is defined as: struct csum *fs_csp[MAXCSBUF == 32]. So index1 should be 0..31, while index2 has no meaning, since each pointer points to only *one* csum structure. If you have char * charpointer[32], that will make more sense (it can be treated as a 2d array). To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message