aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2016-02-16 20:06:19 -0500
committerMike Marshall <hubcap@omnibond.com>2016-03-25 22:30:54 -0400
commitbf6bf606e545cb31c29499b354c13b2621acd649 (patch)
tree237329d42ac5e126d273a31606f9258b04155348 /fs
parent9f5e2f7f1b4bf7d0b19d88edd9425510fadbb9e4 (diff)
orangefs_copy_{to,from}_bufmap(): don't pass bufmap pointer
it's always __orangefs_bufmap Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/orangefs/file.c18
-rw-r--r--fs/orangefs/orangefs-bufmap.c13
-rw-r--r--fs/orangefs/orangefs-bufmap.h6
3 files changed, 14 insertions, 23 deletions
diff --git a/fs/orangefs/file.c b/fs/orangefs/file.c
index d4a00ad26f6e..db9dd6ebcc3f 100644
--- a/fs/orangefs/file.c
+++ b/fs/orangefs/file.c
@@ -21,8 +21,7 @@
21 * can futher be kernel-space or user-space addresses. 21 * can futher be kernel-space or user-space addresses.
22 * or it can pointers to struct page's 22 * or it can pointers to struct page's
23 */ 23 */
24static int precopy_buffers(struct orangefs_bufmap *bufmap, 24static int precopy_buffers(int buffer_index,
25 int buffer_index,
26 struct iov_iter *iter, 25 struct iov_iter *iter,
27 size_t total_size) 26 size_t total_size)
28{ 27{
@@ -34,8 +33,7 @@ static int precopy_buffers(struct orangefs_bufmap *bufmap,
34 33
35 34
36 if (total_size) { 35 if (total_size) {
37 ret = orangefs_bufmap_copy_from_iovec(bufmap, 36 ret = orangefs_bufmap_copy_from_iovec(iter,
38 iter,
39 buffer_index, 37 buffer_index,
40 total_size); 38 total_size);
41 if (ret < 0) 39 if (ret < 0)
@@ -58,8 +56,7 @@ static int precopy_buffers(struct orangefs_bufmap *bufmap,
58 * can futher be kernel-space or user-space addresses. 56 * can futher be kernel-space or user-space addresses.
59 * or it can pointers to struct page's 57 * or it can pointers to struct page's
60 */ 58 */
61static int postcopy_buffers(struct orangefs_bufmap *bufmap, 59static int postcopy_buffers(int buffer_index,
62 int buffer_index,
63 struct iov_iter *iter, 60 struct iov_iter *iter,
64 size_t total_size) 61 size_t total_size)
65{ 62{
@@ -70,8 +67,7 @@ static int postcopy_buffers(struct orangefs_bufmap *bufmap,
70 * struct page pointers. 67 * struct page pointers.
71 */ 68 */
72 if (total_size) { 69 if (total_size) {
73 ret = orangefs_bufmap_copy_to_iovec(bufmap, 70 ret = orangefs_bufmap_copy_to_iovec(iter,
74 iter,
75 buffer_index, 71 buffer_index,
76 total_size); 72 total_size);
77 if (ret < 0) 73 if (ret < 0)
@@ -138,8 +134,7 @@ populate_shared_memory:
138 * precopy_buffers only pertains to writes. 134 * precopy_buffers only pertains to writes.
139 */ 135 */
140 if (type == ORANGEFS_IO_WRITE) { 136 if (type == ORANGEFS_IO_WRITE) {
141 ret = precopy_buffers(bufmap, 137 ret = precopy_buffers(buffer_index,
142 buffer_index,
143 iter, 138 iter,
144 total_size); 139 total_size);
145 if (ret < 0) 140 if (ret < 0)
@@ -242,8 +237,7 @@ populate_shared_memory:
242 * postcopy_buffers only pertains to reads. 237 * postcopy_buffers only pertains to reads.
243 */ 238 */
244 if (type == ORANGEFS_IO_READ) { 239 if (type == ORANGEFS_IO_READ) {
245 ret = postcopy_buffers(bufmap, 240 ret = postcopy_buffers(buffer_index,
246 buffer_index,
247 iter, 241 iter,
248 new_op->downcall.resp.io.amt_complete); 242 new_op->downcall.resp.io.amt_complete);
249 if (ret < 0) 243 if (ret < 0)
diff --git a/fs/orangefs/orangefs-bufmap.c b/fs/orangefs/orangefs-bufmap.c
index 44d437dbfce0..97689c6cab17 100644
--- a/fs/orangefs/orangefs-bufmap.c
+++ b/fs/orangefs/orangefs-bufmap.c
@@ -511,19 +511,18 @@ void orangefs_readdir_index_put(int buffer_index)
511 * we've been handed an iovec, we need to copy it to 511 * we've been handed an iovec, we need to copy it to
512 * the shared memory descriptor at "buffer_index". 512 * the shared memory descriptor at "buffer_index".
513 */ 513 */
514int orangefs_bufmap_copy_from_iovec(struct orangefs_bufmap *bufmap, 514int orangefs_bufmap_copy_from_iovec(struct iov_iter *iter,
515 struct iov_iter *iter,
516 int buffer_index, 515 int buffer_index,
517 size_t size) 516 size_t size)
518{ 517{
519 struct orangefs_bufmap_desc *to = &bufmap->desc_array[buffer_index]; 518 struct orangefs_bufmap_desc *to;
520 int i; 519 int i;
521 520
522 gossip_debug(GOSSIP_BUFMAP_DEBUG, 521 gossip_debug(GOSSIP_BUFMAP_DEBUG,
523 "%s: buffer_index:%d: size:%zu:\n", 522 "%s: buffer_index:%d: size:%zu:\n",
524 __func__, buffer_index, size); 523 __func__, buffer_index, size);
525 524
526 525 to = &__orangefs_bufmap->desc_array[buffer_index];
527 for (i = 0; size; i++) { 526 for (i = 0; size; i++) {
528 struct page *page = to->page_array[i]; 527 struct page *page = to->page_array[i];
529 size_t n = size; 528 size_t n = size;
@@ -542,14 +541,14 @@ int orangefs_bufmap_copy_from_iovec(struct orangefs_bufmap *bufmap,
542 * we've been handed an iovec, we need to fill it from 541 * we've been handed an iovec, we need to fill it from
543 * the shared memory descriptor at "buffer_index". 542 * the shared memory descriptor at "buffer_index".
544 */ 543 */
545int orangefs_bufmap_copy_to_iovec(struct orangefs_bufmap *bufmap, 544int orangefs_bufmap_copy_to_iovec(struct iov_iter *iter,
546 struct iov_iter *iter,
547 int buffer_index, 545 int buffer_index,
548 size_t size) 546 size_t size)
549{ 547{
550 struct orangefs_bufmap_desc *from = &bufmap->desc_array[buffer_index]; 548 struct orangefs_bufmap_desc *from;
551 int i; 549 int i;
552 550
551 from = &__orangefs_bufmap->desc_array[buffer_index];
553 gossip_debug(GOSSIP_BUFMAP_DEBUG, 552 gossip_debug(GOSSIP_BUFMAP_DEBUG,
554 "%s: buffer_index:%d: size:%zu:\n", 553 "%s: buffer_index:%d: size:%zu:\n",
555 __func__, buffer_index, size); 554 __func__, buffer_index, size);
diff --git a/fs/orangefs/orangefs-bufmap.h b/fs/orangefs/orangefs-bufmap.h
index 0be62be373f7..babdc713c5e0 100644
--- a/fs/orangefs/orangefs-bufmap.h
+++ b/fs/orangefs/orangefs-bufmap.h
@@ -27,13 +27,11 @@ int orangefs_readdir_index_get(struct orangefs_bufmap **mapp, int *buffer_index)
27 27
28void orangefs_readdir_index_put(int buffer_index); 28void orangefs_readdir_index_put(int buffer_index);
29 29
30int orangefs_bufmap_copy_from_iovec(struct orangefs_bufmap *bufmap, 30int orangefs_bufmap_copy_from_iovec(struct iov_iter *iter,
31 struct iov_iter *iter,
32 int buffer_index, 31 int buffer_index,
33 size_t size); 32 size_t size);
34 33
35int orangefs_bufmap_copy_to_iovec(struct orangefs_bufmap *bufmap, 34int orangefs_bufmap_copy_to_iovec(struct iov_iter *iter,
36 struct iov_iter *iter,
37 int buffer_index, 35 int buffer_index,
38 size_t size); 36 size_t size);
39 37