]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
orangefs: pass slot index back to readpage.
authorMike Marshall <hubcap@omnibond.com>
Mon, 25 Mar 2019 22:17:10 +0000 (18:17 -0400)
committerMike Marshall <hubcap@omnibond.com>
Fri, 3 May 2019 18:32:39 +0000 (14:32 -0400)
When userspace deposits more than a page of data into the shared buffer,
we'll need to know which slot it is in when we get back to readpage
so that we can try to use the extra data to fill some extra pages.

Signed-off-by: Mike Marshall <hubcap@omnibond.com>
Signed-off-by: Martin Brandenburg <martin@omnibond.com>
fs/orangefs/file.c
fs/orangefs/inode.c
fs/orangefs/orangefs-kernel.h

index 74292d31d1133428fa9214c745e7d03d66b517b3..68ba5ae7ef5dfa7b64c311271cfe9238ea4b9f7f 100644 (file)
@@ -47,7 +47,7 @@ static int flush_racache(struct inode *inode)
  */
 ssize_t wait_for_direct_io(enum ORANGEFS_io_type type, struct inode *inode,
     loff_t *offset, struct iov_iter *iter, size_t total_size,
-    loff_t readahead_size, struct orangefs_write_range *wr)
+    loff_t readahead_size, struct orangefs_write_range *wr, int *index_return)
 {
        struct orangefs_inode_s *orangefs_inode = ORANGEFS_I(inode);
        struct orangefs_khandle *handle = &orangefs_inode->refn.khandle;
index 7ed2ea093c4ea5fb47baf692e0a78e17617fe8a5..cded74edb47c309f3e9396d68eee6ffe8b54a0cd 100644 (file)
@@ -55,7 +55,7 @@ static int orangefs_writepage_locked(struct page *page,
        iov_iter_bvec(&iter, WRITE, &bv, 1, wlen);
 
        ret = wait_for_direct_io(ORANGEFS_IO_WRITE, inode, &off, &iter, wlen,
-           len, wr);
+           len, wr, NULL);
        if (ret < 0) {
                SetPageError(page);
                mapping_set_error(page->mapping, ret);
@@ -126,7 +126,7 @@ static int orangefs_writepages_work(struct orangefs_writepages *ow,
        wr.uid = ow->uid;
        wr.gid = ow->gid;
        ret = wait_for_direct_io(ORANGEFS_IO_WRITE, inode, &off, &iter, ow->len,
-           0, &wr);
+           0, &wr, NULL);
        if (ret < 0) {
                for (i = 0; i < ow->npages; i++) {
                        SetPageError(ow->pages[i]);
@@ -265,7 +265,7 @@ static int orangefs_readpage(struct file *file, struct page *page)
                orangefs_launder_page(page);
 
        ret = wait_for_direct_io(ORANGEFS_IO_READ, inode, &off, &iter,
-           PAGE_SIZE, inode->i_size, NULL);
+           PAGE_SIZE, inode->i_size, NULL, NULL);
        /* this will only zero remaining unread portions of the page data */
        iov_iter_zero(~0U, &iter);
        /* takes care of potential aliasing */
@@ -552,7 +552,7 @@ static ssize_t orangefs_direct_IO(struct kiocb *iocb,
                             (int)*offset);
 
                ret = wait_for_direct_io(type, inode, offset, iter,
-                               each_count, 0, NULL);
+                               each_count, 0, NULL, NULL);
                gossip_debug(GOSSIP_FILE_DEBUG,
                             "%s(%pU): return from wait_for_io:%d\n",
                             __func__,
index 3ae2f129b9c7e092ce7f7b161baa6ed5eabc09eb..572dd29fbd54333d2d012a0ba8d8298bdcecf4ab 100644 (file)
@@ -398,7 +398,7 @@ bool __is_daemon_in_service(void);
  */
 int orangefs_revalidate_mapping(struct inode *);
 ssize_t wait_for_direct_io(enum ORANGEFS_io_type, struct inode *, loff_t *,
-    struct iov_iter *, size_t, loff_t, struct orangefs_write_range *);
+    struct iov_iter *, size_t, loff_t, struct orangefs_write_range *, int *);
 ssize_t do_readv_writev(enum ORANGEFS_io_type, struct file *, loff_t *,
     struct iov_iter *);