]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
orangefs_copy_{to,from}_bufmap(): don't pass bufmap pointer
authorAl Viro <viro@zeniv.linux.org.uk>
Wed, 17 Feb 2016 01:06:19 +0000 (20:06 -0500)
committerMike Marshall <hubcap@omnibond.com>
Sat, 26 Mar 2016 02:30:54 +0000 (22:30 -0400)
it's always __orangefs_bufmap

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
fs/orangefs/file.c
fs/orangefs/orangefs-bufmap.c
fs/orangefs/orangefs-bufmap.h

index d4a00ad26f6e3526c3ddfb358083b1822bde19ba..db9dd6ebcc3f5b38d19a7e9e13a31d64df83618d 100644 (file)
@@ -21,8 +21,7 @@
  *       can futher be kernel-space or user-space addresses.
  *       or it can pointers to struct page's
  */
-static int precopy_buffers(struct orangefs_bufmap *bufmap,
-                          int buffer_index,
+static int precopy_buffers(int buffer_index,
                           struct iov_iter *iter,
                           size_t total_size)
 {
@@ -34,8 +33,7 @@ static int precopy_buffers(struct orangefs_bufmap *bufmap,
 
 
        if (total_size) {
-               ret = orangefs_bufmap_copy_from_iovec(bufmap,
-                                                     iter,
+               ret = orangefs_bufmap_copy_from_iovec(iter,
                                                      buffer_index,
                                                      total_size);
                if (ret < 0)
@@ -58,8 +56,7 @@ static int precopy_buffers(struct orangefs_bufmap *bufmap,
  *       can futher be kernel-space or user-space addresses.
  *       or it can pointers to struct page's
  */
-static int postcopy_buffers(struct orangefs_bufmap *bufmap,
-                           int buffer_index,
+static int postcopy_buffers(int buffer_index,
                            struct iov_iter *iter,
                            size_t total_size)
 {
@@ -70,8 +67,7 @@ static int postcopy_buffers(struct orangefs_bufmap *bufmap,
         * struct page pointers.
         */
        if (total_size) {
-               ret = orangefs_bufmap_copy_to_iovec(bufmap,
-                                                   iter,
+               ret = orangefs_bufmap_copy_to_iovec(iter,
                                                    buffer_index,
                                                    total_size);
                if (ret < 0)
@@ -138,8 +134,7 @@ populate_shared_memory:
         * precopy_buffers only pertains to writes.
         */
        if (type == ORANGEFS_IO_WRITE) {
-               ret = precopy_buffers(bufmap,
-                                     buffer_index,
+               ret = precopy_buffers(buffer_index,
                                      iter,
                                      total_size);
                if (ret < 0)
@@ -242,8 +237,7 @@ populate_shared_memory:
         * postcopy_buffers only pertains to reads.
         */
        if (type == ORANGEFS_IO_READ) {
-               ret = postcopy_buffers(bufmap,
-                                      buffer_index,
+               ret = postcopy_buffers(buffer_index,
                                       iter,
                                       new_op->downcall.resp.io.amt_complete);
                if (ret < 0)
index 44d437dbfce0b567e54b71c8c8b13febc40173d1..97689c6cab17701ee65e4380ef7382529a3cfdf0 100644 (file)
@@ -511,19 +511,18 @@ void orangefs_readdir_index_put(int buffer_index)
  * we've been handed an iovec, we need to copy it to 
  * the shared memory descriptor at "buffer_index".
  */
-int orangefs_bufmap_copy_from_iovec(struct orangefs_bufmap *bufmap,
-                               struct iov_iter *iter,
+int orangefs_bufmap_copy_from_iovec(struct iov_iter *iter,
                                int buffer_index,
                                size_t size)
 {
-       struct orangefs_bufmap_desc *to = &bufmap->desc_array[buffer_index];
+       struct orangefs_bufmap_desc *to;
        int i;
 
        gossip_debug(GOSSIP_BUFMAP_DEBUG,
                     "%s: buffer_index:%d: size:%zu:\n",
                     __func__, buffer_index, size);
 
-
+       to = &__orangefs_bufmap->desc_array[buffer_index];
        for (i = 0; size; i++) {
                struct page *page = to->page_array[i];
                size_t n = size;
@@ -542,14 +541,14 @@ int orangefs_bufmap_copy_from_iovec(struct orangefs_bufmap *bufmap,
  * we've been handed an iovec, we need to fill it from
  * the shared memory descriptor at "buffer_index".
  */
-int orangefs_bufmap_copy_to_iovec(struct orangefs_bufmap *bufmap,
-                                   struct iov_iter *iter,
+int orangefs_bufmap_copy_to_iovec(struct iov_iter *iter,
                                    int buffer_index,
                                    size_t size)
 {
-       struct orangefs_bufmap_desc *from = &bufmap->desc_array[buffer_index];
+       struct orangefs_bufmap_desc *from;
        int i;
 
+       from = &__orangefs_bufmap->desc_array[buffer_index];
        gossip_debug(GOSSIP_BUFMAP_DEBUG,
                     "%s: buffer_index:%d: size:%zu:\n",
                     __func__, buffer_index, size);
index 0be62be373f70da096fd47da002ed6475a23d550..babdc713c5e07e072711b1b5397ba3ce17c89338 100644 (file)
@@ -27,13 +27,11 @@ int orangefs_readdir_index_get(struct orangefs_bufmap **mapp, int *buffer_index)
 
 void orangefs_readdir_index_put(int buffer_index);
 
-int orangefs_bufmap_copy_from_iovec(struct orangefs_bufmap *bufmap,
-                               struct iov_iter *iter,
+int orangefs_bufmap_copy_from_iovec(struct iov_iter *iter,
                                int buffer_index,
                                size_t size);
 
-int orangefs_bufmap_copy_to_iovec(struct orangefs_bufmap *bufmap,
-                             struct iov_iter *iter,
+int orangefs_bufmap_copy_to_iovec(struct iov_iter *iter,
                              int buffer_index,
                              size_t size);