diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-05 11:50:26 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-05 11:50:26 -0400 |
commit | 45d9a2220f6004b47c362cc7fc7cf9a73cb6353a (patch) | |
tree | 4e2217464c5cd71674a6ffff1f3dddaeb52556b7 /fs/ext4/inode.c | |
parent | 2386a3b0fbb0c2dcf29694c7df9a72cb268458f0 (diff) | |
parent | 02afc27faec94c9e068517a22acf55400976c698 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull vfs pile 1 from Al Viro:
"Unfortunately, this merge window it'll have a be a lot of small piles -
my fault, actually, for not keeping #for-next in anything that would
resemble a sane shape ;-/
This pile: assorted fixes (the first 3 are -stable fodder, IMO) and
cleanups + %pd/%pD formats (dentry/file pathname, up to 4 last
components) + several long-standing patches from various folks.
There definitely will be a lot more (starting with Miklos'
check_submount_and_drop() series)"
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (26 commits)
direct-io: Handle O_(D)SYNC AIO
direct-io: Implement generic deferred AIO completions
add formats for dentry/file pathnames
kvm eventfd: switch to fdget
powerpc kvm: use fdget
switch fchmod() to fdget
switch epoll_ctl() to fdget
switch copy_module_from_fd() to fdget
git simplify nilfs check for busy subtree
ibmasmfs: don't bother passing superblock when not needed
don't pass superblock to hypfs_{mkdir,create*}
don't pass superblock to hypfs_diag_create_files
don't pass superblock to hypfs_vm_create_files()
oprofile: get rid of pointless forward declarations of struct super_block
oprofilefs_create_...() do not need superblock argument
oprofilefs_mkdir() doesn't need superblock argument
don't bother with passing superblock to oprofile_create_stats_files()
oprofile: don't bother with passing superblock to ->create_files()
don't bother passing sb to oprofile_create_files()
coh901318: don't open-code simple_read_from_buffer()
...
Diffstat (limited to 'fs/ext4/inode.c')
-rw-r--r-- | fs/ext4/inode.c | 28 |
1 files changed, 7 insertions, 21 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 9115f2807515..c79fd7dabe79 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c | |||
@@ -727,8 +727,12 @@ static int _ext4_get_block(struct inode *inode, sector_t iblock, | |||
727 | 727 | ||
728 | ret = ext4_map_blocks(handle, inode, &map, flags); | 728 | ret = ext4_map_blocks(handle, inode, &map, flags); |
729 | if (ret > 0) { | 729 | if (ret > 0) { |
730 | ext4_io_end_t *io_end = ext4_inode_aio(inode); | ||
731 | |||
730 | map_bh(bh, inode->i_sb, map.m_pblk); | 732 | map_bh(bh, inode->i_sb, map.m_pblk); |
731 | bh->b_state = (bh->b_state & ~EXT4_MAP_FLAGS) | map.m_flags; | 733 | bh->b_state = (bh->b_state & ~EXT4_MAP_FLAGS) | map.m_flags; |
734 | if (io_end && io_end->flag & EXT4_IO_END_UNWRITTEN) | ||
735 | set_buffer_defer_completion(bh); | ||
732 | bh->b_size = inode->i_sb->s_blocksize * map.m_len; | 736 | bh->b_size = inode->i_sb->s_blocksize * map.m_len; |
733 | ret = 0; | 737 | ret = 0; |
734 | } | 738 | } |
@@ -3024,19 +3028,13 @@ static int ext4_get_block_write_nolock(struct inode *inode, sector_t iblock, | |||
3024 | } | 3028 | } |
3025 | 3029 | ||
3026 | static void ext4_end_io_dio(struct kiocb *iocb, loff_t offset, | 3030 | static void ext4_end_io_dio(struct kiocb *iocb, loff_t offset, |
3027 | ssize_t size, void *private, int ret, | 3031 | ssize_t size, void *private) |
3028 | bool is_async) | ||
3029 | { | 3032 | { |
3030 | struct inode *inode = file_inode(iocb->ki_filp); | ||
3031 | ext4_io_end_t *io_end = iocb->private; | 3033 | ext4_io_end_t *io_end = iocb->private; |
3032 | 3034 | ||
3033 | /* if not async direct IO just return */ | 3035 | /* if not async direct IO just return */ |
3034 | if (!io_end) { | 3036 | if (!io_end) |
3035 | inode_dio_done(inode); | ||
3036 | if (is_async) | ||
3037 | aio_complete(iocb, ret, 0); | ||
3038 | return; | 3037 | return; |
3039 | } | ||
3040 | 3038 | ||
3041 | ext_debug("ext4_end_io_dio(): io_end 0x%p " | 3039 | ext_debug("ext4_end_io_dio(): io_end 0x%p " |
3042 | "for inode %lu, iocb 0x%p, offset %llu, size %zd\n", | 3040 | "for inode %lu, iocb 0x%p, offset %llu, size %zd\n", |
@@ -3046,11 +3044,7 @@ static void ext4_end_io_dio(struct kiocb *iocb, loff_t offset, | |||
3046 | iocb->private = NULL; | 3044 | iocb->private = NULL; |
3047 | io_end->offset = offset; | 3045 | io_end->offset = offset; |
3048 | io_end->size = size; | 3046 | io_end->size = size; |
3049 | if (is_async) { | 3047 | ext4_put_io_end(io_end); |
3050 | io_end->iocb = iocb; | ||
3051 | io_end->result = ret; | ||
3052 | } | ||
3053 | ext4_put_io_end_defer(io_end); | ||
3054 | } | 3048 | } |
3055 | 3049 | ||
3056 | /* | 3050 | /* |
@@ -3135,7 +3129,6 @@ static ssize_t ext4_ext_direct_IO(int rw, struct kiocb *iocb, | |||
3135 | ret = -ENOMEM; | 3129 | ret = -ENOMEM; |
3136 | goto retake_lock; | 3130 | goto retake_lock; |
3137 | } | 3131 | } |
3138 | io_end->flag |= EXT4_IO_END_DIRECT; | ||
3139 | /* | 3132 | /* |
3140 | * Grab reference for DIO. Will be dropped in ext4_end_io_dio() | 3133 | * Grab reference for DIO. Will be dropped in ext4_end_io_dio() |
3141 | */ | 3134 | */ |
@@ -3180,13 +3173,6 @@ static ssize_t ext4_ext_direct_IO(int rw, struct kiocb *iocb, | |||
3180 | if (ret <= 0 && ret != -EIOCBQUEUED && iocb->private) { | 3173 | if (ret <= 0 && ret != -EIOCBQUEUED && iocb->private) { |
3181 | WARN_ON(iocb->private != io_end); | 3174 | WARN_ON(iocb->private != io_end); |
3182 | WARN_ON(io_end->flag & EXT4_IO_END_UNWRITTEN); | 3175 | WARN_ON(io_end->flag & EXT4_IO_END_UNWRITTEN); |
3183 | WARN_ON(io_end->iocb); | ||
3184 | /* | ||
3185 | * Generic code already did inode_dio_done() so we | ||
3186 | * have to clear EXT4_IO_END_DIRECT to not do it for | ||
3187 | * the second time. | ||
3188 | */ | ||
3189 | io_end->flag = 0; | ||
3190 | ext4_put_io_end(io_end); | 3176 | ext4_put_io_end(io_end); |
3191 | iocb->private = NULL; | 3177 | iocb->private = NULL; |
3192 | } | 3178 | } |