Re: [PATCH 6/6] fs: add CONFIG_BUFFER_HEAD

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux