linux/fs/xfs
Dave Chinner 9aa05000f2 xfs: xfs_sync_data is redundant.
We don't do any data writeback from XFS any more - the VFS is
completely responsible for that, including for freeze. We can
replace the remaining caller with a VFS level function that
achieves the same thing, but without conflicting with current
writeback work.

This means we can remove the flush_work and xfs_flush_inodes() - the
VFS functionality completely replaces the internal flush queue for
doing this writeback work in a separate context to avoid stack
overruns.

This does have one complication - it cannot be called with page
locks held.  Hence move the flushing of delalloc space when ENOSPC
occurs back up into xfs_file_aio_buffered_write when we don't hold
any locks that will stall writeback.

Unfortunately, writeback_inodes_sb_if_idle() is not sufficient to
trigger delalloc conversion fast enough to prevent spurious ENOSPC
whent here are hundreds of writers, thousands of small files and GBs
of free RAM.  Hence we need to use sync_sb_inodes() to block callers
while we wait for writeback like the previous xfs_flush_inodes
implementation did.

That means we have to hold the s_umount lock here, but because this
call can nest inside i_mutex (the parent directory in the create
case, held by the VFS), we have to use down_read_trylock() to avoid
potential deadlocks. In practice, this trylock will succeed on
almost every attempt as unmount/remount type operations are
exceedingly rare.

Note: we always need to pass a count of zero to
generic_file_buffered_write() as the previously written byte count.
We only do this by accident before this patch by the virtue of ret
always being zero when there are no errors. Make this explicit
rather than needing to specifically zero ret in the ENOSPC retry
case.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Tested-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Ben Myers <bpm@sgi.com>
2012-10-17 12:01:25 -05:00
..
Kconfig
kmem.c
kmem.h
Makefile
mrlock.h
time.h
uuid.c
uuid.h
xfs_acl.c userns: Pass a userns parameter into posix_acl_to_xattr and posix_acl_from_xattr 2012-09-18 01:01:35 -07:00
xfs_acl.h
xfs_ag.h
xfs_alloc_btree.c
xfs_alloc_btree.h
xfs_alloc.c
xfs_alloc.h
xfs_aops.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2012-08-01 10:26:23 -07:00
xfs_aops.h Prefix IO_XX flags with XFS_IO_XX to avoid namespace colision. 2012-07-22 11:00:55 -05:00
xfs_attr_leaf.c
xfs_attr_leaf.h
xfs_attr_sf.h
xfs_attr.c
xfs_attr.h
xfs_bit.c
xfs_bit.h
xfs_bmap_btree.c
xfs_bmap_btree.h
xfs_bmap.c
xfs_bmap.h
xfs_btree.c
xfs_btree.h
xfs_buf_item.c
xfs_buf_item.h
xfs_buf.c xfs: fix race while discarding buffers [V4] 2012-08-29 15:01:11 -05:00
xfs_buf.h xfs: fix race while discarding buffers [V4] 2012-08-29 15:01:11 -05:00
xfs_da_btree.c
xfs_da_btree.h xfs: fix comment typo of struct xfs_da_blkinfo. 2012-07-22 10:34:42 -05:00
xfs_dfrag.c switch simple cases of fget_light to fdget 2012-09-26 22:20:08 -04:00
xfs_dfrag.h
xfs_dinode.h
xfs_dir2_block.c
xfs_dir2_data.c
xfs_dir2_format.h
xfs_dir2_leaf.c
xfs_dir2_node.c
xfs_dir2_priv.h
xfs_dir2_sf.c
xfs_dir2.c
xfs_dir2.h
xfs_discard.c xfs: check for possible overflow in xfs_ioc_trim 2012-08-23 14:48:44 -05:00
xfs_discard.h
xfs_dquot_item.c
xfs_dquot_item.h
xfs_dquot.c
xfs_dquot.h
xfs_error.c
xfs_error.h
xfs_export.c tmpfs,ceph,gfs2,isofs,reiserfs,xfs: fix fh_len checking 2012-10-09 23:33:55 -04:00
xfs_export.h
xfs_extent_busy.c
xfs_extent_busy.h
xfs_extfree_item.c
xfs_extfree_item.h
xfs_file.c xfs: xfs_sync_data is redundant. 2012-10-17 12:01:25 -05:00
xfs_filestream.c
xfs_filestream.h
xfs_fs_subr.c
xfs_fs.h
xfs_fsops.c
xfs_fsops.h
xfs_globals.c
xfs_ialloc_btree.c
xfs_ialloc_btree.h
xfs_ialloc.c xfs: Fix m_agirotor reset during AG selection 2012-09-26 15:42:42 -05:00
xfs_ialloc.h xfs: remove the alloc_done argument to xfs_dialloc 2012-07-29 16:00:31 -05:00
xfs_iget.c xfs: remove iolock lock classes 2012-07-29 16:23:51 -05:00
xfs_inode_item.c
xfs_inode_item.h
xfs_inode.c xfs: do not take the iolock in xfs_inactive 2012-07-29 16:16:49 -05:00
xfs_inode.h xfs: remove iolock lock classes 2012-07-29 16:23:51 -05:00
xfs_inum.h
xfs_ioctl32.c xfs: Convert to new freezing code 2012-07-31 09:45:48 +04:00
xfs_ioctl32.h
xfs_ioctl.c switch simple cases of fget_light to fdget 2012-09-26 22:20:08 -04:00
xfs_ioctl.h
xfs_iomap.c xfs: xfs_sync_data is redundant. 2012-10-17 12:01:25 -05:00
xfs_iomap.h
xfs_iops.c xfs: update for 3.6-rc1 2012-07-30 13:37:53 -07:00
xfs_iops.h
xfs_itable.c xfs: merge xfs_itobp into xfs_imap_to_bp 2012-07-22 10:46:56 -05:00
xfs_itable.h
xfs_linux.h
xfs_log_cil.c
xfs_log_priv.h xfs: sync work is now only periodic log work 2012-10-17 11:53:29 -05:00
xfs_log_recover.c xfs: merge xfs_itobp into xfs_imap_to_bp 2012-07-22 10:46:56 -05:00
xfs_log_recover.h
xfs_log.c xfs: Bring some sanity to log unmounting 2012-10-17 11:57:10 -05:00
xfs_log.h xfs: sync work is now only periodic log work 2012-10-17 11:53:29 -05:00
xfs_message.c
xfs_message.h
xfs_mount.c xfs: Bring some sanity to log unmounting 2012-10-17 11:57:10 -05:00
xfs_mount.h xfs: xfs_sync_data is redundant. 2012-10-17 12:01:25 -05:00
xfs_mru_cache.c
xfs_mru_cache.h
xfs_qm_bhv.c
xfs_qm_syscalls.c
xfs_qm.c
xfs_qm.h
xfs_quota_priv.h
xfs_quota.h
xfs_quotaops.c userns: Convert qutoactl 2012-09-18 01:01:39 -07:00
xfs_rename.c
xfs_rtalloc.c xfs: fix uninitialised variable in xfs_rtbuf_get() 2012-08-23 14:48:16 -05:00
xfs_rtalloc.h
xfs_sb.h
xfs_stats.c
xfs_stats.h
xfs_super.c xfs: xfs_sync_data is redundant. 2012-10-17 12:01:25 -05:00
xfs_super.h xfs: xfs_sync_data is redundant. 2012-10-17 12:01:25 -05:00
xfs_sync.c xfs: xfs_sync_data is redundant. 2012-10-17 12:01:25 -05:00
xfs_sync.h xfs: xfs_sync_data is redundant. 2012-10-17 12:01:25 -05:00
xfs_sysctl.c
xfs_sysctl.h
xfs_trace.c
xfs_trace.h xfs: kill struct declarations in xfs_mount.h 2012-08-16 13:29:35 -05:00
xfs_trans_ail.c xfs: re-enable xfsaild idle mode and fix associated races 2012-07-29 16:27:57 -05:00
xfs_trans_buf.c
xfs_trans_dquot.c userns: Convert quota netlink aka quota_send_warning 2012-09-18 01:01:40 -07:00
xfs_trans_extfree.c
xfs_trans_inode.c
xfs_trans_priv.h xfs: re-enable xfsaild idle mode and fix associated races 2012-07-29 16:27:57 -05:00
xfs_trans_space.h
xfs_trans.c xfs: Convert to new freezing code 2012-07-31 09:45:48 +04:00
xfs_trans.h Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2012-08-01 10:26:23 -07:00
xfs_types.h
xfs_utils.c xfs: remove the alloc_done argument to xfs_dialloc 2012-07-29 16:00:31 -05:00
xfs_utils.h
xfs_vnode.h
xfs_vnodeops.c xfs: xfs_sync_data is redundant. 2012-10-17 12:01:25 -05:00
xfs_vnodeops.h
xfs_xattr.c
xfs.h