Commit 6073e75a authored by Alexandre Julliard's avatar Alexandre Julliard

server: Implement flush requests for device files.

parent 48151717
...@@ -131,6 +131,7 @@ static obj_handle_t device_read( struct fd *fd, const async_data_t *async_data, ...@@ -131,6 +131,7 @@ static obj_handle_t device_read( struct fd *fd, const async_data_t *async_data,
file_pos_t pos ); file_pos_t pos );
static obj_handle_t device_write( struct fd *fd, const async_data_t *async_data, int blocking, static obj_handle_t device_write( struct fd *fd, const async_data_t *async_data, int blocking,
file_pos_t pos, data_size_t *written ); file_pos_t pos, data_size_t *written );
static obj_handle_t device_flush( struct fd *fd, const async_data_t *async_data, int blocking );
static obj_handle_t device_ioctl( struct fd *fd, ioctl_code_t code, const async_data_t *async_data, static obj_handle_t device_ioctl( struct fd *fd, ioctl_code_t code, const async_data_t *async_data,
int blocking ); int blocking );
...@@ -161,7 +162,7 @@ static const struct fd_ops device_fd_ops = ...@@ -161,7 +162,7 @@ static const struct fd_ops device_fd_ops =
device_get_fd_type, /* get_fd_type */ device_get_fd_type, /* get_fd_type */
device_read, /* read */ device_read, /* read */
device_write, /* write */ device_write, /* write */
no_fd_flush, /* flush */ device_flush, /* flush */
device_ioctl, /* ioctl */ device_ioctl, /* ioctl */
default_fd_queue_async, /* queue_async */ default_fd_queue_async, /* queue_async */
default_fd_reselect_async, /* reselect_async */ default_fd_reselect_async, /* reselect_async */
...@@ -388,6 +389,23 @@ static obj_handle_t device_write( struct fd *fd, const async_data_t *async_data, ...@@ -388,6 +389,23 @@ static obj_handle_t device_write( struct fd *fd, const async_data_t *async_data,
return handle; return handle;
} }
static obj_handle_t device_flush( struct fd *fd, const async_data_t *async_data, int blocking )
{
struct device *device = get_fd_user( fd );
struct irp_call *irp;
obj_handle_t handle;
irp_params_t params;
params.major = IRP_MJ_FLUSH_BUFFERS;
irp = create_irp( device, &params, NULL, 0, 0 );
if (!irp) return 0;
handle = queue_irp( device, irp, async_data, blocking );
release_object( irp );
return handle;
}
static obj_handle_t device_ioctl( struct fd *fd, ioctl_code_t code, const async_data_t *async_data, static obj_handle_t device_ioctl( struct fd *fd, ioctl_code_t code, const async_data_t *async_data,
int blocking ) int blocking )
{ {
......
...@@ -326,6 +326,9 @@ static void dump_irp_params( const char *prefix, const irp_params_t *data ) ...@@ -326,6 +326,9 @@ static void dump_irp_params( const char *prefix, const irp_params_t *data )
dump_uint64( ",pos=", &data->write.pos ); dump_uint64( ",pos=", &data->write.pos );
fputc( '}', stderr ); fputc( '}', stderr );
break; break;
case IRP_MJ_FLUSH_BUFFERS:
fprintf( stderr, "%s{major=FLUSH_BUFFERS}", prefix );
break;
case IRP_MJ_DEVICE_CONTROL: case IRP_MJ_DEVICE_CONTROL:
fprintf( stderr, "%s{major=DEVICE_CONTROL", prefix ); fprintf( stderr, "%s{major=DEVICE_CONTROL", prefix );
dump_ioctl_code( ",code=", &data->ioctl.code ); dump_ioctl_code( ",code=", &data->ioctl.code );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment