Commit bf6bf606 authored by Al Viro's avatar Al Viro Committed by Mike Marshall

orangefs_copy_{to,from}_bufmap(): don't pass bufmap pointer

it's always __orangefs_bufmap
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
Signed-off-by: default avatarMike Marshall <hubcap@omnibond.com>
parent 9f5e2f7f
...@@ -21,8 +21,7 @@ ...@@ -21,8 +21,7 @@
* can futher be kernel-space or user-space addresses. * can futher be kernel-space or user-space addresses.
* or it can pointers to struct page's * or it can pointers to struct page's
*/ */
static int precopy_buffers(struct orangefs_bufmap *bufmap, static int precopy_buffers(int buffer_index,
int buffer_index,
struct iov_iter *iter, struct iov_iter *iter,
size_t total_size) size_t total_size)
{ {
...@@ -34,8 +33,7 @@ static int precopy_buffers(struct orangefs_bufmap *bufmap, ...@@ -34,8 +33,7 @@ static int precopy_buffers(struct orangefs_bufmap *bufmap,
if (total_size) { if (total_size) {
ret = orangefs_bufmap_copy_from_iovec(bufmap, ret = orangefs_bufmap_copy_from_iovec(iter,
iter,
buffer_index, buffer_index,
total_size); total_size);
if (ret < 0) if (ret < 0)
...@@ -58,8 +56,7 @@ static int precopy_buffers(struct orangefs_bufmap *bufmap, ...@@ -58,8 +56,7 @@ static int precopy_buffers(struct orangefs_bufmap *bufmap,
* can futher be kernel-space or user-space addresses. * can futher be kernel-space or user-space addresses.
* or it can pointers to struct page's * or it can pointers to struct page's
*/ */
static int postcopy_buffers(struct orangefs_bufmap *bufmap, static int postcopy_buffers(int buffer_index,
int buffer_index,
struct iov_iter *iter, struct iov_iter *iter,
size_t total_size) size_t total_size)
{ {
...@@ -70,8 +67,7 @@ static int postcopy_buffers(struct orangefs_bufmap *bufmap, ...@@ -70,8 +67,7 @@ static int postcopy_buffers(struct orangefs_bufmap *bufmap,
* struct page pointers. * struct page pointers.
*/ */
if (total_size) { if (total_size) {
ret = orangefs_bufmap_copy_to_iovec(bufmap, ret = orangefs_bufmap_copy_to_iovec(iter,
iter,
buffer_index, buffer_index,
total_size); total_size);
if (ret < 0) if (ret < 0)
...@@ -138,8 +134,7 @@ static ssize_t wait_for_direct_io(enum ORANGEFS_io_type type, struct inode *inod ...@@ -138,8 +134,7 @@ static ssize_t wait_for_direct_io(enum ORANGEFS_io_type type, struct inode *inod
* precopy_buffers only pertains to writes. * precopy_buffers only pertains to writes.
*/ */
if (type == ORANGEFS_IO_WRITE) { if (type == ORANGEFS_IO_WRITE) {
ret = precopy_buffers(bufmap, ret = precopy_buffers(buffer_index,
buffer_index,
iter, iter,
total_size); total_size);
if (ret < 0) if (ret < 0)
...@@ -242,8 +237,7 @@ static ssize_t wait_for_direct_io(enum ORANGEFS_io_type type, struct inode *inod ...@@ -242,8 +237,7 @@ static ssize_t wait_for_direct_io(enum ORANGEFS_io_type type, struct inode *inod
* postcopy_buffers only pertains to reads. * postcopy_buffers only pertains to reads.
*/ */
if (type == ORANGEFS_IO_READ) { if (type == ORANGEFS_IO_READ) {
ret = postcopy_buffers(bufmap, ret = postcopy_buffers(buffer_index,
buffer_index,
iter, iter,
new_op->downcall.resp.io.amt_complete); new_op->downcall.resp.io.amt_complete);
if (ret < 0) if (ret < 0)
......
...@@ -511,19 +511,18 @@ void orangefs_readdir_index_put(int buffer_index) ...@@ -511,19 +511,18 @@ void orangefs_readdir_index_put(int buffer_index)
* we've been handed an iovec, we need to copy it to * we've been handed an iovec, we need to copy it to
* the shared memory descriptor at "buffer_index". * the shared memory descriptor at "buffer_index".
*/ */
int orangefs_bufmap_copy_from_iovec(struct orangefs_bufmap *bufmap, int orangefs_bufmap_copy_from_iovec(struct iov_iter *iter,
struct iov_iter *iter,
int buffer_index, int buffer_index,
size_t size) size_t size)
{ {
struct orangefs_bufmap_desc *to = &bufmap->desc_array[buffer_index]; struct orangefs_bufmap_desc *to;
int i; int i;
gossip_debug(GOSSIP_BUFMAP_DEBUG, gossip_debug(GOSSIP_BUFMAP_DEBUG,
"%s: buffer_index:%d: size:%zu:\n", "%s: buffer_index:%d: size:%zu:\n",
__func__, buffer_index, size); __func__, buffer_index, size);
to = &__orangefs_bufmap->desc_array[buffer_index];
for (i = 0; size; i++) { for (i = 0; size; i++) {
struct page *page = to->page_array[i]; struct page *page = to->page_array[i];
size_t n = size; size_t n = size;
...@@ -542,14 +541,14 @@ int orangefs_bufmap_copy_from_iovec(struct orangefs_bufmap *bufmap, ...@@ -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 * we've been handed an iovec, we need to fill it from
* the shared memory descriptor at "buffer_index". * the shared memory descriptor at "buffer_index".
*/ */
int orangefs_bufmap_copy_to_iovec(struct orangefs_bufmap *bufmap, int orangefs_bufmap_copy_to_iovec(struct iov_iter *iter,
struct iov_iter *iter,
int buffer_index, int buffer_index,
size_t size) size_t size)
{ {
struct orangefs_bufmap_desc *from = &bufmap->desc_array[buffer_index]; struct orangefs_bufmap_desc *from;
int i; int i;
from = &__orangefs_bufmap->desc_array[buffer_index];
gossip_debug(GOSSIP_BUFMAP_DEBUG, gossip_debug(GOSSIP_BUFMAP_DEBUG,
"%s: buffer_index:%d: size:%zu:\n", "%s: buffer_index:%d: size:%zu:\n",
__func__, buffer_index, size); __func__, buffer_index, size);
......
...@@ -27,13 +27,11 @@ int orangefs_readdir_index_get(struct orangefs_bufmap **mapp, int *buffer_index) ...@@ -27,13 +27,11 @@ int orangefs_readdir_index_get(struct orangefs_bufmap **mapp, int *buffer_index)
void orangefs_readdir_index_put(int buffer_index); void orangefs_readdir_index_put(int buffer_index);
int orangefs_bufmap_copy_from_iovec(struct orangefs_bufmap *bufmap, int orangefs_bufmap_copy_from_iovec(struct iov_iter *iter,
struct iov_iter *iter,
int buffer_index, int buffer_index,
size_t size); size_t size);
int orangefs_bufmap_copy_to_iovec(struct orangefs_bufmap *bufmap, int orangefs_bufmap_copy_to_iovec(struct iov_iter *iter,
struct iov_iter *iter,
int buffer_index, int buffer_index,
size_t size); size_t size);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment