X-Git-Url: https://git.sven.stormbind.net/?p=sven%2Fexfatprogs.git;a=blobdiff_plain;f=fsck%2Ffsck.h;h=6c91face740c25f5ba10dc788d4305cf79338664;hp=ef46fa797d1ce277d2362edea6adf846d444ce8c;hb=HEAD;hpb=f7feb8f190bd23ec253bf9fe705738049d9cedd7 diff --git a/fsck/fsck.h b/fsck/fsck.h index ef46fa7..ee0cb30 100644 --- a/fsck/fsck.h +++ b/fsck/fsck.h @@ -7,57 +7,31 @@ #include "list.h" -typedef __u32 clus_t; - -struct exfat_inode { - struct exfat_inode *parent; - struct list_head children; - struct list_head sibling; - struct list_head list; - clus_t first_clus; - clus_t last_lclus; - clus_t last_pclus; - __u16 attr; - uint64_t size; - bool is_contiguous; - off_t dentry_file_offset; - __le16 name[0]; /* only for directory */ -}; - -#define EXFAT_NAME_MAX 255 -#define NAME_BUFFER_SIZE ((EXFAT_NAME_MAX+1)*2) - -struct exfat_de_iter { - struct exfat *exfat; - struct exfat_inode *parent; - unsigned char *dentries; /* cluster * 2 allocated */ - unsigned int read_size; /* cluster size */ - off_t de_file_offset; /* offset in dentries buffer */ - off_t next_read_offset; - int max_skip_dentries; -}; - enum fsck_ui_options { FSCK_OPTS_REPAIR_ASK = 0x01, FSCK_OPTS_REPAIR_YES = 0x02, FSCK_OPTS_REPAIR_NO = 0x04, - FSCK_OPTS_REPAIR = 0x07, + FSCK_OPTS_REPAIR_AUTO = 0x08, + FSCK_OPTS_REPAIR_WRITE = 0x0b, + FSCK_OPTS_REPAIR_ALL = 0x0f, + FSCK_OPTS_IGNORE_BAD_FS_NAME = 0x10, + FSCK_OPTS_RESCUE_CLUS = 0x20, }; -struct exfat { - enum fsck_ui_options options; - struct exfat_blk_dev *blk_dev; - struct pbr *bs; - char volume_label[VOLUME_LABEL_BUFFER_SIZE]; - struct exfat_inode *root; - struct list_head dir_list; +struct exfat; +struct exfat_inode; + +struct exfat_fsck { + struct exfat *exfat; struct exfat_de_iter de_iter; - __u32 *alloc_bitmap; - __u64 bit_count; + struct buffer_desc *buffer_desc; /* cluster * 2 */ + enum fsck_ui_options options; + bool dirty:1; + bool dirty_fat:1; + + char *name_hash_bitmap; }; -#define EXFAT_CLUSTER_SIZE(pbr) (1 << ((pbr)->bsx.sect_size_bits + \ - (pbr)->bsx.sect_per_clus_bits)) -#define EXFAT_SECTOR_SIZE(pbr) (1 << (pbr)->bsx.sect_size_bits) +off_t exfat_c2o(struct exfat *exfat, unsigned int clus); #endif