linux-embedded.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sam Ravnborg <sam@ravnborg.org>
To: Marco <marco.stornelli@gmail.com>
Cc: Linux FS Devel <linux-fsdevel@vger.kernel.org>,
	Linux Embedded <linux-embedded@vger.kernel.org>,
	Linux Kernel <linux-kernel@vger.kernel.org>,
	Daniel Walker <dwalker@soe.ucsc.edu>
Subject: Re: [PATCH 06/14] Pramfs: Include files
Date: Sat, 13 Jun 2009 16:04:59 +0200	[thread overview]
Message-ID: <20090613140459.GC30053@uranus.ravnborg.org> (raw)
In-Reply-To: <4A33A7EC.6070008@gmail.com>

On Sat, Jun 13, 2009 at 03:21:48PM +0200, Marco wrote:
> From: Marco Stornelli <marco.stornelli@gmail.com>
> 
> Include files.
> 
> Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>
> ---
> 
> diff -uprN linux-2.6.30-orig/fs/pramfs/pram_fs.h linux-2.6.30/fs/pramfs/pram_fs.h
> --- linux-2.6.30-orig/fs/pramfs/pram_fs.h	1970-01-01 01:00:00.000000000 +0100
> +++ linux-2.6.30/fs/pramfs/pram_fs.h	2009-06-13 12:58:49.000000000 +0200
> @@ -0,0 +1,388 @@
> +/*
> + * FILE NAME include/linux/pram_fs.h
> + *
> + * BRIEF DESCRIPTION
> + *
> + * Definitions for the PRAMFS filesystem.
> + *
> + * Copyright 2009 Marco Stornelli <marco.stornelli@gmail.com>
> + * Copyright 2003 Sony Corporation
> + * Copyright 2003 Matsushita Electric Industrial Co., Ltd.
> + * 2003-2004 (c) MontaVista Software, Inc. , Steve Longerbeam
> + * This file is licensed under the terms of the GNU General Public
> + * License version 2. This program is licensed "as is" without any
> + * warranty of any kind, whether express or implied.
> + */
> +#ifndef _LINUX_PRAM_FS_H
> +#define _LINUX_PRAM_FS_H
> +
> +#include <linux/types.h>
> +
> +#ifdef __KERNEL__
> +#include <linux/sched.h>
> +#include <linux/buffer_head.h>
> +#include "pram_fs_sb.h"
> +#endif

The only reason to have this header file in include/linux/
is that it is used by userspace.
So please split it up so we have one header suitable for exporting
and another header with all the promfs local stuff.
The latter should be in fs/pramsfs/


> +
> +/*
> + * The PRAM filesystem constants/structures
> + */
> +
> +/*
> + * Define PRAMFS_DEBUG to produce debug messages
> + */
> +#define PRAMFS_DEBUG
> +
> +/*
> + * Debug code
> + */
> +#ifdef __KERNEL__
> +#define PFX "pramfs"
> +#ifdef PRAMFS_DEBUG
> +#define pram_dbg(format, arg...) \
> +    printk(KERN_DEBUG PFX ": " format , ## arg)
> +#else
> +#define pram_dbg(format, arg...) do {} while (0)
> +#endif
> +#define pram_err(format, arg...) \
> +    printk(KERN_ERR PFX ": " format , ## arg)
> +#define pram_info(format, arg...) \
> +    printk(KERN_INFO PFX ": " format , ## arg)
> +#define pram_warn(format, arg...) \
> +    printk(KERN_WARNING PFX ": " format , ## arg)
> +#endif

For a typical drivers we have some pr_* to avoid the above.
Can they be used for a filesystem too?

> +
> +/*
> + * The PRAM file system magic number
> + */
> +#define PRAM_SUPER_MAGIC	0xEFFA

Move to include/linux/magic.h

> +
> +/*
> + * Structure of an inode in PRAMFS
> + */
> +struct pram_inode {
> +	__u32   i_sum;          /* checksum of this inode */
> +	__u32	i_uid;		/* Owner Uid */
> +	__u32	i_gid;		/* Group Id */
> +	__u16	i_mode;		/* File mode */
> +	__u16	i_links_count;	/* Links count */
> +	__u32	i_blocks;	/* Blocks count */
> +	__u32	i_size;		/* Size of data in bytes */
> +	__u32	i_atime;	/* Access time */
> +	__u32	i_ctime;	/* Creation time */
> +	__u32	i_mtime;	/* Modification time */
> +	__u32	i_dtime;	/* Deletion Time */
> +
> +	union {
> +		struct {
> +			/*
> +			 * ptr to row block of 2D block pointer array,
> +			 * file block #'s 0 to (blocksize/4)^2 - 1.
> +			 */
> +			off_t row_block;

It is my understanding that we shall use: __kernel_off_t
in exported headers.

The headers are not added to Kbuild - so it is not exported.
I assume thats an oversight.

	Sam

  reply	other threads:[~2009-06-13 14:04 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-13 13:21 [PATCH 06/14] Pramfs: Include files Marco
2009-06-13 14:04 ` Sam Ravnborg [this message]
2009-06-13 22:59   ` Arnd Bergmann
2009-06-14  7:15     ` Marco
2009-06-21 17:07     ` Marco
2009-06-21 20:22       ` Arnd Bergmann
2009-06-22  6:23         ` Marco Stornelli
2009-06-22 11:17           ` Arnd Bergmann
2009-06-22 18:05             ` Marco
2009-06-22 18:33               ` Arnd Bergmann
2009-06-22 19:31                 ` Chris Simmonds
2009-06-22 20:30                   ` Sam Ravnborg
2009-06-22 22:00                     ` Tim Bird
2009-06-23  4:21                       ` Sam Ravnborg
2009-06-23 17:38                         ` Marco
2009-06-23 19:26                           ` Jörn Engel
2009-06-23 21:15                             ` David Woodhouse
2009-06-23 21:55                               ` Arnd Bergmann
2009-06-24  6:32                                 ` Marco Stornelli
2009-06-24 15:30                                   ` Arnd Bergmann
2009-06-24 16:49                                     ` Marco
2009-06-22 21:41                   ` Jörn Engel
2009-06-22 22:20                     ` David Woodhouse
2009-06-23  5:57                       ` Jörn Engel
2009-06-23  8:31                         ` David Woodhouse
2009-06-22 23:07                     ` Arnd Bergmann
2009-06-23  6:40                 ` Marco Stornelli
2009-06-14  7:15   ` Marco

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=20090613140459.GC30053@uranus.ravnborg.org \
    --to=sam@ravnborg.org \
    --cc=dwalker@soe.ucsc.edu \
    --cc=linux-embedded@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marco.stornelli@gmail.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).