xfs_file.c (f1285ff0acf9040a39921355d07bd83a3308c402) xfs_file.c (fa8d972d055c723cc427e14d4d7919640f418730)
1/*
2 * Copyright (c) 2000-2005 Silicon Graphics, Inc.
3 * All Rights Reserved.
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation.
8 *

--- 346 unchanged lines hidden (view full) ---

355 ret = invalidate_inode_pages2(mapping);
356 WARN_ON_ONCE(ret);
357 ret = 0;
358 }
359 xfs_rw_ilock_demote(ip, XFS_IOLOCK_EXCL);
360 }
361
362 data = *to;
1/*
2 * Copyright (c) 2000-2005 Silicon Graphics, Inc.
3 * All Rights Reserved.
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation.
8 *

--- 346 unchanged lines hidden (view full) ---

355 ret = invalidate_inode_pages2(mapping);
356 WARN_ON_ONCE(ret);
357 ret = 0;
358 }
359 xfs_rw_ilock_demote(ip, XFS_IOLOCK_EXCL);
360 }
361
362 data = *to;
363 ret = mapping->a_ops->direct_IO(iocb, &data);
363 if (IS_DAX(inode)) {
364 ret = dax_do_io(iocb, inode, &data, xfs_get_blocks_direct,
365 NULL, 0);
366 } else {
367 ret = __blockdev_direct_IO(iocb, inode, target->bt_bdev, &data,
368 xfs_get_blocks_direct, NULL, NULL, 0);
369 }
364 if (ret > 0) {
365 iocb->ki_pos += ret;
366 iov_iter_advance(to, ret);
367 }
368 xfs_rw_iunlock(ip, XFS_IOLOCK_SHARED);
369
370 file_accessed(iocb->ki_filp);
371 return ret;

--- 442 unchanged lines hidden (view full) ---

814 else if (iolock == XFS_IOLOCK_EXCL) {
815 xfs_rw_ilock_demote(ip, XFS_IOLOCK_EXCL);
816 iolock = XFS_IOLOCK_SHARED;
817 }
818
819 trace_xfs_file_direct_write(ip, count, iocb->ki_pos);
820
821 data = *from;
370 if (ret > 0) {
371 iocb->ki_pos += ret;
372 iov_iter_advance(to, ret);
373 }
374 xfs_rw_iunlock(ip, XFS_IOLOCK_SHARED);
375
376 file_accessed(iocb->ki_filp);
377 return ret;

--- 442 unchanged lines hidden (view full) ---

820 else if (iolock == XFS_IOLOCK_EXCL) {
821 xfs_rw_ilock_demote(ip, XFS_IOLOCK_EXCL);
822 iolock = XFS_IOLOCK_SHARED;
823 }
824
825 trace_xfs_file_direct_write(ip, count, iocb->ki_pos);
826
827 data = *from;
822 ret = mapping->a_ops->direct_IO(iocb, &data);
828 if (IS_DAX(inode)) {
829 ret = dax_do_io(iocb, inode, &data, xfs_get_blocks_direct,
830 xfs_end_io_direct_write, 0);
831 } else {
832 ret = __blockdev_direct_IO(iocb, inode, target->bt_bdev, &data,
833 xfs_get_blocks_direct, xfs_end_io_direct_write,
834 NULL, DIO_ASYNC_EXTEND);
835 }
823
824 /* see generic_file_direct_write() for why this is necessary */
825 if (mapping->nrpages) {
826 invalidate_inode_pages2_range(mapping,
827 iocb->ki_pos >> PAGE_SHIFT,
828 end >> PAGE_SHIFT);
829 }
830

--- 912 unchanged lines hidden ---
836
837 /* see generic_file_direct_write() for why this is necessary */
838 if (mapping->nrpages) {
839 invalidate_inode_pages2_range(mapping,
840 iocb->ki_pos >> PAGE_SHIFT,
841 end >> PAGE_SHIFT);
842 }
843

--- 912 unchanged lines hidden ---