Changeset f7017572 in mainline for uspace/srv


Ignore:
Timestamp:
2008-01-27T18:54:16Z (17 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
acfdcb0
Parents:
15b9970
Message:

VFS_WRITE and tmpfs_write fixes.

Location:
uspace/srv
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fs/tmpfs/tmpfs.c

    r15b9970 rf7017572  
    116116                        tmpfs_read(callid, &call);
    117117                        break;
     118                case VFS_WRITE:
     119                        tmpfs_write(callid, &call);
     120                        break;
    118121                default:
    119122                        ipc_answer_0(callid, ENOTSUP);
  • uspace/srv/fs/tmpfs/tmpfs_ops.c

    r15b9970 rf7017572  
    498498                /* The file size is not changing. */
    499499                (void) ipc_data_write_finalize(callid, dentry->data + pos, len);
    500                 ipc_answer_1(rid, EOK, len);
     500                ipc_answer_2(rid, EOK, len, dentry->size);
    501501                return;
    502502        }
     
    512512        if (!newdata) {
    513513                ipc_answer_0(callid, ENOMEM);
    514                 ipc_answer_1(rid, EOK, 0);
     514                ipc_answer_2(rid, EOK, 0, dentry->size);
    515515                return;
    516516        }
  • uspace/srv/vfs/vfs_ops.c

    r15b9970 rf7017572  
    371371        vfs_file_t *file = vfs_file_get(fd);
    372372        file->node = node;
    373         if (oflag & O_APPEND)
     373        if (oflag & O_APPEND) 
    374374                file->append = true;
    375375
     
    471471        else {
    472472                /* Update the cached version of node's size. */
    473                 file->node->size = IPC_GET_ARG2(answer);
     473                if (rc == EOK)
     474                        file->node->size = IPC_GET_ARG2(answer);
    474475                rwlock_write_unlock(&file->node->contents_rwlock);
    475476        }
    476477
    477478        /* Update the position pointer and unlock the open file. */
    478         file->pos += bytes;
     479        if (rc == EOK)
     480                file->pos += bytes;
    479481        futex_up(&file->lock);
    480482
Note: See TracChangeset for help on using the changeset viewer.