Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752560AbdGEVvr (ORCPT ); Wed, 5 Jul 2017 17:51:47 -0400 Received: from mail-oi0-f65.google.com ([209.85.218.65]:34733 "EHLO mail-oi0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752345AbdGEVvo (ORCPT ); Wed, 5 Jul 2017 17:51:44 -0400 MIME-Version: 1.0 In-Reply-To: <20170705071446.GA10672@ZenIV.linux.org.uk> References: <20170705071446.GA10672@ZenIV.linux.org.uk> From: Linus Torvalds Date: Wed, 5 Jul 2017 14:51:43 -0700 X-Google-Sender-Auth: YVUAcziWxx93BtoHsZ5r2cg9gbA Message-ID: Subject: Re: [git pull] vfs.git part 3 To: Al Viro , Christoph Hellwig Cc: Linux Kernel Mailing List , linux-fsdevel Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1315 Lines: 31 On Wed, Jul 5, 2017 at 12:14 AM, Al Viro wrote: > > Christoph's fs/read_write.c series - consolidation and cleanups. Side note - when looking through this, it struck me how confusing that "int flags" argument was. We have a ton of "flags" in the filesystem layer, and how all the read/write helpers take them too, and it's really hard to see what kind of flags they are. Could we perhaps make those RWF_xyz flags have a nice bitwise type, and use that type in the argument list, so that not only could there be some sparse typechecking, but the functions that pass flags on to each other would automatically have a certain amount of actual self-documenting prototypes? So when you look at one of those vfs_iter_write() or whatever functions, you just see *what* flags the flags argument is. Because "int flags" really is the worst. It's the wrong type anyway (at least make it unsigned if it's a collection of bits), but it's also very ambiguous indeed when there are so many other flags that are often used/tested in the same functions (there's the "iter" flagsm, there's file->f_mode, there's just a lot of different flags going on, and the "int flags" is the least well documented of them all, particularly since 99.9% of all users just pass in zero). Hmm? Linus