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:
parent
9e05e670b4
commit
8f3efeb116
19
Makefile
19
Makefile
@ -1,6 +1,15 @@
|
|||||||
#
|
KERNEL_RELEASE = $(shell uname -r)
|
||||||
# Makefile for the fpgafs virtual filesystem
|
KERNEL_BUILDROOT ?= /lib/modules/$(KERNEL_RELEASE)/build
|
||||||
#
|
BUILDROOT = $(shell pwd)
|
||||||
obj-$(CONFIG_FPGA_FS) += fpgafs.o
|
|
||||||
|
|
||||||
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
6
Makefile.kernel
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
#
|
||||||
|
# Makefile for the fpgafs virtual filesystem
|
||||||
|
#
|
||||||
|
obj-$(CONFIG_FPGA_FS) += fpgafs.o
|
||||||
|
|
||||||
|
fpgafs-objs := inode.o files.o
|
3
files.c
3
files.c
@ -1,3 +1,6 @@
|
|||||||
|
/*********************************************
|
||||||
|
* Benjamin Krill <ben@codiert.org>
|
||||||
|
*********************************************/
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/version.h>
|
#include <linux/version.h>
|
||||||
|
11
inode.c
11
inode.c
@ -1,3 +1,6 @@
|
|||||||
|
/*********************************************
|
||||||
|
* Benjamin Krill <ben@codiert.org>
|
||||||
|
*********************************************/
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/version.h>
|
#include <linux/version.h>
|
||||||
#include <linux/init.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 = {
|
const struct inode_operations fpgafs_simple_dir_inode_operations = {
|
||||||
.lookup = simple_lookup,
|
.lookup = simple_lookup
|
||||||
};
|
};
|
||||||
|
|
||||||
const struct inode_operations fpgafs_dir_inode_operations = {
|
const struct inode_operations fpgafs_dir_inode_operations = {
|
||||||
.lookup = simple_lookup,
|
.lookup = simple_lookup,
|
||||||
.mkdir = fpgafs_mkdir,
|
.mkdir = fpgafs_mkdir,
|
||||||
.rmdir = fpgafs_rmdir,
|
.rmdir = fpgafs_rmdir
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct kmem_cache *fpgafs_inode_cache;
|
static struct kmem_cache *fpgafs_inode_cache;
|
||||||
@ -151,7 +154,7 @@ int fpgafs_mkdir( struct inode *dir, struct dentry *dentry, int mode)
|
|||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
struct inode *inode;
|
struct inode *inode;
|
||||||
struct fpga_context *ctx;
|
struct fpga_context *ctx = NULL;
|
||||||
|
|
||||||
ret = -ENOSPC;
|
ret = -ENOSPC;
|
||||||
inode = fpgafs_new_inode(dir->i_sb, mode | S_IFDIR);
|
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)
|
static int fpgafs_rmdir(struct inode *dir, struct dentry *dentry)
|
||||||
{
|
{
|
||||||
/* remove all entries */
|
/* remove all entries */
|
||||||
// fpgafs_prune_dir(dir);
|
fpgafs_prune_dir(dentry);
|
||||||
//fpgafs_remove_inode
|
//fpgafs_remove_inode
|
||||||
|
|
||||||
return simple_rmdir(dir, dentry);
|
return simple_rmdir(dir, dentry);
|
||||||
|
Loading…
Reference in New Issue
Block a user