|
@@ -1645,7 +1645,7 @@ out_end_io:
|
|
* case the completion can be called in interrupt context, whereas if we have an
|
|
* case the completion can be called in interrupt context, whereas if we have an
|
|
* ioend we will always be called in task context (i.e. from a workqueue).
|
|
* ioend we will always be called in task context (i.e. from a workqueue).
|
|
*/
|
|
*/
|
|
-STATIC void
|
|
|
|
|
|
+STATIC int
|
|
xfs_end_io_direct_write(
|
|
xfs_end_io_direct_write(
|
|
struct kiocb *iocb,
|
|
struct kiocb *iocb,
|
|
loff_t offset,
|
|
loff_t offset,
|
|
@@ -1655,15 +1655,19 @@ xfs_end_io_direct_write(
|
|
struct inode *inode = file_inode(iocb->ki_filp);
|
|
struct inode *inode = file_inode(iocb->ki_filp);
|
|
struct xfs_ioend *ioend = private;
|
|
struct xfs_ioend *ioend = private;
|
|
|
|
|
|
|
|
+ if (size <= 0)
|
|
|
|
+ return 0;
|
|
|
|
+
|
|
trace_xfs_gbmap_direct_endio(XFS_I(inode), offset, size,
|
|
trace_xfs_gbmap_direct_endio(XFS_I(inode), offset, size,
|
|
ioend ? ioend->io_type : 0, NULL);
|
|
ioend ? ioend->io_type : 0, NULL);
|
|
|
|
|
|
if (!ioend) {
|
|
if (!ioend) {
|
|
ASSERT(offset + size <= i_size_read(inode));
|
|
ASSERT(offset + size <= i_size_read(inode));
|
|
- return;
|
|
|
|
|
|
+ return 0;
|
|
}
|
|
}
|
|
|
|
|
|
__xfs_end_io_direct_write(inode, ioend, offset, size);
|
|
__xfs_end_io_direct_write(inode, ioend, offset, size);
|
|
|
|
+ return 0;
|
|
}
|
|
}
|
|
|
|
|
|
static inline ssize_t
|
|
static inline ssize_t
|
|
@@ -1672,10 +1676,7 @@ xfs_vm_do_dio(
|
|
struct kiocb *iocb,
|
|
struct kiocb *iocb,
|
|
struct iov_iter *iter,
|
|
struct iov_iter *iter,
|
|
loff_t offset,
|
|
loff_t offset,
|
|
- void (*endio)(struct kiocb *iocb,
|
|
|
|
- loff_t offset,
|
|
|
|
- ssize_t size,
|
|
|
|
- void *private),
|
|
|
|
|
|
+ dio_iodone_t endio,
|
|
int flags)
|
|
int flags)
|
|
{
|
|
{
|
|
struct block_device *bdev;
|
|
struct block_device *bdev;
|