From: Arnd Bergmann <arnd@arndb.de>
To: jaredeh@gmail.com
Cc: Linux-kernel@vger.kernel.org, linux-embedded@vger.kernel.org,
linux-mtd <linux-mtd@lists.infradead.org>,
"Jörn Engel" <joern@logfs.org>,
tim.bird@am.sony.com, cotte@de.ibm.com, nickpiggin@yahoo.com.au
Subject: Re: [PATCH 03/10] AXFS: axfs.h
Date: Thu, 21 Aug 2008 13:31:35 +0200 [thread overview]
Message-ID: <200808211331.36346.arnd@arndb.de> (raw)
In-Reply-To: <48AD00E6.2070505@gmail.com>
On Thursday 21 August 2008, Jared Hulbert wrote:
>
> +#ifndef __AXFS_H
> +#define __AXFS_H
> +
> +
> +#ifdef __KERNEL__
> +#include <linux/rwsem.h>
> +#endif
> +#include <linux/errno.h>
> +#include <linux/time.h>
> +
> +#define AXFS_MAGIC 0x48A0E4CD /* some random number */
> +#define AXFS_SIGNATURE "Advanced XIP FS"
> +#define AXFS_MAXPATHLEN 255
> +
> +/* Uncompression interfaces to the underlying zlib */
> +int axfs_uncompress_block(void *, int, void *, int);
> +int axfs_uncompress_init(void);
> +int axfs_uncompress_exit(void);
You already have both __KERNEL__ and user space parts in your header.
Function declarations clearly don't belong in the user visible parts.
I suggest you only leave on-disk data structure definitions and user
interfaces in the user-visible include/linux/axfs.h file, and move
all internal interfaces to fs/axfs/axfs.h.
> +/*
> + * on media struct describing a data region
> + */
> +struct axfs_region_desc_onmedia {
> + u64 fsoffset;
> + u64 size;
> + u64 compressed_size;
> + u64 max_index;
> + u8 table_byte_depth;
> + u8 incore;
> +};
For on-disk data structures, I would use __be64 or __le64 types,
preferrably the opposite of your native CPU byte order on the system
you are developing most code on, to make sure that you get endianess
right.
> +#define AXFS_PAGE_SIZE 4096
What happens on systems where AXFS_PAGE_SIZE != PAGE_SIZE?
> +#ifndef TRUE
> +#define TRUE 1
> +#endif
> +#ifndef FALSE
> +#define FALSE 0
> +#endif
> +
These are already defined in <linux/kernel.h>, so please use the
existing definitions.
Arnd <><
next prev parent reply other threads:[~2008-08-21 11:31 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-21 5:45 [PATCH 03/10] AXFS: axfs.h Jared Hulbert
2008-08-21 7:51 ` Carsten Otte
2008-08-21 11:31 ` Arnd Bergmann [this message]
2008-08-21 20:05 ` Jared Hulbert
2008-08-21 12:24 ` Arnd Bergmann
2008-08-21 22:40 ` Jared Hulbert
2008-08-22 11:27 ` Arnd Bergmann
2008-08-22 12:04 ` Geert Uytterhoeven
2008-08-22 18:12 ` Jared Hulbert
2008-08-21 13:10 ` Daniel Walker
2008-08-21 20:07 ` Jared Hulbert
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=200808211331.36346.arnd@arndb.de \
--to=arnd@arndb.de \
--cc=Linux-kernel@vger.kernel.org \
--cc=cotte@de.ibm.com \
--cc=jaredeh@gmail.com \
--cc=joern@logfs.org \
--cc=linux-embedded@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=nickpiggin@yahoo.com.au \
--cc=tim.bird@am.sony.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;
as well as URLs for NNTP newsgroup(s).