summary refs log tree commit diff
path: root/fs/zonefs/zonefs.h
diff options
context:
space:
mode:
authorDamien Le Moal <damien.lemoal@opensource.wdc.com>2022-04-12 22:38:07 +0900
committerDamien Le Moal <damien.lemoal@opensource.wdc.com>2022-04-21 08:37:46 +0900
commit7d6dfbe03bd3bef51ead25d129dabebd8bae1ec4 (patch)
treef48d2f8981112eba7f514dc4e7e5fcb60a7ef866 /fs/zonefs/zonefs.h
parent2b95a23c4f50c42fe85f0d345612075d0f2c3118 (diff)
downloadlinux-7d6dfbe03bd3bef51ead25d129dabebd8bae1ec4.tar.gz
zonefs: Always do seq file write open accounting
The explicit_open mount option forces an explicitly open of the zone of
sequential files that are open for writing to ensure that the open file
can be written without the device failing write operations due to open
zone resources limit being exceeded. To implement this, zonefs accounts
all write open seq file when this mount option is used.

This accounting however can be easily performed even when the
explicit_open mount option is not used, thus allowing applications to
control zone resources on their own, without relying on open() system
call failures from zonefs.

To implement this, the helper zonefs_file_use_exp_open() is removed and
replaced with the helper zonefs_seq_file_need_wro() which test if a file
is a sequential file being open with write access. zonefs_open_zone()
and zonefs_close_zone() are renamed respectively to
zonefs_seq_file_write_open() and zonefs_seq_file_write_close() and
modified to update the s_wro_seq_files counter regardless of the
explicit_open mount option use.

If the explicit_open mount option is used, zonefs_seq_file_write_open()
execute an explicit zone open operation for a sequential file open for
writing for the first time, as before.

Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Hans Holmberg <hans.holmberg@wdc.com>
Diffstat (limited to 'fs/zonefs/zonefs.h')
0 files changed, 0 insertions, 0 deletions