Date: Sun, 26 Apr 2009 18:26:14 -0400 (EDT) From: Rick Macklem <rmacklem@uoguelph.ca> To: "Rick C. Petty" <rick-freebsd2008@kiwi-computer.com> Cc: freebsd-fs@freebsd.org Subject: Re: Why do some ufs i-node fields have 2 copies? Message-ID: <Pine.GSO.4.63.0904261813260.16667@muncher.cs.uoguelph.ca> In-Reply-To: <20090426210343.GA51829@keira.kiwi-computer.com> References: <Pine.GSO.4.63.0904261651460.4478@muncher.cs.uoguelph.ca> <20090426210343.GA51829@keira.kiwi-computer.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.63.0904261813260.16667>