Changeset beb9336 in mainline for uspace/srv/fs/ext4fs/ext4fs.c


Ignore:
Timestamp:
2012-08-24T14:07:52Z (12 years ago)
Author:
Frantisek Princ <frantisek.princ@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
041ab64
Parents:
bd29f9c9 (diff), db81577 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge with mainline

File:
1 edited

Legend:

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

    rbd29f9c9 rbeb9336  
    2929/** @addtogroup fs
    3030 * @{
    31  */
    32 
     31 */
    3332/**
    34  * @file        ext4fs.c
    35  * @brief       EXT4 file system driver for HelenOS.
     33 * @file  ext4fs.c
     34 * @brief Ext4 file system driver for HelenOS.
    3635 */
    3736
     
    4645#include "../../vfs/vfs.h"
    4746
    48 #define NAME    "ext4fs"
     47#define NAME  "ext4fs"
    4948
    5049vfs_info_t ext4fs_vfs_info = {
    5150        .name = NAME,
    52         .instance = 0,
     51        .instance = 0
    5352};
    5453
    55 /**
    56  * Entry point of ext4fs server.
    57  * Initialize data structures and IPC, then accepts connections in server mode.
    58  */
    5954int main(int argc, char **argv)
    6055{
    61         printf(NAME ": HelenOS EXT4 file system server\n");
    62 
     56        printf("%s: HelenOS ext4 file system server\n", NAME);
     57       
    6358        if (argc == 3) {
    6459                if (!str_cmp(argv[1], "--instance"))
    6560                        ext4fs_vfs_info.instance = strtol(argv[2], NULL, 10);
    6661                else {
    67                         printf(NAME " Unrecognized parameters\n");
    68                         return -1;
     62                        printf("%s: Unrecognized parameters\n", NAME);
     63                        return 1;
    6964                }
    7065        }
    71 
     66       
    7267        async_sess_t *vfs_sess = service_connect_blocking(EXCHANGE_SERIALIZE,
    73                 SERVICE_VFS, 0, 0);
     68            SERVICE_VFS, 0, 0);
    7469        if (!vfs_sess) {
    75                 printf(NAME ": failed to connect to VFS\n");
    76                 return -1;
     70                printf("%s: Failed to connect to VFS\n", NAME);
     71                return 2;
    7772        }
    78 
     73       
    7974        int rc = ext4fs_global_init();
    8075        if (rc != EOK) {
    81                 printf(NAME ": Failed global initialization\n");
    82                 return 1;
     76                printf("%s: Global initialization failed\n", NAME);
     77                return rc;
    8378        }
    84 
     79       
    8580        rc = fs_register(vfs_sess, &ext4fs_vfs_info, &ext4fs_ops,
    8681            &ext4fs_libfs_ops);
    8782        if (rc != EOK) {
    88                 fprintf(stdout, NAME ": Failed to register fs (%d)\n", rc);
    89                 return 1;
     83                printf("%s: Failed to register file system\n", NAME);
     84                return rc;
    9085        }
    91 
    92         printf(NAME ": Accepting connections\n");
     86       
     87        printf("%s: Accepting connections\n", NAME);
    9388        task_retval(0);
    9489        async_manager();
    95         /* not reached */
     90       
     91        /* Not reached */
    9692        return 0;
    9793}
     
    9995/**
    10096 * @}
    101  */ 
     97 */
Note: See TracChangeset for help on using the changeset viewer.