udf: use int for allocated blocks instead of sector_t
authorFabian Frederick <fabf@skynet.be>
Sun, 15 Mar 2015 09:54:23 +0000 (10:54 +0100)
committerJan Kara <jack@suse.cz>
Mon, 16 Mar 2015 07:24:16 +0000 (08:24 +0100)
Fix the following warnings:

fs/udf/balloc.c:768:15: warning: conversion to 'sector_t' from 'int'
may change the sign of the result [-Wsign-conversion]
   allocated = udf_bitmap_prealloc_blocks(sb,
               ^
fs/udf/balloc.c:773:15: warning: conversion to 'sector_t' from 'int'
may change the sign of the result [-Wsign-conversion]
   allocated = udf_table_prealloc_blocks(sb,
               ^
fs/udf/balloc.c:778:15: warning: conversion to 'sector_t' from 'int'
may change the sign of the result [-Wsign-conversion]
   allocated = udf_bitmap_prealloc_blocks(sb,
               ^
fs/udf/balloc.c:783:15: warning: conversion to 'sector_t' from 'int'
may change the sign of the result [-Wsign-conversion]
   allocated = udf_table_prealloc_blocks(sb,
               ^
fs/udf/balloc.c:791:26: warning: conversion to 'loff_t' from 'sector_t'
may change the sign of the result [-Wsign-conversion]
   inode_add_bytes(inode, allocated << sb->s_blocksize_bits);
                          ^
fs/udf/balloc.c:792:2: warning: conversion to 'int' from 'sector_t'
may alter its value [-Wconversion]
  return allocated;

Suggested-by: Jan Kara <jack@suse.cz>
Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Jan Kara <jack@suse.cz>
fs/udf/balloc.c

index acd8e0519ac548d6f2b848a730dd2d0b376b4ad8..6d6a96b4e73fe20ba15edc1213564613cb201bbd 100644 (file)
@@ -758,7 +758,7 @@ inline int udf_prealloc_blocks(struct super_block *sb,
                               uint32_t block_count)
 {
        struct udf_part_map *map = &UDF_SB(sb)->s_partmaps[partition];
-       sector_t allocated;
+       int allocated;
 
        if (map->s_partition_flags & UDF_PART_FLAG_UNALLOC_BITMAP)
                allocated = udf_bitmap_prealloc_blocks(sb,