summaryrefslogtreecommitdiffstats
path: root/fs/udf/udf_sb.h
diff options
context:
space:
mode:
authorMarcin Slusarz <marcin.slusarz@gmail.com>2008-02-08 13:20:33 +0100
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-08 18:22:35 +0100
commit66e1da3f47d5aaa278d116e72d2f8e8f204cdca3 (patch)
treeaab724a6ccc5da3f6d64eb3cff3e9ac92b0b940b /fs/udf/udf_sb.h
parentudf: check if udf_load_logicalvol failed (diff)
downloadlinux-66e1da3f47d5aaa278d116e72d2f8e8f204cdca3.tar.xz
linux-66e1da3f47d5aaa278d116e72d2f8e8f204cdca3.zip
udf: convert macros related to bitmaps to functions
convert UDF_SB_ALLOC_BITMAP macro to udf_sb_alloc_bitmap function convert UDF_SB_FREE_BITMAP macro to udf_sb_free_bitmap function Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com> Cc: Ben Fennema <bfennema@falcon.csc.calpoly.edu> Acked-by: Jan Kara <jack@suse.cz> Cc: Christoph Hellwig <hch@infradead.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to '')
-rw-r--r--fs/udf/udf_sb.h38
1 files changed, 0 insertions, 38 deletions
diff --git a/fs/udf/udf_sb.h b/fs/udf/udf_sb.h
index 4d3bd77ea94b..2c05f8277fd8 100644
--- a/fs/udf/udf_sb.h
+++ b/fs/udf/udf_sb.h
@@ -43,46 +43,8 @@ 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_BITMAP(X,Y,Z)\
-{\
- struct udf_sb_info *sbi = UDF_SB(X);\
- int nr_groups = ((sbi->s_partmaps[(Y)].s_partition_len + (sizeof(struct spaceBitmapDesc) << 3) +\
- ((X)->s_blocksize * 8) - 1) / ((X)->s_blocksize * 8));\
- int size = sizeof(struct udf_bitmap) + (sizeof(struct buffer_head *) * nr_groups);\
- if (size <= PAGE_SIZE)\
- sbi->s_partmaps[(Y)].Z.s_bitmap = kmalloc(size, GFP_KERNEL);\
- else\
- sbi->s_partmaps[(Y)].Z.s_bitmap = vmalloc(size);\
- if (sbi->s_partmaps[(Y)].Z.s_bitmap != NULL) {\
- memset(sbi->s_partmaps[(Y)].Z.s_bitmap, 0x00, size);\
- sbi->s_partmaps[(Y)].Z.s_bitmap->s_block_bitmap =\
- (struct buffer_head **)(sbi->s_partmaps[(Y)].Z.s_bitmap + 1);\
- sbi->s_partmaps[(Y)].Z.s_bitmap->s_nr_groups = nr_groups;\
- } else {\
- udf_error(X, __FUNCTION__, "Unable to allocate space for bitmap and %d buffer_head pointers", nr_groups);\
- }\
-}
-
-#define UDF_SB_FREE_BITMAP(X,Y,Z)\
-{\
- int i;\
- int nr_groups = UDF_SB_BITMAP_NR_GROUPS(X,Y,Z);\
- int size = sizeof(struct udf_bitmap) + (sizeof(struct buffer_head *) * nr_groups);\
- for (i = 0; i < nr_groups; i++) {\
- if (UDF_SB_BITMAP(X,Y,Z,i))\
- brelse(UDF_SB_BITMAP(X,Y,Z,i));\
- }\
- if (size <= PAGE_SIZE)\
- kfree(UDF_SB(X)->s_partmaps[Y].Z.s_bitmap);\
- else\
- vfree(UDF_SB(X)->s_partmaps[Y].Z.s_bitmap);\
-}
-
#define UDF_QUERY_FLAG(X,Y) ( UDF_SB(X)->s_flags & ( 1 << (Y) ) )
#define UDF_SET_FLAG(X,Y) ( UDF_SB(X)->s_flags |= ( 1 << (Y) ) )
#define UDF_CLEAR_FLAG(X,Y) ( UDF_SB(X)->s_flags &= ~( 1 << (Y) ) )
-#define UDF_SB_BITMAP(X,Y,Z,I) ( UDF_SB(X)->s_partmaps[(Y)].Z.s_bitmap->s_block_bitmap[I] )
-#define UDF_SB_BITMAP_NR_GROUPS(X,Y,Z) ( UDF_SB(X)->s_partmaps[(Y)].Z.s_bitmap->s_nr_groups )
-
#endif /* __LINUX_UDF_SB_H */