linux/fs/xfs
Christoph Hellwig 5fe878ae7f direct-io: cleanup blockdev_direct_IO locking
Currently the locking in blockdev_direct_IO is a mess, we have three
different locking types and very confusing checks for some of them.  The
most complicated one is DIO_OWN_LOCKING for reads, which happens to not
actually be used.

This patch gets rid of the DIO_OWN_LOCKING - as mentioned above the read
case is unused anyway, and the write side is almost identical to
DIO_NO_LOCKING.  The difference is that DIO_NO_LOCKING always sets the
create argument for the get_blocks callback to zero, but we can easily
move that to the actual get_blocks callbacks.  There are four users of the
DIO_NO_LOCKING mode: gfs already ignores the create argument and thus is
fine with the new version, ocfs2 only errors out if create were ever set,
and we can remove this dead code now, the block device code only ever uses
create for an error message if we are fully beyond the device which can
never happen, and last but not least XFS will need the new behavour for
writes.

Now we can replace the lock_type variable with a flags one, where no flag
means the DIO_NO_LOCKING behaviour and DIO_LOCKING is kept as the first
flag.  Separate out the check for not allowing to fill holes into a
separate flag, although for now both flags always get set at the same
time.

Also revamp the documentation of the locking scheme to actually make
sense.

[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Christoph Hellwig <hch@lst.de>
Cc: Dave Chinner <david@fromorbit.com>
Cc: Badari Pulavarty <pbadari@us.ibm.com>
Cc: Jeff Moyer <jmoyer@redhat.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Cc: Zach Brown <zach.brown@oracle.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Alex Elder <aelder@sgi.com>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-12-16 07:20:13 -08:00
..
linux-2.6 direct-io: cleanup blockdev_direct_IO locking 2009-12-16 07:20:13 -08:00
quota xfs: event tracing support 2009-12-14 23:08:16 -06:00
support xfs: event tracing support 2009-12-14 23:08:16 -06:00
Kconfig xfs: use generic Posix ACL code 2009-06-10 17:07:47 +02:00
Makefile xfs: event tracing support 2009-12-14 23:08:16 -06:00
xfs.h xfs: event tracing support 2009-12-14 23:08:16 -06:00
xfs_acl.h switch xfs to generic acl caching helpers 2009-06-24 08:17:07 -04:00
xfs_ag.h xfs: event tracing support 2009-12-14 23:08:16 -06:00
xfs_alloc.c xfs: event tracing support 2009-12-14 23:08:16 -06:00
xfs_alloc.h xfs: event tracing support 2009-12-14 23:08:16 -06:00
xfs_alloc_btree.c xfs: event tracing support 2009-12-14 23:08:16 -06:00
xfs_alloc_btree.h
xfs_arch.h xfs: use generic Posix ACL code 2009-06-10 17:07:47 +02:00
xfs_attr.c xfs: event tracing support 2009-12-14 23:08:16 -06:00
xfs_attr.h xfs: event tracing support 2009-12-14 23:08:16 -06:00
xfs_attr_leaf.c xfs: event tracing support 2009-12-14 23:08:16 -06:00
xfs_attr_leaf.h
xfs_attr_sf.h xfs: event tracing support 2009-12-14 23:08:16 -06:00
xfs_bit.c
xfs_bit.h
xfs_bmap.c xfs: event tracing support 2009-12-14 23:08:16 -06:00
xfs_bmap.h xfs: event tracing support 2009-12-14 23:08:16 -06:00
xfs_bmap_btree.c xfs: event tracing support 2009-12-14 23:08:16 -06:00
xfs_bmap_btree.h xfs: add more statics & drop some unused functions 2009-08-31 14:46:20 -05:00
xfs_btree.c xfs: event tracing support 2009-12-14 23:08:16 -06:00
xfs_btree.h xfs: add more statics & drop some unused functions 2009-08-31 14:46:20 -05:00
xfs_btree_trace.c
xfs_btree_trace.h xfs: event tracing support 2009-12-14 23:08:16 -06:00
xfs_buf_item.c xfs: event tracing support 2009-12-14 23:08:16 -06:00
xfs_buf_item.h xfs: event tracing support 2009-12-14 23:08:16 -06:00
xfs_da_btree.c xfs: event tracing support 2009-12-14 23:08:16 -06:00
xfs_da_btree.h xfs: event tracing support 2009-12-14 23:08:16 -06:00
xfs_dfrag.c xfs: event tracing support 2009-12-14 23:08:16 -06:00
xfs_dfrag.h
xfs_dinode.h xfs: remove m_litino 2009-03-29 09:51:14 +02:00
xfs_dir2.c xfs: event tracing support 2009-12-14 23:08:16 -06:00
xfs_dir2.h
xfs_dir2_block.c xfs: event tracing support 2009-12-14 23:08:16 -06:00
xfs_dir2_block.h
xfs_dir2_data.c
xfs_dir2_data.h xfs: fix various typos 2009-03-29 09:55:42 +02:00
xfs_dir2_leaf.c xfs: event tracing support 2009-12-14 23:08:16 -06:00
xfs_dir2_leaf.h
xfs_dir2_node.c xfs: event tracing support 2009-12-14 23:08:16 -06:00
xfs_dir2_node.h
xfs_dir2_sf.c xfs: event tracing support 2009-12-14 23:08:16 -06:00
xfs_dir2_sf.h
xfs_dmapi.h
xfs_dmops.c
xfs_error.c
xfs_error.h
xfs_extfree_item.c
xfs_extfree_item.h [XFS] remove always-true #ifndef HAVE_FORMAT32 tests 2009-01-22 14:07:31 +11:00
xfs_filestream.c xfs: event tracing support 2009-12-14 23:08:16 -06:00
xfs_filestream.h xfs: kill the STATIC_INLINE macro 2009-12-11 15:11:22 -06:00
xfs_fs.h trivial: fix typo "for for" in multiple files 2009-09-21 15:14:54 +02:00
xfs_fsops.c xfs: event tracing support 2009-12-14 23:08:16 -06:00
xfs_fsops.h
xfs_ialloc.c xfs: kill the STATIC_INLINE macro 2009-12-11 15:11:22 -06:00
xfs_ialloc.h xfs: rationalize xfs_inobt_lookup* 2009-09-01 12:45:39 -05:00
xfs_ialloc_btree.c xfs: fix various typos 2009-03-29 09:55:42 +02:00
xfs_ialloc_btree.h xfs: remove superflous inobt macros 2009-02-09 08:37:14 +01:00
xfs_iget.c xfs: event tracing support 2009-12-14 23:08:16 -06:00
xfs_inode.c xfs: event tracing support 2009-12-14 23:08:16 -06:00
xfs_inode.h xfs: event tracing support 2009-12-14 23:08:16 -06:00
xfs_inode_item.c xfs: event tracing support 2009-12-14 23:08:16 -06:00
xfs_inode_item.h xfs: simplify xfs_trans_iget 2009-09-01 12:46:16 -05:00
xfs_inum.h xfs: remove XFS_INO64_OFFSET 2009-08-31 14:46:22 -05:00
xfs_iomap.c xfs: event tracing support 2009-12-14 23:08:16 -06:00
xfs_iomap.h xfs: event tracing support 2009-12-14 23:08:16 -06:00
xfs_itable.c xfs: implement ->dirty_inode to fix timestamp handling 2009-10-08 12:00:03 -05:00
xfs_itable.h xfs: add more statics & drop some unused functions 2009-08-31 14:46:20 -05:00
xfs_log.c xfs: event tracing support 2009-12-14 23:08:16 -06:00
xfs_log.h xfs: cleanup log unmount handling 2009-03-16 08:19:29 +01:00
xfs_log_priv.h xfs: event tracing support 2009-12-14 23:08:16 -06:00
xfs_log_recover.c Merge branch 'for-linus' of git://oss.sgi.com/xfs/xfs 2009-12-15 09:12:43 -08:00
xfs_log_recover.h
xfs_mount.c xfs: event tracing support 2009-12-14 23:08:16 -06:00
xfs_mount.h xfs: cleanup dmapi macros in the umount path 2009-12-11 15:11:23 -06:00
xfs_mru_cache.c xfs: add more statics & drop some unused functions 2009-08-31 14:46:20 -05:00
xfs_mru_cache.h xfs: add more statics & drop some unused functions 2009-08-31 14:46:20 -05:00
xfs_quota.h xfs: event tracing support 2009-12-14 23:08:16 -06:00
xfs_refcache.h
xfs_rename.c xfs: event tracing support 2009-12-14 23:08:16 -06:00
xfs_rtalloc.c xfs: event tracing support 2009-12-14 23:08:16 -06:00
xfs_rtalloc.h xfs: fix various typos 2009-03-29 09:55:42 +02:00
xfs_rw.c xfs: event tracing support 2009-12-14 23:08:16 -06:00
xfs_rw.h xfs: uninline xfs_get_extsz_hint 2009-12-11 15:11:22 -06:00
xfs_sb.h [XFS] Remove the rest of the macro-to-function indirections. 2009-01-19 14:45:55 +11:00
xfs_trans.c xfs: I/O completion handlers must use NOFS allocations 2009-12-11 15:11:20 -06:00
xfs_trans.h xfs: event tracing support 2009-12-14 23:08:16 -06:00
xfs_trans_ail.c xfs: copy li_lsn before dropping AIL lock 2009-11-17 10:26:49 -06:00
xfs_trans_buf.c xfs: event tracing support 2009-12-14 23:08:16 -06:00
xfs_trans_extfree.c
xfs_trans_inode.c xfs: simplify xfs_trans_iget 2009-09-01 12:46:16 -05:00
xfs_trans_item.c xfs: fix various typos 2009-03-29 09:55:42 +02:00
xfs_trans_priv.h
xfs_trans_space.h xfs: remove superflous inobt macros 2009-02-09 08:37:14 +01:00
xfs_types.h xfs: remove uchar_t/ushort_t/uint_t/ulong_t types 2009-02-09 08:37:39 +01:00
xfs_utils.c xfs: kill xfs_qmops 2009-06-08 15:33:32 +02:00
xfs_utils.h
xfs_vnodeops.c xfs: event tracing support 2009-12-14 23:08:16 -06:00
xfs_vnodeops.h xfs: simplify inode teardown 2009-12-11 15:11:19 -06:00