From 53da07e436df21f078de665d90442ee5c7166ab7 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Mon, 14 May 2012 15:21:30 +0200 Subject: 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. --- cpukit/libblock/src/blkdev-imfs.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'cpukit/libblock') diff --git a/cpukit/libblock/src/blkdev-imfs.c b/cpukit/libblock/src/blkdev-imfs.c index 86455930f6..c69542d531 100644 --- a/cpukit/libblock/src/blkdev-imfs.c +++ b/cpukit/libblock/src/blkdev-imfs.c @@ -75,6 +75,7 @@ static ssize_t rtems_blkdev_imfs_read( } if (remaining >= 0) { + iop->offset += count; rv = (ssize_t) count; } else { errno = EIO; @@ -134,6 +135,7 @@ static ssize_t rtems_blkdev_imfs_write( } if (remaining >= 0) { + iop->offset += count; rv = (ssize_t) count; } else { errno = EIO; -- cgit v1.2.3