At Thu, 13 Apr 2000 14:54:36 -0400,
Phil Schwan <phil@xxxxxxxxxxxxx> wrote:
>
>
> On Apr 13, cattelan@xxxxxxxxxxx wrote:
> > First it would be best not to include linux/fs.h in any file
> > not in the fs/xfs/linux directory. It will cause headaches.
> >
> > If fact that linux/xfs_sema.h shouldn't be there either.
> >
> > If the file is general enough say types.h it can go
> > in xfs_os_defs.h; I doesn't really hurt if some
> > *.c files include some header files they don't need.
> > As long as it doesn't create conflicts.
> >
> > if you really really need to include fs.h put it
> > in xfs_os_defs.h with an
> > #ifdef NEED_FS_H wrapper.
> > then define it in what ever file that it is needed.
>
> If I were to change this:
>
> #include <xfs_os_defs.h>
>
> #ifdef SIM
> #define _KERNEL 1
> #define __KERNEL__ 1
> #endif
>
> #include <linux/xfs_sema.h>
>
> to this:
>
> #define NEED_XFS_SEMA_H
> #include <xfs_os_defs.h>
>
> #ifdef SIM
> #define _KERNEL 1
> #define __KERNEL__ 1
> #endif
>
> it wouldn't do the Right Thing in the SIM case, would it?
>
The first thing xfs_os_defs.h will need is
#ifdef SIM
#define _KERNEL 1
#define __KERNEL__ 1
#endif
in the xfs_sema.h case we may not need to wrap it with the
ifdef... since it may not cause compile problems.
linux/fs.h can cause problem if includede in the wrong files.
The goal here is put as much common or problem header files in
one spot such that they can be controlled with ifdef switches.
There is a lot work that needs to be done in this area, but
it is cleanliness issues and not functionality issues, the
functionality is taking presidence.
-Me
|