diff options
author | Julia Lawall <julia@diku.dk> | 2008-02-14 10:15:45 -0500 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2008-04-17 08:22:23 -0400 |
commit | 8dee00bb758f9e1d7fac9f5d2463d09444d4f255 (patch) | |
tree | 86a963fdb55606b1e4e9285150942a799e457262 /fs/udf/super.c | |
parent | 15aebd2866b21a568d8defec134bf29f9aea9088 (diff) |
fs/udf: Use DIV_ROUND_UP
The kernel.h macro DIV_ROUND_UP performs the computation (((n) + (d) - 1) /
(d)) but is perhaps more readable.
An extract of the semantic patch that makes this change is as follows:
(http://www.emn.fr/x-info/coccinelle/)
// <smpl>
@haskernel@
@@
#include <linux/kernel.h>
@depends on haskernel@
expression n,d;
@@
(
- (n + d - 1) / d
+ DIV_ROUND_UP(n,d)
|
- (n + (d - 1)) / d
+ DIV_ROUND_UP(n,d)
)
@depends on haskernel@
expression n,d;
@@
- DIV_ROUND_UP((n),d)
+ DIV_ROUND_UP(n,d)
@depends on haskernel@
expression n,d;
@@
- DIV_ROUND_UP(n,(d))
+ DIV_ROUND_UP(n,d)
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/udf/super.c')
-rw-r--r-- | fs/udf/super.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/fs/udf/super.c b/fs/udf/super.c index 02815e92553b..5f0d400385e0 100644 --- a/fs/udf/super.c +++ b/fs/udf/super.c | |||
@@ -986,10 +986,9 @@ static void udf_load_fileset(struct super_block *sb, struct buffer_head *bh, | |||
986 | int udf_compute_nr_groups(struct super_block *sb, u32 partition) | 986 | int udf_compute_nr_groups(struct super_block *sb, u32 partition) |
987 | { | 987 | { |
988 | struct udf_part_map *map = &UDF_SB(sb)->s_partmaps[partition]; | 988 | struct udf_part_map *map = &UDF_SB(sb)->s_partmaps[partition]; |
989 | return (map->s_partition_len + | 989 | return DIV_ROUND_UP(map->s_partition_len + |
990 | (sizeof(struct spaceBitmapDesc) << 3) + | 990 | (sizeof(struct spaceBitmapDesc) << 3), |
991 | (sb->s_blocksize * 8) - 1) / | 991 | sb->s_blocksize * 8); |
992 | (sb->s_blocksize * 8); | ||
993 | } | 992 | } |
994 | 993 | ||
995 | static struct udf_bitmap *udf_sb_alloc_bitmap(struct super_block *sb, u32 index) | 994 | static struct udf_bitmap *udf_sb_alloc_bitmap(struct super_block *sb, u32 index) |