From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matthew Wilcox Subject: consting operations Date: Fri, 11 Jul 2003 23:19:01 +0100 Sender: linux-fsdevel-owner@vger.kernel.org Message-ID: <20030711221901.GO20424@parcelfarce.linux.theplanet.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from parcelfarce.linux.theplanet.co.uk ([195.92.249.252]:39362 "EHLO www.linux.org.uk") by vger.kernel.org with ESMTP id S266870AbTGKWET (ORCPT ); Fri, 11 Jul 2003 18:04:19 -0400 Received: from willy by www.linux.org.uk with local (Exim 4.14) id 19b6EH-0000z9-PC for linux-fsdevel@vger.kernel.org; Fri, 11 Jul 2003 23:19:01 +0100 To: linux-fsdevel@vger.kernel.org Content-Disposition: inline List-Id: linux-fsdevel.vger.kernel.org I was having an argument with Jeff Garzik about a completely unrelated part of the kernel. He wants to have an setup routine that initialises various members of an ->*_ops vector to some default methods. I wanted to retaliate with "But that will be in read-only storage, so you can't do that", but I realised that wasn't the case. Which got me to wondering why our filesystem ops vectors aren't in read-only storage. As a test, I did ext2 and moved 764 bytes from .data to .text -- not too significant, but not bad either (4 bytes disappeared somewhere. let's call it a rounding error). Of course, just converting ext2 yields all kinds of warnings from the compiler about discarding qualifiers. We need to change linux/fs.h to make all those things const .... and that splatters out to about 20 places we need to let gcc know that yes, this local pointer really is const. Worth it? dunno. Opinions? -- "It's not Hollywood. War is real, war is primarily not about defeat or victory, it is about death. I've seen thousands and thousands of dead bodies. Do you think I want to have an academic debate on this subject?" -- Robert Fisk