From 84bc9c3d56225d0bdd9f4bbc76986ef4ef83e22c Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Mon, 26 Jun 2017 12:20:27 +0200 Subject: [PATCH] server: Remove no longer needed need_handle from queue_irp. Signed-off-by: Jacek Caban Signed-off-by: Alexandre Julliard --- server/device.c | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/server/device.c b/server/device.c index cf405b81cc2..fc5bcbec115 100644 --- a/server/device.c +++ b/server/device.c @@ -462,22 +462,14 @@ static void set_file_user_ptr( struct device_file *file, client_ptr_t ptr ) } /* queue an irp to the device */ -static obj_handle_t queue_irp( struct device_file *file, struct irp_call *irp, struct async *async, int need_handle ) +static int queue_irp( struct device_file *file, struct irp_call *irp, struct async *async ) { - obj_handle_t handle = 0; + if (!fd_queue_async( file->fd, async, ASYNC_TYPE_WAIT )) return 0; - if (!need_handle) handle = 1; - else if (async_is_blocking( async ) && !(handle = alloc_handle( current->process, async, SYNCHRONIZE, 0 ))) return 0; - - if (!fd_queue_async( file->fd, async, ASYNC_TYPE_WAIT )) - { - if (need_handle && handle) close_handle( current->process, handle ); - return 0; - } irp->async = (struct async *)grab_object( async ); add_irp_to_queue( file, irp, current ); set_error( STATUS_PENDING ); - return handle; + return 1; } static enum server_fd_type device_file_get_fd_type( struct fd *fd ) @@ -501,7 +493,7 @@ static int device_file_read( struct fd *fd, struct async *async, file_pos_t pos irp = create_irp( file, ¶ms, async ); if (!irp) return 0; - handle = queue_irp( file, irp, async, 0 ); + handle = queue_irp( file, irp, async ); release_object( irp ); return handle; } @@ -522,7 +514,7 @@ static int device_file_write( struct fd *fd, struct async *async, file_pos_t pos irp = create_irp( file, ¶ms, async ); if (!irp) return 0; - handle = queue_irp( file, irp, async, 0 ); + handle = queue_irp( file, irp, async ); release_object( irp ); return handle; } @@ -541,7 +533,7 @@ static int device_file_flush( struct fd *fd, struct async *async ) irp = create_irp( file, ¶ms, NULL ); if (!irp) return 0; - handle = queue_irp( file, irp, async, 0 ); + handle = queue_irp( file, irp, async ); release_object( irp ); return handle; } @@ -561,7 +553,7 @@ static int device_file_ioctl( struct fd *fd, ioctl_code_t code, struct async *as irp = create_irp( file, ¶ms, async ); if (!irp) return 0; - handle = queue_irp( file, irp, async, 0 ); + handle = queue_irp( file, irp, async ); release_object( irp ); return handle; }