file.c (cecdd52a3dd312564f81a39df08378b7b39a2654) file.c (de4f5fed3f231a8ff4790bf52975f847b95b85ea)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (C) 2007 Oracle. All rights reserved.
4 */
5
6#include <linux/fs.h>
7#include <linux/pagemap.h>
8#include <linux/time.h>

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

3725
3726 ret = check_direct_IO(fs_info, iter, offset);
3727 if (ret < 0)
3728 return ret;
3729
3730 if (!iter_is_iovec(iter))
3731 return 0;
3732
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (C) 2007 Oracle. All rights reserved.
4 */
5
6#include <linux/fs.h>
7#include <linux/pagemap.h>
8#include <linux/time.h>

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

3725
3726 ret = check_direct_IO(fs_info, iter, offset);
3727 if (ret < 0)
3728 return ret;
3729
3730 if (!iter_is_iovec(iter))
3731 return 0;
3732
3733 for (seg = 0; seg < iter->nr_segs; seg++)
3734 for (i = seg + 1; i < iter->nr_segs; i++)
3735 if (iter->iov[seg].iov_base == iter->iov[i].iov_base)
3733 for (seg = 0; seg < iter->nr_segs; seg++) {
3734 for (i = seg + 1; i < iter->nr_segs; i++) {
3735 const struct iovec *iov1 = iter_iov(iter) + seg;
3736 const struct iovec *iov2 = iter_iov(iter) + i;
3737
3738 if (iov1->iov_base == iov2->iov_base)
3736 return -EINVAL;
3739 return -EINVAL;
3740 }
3741 }
3737 return 0;
3738}
3739
3740static ssize_t btrfs_direct_read(struct kiocb *iocb, struct iov_iter *to)
3741{
3742 struct inode *inode = file_inode(iocb->ki_filp);
3743 size_t prev_left = 0;
3744 ssize_t read = 0;

--- 119 unchanged lines hidden ---
3742 return 0;
3743}
3744
3745static ssize_t btrfs_direct_read(struct kiocb *iocb, struct iov_iter *to)
3746{
3747 struct inode *inode = file_inode(iocb->ki_filp);
3748 size_t prev_left = 0;
3749 ssize_t read = 0;

--- 119 unchanged lines hidden ---