public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] linux/ufs_fs.h: use __u64 for userspace
@ 2008-01-02  1:51 Mike Frysinger
  2008-01-02  2:02 ` Adrian Bunk
  0 siblings, 1 reply; 6+ messages in thread
From: Mike Frysinger @ 2008-01-02  1:51 UTC (permalink / raw)
  To: Andrew Morton, LKML

Fix the ufs_inotofsba macro to use __u64 rather than u64 since this is
exported to userspace.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
diff --git a/include/linux/ufs_fs.h b/include/linux/ufs_fs.h
index 10b854d..35b6e59 100644
--- a/include/linux/ufs_fs.h
+++ b/include/linux/ufs_fs.h
@@ -225,7 +225,7 @@ typedef __u16 __bitwise __fs16;
  */
 #define	ufs_inotocg(x)		((x) / uspi->s_ipg)
 #define	ufs_inotocgoff(x)	((x) % uspi->s_ipg)
-#define	ufs_inotofsba(x)	(((u64)ufs_cgimin(ufs_inotocg(x))) + ufs_inotocgoff(x) / uspi->s_inopf)
+#define	ufs_inotofsba(x)	(((__u64)ufs_cgimin(ufs_inotocg(x))) + ufs_inotocgoff(x) / uspi->s_inopf)
 #define	ufs_inotofsbo(x)	((x) % uspi->s_inopf)
 
 /*

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [patch] linux/ufs_fs.h: use __u64 for userspace
  2008-01-02  1:51 [patch] linux/ufs_fs.h: use __u64 for userspace Mike Frysinger
@ 2008-01-02  2:02 ` Adrian Bunk
  2008-01-02  7:50   ` Christoph Hellwig
  0 siblings, 1 reply; 6+ messages in thread
From: Adrian Bunk @ 2008-01-02  2:02 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: Andrew Morton, LKML

On Tue, Jan 01, 2008 at 08:51:40PM -0500, Mike Frysinger wrote:
> Fix the ufs_inotofsba macro to use __u64 rather than u64 since this is
> exported to userspace.
> 
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
> ---
> diff --git a/include/linux/ufs_fs.h b/include/linux/ufs_fs.h
> index 10b854d..35b6e59 100644
> --- a/include/linux/ufs_fs.h
> +++ b/include/linux/ufs_fs.h
> @@ -225,7 +225,7 @@ typedef __u16 __bitwise __fs16;
>   */
>  #define	ufs_inotocg(x)		((x) / uspi->s_ipg)
>  #define	ufs_inotocgoff(x)	((x) % uspi->s_ipg)
> -#define	ufs_inotofsba(x)	(((u64)ufs_cgimin(ufs_inotocg(x))) + ufs_inotocgoff(x) / uspi->s_inopf)
> +#define	ufs_inotofsba(x)	(((__u64)ufs_cgimin(ufs_inotocg(x))) + ufs_inotocgoff(x) / uspi->s_inopf)
>  #define	ufs_inotofsbo(x)	((x) % uspi->s_inopf)

But userspace anyway can't use them since it doesn't know what "uspi" 
is, so you should better reduce the userspace visibility of this header.

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [patch] linux/ufs_fs.h: use __u64 for userspace
  2008-01-02  2:02 ` Adrian Bunk
@ 2008-01-02  7:50   ` Christoph Hellwig
  2008-01-02  8:04     ` David Miller
  0 siblings, 1 reply; 6+ messages in thread
From: Christoph Hellwig @ 2008-01-02  7:50 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: Mike Frysinger, Andrew Morton, LKML

On Wed, Jan 02, 2008 at 04:02:42AM +0200, Adrian Bunk wrote:
> But userspace anyway can't use them since it doesn't know what "uspi" 
> is, so you should better reduce the userspace visibility of this header.

We had this come up before and the header should not be exported to
userspace at all.  It documents the ufs ondisk structures which are

  a) not a user/kernel interface
  b) may change frequently due to addition of another ufs subvariant.

The only non-kernel user of this known to me is silo, which should just
have it's own header documenting the solaris sparc ufs variant it needs
to understand, possibly by using a copy of the kernel version at any
given point of time.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [patch] linux/ufs_fs.h: use __u64 for userspace
  2008-01-02  7:50   ` Christoph Hellwig
@ 2008-01-02  8:04     ` David Miller
  2008-01-02  8:10       ` Christoph Hellwig
  2008-01-02 13:40       ` [patch] linux/ufs_fs.h: do not export to userspace anymore Mike Frysinger
  0 siblings, 2 replies; 6+ messages in thread
From: David Miller @ 2008-01-02  8:04 UTC (permalink / raw)
  To: hch; +Cc: bunk, vapier, akpm, linux-kernel

From: Christoph Hellwig <hch@infradead.org>
Date: Wed, 2 Jan 2008 07:50:33 +0000

> The only non-kernel user of this known to me is silo, which should just
> have it's own header documenting the solaris sparc ufs variant it needs
> to understand, possibly by using a copy of the kernel version at any
> given point of time.

And this is what the current SILO sources do.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [patch] linux/ufs_fs.h: use __u64 for userspace
  2008-01-02  8:04     ` David Miller
@ 2008-01-02  8:10       ` Christoph Hellwig
  2008-01-02 13:40       ` [patch] linux/ufs_fs.h: do not export to userspace anymore Mike Frysinger
  1 sibling, 0 replies; 6+ messages in thread
From: Christoph Hellwig @ 2008-01-02  8:10 UTC (permalink / raw)
  To: David Miller; +Cc: hch, bunk, vapier, akpm, linux-kernel

On Wed, Jan 02, 2008 at 12:04:44AM -0800, David Miller wrote:
> From: Christoph Hellwig <hch@infradead.org>
> Date: Wed, 2 Jan 2008 07:50:33 +0000
> 
> > The only non-kernel user of this known to me is silo, which should just
> > have it's own header documenting the solaris sparc ufs variant it needs
> > to understand, possibly by using a copy of the kernel version at any
> > given point of time.
> 
> And this is what the current SILO sources do.

Nice.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [patch] linux/ufs_fs.h: do not export to userspace anymore
  2008-01-02  8:04     ` David Miller
  2008-01-02  8:10       ` Christoph Hellwig
@ 2008-01-02 13:40       ` Mike Frysinger
  1 sibling, 0 replies; 6+ messages in thread
From: Mike Frysinger @ 2008-01-02 13:40 UTC (permalink / raw)
  To: David Miller; +Cc: hch, bunk, akpm, linux-kernel

On Wednesday 02 January 2008, David Miller wrote:
> From: Christoph Hellwig <hch@infradead.org>
> > The only non-kernel user of this known to me is silo, which should just
> > have it's own header documenting the solaris sparc ufs variant it needs
> > to understand, possibly by using a copy of the kernel version at any
> > given point of time.
>
> And this is what the current SILO sources do.

then if silo has gotten its stuff together ...
---
Do not export linux/ufs_fs.h to userspace anymore as the only userspace
consumer has been fixed to not need it anymore.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
diff --git a/include/linux/Kbuild b/include/linux/Kbuild
index f30fa92..fd2570f 100644
--- a/include/linux/Kbuild
+++ b/include/linux/Kbuild
@@ -336,7 +336,6 @@ unifdef-y += tty.h
 unifdef-y += types.h
 unifdef-y += udf_fs_i.h
 unifdef-y += udp.h
-unifdef-y += ufs_fs.h
 unifdef-y += uinput.h
 unifdef-y += uio.h
 unifdef-y += unistd.h
diff --git a/include/linux/ufs_fs.h b/include/linux/ufs_fs.h
index 10b854d..46e4a8d 100644
--- a/include/linux/ufs_fs.h
+++ b/include/linux/ufs_fs.h
@@ -35,16 +35,10 @@
 #include <linux/stat.h>
 #include <linux/fs.h>
 
-#ifndef __KERNEL__
-typedef __u64 __fs64;
-typedef __u32 __fs32;
-typedef __u16 __fs16;
-#else
 #include <asm/div64.h>
 typedef __u64 __bitwise __fs64;
 typedef __u32 __bitwise __fs32;
 typedef __u16 __bitwise __fs16;
-#endif
 
 #define UFS_BBLOCK 0
 #define UFS_BBSIZE 8192

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-01-02 13:41 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-02  1:51 [patch] linux/ufs_fs.h: use __u64 for userspace Mike Frysinger
2008-01-02  2:02 ` Adrian Bunk
2008-01-02  7:50   ` Christoph Hellwig
2008-01-02  8:04     ` David Miller
2008-01-02  8:10       ` Christoph Hellwig
2008-01-02 13:40       ` [patch] linux/ufs_fs.h: do not export to userspace anymore Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox