diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2016-02-13 21:04:51 -0500 |
---|---|---|
committer | Mike Marshall <hubcap@omnibond.com> | 2016-02-19 13:45:54 -0500 |
commit | 82d37f19ff885ece97b8a072182e39c9dc4ead7d (patch) | |
tree | 3fd02055b7c7e55765b3315320d419041f825504 /fs/orangefs | |
parent | ea2c9c9f6574e835cbc903c94b82b5a34a334866 (diff) |
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>
Diffstat (limited to 'fs/orangefs')
-rw-r--r-- | fs/orangefs/dir.c | 15 | ||||
-rw-r--r-- | fs/orangefs/orangefs-bufmap.c | 2 | ||||
-rw-r--r-- | fs/orangefs/orangefs-bufmap.h | 2 |
3 files changed, 9 insertions, 10 deletions
diff --git a/fs/orangefs/dir.c b/fs/orangefs/dir.c index 6f5836d6a7a3..c9b8d0ced833 100644 --- a/fs/orangefs/dir.c +++ b/fs/orangefs/dir.c | |||
@@ -170,8 +170,7 @@ static long readdir_handle_ctor(struct readdir_handle_s *rhandle, void *buf, | |||
170 | return ret; | 170 | return ret; |
171 | } | 171 | } |
172 | 172 | ||
173 | static void readdir_handle_dtor(struct orangefs_bufmap *bufmap, | 173 | static void readdir_handle_dtor(struct readdir_handle_s *rhandle) |
174 | struct readdir_handle_s *rhandle) | ||
175 | { | 174 | { |
176 | if (rhandle == NULL) | 175 | if (rhandle == NULL) |
177 | return; | 176 | return; |
@@ -181,7 +180,7 @@ static void readdir_handle_dtor(struct orangefs_bufmap *bufmap, | |||
181 | rhandle->readdir_response.dirent_array = NULL; | 180 | rhandle->readdir_response.dirent_array = NULL; |
182 | 181 | ||
183 | if (rhandle->buffer_index >= 0) { | 182 | if (rhandle->buffer_index >= 0) { |
184 | orangefs_readdir_index_put(bufmap, rhandle->buffer_index); | 183 | orangefs_readdir_index_put(rhandle->buffer_index); |
185 | rhandle->buffer_index = -1; | 184 | rhandle->buffer_index = -1; |
186 | } | 185 | } |
187 | if (rhandle->dents_buf) { | 186 | if (rhandle->dents_buf) { |
@@ -284,14 +283,14 @@ get_new_buffer_index: | |||
284 | gossip_debug(GOSSIP_DIR_DEBUG, | 283 | gossip_debug(GOSSIP_DIR_DEBUG, |
285 | "%s: Getting new buffer_index for retry of readdir..\n", | 284 | "%s: Getting new buffer_index for retry of readdir..\n", |
286 | __func__); | 285 | __func__); |
287 | orangefs_readdir_index_put(bufmap, buffer_index); | 286 | orangefs_readdir_index_put(buffer_index); |
288 | goto get_new_buffer_index; | 287 | goto get_new_buffer_index; |
289 | } | 288 | } |
290 | 289 | ||
291 | if (ret == -EIO && op_state_purged(new_op)) { | 290 | if (ret == -EIO && op_state_purged(new_op)) { |
292 | gossip_err("%s: Client is down. Aborting readdir call.\n", | 291 | gossip_err("%s: Client is down. Aborting readdir call.\n", |
293 | __func__); | 292 | __func__); |
294 | orangefs_readdir_index_put(bufmap, buffer_index); | 293 | orangefs_readdir_index_put(buffer_index); |
295 | goto out_free_op; | 294 | goto out_free_op; |
296 | } | 295 | } |
297 | 296 | ||
@@ -299,7 +298,7 @@ get_new_buffer_index: | |||
299 | gossip_debug(GOSSIP_DIR_DEBUG, | 298 | gossip_debug(GOSSIP_DIR_DEBUG, |
300 | "Readdir request failed. Status:%d\n", | 299 | "Readdir request failed. Status:%d\n", |
301 | new_op->downcall.status); | 300 | new_op->downcall.status); |
302 | orangefs_readdir_index_put(bufmap, buffer_index); | 301 | orangefs_readdir_index_put(buffer_index); |
303 | if (ret >= 0) | 302 | if (ret >= 0) |
304 | ret = new_op->downcall.status; | 303 | ret = new_op->downcall.status; |
305 | goto out_free_op; | 304 | goto out_free_op; |
@@ -314,7 +313,7 @@ get_new_buffer_index: | |||
314 | gossip_err("orangefs_readdir: Could not decode trailer buffer into a readdir response %d\n", | 313 | gossip_err("orangefs_readdir: Could not decode trailer buffer into a readdir response %d\n", |
315 | ret); | 314 | ret); |
316 | ret = bytes_decoded; | 315 | ret = bytes_decoded; |
317 | orangefs_readdir_index_put(bufmap, buffer_index); | 316 | orangefs_readdir_index_put(buffer_index); |
318 | goto out_free_op; | 317 | goto out_free_op; |
319 | } | 318 | } |
320 | 319 | ||
@@ -410,7 +409,7 @@ get_new_buffer_index: | |||
410 | } | 409 | } |
411 | 410 | ||
412 | out_destroy_handle: | 411 | out_destroy_handle: |
413 | readdir_handle_dtor(bufmap, &rhandle); | 412 | readdir_handle_dtor(&rhandle); |
414 | out_free_op: | 413 | out_free_op: |
415 | op_release(new_op); | 414 | op_release(new_op); |
416 | gossip_debug(GOSSIP_DIR_DEBUG, "orangefs_readdir returning %d\n", ret); | 415 | gossip_debug(GOSSIP_DIR_DEBUG, "orangefs_readdir returning %d\n", ret); |
diff --git a/fs/orangefs/orangefs-bufmap.c b/fs/orangefs/orangefs-bufmap.c index 96faf4ee6529..44d437dbfce0 100644 --- a/fs/orangefs/orangefs-bufmap.c +++ b/fs/orangefs/orangefs-bufmap.c | |||
@@ -502,7 +502,7 @@ int orangefs_readdir_index_get(struct orangefs_bufmap **mapp, int *buffer_index) | |||
502 | return ret; | 502 | return ret; |
503 | } | 503 | } |
504 | 504 | ||
505 | void orangefs_readdir_index_put(struct orangefs_bufmap *bufmap, int buffer_index) | 505 | void orangefs_readdir_index_put(int buffer_index) |
506 | { | 506 | { |
507 | put(&readdir_map, buffer_index); | 507 | put(&readdir_map, buffer_index); |
508 | } | 508 | } |
diff --git a/fs/orangefs/orangefs-bufmap.h b/fs/orangefs/orangefs-bufmap.h index f0684f0085d1..0be62be373f7 100644 --- a/fs/orangefs/orangefs-bufmap.h +++ b/fs/orangefs/orangefs-bufmap.h | |||
@@ -25,7 +25,7 @@ void orangefs_bufmap_put(int buffer_index); | |||
25 | 25 | ||
26 | int orangefs_readdir_index_get(struct orangefs_bufmap **mapp, int *buffer_index); | 26 | int orangefs_readdir_index_get(struct orangefs_bufmap **mapp, int *buffer_index); |
27 | 27 | ||
28 | void orangefs_readdir_index_put(struct orangefs_bufmap *bufmap, int buffer_index); | 28 | void orangefs_readdir_index_put(int buffer_index); |
29 | 29 | ||
30 | int orangefs_bufmap_copy_from_iovec(struct orangefs_bufmap *bufmap, | 30 | int orangefs_bufmap_copy_from_iovec(struct orangefs_bufmap *bufmap, |
31 | struct iov_iter *iter, | 31 | struct iov_iter *iter, |