Changeset 55a7fee in mainline for uspace/srv/vfs/vfs_ops.c


Ignore:
Timestamp:
2017-03-19T20:15:55Z (7 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
3648e184
Parents:
35e81e2
Message:

Streamline vfs_op_fstat()

File:
1 edited

Legend:

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

    r35e81e2 r55a7fee  
    137137}
    138138
    139 int vfs_op_fstat_forward(int fd)
     139int vfs_op_fstat(int fd)
    140140{
    141141        vfs_file_t *file = vfs_file_get(fd);
     
    143143                return EBADF;
    144144
    145         assert(file->node);
    146        
    147         ipc_callid_t callid;
    148         if (!async_data_read_receive(&callid, NULL)) {
    149                 vfs_file_put(file);
    150                 async_answer_0(callid, EINVAL);
    151                 return EINVAL;
    152         }
    153 
    154         async_exch_t *exch = vfs_exchange_grab(file->node->fs_handle);
    155         assert(exch);
    156        
    157         aid_t msg;
    158         msg = async_send_3(exch, VFS_OUT_STAT, file->node->service_id,
    159             file->node->index, true, NULL);
    160         assert(msg);
    161         async_forward_fast(callid, exch, 0, 0, 0, IPC_FF_ROUTE_FROM_ME);
    162        
     145        vfs_node_t *node = file->node;
     146
     147        async_exch_t *exch = vfs_exchange_grab(node->fs_handle);
     148        int rc = async_data_read_forward_fast(exch, VFS_OUT_STAT,
     149            node->service_id, node->index, true, 0, NULL);
    163150        vfs_exchange_release(exch);
    164        
    165         sysarg_t rc;
    166         async_wait_for(msg, &rc);
    167151       
    168152        vfs_file_put(file);
Note: See TracChangeset for help on using the changeset viewer.