Re: [PATCHv2 1/4] zram: introduce writeback bio batching support

From: Sergey Senozhatsky

Date: Thu Nov 13 2025 - 22:08:14 EST


On (25/11/14 10:53), Sergey Senozhatsky wrote:
> [..]
> > > +struct zram_wb_req {
> > > + unsigned long blk_idx;
> > > + struct page *page;
> > > struct zram_pp_slot *pps;
> > > struct bio_vec bio_vec;
> > > struct bio bio;
> > > - int ret = 0, err;
> > > +
> > > + struct list_head entry;
> > > +};
> >
> > How about moving structure definition to the upper part of the C file?
> > Not only readability to put together data types but also better diff
> > for reviewer to know what we changed in this patch.
>
> This still needs to be under #ifdef CONFIG_ZRAM_WRITEBACK so readability
> is not significantly better. Do you still prefer moving it up?

My intention was to keep structs definitions together with the static
functions that use them (which are under big #ifdef CONFIG_ZRAM_WRITEBACK
block). So that CONFIG_ZRAM_WRITEBACK parts stay in one place and are not
scattered across the file.