[pnfs] [PATCH 06/19] pnfsblock: dm kernel interface
Fred Isaman
iisaman at citi.umich.edu
Tue Mar 25 16:26:01 EDT 2008
We need kernel access to what is currently a user-mode only ioctl interface.
Signed-off-by: Fred Isaman <iisaman at citi.umich.edu>
---
drivers/md/dm-ioctl.c | 24 ++++++++++++++++++++++++
fs/nfs/blocklayout/blocklayout.h | 4 ++++
2 files changed, 28 insertions(+), 0 deletions(-)
diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c
index 9627fa0..d028668 100644
--- a/drivers/md/dm-ioctl.c
+++ b/drivers/md/dm-ioctl.c
@@ -593,6 +593,12 @@ static int dev_create(struct dm_ioctl *param, size_t param_size)
return r;
}
+int dm_dev_create(struct dm_ioctl *param)
+{
+ return dev_create(param, sizeof(*param));
+}
+EXPORT_SYMBOL(dm_dev_create);
+
/*
* Always use UUID for lookups if it's present, otherwise use name or dev.
*/
@@ -684,6 +690,12 @@ static int dev_remove(struct dm_ioctl *param, size_t param_size)
return 0;
}
+int dm_dev_remove(struct dm_ioctl *param)
+{
+ return dev_remove(param, sizeof(*param));
+}
+EXPORT_SYMBOL(dm_dev_remove);
+
/*
* Check a string doesn't overrun the chunk of
* memory we copied from userland.
@@ -849,6 +861,12 @@ static int do_resume(struct dm_ioctl *param)
return r;
}
+int dm_do_resume(struct dm_ioctl *param)
+{
+ return do_resume(param);
+}
+EXPORT_SYMBOL(dm_do_resume);
+
/*
* Set or unset the suspension state of a device.
* If the device already is in the requested state we just return its status.
@@ -1092,6 +1110,12 @@ out:
return r;
}
+int dm_table_load(struct dm_ioctl *param, size_t param_size)
+{
+ return table_load(param, param_size);
+}
+EXPORT_SYMBOL(dm_table_load);
+
static int table_clear(struct dm_ioctl *param, size_t param_size)
{
int r;
diff --git a/fs/nfs/blocklayout/blocklayout.h b/fs/nfs/blocklayout/blocklayout.h
index 5cb96f2..0672fcf 100644
--- a/fs/nfs/blocklayout/blocklayout.h
+++ b/fs/nfs/blocklayout/blocklayout.h
@@ -35,8 +35,12 @@
#include <linux/nfs_fs.h>
#include <linux/pnfs_xdr.h> /* Needed by nfs4_pnfs.h */
#include <linux/nfs4_pnfs.h>
+#include <linux/dm-ioctl.h> /* Needed for struct dm_ioctl*/
extern struct class shost_class; /* exported from drivers/scsi/hosts.c */
+extern int dm_dev_create(struct dm_ioctl *param); /* from dm-ioctl.c */
+extern int dm_dev_remove(struct dm_ioctl *param); /* from dm-ioctl.c */
+
struct block_mount_id {
struct super_block *bm_sb; /* back pointer */
--
1.5.3.3
More information about the pNFS
mailing list