Commit 70e13017 authored by Charles Jacobsen's avatar Charles Jacobsen Committed by Vikram Narayanan

Simple glue building.

parent 0d22a750
......@@ -3,7 +3,7 @@
# Flag to toggle some coditional compilation in the original source code
# for isolation
CFLAGS_lcd-test-mod-pmfs-lcd.o := -DLCD_ISOLATE
ccflags-y := -DLCD_ISOLATE
# The original code
obj-$(CONFIG_LCD_TEST_MOD_PMFS_LCD) += lcd-test-mod-pmfs-lcd.o
......
#include <linux/fs.h>
#include <lcd-domains/liblcd.h>
int register_filesystem(struct file_system_type *)
int register_filesystem(struct file_system_type *fs)
{
return 0;
}
int unregister_filesystem(struct file_system_type *)
int unregister_filesystem(struct file_system_type *fs)
{
return 0;
}
......@@ -10,6 +10,8 @@
#include <lcd-domains/liblcd-hacks.h>
int init_pmfs_fs(void);
void exit_pmfs_fs(void);
static int __noreturn __init pmfs_lcd_init(void)
{
......@@ -17,6 +19,14 @@ static int __noreturn __init pmfs_lcd_init(void)
r = lcd_enter();
if (r)
goto fail1;
r = init_pmfs_fs();
if (r)
goto fail1;
exit_pmfs_fs();
fail1:
lcd_exit(r);
}
......
......@@ -1041,6 +1041,8 @@ static void pmfs_destroy_inode(struct inode *inode)
static void init_once(void *foo)
{
#ifdef LCD_ISOLATE
struct pmfs_inode_vfs *vi;
/*
* This is the "constructor" for the pmfs_inode_vfs slab cache
* (called when an inode is allocated from the cache). We need to
......@@ -1056,7 +1058,7 @@ static void init_once(void *foo)
c->vfs_ref = 0; /* null */
c->pmfs_ref = 0; /* null */
struct pmfs_inode_vfs *vi = &c->x;
vi = &c->x;
#else
......@@ -1085,8 +1087,6 @@ static int __init init_blocknode_cache(void)
static int __init init_inodecache(void)
{
#ifdef LCD_ISOLATE
#error "It worked!"
/*
* Objects in this slab cache pass through an interface boundary
* (struct inode is inside struct pmfs_inode_vfs). Put inside glue
......@@ -1097,7 +1097,7 @@ static int __init init_inodecache(void)
struct pmfs_inode_vfs x;
u64 vfs_ref;
u64 pmfs_ref;
},
}),
0, (SLAB_RECLAIM_ACCOUNT |
SLAB_MEM_SPREAD),
init_once);
......@@ -1221,7 +1221,11 @@ static const struct export_operations pmfs_export_ops = {
#ifndef LCD_ISOLATE
static
#endif
int __init init_pmfs_fs(void)
int
#ifndef LCD_ISOLATE
__init
#endif
init_pmfs_fs(void)
{
int rc = 0;
......@@ -1261,7 +1265,11 @@ out1:
#ifndef LCD_ISOLATE
static
#endif
void __exit exit_pmfs_fs(void)
void
#ifndef LCD_ISOLATE
__exit
#endif
exit_pmfs_fs(void)
{
unregister_filesystem(&pmfs_fs_type);
bdi_destroy(&pmfs_backing_dev_info);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment