From 1357d06d49d1f87af48ab768d34af55bff18b0c3 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Thu, 11 Feb 2016 21:34:52 -0500 Subject: [PATCH] get rid of bufmap argument of orangefs_bufmap_put() it's always equal to __orangefs_bufmap and the latter can't change until we are done Signed-off-by: Al Viro Signed-off-by: Mike Marshall --- fs/orangefs/file.c | 6 +++--- fs/orangefs/orangefs-bufmap.c | 3 ++- fs/orangefs/orangefs-bufmap.h | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/fs/orangefs/file.c b/fs/orangefs/file.c index dafa03ef0107..193671c137c3 100644 --- a/fs/orangefs/file.c +++ b/fs/orangefs/file.c @@ -170,7 +170,7 @@ populate_shared_memory: * 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; @@ -190,7 +190,7 @@ populate_shared_memory: } 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 @@ -239,7 +239,7 @@ done_copying: 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); diff --git a/fs/orangefs/orangefs-bufmap.c b/fs/orangefs/orangefs-bufmap.c index c60019de1fd8..1819dee58433 100644 --- a/fs/orangefs/orangefs-bufmap.c +++ b/fs/orangefs/orangefs-bufmap.c @@ -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; diff --git a/fs/orangefs/orangefs-bufmap.h b/fs/orangefs/orangefs-bufmap.h index dff55e2857c5..2a2d4269d03e 100644 --- a/fs/orangefs/orangefs-bufmap.h +++ b/fs/orangefs/orangefs-bufmap.h @@ -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); -- 2.20.1