summaryrefslogtreecommitdiffstats
path: root/fs/orangefs/devorangefs-req.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2016-02-14 03:01:21 +0100
committerMike Marshall <hubcap@omnibond.com>2016-02-19 19:45:54 +0100
commitea2c9c9f6574e835cbc903c94b82b5a34a334866 (patch)
tree47637785f81f2e7edb746de19a7b1a3c6ccd9627 /fs/orangefs/devorangefs-req.c
parentorangefs_bufmap_..._query(): don't bother with refcounts (diff)
downloadlinux-ea2c9c9f6574e835cbc903c94b82b5a34a334866.tar.xz
linux-ea2c9c9f6574e835cbc903c94b82b5a34a334866.zip
orangefs: bufmap rewrite
new waiting-for-slot logics: * make request for slot wait for bufmap to be set up if it comes before it's installed *OR* while it's running down * make closing control device wait for all slots to be freed * waiting itself rewritten to (open-coded) analogues of wait_event_... primitives - we would need wait_event_locked() and, pardon an obscenely long name, wait_event_interruptible_exclusive_timeout_locked(). * we never wait for more than slot_timeout_secs in total and, if during the wait the daemon goes away, we only allow ORANGEFS_BUFMAP_WAIT_TIMEOUT_SECS for it to come back. * (cosmetical) bitmap is used instead of an array of zeroes and ones * old (and only reached if we are about to corrupt memory) waiting for daemon restart in service_operation() removed. [Martin's fixes folded] Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Mike Marshall <hubcap@omnibond.com>
Diffstat (limited to 'fs/orangefs/devorangefs-req.c')
-rw-r--r--fs/orangefs/devorangefs-req.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/fs/orangefs/devorangefs-req.c b/fs/orangefs/devorangefs-req.c
index 6a7df1204bfc..790855a72e32 100644
--- a/fs/orangefs/devorangefs-req.c
+++ b/fs/orangefs/devorangefs-req.c
@@ -508,8 +508,7 @@ static int orangefs_devreq_release(struct inode *inode, struct file *file)
__func__);
mutex_lock(&devreq_mutex);
- if (orangefs_get_bufmap_init())
- orangefs_bufmap_finalize();
+ orangefs_bufmap_finalize();
open_access_count = -1;
@@ -527,6 +526,9 @@ static int orangefs_devreq_release(struct inode *inode, struct file *file)
* them as purged and wake them up
*/
purge_inprogress_ops();
+
+ orangefs_bufmap_run_down();
+
gossip_debug(GOSSIP_DEV_DEBUG,
"pvfs2-client-core: device close complete\n");
open_access_count = 0;
@@ -607,13 +609,8 @@ static long dispatch_ioctl_command(unsigned int command, unsigned long arg)
(struct ORANGEFS_dev_map_desc __user *)
arg,
sizeof(struct ORANGEFS_dev_map_desc));
- if (orangefs_get_bufmap_init()) {
- return -EINVAL;
- } else {
- return ret ?
- -EIO :
- orangefs_bufmap_initialize(&user_desc);
- }
+ /* WTF -EIO and not -EFAULT? */
+ return ret ? -EIO : orangefs_bufmap_initialize(&user_desc);
case ORANGEFS_DEV_REMOUNT_ALL:
gossip_debug(GOSSIP_DEV_DEBUG,
"%s: got ORANGEFS_DEV_REMOUNT_ALL\n",