Changeset 4c53333 in mainline for uspace/srv/fs/ext4fs/ext4fs.c


Ignore:
Timestamp:
2013-07-11T08:21:10Z (13 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
64e63ce1
Parents:
80445cf (diff), c8bb1633 (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 mainline changes

File:
1 moved

Legend:

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

    r80445cf r4c53333  
    11/*
    2  * Copyright (c) 2006 Martin Decky
    3  * Copyright (c) 2011 Martin Sucha
     2 * Copyright (c) 2012 Frantisek Princ
    43 * All rights reserved.
    54 *
     
    3029/** @addtogroup fs
    3130 * @{
    32  */
    33 
     31 */
    3432/**
    35  * @file        ext2.c
    36  * @brief       EXT2 file system driver for HelenOS.
     33 * @file  ext4fs.c
     34 * @brief Ext4 file system driver for HelenOS.
    3735 */
    3836
    39 #include "ext2fs.h"
    40 #include <ipc/services.h>
    41 #include <ns.h>
    4237#include <async.h>
    4338#include <errno.h>
    44 #include <unistd.h>
     39#include <libfs.h>
     40#include <ns.h>
     41#include <stdio.h>
    4542#include <task.h>
    46 #include <stdio.h>
    47 #include <libfs.h>
     43#include <ipc/services.h>
     44#include "ext4fs.h"
    4845#include "../../vfs/vfs.h"
    4946
    50 #define NAME    "ext2fs"
     47#define NAME  "ext4fs"
    5148
    52 vfs_info_t ext2fs_vfs_info = {
     49vfs_info_t ext4fs_vfs_info = {
    5350        .name = NAME,
    54         .instance = 0,
     51        .instance = 0
    5552};
    5653
    5754int main(int argc, char **argv)
    5855{
    59         printf(NAME ": HelenOS EXT2 file system server\n");
    60 
     56        printf("%s: HelenOS ext4 file system server\n", NAME);
     57       
    6158        if (argc == 3) {
    6259                if (!str_cmp(argv[1], "--instance"))
    63                         ext2fs_vfs_info.instance = strtol(argv[2], NULL, 10);
     60                        ext4fs_vfs_info.instance = strtol(argv[2], NULL, 10);
    6461                else {
    65                         printf(NAME " Unrecognized parameters");
    66                         return -1;
     62                        printf("%s: Unrecognized parameters\n", NAME);
     63                        return 1;
    6764                }
    6865        }
     
    7168            SERVICE_VFS, 0, 0);
    7269        if (!vfs_sess) {
    73                 printf(NAME ": failed to connect to VFS\n");
    74                 return -1;
    75         }
    76 
    77         int rc = ext2fs_global_init();
    78         if (rc != EOK) {
    79                 printf(NAME ": Failed global initialization\n");
    80                 return 1;
    81         }       
    82                
    83         rc = fs_register(vfs_sess, &ext2fs_vfs_info, &ext2fs_ops,
    84             &ext2fs_libfs_ops);
    85         if (rc != EOK) {
    86                 fprintf(stdout, NAME ": Failed to register fs (%d)\n", rc);
    87                 return 1;
     70                printf("%s: Failed to connect to VFS\n", NAME);
     71                return 2;
    8872        }
    8973       
    90         printf(NAME ": Accepting connections\n");
     74        int rc = ext4fs_global_init();
     75        if (rc != EOK) {
     76                printf("%s: Global initialization failed\n", NAME);
     77                return rc;
     78        }
     79       
     80        rc = fs_register(vfs_sess, &ext4fs_vfs_info, &ext4fs_ops,
     81            &ext4fs_libfs_ops);
     82        if (rc != EOK) {
     83                printf("%s: Failed to register file system\n", NAME);
     84                return rc;
     85        }
     86       
     87        printf("%s: Accepting connections\n", NAME);
    9188        task_retval(0);
    9289        async_manager();
    93         /* not reached */
     90       
     91        /* Not reached */
    9492        return 0;
    9593}
     
    9795/**
    9896 * @}
    99  */ 
     97 */
Note: See TracChangeset for help on using the changeset viewer.