* buffer cache
@ 2003-09-13 8:51 vadiraj c s
2003-09-13 10:27 ` Jan Hudec
0 siblings, 1 reply; 15+ messages in thread
From: vadiraj c s @ 2003-09-13 8:51 UTC (permalink / raw)
To: linux-fsdevel
hello all,
This is third time i'm posting my request. I'm working on
filesystem, I need to compile my code. I included linux/fs.h
header file, none of the function declared in it gets compiled, I
mean I get an error saying Undefined reference, the functions are
inline functions.
1.) Is there any specific compilation method for such functions?
2.) How do I test my code before I register to VFS?
vadiraj
deeprootlinux
___________________________________________________
Catering meets Camera; Tanya Weds Sahil.
Rediff Matchmaker strikes another interesting match
Visit http://matchmaker.rediff.com?1
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: buffer cache
2003-09-13 8:51 buffer cache vadiraj c s
@ 2003-09-13 10:27 ` Jan Hudec
2003-09-13 13:14 ` Matthew Wilcox
2003-09-13 17:25 ` Bryan Henderson
0 siblings, 2 replies; 15+ messages in thread
From: Jan Hudec @ 2003-09-13 10:27 UTC (permalink / raw)
To: vadiraj c s; +Cc: linux-fsdevel
On Sat, Sep 13, 2003 at 08:51:43 -0000, vadiraj c s wrote:
> hello all,
>
>
> This is third time i'm posting my request. I'm working on
> filesystem, I need to compile my code. I included linux/fs.h
> header file, none of the function declared in it gets compiled, I
> mean I get an error saying Undefined reference, the functions are
> inline functions.
Sanity-check: Do you compile with the -O2 option? Kernel stuff must be
compiled with optimization due to this and many other reasons.
> 1.) Is there any specific compilation method for such functions?
> 2.) How do I test my code before I register to VFS?
>
> vadiraj
> deeprootlinux
>
> ___________________________________________________
> Catering meets Camera; Tanya Weds Sahil.
> Rediff Matchmaker strikes another interesting match
> Visit http://matchmaker.rediff.com?1
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
-------------------------------------------------------------------------------
Jan 'Bulb' Hudec <bulb@ucw.cz>
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: buffer cache
2003-09-13 10:27 ` Jan Hudec
@ 2003-09-13 13:14 ` Matthew Wilcox
2003-09-13 17:25 ` Bryan Henderson
1 sibling, 0 replies; 15+ messages in thread
From: Matthew Wilcox @ 2003-09-13 13:14 UTC (permalink / raw)
To: Jan Hudec; +Cc: vadiraj c s, linux-fsdevel
On Sat, Sep 13, 2003 at 12:27:21PM +0200, Jan Hudec wrote:
> On Sat, Sep 13, 2003 at 08:51:43 -0000, vadiraj c s wrote:
> > This is third time i'm posting my request. I'm working on
> > filesystem, I need to compile my code. I included linux/fs.h
> > header file, none of the function declared in it gets compiled, I
> > mean I get an error saying Undefined reference, the functions are
> > inline functions.
>
> Sanity-check: Do you compile with the -O2 option? Kernel stuff must be
> compiled with optimization due to this and many other reasons.
he's trying to get it to compile in userspace. there's basically no
way to do this; just compile it as a module.
--
"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
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: buffer cache
2003-09-13 10:27 ` Jan Hudec
2003-09-13 13:14 ` Matthew Wilcox
@ 2003-09-13 17:25 ` Bryan Henderson
2003-09-13 17:28 ` Jan Hudec
1 sibling, 1 reply; 15+ messages in thread
From: Bryan Henderson @ 2003-09-13 17:25 UTC (permalink / raw)
To: Jan Hudec; +Cc: linux-fsdevel, vadiraj c s
>>I get an error saying Undefined reference, the functions are
>>inline functions.
>
>Kernel stuff must be compiled with optimization due to this and ...
Are you sure? I compile a filesystem driver module with no optimization
all the time. Without optimization, the functions that are supposed to be
inline become out-of-line, but it still compiles. On older versions of
Linux, I did have to use -O because there were some "extern inline"
functions, but not now. This is a 2.4.20ish kernel; maybe there are extern
inlines in newer kernel code?
But here, we're apparently talking about the link editor (ld) "undefined
reference" error, which means it isn't a question of compiling kernel code
at all - he's trying to create an executable. That still wouldn't cause a
problem with inline functions, but I suspect the problem is really with
other (external) functions with similar names that the inline functions
call.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: buffer cache
2003-09-13 17:25 ` Bryan Henderson
@ 2003-09-13 17:28 ` Jan Hudec
2003-09-14 9:32 ` David Woodhouse
0 siblings, 1 reply; 15+ messages in thread
From: Jan Hudec @ 2003-09-13 17:28 UTC (permalink / raw)
To: Bryan Henderson; +Cc: linux-fsdevel, vadiraj c s
On Sat, Sep 13, 2003 at 11:25:29 -0600, Bryan Henderson wrote:
>
>
>
>
> >>I get an error saying Undefined reference, the functions are
> >>inline functions.
> >
> >Kernel stuff must be compiled with optimization due to this and ...
>
> Are you sure? I compile a filesystem driver module with no optimization
> all the time. Without optimization, the functions that are supposed to be
> inline become out-of-line, but it still compiles. On older versions of
> Linux, I did have to use -O because there were some "extern inline"
> functions, but not now. This is a 2.4.20ish kernel; maybe there are extern
> inlines in newer kernel code?
>
> But here, we're apparently talking about the link editor (ld) "undefined
> reference" error, which means it isn't a question of compiling kernel code
> at all - he's trying to create an executable. That still wouldn't cause a
> problem with inline functions, but I suspect the problem is really with
> other (external) functions with similar names that the inline functions
> call.
... you are right. The error looks like he is trying to do something
wrong (binary instead of relocable object).
-------------------------------------------------------------------------------
Jan 'Bulb' Hudec <bulb@ucw.cz>
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: buffer cache
2003-09-13 17:28 ` Jan Hudec
@ 2003-09-14 9:32 ` David Woodhouse
2003-09-14 10:03 ` Jan Hudec
0 siblings, 1 reply; 15+ messages in thread
From: David Woodhouse @ 2003-09-14 9:32 UTC (permalink / raw)
To: Jan Hudec; +Cc: Bryan Henderson, linux-fsdevel, vadiraj c s
On Sat, 2003-09-13 at 19:28 +0200, Jan Hudec wrote:
> ... you are right. The error looks like he is trying to do something
> wrong (binary instead of relocable object).
Probably as a result of hacking up his own broken makefiles instead of
make -C $KERNELDIR SUBDIRS=`pwd` modules
--
dwmw2
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: buffer cache
2003-09-14 9:32 ` David Woodhouse
@ 2003-09-14 10:03 ` Jan Hudec
2003-09-14 10:37 ` David Woodhouse
0 siblings, 1 reply; 15+ messages in thread
From: Jan Hudec @ 2003-09-14 10:03 UTC (permalink / raw)
To: linux-fsdevel
On Sun, Sep 14, 2003 at 10:32:45 +0100, David Woodhouse wrote:
> On Sat, 2003-09-13 at 19:28 +0200, Jan Hudec wrote:
> > ... you are right. The error looks like he is trying to do something
> > wrong (binary instead of relocable object).
>
> Probably as a result of hacking up his own broken makefiles instead of
> make -C $KERNELDIR SUBDIRS=`pwd` modules
Well, I wrote a module to compile off-tree. The correct command to link
a module is:
ld -r -o <modname>.o <objects...>
-------------------------------------------------------------------------------
Jan 'Bulb' Hudec <bulb@ucw.cz>
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: buffer cache
2003-09-14 10:03 ` Jan Hudec
@ 2003-09-14 10:37 ` David Woodhouse
2003-09-14 11:19 ` Jan Hudec
2003-09-15 16:18 ` Bryan Henderson
0 siblings, 2 replies; 15+ messages in thread
From: David Woodhouse @ 2003-09-14 10:37 UTC (permalink / raw)
To: Jan Hudec; +Cc: linux-fsdevel
Please don't drop me from the recipients when replying; it's very rude.
On Sun, 2003-09-14 at 12:03 +0200, Jan Hudec wrote:
> > Probably as a result of hacking up his own broken makefiles instead of
> > make -C $KERNELDIR SUBDIRS=`pwd` modules
>
> Well, I wrote a module to compile off-tree. The correct command to link
> a module is:
> ld -r -o <modname>.o <objects...>
No, that's not always correct. It's completely wrong for 2.6, of course
-- and even for 2.4, if building modules for a 64-bit kernel, you may
find your userspace is 32-bit by default and you need something like
-melf64_sparc on the linker command line. The kernel makefiles get this
right. Use them.
The kernel is also free to screw with its own internal ABI all it likes
-- with cflags affecting global register usage, etc. You must do as it
does in the kernel you happen to be building -- which basically means
you must use the kernel build system.
The correct way to build modules out of the kernel tree is to use the
kernel makefiles and override SUBDIRS to point at your own directory;
it's been that way since 2.0 if not earlier.
--
dwmw2
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: buffer cache
2003-09-14 10:37 ` David Woodhouse
@ 2003-09-14 11:19 ` Jan Hudec
2003-09-15 16:18 ` Bryan Henderson
1 sibling, 0 replies; 15+ messages in thread
From: Jan Hudec @ 2003-09-14 11:19 UTC (permalink / raw)
To: David Woodhouse; +Cc: linux-fsdevel
On Sun, Sep 14, 2003 at 11:37:22 +0100, David Woodhouse wrote:
> Please don't drop me from the recipients when replying; it's very rude.
>
> On Sun, 2003-09-14 at 12:03 +0200, Jan Hudec wrote:
> > > Probably as a result of hacking up his own broken makefiles instead of
> > > make -C $KERNELDIR SUBDIRS=`pwd` modules
> >
> > Well, I wrote a module to compile off-tree. The correct command to link
> > a module is:
> > ld -r -o <modname>.o <objects...>
>
> No, that's not always correct. It's completely wrong for 2.6, of course
> -- and even for 2.4, if building modules for a 64-bit kernel, you may
> find your userspace is 32-bit by default and you need something like
> -melf64_sparc on the linker command line. The kernel makefiles get this
> right. Use them.
>
> The kernel is also free to screw with its own internal ABI all it likes
> -- with cflags affecting global register usage, etc. You must do as it
> does in the kernel you happen to be building -- which basically means
Which I basicaly do becasue I ask kernel to give me the flags it uses.
> you must use the kernel build system.
That's what the script target is for.
> The correct way to build modules out of the kernel tree is to use the
> kernel makefiles and override SUBDIRS to point at your own directory;
> it's been that way since 2.0 if not earlier.
Well... I can't imagine compiling a project with various objects spead
all over the place (I have a driver, that has various pieces common with
various other programs) using the kernel build system. So it reduces back
to geting right flags from it.
-------------------------------------------------------------------------------
Jan 'Bulb' Hudec <bulb@ucw.cz>
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: buffer cache
2003-09-14 10:37 ` David Woodhouse
2003-09-14 11:19 ` Jan Hudec
@ 2003-09-15 16:18 ` Bryan Henderson
2003-09-15 16:35 ` Greg KH
1 sibling, 1 reply; 15+ messages in thread
From: Bryan Henderson @ 2003-09-15 16:18 UTC (permalink / raw)
To: David Woodhouse; +Cc: Jan Hudec, linux-fsdevel
>The correct way to build modules out of the kernel tree is to use the
>kernel makefiles and override SUBDIRS to point at your own directory;
That philosophy seems to fly in the face of the very modularity that makes
modules great. If you accept the idea that your module source code should
be arranged the same way as Linux kernel source code and built the same
way, you might as well just maintain your code as a patch to the Linux
source tree.
But if you accept the idea that a module writer can write his own make
file, then he is free to organize the source code in original ways, use a
language other than C, and share code or structure with non-Linux
applications (e.g. device drivers for the same device in other OSes).
I of course use the include/ directory from the Linux source tree to
compile my out-of-tree modules, but I would need more convincing to use
any other part of the tree.
I know there are things that can change in Linux that would make an
independent module build no longer correct, but there has to be a better
way to deal with that than by having Linux supply the make files.
--
Bryan Henderson IBM Almaden Research Center
San Jose CA Filesystems
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: buffer cache
2003-09-15 16:18 ` Bryan Henderson
@ 2003-09-15 16:35 ` Greg KH
2003-09-15 22:41 ` Bryan Henderson
0 siblings, 1 reply; 15+ messages in thread
From: Greg KH @ 2003-09-15 16:35 UTC (permalink / raw)
To: Bryan Henderson; +Cc: David Woodhouse, Jan Hudec, linux-fsdevel
On Mon, Sep 15, 2003 at 09:18:38AM -0700, Bryan Henderson wrote:
> >The correct way to build modules out of the kernel tree is to use the
> >kernel makefiles and override SUBDIRS to point at your own directory;
>
> That philosophy seems to fly in the face of the very modularity that makes
> modules great. If you accept the idea that your module source code should
> be arranged the same way as Linux kernel source code and built the same
> way, you might as well just maintain your code as a patch to the Linux
> source tree.
>
> But if you accept the idea that a module writer can write his own make
> file, then he is free to organize the source code in original ways, use a
> language other than C, and share code or structure with non-Linux
> applications (e.g. device drivers for the same device in other OSes).
Um, I think the point is that no one does accept that idea. And if you
try to write your own makefile, then you deserve any problems that you
might have, as the kernel build developers have repeatedly told people
how to do this properly so that things to not break.
greg k-h
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: buffer cache
2003-09-15 16:35 ` Greg KH
@ 2003-09-15 22:41 ` Bryan Henderson
2003-09-16 5:13 ` David Woodhouse
0 siblings, 1 reply; 15+ messages in thread
From: Bryan Henderson @ 2003-09-15 22:41 UTC (permalink / raw)
To: Greg KH; +Cc: Jan Hudec, David Woodhouse, linux-fsdevel
>> But if you accept the idea that a module writer can write his own make
>> file, then he is free to organize the source code in original ways, use
a
>> language other than C, and share code or structure with non-Linux
>> applications (e.g. device drivers for the same device in other OSes).
>
>Um, I think the point is that no one does accept that idea.
I think that's a bit of an overstatement. We've heard from two people
today who accept that idea, and I've given reasons that others might
intelligently do so. Probably the strongest statement you can make is
that no kernel developers accept that idea. And I could believe that,
considering there are several ideas on which kernel developers and
maintainers of out-of-tree kernel code often don't see eye to eye. Like
whether you should give users your source code and the importance of base
kernel interfaces remaining the same from one release to the next.
>And if you
>try to write your own makefile, then you deserve any problems that you
>might have, as the kernel build developers have repeatedly told people
>how to do this properly so that things to not break.
I do agree with that. You take the good with the bad. Same goes for
deciding whether to keep your code in its own directory or patch the
kernel tree and whether to distribute your code separately or get it
accepted into Linus' or some other kernel tree.
--
Bryan Henderson IBM Almaden Research Center
San Jose CA Filesystems
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: buffer cache
2003-09-15 22:41 ` Bryan Henderson
@ 2003-09-16 5:13 ` David Woodhouse
2003-09-16 10:18 ` Jamie Lokier
0 siblings, 1 reply; 15+ messages in thread
From: David Woodhouse @ 2003-09-16 5:13 UTC (permalink / raw)
To: Bryan Henderson; +Cc: Greg KH, Jan Hudec, linux-fsdevel
On Mon, 2003-09-15 at 15:41 -0700, Bryan Henderson wrote:
> >> But if you accept the idea that a module writer can write his own make
> >> file, then he is free to organize the source code in original ways, use a
> >> language other than C, and share code or structure with non-Linux
> >> applications (e.g. device drivers for the same device in other OSes).
> >
> >Um, I think the point is that no one does accept that idea.
>
> I think that's a bit of an overstatement.
I accept the idea. I also accept the idea that said module writer can
also write all his own include files _too_, and avoid even having to
have a kernel tree around at all.
I think he'd have to be on crack, but I do accept that he _can_ do that.
But I don't want him asking for support, and I don't want him advocating
this practice to newbies.
Do what you like in the privacy of your own home; I really couldn't give
a monkey's. Just don't talk about it in public :)
--
dwmw2
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: buffer cache
2003-09-16 5:13 ` David Woodhouse
@ 2003-09-16 10:18 ` Jamie Lokier
2003-09-16 12:16 ` David Woodhouse
0 siblings, 1 reply; 15+ messages in thread
From: Jamie Lokier @ 2003-09-16 10:18 UTC (permalink / raw)
To: David Woodhouse; +Cc: Bryan Henderson, Greg KH, Jan Hudec, linux-fsdevel
David Woodhouse wrote:
> I accept the idea. I also accept the idea that said module writer can
> also write all his own include files _too_, and avoid even having to
> have a kernel tree around at all.
I don't think you can entertain that idea, because...
> I think he'd have to be on crack, but I do accept that he _can_ do that.
...to write his own files which allow modules to work with the kernel
would require duplicating the existing include files in great detail -
perhaps enough to count as a derived work.
In other words, it's widely believed that he _can't_ do that.
Fwiw I don't have any problem with this.
-- Jamie
ps. It may be possible, after all people have written binary modules
for other operating systems purely by reverse engineering the
operating system, starting with no source. Perhaps that's what
you're advocating ;)
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: buffer cache
2003-09-16 10:18 ` Jamie Lokier
@ 2003-09-16 12:16 ` David Woodhouse
0 siblings, 0 replies; 15+ messages in thread
From: David Woodhouse @ 2003-09-16 12:16 UTC (permalink / raw)
To: Jamie Lokier; +Cc: Bryan Henderson, Greg KH, Jan Hudec, linux-fsdevel
On Tue, 2003-09-16 at 11:18 +0100, Jamie Lokier wrote:
> > I think he'd have to be on crack, but I do accept that he _can_ do that.
>
> ...to write his own files which allow modules to work with the kernel
> would require duplicating the existing include files in great detail -
> perhaps enough to count as a derived work.
>
> In other words, it's widely believed that he _can't_ do that.
He _can_ do it. If he actually does it by a large amount of copying,
then you are correct that he _may_ not distribute the result under a
licence other than the GPL. But he _can_ do it for his own purposes.
> Fwiw I don't have any problem with this.
What consenting adults do in the privacy of their own home I have no
problem with. I don't want to see it advocated in public, to people who
know no better.
--
dwmw2
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2003-09-16 12:16 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-09-13 8:51 buffer cache vadiraj c s
2003-09-13 10:27 ` Jan Hudec
2003-09-13 13:14 ` Matthew Wilcox
2003-09-13 17:25 ` Bryan Henderson
2003-09-13 17:28 ` Jan Hudec
2003-09-14 9:32 ` David Woodhouse
2003-09-14 10:03 ` Jan Hudec
2003-09-14 10:37 ` David Woodhouse
2003-09-14 11:19 ` Jan Hudec
2003-09-15 16:18 ` Bryan Henderson
2003-09-15 16:35 ` Greg KH
2003-09-15 22:41 ` Bryan Henderson
2003-09-16 5:13 ` David Woodhouse
2003-09-16 10:18 ` Jamie Lokier
2003-09-16 12:16 ` David Woodhouse
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).