summaryrefslogtreecommitdiff
path: root/fs/orangefs/orangefs-bufmap.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2016-02-17 04:10:26 +0300
committerMike Marshall <hubcap@omnibond.com>2016-03-26 05:30:54 +0300
commitb8a99a8f9f0aebf2a75bb0d9280bff7e7ac9b57e (patch)
treed987f21f5f1c7ea83b62fcf7d0bda6f10971d285 /fs/orangefs/orangefs-bufmap.c
parentbf6bf606e545cb31c29499b354c13b2621acd649 (diff)
downloadlinux-b8a99a8f9f0aebf2a75bb0d9280bff7e7ac9b57e.tar.xz
orangefs: saner calling conventions for getting a slot
just have it return the slot number or -E... - the caller checks the sign anyway Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
Diffstat (limited to 'fs/orangefs/orangefs-bufmap.c')
-rw-r--r--fs/orangefs/orangefs-bufmap.c24
1 files changed, 6 insertions, 18 deletions
diff --git a/fs/orangefs/orangefs-bufmap.c b/fs/orangefs/orangefs-bufmap.c
index 97689c6cab17..1f8acc9f9a88 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)