compat: Backport DIV_ROUND_UP_DLL macro
authorOzan Çağlayan <ozancag@gmail.com>
Mon, 2 Jul 2012 14:22:14 +0000 (17:22 +0300)
committerLuis R. Rodriguez <mcgrof@frijolero.org>
Tue, 3 Jul 2012 00:09:35 +0000 (17:09 -0700)
This backports:

commit 36a26c69b4c70396ef569c3452690fba0c1dec08
Author: Nicholas Bellinger <nab@linux-iscsi.org>
Date:   Tue Jul 26 00:35:26 2011 -0700

    kernel.h: Add DIV_ROUND_UP_ULL and DIV_ROUND_UP_SECTOR_T macro usage

Trying kernel  3.4.0-030400-generic [OK]
Trying kernel  3.3.7-030307-generic [OK]
Trying kernel  3.2.2-030202-generic [OK]
Trying kernel  3.1.10-030110-generic [OK]
Trying kernel  3.0.18-030018-generic [OK]
Trying kernel  2.6.39-02063904-generic [OK]
Trying kernel  2.6.38-02063808-generic [OK]
Trying kernel  2.6.37-02063706-generic [OK]
Trying kernel  2.6.36-02063604-generic [OK]
Trying kernel  2.6.35-02063512-generic [OK]
Trying kernel  2.6.34-02063410-generic [OK]
Trying kernel  2.6.33-02063305-generic [OK]
Trying kernel  2.6.32-02063255-generic [OK]
Trying kernel  2.6.31-02063113-generic [OK]
Trying kernel  2.6.30-02063010-generic [OK]
Trying kernel  2.6.29-02062906-generic [OK]
Trying kernel  2.6.28-02062810-generic [OK]
Trying kernel  2.6.27-020627-generic [OK]
Trying kernel  2.6.26-020626-generic [OK]
Trying kernel  2.6.25-020625-generic [OK]
Trying kernel  2.6.24-020624-generic [OK]

Signed-off-by: Ozan Çağlayan <ozancag@gmail.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@frijolero.org>
include/linux/compat-3.1.h

index da8e971c870a974ab2f7cc454f14901400ef1c24..5998bb16c46b2a656da5cdaa5ff81e44a5199853 100644 (file)
@@ -9,6 +9,20 @@
 #include <linux/skbuff.h>
 #include <net/ip.h>
 #include <linux/idr.h>
+#include <asm/div64.h>
+
+
+/* This backports:
+ *
+ * commit 36a26c69b4c70396ef569c3452690fba0c1dec08
+ * Author: Nicholas Bellinger <nab@linux-iscsi.org>
+ * Date:   Tue Jul 26 00:35:26 2011 -0700
+ *
+ *     kernel.h: Add DIV_ROUND_UP_ULL and DIV_ROUND_UP_SECTOR_T macro usage
+ */
+
+#define DIV_ROUND_UP_ULL(ll,d) \
+       ({ unsigned long long _tmp = (ll)+(d)-1; do_div(_tmp, d); _tmp; })
 
 /* Backports 56f8a75c */
 static inline bool ip_is_fragment(const struct iphdr *iph)