Skip to content

Commit

Permalink
Merge branch 'for-linus-2' of git://git.kernel.org/pub/scm/linux/kern…
Browse files Browse the repository at this point in the history
…el/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
  • Loading branch information
Linus Torvalds committed Aug 4, 2012
2 parents d8579fd + fe7c805 commit e7882d6
Show file tree
Hide file tree
Showing 31 changed files with 38 additions and 194 deletions.
4 changes: 2 additions & 2 deletions Documentation/DocBook/filesystems.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,8 @@ all your transactions.
</para>

<para>
Then at umount time , in your put_super() (2.4) or write_super() (2.5)
you can then call journal_destroy() to clean up your in-core journal object.
Then at umount time , in your put_super() you can then call journal_destroy()
to clean up your in-core journal object.
</para>

<para>
Expand Down
2 changes: 0 additions & 2 deletions Documentation/filesystems/Locking
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ prototypes:
int (*drop_inode) (struct inode *);
void (*evict_inode) (struct inode *);
void (*put_super) (struct super_block *);
void (*write_super) (struct super_block *);
int (*sync_fs)(struct super_block *sb, int wait);
int (*freeze_fs) (struct super_block *);
int (*unfreeze_fs) (struct super_block *);
Expand All @@ -136,7 +135,6 @@ write_inode:
drop_inode: !!!inode->i_lock!!!
evict_inode:
put_super: write
write_super: read
sync_fs: read
freeze_fs: write
unfreeze_fs: write
Expand Down
5 changes: 2 additions & 3 deletions Documentation/filesystems/porting
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,8 @@ protected.
---
[mandatory]

BKL is also moved from around sb operations. ->write_super() Is now called
without BKL held. BKL should have been shifted into individual fs sb_op
functions. If you don't need it, remove it.
BKL is also moved from around sb operations. BKL should have been shifted into
individual fs sb_op functions. If you don't need it, remove it.

---
[informational]
Expand Down
4 changes: 0 additions & 4 deletions Documentation/filesystems/vfs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,6 @@ struct super_operations {
void (*drop_inode) (struct inode *);
void (*delete_inode) (struct inode *);
void (*put_super) (struct super_block *);
void (*write_super) (struct super_block *);
int (*sync_fs)(struct super_block *sb, int wait);
int (*freeze_fs) (struct super_block *);
int (*unfreeze_fs) (struct super_block *);
Expand Down Expand Up @@ -273,9 +272,6 @@ or bottom half).
put_super: called when the VFS wishes to free the superblock
(i.e. unmount). This is called with the superblock lock held

write_super: called when the VFS superblock needs to be written to
disc. This method is optional

sync_fs: called when VFS is writing out all dirty data associated with
a superblock. The second parameter indicates whether the method
should wait until the write out has been completed. Optional.
Expand Down
12 changes: 6 additions & 6 deletions Documentation/laptops/laptop-mode.txt
Original file line number Diff line number Diff line change
Expand Up @@ -262,9 +262,9 @@ MINIMUM_BATTERY_MINUTES=10

#
# Allowed dirty background ratio, in percent. Once DIRTY_RATIO has been
# exceeded, the kernel will wake pdflush which will then reduce the amount
# of dirty memory to dirty_background_ratio. Set this nice and low, so once
# some writeout has commenced, we do a lot of it.
# exceeded, the kernel will wake flusher threads which will then reduce the
# amount of dirty memory to dirty_background_ratio. Set this nice and low,
# so once some writeout has commenced, we do a lot of it.
#
#DIRTY_BACKGROUND_RATIO=5

Expand Down Expand Up @@ -384,9 +384,9 @@ CPU_MAXFREQ=${CPU_MAXFREQ:-'slowest'}

#
# Allowed dirty background ratio, in percent. Once DIRTY_RATIO has been
# exceeded, the kernel will wake pdflush which will then reduce the amount
# of dirty memory to dirty_background_ratio. Set this nice and low, so once
# some writeout has commenced, we do a lot of it.
# exceeded, the kernel will wake flusher threads which will then reduce the
# amount of dirty memory to dirty_background_ratio. Set this nice and low,
# so once some writeout has commenced, we do a lot of it.
#
DIRTY_BACKGROUND_RATIO=${DIRTY_BACKGROUND_RATIO:-'5'}

Expand Down
14 changes: 7 additions & 7 deletions Documentation/sysctl/vm.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ huge pages although processes will also directly compact memory as required.

dirty_background_bytes

Contains the amount of dirty memory at which the pdflush background writeback
daemon will start writeback.
Contains the amount of dirty memory at which the background kernel
flusher threads will start writeback.

Note: dirty_background_bytes is the counterpart of dirty_background_ratio. Only
one of them may be specified at a time. When one sysctl is written it is
Expand All @@ -89,7 +89,7 @@ other appears as 0 when read.
dirty_background_ratio

Contains, as a percentage of total system memory, the number of pages at which
the pdflush background writeback daemon will start writing out dirty data.
the background kernel flusher threads will start writing out dirty data.

==============================================================

Expand All @@ -112,9 +112,9 @@ retained.
dirty_expire_centisecs

This tunable is used to define when dirty data is old enough to be eligible
for writeout by the pdflush daemons. It is expressed in 100'ths of a second.
Data which has been dirty in-memory for longer than this interval will be
written out next time a pdflush daemon wakes up.
for writeout by the kernel flusher threads. It is expressed in 100'ths
of a second. Data which has been dirty in-memory for longer than this
interval will be written out next time a flusher thread wakes up.

==============================================================

Expand All @@ -128,7 +128,7 @@ data.

dirty_writeback_centisecs

The pdflush writeback daemons will periodically wake up and write `old' data
The kernel flusher threads will periodically wake up and write `old' data
out to disk. This tunable expresses the interval between those wakeups, in
100'ths of a second.

Expand Down
4 changes: 2 additions & 2 deletions drivers/block/drbd/drbd_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3537,9 +3537,9 @@ static void drbd_cleanup(void)
}

/**
* drbd_congested() - Callback for pdflush
* drbd_congested() - Callback for the flusher thread
* @congested_data: User data
* @bdi_bits: Bits pdflush is currently interested in
* @bdi_bits: Bits the BDI flusher thread is currently interested in
*
* Returns 1<<BDI_async_congested and/or 1<<BDI_sync_congested if we are congested.
*/
Expand Down
2 changes: 1 addition & 1 deletion fs/bio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1312,7 +1312,7 @@ EXPORT_SYMBOL(bio_copy_kern);
* Note that this code is very hard to test under normal circumstances because
* direct-io pins the pages with get_user_pages(). This makes
* is_page_cache_freeable return false, and the VM will not clean the pages.
* But other code (eg, pdflush) could clean the pages if they are mapped
* But other code (eg, flusher threads) could clean the pages if they are mapped
* pagecache.
*
* Simply disabling the call to bio_set_pages_dirty() is a good way to test the
Expand Down
3 changes: 2 additions & 1 deletion fs/btrfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,8 @@ static noinline int add_async_extent(struct async_cow *cow,
* If this code finds it can't get good compression, it puts an
* entry onto the work queue to write the uncompressed bytes. This
* makes sure that both compressed inodes and uncompressed inodes
* are written in the same order that pdflush sent them down.
* are written in the same order that the flusher thread sent them
* down.
*/
static noinline int compress_file_range(struct inode *inode,
struct page *locked_page,
Expand Down
2 changes: 1 addition & 1 deletion fs/btrfs/ordered-data.c
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ void btrfs_start_ordered_extent(struct inode *inode,
/*
* pages in the range can be dirty, clean or writeback. We
* start IO on any dirty ones so the wait doesn't stall waiting
* for pdflush to find them
* for the flusher thread to find them
*/
if (!test_bit(BTRFS_ORDERED_DIRECT, &entry->flags))
filemap_fdatawrite_range(inode->i_mapping, start, end);
Expand Down
4 changes: 0 additions & 4 deletions fs/btrfs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,6 @@ static void __save_error_info(struct btrfs_fs_info *fs_info)
fs_info->fs_state = BTRFS_SUPER_FLAG_ERROR;
}

/* NOTE:
* We move write_super stuff at umount in order to avoid deadlock
* for umount hold all lock.
*/
static void save_error_info(struct btrfs_fs_info *fs_info)
{
__save_error_info(fs_info);
Expand Down
4 changes: 0 additions & 4 deletions fs/btrfs/volumes.c
Original file line number Diff line number Diff line change
Expand Up @@ -1744,10 +1744,6 @@ int btrfs_init_new_device(struct btrfs_root *root, char *device_path)

device->fs_devices = root->fs_info->fs_devices;

/*
* we don't want write_supers to jump in here with our device
* half setup
*/
mutex_lock(&root->fs_info->fs_devices->device_list_mutex);
list_add_rcu(&device->dev_list, &root->fs_info->fs_devices->devices);
list_add(&device->dev_alloc_list,
Expand Down
8 changes: 0 additions & 8 deletions fs/ext3/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -3459,14 +3459,6 @@ ext3_reserve_inode_write(handle_t *handle, struct inode *inode,
* inode out, but prune_icache isn't a user-visible syncing function.
* Whenever the user wants stuff synced (sys_sync, sys_msync, sys_fsync)
* we start and wait on commits.
*
* Is this efficient/effective? Well, we're being nice to the system
* by cleaning up our inodes proactively so they can be reaped
* without I/O. But we are potentially leaving up to five seconds'
* worth of inodes floating about which prune_icache wants us to
* write out. One way to fix that would be to get prune_icache()
* to do a write_super() to free up some memory. It has the desired
* effect.
*/
int ext3_mark_inode_dirty(handle_t *handle, struct inode *inode)
{
Expand Down
11 changes: 0 additions & 11 deletions fs/ext3/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,6 @@ static int ext3_freeze(struct super_block *sb);

/*
* Wrappers for journal_start/end.
*
* The only special thing we need to do here is to make sure that all
* journal_end calls result in the superblock being marked dirty, so
* that sync() will call the filesystem's write_super callback if
* appropriate.
*/
handle_t *ext3_journal_start_sb(struct super_block *sb, int nblocks)
{
Expand All @@ -90,12 +85,6 @@ handle_t *ext3_journal_start_sb(struct super_block *sb, int nblocks)
return journal_start(journal, nblocks);
}

/*
* The only special thing we need to do here is to make sure that all
* journal_stop calls result in the superblock being marked dirty, so
* that sync() will call the filesystem's write_super callback if
* appropriate.
*/
int __ext3_journal_stop(const char *where, handle_t *handle)
{
struct super_block *sb;
Expand Down
10 changes: 1 addition & 9 deletions fs/ext4/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1970,7 +1970,7 @@ static void ext4_end_io_buffer_write(struct buffer_head *bh, int uptodate);
* This function can get called via...
* - ext4_da_writepages after taking page lock (have journal handle)
* - journal_submit_inode_data_buffers (no journal handle)
* - shrink_page_list via pdflush (no journal handle)
* - shrink_page_list via the kswapd/direct reclaim (no journal handle)
* - grab_page_cache when doing write_begin (have journal handle)
*
* We don't do any block allocation in this function. If we have page with
Expand Down Expand Up @@ -4589,14 +4589,6 @@ static int ext4_expand_extra_isize(struct inode *inode,
* inode out, but prune_icache isn't a user-visible syncing function.
* Whenever the user wants stuff synced (sys_sync, sys_msync, sys_fsync)
* we start and wait on commits.
*
* Is this efficient/effective? Well, we're being nice to the system
* by cleaning up our inodes proactively so they can be reaped
* without I/O. But we are potentially leaving up to five seconds'
* worth of inodes floating about which prune_icache wants us to
* write out. One way to fix that would be to get prune_icache()
* to do a write_super() to free up some memory. It has the desired
* effect.
*/
int ext4_mark_inode_dirty(handle_t *handle, struct inode *inode)
{
Expand Down
11 changes: 0 additions & 11 deletions fs/ext4/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -326,11 +326,6 @@ static void ext4_put_nojournal(handle_t *handle)

/*
* Wrappers for jbd2_journal_start/end.
*
* The only special thing we need to do here is to make sure that all
* journal_end calls result in the superblock being marked dirty, so
* that sync() will call the filesystem's write_super callback if
* appropriate.
*/
handle_t *ext4_journal_start_sb(struct super_block *sb, int nblocks)
{
Expand All @@ -356,12 +351,6 @@ handle_t *ext4_journal_start_sb(struct super_block *sb, int nblocks)
return jbd2_journal_start(journal, nblocks);
}

/*
* The only special thing we need to do here is to make sure that all
* jbd2_journal_stop calls result in the superblock being marked dirty, so
* that sync() will call the filesystem's write_super callback if
* appropriate.
*/
int __ext4_journal_stop(const char *where, unsigned int line, handle_t *handle)
{
struct super_block *sb;
Expand Down
2 changes: 1 addition & 1 deletion fs/gfs2/meta_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ static int gfs2_aspace_writepage(struct page *page, struct writeback_control *wb
/*
* If it's a fully non-blocking write attempt and we cannot
* lock the buffer then redirty the page. Note that this can
* potentially cause a busy-wait loop from pdflush and kswapd
* potentially cause a busy-wait loop from flusher thread and kswapd
* activity, but those code paths have their own higher-level
* throttling.
*/
Expand Down
4 changes: 2 additions & 2 deletions fs/hfs/mdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,10 +236,10 @@ int hfs_mdb_get(struct super_block *sb)
* hfs_mdb_commit()
*
* Description:
* This updates the MDB on disk (look also at hfs_write_super()).
* This updates the MDB on disk.
* It does not check, if the superblock has been modified, or
* if the filesystem has been mounted read-only. It is mainly
* called by hfs_write_super() and hfs_btree_extend().
* called by hfs_sync_fs() and flush_mdb().
* Input Variable(s):
* struct hfs_mdb *mdb: Pointer to the hfs MDB
* int backup;
Expand Down
4 changes: 2 additions & 2 deletions fs/jbd/journal.c
Original file line number Diff line number Diff line change
Expand Up @@ -534,8 +534,8 @@ int journal_start_commit(journal_t *journal, tid_t *ptid)
ret = 1;
} else if (journal->j_committing_transaction) {
/*
* If ext3_write_super() recently started a commit, then we
* have to wait for completion of that transaction
* If commit has been started, then we have to wait for
* completion of that transaction.
*/
if (ptid)
*ptid = journal->j_committing_transaction->t_tid;
Expand Down
4 changes: 2 additions & 2 deletions fs/jbd2/journal.c
Original file line number Diff line number Diff line change
Expand Up @@ -612,8 +612,8 @@ int jbd2_journal_start_commit(journal_t *journal, tid_t *ptid)
ret = 1;
} else if (journal->j_committing_transaction) {
/*
* If ext3_write_super() recently started a commit, then we
* have to wait for completion of that transaction
* If commit has been started, then we have to wait for
* completion of that transaction.
*/
if (ptid)
*ptid = journal->j_committing_transaction->t_tid;
Expand Down
4 changes: 0 additions & 4 deletions fs/nilfs2/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -676,17 +676,13 @@ static const struct super_operations nilfs_sops = {
.alloc_inode = nilfs_alloc_inode,
.destroy_inode = nilfs_destroy_inode,
.dirty_inode = nilfs_dirty_inode,
/* .write_inode = nilfs_write_inode, */
/* .drop_inode = nilfs_drop_inode, */
.evict_inode = nilfs_evict_inode,
.put_super = nilfs_put_super,
/* .write_super = nilfs_write_super, */
.sync_fs = nilfs_sync_fs,
.freeze_fs = nilfs_freeze,
.unfreeze_fs = nilfs_unfreeze,
.statfs = nilfs_statfs,
.remount_fs = nilfs_remount,
/* .umount_begin */
.show_options = nilfs_show_options
};

Expand Down
2 changes: 0 additions & 2 deletions fs/nilfs2/the_nilfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,6 @@ struct the_nilfs {
* used for
* - loading the latest checkpoint exclusively.
* - allocating a new full segment.
* - protecting s_dirt in the super_block struct
* (see nilfs_write_super) and the following fields.
*/
struct buffer_head *ns_sbh[2];
struct nilfs_super_block *ns_sbp[2];
Expand Down
2 changes: 1 addition & 1 deletion fs/open.c
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,7 @@ static int do_dentry_open(struct file *f,
* here, so just reset the state.
*/
file_reset_write(f);
mnt_drop_write(f->f_path.mnt);
__mnt_drop_write(f->f_path.mnt);
}
}
cleanup_file:
Expand Down
Loading

0 comments on commit e7882d6

Please sign in to comment.