Skip to contentSkip to conversation

consting operations

DISCUSSION Matthew Wilcox 5 participants 7 messages Jul 11, 2003 – Jul 14, 2003 VFS

lore
Share & tools
lore
#0 lore raw

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?

Signature · 3 lines
"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
#1 lore raw
Quoted 2 lines · Matthew Wilcox

Worth it? dunno. Opinions?

Someone doesn't have enough bugs to fix?

#2 lore raw
Quoted 5 lines · Andrew Morton
Quoted 2 lines · Matthew Wilcox

Worth it? dunno. Opinions?

Someone doesn't have enough bugs to fix?

Heh, it might prevent some bugs ... ISTR viro complaining about some dodgy goings-on in intermezzo where the ops were treated as non-const ...

Anyway, you can take PCI Domains off the must-fix list; they're done.

Signature · 3 lines
"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
#3 lore raw
In reply to Matthew Wilcox
Quoted 12 lines · Matthew Wilcox

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).

Quoted 6 lines

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?

why do you think that filesystem ops should be read only?

(or do you just mean for ext2/ext3/... ?)

best,
Herbert

Quoted 4 lines
Signature · 3 lines
"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
#4 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

" " == Herbert Pötzl <[email protected]> writes:

> why do you think that filesystem ops should be read only?

What possible reason could there be for making them overwritable? Sounds like a recipe for disaster...

If you want to layer stuff on top of another filesystem, then surely you can do that by methods that don't involve overwriting a globally shared table.

Cheers,
Trond
-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#5 lore raw
Quoted 6 lines · Trond Myklebust
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

" " == Herbert Pötzl <[email protected]> writes:

> why do you think that filesystem ops should be read only?

What possible reason could there be for making them overwritable? Sounds like a recipe for disaster...

hmm, yeah I guess you are right ...

I was more thinking about modular filesystems with plugins for special symlink or directory handling, but there it would be better to add another level of indirection anyway ...

Quoted 3 lines

If you want to layer stuff on top of another filesystem, then surely you can do that by methods that don't involve overwriting a globally shared table.

agreed, this would be bad design.

best,
Herbert

Quoted 2 lines

Cheers,
Trond

-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#6 lore raw
In reply to Matthew Wilcox
Quoted 6 lines · Matthew Wilcox

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?

I think it's worth it. I posted a patch to fs-devel on the 24th of June which does linux/fs.h and fixes the warnings I saw with local pointers.

Signature · 1 line
dwmw2