From owner-freebsd-fs@FreeBSD.ORG Sun Apr 26 22:19:19 2009 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EDD941065670 for ; Sun, 26 Apr 2009 22:19:19 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from gigi.cs.uoguelph.ca (gigi.cs.uoguelph.ca [131.104.94.210]) by mx1.freebsd.org (Postfix) with ESMTP id ABE728FC1B for ; Sun, 26 Apr 2009 22:19:19 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from muncher.cs.uoguelph.ca (muncher.cs.uoguelph.ca [131.104.91.102]) by gigi.cs.uoguelph.ca (8.13.1/8.13.1) with ESMTP id n3QMJIMK026504; Sun, 26 Apr 2009 18:19:18 -0400 Received: from localhost (rmacklem@localhost) by muncher.cs.uoguelph.ca (8.11.7p3+Sun/8.11.6) with ESMTP id n3QMQEP18311; Sun, 26 Apr 2009 18:26:16 -0400 (EDT) X-Authentication-Warning: muncher.cs.uoguelph.ca: rmacklem owned process doing -bs Date: Sun, 26 Apr 2009 18:26:14 -0400 (EDT) From: Rick Macklem X-X-Sender: rmacklem@muncher.cs.uoguelph.ca To: "Rick C. Petty" In-Reply-To: <20090426210343.GA51829@keira.kiwi-computer.com> Message-ID: References: <20090426210343.GA51829@keira.kiwi-computer.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Scanned-By: MIMEDefang 2.63 on 131.104.94.210 Cc: freebsd-fs@freebsd.org Subject: Re: Why do some ufs i-node fields have 2 copies? X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Apr 2009 22:19:20 -0000 On Sun, 26 Apr 2009, Rick C. Petty wrote: > > The reason is that the first set (the "copies") are what are referenced by > the ffs/ufs code. The real copies are what came from the disk (hence the > "on-disk"). Because UFS1 & UFS2 have such different dinode structures, the > copies are moved to/from the dinode structures when the inode is read to or > written from the disk. At all other times, the "copies" are used. > Righto. However some fields like i_mtime are just accessed using the DIP() and DIP_SET() macros. Are you just saying that it was easier to not bother using the macros for frequently referenced fields? (Or, to put it another way, "when support for UFS2 was added, the code would have looked really grotty if DIP() and DIP_SET() were used for frequently used fields?".) The question came up because I had proposed a patch with: DIP_SET(ip, i_modrev, DIP(ip, i_modrev) + 1); in it and it was suggested that i_modrev might be more appropriate with a "shadow copy". Since I realized I didn't know why there were "shadow copies" of some fields and not others, it lead to the original question. (This is the only place i_modrev gets manipulated by the patch.) If my interpretation of your answer is correct, I'd say that a "shadow copy" doesn't really add anything to the code? What do others think? Thanks for the reply, rick