[PATCH 06/21] dm: Some future-proofing by means of compile-time DM_VERSION_MAJOR check

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* dm.c: Add check whether DM_VERSION_MAJOR equals to 4, provide empty
dm_ioctl if check fails.
---
 dm.c |   13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/dm.c b/dm.c
index ebdfc44..79bb7c7 100644
--- a/dm.c
+++ b/dm.c
@@ -5,6 +5,8 @@
 # include <sys/ioctl.h>
 # include <linux/dm-ioctl.h>
 
+# if DM_VERSION_MAJOR == 4
+
 static void
 dm_decode_device(const unsigned int code, const struct dm_ioctl *ioc)
 {
@@ -375,4 +377,13 @@ dm_ioctl(struct tcb *tcp, const unsigned int code, long arg)
 	}
 }
 
-#endif
+# else /* !(DM_VERSION_MAJOR == 4) */
+
+int
+dm_ioctl(struct tcb *tcp, const unsigned int code, long arg)
+{
+	return 0;
+}
+
+# endif /* DM_VERSION_MAJOR == 4 */
+#endif /* HAVE_LINUX_DM_IOCTL_H */
-- 
1.7.10.4

--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/dm-devel



[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux