diff options
Diffstat (limited to 'fs/sync.c')
-rw-r--r-- | fs/sync.c | 15 |
1 files changed, 6 insertions, 9 deletions
@@ -27,11 +27,10 @@ | |||
27 | * wait == 1 case since in that case write_inode() functions do | 27 | * wait == 1 case since in that case write_inode() functions do |
28 | * sync_dirty_buffer() and thus effectively write one block at a time. | 28 | * sync_dirty_buffer() and thus effectively write one block at a time. |
29 | */ | 29 | */ |
30 | static int __sync_filesystem(struct super_block *sb, int wait, | 30 | static int __sync_filesystem(struct super_block *sb, int wait) |
31 | unsigned long start) | ||
32 | { | 31 | { |
33 | if (wait) | 32 | if (wait) |
34 | sync_inodes_sb(sb, start); | 33 | sync_inodes_sb(sb); |
35 | else | 34 | else |
36 | writeback_inodes_sb(sb, WB_REASON_SYNC); | 35 | writeback_inodes_sb(sb, WB_REASON_SYNC); |
37 | 36 | ||
@@ -48,7 +47,6 @@ static int __sync_filesystem(struct super_block *sb, int wait, | |||
48 | int sync_filesystem(struct super_block *sb) | 47 | int sync_filesystem(struct super_block *sb) |
49 | { | 48 | { |
50 | int ret; | 49 | int ret; |
51 | unsigned long start = jiffies; | ||
52 | 50 | ||
53 | /* | 51 | /* |
54 | * We need to be protected against the filesystem going from | 52 | * We need to be protected against the filesystem going from |
@@ -62,17 +60,17 @@ int sync_filesystem(struct super_block *sb) | |||
62 | if (sb->s_flags & MS_RDONLY) | 60 | if (sb->s_flags & MS_RDONLY) |
63 | return 0; | 61 | return 0; |
64 | 62 | ||
65 | ret = __sync_filesystem(sb, 0, start); | 63 | ret = __sync_filesystem(sb, 0); |
66 | if (ret < 0) | 64 | if (ret < 0) |
67 | return ret; | 65 | return ret; |
68 | return __sync_filesystem(sb, 1, start); | 66 | return __sync_filesystem(sb, 1); |
69 | } | 67 | } |
70 | EXPORT_SYMBOL_GPL(sync_filesystem); | 68 | EXPORT_SYMBOL_GPL(sync_filesystem); |
71 | 69 | ||
72 | static void sync_inodes_one_sb(struct super_block *sb, void *arg) | 70 | static void sync_inodes_one_sb(struct super_block *sb, void *arg) |
73 | { | 71 | { |
74 | if (!(sb->s_flags & MS_RDONLY)) | 72 | if (!(sb->s_flags & MS_RDONLY)) |
75 | sync_inodes_sb(sb, *((unsigned long *)arg)); | 73 | sync_inodes_sb(sb); |
76 | } | 74 | } |
77 | 75 | ||
78 | static void sync_fs_one_sb(struct super_block *sb, void *arg) | 76 | static void sync_fs_one_sb(struct super_block *sb, void *arg) |
@@ -104,10 +102,9 @@ static void fdatawait_one_bdev(struct block_device *bdev, void *arg) | |||
104 | SYSCALL_DEFINE0(sync) | 102 | SYSCALL_DEFINE0(sync) |
105 | { | 103 | { |
106 | int nowait = 0, wait = 1; | 104 | int nowait = 0, wait = 1; |
107 | unsigned long start = jiffies; | ||
108 | 105 | ||
109 | wakeup_flusher_threads(0, WB_REASON_SYNC); | 106 | wakeup_flusher_threads(0, WB_REASON_SYNC); |
110 | iterate_supers(sync_inodes_one_sb, &start); | 107 | iterate_supers(sync_inodes_one_sb, NULL); |
111 | iterate_supers(sync_fs_one_sb, &nowait); | 108 | iterate_supers(sync_fs_one_sb, &nowait); |
112 | iterate_supers(sync_fs_one_sb, &wait); | 109 | iterate_supers(sync_fs_one_sb, &wait); |
113 | iterate_bdevs(fdatawrite_one_bdev, NULL); | 110 | iterate_bdevs(fdatawrite_one_bdev, NULL); |