diff options
Diffstat (limited to 'fs/hfsplus')
-rw-r--r-- | fs/hfsplus/super.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/fs/hfsplus/super.c b/fs/hfsplus/super.c index 1aab8aa7801e..9fc3af0c0dab 100644 --- a/fs/hfsplus/super.c +++ b/fs/hfsplus/super.c | |||
@@ -152,7 +152,7 @@ static void hfsplus_clear_inode(struct inode *inode) | |||
152 | } | 152 | } |
153 | } | 153 | } |
154 | 154 | ||
155 | static void hfsplus_write_super(struct super_block *sb) | 155 | static int hfsplus_sync_fs(struct super_block *sb, int wait) |
156 | { | 156 | { |
157 | struct hfsplus_vh *vhdr = HFSPLUS_SB(sb).s_vhdr; | 157 | struct hfsplus_vh *vhdr = HFSPLUS_SB(sb).s_vhdr; |
158 | 158 | ||
@@ -160,9 +160,6 @@ static void hfsplus_write_super(struct super_block *sb) | |||
160 | 160 | ||
161 | lock_super(sb); | 161 | lock_super(sb); |
162 | sb->s_dirt = 0; | 162 | sb->s_dirt = 0; |
163 | if (sb->s_flags & MS_RDONLY) | ||
164 | /* warn? */ | ||
165 | goto out; | ||
166 | 163 | ||
167 | vhdr->free_blocks = cpu_to_be32(HFSPLUS_SB(sb).free_blocks); | 164 | vhdr->free_blocks = cpu_to_be32(HFSPLUS_SB(sb).free_blocks); |
168 | vhdr->next_alloc = cpu_to_be32(HFSPLUS_SB(sb).next_alloc); | 165 | vhdr->next_alloc = cpu_to_be32(HFSPLUS_SB(sb).next_alloc); |
@@ -194,8 +191,16 @@ static void hfsplus_write_super(struct super_block *sb) | |||
194 | } | 191 | } |
195 | HFSPLUS_SB(sb).flags &= ~HFSPLUS_SB_WRITEBACKUP; | 192 | HFSPLUS_SB(sb).flags &= ~HFSPLUS_SB_WRITEBACKUP; |
196 | } | 193 | } |
197 | out: | ||
198 | unlock_super(sb); | 194 | unlock_super(sb); |
195 | return 0; | ||
196 | } | ||
197 | |||
198 | static void hfsplus_write_super(struct super_block *sb) | ||
199 | { | ||
200 | if (!(sb->s_flags & MS_RDONLY)) | ||
201 | hfsplus_sync_fs(sb, 1); | ||
202 | else | ||
203 | sb->s_dirt = 0; | ||
199 | } | 204 | } |
200 | 205 | ||
201 | static void hfsplus_put_super(struct super_block *sb) | 206 | static void hfsplus_put_super(struct super_block *sb) |
@@ -290,6 +295,7 @@ static const struct super_operations hfsplus_sops = { | |||
290 | .clear_inode = hfsplus_clear_inode, | 295 | .clear_inode = hfsplus_clear_inode, |
291 | .put_super = hfsplus_put_super, | 296 | .put_super = hfsplus_put_super, |
292 | .write_super = hfsplus_write_super, | 297 | .write_super = hfsplus_write_super, |
298 | .sync_fs = hfsplus_sync_fs, | ||
293 | .statfs = hfsplus_statfs, | 299 | .statfs = hfsplus_statfs, |
294 | .remount_fs = hfsplus_remount, | 300 | .remount_fs = hfsplus_remount, |
295 | .show_options = hfsplus_show_options, | 301 | .show_options = hfsplus_show_options, |