lkml.org 
[lkml]   [2003]   [Apr]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] struct loop_info
    From: Andreas Dilger <adilger@clusterfs.com>

> 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).

I replaced the dev_t's by the actual thing they were typedef'd to.
That is guaranteed to preserve correctness.

> 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?

Yes, a bit ugly. I could have saved kernel source (20 small files)
by using __legacy_dev_t in loop.h, with a typedef of __legacy_dev_t
in <asm/posix_types.h>.

Maybe I should have done that. The reason I did what I did is
that all these defined types give lots of complications in
user space code. Maintainability of the union of kernel and
user space source is increased by just saying explicitly
what these types are.

Andries
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:34    [W:0.025 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site