linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	Joel Becker <jlbec@evilplan.org>,
	Chris Mason <chris.mason@oracle.com>,
	David Miller <davem@davemloft.net>
Subject: Re: [RFC] killing boilerplate checks in ->link/->mkdir/->rename
Date: Fri, 3 Feb 2012 01:45:33 +0000	[thread overview]
Message-ID: <20120203014533.GT23916@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20120203011612.GS23916@ZenIV.linux.org.uk>

On Fri, Feb 03, 2012 at 01:16:12AM +0000, Al Viro wrote:

> After looking a bit more: nlink_t is a f*cking mess.  Almost any code
> using that type kernel-side is broken.  Crap galore:
> 	* sometimes it's 32 bits, sometimes 16, sometimes 64.  Essentially
> at random.
> 	* almost all have it unsigned, except for sparc32, where it's
> signed short [inherited from v7 via SunOS?  BTW, in v6 it used to be even
> funnier - char, which is where ridiculous LINK_MAX == 127 comes from]
> 
> IOW, nlink_t is an attractive nuisance - it's nearly impossible to use in
> a portable way and we are lucky that almost nobody tries to.

Incidentally, why the hell do we have
	typedef __kernel_nlink_t        nlink_t;
anyway?  It's *not* exposed to userland and it's different from the
userland nlink_t (which is unsigned int on 32bit and unsigned long on 64bit).
Why not use __kernel_nlink_t (or explicitly-sized __uNN) in
arch/*/include/asm/stat.h and declare nlink_t kernel-side as __u32?

Why do we have daddr_t, while we are at it?  There is exactly one user -
fs/freevxfs and there we definitely want a fixed-sized type.

  reply	other threads:[~2012-02-03  1:45 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20120130222717.GA6393@kroah.com>
     [not found] ` <m18vkoirv9.fsf@fess.ebiederm.org>
     [not found]   ` <4F27C6EB.2070305@suse.cz>
     [not found]     ` <m14nvc82jo.fsf@fess.ebiederm.org>
     [not found]       ` <CA+55aFwZNdoAA9iPMiEp8-+ndgV+CtSZO4neSh_L+gd77k7-vg@mail.gmail.com>
     [not found]         ` <m1wr87ywex.fsf@fess.ebiederm.org>
     [not found]           ` <m1ehueyz20.fsf_-_@fess.ebiederm.org>
     [not found]             ` <CA+55aFyNQnXrL7fWhBt4LYBuoHD_x+j=Af-N=ueFMBkymy9Rnw@mail.gmail.com>
     [not found]               ` <CA+55aFzZX544ZDN9vN3jWMWZ=_9ZtpZ9cR6gNEzUnx9RCqR5LQ@mail.gmail.com>
     [not found]                 ` <20120202012258.GQ23916@ZenIV.linux.org.uk>
2012-02-02 21:24                   ` [RFC] killing boilerplate checks in ->link/->mkdir/->rename Al Viro
2012-02-02 23:46                     ` Linus Torvalds
2012-02-03  1:16                       ` Al Viro
2012-02-03  1:45                         ` Al Viro [this message]
2012-02-03  2:00                           ` Linus Torvalds
2012-02-03 14:57                         ` Chris Mason
2012-02-03 17:08                         ` Al Viro
2012-02-03 19:34                           ` Artem Bityutskiy
2012-02-06  8:50                           ` Artem Bityutskiy
2012-02-06 13:56                             ` Al Viro
2012-02-06 17:05                               ` Artem Bityutskiy
2012-02-06 17:11                                 ` Al Viro
2012-02-07  7:21                                   ` Artem Bityutskiy
2012-02-06 22:49                         ` Dave Chinner
2012-02-03  8:25                     ` Andreas Dilger
2012-02-03 17:03                       ` Al Viro
2012-02-04  7:42                         ` Andreas Dilger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120203014533.GT23916@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=chris.mason@oracle.com \
    --cc=davem@davemloft.net \
    --cc=jlbec@evilplan.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).