Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp594149ybe; Thu, 19 Sep 2019 00:11:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqwOUH5qRSjKcEEalKKto7a5QnVY+KW7tpVlg3tUHKEpS6cxWJ9xZsIujCdp8z/dNdaRaoaP X-Received: by 2002:a17:906:32c3:: with SMTP id k3mr12832334ejk.117.1568877078573; Thu, 19 Sep 2019 00:11:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568877078; cv=none; d=google.com; s=arc-20160816; b=z/1YvSdSGT/tqNCgxL6to5RDD08fUG0ztymy4WrCiPgoFPPaGAkmx0oJ7UZxx8Y84U 8SntZ/s4hu7ptm+89+FdKCbIL1j3XuT9r+cYTCkt48bdgnFViGK6wb4LHAktgh89wknE 4hRrtZqweY0tSSwFT4SGnQNWQxHExK3dncuo23BFVKoLCVNVXXg7Ub8fu+YFhPx1NbKw afJTfH9FWHgheiUKy0tjSmUVIjIhJ47r5m2aJp3P9uA+j6XQ3Dkf+hcZGLB1icEs5/ML ilv1XPS5cMu88BgGFyGAFmqmVcb5yLf8Ssq8pNcYE51vGITOvHgjg28OXKxBOX4Vf94r i7Ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=5Xuld3BlUHhLVm41JSQ0g37C/9G156A47j1pRWimdvw=; b=fivtns0aXi1WRKxwbi8cLEu2tr2ylDg0mk+Gpv7nB4YzDhPA6BVec5Yeb4d/znx57M YBSkW2TOyEZ74WTZtXFSATKyKmkn0InGs5YjJQB5X3IMS9LNGI40woHZ5DZUvfAT9uuN AZqQbcbxadWFOJrD3Y+0XoPBMW10SBK5NzHLrRFFbVdu9euuzSTv9y+QGBf1Olb+infv mT6EqwqajAFpef5MqhimkZmu++SI6V1lFdoxj+CgjQsPKssWlvQpk/U7ptR4zUGnP+9d MRJRIBj0TJK5yb0EHr47F1eNEOxlJcYZXKfcgUQSmD9eI04wLZHlyBwdeV3zFpwOsyva REBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=K4bnmhnB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s27si4105437ejb.356.2019.09.19.00.10.55; Thu, 19 Sep 2019 00:11:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=K4bnmhnB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387909AbfISCIR (ORCPT + 99 others); Wed, 18 Sep 2019 22:08:17 -0400 Received: from mail-lf1-f66.google.com ([209.85.167.66]:46266 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387712AbfISCIR (ORCPT ); Wed, 18 Sep 2019 22:08:17 -0400 Received: by mail-lf1-f66.google.com with SMTP id t8so1069377lfc.13 for ; Wed, 18 Sep 2019 19:08:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=5Xuld3BlUHhLVm41JSQ0g37C/9G156A47j1pRWimdvw=; b=K4bnmhnBOLjP8CCgm9SQOLs8Azqf3H69cXUe+ZDqGsJNsVyqgu4XmqoP9IeTJLNk2l //0jhii85ZMd5vOF7E688yX86AzktkkMYhlQ07aMMj+h5+afd2UQCp7atEt6iXXdF2LU RRh/vpBYAp69fsqpH8cadS17r2gGFQbSW0FSg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=5Xuld3BlUHhLVm41JSQ0g37C/9G156A47j1pRWimdvw=; b=jKa/WbpdCX/3XH88RD2Si1t/aAkKt2K6tA0tsGeFy7+PrgqHXoRYH7Dx3VJqKGXbR0 kOAKe/I9nzkjU+oCF5bYuSn9J2W94hIbmegzR+lzXzHbJrKm450FpAdQ2s7oxMNUiEvG G1mwYKqo38bc8EkWGgNu7yFdCdR/0fMFBqEKjBY7deyvIMiRLAMnUEpRFEhRVDhjcxpD QeByaYGALu+IsXe8DETet23y561+ywg1wIokkMSO7wWXwHGyo8bzyaKWZQzCFtcpFCnC dw6IyaiAw2BZeJMU8lvZIim0TL1vNF9PDHuWGBZ+cIXVYIXEJsMggr/TQY9WEjcqV/Ca FlbA== X-Gm-Message-State: APjAAAUewt6tmaVvta8F2oJ+G1b/WX9uWdh/R1DIN/6+oNnig9JJ2H/C /0mPEhRL+Z3pOshucalZN1bQn8hqK2E= X-Received: by 2002:ac2:554c:: with SMTP id l12mr3702006lfk.10.1568858894836; Wed, 18 Sep 2019 19:08:14 -0700 (PDT) Received: from mail-lf1-f47.google.com (mail-lf1-f47.google.com. [209.85.167.47]) by smtp.gmail.com with ESMTPSA id b10sm1242105lji.48.2019.09.18.19.08.13 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 18 Sep 2019 19:08:13 -0700 (PDT) Received: by mail-lf1-f47.google.com with SMTP id u28so1108714lfc.5 for ; Wed, 18 Sep 2019 19:08:13 -0700 (PDT) X-Received: by 2002:ac2:5a4c:: with SMTP id r12mr3524864lfn.52.1568858892842; Wed, 18 Sep 2019 19:08:12 -0700 (PDT) MIME-Version: 1.0 References: <20190917152140.GU2229799@magnolia> In-Reply-To: From: Linus Torvalds Date: Wed, 18 Sep 2019 19:07:56 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [GIT PULL] iomap: new code for 5.4 To: "Darrick J. Wong" Cc: linux-fsdevel , linux-xfs , Dave Chinner , Linux Kernel Mailing List , Eric Sandeen , Christoph Hellwig , Andreas Gruenbacher , Bob Peterson , cluster-devel Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 18, 2019 at 6:31 PM Linus Torvalds wrote: > > Why would anybody use that odd "list_pop()" thing in a loop, when what > it really seems to just want is that bog-standard > "list_for_each_entry_safe()" Side note: I do agree that the list_for_each_entry_safe() thing isn't exactly beautiful, particularly since you need that extra variable for the temporary "next" pointer. It's one of the C++ features I'd really like to use in the kernel - the whole "declare new variable in a for (;;) statement" thing. In fact, it made it into C - it's there in C99 - but we still use "-std=gnu89" because of other problems with the c99 updates. Anyway, I *would* be interested in cleaning up list_for_each_entry_safe() if somebody has the energy and figures out what we could do to get the c99 behavior without the breakage from other sources. For some background: the reason we use "gnu89" is because we use the GNU extension with type cast initializers quite a bit, ie things like #define __RAW_SPIN_LOCK_UNLOCKED(lockname) \ (raw_spinlock_t) __RAW_SPIN_LOCK_INITIALIZER(lockname) and that broke in c99 and gnu99, which considers those compound literals and you can no longer use them as initializers. See https://lore.kernel.org/lkml/20141019231031.GB9319@node.dhcp.inet.fi/ for some of the historical discussion about this. It really _is_ sad, because variable declarations inside for-loops are very useful, and would have the potential to make some of our "for_each_xyz()" macros a lot prettier (and easier to use too). So our list_for_each_entry_safe() thing isn't perfect, but that's no reason to try to then make up completely new things. Linus