aboutsummaryrefslogtreecommitdiffstats
path: root/fs/udf/udf_sb.h
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@infradead.org>2007-07-23 05:20:10 -0400
committerDavid Woodhouse <dwmw2@infradead.org>2007-07-23 05:20:10 -0400
commit39fe5434cb9de5da40510028b17b96bc4eb312b3 (patch)
tree7a02a317b9ad57da51ca99887c119e779ccf3f13 /fs/udf/udf_sb.h
parent0fc72b81d3111d114ab378935b1cf07680ca1289 (diff)
parentf695baf2df9e0413d3521661070103711545207a (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'fs/udf/udf_sb.h')
-rw-r--r--fs/udf/udf_sb.h20
1 files changed, 6 insertions, 14 deletions
diff --git a/fs/udf/udf_sb.h b/fs/udf/udf_sb.h
index 3b2e6c8cb151..3e937d3fb8f9 100644
--- a/fs/udf/udf_sb.h
+++ b/fs/udf/udf_sb.h
@@ -41,8 +41,7 @@ static inline struct udf_sb_info *UDF_SB(struct super_block *sb)
41 41
42#define UDF_SB_FREE(X)\ 42#define UDF_SB_FREE(X)\
43{\ 43{\
44 if (UDF_SB(X))\ 44 if (UDF_SB(X)) {\
45 {\
46 kfree(UDF_SB_PARTMAPS(X));\ 45 kfree(UDF_SB_PARTMAPS(X));\
47 UDF_SB_PARTMAPS(X) = NULL;\ 46 UDF_SB_PARTMAPS(X) = NULL;\
48 }\ 47 }\
@@ -51,13 +50,10 @@ static inline struct udf_sb_info *UDF_SB(struct super_block *sb)
51#define UDF_SB_ALLOC_PARTMAPS(X,Y)\ 50#define UDF_SB_ALLOC_PARTMAPS(X,Y)\
52{\ 51{\
53 UDF_SB_PARTMAPS(X) = kmalloc(sizeof(struct udf_part_map) * Y, GFP_KERNEL);\ 52 UDF_SB_PARTMAPS(X) = kmalloc(sizeof(struct udf_part_map) * Y, GFP_KERNEL);\
54 if (UDF_SB_PARTMAPS(X) != NULL)\ 53 if (UDF_SB_PARTMAPS(X) != NULL) {\
55 {\
56 UDF_SB_NUMPARTS(X) = Y;\ 54 UDF_SB_NUMPARTS(X) = Y;\
57 memset(UDF_SB_PARTMAPS(X), 0x00, sizeof(struct udf_part_map) * Y);\ 55 memset(UDF_SB_PARTMAPS(X), 0x00, sizeof(struct udf_part_map) * Y);\
58 }\ 56 } else {\
59 else\
60 {\
61 UDF_SB_NUMPARTS(X) = 0;\ 57 UDF_SB_NUMPARTS(X) = 0;\
62 udf_error(X, __FUNCTION__, "Unable to allocate space for %d partition maps", Y);\ 58 udf_error(X, __FUNCTION__, "Unable to allocate space for %d partition maps", Y);\
63 }\ 59 }\
@@ -72,15 +68,12 @@ static inline struct udf_sb_info *UDF_SB(struct super_block *sb)
72 UDF_SB_PARTMAPS(X)[(Y)].Z.s_bitmap = kmalloc(size, GFP_KERNEL);\ 68 UDF_SB_PARTMAPS(X)[(Y)].Z.s_bitmap = kmalloc(size, GFP_KERNEL);\
73 else\ 69 else\
74 UDF_SB_PARTMAPS(X)[(Y)].Z.s_bitmap = vmalloc(size);\ 70 UDF_SB_PARTMAPS(X)[(Y)].Z.s_bitmap = vmalloc(size);\
75 if (UDF_SB_PARTMAPS(X)[(Y)].Z.s_bitmap != NULL)\ 71 if (UDF_SB_PARTMAPS(X)[(Y)].Z.s_bitmap != NULL) {\
76 {\
77 memset(UDF_SB_PARTMAPS(X)[(Y)].Z.s_bitmap, 0x00, size);\ 72 memset(UDF_SB_PARTMAPS(X)[(Y)].Z.s_bitmap, 0x00, size);\
78 UDF_SB_PARTMAPS(X)[(Y)].Z.s_bitmap->s_block_bitmap =\ 73 UDF_SB_PARTMAPS(X)[(Y)].Z.s_bitmap->s_block_bitmap =\
79 (struct buffer_head **)(UDF_SB_PARTMAPS(X)[(Y)].Z.s_bitmap + 1);\ 74 (struct buffer_head **)(UDF_SB_PARTMAPS(X)[(Y)].Z.s_bitmap + 1);\
80 UDF_SB_PARTMAPS(X)[(Y)].Z.s_bitmap->s_nr_groups = nr_groups;\ 75 UDF_SB_PARTMAPS(X)[(Y)].Z.s_bitmap->s_nr_groups = nr_groups;\
81 }\ 76 } else {\
82 else\
83 {\
84 udf_error(X, __FUNCTION__, "Unable to allocate space for bitmap and %d buffer_head pointers", nr_groups);\ 77 udf_error(X, __FUNCTION__, "Unable to allocate space for bitmap and %d buffer_head pointers", nr_groups);\
85 }\ 78 }\
86} 79}
@@ -90,8 +83,7 @@ static inline struct udf_sb_info *UDF_SB(struct super_block *sb)
90 int i;\ 83 int i;\
91 int nr_groups = UDF_SB_BITMAP_NR_GROUPS(X,Y,Z);\ 84 int nr_groups = UDF_SB_BITMAP_NR_GROUPS(X,Y,Z);\
92 int size = sizeof(struct udf_bitmap) + (sizeof(struct buffer_head *) * nr_groups);\ 85 int size = sizeof(struct udf_bitmap) + (sizeof(struct buffer_head *) * nr_groups);\
93 for (i=0; i<nr_groups; i++)\ 86 for (i = 0; i < nr_groups; i++) {\
94 {\
95 if (UDF_SB_BITMAP(X,Y,Z,i))\ 87 if (UDF_SB_BITMAP(X,Y,Z,i))\
96 brelse(UDF_SB_BITMAP(X,Y,Z,i));\ 88 brelse(UDF_SB_BITMAP(X,Y,Z,i));\
97 }\ 89 }\