diff options
Diffstat (limited to 'fs/sysv')
-rw-r--r-- | fs/sysv/inode.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/fs/sysv/inode.c b/fs/sysv/inode.c index 425c976cfcd2..479923456a54 100644 --- a/fs/sysv/inode.c +++ b/fs/sysv/inode.c | |||
@@ -31,16 +31,13 @@ | |||
31 | #include <asm/byteorder.h> | 31 | #include <asm/byteorder.h> |
32 | #include "sysv.h" | 32 | #include "sysv.h" |
33 | 33 | ||
34 | /* This is only called on sync() and umount(), when s_dirt=1. */ | 34 | static int sysv_sync_fs(struct super_block *sb, int wait) |
35 | static void sysv_write_super(struct super_block *sb) | ||
36 | { | 35 | { |
37 | struct sysv_sb_info *sbi = SYSV_SB(sb); | 36 | struct sysv_sb_info *sbi = SYSV_SB(sb); |
38 | unsigned long time = get_seconds(), old_time; | 37 | unsigned long time = get_seconds(), old_time; |
39 | 38 | ||
40 | lock_super(sb); | 39 | lock_super(sb); |
41 | lock_kernel(); | 40 | lock_kernel(); |
42 | if (sb->s_flags & MS_RDONLY) | ||
43 | goto clean; | ||
44 | 41 | ||
45 | /* | 42 | /* |
46 | * If we are going to write out the super block, | 43 | * If we are going to write out the super block, |
@@ -54,10 +51,19 @@ static void sysv_write_super(struct super_block *sb) | |||
54 | *sbi->s_sb_time = cpu_to_fs32(sbi, time); | 51 | *sbi->s_sb_time = cpu_to_fs32(sbi, time); |
55 | mark_buffer_dirty(sbi->s_bh2); | 52 | mark_buffer_dirty(sbi->s_bh2); |
56 | } | 53 | } |
57 | clean: | 54 | |
58 | sb->s_dirt = 0; | ||
59 | unlock_kernel(); | 55 | unlock_kernel(); |
60 | unlock_super(sb); | 56 | unlock_super(sb); |
57 | |||
58 | return 0; | ||
59 | } | ||
60 | |||
61 | static void sysv_write_super(struct super_block *sb) | ||
62 | { | ||
63 | if (!(sb->s_flags & MS_RDONLY)) | ||
64 | sysv_sync_fs(sb, 1); | ||
65 | else | ||
66 | sb->s_dirt = 0; | ||
61 | } | 67 | } |
62 | 68 | ||
63 | static int sysv_remount(struct super_block *sb, int *flags, char *data) | 69 | static int sysv_remount(struct super_block *sb, int *flags, char *data) |
@@ -345,6 +351,7 @@ const struct super_operations sysv_sops = { | |||
345 | .delete_inode = sysv_delete_inode, | 351 | .delete_inode = sysv_delete_inode, |
346 | .put_super = sysv_put_super, | 352 | .put_super = sysv_put_super, |
347 | .write_super = sysv_write_super, | 353 | .write_super = sysv_write_super, |
354 | .sync_fs = sysv_sync_fs, | ||
348 | .remount_fs = sysv_remount, | 355 | .remount_fs = sysv_remount, |
349 | .statfs = sysv_statfs, | 356 | .statfs = sysv_statfs, |
350 | }; | 357 | }; |