alistair23-linux/fs/btrfs
Chris Mason 4845e44ffd Btrfs: rework O_DIRECT enospc handling
This changes O_DIRECT write code to mark extents as delalloc
while it is processing them.  Yan Zheng has reworked the
enospc accounting based on tracking delalloc extents and
this makes it much easier to track enospc in the O_DIRECT code.

There are a few space cases with the O_DIRECT code though,
it only sets the EXTENT_DELALLOC bits, instead of doing
EXTENT_DELALLOC | EXTENT_DIRTY | EXTENT_UPTODATE, because
we don't want to mess with clearing the dirty and uptodate
bits when things go wrong.  This is important because there
are no pages in the page cache, so any extent state structs
that we put in the tree won't get freed by releasepage.  We have
to clear them ourselves as the DIO ends.

With this commit, we reserve space at in btrfs_file_aio_write,
and then as each btrfs_direct_IO call progresses it sets
EXTENT_DELALLOC on the range.

btrfs_get_blocks_direct is responsible for clearing the delalloc
at the same time it drops the extent lock.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
2010-05-25 21:52:08 -04:00
..
acl.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
async-thread.c Btrfs: don't walk around with task->state != TASK_RUNNING 2010-05-25 10:34:58 -04:00
async-thread.h Btrfs: fix deadlock on async thread startup 2009-10-05 09:44:45 -04:00
btrfs_inode.h Btrfs: Metadata reservation for orphan inodes 2010-05-25 10:34:52 -04:00
compat.h
compression.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable 2010-04-05 13:21:15 -07:00
compression.h
ctree.c Btrfs: Metadata ENOSPC handling for balance 2010-05-25 10:34:54 -04:00
ctree.h Btrfs: add basic DIO read/write support 2010-05-25 10:34:57 -04:00
delayed-ref.c Btrfs: Integrate metadata reservation with start_transaction 2010-05-25 10:34:50 -04:00
delayed-ref.h Btrfs: Integrate metadata reservation with start_transaction 2010-05-25 10:34:50 -04:00
dir-item.c Btrfs: Pass transaction handle to security and ACL initialization functions 2009-12-17 12:33:34 -05:00
disk-io.c Btrfs: use async helpers for DIO write checksumming 2010-05-25 10:34:58 -04:00
disk-io.h Btrfs: use async helpers for DIO write checksumming 2010-05-25 10:34:58 -04:00
export.c Btrfs: change how we mount subvolumes 2010-03-15 10:58:13 -04:00
export.h
extent-tree.c Btrfs: Metadata ENOSPC handling for balance 2010-05-25 10:34:54 -04:00
extent_io.c Btrfs: rework O_DIRECT enospc handling 2010-05-25 21:52:08 -04:00
extent_io.h Btrfs: rework O_DIRECT enospc handling 2010-05-25 21:52:08 -04:00
extent_map.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
extent_map.h
file-item.c Btrfs: add basic DIO read/write support 2010-05-25 10:34:57 -04:00
file.c Btrfs: rework O_DIRECT enospc handling 2010-05-25 21:52:08 -04:00
free-space-cache.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
free-space-cache.h
hash.h
inode-item.c Btrfs: Integrate metadata reservation with start_transaction 2010-05-25 10:34:50 -04:00
inode-map.c
inode.c Btrfs: rework O_DIRECT enospc handling 2010-05-25 21:52:08 -04:00
ioctl.c Btrfs: Metadata reservation for orphan inodes 2010-05-25 10:34:52 -04:00
ioctl.h Btrfs: use __u64 types in ioctl.h 2010-03-16 14:24:27 -04:00
Kconfig Revert "task_struct: make journal_info conditional" 2009-12-17 13:23:24 -08:00
locking.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
locking.h
Makefile
ordered-data.c Btrfs: add basic DIO read/write support 2010-05-25 10:34:57 -04:00
ordered-data.h Btrfs: add basic DIO read/write support 2010-05-25 10:34:57 -04:00
orphan.c
print-tree.c
print-tree.h
ref-cache.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
ref-cache.h Btrfs: use RB_ROOT to intialize rb_trees instead of setting rb_node to NULL 2010-03-08 16:26:50 -05:00
relocation.c Btrfs: Metadata ENOSPC handling for balance 2010-05-25 10:34:54 -04:00
root-tree.c Btrfs: Metadata reservation for orphan inodes 2010-05-25 10:34:52 -04:00
struct-funcs.c
super.c Btrfs: Metadata reservation for orphan inodes 2010-05-25 10:34:52 -04:00
sysfs.c Driver core: Constify struct sysfs_ops in struct kobj_type 2010-03-07 17:04:49 -08:00
transaction.c Btrfs: don't walk around with task->state != TASK_RUNNING 2010-05-25 10:34:58 -04:00
transaction.h Btrfs: Introduce global metadata reservation 2010-05-25 10:34:52 -04:00
tree-defrag.c Btrfs: Introduce global metadata reservation 2010-05-25 10:34:52 -04:00
tree-log.c Btrfs: Metadata ENOSPC handling for tree log 2010-05-25 10:34:53 -04:00
tree-log.h Btrfs: Metadata ENOSPC handling for tree log 2010-05-25 10:34:53 -04:00
version.h
version.sh
volumes.c Btrfs: Integrate metadata reservation with start_transaction 2010-05-25 10:34:50 -04:00
volumes.h
xattr.c Btrfs: Integrate metadata reservation with start_transaction 2010-05-25 10:34:50 -04:00
xattr.h Btrfs: Pass transaction handle to security and ACL initialization functions 2009-12-17 12:33:34 -05:00
zlib.c