Changeset 5ed8b72 in mainline for uspace/lib/fs/libfs.c


Ignore:
Timestamp:
2013-09-15T23:17:11Z (11 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b9f7848b
Parents:
651c8db
Message:

cstyle fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/fs/libfs.c

    r651c8db r5ed8b72  
    806806        service_id_t service_id = (service_id_t) IPC_GET_ARG1(*request);
    807807        fs_index_t index = (fs_index_t) IPC_GET_ARG2(*request);
    808        
     808
    809809        fs_node_t *fn;
    810810        int rc = ops->node_get(&fn, service_id, index);
    811811        on_error(rc, answer_and_return(rid, rc));
    812        
     812
    813813        ipc_callid_t callid;
    814814        size_t size;
     
    820820                return;
    821821        }
    822        
     822
    823823        struct stat stat;
    824824        memset(&stat, 0, sizeof(struct stat));
    825        
     825
    826826        stat.fs_handle = fs_handle;
    827827        stat.service_id = service_id;
     
    832832        stat.size = ops->size_get(fn);
    833833        stat.service = ops->service_get(fn);
    834        
     834
    835835        ops->node_put(fn);
    836836
     
    845845        service_id_t service_id = (service_id_t) IPC_GET_ARG1(*request);
    846846        fs_index_t index = (fs_index_t) IPC_GET_ARG2(*request);
    847        
     847
    848848        fs_node_t *fn;
    849849        int rc = ops->node_get(&fn, service_id, index);
    850850        on_error(rc, answer_and_return(rid, rc));
    851        
     851
    852852        ipc_callid_t callid;
    853853        size_t size;
    854854        if ((!async_data_read_receive(&callid, &size)) ||
    855855            (size != sizeof(struct statfs))) {
    856                 ops->node_put(fn);
    857                 async_answer_0(callid, EINVAL);
    858                 async_answer_0(rid, EINVAL);
    859                 return;
    860         }
    861        
    862         struct statfs statfs;
    863         memset(&statfs, 0, sizeof(struct statfs));
    864 
    865         if (NULL != ops->size_block) { 
    866                 rc = ops->size_block(service_id, &statfs.f_bsize);
    867                 if (rc != EOK) goto error;
    868         }
    869 
    870         if (NULL != ops->total_block_count) {
    871                 rc = ops->total_block_count(service_id, &statfs.f_blocks);
    872                 if (rc != EOK) goto error;
    873         }
    874 
    875         if (NULL != ops->free_block_count) {
    876                 rc = ops->free_block_count(service_id, &statfs.f_bfree);
    877                 if (rc != EOK) goto error;
     856                goto error;
     857        }
     858
     859        struct statfs st;
     860        memset(&st, 0, sizeof(struct statfs));
     861
     862        if (ops->size_block != NULL) {
     863                rc = ops->size_block(service_id, &st.f_bsize);
     864                if (rc != EOK)
     865                        goto error;
     866        }
     867
     868        if (ops->total_block_count != NULL) {
     869                rc = ops->total_block_count(service_id, &st.f_blocks);
     870                if (rc != EOK)
     871                        goto error;
     872        }
     873
     874        if (ops->free_block_count != NULL) {
     875                rc = ops->free_block_count(service_id, &st.f_bfree);
     876                if (rc != EOK)
     877                        goto error;
    878878        }
    879879
    880880        ops->node_put(fn);
    881         async_data_read_finalize(callid, &statfs, sizeof(struct statfs));
     881        async_data_read_finalize(callid, &st, sizeof(struct statfs));
    882882        async_answer_0(rid, EOK);
    883883        return;
Note: See TracChangeset for help on using the changeset viewer.