[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120203014533.GT23916@ZenIV.linux.org.uk>
Date: Fri, 3 Feb 2012 01:45:33 +0000
From: Al Viro <viro@...IV.linux.org.uk>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
Joel Becker <jlbec@...lplan.org>,
Chris Mason <chris.mason@...cle.com>,
David Miller <davem@...emloft.net>
Subject: Re: [RFC] killing boilerplate checks in ->link/->mkdir/->rename
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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists