X-Git-Url: https://git.sven.stormbind.net/?a=blobdiff_plain;f=include%2Fexfat_dir.h;h=d450c61000cbc8c9e978c00a1dff7da57561228c;hb=HEAD;hp=3bc5b51c6f4c9f028a76394ca72a3b906c2c43e0;hpb=03290761e3849db9b13d2d3b176b36ab31c395bb;p=sven%2Fexfatprogs.git diff --git a/include/exfat_dir.h b/include/exfat_dir.h index 3bc5b51..6a3acfd 100644 --- a/include/exfat_dir.h +++ b/include/exfat_dir.h @@ -16,7 +16,7 @@ struct buffer_desc; struct exfat_de_iter { struct exfat *exfat; struct exfat_inode *parent; - struct buffer_desc *buffer_desc; /* cluster * 2 */ + struct buffer_desc *buffer_desc; __u32 ra_next_clus; unsigned int ra_begin_offset; unsigned int ra_partial_size; @@ -25,13 +25,16 @@ struct exfat_de_iter { off_t de_file_offset; off_t next_read_offset; int max_skip_dentries; -#define DOT_NAME_NUM_MAX 9999999 - unsigned int dot_name_num; +#define INVALID_NAME_NUM_MAX 9999999 + unsigned int invalid_name_num; + + char *name_hash_bitmap; /* bitmap of children's name hashes */ }; struct exfat_lookup_filter { struct { uint8_t type; + int dentry_count; /* return 0 if matched, return 1 if not matched, * otherwise return errno */ @@ -43,8 +46,15 @@ struct exfat_lookup_filter { struct exfat_dentry *dentry_set; int dentry_count; off_t file_offset; - /* device offset where the dentry_set locates, or - * the empty slot locates or EOF if not found. + /* + * If the dentry_set found: + * - device offset where the dentry_set locates. + * If the dentry_set not found: + * - device offset where the first empty dentry_set locates + * if in.dentry_count > 0 and there are enough empty dentry. + * - device offset where the last empty dentry_set locates + * if in.dentry_count = 0 or no enough empty dentry. + * - EOF if no empty dentry_set. */ off_t dev_offset; } out; @@ -65,6 +75,10 @@ int exfat_lookup_dentry_set(struct exfat *exfat, struct exfat_inode *parent, struct exfat_lookup_filter *filter); int exfat_lookup_file(struct exfat *exfat, struct exfat_inode *parent, const char *name, struct exfat_lookup_filter *filter_out); +int exfat_lookup_file_by_utf16name(struct exfat *exfat, + struct exfat_inode *parent, + __le16 *utf16_name, + struct exfat_lookup_filter *filter_out); int exfat_create_file(struct exfat *exfat, struct exfat_inode *parent, const char *name, unsigned short attr);