Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1681890

Re: [git pull] vfs.git part 3

From Linus Torvalds <torvalds@linux-foundation.org>
Newsgroups linux.kernel
Subject Re: [git pull] vfs.git part 3
Date 2017-07-06 00:00 +0200
Message-ID <u00v1-3uT-47@gated-at.bofh.it> (permalink)
References <tZMLo-3av-19@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, Jul 5, 2017 at 12:14 AM, Al Viro <viro@zeniv.linux.org.uk> 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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[git pull] vfs.git part 3 Al Viro <viro@ZenIV.linux.org.uk> - 2017-07-05 09:20 +0200
  Re: [git pull] vfs.git part 3 Linus Torvalds <torvalds@linux-foundation.org> - 2017-07-06 00:00 +0200
    Re: [git pull] vfs.git part 3 Al Viro <viro@ZenIV.linux.org.uk> - 2017-07-06 00:40 +0200
      Re: [git pull] vfs.git part 3 Christoph Hellwig <hch@lst.de> - 2017-07-06 01:00 +0200
        Re: [git pull] vfs.git part 3 Al Viro <viro@ZenIV.linux.org.uk> - 2017-07-06 01:30 +0200
          Re: [git pull] vfs.git part 3 Christoph Hellwig <hch@lst.de> - 2017-07-06 16:50 +0200
            Re: [git pull] vfs.git part 3 Christoph Hellwig <hch@lst.de> - 2017-07-06 17:10 +0200
            Re: [git pull] vfs.git part 3 Al Viro <viro@ZenIV.linux.org.uk> - 2017-07-06 17:10 +0200
              Re: [git pull] vfs.git part 3 Christoph Hellwig <hch@lst.de> - 2017-07-06 17:20 +0200
                Re: [git pull] vfs.git part 3 Al Viro <viro@ZenIV.linux.org.uk> - 2017-07-06 17:50 +0200
                Re: [git pull] vfs.git part 3 Al Viro <viro@ZenIV.linux.org.uk> - 2017-07-06 18:00 +0200
                Re: [git pull] vfs.git part 3 Christoph Hellwig <hch@lst.de> - 2017-07-06 19:00 +0200
                Re: [git pull] vfs.git part 3 Al Viro <viro@ZenIV.linux.org.uk> - 2017-07-06 21:20 +0200
                Re: [git pull] vfs.git part 3 Al Viro <viro@ZenIV.linux.org.uk> - 2017-07-07 01:30 +0200
                Re: [git pull] vfs.git part 3 Christoph Hellwig <hch@lst.de> - 2017-07-07 16:10 +0200
                Re: [git pull] vfs.git part 3 Linus Torvalds <torvalds@linux-foundation.org> - 2017-07-07 17:50 +0200
                Re: [git pull] vfs.git part 3 Christopher Li <sparse@chrisli.org> - 2017-07-07 21:50 +0200
                Re: [git pull] vfs.git part 3 Al Viro <viro@ZenIV.linux.org.uk> - 2017-07-08 18:30 +0200
      [RFC] ->poll() sparse annotations Al Viro <viro@ZenIV.linux.org.uk> - 2017-07-18 03:40 +0200

csiph-web