Ignore:
Timestamp:
May 14, 2012, 1:21:30 PM (7 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
7666afc
Parents:
fed66f99
git-author:
Sebastian Huber <sebastian.huber@…> (05/14/12 13:21:30)
git-committer:
Sebastian Huber <sebastian.huber@…> (05/15/12 08:01:42)
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libfs/src/dosfs/msdos_file.c

    rfed66f99 r53da07e  
    118118    ret = fat_file_read(iop->pathinfo.mt_entry, fat_fd, iop->offset, count,
    119119                        buffer);
     120    if (ret > 0)
     121        iop->offset += ret;
    120122
    121123    rtems_semaphore_release(fs_info->vol_sema);
     
    164166     * file was extended
    165167     */
    166     if (iop->offset + ret > fat_fd->fat_file_size)
    167         fat_fd->fat_file_size = iop->offset + ret;
     168    iop->offset += ret;
     169    if (iop->offset > fat_fd->fat_file_size)
     170        fat_fd->fat_file_size = iop->offset;
    168171
    169172    rtems_semaphore_release(fs_info->vol_sema);
Note: See TracChangeset for help on using the changeset viewer.