Skip to content

Commit

Permalink
orangefs: bufmap rewrite
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Mike Marshall <[email protected]>
  • Loading branch information
Al Viro authored and hubcapsc committed Feb 19, 2016
1 parent 1780418 commit ea2c9c9
Show file tree
Hide file tree
Showing 4 changed files with 174 additions and 247 deletions.
15 changes: 6 additions & 9 deletions fs/orangefs/devorangefs-req.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;
Expand Down Expand Up @@ -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",
Expand Down
Loading

0 comments on commit ea2c9c9

Please sign in to comment.