[<prev] [next>] [day] [month] [year] [list]
Message-ID: <YRFEtK1CNr0Q+4nz@infradead.org>
Date: Mon, 9 Aug 2021 16:07:32 +0100
From: Christoph Hellwig <hch@...radead.org>
To: "Darrick J. Wong" <djwong@...nel.org>
Cc: linux-xfs@...r.kernel.org, linux-kernel@...r.kernel.org,
ojeda@...nel.org, nathan@...nel.org, ndesaulniers@...gle.com,
arnd@...db.de
Subject: Re: [PATCH 3/5] xfs: automatic resource cleanup of for_each_perag*
> +# Required for for_each_perag*
> +ccflags-y += -std=gnu99
I don't think it is up to an individual subsystem to pick a specific C
dialect.
I think the most important reason why the kernel sticks with gnu89 is
to avoid the misfeature of variable declarations in the middle of
blocks, and this change would lose it.
> + xfs_agnumber_t last_agno = 0;
> int saved_error = 0;
> int error = 0;
> LIST_HEAD (buffer_list);
>
> /* update secondary superblocks. */
> - for_each_perag_from(mp, agno, pag) {
> + for_each_perag_from(mp, iter, 1) {
> struct xfs_buf *bp;
>
> + last_agno = iter.pag->pag_agno;
This is a really horrible API as it magically injects a local variable
in a macro. It also leads to worse code generation and a small but
noticable increase in .text sie:
hch@...ck:~/work/xfs$ size xfs.o.*
text data bss dec hex filename
1521421 301161 1880 1824462 1bd6ce xfs.o.old
1521516 301161 1880 1824557 1bd72d xfs.o.new
Powered by blists - more mailing lists