diff options
author | Christoph Hellwig <hch@tuxera.com> | 2010-09-30 23:45:20 -0400 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2010-09-30 23:45:20 -0400 |
commit | 84adede31267af37141da2b2b04293c5ea8af7ae (patch) | |
tree | 41c1a3e28fab11baca330232bacbff3085afde82 /fs/hfsplus/super.c | |
parent | 7ac9fb9c2a50963b699b3548e6f00698c1554dc6 (diff) |
hfsplus: use atomic bitops for the superblock flags
The flags in the HFS+-specific superlock do get modified during runtime,
use atomic bitops to make the modifications SMP safe.
Signed-off-by: Christoph Hellwig <hch@tuxera.com>
Diffstat (limited to 'fs/hfsplus/super.c')
-rw-r--r-- | fs/hfsplus/super.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/fs/hfsplus/super.c b/fs/hfsplus/super.c index b766c170e4d8..9a88d7536103 100644 --- a/fs/hfsplus/super.c +++ b/fs/hfsplus/super.c | |||
@@ -119,7 +119,7 @@ static int hfsplus_system_write_inode(struct inode *inode) | |||
119 | } | 119 | } |
120 | 120 | ||
121 | if (fork->total_size != cpu_to_be64(inode->i_size)) { | 121 | if (fork->total_size != cpu_to_be64(inode->i_size)) { |
122 | sbi->flags |= HFSPLUS_SB_WRITEBACKUP; | 122 | set_bit(HFSPLUS_SB_WRITEBACKUP, &sbi->flags); |
123 | inode->i_sb->s_dirt = 1; | 123 | inode->i_sb->s_dirt = 1; |
124 | } | 124 | } |
125 | hfsplus_inode_write_fork(inode, fork); | 125 | hfsplus_inode_write_fork(inode, fork); |
@@ -170,7 +170,7 @@ int hfsplus_sync_fs(struct super_block *sb, int wait) | |||
170 | vhdr->file_count = cpu_to_be32(sbi->file_count); | 170 | vhdr->file_count = cpu_to_be32(sbi->file_count); |
171 | 171 | ||
172 | mark_buffer_dirty(sbi->s_vhbh); | 172 | mark_buffer_dirty(sbi->s_vhbh); |
173 | if (sbi->flags & HFSPLUS_SB_WRITEBACKUP) { | 173 | if (test_and_clear_bit(HFSPLUS_SB_WRITEBACKUP, &sbi->flags)) { |
174 | if (sbi->sect_count) { | 174 | if (sbi->sect_count) { |
175 | struct buffer_head *bh; | 175 | struct buffer_head *bh; |
176 | u32 block, offset; | 176 | u32 block, offset; |
@@ -192,7 +192,6 @@ int hfsplus_sync_fs(struct super_block *sb, int wait) | |||
192 | printk(KERN_WARNING "hfs: backup not found!\n"); | 192 | printk(KERN_WARNING "hfs: backup not found!\n"); |
193 | } | 193 | } |
194 | } | 194 | } |
195 | sbi->flags &= ~HFSPLUS_SB_WRITEBACKUP; | ||
196 | } | 195 | } |
197 | mutex_unlock(&sbi->alloc_mutex); | 196 | mutex_unlock(&sbi->alloc_mutex); |
198 | mutex_unlock(&sbi->vh_mutex); | 197 | mutex_unlock(&sbi->vh_mutex); |
@@ -276,7 +275,7 @@ static int hfsplus_remount(struct super_block *sb, int *flags, char *data) | |||
276 | "running fsck.hfsplus is recommended. leaving read-only.\n"); | 275 | "running fsck.hfsplus is recommended. leaving read-only.\n"); |
277 | sb->s_flags |= MS_RDONLY; | 276 | sb->s_flags |= MS_RDONLY; |
278 | *flags |= MS_RDONLY; | 277 | *flags |= MS_RDONLY; |
279 | } else if (sbi.flags & HFSPLUS_SB_FORCE) { | 278 | } else if (test_bit(HFSPLUS_SB_FORCE, &sbi.flags)) { |
280 | /* nothing */ | 279 | /* nothing */ |
281 | } else if (vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_SOFTLOCK)) { | 280 | } else if (vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_SOFTLOCK)) { |
282 | printk(KERN_WARNING "hfs: filesystem is marked locked, leaving read-only.\n"); | 281 | printk(KERN_WARNING "hfs: filesystem is marked locked, leaving read-only.\n"); |
@@ -376,7 +375,7 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent) | |||
376 | printk(KERN_WARNING "hfs: Filesystem was not cleanly unmounted, " | 375 | printk(KERN_WARNING "hfs: Filesystem was not cleanly unmounted, " |
377 | "running fsck.hfsplus is recommended. mounting read-only.\n"); | 376 | "running fsck.hfsplus is recommended. mounting read-only.\n"); |
378 | sb->s_flags |= MS_RDONLY; | 377 | sb->s_flags |= MS_RDONLY; |
379 | } else if (sbi->flags & HFSPLUS_SB_FORCE) { | 378 | } else if (test_and_clear_bit(HFSPLUS_SB_FORCE, &sbi->flags)) { |
380 | /* nothing */ | 379 | /* nothing */ |
381 | } else if (vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_SOFTLOCK)) { | 380 | } else if (vhdr->attributes & cpu_to_be32(HFSPLUS_VOL_SOFTLOCK)) { |
382 | printk(KERN_WARNING "hfs: Filesystem is marked locked, mounting read-only.\n"); | 381 | printk(KERN_WARNING "hfs: Filesystem is marked locked, mounting read-only.\n"); |
@@ -386,7 +385,6 @@ static int hfsplus_fill_super(struct super_block *sb, void *data, int silent) | |||
386 | "use the force option at your own risk, mounting read-only.\n"); | 385 | "use the force option at your own risk, mounting read-only.\n"); |
387 | sb->s_flags |= MS_RDONLY; | 386 | sb->s_flags |= MS_RDONLY; |
388 | } | 387 | } |
389 | sbi->flags &= ~HFSPLUS_SB_FORCE; | ||
390 | 388 | ||
391 | /* Load metadata objects (B*Trees) */ | 389 | /* Load metadata objects (B*Trees) */ |
392 | sbi->ext_tree = hfs_btree_open(sb, HFSPLUS_EXT_CNID); | 390 | sbi->ext_tree = hfs_btree_open(sb, HFSPLUS_EXT_CNID); |