diff options
author | Yuezhang Mo <Yuezhang.Mo@sony.com> | 2022-11-09 13:50:22 +0800 |
---|---|---|
committer | Namjae Jeon <linkinjeon@kernel.org> | 2022-12-12 11:02:49 +0900 |
commit | a3ff29a95fde16906304455aa8c0bd84eb770258 (patch) | |
tree | 57350d5839a840354048b8438215f98debad2008 /fs/exfat/exfat_fs.h | |
parent | f83d8a3b532097276266b5e81073ea46e27b17ab (diff) | |
download | lwn-a3ff29a95fde16906304455aa8c0bd84eb770258.tar.gz lwn-a3ff29a95fde16906304455aa8c0bd84eb770258.zip |
exfat: support dynamic allocate bh for exfat_entry_set_cache
In special cases, a file or a directory may occupied more than 19
directory entries, pre-allocating 3 bh is not enough. Such as
- Support vendor secondary directory entry in the future.
- Since file directory entry is damaged, the SecondaryCount
field is bigger than 18.
So this commit supports dynamic allocation of bh.
Signed-off-by: Yuezhang Mo <Yuezhang.Mo@sony.com>
Reviewed-by: Andy Wu <Andy.Wu@sony.com>
Reviewed-by: Aoyama Wataru <wataru.aoyama@sony.com>
Reviewed-by: Sungjong Seo <sj1557.seo@samsung.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Diffstat (limited to 'fs/exfat/exfat_fs.h')
-rw-r--r-- | fs/exfat/exfat_fs.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/exfat/exfat_fs.h b/fs/exfat/exfat_fs.h index af55018ff22e..82395ae80dba 100644 --- a/fs/exfat/exfat_fs.h +++ b/fs/exfat/exfat_fs.h @@ -185,11 +185,14 @@ struct exfat_entry_set_cache { struct super_block *sb; unsigned int start_off; int num_bh; - struct buffer_head *bh[DIR_CACHE_SIZE]; + struct buffer_head *__bh[DIR_CACHE_SIZE]; + struct buffer_head **bh; unsigned int num_entries; bool modified; }; +#define IS_DYNAMIC_ES(es) ((es)->__bh != (es)->bh) + struct exfat_dir_entry { struct exfat_chain dir; int entry; |