[dm-devel] [PATCH] move min_not_zero to dm.h

Kevin Corry kevcorry at us.ibm.com
Mon Nov 3 13:46:01 UTC 2003


Move the definition of min_not_zero() to dm.h, since multiple files are using it.

--- a/drivers/md/dm-snap.c	31 Oct 2003 19:37:56 -0000
+++ b/drivers/md/dm-snap.c	3 Nov 2003 19:20:23 -0000
@@ -1137,8 +1137,6 @@
 	return (bio_rw(bio) == WRITE) ? do_origin(dev, bio) : 1;
 }
 
-#define min_not_zero(l, r) (l == 0) ? r : ((r == 0) ? l : min(l, r))
-
 /*
  * Set the target "split_io" field to the minimum of all the snapshots'
  * chunk sizes.
--- a/drivers/md/dm-table.c	30 Oct 2003 16:38:48 -0000
+++ b/drivers/md/dm-table.c	3 Nov 2003 18:27:34 -0000
@@ -70,11 +70,6 @@
 }
 
 /*
- * Returns the minimum that is _not_ zero, unless both are zero.
- */
-#define min_not_zero(l, r) (l == 0) ? r : ((r == 0) ? l : min(l, r))
-
-/*
  * Combine two io_restrictions, always taking the lower value.
  */
 static void combine_restrictions_low(struct io_restrictions *lhs,
--- a/drivers/md/dm.h	27 Oct 2003 17:43:28 -0000
+++ b/drivers/md/dm.h	3 Nov 2003 18:28:17 -0000
@@ -128,6 +128,12 @@
 /*-----------------------------------------------------------------
  * Useful inlines.
  *---------------------------------------------------------------*/
+
+/*
+ * Returns the minimum that is _not_ zero, unless both are zero.
+ */
+#define min_not_zero(l, r) (l == 0) ? r : ((r == 0) ? l : min(l, r))
+
 static inline int array_too_big(unsigned long fixed, unsigned long obj,
 				unsigned long num)
 {





More information about the dm-devel mailing list