Changeset 4fe94c66 in mainline for uspace/srv/vfs/vfs_file.c


Ignore:
Timestamp:
2011-01-26T00:57:06Z (13 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
12573db, bf75e3cb
Parents:
8b65e547
Message:

Now when the table of open files is shared by multiple connections of
one client task, it became necessary to maintain the vfs_file_t
references obtained from vfs_file_get() explicitly.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/vfs/vfs_file.c

    r8b65e547 r4fe94c66  
    258258        if ((fd >= 0) && (fd < MAX_OPEN_FILES)) {
    259259                vfs_file_t *file = FILES[fd];
     260                vfs_file_addref(file);
    260261                fibril_mutex_unlock(&VFS_DATA->lock);
    261262                return file;
     
    266267}
    267268
     269/** Stop using a file structure.
     270 *
     271 * @param file          VFS file structure.
     272 */
     273void vfs_file_put(vfs_file_t *file)
     274{
     275        fibril_mutex_lock(&VFS_DATA->lock);
     276        vfs_file_delref(file);
     277        fibril_mutex_unlock(&VFS_DATA->lock);
     278}
     279
    268280/**
    269281 * @}
Note: See TracChangeset for help on using the changeset viewer.