Skip to content

Commit a7fe0ba

Browse files
szinckDave Kleikamp
authored andcommitted
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 <[email protected]> Signed-off-by: Dave Kleikamp <[email protected]>
1 parent 1eb3a71 commit a7fe0ba

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

fs/jfs/jfs_dtree.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ struct idtentry {
7474
#define DTIHDRDATALEN 11
7575

7676
/* 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))
7878

7979

8080
/*
@@ -133,7 +133,7 @@ struct dir_table_slot {
133133
( ((s64)((dts)->addr1)) << 32 | __le32_to_cpu((dts)->addr2) )
134134

135135
/* 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))
137137
#define NDTLEAF NDTINTERNAL
138138

139139

fs/jfs/resize.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ int jfs_extendfs(struct super_block *sb, s64 newLVSize, int newLogSize)
172172
*/
173173
t64 = ((newLVSize - newLogSize + BPERDMAP - 1) >> L2BPERDMAP)
174174
<< L2BPERDMAP;
175-
t32 = ((t64 + (BITSPERPAGE - 1)) / BITSPERPAGE) + 1 + 50;
175+
t32 = DIV_ROUND_UP(t64, BITSPERPAGE) + 1 + 50;
176176
newFSCKSize = t32 << sbi->l2nbperpage;
177177
newFSCKAddress = newLogAddress - newFSCKSize;
178178

0 commit comments

Comments
 (0)