diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-08-04 11:32:46 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-08-04 11:32:46 -0400 |
commit | e7882d6c40874a5b5033ca85f7508a602a60b662 (patch) | |
tree | d477954bbc6ad932cda97fca1def0f5b48a2a378 | |
parent | d8579fd834de224d2833ce2e82e0f691cc67e8f7 (diff) | |
parent | fe7c80518e34d1786f4a940ce673a0bfcbe53298 (diff) |
Merge branch 'for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull VFS fixes and cleanups from Al Viro.
Most of this is the series to remove sync_supers() and the
->write_supers VFS callback from Artem Bityutskiy. One commit to do the
actual removal work, a whole series of commits to fix up stale comments
etc all over the tree.
There's also a regression fix for an incorrect use of mnt_drop_write()
in do_dentry_open().
* 'for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
missed mnt_drop_write() in do_dentry_open()
UBIFS: nuke pdflush from comments
gfs2: nuke pdflush from comments
drbd: nuke pdflush from comments
nilfs2: nuke write_super from comments
hfs: nuke write_super from comments
vfs: nuke pdflush from comments
jbd/jbd2: nuke write_super from comments
btrfs: nuke pdflush from comments
btrfs: nuke write_super from comments
ext4: nuke pdflush from comments
ext4: nuke write_super from comments
ext3: nuke write_super from comments
Documentation: fix the VM knobs descritpion WRT pdflush
Documentation: get rid of write_super
vfs: kill write_super and sync_supers
31 files changed, 38 insertions, 194 deletions
diff --git a/Documentation/DocBook/filesystems.tmpl b/Documentation/DocBook/filesystems.tmpl index 3fca32c41927..25b58efd955d 100644 --- a/Documentation/DocBook/filesystems.tmpl +++ b/Documentation/DocBook/filesystems.tmpl | |||
@@ -224,8 +224,8 @@ all your transactions. | |||
224 | </para> | 224 | </para> |
225 | 225 | ||
226 | <para> | 226 | <para> |
227 | Then at umount time , in your put_super() (2.4) or write_super() (2.5) | 227 | Then at umount time , in your put_super() you can then call journal_destroy() |
228 | you can then call journal_destroy() to clean up your in-core journal object. | 228 | to clean up your in-core journal object. |
229 | </para> | 229 | </para> |
230 | 230 | ||
231 | <para> | 231 | <para> |
diff --git a/Documentation/filesystems/Locking b/Documentation/filesystems/Locking index 0f103e39b4f6..e540a24e5d06 100644 --- a/Documentation/filesystems/Locking +++ b/Documentation/filesystems/Locking | |||
@@ -114,7 +114,6 @@ prototypes: | |||
114 | int (*drop_inode) (struct inode *); | 114 | int (*drop_inode) (struct inode *); |
115 | void (*evict_inode) (struct inode *); | 115 | void (*evict_inode) (struct inode *); |
116 | void (*put_super) (struct super_block *); | 116 | void (*put_super) (struct super_block *); |
117 | void (*write_super) (struct super_block *); | ||
118 | int (*sync_fs)(struct super_block *sb, int wait); | 117 | int (*sync_fs)(struct super_block *sb, int wait); |
119 | int (*freeze_fs) (struct super_block *); | 118 | int (*freeze_fs) (struct super_block *); |
120 | int (*unfreeze_fs) (struct super_block *); | 119 | int (*unfreeze_fs) (struct super_block *); |
@@ -136,7 +135,6 @@ write_inode: | |||
136 | drop_inode: !!!inode->i_lock!!! | 135 | drop_inode: !!!inode->i_lock!!! |
137 | evict_inode: | 136 | evict_inode: |
138 | put_super: write | 137 | put_super: write |
139 | write_super: read | ||
140 | sync_fs: read | 138 | sync_fs: read |
141 | freeze_fs: write | 139 | freeze_fs: write |
142 | unfreeze_fs: write | 140 | unfreeze_fs: write |
diff --git a/Documentation/filesystems/porting b/Documentation/filesystems/porting index 2bef2b3843d1..0742feebc6e2 100644 --- a/Documentation/filesystems/porting +++ b/Documentation/filesystems/porting | |||
@@ -94,9 +94,8 @@ protected. | |||
94 | --- | 94 | --- |
95 | [mandatory] | 95 | [mandatory] |
96 | 96 | ||
97 | BKL is also moved from around sb operations. ->write_super() Is now called | 97 | BKL is also moved from around sb operations. BKL should have been shifted into |
98 | without BKL held. BKL should have been shifted into individual fs sb_op | 98 | individual fs sb_op functions. If you don't need it, remove it. |
99 | functions. If you don't need it, remove it. | ||
100 | 99 | ||
101 | --- | 100 | --- |
102 | [informational] | 101 | [informational] |
diff --git a/Documentation/filesystems/vfs.txt b/Documentation/filesystems/vfs.txt index 065aa2dc0835..2ee133e030c3 100644 --- a/Documentation/filesystems/vfs.txt +++ b/Documentation/filesystems/vfs.txt | |||
@@ -216,7 +216,6 @@ struct super_operations { | |||
216 | void (*drop_inode) (struct inode *); | 216 | void (*drop_inode) (struct inode *); |
217 | void (*delete_inode) (struct inode *); | 217 | void (*delete_inode) (struct inode *); |
218 | void (*put_super) (struct super_block *); | 218 | void (*put_super) (struct super_block *); |
219 | void (*write_super) (struct super_block *); | ||
220 | int (*sync_fs)(struct super_block *sb, int wait); | 219 | int (*sync_fs)(struct super_block *sb, int wait); |
221 | int (*freeze_fs) (struct super_block *); | 220 | int (*freeze_fs) (struct super_block *); |
222 | int (*unfreeze_fs) (struct super_block *); | 221 | int (*unfreeze_fs) (struct super_block *); |
@@ -273,9 +272,6 @@ or bottom half). | |||
273 | put_super: called when the VFS wishes to free the superblock | 272 | put_super: called when the VFS wishes to free the superblock |
274 | (i.e. unmount). This is called with the superblock lock held | 273 | (i.e. unmount). This is called with the superblock lock held |
275 | 274 | ||
276 | write_super: called when the VFS superblock needs to be written to | ||
277 | disc. This method is optional | ||
278 | |||
279 | sync_fs: called when VFS is writing out all dirty data associated with | 275 | sync_fs: called when VFS is writing out all dirty data associated with |
280 | a superblock. The second parameter indicates whether the method | 276 | a superblock. The second parameter indicates whether the method |
281 | should wait until the write out has been completed. Optional. | 277 | should wait until the write out has been completed. Optional. |
diff --git a/Documentation/laptops/laptop-mode.txt b/Documentation/laptops/laptop-mode.txt index 0bf25eebce94..4ebbfc3f1c6e 100644 --- a/Documentation/laptops/laptop-mode.txt +++ b/Documentation/laptops/laptop-mode.txt | |||
@@ -262,9 +262,9 @@ MINIMUM_BATTERY_MINUTES=10 | |||
262 | 262 | ||
263 | # | 263 | # |
264 | # Allowed dirty background ratio, in percent. Once DIRTY_RATIO has been | 264 | # Allowed dirty background ratio, in percent. Once DIRTY_RATIO has been |
265 | # exceeded, the kernel will wake pdflush which will then reduce the amount | 265 | # exceeded, the kernel will wake flusher threads which will then reduce the |
266 | # of dirty memory to dirty_background_ratio. Set this nice and low, so once | 266 | # amount of dirty memory to dirty_background_ratio. Set this nice and low, |
267 | # some writeout has commenced, we do a lot of it. | 267 | # so once some writeout has commenced, we do a lot of it. |
268 | # | 268 | # |
269 | #DIRTY_BACKGROUND_RATIO=5 | 269 | #DIRTY_BACKGROUND_RATIO=5 |
270 | 270 | ||
@@ -384,9 +384,9 @@ CPU_MAXFREQ=${CPU_MAXFREQ:-'slowest'} | |||
384 | 384 | ||
385 | # | 385 | # |
386 | # Allowed dirty background ratio, in percent. Once DIRTY_RATIO has been | 386 | # Allowed dirty background ratio, in percent. Once DIRTY_RATIO has been |
387 | # exceeded, the kernel will wake pdflush which will then reduce the amount | 387 | # exceeded, the kernel will wake flusher threads which will then reduce the |
388 | # of dirty memory to dirty_background_ratio. Set this nice and low, so once | 388 | # amount of dirty memory to dirty_background_ratio. Set this nice and low, |
389 | # some writeout has commenced, we do a lot of it. | 389 | # so once some writeout has commenced, we do a lot of it. |
390 | # | 390 | # |
391 | DIRTY_BACKGROUND_RATIO=${DIRTY_BACKGROUND_RATIO:-'5'} | 391 | DIRTY_BACKGROUND_RATIO=${DIRTY_BACKGROUND_RATIO:-'5'} |
392 | 392 | ||
diff --git a/Documentation/sysctl/vm.txt b/Documentation/sysctl/vm.txt index dcc2a94ae34e..078701fdbd4d 100644 --- a/Documentation/sysctl/vm.txt +++ b/Documentation/sysctl/vm.txt | |||
@@ -76,8 +76,8 @@ huge pages although processes will also directly compact memory as required. | |||
76 | 76 | ||
77 | dirty_background_bytes | 77 | dirty_background_bytes |
78 | 78 | ||
79 | Contains the amount of dirty memory at which the pdflush background writeback | 79 | Contains the amount of dirty memory at which the background kernel |
80 | daemon will start writeback. | 80 | flusher threads will start writeback. |
81 | 81 | ||
82 | Note: dirty_background_bytes is the counterpart of dirty_background_ratio. Only | 82 | Note: dirty_background_bytes is the counterpart of dirty_background_ratio. Only |
83 | one of them may be specified at a time. When one sysctl is written it is | 83 | one of them may be specified at a time. When one sysctl is written it is |
@@ -89,7 +89,7 @@ other appears as 0 when read. | |||
89 | dirty_background_ratio | 89 | dirty_background_ratio |
90 | 90 | ||
91 | Contains, as a percentage of total system memory, the number of pages at which | 91 | Contains, as a percentage of total system memory, the number of pages at which |
92 | the pdflush background writeback daemon will start writing out dirty data. | 92 | the background kernel flusher threads will start writing out dirty data. |
93 | 93 | ||
94 | ============================================================== | 94 | ============================================================== |
95 | 95 | ||
@@ -112,9 +112,9 @@ retained. | |||
112 | dirty_expire_centisecs | 112 | dirty_expire_centisecs |
113 | 113 | ||
114 | This tunable is used to define when dirty data is old enough to be eligible | 114 | This tunable is used to define when dirty data is old enough to be eligible |
115 | for writeout by the pdflush daemons. It is expressed in 100'ths of a second. | 115 | for writeout by the kernel flusher threads. It is expressed in 100'ths |
116 | Data which has been dirty in-memory for longer than this interval will be | 116 | of a second. Data which has been dirty in-memory for longer than this |
117 | written out next time a pdflush daemon wakes up. | 117 | interval will be written out next time a flusher thread wakes up. |
118 | 118 | ||
119 | ============================================================== | 119 | ============================================================== |
120 | 120 | ||
@@ -128,7 +128,7 @@ data. | |||
128 | 128 | ||
129 | dirty_writeback_centisecs | 129 | dirty_writeback_centisecs |
130 | 130 | ||
131 | The pdflush writeback daemons will periodically wake up and write `old' data | 131 | The kernel flusher threads will periodically wake up and write `old' data |
132 | out to disk. This tunable expresses the interval between those wakeups, in | 132 | out to disk. This tunable expresses the interval between those wakeups, in |
133 | 100'ths of a second. | 133 | 100'ths of a second. |
134 | 134 | ||
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c index 2e0e7fc1dbba..dbe6135a2abe 100644 --- a/drivers/block/drbd/drbd_main.c +++ b/drivers/block/drbd/drbd_main.c | |||
@@ -3537,9 +3537,9 @@ static void drbd_cleanup(void) | |||
3537 | } | 3537 | } |
3538 | 3538 | ||
3539 | /** | 3539 | /** |
3540 | * drbd_congested() - Callback for pdflush | 3540 | * drbd_congested() - Callback for the flusher thread |
3541 | * @congested_data: User data | 3541 | * @congested_data: User data |
3542 | * @bdi_bits: Bits pdflush is currently interested in | 3542 | * @bdi_bits: Bits the BDI flusher thread is currently interested in |
3543 | * | 3543 | * |
3544 | * Returns 1<<BDI_async_congested and/or 1<<BDI_sync_congested if we are congested. | 3544 | * Returns 1<<BDI_async_congested and/or 1<<BDI_sync_congested if we are congested. |
3545 | */ | 3545 | */ |
@@ -1312,7 +1312,7 @@ EXPORT_SYMBOL(bio_copy_kern); | |||
1312 | * Note that this code is very hard to test under normal circumstances because | 1312 | * Note that this code is very hard to test under normal circumstances because |
1313 | * direct-io pins the pages with get_user_pages(). This makes | 1313 | * direct-io pins the pages with get_user_pages(). This makes |
1314 | * is_page_cache_freeable return false, and the VM will not clean the pages. | 1314 | * is_page_cache_freeable return false, and the VM will not clean the pages. |
1315 | * But other code (eg, pdflush) could clean the pages if they are mapped | 1315 | * But other code (eg, flusher threads) could clean the pages if they are mapped |
1316 | * pagecache. | 1316 | * pagecache. |
1317 | * | 1317 | * |
1318 | * Simply disabling the call to bio_set_pages_dirty() is a good way to test the | 1318 | * Simply disabling the call to bio_set_pages_dirty() is a good way to test the |
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 83baec24946d..6e8f416773d4 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -324,7 +324,8 @@ static noinline int add_async_extent(struct async_cow *cow, | |||
324 | * If this code finds it can't get good compression, it puts an | 324 | * If this code finds it can't get good compression, it puts an |
325 | * entry onto the work queue to write the uncompressed bytes. This | 325 | * entry onto the work queue to write the uncompressed bytes. This |
326 | * makes sure that both compressed inodes and uncompressed inodes | 326 | * makes sure that both compressed inodes and uncompressed inodes |
327 | * are written in the same order that pdflush sent them down. | 327 | * are written in the same order that the flusher thread sent them |
328 | * down. | ||
328 | */ | 329 | */ |
329 | static noinline int compress_file_range(struct inode *inode, | 330 | static noinline int compress_file_range(struct inode *inode, |
330 | struct page *locked_page, | 331 | struct page *locked_page, |
diff --git a/fs/btrfs/ordered-data.c b/fs/btrfs/ordered-data.c index 643335a4fe3c..051c7fe551dd 100644 --- a/fs/btrfs/ordered-data.c +++ b/fs/btrfs/ordered-data.c | |||
@@ -596,7 +596,7 @@ void btrfs_start_ordered_extent(struct inode *inode, | |||
596 | /* | 596 | /* |
597 | * pages in the range can be dirty, clean or writeback. We | 597 | * pages in the range can be dirty, clean or writeback. We |
598 | * start IO on any dirty ones so the wait doesn't stall waiting | 598 | * start IO on any dirty ones so the wait doesn't stall waiting |
599 | * for pdflush to find them | 599 | * for the flusher thread to find them |
600 | */ | 600 | */ |
601 | if (!test_bit(BTRFS_ORDERED_DIRECT, &entry->flags)) | 601 | if (!test_bit(BTRFS_ORDERED_DIRECT, &entry->flags)) |
602 | filemap_fdatawrite_range(inode->i_mapping, start, end); | 602 | filemap_fdatawrite_range(inode->i_mapping, start, end); |
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 8c6e61d6eed5..f2eb24c477a3 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c | |||
@@ -100,10 +100,6 @@ static void __save_error_info(struct btrfs_fs_info *fs_info) | |||
100 | fs_info->fs_state = BTRFS_SUPER_FLAG_ERROR; | 100 | fs_info->fs_state = BTRFS_SUPER_FLAG_ERROR; |
101 | } | 101 | } |
102 | 102 | ||
103 | /* NOTE: | ||
104 | * We move write_super stuff at umount in order to avoid deadlock | ||
105 | * for umount hold all lock. | ||
106 | */ | ||
107 | static void save_error_info(struct btrfs_fs_info *fs_info) | 103 | static void save_error_info(struct btrfs_fs_info *fs_info) |
108 | { | 104 | { |
109 | __save_error_info(fs_info); | 105 | __save_error_info(fs_info); |
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index b8708f994e67..e86ae04abe6a 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c | |||
@@ -1744,10 +1744,6 @@ int btrfs_init_new_device(struct btrfs_root *root, char *device_path) | |||
1744 | 1744 | ||
1745 | device->fs_devices = root->fs_info->fs_devices; | 1745 | device->fs_devices = root->fs_info->fs_devices; |
1746 | 1746 | ||
1747 | /* | ||
1748 | * we don't want write_supers to jump in here with our device | ||
1749 | * half setup | ||
1750 | */ | ||
1751 | mutex_lock(&root->fs_info->fs_devices->device_list_mutex); | 1747 | mutex_lock(&root->fs_info->fs_devices->device_list_mutex); |
1752 | list_add_rcu(&device->dev_list, &root->fs_info->fs_devices->devices); | 1748 | list_add_rcu(&device->dev_list, &root->fs_info->fs_devices->devices); |
1753 | list_add(&device->dev_alloc_list, | 1749 | list_add(&device->dev_alloc_list, |
diff --git a/fs/ext3/inode.c b/fs/ext3/inode.c index 9a4a5c48b1c9..a07597307fd1 100644 --- a/fs/ext3/inode.c +++ b/fs/ext3/inode.c | |||
@@ -3459,14 +3459,6 @@ ext3_reserve_inode_write(handle_t *handle, struct inode *inode, | |||
3459 | * inode out, but prune_icache isn't a user-visible syncing function. | 3459 | * inode out, but prune_icache isn't a user-visible syncing function. |
3460 | * Whenever the user wants stuff synced (sys_sync, sys_msync, sys_fsync) | 3460 | * Whenever the user wants stuff synced (sys_sync, sys_msync, sys_fsync) |
3461 | * we start and wait on commits. | 3461 | * we start and wait on commits. |
3462 | * | ||
3463 | * Is this efficient/effective? Well, we're being nice to the system | ||
3464 | * by cleaning up our inodes proactively so they can be reaped | ||
3465 | * without I/O. But we are potentially leaving up to five seconds' | ||
3466 | * worth of inodes floating about which prune_icache wants us to | ||
3467 | * write out. One way to fix that would be to get prune_icache() | ||
3468 | * to do a write_super() to free up some memory. It has the desired | ||
3469 | * effect. | ||
3470 | */ | 3462 | */ |
3471 | int ext3_mark_inode_dirty(handle_t *handle, struct inode *inode) | 3463 | int ext3_mark_inode_dirty(handle_t *handle, struct inode *inode) |
3472 | { | 3464 | { |
diff --git a/fs/ext3/super.c b/fs/ext3/super.c index ff9bcdc5b0d5..8c892e93d8e7 100644 --- a/fs/ext3/super.c +++ b/fs/ext3/super.c | |||
@@ -64,11 +64,6 @@ static int ext3_freeze(struct super_block *sb); | |||
64 | 64 | ||
65 | /* | 65 | /* |
66 | * Wrappers for journal_start/end. | 66 | * Wrappers for journal_start/end. |
67 | * | ||
68 | * The only special thing we need to do here is to make sure that all | ||
69 | * journal_end calls result in the superblock being marked dirty, so | ||
70 | * that sync() will call the filesystem's write_super callback if | ||
71 | * appropriate. | ||
72 | */ | 67 | */ |
73 | handle_t *ext3_journal_start_sb(struct super_block *sb, int nblocks) | 68 | handle_t *ext3_journal_start_sb(struct super_block *sb, int nblocks) |
74 | { | 69 | { |
@@ -90,12 +85,6 @@ handle_t *ext3_journal_start_sb(struct super_block *sb, int nblocks) | |||
90 | return journal_start(journal, nblocks); | 85 | return journal_start(journal, nblocks); |
91 | } | 86 | } |
92 | 87 | ||
93 | /* | ||
94 | * The only special thing we need to do here is to make sure that all | ||
95 | * journal_stop calls result in the superblock being marked dirty, so | ||
96 | * that sync() will call the filesystem's write_super callback if | ||
97 | * appropriate. | ||
98 | */ | ||
99 | int __ext3_journal_stop(const char *where, handle_t *handle) | 88 | int __ext3_journal_stop(const char *where, handle_t *handle) |
100 | { | 89 | { |
101 | struct super_block *sb; | 90 | struct super_block *sb; |
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 6324f74e0342..dff171c3a123 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c | |||
@@ -1970,7 +1970,7 @@ static void ext4_end_io_buffer_write(struct buffer_head *bh, int uptodate); | |||
1970 | * This function can get called via... | 1970 | * This function can get called via... |
1971 | * - ext4_da_writepages after taking page lock (have journal handle) | 1971 | * - ext4_da_writepages after taking page lock (have journal handle) |
1972 | * - journal_submit_inode_data_buffers (no journal handle) | 1972 | * - journal_submit_inode_data_buffers (no journal handle) |
1973 | * - shrink_page_list via pdflush (no journal handle) | 1973 | * - shrink_page_list via the kswapd/direct reclaim (no journal handle) |
1974 | * - grab_page_cache when doing write_begin (have journal handle) | 1974 | * - grab_page_cache when doing write_begin (have journal handle) |
1975 | * | 1975 | * |
1976 | * We don't do any block allocation in this function. If we have page with | 1976 | * We don't do any block allocation in this function. If we have page with |
@@ -4589,14 +4589,6 @@ static int ext4_expand_extra_isize(struct inode *inode, | |||
4589 | * inode out, but prune_icache isn't a user-visible syncing function. | 4589 | * inode out, but prune_icache isn't a user-visible syncing function. |
4590 | * Whenever the user wants stuff synced (sys_sync, sys_msync, sys_fsync) | 4590 | * Whenever the user wants stuff synced (sys_sync, sys_msync, sys_fsync) |
4591 | * we start and wait on commits. | 4591 | * we start and wait on commits. |
4592 | * | ||
4593 | * Is this efficient/effective? Well, we're being nice to the system | ||
4594 | * by cleaning up our inodes proactively so they can be reaped | ||
4595 | * without I/O. But we are potentially leaving up to five seconds' | ||
4596 | * worth of inodes floating about which prune_icache wants us to | ||
4597 | * write out. One way to fix that would be to get prune_icache() | ||
4598 | * to do a write_super() to free up some memory. It has the desired | ||
4599 | * effect. | ||
4600 | */ | 4592 | */ |
4601 | int ext4_mark_inode_dirty(handle_t *handle, struct inode *inode) | 4593 | int ext4_mark_inode_dirty(handle_t *handle, struct inode *inode) |
4602 | { | 4594 | { |
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index d76ec8277d3f..3e0851e4f468 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
@@ -326,11 +326,6 @@ static void ext4_put_nojournal(handle_t *handle) | |||
326 | 326 | ||
327 | /* | 327 | /* |
328 | * Wrappers for jbd2_journal_start/end. | 328 | * Wrappers for jbd2_journal_start/end. |
329 | * | ||
330 | * The only special thing we need to do here is to make sure that all | ||
331 | * journal_end calls result in the superblock being marked dirty, so | ||
332 | * that sync() will call the filesystem's write_super callback if | ||
333 | * appropriate. | ||
334 | */ | 329 | */ |
335 | handle_t *ext4_journal_start_sb(struct super_block *sb, int nblocks) | 330 | handle_t *ext4_journal_start_sb(struct super_block *sb, int nblocks) |
336 | { | 331 | { |
@@ -356,12 +351,6 @@ handle_t *ext4_journal_start_sb(struct super_block *sb, int nblocks) | |||
356 | return jbd2_journal_start(journal, nblocks); | 351 | return jbd2_journal_start(journal, nblocks); |
357 | } | 352 | } |
358 | 353 | ||
359 | /* | ||
360 | * The only special thing we need to do here is to make sure that all | ||
361 | * jbd2_journal_stop calls result in the superblock being marked dirty, so | ||
362 | * that sync() will call the filesystem's write_super callback if | ||
363 | * appropriate. | ||
364 | */ | ||
365 | int __ext4_journal_stop(const char *where, unsigned int line, handle_t *handle) | 354 | int __ext4_journal_stop(const char *where, unsigned int line, handle_t *handle) |
366 | { | 355 | { |
367 | struct super_block *sb; | 356 | struct super_block *sb; |
diff --git a/fs/gfs2/meta_io.c b/fs/gfs2/meta_io.c index 3a56c8d94de0..22255d96b27e 100644 --- a/fs/gfs2/meta_io.c +++ b/fs/gfs2/meta_io.c | |||
@@ -52,7 +52,7 @@ static int gfs2_aspace_writepage(struct page *page, struct writeback_control *wb | |||
52 | /* | 52 | /* |
53 | * If it's a fully non-blocking write attempt and we cannot | 53 | * If it's a fully non-blocking write attempt and we cannot |
54 | * lock the buffer then redirty the page. Note that this can | 54 | * lock the buffer then redirty the page. Note that this can |
55 | * potentially cause a busy-wait loop from pdflush and kswapd | 55 | * potentially cause a busy-wait loop from flusher thread and kswapd |
56 | * activity, but those code paths have their own higher-level | 56 | * activity, but those code paths have their own higher-level |
57 | * throttling. | 57 | * throttling. |
58 | */ | 58 | */ |
diff --git a/fs/hfs/mdb.c b/fs/hfs/mdb.c index 5fd51a5833ff..b7ec224910c5 100644 --- a/fs/hfs/mdb.c +++ b/fs/hfs/mdb.c | |||
@@ -236,10 +236,10 @@ out: | |||
236 | * hfs_mdb_commit() | 236 | * hfs_mdb_commit() |
237 | * | 237 | * |
238 | * Description: | 238 | * Description: |
239 | * This updates the MDB on disk (look also at hfs_write_super()). | 239 | * This updates the MDB on disk. |
240 | * It does not check, if the superblock has been modified, or | 240 | * It does not check, if the superblock has been modified, or |
241 | * if the filesystem has been mounted read-only. It is mainly | 241 | * if the filesystem has been mounted read-only. It is mainly |
242 | * called by hfs_write_super() and hfs_btree_extend(). | 242 | * called by hfs_sync_fs() and flush_mdb(). |
243 | * Input Variable(s): | 243 | * Input Variable(s): |
244 | * struct hfs_mdb *mdb: Pointer to the hfs MDB | 244 | * struct hfs_mdb *mdb: Pointer to the hfs MDB |
245 | * int backup; | 245 | * int backup; |
diff --git a/fs/jbd/journal.c b/fs/jbd/journal.c index 425c2f2cf170..09357508ec9a 100644 --- a/fs/jbd/journal.c +++ b/fs/jbd/journal.c | |||
@@ -534,8 +534,8 @@ int journal_start_commit(journal_t *journal, tid_t *ptid) | |||
534 | ret = 1; | 534 | ret = 1; |
535 | } else if (journal->j_committing_transaction) { | 535 | } else if (journal->j_committing_transaction) { |
536 | /* | 536 | /* |
537 | * If ext3_write_super() recently started a commit, then we | 537 | * If commit has been started, then we have to wait for |
538 | * have to wait for completion of that transaction | 538 | * completion of that transaction. |
539 | */ | 539 | */ |
540 | if (ptid) | 540 | if (ptid) |
541 | *ptid = journal->j_committing_transaction->t_tid; | 541 | *ptid = journal->j_committing_transaction->t_tid; |
diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c index e9a3c4c85594..8625da27eccf 100644 --- a/fs/jbd2/journal.c +++ b/fs/jbd2/journal.c | |||
@@ -612,8 +612,8 @@ int jbd2_journal_start_commit(journal_t *journal, tid_t *ptid) | |||
612 | ret = 1; | 612 | ret = 1; |
613 | } else if (journal->j_committing_transaction) { | 613 | } else if (journal->j_committing_transaction) { |
614 | /* | 614 | /* |
615 | * If ext3_write_super() recently started a commit, then we | 615 | * If commit has been started, then we have to wait for |
616 | * have to wait for completion of that transaction | 616 | * completion of that transaction. |
617 | */ | 617 | */ |
618 | if (ptid) | 618 | if (ptid) |
619 | *ptid = journal->j_committing_transaction->t_tid; | 619 | *ptid = journal->j_committing_transaction->t_tid; |
diff --git a/fs/nilfs2/super.c b/fs/nilfs2/super.c index 6522cac6057c..6a10812711c1 100644 --- a/fs/nilfs2/super.c +++ b/fs/nilfs2/super.c | |||
@@ -676,17 +676,13 @@ static const struct super_operations nilfs_sops = { | |||
676 | .alloc_inode = nilfs_alloc_inode, | 676 | .alloc_inode = nilfs_alloc_inode, |
677 | .destroy_inode = nilfs_destroy_inode, | 677 | .destroy_inode = nilfs_destroy_inode, |
678 | .dirty_inode = nilfs_dirty_inode, | 678 | .dirty_inode = nilfs_dirty_inode, |
679 | /* .write_inode = nilfs_write_inode, */ | ||
680 | /* .drop_inode = nilfs_drop_inode, */ | ||
681 | .evict_inode = nilfs_evict_inode, | 679 | .evict_inode = nilfs_evict_inode, |
682 | .put_super = nilfs_put_super, | 680 | .put_super = nilfs_put_super, |
683 | /* .write_super = nilfs_write_super, */ | ||
684 | .sync_fs = nilfs_sync_fs, | 681 | .sync_fs = nilfs_sync_fs, |
685 | .freeze_fs = nilfs_freeze, | 682 | .freeze_fs = nilfs_freeze, |
686 | .unfreeze_fs = nilfs_unfreeze, | 683 | .unfreeze_fs = nilfs_unfreeze, |
687 | .statfs = nilfs_statfs, | 684 | .statfs = nilfs_statfs, |
688 | .remount_fs = nilfs_remount, | 685 | .remount_fs = nilfs_remount, |
689 | /* .umount_begin */ | ||
690 | .show_options = nilfs_show_options | 686 | .show_options = nilfs_show_options |
691 | }; | 687 | }; |
692 | 688 | ||
diff --git a/fs/nilfs2/the_nilfs.h b/fs/nilfs2/the_nilfs.h index 6eee4177807b..be1267a34cea 100644 --- a/fs/nilfs2/the_nilfs.h +++ b/fs/nilfs2/the_nilfs.h | |||
@@ -107,8 +107,6 @@ struct the_nilfs { | |||
107 | * used for | 107 | * used for |
108 | * - loading the latest checkpoint exclusively. | 108 | * - loading the latest checkpoint exclusively. |
109 | * - allocating a new full segment. | 109 | * - allocating a new full segment. |
110 | * - protecting s_dirt in the super_block struct | ||
111 | * (see nilfs_write_super) and the following fields. | ||
112 | */ | 110 | */ |
113 | struct buffer_head *ns_sbh[2]; | 111 | struct buffer_head *ns_sbh[2]; |
114 | struct nilfs_super_block *ns_sbp[2]; | 112 | struct nilfs_super_block *ns_sbp[2]; |
@@ -717,7 +717,7 @@ cleanup_all: | |||
717 | * here, so just reset the state. | 717 | * here, so just reset the state. |
718 | */ | 718 | */ |
719 | file_reset_write(f); | 719 | file_reset_write(f); |
720 | mnt_drop_write(f->f_path.mnt); | 720 | __mnt_drop_write(f->f_path.mnt); |
721 | } | 721 | } |
722 | } | 722 | } |
723 | cleanup_file: | 723 | cleanup_file: |
diff --git a/fs/super.c b/fs/super.c index b05cf47463d0..0902cfa6a12e 100644 --- a/fs/super.c +++ b/fs/super.c | |||
@@ -537,46 +537,6 @@ void drop_super(struct super_block *sb) | |||
537 | EXPORT_SYMBOL(drop_super); | 537 | EXPORT_SYMBOL(drop_super); |
538 | 538 | ||
539 | /** | 539 | /** |
540 | * sync_supers - helper for periodic superblock writeback | ||
541 | * | ||
542 | * Call the write_super method if present on all dirty superblocks in | ||
543 | * the system. This is for the periodic writeback used by most older | ||
544 | * filesystems. For data integrity superblock writeback use | ||
545 | * sync_filesystems() instead. | ||
546 | * | ||
547 | * Note: check the dirty flag before waiting, so we don't | ||
548 | * hold up the sync while mounting a device. (The newly | ||
549 | * mounted device won't need syncing.) | ||
550 | */ | ||
551 | void sync_supers(void) | ||
552 | { | ||
553 | struct super_block *sb, *p = NULL; | ||
554 | |||
555 | spin_lock(&sb_lock); | ||
556 | list_for_each_entry(sb, &super_blocks, s_list) { | ||
557 | if (hlist_unhashed(&sb->s_instances)) | ||
558 | continue; | ||
559 | if (sb->s_op->write_super && sb->s_dirt) { | ||
560 | sb->s_count++; | ||
561 | spin_unlock(&sb_lock); | ||
562 | |||
563 | down_read(&sb->s_umount); | ||
564 | if (sb->s_root && sb->s_dirt && (sb->s_flags & MS_BORN)) | ||
565 | sb->s_op->write_super(sb); | ||
566 | up_read(&sb->s_umount); | ||
567 | |||
568 | spin_lock(&sb_lock); | ||
569 | if (p) | ||
570 | __put_super(p); | ||
571 | p = sb; | ||
572 | } | ||
573 | } | ||
574 | if (p) | ||
575 | __put_super(p); | ||
576 | spin_unlock(&sb_lock); | ||
577 | } | ||
578 | |||
579 | /** | ||
580 | * iterate_supers - call function for all active superblocks | 540 | * iterate_supers - call function for all active superblocks |
581 | * @f: function to call | 541 | * @f: function to call |
582 | * @arg: argument to pass to it | 542 | * @arg: argument to pass to it |
diff --git a/fs/ubifs/file.c b/fs/ubifs/file.c index 35389ca2d267..7bd6e72afd11 100644 --- a/fs/ubifs/file.c +++ b/fs/ubifs/file.c | |||
@@ -37,11 +37,11 @@ | |||
37 | * | 37 | * |
38 | * A thing to keep in mind: inode @i_mutex is locked in most VFS operations we | 38 | * A thing to keep in mind: inode @i_mutex is locked in most VFS operations we |
39 | * implement. However, this is not true for 'ubifs_writepage()', which may be | 39 | * implement. However, this is not true for 'ubifs_writepage()', which may be |
40 | * called with @i_mutex unlocked. For example, when pdflush is doing background | 40 | * called with @i_mutex unlocked. For example, when flusher thread is doing |
41 | * write-back, it calls 'ubifs_writepage()' with unlocked @i_mutex. At "normal" | 41 | * background write-back, it calls 'ubifs_writepage()' with unlocked @i_mutex. |
42 | * work-paths the @i_mutex is locked in 'ubifs_writepage()', e.g. in the | 42 | * At "normal" work-paths the @i_mutex is locked in 'ubifs_writepage()', e.g. |
43 | * "sys_write -> alloc_pages -> direct reclaim path". So, in 'ubifs_writepage()' | 43 | * in the "sys_write -> alloc_pages -> direct reclaim path". So, in |
44 | * we are only guaranteed that the page is locked. | 44 | * 'ubifs_writepage()' we are only guaranteed that the page is locked. |
45 | * | 45 | * |
46 | * Similarly, @i_mutex is not always locked in 'ubifs_readpage()', e.g., the | 46 | * Similarly, @i_mutex is not always locked in 'ubifs_readpage()', e.g., the |
47 | * read-ahead path does not lock it ("sys_read -> generic_file_aio_read -> | 47 | * read-ahead path does not lock it ("sys_read -> generic_file_aio_read -> |
diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c index 1c766c39c038..c3fa6c5327a3 100644 --- a/fs/ubifs/super.c +++ b/fs/ubifs/super.c | |||
@@ -303,7 +303,7 @@ static int ubifs_write_inode(struct inode *inode, struct writeback_control *wbc) | |||
303 | mutex_lock(&ui->ui_mutex); | 303 | mutex_lock(&ui->ui_mutex); |
304 | /* | 304 | /* |
305 | * Due to races between write-back forced by budgeting | 305 | * Due to races between write-back forced by budgeting |
306 | * (see 'sync_some_inodes()') and pdflush write-back, the inode may | 306 | * (see 'sync_some_inodes()') and background write-back, the inode may |
307 | * have already been synchronized, do not do this again. This might | 307 | * have already been synchronized, do not do this again. This might |
308 | * also happen if it was synchronized in an VFS operation, e.g. | 308 | * also happen if it was synchronized in an VFS operation, e.g. |
309 | * 'ubifs_link()'. | 309 | * 'ubifs_link()'. |
diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h index c97c6b9cd38e..2a9a9abc9126 100644 --- a/include/linux/backing-dev.h +++ b/include/linux/backing-dev.h | |||
@@ -124,7 +124,6 @@ void bdi_start_writeback(struct backing_dev_info *bdi, long nr_pages, | |||
124 | void bdi_start_background_writeback(struct backing_dev_info *bdi); | 124 | void bdi_start_background_writeback(struct backing_dev_info *bdi); |
125 | int bdi_writeback_thread(void *data); | 125 | int bdi_writeback_thread(void *data); |
126 | int bdi_has_dirty_io(struct backing_dev_info *bdi); | 126 | int bdi_has_dirty_io(struct backing_dev_info *bdi); |
127 | void bdi_arm_supers_timer(void); | ||
128 | void bdi_wakeup_thread_delayed(struct backing_dev_info *bdi); | 127 | void bdi_wakeup_thread_delayed(struct backing_dev_info *bdi); |
129 | void bdi_lock_two(struct bdi_writeback *wb1, struct bdi_writeback *wb2); | 128 | void bdi_lock_two(struct bdi_writeback *wb1, struct bdi_writeback *wb2); |
130 | 129 | ||
diff --git a/include/linux/fs.h b/include/linux/fs.h index 38dba16c4176..aa110476a95b 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -1491,7 +1491,6 @@ struct sb_writers { | |||
1491 | struct super_block { | 1491 | struct super_block { |
1492 | struct list_head s_list; /* Keep this first */ | 1492 | struct list_head s_list; /* Keep this first */ |
1493 | dev_t s_dev; /* search index; _not_ kdev_t */ | 1493 | dev_t s_dev; /* search index; _not_ kdev_t */ |
1494 | unsigned char s_dirt; | ||
1495 | unsigned char s_blocksize_bits; | 1494 | unsigned char s_blocksize_bits; |
1496 | unsigned long s_blocksize; | 1495 | unsigned long s_blocksize; |
1497 | loff_t s_maxbytes; /* Max file size */ | 1496 | loff_t s_maxbytes; /* Max file size */ |
@@ -1861,7 +1860,6 @@ struct super_operations { | |||
1861 | int (*drop_inode) (struct inode *); | 1860 | int (*drop_inode) (struct inode *); |
1862 | void (*evict_inode) (struct inode *); | 1861 | void (*evict_inode) (struct inode *); |
1863 | void (*put_super) (struct super_block *); | 1862 | void (*put_super) (struct super_block *); |
1864 | void (*write_super) (struct super_block *); | ||
1865 | int (*sync_fs)(struct super_block *sb, int wait); | 1863 | int (*sync_fs)(struct super_block *sb, int wait); |
1866 | int (*freeze_fs) (struct super_block *); | 1864 | int (*freeze_fs) (struct super_block *); |
1867 | int (*unfreeze_fs) (struct super_block *); | 1865 | int (*unfreeze_fs) (struct super_block *); |
@@ -2397,7 +2395,6 @@ extern int vfs_fsync_range(struct file *file, loff_t start, loff_t end, | |||
2397 | int datasync); | 2395 | int datasync); |
2398 | extern int vfs_fsync(struct file *file, int datasync); | 2396 | extern int vfs_fsync(struct file *file, int datasync); |
2399 | extern int generic_write_sync(struct file *file, loff_t pos, loff_t count); | 2397 | extern int generic_write_sync(struct file *file, loff_t pos, loff_t count); |
2400 | extern void sync_supers(void); | ||
2401 | extern void emergency_sync(void); | 2398 | extern void emergency_sync(void); |
2402 | extern void emergency_remount(void); | 2399 | extern void emergency_remount(void); |
2403 | #ifdef CONFIG_BLOCK | 2400 | #ifdef CONFIG_BLOCK |
diff --git a/include/linux/writeback.h b/include/linux/writeback.h index c66fe3332d83..50c3e8fa06a8 100644 --- a/include/linux/writeback.h +++ b/include/linux/writeback.h | |||
@@ -104,7 +104,6 @@ static inline void wait_on_inode(struct inode *inode) | |||
104 | wait_on_bit(&inode->i_state, __I_NEW, inode_wait, TASK_UNINTERRUPTIBLE); | 104 | wait_on_bit(&inode->i_state, __I_NEW, inode_wait, TASK_UNINTERRUPTIBLE); |
105 | } | 105 | } |
106 | 106 | ||
107 | |||
108 | /* | 107 | /* |
109 | * mm/page-writeback.c | 108 | * mm/page-writeback.c |
110 | */ | 109 | */ |
diff --git a/mm/backing-dev.c b/mm/backing-dev.c index 6b4718e2ee34..b41823cc05e6 100644 --- a/mm/backing-dev.c +++ b/mm/backing-dev.c | |||
@@ -39,12 +39,6 @@ DEFINE_SPINLOCK(bdi_lock); | |||
39 | LIST_HEAD(bdi_list); | 39 | LIST_HEAD(bdi_list); |
40 | LIST_HEAD(bdi_pending_list); | 40 | LIST_HEAD(bdi_pending_list); |
41 | 41 | ||
42 | static struct task_struct *sync_supers_tsk; | ||
43 | static struct timer_list sync_supers_timer; | ||
44 | |||
45 | static int bdi_sync_supers(void *); | ||
46 | static void sync_supers_timer_fn(unsigned long); | ||
47 | |||
48 | void bdi_lock_two(struct bdi_writeback *wb1, struct bdi_writeback *wb2) | 42 | void bdi_lock_two(struct bdi_writeback *wb1, struct bdi_writeback *wb2) |
49 | { | 43 | { |
50 | if (wb1 < wb2) { | 44 | if (wb1 < wb2) { |
@@ -250,12 +244,6 @@ static int __init default_bdi_init(void) | |||
250 | { | 244 | { |
251 | int err; | 245 | int err; |
252 | 246 | ||
253 | sync_supers_tsk = kthread_run(bdi_sync_supers, NULL, "sync_supers"); | ||
254 | BUG_ON(IS_ERR(sync_supers_tsk)); | ||
255 | |||
256 | setup_timer(&sync_supers_timer, sync_supers_timer_fn, 0); | ||
257 | bdi_arm_supers_timer(); | ||
258 | |||
259 | err = bdi_init(&default_backing_dev_info); | 247 | err = bdi_init(&default_backing_dev_info); |
260 | if (!err) | 248 | if (!err) |
261 | bdi_register(&default_backing_dev_info, NULL, "default"); | 249 | bdi_register(&default_backing_dev_info, NULL, "default"); |
@@ -270,46 +258,6 @@ int bdi_has_dirty_io(struct backing_dev_info *bdi) | |||
270 | return wb_has_dirty_io(&bdi->wb); | 258 | return wb_has_dirty_io(&bdi->wb); |
271 | } | 259 | } |
272 | 260 | ||
273 | /* | ||
274 | * kupdated() used to do this. We cannot do it from the bdi_forker_thread() | ||
275 | * or we risk deadlocking on ->s_umount. The longer term solution would be | ||
276 | * to implement sync_supers_bdi() or similar and simply do it from the | ||
277 | * bdi writeback thread individually. | ||
278 | */ | ||
279 | static int bdi_sync_supers(void *unused) | ||
280 | { | ||
281 | set_user_nice(current, 0); | ||
282 | |||
283 | while (!kthread_should_stop()) { | ||
284 | set_current_state(TASK_INTERRUPTIBLE); | ||
285 | schedule(); | ||
286 | |||
287 | /* | ||
288 | * Do this periodically, like kupdated() did before. | ||
289 | */ | ||
290 | sync_supers(); | ||
291 | } | ||
292 | |||
293 | return 0; | ||
294 | } | ||
295 | |||
296 | void bdi_arm_supers_timer(void) | ||
297 | { | ||
298 | unsigned long next; | ||
299 | |||
300 | if (!dirty_writeback_interval) | ||
301 | return; | ||
302 | |||
303 | next = msecs_to_jiffies(dirty_writeback_interval * 10) + jiffies; | ||
304 | mod_timer(&sync_supers_timer, round_jiffies_up(next)); | ||
305 | } | ||
306 | |||
307 | static void sync_supers_timer_fn(unsigned long unused) | ||
308 | { | ||
309 | wake_up_process(sync_supers_tsk); | ||
310 | bdi_arm_supers_timer(); | ||
311 | } | ||
312 | |||
313 | static void wakeup_timer_fn(unsigned long data) | 261 | static void wakeup_timer_fn(unsigned long data) |
314 | { | 262 | { |
315 | struct backing_dev_info *bdi = (struct backing_dev_info *)data; | 263 | struct backing_dev_info *bdi = (struct backing_dev_info *)data; |
diff --git a/mm/page-writeback.c b/mm/page-writeback.c index e5363f34e025..5ad5ce23c1e0 100644 --- a/mm/page-writeback.c +++ b/mm/page-writeback.c | |||
@@ -1532,7 +1532,6 @@ int dirty_writeback_centisecs_handler(ctl_table *table, int write, | |||
1532 | void __user *buffer, size_t *length, loff_t *ppos) | 1532 | void __user *buffer, size_t *length, loff_t *ppos) |
1533 | { | 1533 | { |
1534 | proc_dointvec(table, write, buffer, length, ppos); | 1534 | proc_dointvec(table, write, buffer, length, ppos); |
1535 | bdi_arm_supers_timer(); | ||
1536 | return 0; | 1535 | return 0; |
1537 | } | 1536 | } |
1538 | 1537 | ||