[PATCH 13/16] xfs: use is_xxx_kiocb instead of filp->fl_flags

From: Dmitry Monakhov
Date: Sat Apr 04 2015 - 15:14:50 EST


Also function interface cleanup in order to vfs:write_iter interface agreeament

Cc: xfs@xxxxxxxxxxx
Signed-off-by: Dmitry Monakhov <dmonakhov@xxxxxxxxxx>
---
fs/xfs/xfs_file.c | 13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/fs/xfs/xfs_file.c b/fs/xfs/xfs_file.c
index f44212f..148039b 100644
--- a/fs/xfs/xfs_file.c
+++ b/fs/xfs/xfs_file.c
@@ -279,7 +279,7 @@ xfs_file_read_iter(

XFS_STATS_INC(xs_read_calls);

- if (unlikely(file->f_flags & O_DIRECT))
+ if (unlikely(is_direct_kiocb(iocb)))
ioflags |= XFS_IO_ISDIRECT;
if (file->f_mode & FMODE_NOCMTIME)
ioflags |= XFS_IO_INVIS;
@@ -544,17 +544,18 @@ xfs_zero_eof(
*/
STATIC ssize_t
xfs_file_aio_write_checks(
- struct file *file,
+ struct kiocb *iocb,
loff_t *pos,
size_t *count,
int *iolock)
{
+ struct file *file = iocb->ki_filp;
struct inode *inode = file->f_mapping->host;
struct xfs_inode *ip = XFS_I(inode);
int error = 0;

restart:
- error = generic_write_checks(file, pos, count, S_ISBLK(inode->i_mode));
+ error = generic_write_checks(iocb, pos, count, S_ISBLK(inode->i_mode));
if (error)
return error;

@@ -678,7 +679,7 @@ xfs_file_dio_aio_write(
xfs_rw_ilock(ip, iolock);
}

- ret = xfs_file_aio_write_checks(file, &pos, &count, &iolock);
+ ret = xfs_file_aio_write_checks(iocb, &pos, &count, &iolock);
if (ret)
goto out;
iov_iter_truncate(from, count);
@@ -739,7 +740,7 @@ xfs_file_buffered_aio_write(

xfs_rw_ilock(ip, iolock);

- ret = xfs_file_aio_write_checks(file, &pos, &count, &iolock);
+ ret = xfs_file_aio_write_checks(iocb, &pos, &count, &iolock);
if (ret)
goto out;

@@ -803,7 +804,7 @@ xfs_file_write_iter(
if (XFS_FORCED_SHUTDOWN(ip->i_mount))
return -EIO;

- if (unlikely(file->f_flags & O_DIRECT))
+ if (unlikely(is_direct_kiocb(iocb)))
ret = xfs_file_dio_aio_write(iocb, from);
else
ret = xfs_file_buffered_aio_write(iocb, from);
--
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/