add standalone makefile, make some clean ups

git-svn-id: svn+ssh://en.codiert.org/home/staff/ben/dev/misc.svn/projects/fpgafs@341 766a2236-cff9-0310-b0c0-a81a5f92509a
This commit is contained in:
ben 2007-06-28 20:43:40 +00:00
parent 9e05e670b4
commit 8f3efeb116
4 changed files with 30 additions and 9 deletions

View File

@ -1,6 +1,15 @@
#
# Makefile for the fpgafs virtual filesystem
#
obj-$(CONFIG_FPGA_FS) += fpgafs.o
KERNEL_RELEASE = $(shell uname -r)
KERNEL_BUILDROOT ?= /lib/modules/$(KERNEL_RELEASE)/build
BUILDROOT = $(shell pwd)
fpgafs-objs := inode.o files.o
obj-m := fpgafs.o
fpgafs-objs := files.o inode.o
all :
$(MAKE) -C $(KERNEL_BUILDROOT) SUBDIRS=$(BUILDROOT) modules
clean:
rm -f *.ko *.o .*.cmd .*.o.flags *.mod.c Module.symvers
rm -rf .tmp_versions
.PHONY : all clean

6
Makefile.kernel Normal file
View File

@ -0,0 +1,6 @@
#
# Makefile for the fpgafs virtual filesystem
#
obj-$(CONFIG_FPGA_FS) += fpgafs.o
fpgafs-objs := inode.o files.o

View File

@ -1,3 +1,6 @@
/*********************************************
* Benjamin Krill <ben@codiert.org>
*********************************************/
#include <linux/fs.h>
#include <linux/module.h>
#include <linux/version.h>

11
inode.c
View File

@ -1,3 +1,6 @@
/*********************************************
* Benjamin Krill <ben@codiert.org>
*********************************************/
#include <linux/module.h>
#include <linux/version.h>
#include <linux/init.h>
@ -30,13 +33,13 @@ const struct file_operations fpgafs_context_foperations = {
};
const struct inode_operations fpgafs_simple_dir_inode_operations = {
.lookup = simple_lookup,
.lookup = simple_lookup
};
const struct inode_operations fpgafs_dir_inode_operations = {
.lookup = simple_lookup,
.mkdir = fpgafs_mkdir,
.rmdir = fpgafs_rmdir,
.rmdir = fpgafs_rmdir
};
static struct kmem_cache *fpgafs_inode_cache;
@ -151,7 +154,7 @@ int fpgafs_mkdir( struct inode *dir, struct dentry *dentry, int mode)
{
int ret;
struct inode *inode;
struct fpga_context *ctx;
struct fpga_context *ctx = NULL;
ret = -ENOSPC;
inode = fpgafs_new_inode(dir->i_sb, mode | S_IFDIR);
@ -215,7 +218,7 @@ static void fpgafs_prune_dir(struct dentry *dir)
static int fpgafs_rmdir(struct inode *dir, struct dentry *dentry)
{
/* remove all entries */
// fpgafs_prune_dir(dir);
fpgafs_prune_dir(dentry);
//fpgafs_remove_inode
return simple_rmdir(dir, dentry);