1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * Copyright (C) 2021 LG Electronics.
5 * Author(s): Hyunchul Lee <hyc.lee@gmail.com>
15 struct exfat_inode *parent;
16 struct list_head children;
17 struct list_head sibling;
18 struct list_head list;
23 struct exfat_dentry *dentry_set;
26 __le16 name[0]; /* only for directory */
29 #define EXFAT_NAME_MAX 255
30 #define NAME_BUFFER_SIZE ((EXFAT_NAME_MAX + 1) * 2)
33 struct exfat_blk_dev *blk_dev;
35 char volume_label[VOLUME_LABEL_BUFFER_SIZE];
36 struct exfat_inode *root;
37 struct list_head dir_list;
39 unsigned int clus_size;
40 unsigned int sect_size;
44 clus_t disk_bitmap_clus;
45 unsigned int disk_bitmap_size;
51 struct exfat_dentry_loc {
52 struct exfat_inode *parent;
57 struct path_resolve_ctx {
58 struct exfat_inode *ancestors[255];
59 __le16 utf16_path[PATH_MAX + 2];
60 char local_path[PATH_MAX * MB_LEN_MAX + 1];
70 struct exfat *exfat_alloc_exfat(struct exfat_blk_dev *blk_dev, struct pbr *bs);
71 void exfat_free_exfat(struct exfat *exfat);
73 struct exfat_inode *exfat_alloc_inode(__u16 attr);
74 void exfat_free_inode(struct exfat_inode *node);
76 void exfat_free_children(struct exfat_inode *dir, bool file_only);
77 void exfat_free_file_children(struct exfat_inode *dir);
78 void exfat_free_ancestors(struct exfat_inode *child);
79 void exfat_free_dir_list(struct exfat *exfat);
81 int exfat_resolve_path(struct path_resolve_ctx *ctx, struct exfat_inode *child);
82 int exfat_resolve_path_parent(struct path_resolve_ctx *ctx,
83 struct exfat_inode *parent, struct exfat_inode *child);
85 struct buffer_desc *exfat_alloc_buffer(int count,
86 unsigned int clu_size, unsigned int sect_size);
87 void exfat_free_buffer(struct buffer_desc *bd, int count);