Changeset 89c57b6 in mainline for uspace/srv/fs/fat/fat.h


Ignore:
Timestamp:
2011-04-13T14:45:41Z (14 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
88634420
Parents:
cefb126 (diff), 17279ead (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 edited

Legend:

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

    rcefb126 r89c57b6  
    3535
    3636#include "fat_fat.h"
    37 #include <ipc/ipc.h>
    3837#include <fibril_synch.h>
    3938#include <libfs.h>
     
    4847
    4948#define min(a, b)               ((a) < (b) ? (a) : (b))
     49
     50/*
     51 * Convenience macros for accessing some frequently used boot sector members.
     52 */
     53#define BPS(bs)         uint16_t_le2host((bs)->bps)
     54#define SPC(bs)         (bs)->spc
     55#define RSCNT(bs)       uint16_t_le2host((bs)->rscnt)
     56#define FATCNT(bs)      (bs)->fatcnt
     57#define SF(bs)          uint16_t_le2host((bs)->sec_per_fat)
     58#define RDE(bs)         uint16_t_le2host((bs)->root_ent_max)
     59#define TS(bs)          (uint16_t_le2host((bs)->totsec16) != 0 ? \
     60                        uint16_t_le2host((bs)->totsec16) : \
     61                        uint32_t_le2host(bs->totsec32))
    5062
    5163#define BS_BLOCK                0
     
    163175
    164176        fibril_mutex_t  lock;
    165         dev_handle_t    dev_handle;
     177        devmap_handle_t devmap_handle;
    166178        fs_index_t      index;
    167179        /**
     
    198210        unsigned                refcnt;
    199211        bool                    dirty;
     212
     213        /*
     214         * Cache of the node's last and "current" cluster to avoid some
     215         * unnecessary FAT walks.
     216         */
     217        /* Node's last cluster in FAT. */
     218        bool            lastc_cached_valid;
     219        fat_cluster_t   lastc_cached_value;
     220        /* Node's "current" cluster, i.e. where the last I/O took place. */
     221        bool            currc_cached_valid;
     222        aoff64_t        currc_cached_bn;
     223        fat_cluster_t   currc_cached_value;
    200224} fat_node_t;
    201225
     
    217241extern void fat_sync(ipc_callid_t, ipc_call_t *);
    218242
    219 extern int fat_idx_get_new(fat_idx_t **, dev_handle_t);
    220 extern fat_idx_t *fat_idx_get_by_pos(dev_handle_t, fat_cluster_t, unsigned);
    221 extern fat_idx_t *fat_idx_get_by_index(dev_handle_t, fs_index_t);
     243extern int fat_idx_get_new(fat_idx_t **, devmap_handle_t);
     244extern fat_idx_t *fat_idx_get_by_pos(devmap_handle_t, fat_cluster_t, unsigned);
     245extern fat_idx_t *fat_idx_get_by_index(devmap_handle_t, fs_index_t);
    222246extern void fat_idx_destroy(fat_idx_t *);
    223247extern void fat_idx_hashin(fat_idx_t *);
     
    226250extern int fat_idx_init(void);
    227251extern void fat_idx_fini(void);
    228 extern int fat_idx_init_by_dev_handle(dev_handle_t);
    229 extern void fat_idx_fini_by_dev_handle(dev_handle_t);
     252extern int fat_idx_init_by_devmap_handle(devmap_handle_t);
     253extern void fat_idx_fini_by_devmap_handle(devmap_handle_t);
    230254
    231255#endif
Note: See TracChangeset for help on using the changeset viewer.