diff --git a/dm-sflc/src/dev_vol.c b/dm-sflc/src/dev_vol.c
index 5bc3473..2195a73 100644
--- a/dm-sflc/src/dev_vol.c
+++ b/dm-sflc/src/dev_vol.c
@@ -21,8 +21,6 @@
* If not, see .
*/
-#include
-
#include "sflc.h"
#include "legacy/sflc_legacy.h"
diff --git a/dm-sflc/src/sflc_types.h b/dm-sflc/src/sflc_types.h
index d2927cd..250178b 100644
--- a/dm-sflc/src/sflc_types.h
+++ b/dm-sflc/src/sflc_types.h
@@ -45,6 +45,8 @@
* Type-checked polymorphism is achieved by having device and volume methods
* take as argument a pointer to a base-class struct, instead of an opaque void
* pointer. The pointer is then "down-cast" in the mode-specific method.
+ * The same pattern is followed for the struct representing the constructor
+ * arguments.
*/
#ifndef _SFLC_TYPES_H
@@ -116,6 +118,25 @@ struct sflc_volume_base
struct sflc_mode_ops *ops;
};
+/**
+ * Base class for constructor arguments.
+ * Inherited by derived classes for mode-specific arguments.
+ */
+struct sflc_ctor_args_base
+{
+ /* Shufflecake mode: Legacy or Lite */
+ u32 mode;
+
+ /*Shufflecake-unique device ID*/
+ u32 dev_id;
+
+ /* Underlying block device: MAJOR,MINOR */
+ dev_t bdev_devt;
+
+ /* Volume index within the device */
+ u32 vol_idx;
+};
+
/*
*----------------------------
@@ -125,14 +146,14 @@ struct sflc_volume_base
/* Device constructor */
typedef struct sflc_device_base* (*sflc_mode_dev_ctr_fn) (
- struct dm_target *ti, int argc, char **argv);
+ struct dm_target *ti, struct sflc_ctor_args_base *args_base);
/* Device destructor */
typedef void (*sflc_mode_dev_dtr_fn) (struct sflc_device_base* sd_base);
/* Volume constructor */
typedef struct sflc_volume_base* (*sflc_mode_vol_ctr_fn) (
struct sflc_device_base *sd_base, struct dm_target *ti,
- int argc, char **argv);
+ struct sflc_ctor_args_base *args_base);
/* Volume destructor */
typedef void (*sflc_mode_vol_dtr_fn) (struct sflc_volume_base* sv_base);