udf: convert UDF_SB_ALLOC_PARTMAPS macro to udf_sb_alloc_partition_maps function

- convert UDF_SB_ALLOC_PARTMAPS macro to udf_sb_alloc_partition_maps function
- convert kmalloc + memset to kcalloc
- check if kcalloc failed (partially)

Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Cc: Ben Fennema <bfennema@falcon.csc.calpoly.edu>
Cc: Jan Kara <jack@suse.cz>
Acked-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
Marcin Slusarz
2008-02-08 04:20:32 -08:00
committato da Linus Torvalds
parent 6c79e987d6
commit dc5d39be6d
2 ha cambiato i file con 23 aggiunte e 15 eliminazioni

Vedi File

@@ -43,19 +43,6 @@ static inline struct udf_sb_info *UDF_SB(struct super_block *sb)
struct logicalVolIntegrityDescImpUse *udf_sb_lvidiu(struct udf_sb_info *sbi);
#define UDF_SB_ALLOC_PARTMAPS(X,Y)\
{\
struct udf_sb_info *sbi = UDF_SB(X);\
sbi->s_partmaps = kmalloc(sizeof(struct udf_part_map) * Y, GFP_KERNEL);\
if (sbi->s_partmaps != NULL) {\
sbi->s_partitions = Y;\
memset(sbi->s_partmaps, 0x00, sizeof(struct udf_part_map) * Y);\
} else {\
sbi->s_partitions = 0;\
udf_error(X, __FUNCTION__, "Unable to allocate space for %d partition maps", Y);\
}\
}
#define UDF_SB_ALLOC_BITMAP(X,Y,Z)\
{\
struct udf_sb_info *sbi = UDF_SB(X);\