kernel_optimize_test/fs
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
..
9p
adfs
affs
afs
autofs
autofs4 autofs4: always use lookup for lookup 2009-12-16 07:19:58 -08:00
befs
bfs
btrfs task_struct: make journal_info conditional 2009-12-15 08:53:27 -08:00
cachefiles tree-wide: convert open calls to remove spaces to skip_spaces() lib function 2009-12-15 08:53:32 -08:00
cifs
coda
configfs
cramfs
debugfs
devpts
dlm
ecryptfs
efs
exofs
exportfs
ext2 ext2: report metadata errors during fsync 2009-12-16 07:20:06 -08:00
ext3
ext4 tree-wide: convert open calls to remove spaces to skip_spaces() lib function 2009-12-15 08:53:32 -08:00
fat fatfs: use common time_to_tm in fat_time_unix2fat() 2009-12-16 07:20:06 -08:00
freevxfs
fscache FS-Cache: Avoid maybe-used-uninitialised warning on variable 2009-12-16 07:20:13 -08:00
fuse
gfs2 fs/gfs2/sys.c: use %pUB to print UUIDs 2009-12-15 08:53:33 -08:00
hfs hfs: fix a potential buffer overflow 2009-12-15 08:53:10 -08:00
hfsplus
hostfs
hpfs hpfs: use bitmap_weight() 2009-12-16 07:20:06 -08:00
hppfs
hugetlbfs
isofs
jbd task_struct: make journal_info conditional 2009-12-15 08:53:27 -08:00
jbd2 task_struct: make journal_info conditional 2009-12-15 08:53:27 -08:00
jffs2
jfs
lockd
minix
ncpfs
nfs Merge git://git.linux-nfs.org/projects/trondmy/nfs-2.6 2009-12-14 10:00:24 -08:00
nfs_common
nfsd
nilfs2 task_struct: make journal_info conditional 2009-12-15 08:53:27 -08:00
nls
notify
ntfs
ocfs2 direct-io: cleanup blockdev_direct_IO locking 2009-12-16 07:20:13 -08:00
omfs
openpromfs
partitions
proc elf: kill USE_ELF_CORE_DUMP 2009-12-16 07:20:12 -08:00
qnx4
quota
ramfs
reiserfs reiserfs: don't compile procfs.o at all if no support 2009-12-16 07:20:06 -08:00
romfs
smbfs
squashfs
sysfs
sysv
ubifs fs/ubifs: use %pUB to print UUIDs 2009-12-15 08:53:33 -08:00
udf udf: Avoid IO in udf_clear_inode 2009-12-14 21:40:04 +01:00
ufs ufs: NFS support 2009-12-16 07:20:06 -08:00
xfs direct-io: cleanup blockdev_direct_IO locking 2009-12-16 07:20:13 -08:00
aio.c aio: remove unused field 2009-12-16 07:20:13 -08:00
anon_inodes.c
attr.c
bad_inode.c
binfmt_aout.c
binfmt_elf_fdpic.c elf: kill USE_ELF_CORE_DUMP 2009-12-16 07:20:12 -08:00
binfmt_elf.c elf: kill USE_ELF_CORE_DUMP 2009-12-16 07:20:12 -08:00
binfmt_em86.c
binfmt_flat.c
binfmt_misc.c
binfmt_script.c
binfmt_som.c
bio-integrity.c
bio.c
block_dev.c
buffer.c
char_dev.c
compat_binfmt_elf.c
compat_ioctl.c md: move compat_ioctl handling into md.c 2009-12-14 12:51:41 +11:00
compat.c
dcache.c
dcookies.c
direct-io.c direct-io: cleanup blockdev_direct_IO locking 2009-12-16 07:20:13 -08:00
drop_caches.c
eventfd.c
eventpoll.c
exec.c procfs: allow threads to rename siblings via /proc/pid/tasks/tid/comm 2009-12-15 08:53:24 -08:00
fcntl.c
fifo.c
file_table.c
file.c
filesystems.c
fs_struct.c
fs-writeback.c
generic_acl.c
inode.c
internal.h
ioctl.c
ioprio.c
Kconfig task_struct: make journal_info conditional 2009-12-15 08:53:27 -08:00
Kconfig.binfmt
libfs.c
locks.c
Makefile
mbcache.c
mpage.c
namei.c Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs-2.6 2009-12-11 15:31:13 -08:00
namespace.c
nfsctl.c
no-block.c
open.c
pipe.c
pnode.c
pnode.h
posix_acl.c
read_write.c
read_write.h
readdir.c
select.c
seq_file.c
signalfd.c
splice.c
stack.c
stat.c
super.c
sync.c
timerfd.c
utimes.c
xattr_acl.c
xattr.c