diff options
author | Christoph Hellwig <hch@lst.de> | 2009-06-08 04:07:45 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2009-06-11 21:36:16 -0400 |
commit | ad43ffdeea0a7bd3e6036c4aeec2e6699aef8ac7 (patch) | |
tree | dcab8568dca72f130287dbe356c0fe0d7afe4ab7 /fs/sysv/inode.c | |
parent | 7fbc6df0e7a561a313f49faa77829d5de45a97f8 (diff) |
sysv: add ->sync_fs
Add a ->sync_fs method for data integrity syncs, and reimplement
->write_super ontop of it.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/sysv/inode.c')
-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 | }; |