Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 55a7fee in mainline


Ignore:
Timestamp:
2017-03-19T20:15:55Z (5 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master
Children:
3648e184
Parents:
35e81e2
Message:

Streamline vfs_op_fstat()

Location:
uspace/srv/vfs
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/vfs/vfs.h

    r35e81e2 r55a7fee  
    212212extern int vfs_op_close(int fd);
    213213extern int vfs_op_dup(int oldfd, int newfd);
    214 extern int vfs_op_fstat_forward(int fd);
     214extern int vfs_op_fstat(int fd);
    215215extern int vfs_op_mount(int mpfd, unsigned servid, unsigned flags, unsigned instance, const char *opts, const char *fsname, int *outfd);
    216216extern int vfs_op_mtab_get(void);
  • uspace/srv/vfs/vfs_ipc.c

    r35e81e2 r55a7fee  
    6161{
    6262        int fd = IPC_GET_ARG1(*request);
    63         int rc = vfs_op_fstat_forward(fd);
     63        int rc = vfs_op_fstat(fd);
    6464        async_answer_0(rid, rc);
    6565}
  • 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.