GIT 2c5c37da093cd2f455ce818ee7b02b7a39d10498 git+ssh://master.kernel.org/pub/scm/linux/kernel/git/shaggy/jfs-2.6.git#for-mm commit Author: Shaun Zinck Date: Fri Aug 31 12:57:28 2007 -0500 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 Signed-off-by: Dave Kleikamp commit 85e65c39f050a4964d0b943304bd896ff5375988 Author: Jack Stone Date: Tue Jul 31 09:36:53 2007 -0500 Remove unnecessary kmalloc casts in the jfs filesystem Signed-off-by: Jack Stone Signed-off-by: Dave Kleikamp fs/jfs/jfs_dtree.c | 8 ++------ fs/jfs/jfs_dtree.h | 4 ++-- fs/jfs/resize.c | 2 +- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/fs/jfs/jfs_dtree.c b/fs/jfs/jfs_dtree.c index c14ba3c..3f15b36 100644 --- a/fs/jfs/jfs_dtree.c +++ b/fs/jfs/jfs_dtree.c @@ -592,9 +592,7 @@ int dtSearch(struct inode *ip, struct co struct component_name ciKey; struct super_block *sb = ip->i_sb; - ciKey.name = - (wchar_t *) kmalloc((JFS_NAME_MAX + 1) * sizeof(wchar_t), - GFP_NOFS); + ciKey.name = kmalloc((JFS_NAME_MAX + 1) * sizeof(wchar_t), GFP_NOFS); if (ciKey.name == 0) { rc = -ENOMEM; goto dtSearch_Exit2; @@ -957,9 +955,7 @@ static int dtSplitUp(tid_t tid, smp = split->mp; sp = DT_PAGE(ip, smp); - key.name = - (wchar_t *) kmalloc((JFS_NAME_MAX + 2) * sizeof(wchar_t), - GFP_NOFS); + key.name = kmalloc((JFS_NAME_MAX + 2) * sizeof(wchar_t), GFP_NOFS); if (key.name == 0) { DT_PUTPAGE(smp); rc = -ENOMEM; diff --git a/fs/jfs/jfs_dtree.h b/fs/jfs/jfs_dtree.h index 8561c6e..cdac2d5 100644 --- a/fs/jfs/jfs_dtree.h +++ b/fs/jfs/jfs_dtree.h @@ -74,7 +74,7 @@ #define DTIHDRSIZE 10 #define DTIHDRDATALEN 11 /* compute number of slots for entry */ -#define NDTINTERNAL(klen) ( ((4 + (klen)) + (15 - 1)) / 15 ) +#define NDTINTERNAL(klen) (DIV_ROUND_UP((4 + (klen)), 15)) /* @@ -133,7 +133,7 @@ #define addressDTS(dts)\ ( ((s64)((dts)->addr1)) << 32 | __le32_to_cpu((dts)->addr2) ) /* compute number of slots for entry */ -#define NDTLEAF_LEGACY(klen) ( ((2 + (klen)) + (15 - 1)) / 15 ) +#define NDTLEAF_LEGACY(klen) (DIV_ROUND_UP((2 + (klen)), 15)) #define NDTLEAF NDTINTERNAL diff --git a/fs/jfs/resize.c b/fs/jfs/resize.c index 71984ee..7f24a0b 100644 --- a/fs/jfs/resize.c +++ b/fs/jfs/resize.c @@ -172,7 +172,7 @@ int jfs_extendfs(struct super_block *sb, */ t64 = ((newLVSize - newLogSize + BPERDMAP - 1) >> L2BPERDMAP) << L2BPERDMAP; - t32 = ((t64 + (BITSPERPAGE - 1)) / BITSPERPAGE) + 1 + 50; + t32 = DIV_ROUND_UP(t64, BITSPERPAGE) + 1 + 50; newFSCKSize = t32 << sbi->l2nbperpage; newFSCKAddress = newLogAddress - newFSCKSize;