zonefs: Separate zone information from inode information
authorDamien Le Moal <damien.lemoal@opensource.wdc.com>
Wed, 16 Nov 2022 09:15:40 +0000 (18:15 +0900)
committerDamien Le Moal <damien.lemoal@opensource.wdc.com>
Mon, 23 Jan 2023 00:25:51 +0000 (09:25 +0900)
commitaa7f243f32e1d18036ee00d71d3ccfad70ae2121
tree90aa9554803f63416dbf63ce75092f5b6326c8cd
parent34422914dc00b291d1c47dbdabe93b154c2f2b25
zonefs: Separate zone information from inode information

In preparation for adding dynamic inode allocation, separate an inode
zone information from the zonefs inode structure. The new data structure
zonefs_zone is introduced to store in memory information about a zone
that must be kept throughout the lifetime of the device mount.

Linking between a zone file inode and its zone information is done by
setting the inode i_private field to point to a struct zonefs_zone.
Using the i_private pointer avoids the need for adding a pointer in
struct zonefs_inode_info. Beside the vfs inode, this structure is
reduced to a mutex and a write open counter.

One struct zonefs_zone is created per file inode on mount. These
structures are organized in an array using the new struct
zonefs_zone_group data structure to represent zone groups. The
zonefs_zone arrays are indexed per file number (the index of a struct
zonefs_zone in its array directly gives the file number/name for that
zone file inode).

Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
fs/zonefs/file.c
fs/zonefs/super.c
fs/zonefs/trace.h
fs/zonefs/zonefs.h