Commit a7fe0ba7eee4f7c53077ff2bed2b581db17d00df

Authored by Shaun Zinck
Committed by Dave Kleikamp
1 parent 1eb3a711d6

JFS: use DIV_ROUND_UP where appropriate

This replaces some macros and code, which do the same thing as DIV_ROUND_UP
defined in kernel.h, to use the DIV_ROUND_UP macro.

Signed-off-by: Shaun Zinck <shaun.zinck@gmail.com>
Signed-off-by: Dave Kleikamp <shaggy@linux.vnet.ibm.com>

Showing 2 changed files with 3 additions and 3 deletions Side-by-side Diff

... ... @@ -74,7 +74,7 @@
74 74 #define DTIHDRDATALEN 11
75 75  
76 76 /* compute number of slots for entry */
77   -#define NDTINTERNAL(klen) ( ((4 + (klen)) + (15 - 1)) / 15 )
  77 +#define NDTINTERNAL(klen) (DIV_ROUND_UP((4 + (klen)), 15))
78 78  
79 79  
80 80 /*
... ... @@ -133,7 +133,7 @@
133 133 ( ((s64)((dts)->addr1)) << 32 | __le32_to_cpu((dts)->addr2) )
134 134  
135 135 /* compute number of slots for entry */
136   -#define NDTLEAF_LEGACY(klen) ( ((2 + (klen)) + (15 - 1)) / 15 )
  136 +#define NDTLEAF_LEGACY(klen) (DIV_ROUND_UP((2 + (klen)), 15))
137 137 #define NDTLEAF NDTINTERNAL
138 138  
139 139  
... ... @@ -172,7 +172,7 @@
172 172 */
173 173 t64 = ((newLVSize - newLogSize + BPERDMAP - 1) >> L2BPERDMAP)
174 174 << L2BPERDMAP;
175   - t32 = ((t64 + (BITSPERPAGE - 1)) / BITSPERPAGE) + 1 + 50;
  175 + t32 = DIV_ROUND_UP(t64, BITSPERPAGE) + 1 + 50;
176 176 newFSCKSize = t32 << sbi->l2nbperpage;
177 177 newFSCKAddress = newLogAddress - newFSCKSize;
178 178