lkml.org 
[lkml]   [2023]   [Jul]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 6/6] fs: add CONFIG_BUFFER_HEAD
On Thu, Jul 20, 2023 at 03:45:11PM +0100, Matthew Wilcox wrote:
> On Thu, Jul 20, 2023 at 04:04:52PM +0200, Christoph Hellwig wrote:
> > @@ -400,7 +391,8 @@ static int blkdev_iomap_begin(struct inode *inode, loff_t offset, loff_t length,
> > iomap->type = IOMAP_MAPPED;
> > iomap->addr = iomap->offset;
> > iomap->length = isize - iomap->offset;
> > - iomap->flags |= IOMAP_F_BUFFER_HEAD;
> > + if (IS_ENABLED(CONFIG_BUFFER_HEAD))
> > + iomap->flags |= IOMAP_F_BUFFER_HEAD;
>
> Wouldn't it be simpler to do ...
>
> +#ifdef CONFIG_BUFFER_HEAD
> #define IOMAP_F_BUFFER_HEAD (1U << 4)
> +#else
> +#define IOMAP_F_BUFFER_HEAD 0
> +#endif
>
> in include/linux/iomap.h ?

> ... because this function then goes away.

I guess we could do that. It is less intrusive, but I have to say I find
flags that get defined away to 0 fairly confusing for the reader.

\
 
 \ /
  Last update: 2023-07-21 08:24    [W:0.046 / U:1.928 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site