orangefs_readdir_index_put(): get rid of bufmap argument

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
This commit is contained in:
Al Viro 2016-02-13 21:04:51 -05:00 committed by Mike Marshall
parent ea2c9c9f65
commit 82d37f19ff
3 changed files with 9 additions and 10 deletions

View file

@ -170,8 +170,7 @@ static long readdir_handle_ctor(struct readdir_handle_s *rhandle, void *buf,
return ret; return ret;
} }
static void readdir_handle_dtor(struct orangefs_bufmap *bufmap, static void readdir_handle_dtor(struct readdir_handle_s *rhandle)
struct readdir_handle_s *rhandle)
{ {
if (rhandle == NULL) if (rhandle == NULL)
return; return;
@ -181,7 +180,7 @@ static void readdir_handle_dtor(struct orangefs_bufmap *bufmap,
rhandle->readdir_response.dirent_array = NULL; rhandle->readdir_response.dirent_array = NULL;
if (rhandle->buffer_index >= 0) { if (rhandle->buffer_index >= 0) {
orangefs_readdir_index_put(bufmap, rhandle->buffer_index); orangefs_readdir_index_put(rhandle->buffer_index);
rhandle->buffer_index = -1; rhandle->buffer_index = -1;
} }
if (rhandle->dents_buf) { if (rhandle->dents_buf) {
@ -284,14 +283,14 @@ static int orangefs_readdir(struct file *file, struct dir_context *ctx)
gossip_debug(GOSSIP_DIR_DEBUG, gossip_debug(GOSSIP_DIR_DEBUG,
"%s: Getting new buffer_index for retry of readdir..\n", "%s: Getting new buffer_index for retry of readdir..\n",
__func__); __func__);
orangefs_readdir_index_put(bufmap, buffer_index); orangefs_readdir_index_put(buffer_index);
goto get_new_buffer_index; goto get_new_buffer_index;
} }
if (ret == -EIO && op_state_purged(new_op)) { if (ret == -EIO && op_state_purged(new_op)) {
gossip_err("%s: Client is down. Aborting readdir call.\n", gossip_err("%s: Client is down. Aborting readdir call.\n",
__func__); __func__);
orangefs_readdir_index_put(bufmap, buffer_index); orangefs_readdir_index_put(buffer_index);
goto out_free_op; goto out_free_op;
} }
@ -299,7 +298,7 @@ static int orangefs_readdir(struct file *file, struct dir_context *ctx)
gossip_debug(GOSSIP_DIR_DEBUG, gossip_debug(GOSSIP_DIR_DEBUG,
"Readdir request failed. Status:%d\n", "Readdir request failed. Status:%d\n",
new_op->downcall.status); new_op->downcall.status);
orangefs_readdir_index_put(bufmap, buffer_index); orangefs_readdir_index_put(buffer_index);
if (ret >= 0) if (ret >= 0)
ret = new_op->downcall.status; ret = new_op->downcall.status;
goto out_free_op; goto out_free_op;
@ -314,7 +313,7 @@ static int orangefs_readdir(struct file *file, struct dir_context *ctx)
gossip_err("orangefs_readdir: Could not decode trailer buffer into a readdir response %d\n", gossip_err("orangefs_readdir: Could not decode trailer buffer into a readdir response %d\n",
ret); ret);
ret = bytes_decoded; ret = bytes_decoded;
orangefs_readdir_index_put(bufmap, buffer_index); orangefs_readdir_index_put(buffer_index);
goto out_free_op; goto out_free_op;
} }
@ -410,7 +409,7 @@ static int orangefs_readdir(struct file *file, struct dir_context *ctx)
} }
out_destroy_handle: out_destroy_handle:
readdir_handle_dtor(bufmap, &rhandle); readdir_handle_dtor(&rhandle);
out_free_op: out_free_op:
op_release(new_op); op_release(new_op);
gossip_debug(GOSSIP_DIR_DEBUG, "orangefs_readdir returning %d\n", ret); gossip_debug(GOSSIP_DIR_DEBUG, "orangefs_readdir returning %d\n", ret);

View file

@ -502,7 +502,7 @@ int orangefs_readdir_index_get(struct orangefs_bufmap **mapp, int *buffer_index)
return ret; return ret;
} }
void orangefs_readdir_index_put(struct orangefs_bufmap *bufmap, int buffer_index) void orangefs_readdir_index_put(int buffer_index)
{ {
put(&readdir_map, buffer_index); put(&readdir_map, buffer_index);
} }

View file

@ -25,7 +25,7 @@ void orangefs_bufmap_put(int buffer_index);
int orangefs_readdir_index_get(struct orangefs_bufmap **mapp, int *buffer_index); int orangefs_readdir_index_get(struct orangefs_bufmap **mapp, int *buffer_index);
void orangefs_readdir_index_put(struct orangefs_bufmap *bufmap, 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 orangefs_bufmap *bufmap,
struct iov_iter *iter, struct iov_iter *iter,