Changeset 88a27f1 in mainline for uspace/srv/fs/fat/fat_fat.h


Ignore:
Timestamp:
2011-05-13T20:14:32Z (14 years ago)
Author:
Oleg Romanenko <romanenko.oleg@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0182e5cc
Parents:
a8c14aa
Message:
  1. Split fat_get_cluster into 3 methods: fat_get_cluster_fat[12,16,32]

and fat_set_cluster to fat_set_cluster_fat[12,16,32]

  1. Use FAT_MASK to calculating FAT_CLST_LAST1, FAT_CLST_LAST8, FAT_CLST_BAD
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fs/fat/fat_fat.h

    ra8c14aa r88a27f1  
    4444#define FAT_CLST_FIRST    0x0002
    4545
    46 #define FAT12_CLST_BAD    0x0ff7
    47 #define FAT12_CLST_LAST1  0x0ff8
    48 #define FAT12_CLST_LAST8  0x0fff
    49 #define FAT16_CLST_BAD    0xfff7
    50 #define FAT16_CLST_LAST1  0xfff8
    51 #define FAT16_CLST_LAST8  0xffff
    5246#define FAT32_CLST_BAD    0x0ffffff7
    5347#define FAT32_CLST_LAST1  0x0ffffff8
     
    8680#define FAT_IS_FAT32(bs)        (CC(bs) >= FAT16_CLST_MAX)
    8781
    88 #define FAT_CLST_LAST1(bs) \
    89     (FAT_IS_FAT12(bs) ? FAT12_CLST_LAST1 : \
    90     (FAT_IS_FAT32(bs) ? FAT32_CLST_LAST1 : FAT16_CLST_LAST1))
    91 #define FAT_CLST_LAST8(bs) \
    92     (FAT_IS_FAT12(bs) ? FAT12_CLST_LAST8 : \
    93     (FAT_IS_FAT32(bs) ? FAT32_CLST_LAST8 : FAT16_CLST_LAST8))
    94 #define FAT_CLST_BAD(bs) \
    95     (FAT_IS_FAT12(bs) ? FAT12_CLST_BAD : \
    96     (FAT_IS_FAT32(bs) ? FAT32_CLST_BAD : FAT16_CLST_BAD))
    97 
    9882#define FAT_CLST_SIZE(bs) \
    9983    (FAT_IS_FAT32(bs) ? FAT32_CLST_SIZE : FAT16_CLST_SIZE)
     
    10286    (FAT_IS_FAT12(bs) ? FAT12_MASK : \
    10387    (FAT_IS_FAT32(bs) ? FAT32_MASK : FAT16_MASK))
     88
     89#define FAT_CLST_LAST1(bs)      (FAT32_CLST_LAST1 & FAT_MASK((bs)))
     90#define FAT_CLST_LAST8(bs)      (FAT32_CLST_LAST8 & FAT_MASK((bs)))
     91#define FAT_CLST_BAD(bs)        (FAT32_CLST_BAD & FAT_MASK((bs)))
    10492
    10593#define FAT_ROOT_CLST(bs) \
     
    133121extern int fat_alloc_shadow_clusters(struct fat_bs *, devmap_handle_t,
    134122    fat_cluster_t *, unsigned);
     123extern int fat_get_cluster_fat12(struct fat_bs *, devmap_handle_t, unsigned,
     124    fat_cluster_t, fat_cluster_t *);
     125extern int fat_get_cluster_fat16(struct fat_bs *, devmap_handle_t, unsigned,
     126    fat_cluster_t, fat_cluster_t *);
     127extern int fat_get_cluster_fat32(struct fat_bs *, devmap_handle_t, unsigned,
     128    fat_cluster_t, fat_cluster_t *);
    135129extern int fat_get_cluster(struct fat_bs *, devmap_handle_t, unsigned,
    136130    fat_cluster_t, fat_cluster_t *);
     131extern int fat_set_cluster_fat12(struct fat_bs *, devmap_handle_t, unsigned,
     132    fat_cluster_t, fat_cluster_t);
     133extern int fat_set_cluster_fat16(struct fat_bs *, devmap_handle_t, unsigned,
     134    fat_cluster_t, fat_cluster_t);
     135extern int fat_set_cluster_fat32(struct fat_bs *, devmap_handle_t, unsigned,
     136    fat_cluster_t, fat_cluster_t);
    137137extern int fat_set_cluster(struct fat_bs *, devmap_handle_t, unsigned,
    138138    fat_cluster_t, fat_cluster_t);
Note: See TracChangeset for help on using the changeset viewer.