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
*/
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;
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);
int exfat_build_file_dentry_set(struct exfat *exfat, const char *name,
unsigned short attr, struct exfat_dentry **dentry_set,
int *dentry_count);
-int exfat_find_free_cluster(struct exfat *exfat, clus_t start, clus_t *new_clu);
int exfat_add_dentry_set(struct exfat *exfat, struct exfat_dentry_loc *loc,
struct exfat_dentry *dset, int dcount,
bool need_next_loc);