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>
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
#define __LINUX_UDF_SB_H
|
#define __LINUX_UDF_SB_H
|
||||||
|
|
||||||
#include <linux/mutex.h>
|
#include <linux/mutex.h>
|
||||||
|
#include <linux/bitops.h>
|
||||||
|
|
||||||
/* Since UDF 2.01 is ISO 13346 based... */
|
/* Since UDF 2.01 is ISO 13346 based... */
|
||||||
#define UDF_SUPER_MAGIC 0x15013346
|
#define UDF_SUPER_MAGIC 0x15013346
|
||||||
@@ -139,7 +140,7 @@ struct udf_sb_info {
|
|||||||
__u16 s_udfrev;
|
__u16 s_udfrev;
|
||||||
|
|
||||||
/* Miscellaneous flags */
|
/* Miscellaneous flags */
|
||||||
__u32 s_flags;
|
unsigned long s_flags;
|
||||||
|
|
||||||
/* Encoding info */
|
/* Encoding info */
|
||||||
struct nls_table *s_nls_map;
|
struct nls_table *s_nls_map;
|
||||||
@@ -161,8 +162,19 @@ struct logicalVolIntegrityDescImpUse *udf_sb_lvidiu(struct udf_sb_info *sbi);
|
|||||||
|
|
||||||
int udf_compute_nr_groups(struct super_block *sb, u32 partition);
|
int udf_compute_nr_groups(struct super_block *sb, u32 partition);
|
||||||
|
|
||||||
#define UDF_QUERY_FLAG(X,Y) ( UDF_SB(X)->s_flags & ( 1 << (Y) ) )
|
static inline int UDF_QUERY_FLAG(struct super_block *sb, int flag)
|
||||||
#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) ) )
|
return test_bit(flag, &UDF_SB(sb)->s_flags);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void UDF_SET_FLAG(struct super_block *sb, int flag)
|
||||||
|
{
|
||||||
|
set_bit(flag, &UDF_SB(sb)->s_flags);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void UDF_CLEAR_FLAG(struct super_block *sb, int flag)
|
||||||
|
{
|
||||||
|
clear_bit(flag, &UDF_SB(sb)->s_flags);
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* __LINUX_UDF_SB_H */
|
#endif /* __LINUX_UDF_SB_H */
|
||||||
|
Reference in New Issue
Block a user