summaryrefslogtreecommitdiffstats
path: root/cpukit/libcsupport/src/sup_fs_deviceio.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2012-05-14 15:21:30 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2012-05-15 10:01:42 +0200
commit53da07e436df21f078de665d90442ee5c7166ab7 (patch)
tree0249d3ca4e181c677f243907a754dd1e8518bb36 /cpukit/libcsupport/src/sup_fs_deviceio.c
parentFilesystem: Add shared device IO support (diff)
downloadrtems-53da07e436df21f078de665d90442ee5c7166ab7.tar.bz2
Filesystem: PR1255: Move offset update to handlers
It is now the responsibility of the read() and write() handler to update the offset field of the IO descriptor (rtems_libio_t). This change makes it possible to protect the IO descriptor from concurrent access by per file locks.
Diffstat (limited to 'cpukit/libcsupport/src/sup_fs_deviceio.c')
-rw-r--r--cpukit/libcsupport/src/sup_fs_deviceio.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/cpukit/libcsupport/src/sup_fs_deviceio.c b/cpukit/libcsupport/src/sup_fs_deviceio.c
index aeff60ea83..74f92cb44c 100644
--- a/cpukit/libcsupport/src/sup_fs_deviceio.c
+++ b/cpukit/libcsupport/src/sup_fs_deviceio.c
@@ -72,6 +72,8 @@ ssize_t rtems_deviceio_read(
status = rtems_io_read( major, minor, &args );
if ( status == RTEMS_SUCCESSFUL ) {
+ iop->offset += args.bytes_moved;
+
return (ssize_t) args.bytes_moved;
} else {
return rtems_deviceio_errno( status );
@@ -98,6 +100,8 @@ ssize_t rtems_deviceio_write(
status = rtems_io_write( major, minor, &args );
if ( status == RTEMS_SUCCESSFUL ) {
+ iop->offset += args.bytes_moved;
+
return (ssize_t) args.bytes_moved;
} else {
return rtems_deviceio_errno( status );