diff -uNr novfs-1.2.0.orig/novfs/conf novfs-1.2.0/novfs/conf --- novfs-1.2.0.orig/novfs/conf 1970-01-01 01:00:00.000000000 +0100 +++ novfs-1.2.0/novfs/conf 2006-08-30 22:32:57.000000000 +0200 @@ -0,0 +1,63 @@ +#!/bin/sh + +if [ -z "$1" ];then + echo "Usage: ssb linux-kernel-source-dir" >&2 + exit 3 +fi + +echo > conf.h + +sbtdir='/tmp/sbtest' + +rm -fr $sbtdir || exit 3 +mkdir $sbtdir || exit 3 + +echo " +obj-m := sb.o + +all : + \$(MAKE) -C $1 SUBDIRS=$sbtdir modules +" >> $sbtdir/Makefile + +echo " +#include +int main() +{ + get_sb_nodev(0, 0, 0, 0, 0); + return 0; +} +" >> $sbtdir/sb.c + +(cd $sbtdir && make > /dev/null 2>&1) + +if test -e $sbtdir/sb.ko ;then + echo " +#define GET_SB_HAS_STRUCT_VFSMOUNT 1 + " >> conf.h +fi + +rm -fr $sbtdir || exit 3 +mkdir $sbtdir || exit 3 + +echo " +obj-m := sb.o + +all : + \$(MAKE) -C $1 SUBDIRS=$sbtdir modules +" >> $sbtdir/Makefile + +echo " +#include +typedef struct task_struct task_t; +" >> $sbtdir/sb.c + +(cd $sbtdir && make > /dev/null 2>&1) + +if test ! -e $sbtdir/sb.ko ;then + echo " +#define TYPE_DEFINED_TASK_T 1 + " >> conf.h +fi + +rm -fr $sbtdir || exit 3 + diff -uNr novfs-1.2.0.orig/novfs/inode.c novfs-1.2.0/novfs/inode.c --- novfs-1.2.0.orig/novfs/inode.c 2006-07-11 21:24:18.000000000 +0200 +++ novfs-1.2.0/novfs/inode.c 2006-08-30 22:32:57.000000000 +0200 @@ -47,9 +47,11 @@ /*===[ Include files specific to this module ]============================*/ #include "vfs.h" +#include "conf.h" /*===[ External data ]====================================================*/ + /*===[ External prototypes ]==============================================*/ extern int DbgPrint( char *Fmt, ... ); extern int LocalPrint( char *Fmt, ... ); @@ -126,7 +128,13 @@ struct inode *Novfs_get_inode(struct super_block *sb, int mode, int dev, uid_t uid, ino_t ino, struct qstr *name); unsigned long Novfs_internal_hash (struct qstr *name); -struct super_block *Novfs_get_sb (struct file_system_type *Fstype, int Flags, const char *Dev_name, void *Data); + +#ifdef GET_SB_HAS_STRUCT_VFSMOUNT +struct super_block * Novfs_get_sb(struct file_system_type *Fstype, int Flags, const char *Dev_name, void *Data, struct vfsmount *Mnt); +#else +struct super_block * Novfs_get_sb(struct file_system_type *Fstype, int Flags, const char *Dev_name, void *Data); +#endif + void Novfs_kill_sb(struct super_block *SB); int Novfs_fill_super (struct super_block *SB, void *Data, int Silent); @@ -3509,7 +3517,12 @@ } /*++======================================================================*/ +#ifdef GET_SB_HAS_STRUCT_VFSMOUNT +struct super_block *Novfs_get_sb(struct file_system_type *Fstype, int Flags, const char *Dev_name, void *Data, struct vfsmount *Mnt) +#else struct super_block *Novfs_get_sb(struct file_system_type *Fstype, int Flags, const char *Dev_name, void *Data) +#endif + /* * Arguments: * @@ -3526,7 +3539,11 @@ struct super_block *sb; UNUSED_VARIABLE(Dev_name); - sb = get_sb_nodev(Fstype, Flags, Data, Novfs_fill_super); +#ifdef GET_SB_HAS_STRUCT_VFSMOUNT + sb = get_sb_nodev(Fstype, Flags, Data, Novfs_fill_super, Mnt); +#else + sb = get_sb_nodev(Fstype, Flags, Data, Novfs_fill_super); +#endif DbgPrint( "Novfs_get_sb: sb=0x%x Fstype=0x%x Dev_name=%s\n", sb, Fstype, Dev_name); diff -uNr novfs-1.2.0.orig/novfs/Makefile novfs-1.2.0/novfs/Makefile --- novfs-1.2.0.orig/novfs/Makefile 2006-07-11 21:24:18.000000000 +0200 +++ novfs-1.2.0/novfs/Makefile 2006-08-30 22:32:57.000000000 +0200 @@ -34,12 +34,15 @@ NOVFS_VFS_SUB = 0 NOVFS_VFS_RELEASE = 17 +KERNEL_SOURCE_DIR="/usr/src/linux" +#KERNEL_SOURCE_DIR="/usr/src/linux-2.6.18-rc4" + # Remove # from the following line for debug version EXTRA_CFLAGS += -finstrument-functions EXTRA_CFLAGS += -g EXTRA_CFLAGS += -I. EXTRA_CFLAGS += -I$(obj)/../include -#EXTRA_CFLAGS += -I$(obj)/../../include +EXTRA_CFLAGS += -I$(obj)/../../include EXTRA_CFLAGS += -DNOVFS_VFS_MAJOR=$(NOVFS_VFS_MAJOR) EXTRA_CFLAGS += -DNOVFS_VFS_MINOR=$(NOVFS_VFS_MINOR) EXTRA_CFLAGS += -DNOVFS_VFS_SUB=$(NOVFS_VFS_SUB) @@ -50,3 +53,10 @@ obj-m := novfs.o novfs-y := inode.o proc.o profile.o daemon.o file.o scope.o nwcapi.o + +all: + ./conf $(KERNEL_SOURCE_DIR) + make -C $(KERNEL_SOURCE_DIR) SUBDIRS=`pwd` modules + +clean: + make -C $(KERNEL_SOURCE_DIR) SUBDIRS=`pwd` modules clean diff -uNr novfs-1.2.0.orig/novfs/scope.c novfs-1.2.0/novfs/scope.c --- novfs-1.2.0.orig/novfs/scope.c 2006-07-11 21:24:18.000000000 +0200 +++ novfs-1.2.0/novfs/scope.c 2006-08-30 22:32:57.000000000 +0200 @@ -45,8 +45,14 @@ /*===[ Include files specific to this module ]============================*/ #include "vfs.h" +#include "conf.h" #define LEADER signal->leader + +#ifndef TYPE_DEFINED_TASK_T +typedef struct task_struct task_t; +#endif + /*===[ External data ]====================================================*/ /*===[ External prototypes ]==============================================*/