fuse: move initialization of fuse_file to fuse_writepages() instead of in callback
authorJoanne Koong <joannelkoong@gmail.com>
Mon, 26 Aug 2024 21:19:05 +0000 (14:19 -0700)
committerMiklos Szeredi <mszeredi@redhat.com>
Thu, 29 Aug 2024 09:43:12 +0000 (11:43 +0200)
commit672c3b7457fcee9656c36a29a4b21ec4a652433e
tree4f2d008fb59c9d206a869f9d0e75389117db7959
parentc04e3b2118192384153b4eac595768e2ffb7ac4a
fuse: move initialization of fuse_file to fuse_writepages() instead of in callback

Prior to this change, data->ff is checked and if not initialized then
initialized in the fuse_writepages_fill() callback, which gets called
for every dirty page in the address space mapping.

This logic is better placed in the main fuse_writepages() caller where
data.ff is initialized before walking the dirty pages.

No functional changes added.

Signed-off-by: Joanne Koong <joannelkoong@gmail.com>
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
fs/fuse/file.c