Messages in this thread | | | From | Andries.Brouwer@cwi ... | Date | Fri, 18 Apr 2003 10:38:12 +0200 (MEST) | Subject | Re: [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/
| |