aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2010-10-20 11:25:59 -0400
committerJan Kara <jack@suse.cz>2011-01-06 11:03:54 -0500
commitf2a6cc1f146465e13f31d9163d542d1facf4e203 (patch)
tree85dd319f9a1ebef0a33114392b5dbfa2f39b3aeb
parentfab3c8581fc49998f8d0d349b70813d9712fb405 (diff)
udf: Convert UDF_SB(sb)->s_flags to use bitops
Use atomic bitops to manipulate with sb flags to make manipulation safe without any locking. Signed-off-by: Jan Kara <jack@suse.cz>
-rw-r--r--fs/udf/udf_sb.h20
1 files changed, 16 insertions, 4 deletions
diff --git a/fs/udf/udf_sb.h b/fs/udf/udf_sb.h
index d113b72c2768..9f38a6ca4fd5 100644
--- a/fs/udf/udf_sb.h
+++ b/fs/udf/udf_sb.h
@@ -2,6 +2,7 @@
2#define __LINUX_UDF_SB_H 2#define __LINUX_UDF_SB_H
3 3
4#include <linux/mutex.h> 4#include <linux/mutex.h>
5#include <linux/bitops.h>
5 6
6/* Since UDF 2.01 is ISO 13346 based... */ 7/* Since UDF 2.01 is ISO 13346 based... */
7#define UDF_SUPER_MAGIC 0x15013346 8#define UDF_SUPER_MAGIC 0x15013346
@@ -139,7 +140,7 @@ struct udf_sb_info {
139 __u16 s_udfrev; 140 __u16 s_udfrev;
140 141
141 /* Miscellaneous flags */ 142 /* Miscellaneous flags */
142 __u32 s_flags; 143 unsigned long s_flags;
143 144
144 /* Encoding info */ 145 /* Encoding info */
145 struct nls_table *s_nls_map; 146 struct nls_table *s_nls_map;
@@ -161,8 +162,19 @@ struct logicalVolIntegrityDescImpUse *udf_sb_lvidiu(struct udf_sb_info *sbi);
161 162
162int udf_compute_nr_groups(struct super_block *sb, u32 partition); 163int udf_compute_nr_groups(struct super_block *sb, u32 partition);
163 164
164#define UDF_QUERY_FLAG(X,Y) ( UDF_SB(X)->s_flags & ( 1 << (Y) ) ) 165static inline int UDF_QUERY_FLAG(struct super_block *sb, int flag)
165#define UDF_SET_FLAG(X,Y) ( UDF_SB(X)->s_flags |= ( 1 << (Y) ) ) 166{
166#define UDF_CLEAR_FLAG(X,Y) ( UDF_SB(X)->s_flags &= ~( 1 << (Y) ) ) 167 return test_bit(flag, &UDF_SB(sb)->s_flags);
168}
169
170static inline void UDF_SET_FLAG(struct super_block *sb, int flag)
171{
172 set_bit(flag, &UDF_SB(sb)->s_flags);
173}
174
175static inline void UDF_CLEAR_FLAG(struct super_block *sb, int flag)
176{
177 clear_bit(flag, &UDF_SB(sb)->s_flags);
178}
167 179
168#endif /* __LINUX_UDF_SB_H */ 180#endif /* __LINUX_UDF_SB_H */