Changeset 82650385 in mainline


Ignore:
Timestamp:
2011-03-05T17:11:24Z (13 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
3564cdd
Parents:
939b7d2
Message:

export minixfs headers into a separate library

Location:
uspace
Files:
7 deleted
5 edited
1 moved

Legend:

Unmodified
Added
Removed
  • uspace/app/mkminix/mkminix.c

    r939b7d2 r82650385  
    4848#include <getopt.h>
    4949#include <mem.h>
    50 #include "mfs_const.h"
    51 #include "mfs_inode.h"
    52 #include "mfs_super.h"
     50#include <fs/minix.h>
    5351
    5452#define NAME    "mkminix"
     
    264262                "           valid block size values are 1024, 2048 and 4096 bytes per block\n"
    265263                "-i ##      Specify the number of inodes for the filesystem\n"
    266                 "-l         Use 30-char long filenames (V1/V2 only)");
     264                "-l         Use 30-char long filenames (V1/V2 only)\n");
    267265        }
    268266}
  • uspace/lib/c/include/fs/minix.h

    r939b7d2 r82650385  
    2929/** @addtogroup fs
    3030 * @{
    31  */ 
     31 */
    3232
    33 #ifndef _MFS_SUPER_H_
    34 #define _MFS_SUPER_H_
     33#ifndef _MINIX_FS_H_
     34#define _MINIX_FS_H_
    3535
    36 #include "mfs_const.h"
     36#include <sys/types.h>
     37#include <bool.h>
     38
     39#define MFS_MAX_BLOCK_SIZE      4096
     40#define MFS_MIN_BLOCK_SIZE      1024
     41
     42#define MFS_ROOT_INO            1
     43#define MFS_SUPER_BLOCK         0
     44#define MFS_SUPER_BLOCK_SIZE    1024
     45
     46#define V2_NR_DIRECT_ZONES      7
     47#define V2_NR_INDIRECT_ZONES    3
     48
     49#define V1_NR_DIRECT_ZONES      7
     50#define V1_NR_INDIRECT_ZONES    2
     51
     52#define V1_MAX_NAME_LEN         14
     53#define V1L_MAX_NAME_LEN        30
     54#define V2_MAX_NAME_LEN         14
     55#define V2L_MAX_NAME_LEN        30
     56#define V3_MAX_NAME_LEN         60
    3757
    3858#define MFS_MAGIC_V1            0x137F
     
    108128} __attribute__ ((packed));
    109129
    110 typedef enum {
    111         MFS_VERSION_V1 = 1,
    112         MFS_VERSION_V1L,
    113         MFS_VERSION_V2,
    114         MFS_VERSION_V2L,
    115         MFS_VERSION_V3
    116 } mfs_version_t;
     130/*MinixFS V1 inode structure as it is on disk*/
     131struct mfs_v1_inode {
     132        uint16_t        i_mode;
     133        int16_t         i_uid;
     134        int32_t         i_size;
     135        int32_t         i_mtime;
     136        uint8_t         i_gid;
     137        uint8_t         i_nlinks;
     138        /*Block numbers for direct zones*/
     139        uint16_t        i_dzone[V1_NR_DIRECT_ZONES];
     140        /*Block numbers for indirect zones*/
     141        uint16_t        i_izone[V1_NR_INDIRECT_ZONES];
     142} __attribute__ ((packed));
     143
     144/*MinixFS V2 inode structure as it is on disk.*/
     145struct mfs_v2_inode {
     146        uint16_t        i_mode;
     147        uint16_t        i_nlinks;
     148        int16_t         i_uid;
     149        uint16_t        i_gid;
     150        int32_t         i_size;
     151        int32_t         i_atime;
     152        int32_t         i_mtime;
     153        int32_t         i_ctime;
     154        /*Block numbers for direct zones*/
     155        uint32_t        i_dzone[V2_NR_DIRECT_ZONES];
     156        /*Block numbers for indirect zones*/
     157        uint32_t        i_izone[V2_NR_INDIRECT_ZONES];
     158} __attribute__ ((packed));
     159
     160#define mfs_v2_dentry   mfs_v1_dentry
     161#define mfs_v1l_dentry  mfs_v2l_dentry
     162
     163/*MinixFS V1 directory entry on-disk structure*/
     164struct mfs_v1_dentry {
     165        uint16_t d_inum;
     166        char d_name[V1_MAX_NAME_LEN];
     167} __attribute__ ((packed));
     168
     169/*MinixFS V2 with 30-char filenames (Linux variant)*/
     170struct mfs_v2l_dentry {
     171        uint16_t d_inum;
     172        char d_name[V2L_MAX_NAME_LEN];
     173} __attribute__ ((packed));
     174
     175/*MinixFS V3 directory entry on-disk structure*/
     176struct mfs_v3_dentry {
     177        uint32_t d_inum;
     178        char d_name[V3_MAX_NAME_LEN];
     179} __attribute__ ((packed));
     180
    117181
    118182#endif
     
    120184/**
    121185 * @}
    122  */
     186 */
     187
  • uspace/srv/fs/minixfs/mfs.c

    r939b7d2 r82650385  
    4747#include <libfs.h>
    4848#include "mfs.h"
    49 #include "mfs_super.h"
    5049
    5150#define NAME    "mfs"
  • uspace/srv/fs/minixfs/mfs.h

    r939b7d2 r82650385  
    3434#define _MFS_H_
    3535
    36 #include "mfs_const.h"
     36#include <fs/minix.h>
    3737#include "../../vfs/vfs.h"
     38
     39typedef enum {
     40        MFS_VERSION_V1 = 1,
     41        MFS_VERSION_V1L,
     42        MFS_VERSION_V2,
     43        MFS_VERSION_V2L,
     44        MFS_VERSION_V3
     45} mfs_version_t;
    3846
    3947extern void mfs_mounted(ipc_callid_t rid, ipc_call_t *request);
  • uspace/srv/fs/minixfs/mfs_super.c

    r939b7d2 r82650385  
    3737#include <str.h>
    3838#include "mfs.h"
    39 #include "mfs_super.h"
    4039#include "mfs_utils.h"
    4140#include "../../vfs/vfs.h"
  • uspace/srv/fs/minixfs/mfs_utils.h

    r939b7d2 r82650385  
    3131 */
    3232
    33 #include "mfs_const.h"
     33#ifndef _MFS_UTILS_H_
     34#define _MFS_UTILS_H_
     35
     36#include <sys/types.h>
     37#include <bool.h>
    3438
    3539uint16_t conv16(bool native, uint16_t n);
    3640uint32_t conv32(bool native, uint32_t n);
     41
     42#endif
    3743
    3844/**
Note: See TracChangeset for help on using the changeset viewer.