[ANNOUNCE] Make fs operations const
From: Matthew Wilcox (willy_at_debian.org)
Date: 10/31/03
- Previous message: Bartlomiej Zolnierkiewicz: "Re: ide-scsi is working [was: Post-halloween doc updates.]"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 31 Oct 2003 13:49:45 +0000 To: linux-fsdevel@vger.kernel.org
The 54k patch at http://ftp.linux.org.uk/pub/linux/willy/patches/fs-const.diff
makes many file_operations, dentry_operations, address_space_operations,
inode_operations, super_operations and dquot_operations const.
This was inspired by intermezzo doing something naughty which the
compiler didn't know to warn about. By making these pointers point to
const structs, the compiler knows we shouldn't be doing that and will
issue a warning.
As a bonus for the embedded people, this enables us to move more of the
kernel into ROMmable sections. I've only done this for ext2 and a few
well-known *_operations in this patch, but it could be done to many
more filesystems. It only saves a few hundred bytes per filesystem,
but it all adds up.
-- "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 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
- Previous message: Bartlomiej Zolnierkiewicz: "Re: ide-scsi is working [was: Post-halloween doc updates.]"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
- Re: [2.6 patch] drivers/net/smc-mca.c: cleanups
... The compiler does use the const modifier on a static object to optimise ...
int bar; ... send the line "unsubscribe linux-kernel" in ... (Linux-Kernel) - Re: Writing single bits to a file
... The 'const' keyword provides the same kind of benefit that prototypes ... enabling
the compiler to warn you if it detects the fact that you ... I had not gone and more correctly
fixed up the precedence heirarchy (unary ... I like to implement scripting languages
for breakfast ... (comp.lang.c) - Re: const
... > const modifiers, ... willing to remove the const'ness with a cast,
... I don't know how good a cross-file compiler could be - it would have to be ...
it's a guarantee by the programmer. ... (comp.programming) - Re: Index a #define string
... In this case, i wouldn't use an array myself but a const char * const, but ...
should one make it of static storage? ... If they were on the stack, where do you
think their values ... You mean that the compiler optimises it out. ... (comp.lang.cpp) - Re: How to define a const and initialize it?
... > do the same work as const int MYCONST will do.... ... But the thing is
that macro substitution takes ... C++ compiler isn't even aware of its existence.
... This Item might better be called "prefer the compiler to the preprocessor," because
#define is often ... (alt.comp.lang.learn.c-cpp)