diff --git a/fs/orangefs/dir.c b/fs/orangefs/dir.c
index 53a411732606b7960aba82dba0bb93a0239b0958..f30b6ecacdd19595cca35f8a6711eaedc3c0ef04 100644
--- a/fs/orangefs/dir.c
+++ b/fs/orangefs/dir.c
@@ -141,7 +141,6 @@ static long decode_dirents(char *ptr, size_t size,
  */
 static int orangefs_readdir(struct file *file, struct dir_context *ctx)
 {
-	struct orangefs_bufmap *bufmap = NULL;
 	int ret = 0;
 	int buffer_index;
 	/*
@@ -205,8 +204,9 @@ static int orangefs_readdir(struct file *file, struct dir_context *ctx)
 	new_op->upcall.req.readdir.token = *ptoken;
 
 get_new_buffer_index:
-	ret = orangefs_readdir_index_get(&bufmap, &buffer_index);
-	if (ret < 0) {
+	buffer_index = orangefs_readdir_index_get();
+	if (buffer_index < 0) {
+		ret = buffer_index;
 		gossip_lerr("orangefs_readdir: orangefs_readdir_index_get() failure (%d)\n",
 			    ret);
 		goto out_free_op;
diff --git a/fs/orangefs/file.c b/fs/orangefs/file.c
index db9dd6ebcc3f5b38d19a7e9e13a31d64df83618d..63e6a10ab13d2f3adb49c44d3cd9053878ddb28b 100644
--- a/fs/orangefs/file.c
+++ b/fs/orangefs/file.c
@@ -87,7 +87,6 @@ static ssize_t wait_for_direct_io(enum ORANGEFS_io_type type, struct inode *inod
 {
 	struct orangefs_inode_s *orangefs_inode = ORANGEFS_I(inode);
 	struct orangefs_khandle *handle = &orangefs_inode->refn.khandle;
-	struct orangefs_bufmap *bufmap = NULL;
 	struct orangefs_kernel_op_s *new_op = NULL;
 	struct iov_iter saved = *iter;
 	int buffer_index = -1;
@@ -104,11 +103,12 @@ static ssize_t wait_for_direct_io(enum ORANGEFS_io_type type, struct inode *inod
 
 populate_shared_memory:
 	/* get a shared buffer index */
-	ret = orangefs_bufmap_get(&bufmap, &buffer_index);
-	if (ret < 0) {
+	buffer_index = orangefs_bufmap_get();
+	if (buffer_index < 0) {
+		ret = buffer_index;
 		gossip_debug(GOSSIP_FILE_DEBUG,
-			     "%s: orangefs_bufmap_get failure (%ld)\n",
-			     __func__, (long)ret);
+			     "%s: orangefs_bufmap_get failure (%zd)\n",
+			     __func__, ret);
 		goto out;
 	}
 	gossip_debug(GOSSIP_FILE_DEBUG,
diff --git a/fs/orangefs/orangefs-bufmap.c b/fs/orangefs/orangefs-bufmap.c
index 97689c6cab17701ee65e4380ef7382529a3cfdf0..1f8acc9f9a888c3ae3ae944e480301fd219653b2 100644
--- a/fs/orangefs/orangefs-bufmap.c
+++ b/fs/orangefs/orangefs-bufmap.c
@@ -455,17 +455,11 @@ void orangefs_bufmap_run_down(void)
  * gets a free mapped buffer descriptor, will sleep until one becomes
  * available if necessary
  *
- * returns 0 on success, -errno on failure
+ * returns slot on success, -errno on failure
  */
-int orangefs_bufmap_get(struct orangefs_bufmap **mapp, int *buffer_index)
+int orangefs_bufmap_get(void)
 {
-	int ret = get(&rw_map);
-	if (ret >= 0) {
-		*mapp = __orangefs_bufmap;
-		*buffer_index = ret;
-		ret = 0;
-	}
-	return ret;
+	return get(&rw_map);
 }
 
 /*
@@ -489,17 +483,11 @@ void orangefs_bufmap_put(int buffer_index)
  * we could do that at a later point of time. Regardless, these
  * indices are used by the client-core.
  *
- * returns 0 on success, -errno on failure
+ * returns slot on success, -errno on failure
  */
-int orangefs_readdir_index_get(struct orangefs_bufmap **mapp, int *buffer_index)
+int orangefs_readdir_index_get(void)
 {
-	int ret = get(&readdir_map);
-	if (ret >= 0) {
-		*mapp = __orangefs_bufmap;
-		*buffer_index = ret;
-		ret = 0;
-	}
-	return ret;
+	return get(&readdir_map);
 }
 
 void orangefs_readdir_index_put(int buffer_index)
diff --git a/fs/orangefs/orangefs-bufmap.h b/fs/orangefs/orangefs-bufmap.h
index babdc713c5e07e072711b1b5397ba3ce17c89338..ec2849cb52e2cbfca784a4b6f10f7b6fb72d4c56 100644
--- a/fs/orangefs/orangefs-bufmap.h
+++ b/fs/orangefs/orangefs-bufmap.h
@@ -19,11 +19,11 @@ void orangefs_bufmap_finalize(void);
 
 void orangefs_bufmap_run_down(void);
 
-int orangefs_bufmap_get(struct orangefs_bufmap **mapp, int *buffer_index);
+int orangefs_bufmap_get(void);
 
 void orangefs_bufmap_put(int buffer_index);
 
-int orangefs_readdir_index_get(struct orangefs_bufmap **mapp, int *buffer_index);
+int orangefs_readdir_index_get(void);
 
 void orangefs_readdir_index_put(int buffer_index);