From: Andreas Dilger <adilger@clusterfs.com>
To: Andries.Brouwer@cwi.nl
Cc: akpm@digeo.com, torvalds@transmeta.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] struct loop_info
Date: Thu, 17 Apr 2003 23:05:00 -0600 [thread overview]
Message-ID: <20030417230500.I26054@schatzie.adilger.int> (raw)
In-Reply-To: <UTC200304172334.h3HNYgI06614.aeb@smtp.cwi.nl>; from Andries.Brouwer@cwi.nl on Fri, Apr 18, 2003 at 01:34:42AM +0200
On Apr 18, 2003 01:34 +0200, Andries.Brouwer@cwi.nl wrote:
> Until now as the source already says, we had a very unpleasant
> situation with struct loop_info:
>
> -/*
> - * Note that this structure gets the wrong offsets when directly used
> - * from a glibc program, because glibc has a 32bit dev_t.
> - * Prevent people from shooting in their own foot.
> - */
> -#if __GLIBC__ >= 2 && !defined(dev_t)
> -#error "Wrong dev_t in loop.h"
> -#endif
> -
> -/*
> - * This uses kdev_t because glibc currently has no appropiate
> - * conversion version for the loop ioctls.
> - * The situation is very unpleasant
> - */
>
> In the patch below I remove the definition for this struct from
> <linux/loop.h> and put it in <asm/loopinfo.h>.
Great. Now we have 20 copies of asm-foo/loopinfo.h. Couldn't you
just have asm-generic/loopinfo.h and each of the arch-specific
pieces just include that?
> In this struct the occurrences of dev_t have been replaced by their
> actual values (short int / int / long int).
Even better, have specific sized types (__u16, __u32, __u64) for the
fields, so there is no ambiguity (e.g. sparc64, or 32-bit code running
on x86-64).
Cheers, Andreas
--
Andreas Dilger
http://sourceforge.net/projects/ext2resize/
http://www-mddsp.enel.ucalgary.ca/People/adilger/
next prev parent reply other threads:[~2003-04-18 4:54 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-04-17 23:34 Andries.Brouwer
2003-04-18 0:22 ` Andrew Morton
2003-04-18 5:05 ` Andreas Dilger [this message]
2003-04-18 13:24 ` Jari Ruusu
2003-04-18 8:38 Andries.Brouwer
2003-04-18 9:06 Andries.Brouwer
2003-04-18 9:12 ` Christoph Hellwig
2003-04-18 9:36 Andries.Brouwer
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=20030417230500.I26054@schatzie.adilger.int \
--to=adilger@clusterfs.com \
--cc=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®