From: Andries.Brouwer@cwi.nl
To: Andries.Brouwer@cwi.nl, torvalds@transmeta.com
Cc: akpm@digeo.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] struct loop_info64
Date: Fri, 18 Apr 2003 19:19:01 +0200 (MEST) [thread overview]
Message-ID: <UTC200304181719.h3IHJ1i03344.aeb@smtp.cwi.nl> (raw)
From: Linus Torvalds <torvalds@transmeta.com>
We should literally have the rule that any user-visible data structures
cannot use _any_ types other than u8/u16/u32/u64 (and _maybe_ the signed
ones, if there is any real reason to).
I agree very much with the statement that basic types
that occur in the kernel API should be explicitly given.
Not ino_t or __old_dev_t but int or long.
I agree less with the statement that they must be u32 instead of int.
My main reason is historical: the Unix interface is defined in terms
of char/int/long.
> +struct loop_info64 {
> + int lo_number; /* ioctl r/o */
> + unsigned long long lo_device; /* ioctl r/o */
> + unsigned long lo_inode; /* ioctl r/o */
> + unsigned long long lo_rdevice; /* ioctl r/o */
Make these be explicitly sized, and try to put the 64-bit members at the
beginning to avoid alignment and structure packing problems.
OK - will do.
(So far compatibility was so good that a private copy of the old
definition of struct loop_info could be used where the kernel
expects a struct loop_info64. Making more changes to struct loop_info64
diminishes compatibility, but
Any reason to keep an "offset" as "int"?
changing the type of offset destroys compatibility anyway.)
Andries
next reply other threads:[~2003-04-18 17:07 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-04-18 17:19 Andries.Brouwer [this message]
2003-04-18 17:50 ` Linus Torvalds
-- strict thread matches above, loose matches on Subject: below --
2003-04-23 8:20 Andries.Brouwer
[not found] <759098236@toto.iv>
2003-04-23 0:43 ` Peter Chubb
2003-04-18 13:04 Andries.Brouwer
2003-04-18 16:26 ` Linus Torvalds
2003-04-18 16:55 ` Greg KH
2003-04-18 17:55 ` Linus Torvalds
2003-04-18 18:06 ` Greg KH
2003-04-18 19:12 ` Kai Germaschewski
2003-04-19 4:54 ` Rusty Russell
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=UTC200304181719.h3IHJ1i03344.aeb@smtp.cwi.nl \
--to=andries.brouwer@cwi.nl \
--cc=akpm@digeo.com \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.com \
/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
all inboxes | Powered by JetHome®