Skip to content

Commit

Permalink
get rid of bufmap argument of orangefs_bufmap_put()
Browse files Browse the repository at this point in the history
it's always equal to __orangefs_bufmap and the latter can't change
until we are done

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
  • Loading branch information
Al Viro authored and hubcapsc committed Feb 12, 2016
1 parent c0eae8c commit 1357d06
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions fs/orangefs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ static ssize_t wait_for_direct_io(enum ORANGEFS_io_type type, struct inode *inod
* a new shared memory location.
*/
if (ret == -EAGAIN && op_state_purged(new_op)) {
orangefs_bufmap_put(bufmap, buffer_index);
orangefs_bufmap_put(buffer_index);
buffer_index = -1;
if (type == ORANGEFS_IO_WRITE)
*iter = saved;
Expand All @@ -190,7 +190,7 @@ static ssize_t wait_for_direct_io(enum ORANGEFS_io_type type, struct inode *inod
} else {
complete(&new_op->done);
}
orangefs_bufmap_put(bufmap, buffer_index);
orangefs_bufmap_put(buffer_index);
buffer_index = -1;
/*
* don't write an error to syslog on signaled operation
Expand Down Expand Up @@ -239,7 +239,7 @@ static ssize_t wait_for_direct_io(enum ORANGEFS_io_type type, struct inode *inod

out:
if (buffer_index >= 0) {
orangefs_bufmap_put(bufmap, buffer_index);
orangefs_bufmap_put(buffer_index);
gossip_debug(GOSSIP_FILE_DEBUG,
"%s(%pU): PUT buffer_index %d\n",
__func__, handle, buffer_index);
Expand Down
3 changes: 2 additions & 1 deletion fs/orangefs/orangefs-bufmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -458,9 +458,10 @@ int orangefs_bufmap_get(struct orangefs_bufmap **mapp, int *buffer_index)
*
* no return value
*/
void orangefs_bufmap_put(struct orangefs_bufmap *bufmap, int buffer_index)
void orangefs_bufmap_put(int buffer_index)
{
struct slot_args slargs;
struct orangefs_bufmap *bufmap = __orangefs_bufmap;

slargs.slot_count = bufmap->desc_count;
slargs.slot_array = bufmap->buffer_index_array;
Expand Down
2 changes: 1 addition & 1 deletion fs/orangefs/orangefs-bufmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ void orangefs_bufmap_finalize(void);

int orangefs_bufmap_get(struct orangefs_bufmap **mapp, int *buffer_index);

void orangefs_bufmap_put(struct orangefs_bufmap *bufmap, int buffer_index);
void orangefs_bufmap_put(int buffer_index);

int orangefs_readdir_index_get(struct orangefs_bufmap **mapp, int *buffer_index);

Expand Down

0 comments on commit 1357d06

Please sign in to comment.