Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d9b08b9efece1f397143378938e626d0de29e911
Commit:     d9b08b9efece1f397143378938e626d0de29e911
Parent:     8fccfc829a66b8b879c6672940523a402a786ce1
Author:     Christoph Hellwig <[EMAIL PROTECTED]>
AuthorDate: Fri May 18 13:12:40 2007 +0200
Committer:  Mark Fasheh <[EMAIL PROTECTED]>
CommitDate: Fri May 25 11:06:37 2007 -0700

    [PATCH] ocfs2: use generic_segment_checks
    
    Signed-off-by: Christoph Hellwig <[EMAIL PROTECTED]>
    Signed-off-by: Mark Fasheh <[EMAIL PROTECTED]>
---
 fs/ocfs2/file.c |   32 +-------------------------------
 1 files changed, 1 insertions(+), 31 deletions(-)

diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c
index d459eb9..ac6c964 100644
--- a/fs/ocfs2/file.c
+++ b/fs/ocfs2/file.c
@@ -1419,36 +1419,6 @@ out:
        return total ? total : ret;
 }
 
-static int ocfs2_check_iovec(const struct iovec *iov, size_t *counted,
-                            unsigned long *nr_segs)
-{
-       size_t ocount;          /* original count */
-       unsigned long seg;
-
-       ocount = 0;
-       for (seg = 0; seg < *nr_segs; seg++) {
-               const struct iovec *iv = &iov[seg];
-
-               /*
-                * If any segment has a negative length, or the cumulative
-                * length ever wraps negative then return -EINVAL.
-                */
-               ocount += iv->iov_len;
-               if (unlikely((ssize_t)(ocount|iv->iov_len) < 0))
-                       return -EINVAL;
-               if (access_ok(VERIFY_READ, iv->iov_base, iv->iov_len))
-                       continue;
-               if (seg == 0)
-                       return -EFAULT;
-               *nr_segs = seg;
-               ocount -= iv->iov_len;  /* This segment is no good */
-               break;
-       }
-
-       *counted = ocount;
-       return 0;
-}
-
 static ssize_t ocfs2_file_aio_write(struct kiocb *iocb,
                                    const struct iovec *iov,
                                    unsigned long nr_segs,
@@ -1471,7 +1441,7 @@ static ssize_t ocfs2_file_aio_write(struct kiocb *iocb,
        if (iocb->ki_left == 0)
                return 0;
 
-       ret = ocfs2_check_iovec(iov, &ocount, &nr_segs);
+       ret = generic_segment_checks(iov, &nr_segs, &ocount, VERIFY_READ);
        if (ret)
                return ret;
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to